:root, html[data-theme="dark"] {
  --bg: #0b0f14;
  --bg2: #1b2838;
  --panel: #121922;
  --panel2: #182230;
  --line: #243044;
  --text: #e8eef6;
  --muted: #8fa3b8;
  --accent: #ff6b35;
  --ok: #22c55e;
  --warn: #f0c14e;
  --input: #0d141c;
  --header: rgba(12, 18, 26, 0.8);
  --menu: #101820;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
html[data-theme="light"] {
  --bg: #e8eef4;
  --bg2: #d5e3ee;
  --panel: #ffffff;
  --panel2: #f1f5f9;
  --line: #cdd7e3;
  --text: #15202b;
  --muted: #5b6b7c;
  --accent: #e85d2c;
  --ok: #16a34a;
  --warn: #ca8a04;
  --input: #ffffff;
  --header: rgba(255, 255, 255, 0.92);
  --menu: #f8fafc;
  --shadow: 0 18px 40px rgba(30, 50, 70, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: radial-gradient(1200px 600px at 10% -10%, var(--bg2) 0%, var(--bg) 55%); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }

.hidden { display: none !important; }

#auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(160deg, rgba(8, 10, 16, 0.35) 0%, rgba(8, 10, 16, 0.55) 100%),
    url("../assets/login-bg.jpg") center / cover no-repeat fixed;
}
.auth-card {
  width: min(420px, 100%);
  background: rgba(16, 28, 32, 0.62);
  border: 1px solid rgba(180, 220, 210, 0.18);
  border-radius: 24px;
  padding: 32px 28px 22px;
  box-shadow: 0 24px 60px rgba(8, 24, 28, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #f4f8fc;
}
.auth-card h1 {
  margin: 0 0 4px;
  font-size: 1.5rem;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
.auth-card .lead,
.auth-card .copyright,
.auth-card label,
.auth-card .note {
  color: #c9d8e6;
}
.auth-card input,
.auth-card select,
.auth-card textarea {
  background: rgba(8, 14, 20, 0.72);
  color: #f4f8fc;
  border-color: rgba(180, 220, 210, 0.28);
}
.brand.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 52px;
  margin-bottom: 18px;
  padding: 0 52px;
}
.brand.auth-brand .logo {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}
.brand.auth-brand .auth-brand-text { text-align: center; width: 100%; }
.brand.auth-brand h1 {
  margin: 0;
  white-space: nowrap;
  font-size: clamp(1.2rem, 5.4vw, 1.5rem);
}
.brand.auth-brand .lead { margin: 2px 0 0; text-align: center; white-space: nowrap; }
.copyright {
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  margin: 18px 0 0;
}
.copyright a { color: inherit; text-decoration: underline; }
.moved-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.moved-screen.hidden { display: none !important; }
.moved-card {
  max-width: 420px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 22px;
  box-shadow: var(--shadow);
}
.moved-card h1 { margin: 12px 0 10px; font-size: 1.6rem; }
.moved-card .logo { margin: 0 auto 4px; }
.moved-link { color: var(--ok); font-weight: 800; word-break: break-all; }
.moved-go { display: inline-block; margin-top: 16px; text-decoration: none; padding: 12px 22px; border-radius: 999px; }
.id-lock-box {
  background: #4b5563;
  color: #f9fafb;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  margin: 4px 0 8px;
}
.id-lock-box p { margin: 2px 0; }
html[data-theme="light"] .id-lock-box {
  background: #d1d5db;
  color: #111;
}
.brand { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 8px; }
.brand-text {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
}
.brand-title { display: block; line-height: 1.15; }
.app-header .brand { align-items: flex-start; }
.logo {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, #ff6b35, #f0c14e);
  display: grid; place-items: center; font-weight: 800; color: #111;
  border: 0;
}
.logo-btn { cursor: pointer; }
.logo-btn:hover { filter: brightness(1.08); }

.lead { color: var(--muted); margin: 0 0 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tabs button, .ghost, .primary, .danger, .ok {
  border: 0; border-radius: 14px; padding: 12px 14px; font-weight: 700;
  transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.tabs button { flex: 1; background: var(--panel2); color: var(--muted); }
.primary:hover, .ok:hover, .danger:hover, .ghost:hover { filter: brightness(1.05); }
.primary:active, .ok:active, .danger:active, .ghost:active { transform: translateY(1px); }
.tabs button.active { background: var(--line); color: var(--text); }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 10px 0 6px; }
input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--input); color: var(--text);
}
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.pass-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; color: var(--muted); padding: 6px; border-radius: 8px;
}
.pass-toggle:hover { color: var(--text); }
.pass-toggle.on { color: var(--accent); }
#admin-toggle { width: 100%; margin-top: 0; background: #243044; color: #f0c14e; }
.linkish {
  display: block; width: 100%; margin-top: 12px; background: none; border: 0;
  color: #9ec9c0; text-decoration: underline; padding: 0; text-align: center;
}
.admin-modal {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.55); display: grid; place-items: center; padding: 16px;
}
.admin-modal.hidden { display: none !important; }
.admin-dialog {
  width: min(920px, 100%); max-height: min(90vh, 900px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow); padding: 18px 20px 24px;
}
.admin-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.admin-head h2 { margin: 0; }
.admin-body { display: grid; gap: 22px; }
.admin-body section { background: var(--panel2); border-radius: 16px; padding: 14px; }
.admin-body .ghost,
.admin-dialog .ghost {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
html[data-theme="light"] .admin-body .ghost,
html[data-theme="light"] .admin-dialog .ghost {
  background: #e8eef5; color: #15202b; border-color: #b8c5d4;
}
.admin-body .primary,
.admin-dialog .primary {
  background: linear-gradient(180deg, #ff8a4c, var(--accent));
  color: #111;
}
.admin-body .ok,
.admin-dialog .ok {
  background: linear-gradient(180deg, #34d399, var(--ok));
  color: #06210f;
}
.admin-body .danger,
.admin-dialog .danger {
  background: linear-gradient(180deg, #5a2424, #3a1b1b);
  color: #ffb4b4; border: 1px solid #7f2d2d;
}
.admin-fold > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.05rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-fold > summary::-webkit-details-marker { display: none; }
.admin-fold > summary::after { content: "▸"; color: var(--muted); font-size: 0.9rem; }
.admin-fold[open] > summary::after { content: "▾"; }
.admin-people-search {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.admin-people-search input { flex: 1; margin: 0; }
.admin-people-search button { width: auto; margin: 0; flex: 0 0 auto; }
.admin-people-filters {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px;
}
.admin-filter {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 999px; padding: 6px 10px; font-size: 0.75rem; font-weight: 800;
}
.admin-filter.on {
  background: linear-gradient(180deg, #ff8a4c, var(--accent));
  color: #111; border-color: transparent;
}
.admin-user-row { align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-user-face {
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--panel); font-size: 1.2rem; border: 1px solid var(--line);
}
.admin-user-main { flex: 1; min-width: 140px; }
#admin-users-view #admin-users {
  max-height: min(58vh, 480px);
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}
.temp-pass { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.12em; color: #f0c14e; }
.primary {
  width: 100%; margin-top: 16px;
  background: linear-gradient(180deg, #ff8a4c, var(--accent));
  color: #111; font-weight: 800;
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.28);
}
.error { color: #ff6b6b; min-height: 1.2em; font-size: 0.9rem; }

.request-alert {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  background: #3a2a12; color: #ffd7a0; border-bottom: 1px solid #f0c14e;
  padding: 10px 16px; font-weight: 700; text-align: center;
}
.request-alert.hidden { display: none !important; }

.app-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 24, 32, 0.94), rgba(12, 18, 26, 0.88));
  backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 12;
}
html[data-theme="light"] .app-header {
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.9));
}
.app-header .brand strong { letter-spacing: -0.02em; }
.place-toolbar { width: 100%; }
.place-toolbar .seg { max-width: 420px; }
.userbox { display: flex; gap: 10px; align-items: center; }
.header-feed {
  flex: 1; justify-content: flex-end; min-width: 0; max-width: min(520px, 58vw);
}
.header-feed .feed-item {
  margin: 0; padding: 8px 12px; font-size: 0.8rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.side-menu { display: flex; flex-direction: column; }
.help-btns {
  display: grid; gap: 8px; margin: 4px 0 14px;
}
.help-btn {
  width: 100%; justify-content: flex-start; gap: 8px; font-weight: 800;
  border-radius: 16px; padding: 13px 14px; text-align: left;
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
html[data-theme="light"] .help-btn {
  background: #eef3f8; border-color: #c5d0dc;
}
.faq-dialog, .report-dialog { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--line); border-radius: 14px; background: var(--panel2); overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 12px 14px; font-weight: 800; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "▾"; float: right; color: var(--muted); }
.faq-item[open] summary::after { content: "▴"; }
.faq-a {
  margin: 0; padding: 0 14px 14px; color: var(--muted); font-size: 0.92rem; line-height: 1.45;
}
.report-dialog textarea {
  width: 100%; min-height: 120px; resize: vertical; margin: 8px 0 10px;
  box-sizing: border-box;
}
.admin-bugs-sub {
  margin: 14px 0 8px; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 800;
}
#admin-user-reports,
#admin-bugs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
#admin-user-reports .report-card,
#admin-bugs .friend-card {
  display: block;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
}
.report-card .report-msg {
  display: block;
  margin: 0 0 8px;
  font-weight: 700;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.report-card .report-meta {
  display: block;
  margin: 0;
}
.report-count { margin: 0 0 8px; text-align: right; }
.report-card.unread {
  border-color: #f59e0b88;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18);
}
.side-menu #admin-section { position: relative; }
#admin-bugs-n {
  position: absolute; top: 6px; right: 8px; background: #dc2626;
}
.logout-bar {
  margin-top: auto; flex-shrink: 0;
  padding: 28px 16px 22px; border-top: 1px solid var(--line);
}
#panel-cuenta { padding-bottom: 28px; }
#twofa-off .ok { margin-bottom: 12px; }
.logout-btn {
  width: 100%; margin: 0; border: 0; border-radius: 14px;
  padding: 14px 16px; font-weight: 800; font-size: 0.95rem;
  background: linear-gradient(180deg, #3f2228, #2a1518);
  color: #fecaca; box-shadow: 0 8px 18px rgba(80, 20, 30, 0.25);
}
.logout-btn:hover { filter: brightness(1.08); }
html[data-theme="light"] .logout-btn {
  background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3;
  box-shadow: none;
}
.side-menu > .danger { width: 100%; margin-top: auto; flex-shrink: 0; }
.friend-card .danger.small {
  width: auto; padding: 4px 8px; font-size: 0.72rem; line-height: 1.2; margin: 0;
}
.ghost {
  background: var(--panel); color: var(--text);
  border: 1px solid var(--line);
}
html[data-theme="light"] .ghost {
  background: #eef3f8; color: var(--text); border-color: #c5d0dc;
}
.danger {
  background: linear-gradient(180deg, #5a2424, #3a1b1b);
  color: #ffb4b4; border: 1px solid #7f2d2d;
  font-weight: 800;
}
.danger.small { border-radius: 10px; }

main { max-width: 1180px; margin: 0 auto; padding: 22px; }

.friend-feed { display: grid; gap: 8px; }
.feed-item {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; font-size: 0.92rem;
}
.feed-item strong { color: var(--accent); }
.feed-item .when { color: var(--muted); font-size: 0.8rem; margin-left: 6px; }
.feed-item.done { border-color: #1f6b3a; }

/* connected-box layout is defined with the connected-chip styles below */
.header-feed { display: none; }
.header-icons { display: flex; gap: 6px; align-items: center; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.header-icons .icon-btn { font-size: 1.2rem; position: relative; }
.donate-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; font-weight: 800; border-radius: 999px;
  color: #003087;
  background: #fff;
  border: 1px solid #c5d4e8;
  box-shadow: 0 6px 16px rgba(0, 48, 135, 0.12);
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}
.donate-btn:hover {
  transform: translateY(-1px);
  border-color: #009cde;
  box-shadow: 0 10px 22px rgba(0, 112, 186, 0.18);
}
.donate-btn:active { transform: translateY(0); }
.pp-logo {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center; background: #f3f8ff;
}
.pp-logo svg { display: block; }
.donate-label { font-size: 0.84rem; letter-spacing: -0.01em; }
.donate-header {
  height: 36px; padding: 0 12px 0 6px; white-space: nowrap;
}
html[data-theme="dark"] .donate-btn {
  background: #f7fbff; color: #003087;
}
html[data-theme="light"] .donate-btn {
  background: #ffffff; color: #003087;
}
.hdr-n {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: #16a34a; color: #fff; font-size: 0.65rem; font-weight: 800;
  display: grid; place-items: center; line-height: 1;
}
.hdr-n.hidden { display: none !important; }
.period-btn { color: #ec4899; font-size: 1.28rem; }
.hdr-period-n { background: #db2777; top: 0; right: 0; }
.period-btn.off, .period-btn:disabled {
  opacity: 0.28; filter: grayscale(0.35); pointer-events: none; cursor: default;
}
.period-btn.off .hdr-period-n,
.period-btn:disabled .hdr-period-n { opacity: 1; filter: none; }
.period-dialog {
  background: linear-gradient(180deg, #3b1730 0%, #1a0f18 100%);
  border: 1px solid #f9a8d455;
  box-shadow: 0 24px 60px rgba(80, 10, 40, 0.45);
}
html[data-theme="light"] .period-dialog {
  background: linear-gradient(180deg, #fff1f7 0%, #fdf2f8 100%);
  border-color: #f9a8d4;
}
#period-title {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
}
html[data-theme="light"] #period-title { color: #111; }
.period-tab {
  border: 1px solid #f9a8d466;
  background: transparent;
  color: #fce7f3;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
}
.period-tab.on {
  background: #fde68a;
  color: #1a1304;
  border-color: #fde68a;
}
html[data-theme="light"] .period-tab { color: #9d174d; border-color: #f9a8d4; }
html[data-theme="light"] .period-tab.on { background: #facc15; color: #1a1304; }
.period-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  background: #3b1c2a;
  padding: 12px;
  border-radius: 18px;
}
html[data-theme="light"] .period-grid { background: #fce7f3; }
.period-wd {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #111;
  letter-spacing: 0.06em;
  padding: 2px 0 6px;
}
.period-pad { min-height: 44px; }
.period-cell {
  aspect-ratio: 1;
  min-height: 0;
  border: 0;
  border-radius: 12px;
  background: #4a2436;
  color: #fce7f3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-weight: 700;
  padding: 2px;
  overflow: hidden;
}
.period-cell .pnum { font-size: 0.85rem; line-height: 1; }
.period-cell .drop { font-size: 0.55rem; line-height: 1; letter-spacing: -2px; max-width: 100%; overflow: hidden; white-space: nowrap; }
html[data-theme="light"] .period-cell { background: #fbcfe8; color: #831843; }
.period-cell.bleed { background: #e11d48; color: #fff; }
.period-cell.sel {
  outline: 3px solid #38bdf8;
  box-shadow: 0 0 0 2px #0b1220;
  z-index: 1;
  position: relative;
}
.period-cell.pred {
  background: #3b1524; color: #fda4af; box-shadow: inset 0 0 0 2px #f472b6;
}
html[data-theme="light"] .period-cell.pred {
  background: #fce7f3; color: #9d174d; box-shadow: inset 0 0 0 2px #f9a8d4;
}
#period-predict { color: #fff; font-weight: 500; margin: 6px 0 8px; line-height: 1.4; }
#period-predict .period-reg {
  display: inline-block;
  background: #d1d5db;
  color: #111;
  font-weight: 800;
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0 6px 6px 0;
}
#period-predict .period-est { color: #fff; }
html[data-theme="light"] #period-predict,
html[data-theme="light"] #period-predict .period-est { color: #111; }
.period-share-modern { margin-top: 16px; }
.period-share-modern > .ghost { width: 100%; border-radius: 999px; }
.period-invite-row { display: flex; gap: 8px; margin-top: 10px; }
.period-invite-row select { flex: 1; }
.period-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel2); border-radius: 999px; padding: 8px 12px; margin: 6px 0;
}
.sym-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.sym-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin: 0;
  min-height: 68px;
  padding: 8px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
  color: var(--text);
  width: 100%;
  height: auto;
  font-size: 1.2rem;
}
.sym-chip small {
  font-size: 0.62rem;
  line-height: 1.15;
  text-align: center;
  color: var(--muted);
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 1.5em;
}
.sym-chip.on { border-color: #f472b6; background: #3b1524; }
.sym-chip.on small { color: #fbcfe8; }
.sym-read {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.sym-cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 1.2rem;
  text-align: center;
}
.sym-cap small { font-size: 0.62rem; color: var(--muted); line-height: 1.15; }
.period-cell.today { box-shadow: inset 0 0 0 2px #38bdf8; font-weight: 900; }
.period-week { min-height: 18px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; align-items: center; }
.pw-drop { font-size: 0.85rem; }
.pw-drop.pred { opacity: 0.55; }
.pw-em { font-size: 0.72rem; }
html[data-theme="light"] .period-cell.bleed { background: #fb7185; color: #881337; }
.period-menu.off, .period-menu:disabled { opacity: 0.35; pointer-events: none; }
.period-day { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.period-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.period-dialog { max-height: 92vh; overflow: auto; }
.period-cell.today .pnum { text-decoration: underline; text-underline-offset: 2px; }
.theme-toggle { font-size: 1.25rem; }
.theme-toggle .theme-ico { display: none; }
html[data-theme="dark"] .theme-toggle .sun { display: inline; }
html[data-theme="light"] .theme-toggle .moon { display: inline; }

.period-nav-mid { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
#period-label { color: #fff; }
html[data-theme="light"] #period-label { color: #111; }
.period-hoy-chip {
  border: 0; border-radius: 999px; padding: 5px 14px; font-size: 0.78rem; font-weight: 800;
  background: #facc15; color: #1a1304;
  letter-spacing: 0.04em; cursor: pointer; box-shadow: 0 4px 14px rgba(250, 204, 21, 0.4);
}
#period-share-go {
  background: #facc15; color: #1a1304; border: 0; font-weight: 800;
}
.period-hoy-chip:active { transform: scale(0.96); }
.day-edit-card, .alarms-card { max-width: 420px; }
.day-edit-card h2 { margin: 0 0 6px; }
.day-edit-actions { display: grid; gap: 8px; margin-top: 16px; }
.day-edit-alarm {
  display: flex; align-items: flex-start; gap: 10px; margin-top: 14px;
  padding: 12px; border-radius: 14px; background: #163024; border: 1px solid #22c55e66;
  cursor: pointer;
}
html[data-theme="light"] .day-edit-alarm { background: #ecfdf3; border-color: #86efac; }
.day-edit-alarm input { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.day-edit-alarm.hidden { display: none !important; }
.alarm-how {
  background: var(--panel2); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px;
  font-size: 0.88rem; line-height: 1.45;
}
.alarm-how p { margin: 4px 0; }
.alarm-card {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 16px; padding: 14px 16px; margin: 10px 0;
}
.alarm-card.hot { background: #3f1216; border: 1px solid #ef4444; }
.alarm-card.warm { background: #3b2610; border: 1px solid #f97316; }
.alarm-card.cool { background: #163024; border: 1px solid #22c55e; }
html[data-theme="light"] .alarm-card.hot { background: #fee2e2; border-color: #ef4444; }
html[data-theme="light"] .alarm-card.warm { background: #ffedd5; border-color: #f97316; }
html[data-theme="light"] .alarm-card.cool { background: #ecfdf3; border-color: #86efac; }
#period-note { margin: 16px 0 0; opacity: 0.85; line-height: 1.45; }
.period-leave-link {
  display: inline; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 800; color: #f9a8d4; text-decoration: underline;
  text-underline-offset: 3px;
}
html[data-theme="light"] .period-leave-link { color: #be185d; }
.app-confirm-card {
  width: min(420px, 100%); text-align: center; padding: 22px 20px;
  background: linear-gradient(180deg, #3b1730 0%, #1a0f18 100%);
  border: 1px solid #f9a8d455;
}
html[data-theme="light"] .app-confirm-card {
  background: linear-gradient(180deg, #fff1f7 0%, #fdf2f8 100%);
  border-color: #f9a8d4;
}
.app-confirm-name {
  margin: 0 0 12px; font-size: 1.55rem; font-weight: 900; letter-spacing: -0.02em;
  color: #fce7f3; line-height: 1.2;
}
html[data-theme="light"] .app-confirm-name { color: #9d174d; }
.app-confirm-name.hidden { display: none !important; }
.app-confirm-msg {
  margin: 0 0 18px; font-size: 0.95rem; color: var(--muted); line-height: 1.45;
}
.app-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.app-confirm-actions .ok, .app-confirm-actions .ghost { width: 100%; font-weight: 800; }
.cal-dialog {
  background: linear-gradient(180deg, #152033 0%, #101820 42%, #0d141c 100%);
  border: 1px solid #2a3b55;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  max-width: min(560px, 100%);
}
html[data-theme="light"] .cal-dialog {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 55%, #eef3f8 100%);
  border-color: #d5deea;
  box-shadow: 0 24px 50px rgba(30, 50, 70, 0.14);
}
.cal-head { align-items: flex-start; margin-bottom: 14px; }
.cal-head h2 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; }
.cal-kicker {
  margin: 0 0 2px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
}
.cal-nav {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px;
  padding: 8px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid var(--line);
}
html[data-theme="light"] .cal-nav { background: #fff; }
.cal-nav-btn {
  width: 40px; height: 40px; border-radius: 12px; padding: 0;
  display: grid; place-items: center; font-size: 1.1rem;
}
#cal-label { text-transform: capitalize; font-size: 1.02rem; }
.cal-legend { font-size: 0.8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.cal-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 999px; font-weight: 700; font-size: 0.78rem;
  border: 1px solid var(--line); background: rgba(255,255,255,0.03);
}
.cal-pill.went { color: #86efac; border-color: #22c55e44; background: #16351f88; }
.cal-pill.missed { color: #fca5a5; border-color: #ef444444; background: #3a1b1b88; }
html[data-theme="light"] .cal-pill.went { color: #166534; background: #dcfce7; }
html[data-theme="light"] .cal-pill.missed { color: #b91c1c; background: #fee2e2; }
#cal-miles-total {
  font-weight: 800; color: var(--ok); font-size: 0.92rem; margin: 0 0 12px;
  padding: 8px 12px; border-radius: 12px; background: #16351f66; border: 1px solid #22c55e33;
}
html[data-theme="light"] #cal-miles-total { background: #ecfdf3; border-color: #86efac; }
.dot-went, .dot-missed { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot-went { background: #22c55e; box-shadow: 0 0 0 3px #22c55e33; }
.dot-missed { background: #ef4444; box-shadow: 0 0 0 3px #ef444433; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(2.4rem, 0.7fr);
  gap: 6px;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.cal-dow {
  font-size: 0.68rem; color: var(--muted); text-align: center; text-transform: uppercase;
  min-width: 0; letter-spacing: 0.04em; font-weight: 800; padding-bottom: 2px;
}
.cal-day {
  min-height: 56px; min-width: 0; border: 1px solid transparent; border-radius: 14px;
  background: rgba(255,255,255,0.03); color: var(--text);
  font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 4px 2px; overflow: hidden; transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}
html[data-theme="light"] .cal-day { background: #f8fafc; border-color: #e8eef5; }
.cal-day:not(.empty):hover { transform: translateY(-1px); border-color: var(--accent); }
.cal-mi { font-size: 0.6rem; font-weight: 800; color: #4ade80; line-height: 1; }
html[data-theme="light"] .cal-mi { color: #15803d; }
.cal-wx { font-size: 0.72rem; line-height: 1; }
.cal-pin { font-size: 0.48rem; font-weight: 700; color: var(--muted); line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-share { margin-top: 14px; }
.cal-share .ok, [data-run-share] { width: 100%; margin: 8px 0 0; border-radius: 14px; padding: 12px 14px; font-weight: 800; }
#cal-share-card {
  padding: 14px 12px 12px; border-radius: 18px;
  background: rgba(8, 14, 22, 0.55); border: 1px solid #2a3b55;
  width: 100%; max-width: 100%; box-sizing: border-box; overflow: hidden;
}
html[data-theme="light"] #cal-share-card { background: #fff; border-color: #dbe4ef; box-shadow: 0 10px 28px rgba(30,50,70,0.06); }
#cal-share-title { margin: 0 0 8px; font-size: 1rem; }
.cal-share-brand {
  display: flex; align-items: center; gap: 10px; color: var(--text); min-width: 0;
}
.cal-brand-mark {
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: grid; place-items: center; color: #111;
  background: linear-gradient(135deg, #ff6b35, #f0c14e);
  box-shadow: 0 8px 18px rgba(255, 107, 53, 0.28);
}
.cal-brand-mark svg { display: block; }
#cal-share-title-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; }
.cal-week-sum {
  display: grid; place-items: center; text-align: center; font-size: 0.62rem; font-weight: 800;
  color: var(--ok); background: rgba(34, 197, 94, 0.1); border: 1px solid #22c55e33;
  border-radius: 12px; padding: 4px 2px; line-height: 1.1;
  min-width: 0; overflow: hidden; word-break: break-word;
}
.cal-day.went {
  background: linear-gradient(180deg, #1d4a2c, #143520);
  color: #bbf7d0; border-color: #22c55e55;
}
html[data-theme="light"] .cal-day.went { background: linear-gradient(180deg, #ecfdf3, #dcfce7); color: #166534; border-color: #86efac; }
.cal-day.missed {
  background: linear-gradient(180deg, #4a2222, #301616);
  color: #fecaca; border-color: #ef444455;
}
html[data-theme="light"] .cal-day.missed { background: linear-gradient(180deg, #fef2f2, #fee2e2); color: #b91c1c; border-color: #fca5a5; }
html[data-theme="light"] .request-alert { background: #fff7ed; color: #9a3412; }
.cal-day.today { box-shadow: 0 0 0 2px var(--accent), 0 8px 18px rgba(255, 107, 53, 0.22); border-color: transparent; }
.cal-day.empty { background: transparent; border-color: transparent; pointer-events: none; }
.id-card {
  margin-top: 16px; background: linear-gradient(135deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-align: center;
}
.id-card-top { display: grid; gap: 4px; margin-bottom: 12px; }
.id-card img { width: 200px; height: 200px; background: #fff; border-radius: 8px; }
select {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--input); color: var(--text);
}
#id-gym option[value="local"], #id-gym.local-pick {
  color: #ef4444; font-weight: 800; background: #3a1b1b;
}
#id-gym.local-pick { border-color: #ef4444; }
.connected-chip {
  background: #16351f; border: 1px solid #22c55e; border-radius: 16px;
  padding: 8px 12px 8px 8px; font-size: 0.78rem; line-height: 1.25;
  display: flex; align-items: center; gap: 10px;
  color: #dcfce7; width: 100%; box-sizing: border-box;
}
.chip-av-wrap {
  position: relative; width: 40px; height: 40px; flex: 0 0 auto;
}
.connected-chip .chip-face {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
  background: #0f1f14; font-size: 1.2rem; border: 1px solid #22c55e55;
}
.connected-chip .chip-face img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
.connected-chip .dot {
  position: absolute; right: -1px; bottom: -1px; margin: 0;
  border: 2px solid #16351f; z-index: 2;
}
.chip-text {
  min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.connected-chip .chip-name {
  font-weight: 800; word-break: break-word; white-space: normal;
}
.connected-chip .chip-extra {
  font-weight: 600; opacity: 0.9; font-size: 0.72rem; word-break: break-word;
}
html[data-theme="light"] .connected-chip {
  background: #dcfce7; border-color: #16a34a; color: #14532d;
}
html[data-theme="light"] .connected-chip .chip-face { background: #ecfdf3; }
html[data-theme="light"] .connected-chip .dot { border-color: #dcfce7; }
.connected-chip .chip-when { font-weight: 600; opacity: 0.9; }
.connected-box { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
#panel-activos .friend-feed .feed-item strong {
  display: block; font-size: 0.78rem; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#panel-activos .friend-feed .feed-item .when { font-size: 0.7rem; }
html[data-theme="light"] .same { color: #15803d; }
html[data-theme="light"] .buddy .go { color: #15803d; }
.buddy {
  background: var(--input); border: 1px dashed var(--line); border-radius: 12px;
  padding: 8px 10px; font-size: 0.82rem; color: var(--text);
}
.buddy .row-f { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0; }
.buddy .go { color: #7ee0a3; }
.buddy .stop { color: #f0c14e; }

.week-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 12px; flex-wrap: wrap; }
.week-nav h2 { margin: 0; font-size: 1.15rem; }
.week-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; justify-content: flex-end; }
.drag-hint { margin: 0 0 12px; text-align: right; }
.day-card.dragging { opacity: 0.45; transform: scale(0.97); }
.day-card.drop-over { outline: 2px dashed var(--accent); background: var(--panel2); }

.week-grid {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 22px;
}
.day-card {
  position: relative;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; min-height: 128px; text-align: left; color: inherit; width: 100%;
  cursor: pointer; touch-action: pan-y; user-select: none;
}
.day-drag {
  position: absolute; top: 8px; right: 6px;
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: grab; touch-action: none;
  display: grid; place-items: center;
}
.day-drag:hover { color: var(--text); background: var(--line); }
.day-card:hover { border-color: var(--line); }
.day-card.today:not(.selected) { outline: 2px solid var(--accent); }
.day-card.selected {
  background: #2a221e;
  border-color: #6b4536;
  color: var(--text);
  box-shadow: none;
}
.day-card.selected .dow,
.day-card.selected .num,
.day-card.selected .tag,
.day-card.selected .tiny { color: inherit; }
.day-card.selected .dow { color: #c4a090; }
.day-card.selected.missed { opacity: 1; }
.day-card.selected .miss-tag { color: #ff8a8a; }
html[data-theme="light"] .day-card.selected {
  background: #eadcd4;
  border-color: #c4a090;
  color: var(--text);
}
html[data-theme="light"] .day-card.selected .dow { color: #7a5a4a; }
.day-card .dow { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.day-card .num { font-size: 1.4rem; font-weight: 800; margin: 4px 0; }
.day-card .tag { font-size: 0.8rem; font-weight: 700; }
.progress-dot { height: 6px; border-radius: 99px; background: var(--line); margin-top: 10px; overflow: hidden; }
.progress-dot span { display: block; height: 100%; background: var(--ok); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.mine-toggle { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.88rem; cursor: pointer; }
.mine-toggle input { width: auto; }
.seg {
  display: flex; background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; gap: 4px;
}
html[data-theme="light"] .seg { background: #fff; }
.seg button {
  background: transparent; color: var(--muted); border: 0; border-radius: 999px;
  padding: 10px 16px; font-weight: 800;
}
.seg button.active {
  background: linear-gradient(180deg, #ff8a4c, var(--accent));
  color: #111; box-shadow: 0 6px 14px rgba(255, 107, 53, 0.28);
}

.day-hero {
  background: linear-gradient(135deg, var(--panel), var(--panel2));
  border: 1px solid var(--line); border-radius: 24px; padding: 22px; margin-bottom: 18px;
}
.day-hero h3 { margin: 0 0 6px; font-size: 1.7rem; }
#edit-day-title, #edit-day-focus { width: auto; margin-left: 8px; padding: 4px 10px; font-size: 0.72rem; vertical-align: middle; }
.day-sub { margin: 0 0 8px; font-size: 1.02rem; color: var(--muted); }
.meta { color: var(--muted); }

.machines { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.machine {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column;
}
.machine.no-art .body { padding-top: 16px; }
.machine.no-art > img,
.machine.no-art > .icon-art,
.machine.no-art > .photo-ph { display: none !important; }
.machine.done { border-color: #22c55e; background: #16351f; }
html[data-theme="light"] .machine.done { background: #dcfce7; }
.machine.done .body, .machine.done .howto { background: transparent; }
.machine.done .howto { border-color: #1f6b3a; }
.photo-ph {
  width: 100%; height: 180px; border: 0; border-bottom: 2px dashed var(--line);
  background: var(--panel2); color: var(--muted); font-weight: 700;
}
.machine > img, .machine > .icon-art {
  width: 100%; height: 220px; object-fit: cover; background: var(--input); display: block;
}
.howto { margin: 4px 0 8px; background: var(--input); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.howto summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.howto .fact { margin: 8px 0; font-size: 0.86rem; color: var(--muted); }
.howto .fact strong { color: var(--text); }
.steps { margin: 8px 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.steps li { display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: 0.88rem; line-height: 1.35; }
.steps li span {
  width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--text);
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 800;
}
.warn-line { font-size: 0.86rem; color: #f0c14e; margin: 6px 0; }
.icon-art { display: grid; place-items: center; font-size: 3.4rem; }
.body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.body h4 { margin: 0; }
.sets { color: var(--muted); font-size: 0.9rem; }
.cue { font-size: 0.88rem; color: var(--muted); }
.timer { font-variant-numeric: tabular-nums; font-size: 1.35rem; font-weight: 800; }
.actions { display: flex; gap: 8px; margin-top: auto; }
.ok {
  background: linear-gradient(180deg, #34d399, var(--ok));
  color: #06210f; font-weight: 800;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.22);
}
.machine .actions button { flex: 1; }
.btn-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-svg { flex: 0 0 auto; }
.machine .actions button.icon-del {
  flex: 0 0 44px;
  width: 44px;
  padding: 0;
  color: var(--danger);
  display: grid;
  place-items: center;
}
.machine .actions button.icon-del:hover { background: #3b1d1d; }
.gps-today { margin: 8px 0 0; font-size: 1.05rem; color: var(--ok); }
.gps-box {
  margin: 10px 0 4px; padding: 14px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(22, 40, 32, 0.9), rgba(18, 26, 34, 0.96));
  border: 1px solid #2a4a3a; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
html[data-theme="light"] .gps-box {
  background: linear-gradient(180deg, #f0fdf4, #ffffff);
  border-color: #bbf7d0; box-shadow: 0 12px 28px rgba(22, 101, 52, 0.08);
}
.gps-box-top { margin-bottom: 10px; }
.gps-readout { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.gps-mi-block { display: flex; align-items: baseline; gap: 6px; }
.gps-readout strong, .gps-mi-block strong {
  font-size: 2rem; font-variant-numeric: tabular-nums; font-weight: 900; letter-spacing: -0.03em; color: #4ade80;
}
html[data-theme="light"] .gps-readout strong, html[data-theme="light"] .gps-mi-block strong { color: #15803d; }
.gps-mi-unit { font-weight: 800; color: var(--muted); text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.06em; }
.gps-stats { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.gps-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700;
  background: rgba(255,255,255,0.05); border: 1px solid #2f4a3c; color: var(--text);
}
html[data-theme="light"] .gps-chip { background: #ecfdf3; border-color: #bbf7d0; }
.gps-meta-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.gps-map-shell {
  position: relative; z-index: 0; isolation: isolate;
  border-radius: 18px; overflow: hidden; margin: 4px 0 12px;
  border: 1px solid #2a4a3a; box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.08);
}
.gps-map-day {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  padding: 5px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800;
  background: rgba(8, 16, 12, 0.82); color: #bbf7d0; border: 1px solid #22c55e55;
  pointer-events: none; text-transform: capitalize;
}
html[data-theme="light"] .gps-map-day {
  background: rgba(255,255,255,0.92); color: #166534; border-color: #86efac;
}
.gps-map {
  height: 260px; width: 100%; border-radius: 18px; margin: 0;
  overflow: hidden; background: #0f1720; z-index: 0;
}
.gps-map .leaflet-container { height: 100%; width: 100%; background: #0f1720; }
.gps-tiles { filter: saturate(0.85) contrast(1.05) brightness(0.92); }
html[data-theme="light"] .gps-tiles { filter: none; }
.gps-map-fade {
  pointer-events: none; position: absolute; inset: 0; border-radius: 18px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.28); z-index: 2;
}
.gps-map .leaflet-control-zoom {
  border: 0 !important; box-shadow: 0 8px 20px rgba(0,0,0,0.35) !important; overflow: hidden; border-radius: 12px !important;
}
.gps-map .leaflet-control-zoom a {
  background: rgba(15, 23, 32, 0.92) !important; color: #e8eef6 !important;
  border: 0 !important; width: 34px !important; height: 34px !important; line-height: 34px !important;
}
.gps-dot-wrap {
  background: transparent !important; border: 0 !important;
  width: 22px !important; height: 22px !important;
}
.gps-dot-core {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; background: #4ade80; border: 2px solid #fff;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35), 0 4px 12px rgba(0,0,0,0.35);
}
.gps-dot-pulse {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 50%; background: rgba(74, 222, 128, 0.35);
  animation: gps-pulse 1.6s ease-out infinite;
}
@keyframes gps-pulse {
  0% { transform: scale(0.55); opacity: 0.9; }
  100% { transform: scale(1.85); opacity: 0; }
}
.gps-actions { display: grid; gap: 8px; }
.gps-status { margin: 8px 0 0; color: var(--muted); }
.gps-wx { font-size: 0.95rem !important; font-weight: 700; }
#run-lock-again {
  width: 100%; margin: 0 0 8px; min-height: 44px;
  background: #16a34a; color: #fff; font-weight: 800; border: 0;
}
.gps-when, .gps-town { margin: 0 0 4px; font-weight: 700; color: var(--text); }
.gps-town { color: var(--ok); }
.run-share-btns-wrap { margin-top: 10px; }
.run-share-card {
  position: fixed; left: -9999px; top: 0; width: 380px; z-index: -1;
  background: #121922; color: #e8eef6; padding: 22px; border-radius: 18px;
  font-family: "Segoe UI", system-ui, sans-serif;
}
.run-share-brand { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: #86efac; font-weight: 800; }
.run-share-card h3 { margin: 6px 0 4px; font-size: 1.35rem; }
#run-share-date { margin: 0 0 10px; color: #8fa3b8; text-transform: capitalize; }
.run-share-mi { font-size: 2.2rem; font-weight: 800; margin: 0 0 6px; }
#run-share-meta, #run-share-when, #run-share-wx, #run-share-town { margin: 4px 0; font-weight: 700; }
#run-share-map { width: 100%; height: auto; border-radius: 12px; margin-top: 12px; display: block; background: #0c151c; }
.run-lock {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(6, 10, 14, 0.94);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  touch-action: manipulation;
}
/* Keep pista map chrome from painting above modals */
body:has(.admin-modal:not(.hidden)) .gps-map-day,
body:has(.admin-modal:not(.hidden)) .gps-map-fade,
body:has(#side-menu.open) .gps-map-day,
body:has(#side-menu.open) .gps-map-fade {
  visibility: hidden !important;
}
.run-lock.hidden { display: none !important; }
.run-lock-card {
  width: min(360px, 100%); text-align: center; color: #e9edef;
}
.run-lock-alert {
  margin: 0 0 14px; padding: 12px 14px; border-radius: 14px;
  background: #fbbf24; color: #1c1917; font-weight: 800; font-size: 1.02rem;
  line-height: 1.35; text-align: center;
}
.run-lock-alert.hidden { display: none !important; }
.run-lock-mi { font-size: 2.4rem; font-weight: 800; margin: 8px 0; }
.run-lock-timer { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0 0 8px; letter-spacing: 0.04em; }
.run-lock-pace { font-size: 1.35rem; font-weight: 800; margin: 0 0 8px; }
.run-lock-rest, .gps-rest-clock { font-size: 1.2rem; font-weight: 800; color: var(--warn); margin: 0 0 8px; }
.gps-pace { font-weight: 800 !important; font-size: 1rem !important; }
.run-hist { margin: 16px 0 8px; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.run-hist h3 { margin: 0 0 10px; font-size: 1rem; }
.run-hist-row { font-size: 0.88rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.run-hist-row:last-child { border-bottom: 0; }
.run-lock-when, .run-lock-town, .run-lock-temp { margin: 4px 0; font-weight: 700; }
.run-lock-card .ok { width: 100%; margin-top: 22px; min-height: 56px; font-size: 1rem; }
.torch-video {
  position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; bottom: 0; left: 0;
}
.torch-btn {
  width: 54px; height: 54px; margin: 0 auto 6px; border: 0; border-radius: 50%;
  background: #2c2c2e; color: #f2f2f7; display: grid; place-items: center; cursor: pointer;
}
.torch-btn.on { background: #f4c025; color: #1a1304; box-shadow: 0 0 22px rgba(244, 192, 37, 0.75); }
.torch-btn.on .torch-lens { fill: #fff; }
.torch-btn.day {
  opacity: 0.38; color: #8e8e93; background: #1c1c1e; box-shadow: none;
}
.gps-box .torch-btn { margin: 8px auto 0; }
.run-photo-btn {
  background: #2563eb;
  color: #fff;
  font-weight: 700;
}
.run-photo-btn:hover { filter: brightness(1.08); }
.mood-row { margin: 8px 0 4px; }
.mood-ask { display: block; margin-bottom: 6px; }
.mood-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mood-chip {
  width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel2); font-size: 1.25rem; cursor: pointer; padding: 0;
}
.mood-chip.on {
  border-color: var(--accent); background: var(--panel); box-shadow: 0 0 0 2px var(--accent);
}
.day-hero .run-photo-btn {
  width: auto;
  max-width: 100%;
  margin-top: 10px;
  min-height: 44px;
  padding: 10px 16px;
}
.gps-box .ok, .gps-box .danger, .gps-box .run-photo-btn { width: 100%; margin: 8px 0 0; min-height: 48px; font-size: 1rem; }
.run-photo-preview {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(6, 10, 14, 0.88);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.run-photo-preview.hidden { display: none !important; }
.run-photo-preview .card {
  width: min(420px, 100%); background: var(--panel); border-radius: 18px; padding: 14px;
}
.run-photo-preview img {
  width: 100%; border-radius: 12px; display: block; max-height: 58vh; object-fit: contain; background: #000;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
  user-select: auto;
  pointer-events: auto;
}
.run-photo-preview img.run-photo-hold {
  outline: 3px solid #22c55e;
  animation: run-hold-pulse 1s ease-in-out 3;
}
.run-photo-hint-on { color: #86efac; font-weight: 700; }
@keyframes run-hold-pulse {
  0%, 100% { outline-color: #22c55e; }
  50% { outline-color: #facc15; }
}
.run-photo-preview .actions { display: grid; gap: 8px; margin-top: 12px; }
.rest-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rest-actions button { flex: 1; background: var(--line); color: var(--warn); border: 0; border-radius: 12px; padding: 6px 8px; font-weight: 700; font-size: 0.75rem; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.rest-actions input { width: 72px; flex: 0 0 72px; padding: 8px; margin: 0; }
.rest-overlay {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  z-index: 16; min-width: 180px;
}
.rest-box {
  background: #3a2a12; border: 2px solid #f0c14e; border-radius: 18px;
  padding: 12px 18px; text-align: center; box-shadow: var(--shadow);
}
.rest-count { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.note { color: var(--muted); font-size: 0.85rem; margin-top: 18px; }
.page-footer { margin-top: 28px; padding: 18px 0 8px; text-align: center; border-top: 1px solid var(--line); }
.page-footer .ghost { margin-bottom: 8px; }
.terms-body { font-size: 0.9rem; line-height: 1.45; color: var(--muted); max-height: 70vh; overflow: auto; }
.terms-body h3 { margin: 14px 0 6px; font-size: 1rem; color: var(--text); }
.terms-body p { margin: 0 0 8px; }
.terms-record {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text); font-size: 0.88rem;
}
.terms-actions {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.terms-actions .ok, .terms-actions .danger { width: auto; margin: 0; }
.terms-actions.hidden { display: none !important; }

.day-card.missed { opacity: 0.7; }
.day-card .miss-tag { font-size: 0.72rem; color: #ff8a8a; margin-top: 6px; }

.day-status { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.day-status button { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 12px; padding: 8px 12px; }
.day-status button.active.went { background: #16351f; border-color: #22c55e; }
html[data-theme="light"] .day-status button.active.went { background: #dcfce7; }
.day-status button.active.missed { background: #3a1b1b; border-color: #ff8a8a; }
html[data-theme="light"] .day-status button.active.missed { background: #fee2e2; }

.custom-box {
  background: var(--panel); border: 1px dashed #3a516c; border-radius: 20px;
  padding: 16px; margin: 18px 0 28px;
}
.custom-box h3 { margin: 0 0 4px; }
.custom-box .primary { width: auto; margin-top: 12px; }
textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--input); color: var(--text); resize: vertical;
}

.menu-backdrop {
  position: fixed; inset: 0; z-index: 20;
  background: rgba(4, 8, 14, 0.55); backdrop-filter: blur(6px);
}
.side-menu {
  position: fixed; top: 0; left: 0; bottom: 0; width: min(360px, 92vw);
  background: linear-gradient(180deg, #152033 0%, #101820 45%, #0d141c 100%);
  border-right: 1px solid #2a3b55; z-index: 21;
  transform: translateX(-105%); transition: transform .22s cubic-bezier(0.22, 1, 0.36, 1); padding: 16px 14px 18px;
  overflow: auto; box-shadow: 18px 0 50px rgba(0, 0, 0, 0.4);
  display: flex; flex-direction: column;
}
html[data-theme="light"] .side-menu {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  border-right-color: #d5deea; box-shadow: 18px 0 40px rgba(30, 50, 70, 0.12);
}
.side-menu.open { transform: translateX(0); }
.menu-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.side-menu .menu-tab {
  position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 10px 12px; border-radius: 18px; font-weight: 800;
  background: var(--panel); border: 1px solid var(--line);
  color: var(--text); letter-spacing: -0.01em;
}
html[data-theme="light"] .side-menu .menu-tab {
  background: #eef3f8; border-color: #c5d0dc; box-shadow: 0 6px 16px rgba(30,50,70,0.05);
}
.side-menu .menu-tab .tab-ico {
  width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.05rem; line-height: 1; flex: 0 0 auto;
  background: rgba(255,255,255,0.06);
}
html[data-theme="light"] .side-menu .menu-tab .tab-ico { background: #f4f7fb; }
.side-menu .menu-tab.active {
  background: linear-gradient(180deg, rgba(255,138,76,0.2), rgba(255,107,53,0.08));
  color: var(--text); border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 10px 24px rgba(255, 107, 53, 0.14);
}
.side-menu .menu-tab.active .tab-ico {
  background: linear-gradient(180deg, #ff8a4c, var(--accent));
}
html[data-theme="light"] .side-menu .menu-tab.active {
  background: linear-gradient(180deg, #fff7ed, #fff);
  border-color: #fdba74;
}
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: #ff6b35; color: #111; font-size: 0.7rem; font-weight: 800;
  display: grid; place-items: center;
}
.badge.hidden { display: none !important; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.emoji-grid button { width: 40px; height: 40px; font-size: 1.25rem; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; }
.emoji-grid button.on { outline: 2px solid var(--accent); }
.chat-fab {
  position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: linear-gradient(145deg, #25d366, #128c7e);
  font-size: 1.45rem; box-shadow: 0 10px 28px rgba(18, 140, 126, 0.45); color: #fff;
  touch-action: manipulation;
}
.chat-fab:hover { filter: brightness(1.08); }
.chat-fab .badge { top: -4px; right: -4px; background: #ed4245; color: #fff; }
.chat-dialog {
  width: min(980px, 100%) !important; height: min(86vh, 720px);
  max-height: min(86vh, 720px); padding: 0 !important; overflow: hidden;
  background: #111b21 !important; border: 1px solid #1e2a32 !important; border-radius: 16px;
}
.chat-shell { display: grid; grid-template-columns: 300px 1fr; height: min(86vh, 720px); }
.chat-sidebar {
  background: #111b21; border-right: 1px solid #222e35;
  display: flex; flex-direction: column; min-width: 0;
}
.chat-side-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; background: #202c33; color: #e9edef;
}
.chat-search {
  margin: 10px 12px 4px; width: calc(100% - 24px); padding: 10px 12px;
  border: 0; border-radius: 10px; background: #202c33; color: #e9edef;
}
.chat-ttl { margin: 0 14px 8px; color: #8696a0; }
.chat-sidebar > .dc-thread { width: calc(100% - 12px); margin: 0 6px 4px; }
.chat-threads { overflow: auto; flex: 1; min-width: 0; padding: 4px 6px 10px; }
.dc-thread {
  display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 10px; border-radius: 10px; background: transparent;
  margin: 0; cursor: pointer; border: 0; width: 100%; max-width: 100%;
  text-align: left; color: #e9edef; overflow: hidden; box-sizing: border-box;
}
.dc-thread:hover { background: #202c33; }
.dc-thread.on { background: #2a3942; }
.dc-thread .t-body { min-width: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; }
.dc-thread .t-top, .dc-thread .t-bot {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.dc-thread .t-name {
  flex: 1; min-width: 0; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-thread .snip {
  flex: 1; min-width: 0; color: #8696a0; font-size: 0.8rem; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dc-thread .t-when {
  flex: 0 0 auto; color: #8696a0; font-size: 0.7rem; white-space: nowrap;
}
.dc-thread.unread .t-when { color: #00a884; font-weight: 700; }
.av-wrap { position: relative; flex: 0 0 auto; width: 40px; height: 40px; }
.av-wrap .dc-av,
.av-wrap .face-photo,
.av-wrap .face-emoji {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; overflow: hidden;
}
.av-wrap .dot { position: absolute; right: 0; bottom: 0; margin: 0; border: 2px solid #111b21; z-index: 2; }
.chat-unread-pill {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: #00a884; color: #111; font-size: 0.7rem; font-weight: 800;
  display: grid; place-items: center;
}
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #0b141a; height: 100%; }
.chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #202c33; border-bottom: 1px solid #1e2a32; min-height: 62px;
}
.chat-head h2 { margin: 0; font-size: 1rem; color: #e9edef; }
.chat-head-meta { min-width: 0; flex: 1; }
.chat-play { width: auto !important; margin: 0 0 0 8px; padding: 6px 10px; font-size: 0.8rem; flex-shrink: 0; }
.chat-play.hidden { display: none !important; }
.chat-more-wrap { position: relative; flex-shrink: 0; }
.chat-more-wrap.hidden { display: none !important; }
.chat-more-wrap .icon-btn { color: #e9edef !important; background: transparent !important; border: 0 !important; font-size: 1.35rem; line-height: 1; }
.chat-more-menu {
  position: absolute; right: 0; top: 40px; z-index: 5; min-width: 190px;
  background: #202c33; border: 1px solid #2a3942; border-radius: 12px;
  padding: 6px; box-shadow: 0 10px 28px rgba(0,0,0,.4);
}
.chat-more-menu.hidden { display: none !important; }
.chat-more-menu button {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  color: #e9edef; padding: 10px 12px; border-radius: 8px; font-size: 0.88rem;
}
.chat-more-menu button:hover { background: #2a3942; }
.chat-more-menu button.muted-on {
  color: #ef4444;
  font-weight: 800;
}
.chat-more-menu button.muted-on::before { content: "🔇 "; }
.mute-flag {
  color: #ef4444;
  font-size: 0.92em;
  margin-left: 6px;
  vertical-align: middle;
}
.chat-game-go { margin-top: 8px; width: auto; padding: 6px 10px; font-size: 0.78rem; }
.chat-head-meta h2, .chat-head-meta .tiny {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-back { display: none; color: #e9edef !important; background: transparent !important; border: 0 !important; }

.chat-log {
  flex: 1; min-height: 0; overflow: auto;
  display: flex; flex-direction: column; gap: 2px; padding: 14px 12px 18px;
  background:
    linear-gradient(180deg, rgba(11,20,26,.72), rgba(11,20,26,.55)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.015) 0 12px, transparent 12px 24px);
}
.chat-daychip {
  align-self: center; background: #182229; color: #8696a0; font-size: 0.75rem; font-weight: 700;
  padding: 5px 12px; border-radius: 8px; margin: 8px 0; text-transform: capitalize;
}
.wa-row { display: flex; margin: 1px 0; }
.wa-row.mine { justify-content: flex-end; }
.wa-row.theirs { justify-content: flex-start; }
.wa-bubble {
  max-width: min(78%, 520px); padding: 6px 8px 4px 10px; border-radius: 12px;
  position: relative; box-shadow: 0 1px 0.5px rgba(0,0,0,.18);
}
.wa-row.mine .wa-bubble { background: #005c4b; color: #e9edef; border-top-right-radius: 4px; }
.wa-row.theirs .wa-bubble { background: #202c33; color: #e9edef; border-top-left-radius: 4px; }
.wa-row.mine.tail .wa-bubble { border-top-right-radius: 12px; border-bottom-right-radius: 4px; }
.wa-row.theirs.tail .wa-bubble { border-top-left-radius: 12px; border-bottom-left-radius: 4px; }
.wa-text { font-size: 0.95rem; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.wa-text a { color: #53bdeb; }
.wa-meta {
  display: flex; justify-content: flex-end; align-items: center; gap: 4px;
  font-size: 0.68rem; color: #ffffff99; margin-top: 2px; margin-left: 12px;
}
.ticks { letter-spacing: -2px; font-size: 0.85rem; color: #8696a0; }
.ticks.read { color: #53bdeb; }
.chat-empty { color: #8696a0; text-align: center; margin: auto; padding: 24px; }
.chat-emojis {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px;
  background: #202c33; border-top: 1px solid #1e2a32;
}
.chat-emojis.hidden { display: none !important; }
.chat-emojis button {
  width: 38px; height: 38px; border: 0; border-radius: 8px; background: #2a3942;
  font-size: 1.2rem;
}
.chat-emojis button:hover { background: #3b4a54; }
.chat-form {
  display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px 12px; background: #202c33;
}
.chat-form textarea {
  flex: 1; background: #2a3942; border: 0; border-radius: 22px; padding: 10px 14px;
  color: #e9edef; resize: none; max-height: 120px; min-height: 42px; line-height: 1.35;
  font-size: 16px;
}
.chat-emoji-btn, .chat-send, .chat-vanish-btn {
  width: 42px; height: 42px; border: 0; border-radius: 50%; flex: 0 0 42px;
  display: grid; place-items: center; font-size: 1.15rem;
}
.chat-emoji-btn, .chat-vanish-btn { background: transparent; color: #8696a0; }
.chat-emoji-btn:hover, .chat-emoji-btn.on { color: #00a884; }
.chat-vanish-btn.on { color: #ef4444; background: #3b1d1d; }
.place-pill {
  flex: 0 0 auto; font-size: 0.68rem; font-weight: 800; color: #86efac;
  background: #14532d; border-radius: 99px; padding: 2px 7px; white-space: nowrap;
}
.wa-row.vanish .wa-bubble { outline: 1px dashed #f59e0b; }
.chat-send { background: #00a884; color: #fff; font-weight: 800; }
.chat-send:hover { filter: brightness(1.08); }
.chat-shell:not(.in-thread) .chat-form,
.chat-shell:not(.in-thread) .chat-emojis { display: none !important; }
.chat-shell.in-thread .chat-form {
  display: flex !important;
  flex-shrink: 0;
}
.chat-log:has(.chat-lobby) {
  display: block; padding: 0; overflow: auto; -webkit-overflow-scrolling: touch; flex: 1; min-height: 0;
}
.chat-lobby { padding: 16px 18px 28px; overflow: visible; flex: none; min-height: 0; }
.chat-lobby h3 { margin: 0 0 6px; color: #e9edef; font-size: 1.05rem; }
.game-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 16px; }
.game-card {
  background: #202c33; border: 1px solid #2a3942; border-radius: 14px; padding: 14px;
  color: #e9edef; cursor: pointer; text-align: left; width: 100%;
}
.game-card:hover { border-color: #00a884; }
.game-card .g-ico { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.game-card strong { display: block; }
.game-card span { color: #8696a0; font-size: 0.8rem; }
.game-invite { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.game-invite select {
  flex: 1; min-width: 140px; background: #202c33; color: #e9edef; border: 1px solid #2a3942;
  border-radius: 10px; padding: 8px 10px;
}
.game-invite .ok { width: auto; margin: 0; background: #00a884; color: #111; }
.game-list { display: grid; gap: 8px; }
.game-row {
  background: #202c33; border-radius: 12px; padding: 10px 12px; color: #e9edef;
  display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap;
}
.game-row .actions { margin: 0; gap: 6px; }
.game-row button { width: auto; margin: 0; padding: 6px 10px; font-size: 0.8rem; }
.ttt-board {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; margin: 16px auto;
}
.ttt-board button {
  aspect-ratio: 1; border: 0; border-radius: 12px; background: #202c33; color: #e9edef;
  font-size: 2rem; font-weight: 800;
}
.ttt-board button:hover:not(:disabled) { background: #2a3942; }
.ttt-board button:disabled { opacity: 0.85; }
.rps-picks {
  display: flex; gap: 10px; justify-content: center; margin: 16px 0; flex-wrap: wrap;
}
.rps-picks button {
  width: 92px; min-height: 92px; border: 0; border-radius: 16px; background: #202c33;
  font-size: 2rem; color: #e9edef; touch-action: manipulation;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.rps-picks button span.rps-lab { font-size: 0.72rem; font-weight: 700; color: #8696a0; }
.rps-picks button.on { outline: 2px solid #00a884; background: #1a3d36; }
.rps-picks button:disabled { opacity: 0.55; }
.guess-pad {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 280px; margin: 16px auto;
}
.guess-pad button {
  aspect-ratio: 1; border: 0; border-radius: 12px; background: #202c33; color: #e9edef;
  font-size: 1.1rem; font-weight: 800; touch-action: manipulation;
}
.guess-pad button:disabled { opacity: 0.45; }
.game-status { text-align: center; color: #e9edef; margin: 8px 0; }
.game-score { text-align: center; color: #8696a0; font-size: 0.9rem; }
.game-bar {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px;
}
.game-bar button { width: auto; margin: 0; }
.dc-av {
  width: 40px; height: 40px; border-radius: 50%; background: #5865f2;
  display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0;
  overflow: hidden;
}
.dc-av.lg { width: 44px; height: 44px; }
.dc-av.face-photo, .face-photo {
  padding: 0; border: 0; cursor: pointer; background: #1f2c34;
}
.face-photo:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.face-photo img, .dc-av.face-photo img, .avatar-big img, .who-face img, .chip-face img, .friend-face img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
  pointer-events: none;
}
.dc-thread .face-photo { pointer-events: auto; }
#img-modal.admin-modal { z-index: 1300; }
.img-dialog #img-full { max-height: min(72vh, 640px); }
.img-nav.hidden { visibility: hidden; pointer-events: none; }
.face-emoji { display: grid; place-items: center; }
#who {
  display: flex; align-items: center; gap: 6px; margin: 0; min-height: 0;
  max-width: 100%;
}
.who-face {
  width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 0.9rem; overflow: hidden; flex: 0 0 auto;
}
.who-name {
  font-size: 0.84rem; font-weight: 700; color: var(--muted);
  line-height: 1.2; word-break: break-word;
}
.menu-user {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
.menu-user-face {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; flex: 0 0 auto;
  background: var(--panel2); border: 1px solid var(--line); font-size: 1.35rem;
}
.menu-user-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-user-name {
  font-size: 1rem; font-weight: 800; line-height: 1.2;
  word-break: break-word; color: var(--text);
}
.menu-user-handle {
  font-size: 0.78rem; color: var(--muted); font-weight: 600;
}
.chip-face {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 1.2rem; overflow: hidden; flex: 0 0 auto;
}
.friend-face {
  width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: 1rem; overflow: hidden; flex: 0 0 auto; background: var(--panel);
}
.avatar-edit { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
.avatar-preview, .avatar-big {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--panel2);
  border: 2px solid var(--line); font-size: 2rem; flex: 0 0 auto;
}
.avatar-actions { min-width: 0; flex: 1; }
.img-dialog img#img-full { width: 100%; max-height: 48vh; object-fit: contain; background: #0d141c; border-radius: 12px; }
.img-stage { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.img-nav { font-size: 1.4rem; min-width: 40px; }
.img-alts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.img-alts button { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0d141c; }
.img-alts button.on { outline: 2px solid var(--ok); }
.img-alts img { width: 100%; height: 90px; object-fit: cover; display: block; }
.img-alts span { display: block; font-size: 0.72rem; padding: 4px 6px; color: var(--muted); }
.img-sub { font-size: 0.95rem; margin: 14px 0 8px; }

.side-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
  padding: 4px 2px 14px; border-bottom: 1px solid #2a3b55; gap: 8px;
}
html[data-theme="light"] .side-head { border-bottom-color: #e2e8f0; }
.side-head .brand { margin-bottom: 0; }
.side-head strong { font-size: 1.15rem; letter-spacing: -0.02em; }
.icon-btn {
  width: 42px; height: 42px; padding: 0; display: grid; place-items: center;
  border-radius: 14px; background: var(--panel2); color: var(--text);
  border: 1px solid var(--line);
}
html[data-theme="light"] .icon-btn {
  background: #eef3f8; color: var(--text); border-color: #c5d0dc;
}
.header-icons .icon-btn.ghost,
.app-header .icon-btn.ghost {
  background: var(--panel2);
}
html[data-theme="light"] .header-icons .icon-btn.ghost,
html[data-theme="light"] .app-header .icon-btn.ghost {
  background: #eef3f8;
}
.side-menu h3 {
  margin: 18px 0 8px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 800;
}
.side-menu section:first-of-type h3 { margin-top: 0; }
.side-menu label { margin-top: 4px; }
.side-menu .menu-panel {
  background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 14px;
}
html[data-theme="light"] .side-menu .menu-panel { background: #fff; border-color: #e2e8f0; }
.logout-bar { border-top-color: #2a3b55; }
.stack { display: grid; gap: 8px; }
.stack .primary { margin-top: 0; width: 100%; }
.profile-user-line { margin: 0 0 4px; color: var(--muted); font-size: 0.92rem; }
.profile-user-line strong { color: var(--text); }
#my-logins .login-line { margin: 4px 0; }
.login-more { margin-top: 2px; }
.login-more-btn {
  width: 100%; margin-top: 8px; margin-bottom: 6px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; font-weight: 700; font-size: 0.85rem; padding: 10px 12px;
}
.login-more-ico { display: inline-block; transition: transform 0.15s ease; font-size: 0.75rem; }
.login-more-ico.open { transform: none; }
.account-sep {
  height: 1px; margin: 22px 0 14px; border: 0;
  background: linear-gradient(90deg, transparent, #2a3b55, transparent);
}
html[data-theme="light"] .account-sep { background: linear-gradient(90deg, transparent, #d5deea, transparent); }
#panel-cuenta #deactivate-account { margin-top: 4px; }
.deactivate-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; font-weight: 800;
  background: linear-gradient(180deg, #7c3aed, #5b21b6); color: #f5f3ff;
  box-shadow: 0 8px 18px rgba(91, 33, 182, 0.28);
}
.deactivate-btn:hover { filter: brightness(1.08); }
html[data-theme="light"] .deactivate-btn {
  background: linear-gradient(180deg, #8b5cf6, #6d28d9); color: #fff;
  box-shadow: 0 8px 16px rgba(109, 40, 217, 0.22);
}
.friend-card {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; margin-top: 10px; overflow: hidden;
}
.friend-card .row { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.friend-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.friend-main { min-width: 0; flex: 1; }
.friend-name-line {
  display: flex; align-items: flex-start; gap: 7px; min-width: 0;
}
.friend-name-line .dot { margin-top: 5px; flex: 0 0 auto; }
.friend-name {
  font-size: 0.95rem; font-weight: 800; line-height: 1.25;
  color: var(--text); word-break: break-word; overflow-wrap: anywhere;
}
.friend-meta {
  margin-top: 3px; font-size: 0.78rem; color: var(--muted); font-weight: 600;
  word-break: break-word;
}
.friend-status {
  margin-top: 4px; font-size: 0.76rem; font-weight: 700; color: var(--muted);
  word-break: break-word;
}
.friend-status.on { color: #86efac; }
html[data-theme="light"] .friend-status.on { color: #15803d; }
.friend-actions {
  display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto;
}
.friend-actions .ghost.small,
.friend-actions .danger.small {
  width: auto; min-width: 76px;
}
#panel-amigos .friend-card .same,
#panel-amigos .friend-card > .tiny {
  font-size: 0.78rem; line-height: 1.35;
  margin-top: 8px; word-break: break-word;
}
.name-link {
  background: none; border: 0; padding: 0; color: inherit; font-weight: 800;
  text-decoration: underline; text-underline-offset: 3px;
}
.admin-user-info {
  margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); font-size: 0.85rem;
}
.admin-user-info p { margin: 0 0 6px; }
.admin-user-info p:last-child { margin: 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; display: inline-block; margin-right: 6px; }
.dot.on { background: #22c55e; box-shadow: 0 0 8px #22c55e; }
.same { color: #7ee0a3; font-size: 0.85rem; margin: 6px 0 0; }
.tiny { font-size: 0.78rem; color: var(--muted); }
.ghost.small { padding: 6px 10px; font-size: 0.8rem; }

@media (max-width: 900px) {
  #chat-modal.admin-modal { padding: 0; align-items: stretch; display: block; }
  .chat-dialog {
    width: 100% !important; height: 100dvh !important; max-height: 100dvh !important;
    border-radius: 0 !important; border: 0 !important; padding: 0 !important; overflow: hidden !important;
  }
  .chat-shell { grid-template-columns: 1fr; height: 100dvh; min-height: 100dvh; }
  .chat-back { display: grid; }
  .chat-shell:not(.in-thread):not(.in-lobby) .chat-main { display: none; }
  .chat-shell.in-thread .chat-sidebar,
  .chat-shell.in-lobby .chat-sidebar { display: none; }
  .chat-shell.in-lobby .chat-main,
  .chat-shell.in-thread .chat-main { display: flex; height: 100%; }
  .chat-sidebar {
    height: 100dvh; min-width: 0; overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .dc-thread { padding: 12px 10px; }
  .wa-bubble { max-width: min(86%, 100%); }
  .chat-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .game-grid { grid-template-columns: 1fr; }
  .rps-picks { flex-direction: column; align-items: stretch; padding: 0 8px; }
  .rps-picks button {
    width: 100%; min-height: 64px; flex-direction: row; justify-content: flex-start;
    padding: 0 18px; gap: 14px; font-size: 1.8rem;
  }
  .rps-picks button span.rps-lab { font-size: 1rem; color: #e9edef; }
  .dc-thread { min-height: 58px; padding: 12px 10px; }
  .wa-bubble { max-width: 86%; }
  .chat-fab { bottom: max(12px, env(safe-area-inset-bottom)); right: 12px; }
  .header-icons { margin-left: 0; gap: 4px; max-width: 100%; }
  .header-icons .icon-btn { width: 40px; height: 40px; }
  .donate-header {
    height: 34px; padding: 0 10px 0 5px; gap: 6px;
  }
  .donate-label { font-size: 0.78rem; }
  .pp-logo { width: 24px; height: 24px; }
  main { padding: 14px 12px 28px; }
  .app-header { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .header-feed { max-width: 100%; flex-basis: 100%; justify-content: flex-start; }
  .header-feed .feed-item { white-space: normal; font-size: 0.75rem; line-height: 1.3; }
  .week-nav { flex-wrap: wrap; gap: 6px; }
  .week-nav h2 { font-size: 0.9rem; width: 100%; }
  .week-actions { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .week-actions .ghost {
    flex: none; width: 100%; min-width: 0; margin: 0; font-size: 0.68rem;
    padding: 8px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .week-actions .w-full { display: none; }
  .drag-hint { text-align: left; }
  .week-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .day-card { min-height: 108px; padding: 10px 10px 12px; }
  .day-card .num { font-size: 1.2rem; }
  .day-hero { padding: 16px; border-radius: 18px; }
  .day-hero h3 { font-size: 1.25rem; }
  .machines { grid-template-columns: 1fr; }
  .machine > img, .machine > .icon-art { height: 170px; }
  .machine .actions { flex-wrap: wrap; }
  .place-toolbar {
    position: sticky;
    top: var(--app-header-h, 56px);
    z-index: 11;
    margin: 0 0 12px;
    padding: 8px 0 6px;
    background: linear-gradient(var(--bg) 75%, transparent);
  }
  .place-toolbar .seg { max-width: none; width: 100%; }
  .seg { width: 100%; }
  .seg button { flex: 1; padding: 10px 8px; font-size: 0.9rem; }
  .side-menu { width: min(100vw, 360px); padding: 14px; }
  .admin-dialog { padding: 14px; max-height: 92vh; width: min(100vw - 16px, 920px); }
  #cal-modal.admin-modal { padding: 8px; align-items: flex-start; }
  #cal-modal .admin-dialog { max-height: 96vh; overflow-x: hidden; overflow-y: auto; }
  .cal-dialog { border-radius: 22px; }
  .cal-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) 2.4rem;
    gap: 3px;
  }
  .cal-dow { font-size: 0.6rem; }
  .cal-day {
    min-height: 58px;
    aspect-ratio: auto;
    border-radius: 12px;
    font-size: 0.8rem;
    padding: 4px 1px 5px;
    gap: 2px;
    justify-content: flex-start;
  }
  .cal-day > span:first-child { line-height: 1.1; }
  .cal-mi {
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #4ade80;
    line-height: 1.15;
  }
  html[data-theme="light"] .cal-mi { color: #15803d; }
  .cal-wx { font-size: 0.62rem; }
  .cal-pin { display: none; }
  .cal-week-sum { font-size: 0.58rem; border-radius: 10px; padding: 2px 0; font-weight: 900; }
  .cal-legend { font-size: 0.74rem; gap: 6px; }
  .cal-pill { padding: 5px 9px; font-size: 0.72rem; }
  #cal-miles-total { font-size: 0.88rem; padding: 7px 10px; }
  #cal-share-card { padding: 10px 8px; border-radius: 16px; }
  #cal-share-title { font-size: 0.9rem; }
  .cal-brand-mark { width: 30px; height: 30px; border-radius: 9px; }
}
