/* ========================================================================
   RBS' Planning Poker — styles.css (consolidated from latest IST)
   - English-only comments
   - Desktop unchanged
   - Mobile (≤768px): participant row becomes two-line, actions on line 2
   - Vote chips row and result row are centered (stacked)
   ===================================================================== */

/* ---------- Theme tokens ------------------------------------------------ */
:root{
  --bg:#1e1e1e; --text:#d4d4d4; --text-strong:#fff; --text-dim:#aeb3bb;
  --page-bg-image:radial-gradient(ellipse 120% 90% at 50% 8%,rgba(13,38,54,.16) 0%,rgba(15,34,47,.07) 48%,transparent 78%);
  --color-text-muted:var(--text-dim);
  --panel:#2d2d30; --panel-2:#3c3c3c; --panel-2-hover:#47494d; --panel-hover:#34363a; --border:#3c3c3c;
  --accent:#007acc; --accent-strong:#005a9e; --link:#7dbbff;
  --switch-off-track:color-mix(in srgb,var(--text) 50%,var(--panel));
  --switch-off-border:color-mix(in srgb,var(--text) 65%,var(--panel));
  --ok:#4caf50; --ok-border:#81c784; --warn:#ffd54f; --danger:#ef4444;
  --shadow:0 6px 16px rgba(0,0,0,.25);
  --shape-radius-small:10px; --shape-radius-medium:14px; --shape-radius-large:20px;
  --h-input:44px; --h-button:44px; --gap:12px; --gap-sm:8px;

  --footer-h:68px;
  --cta-offset:8px;

  /* Cards */
  --card-min-desktop:46px; --card-max-desktop:84px;
  --card-min-mobile:40px; --card-max-mobile:72px;

  /* Lists */
  --icon-col-width:1.5rem;

  /* Chips */
  --vote-chip-width:3rem;

  /* Inactive */
  --inactive-fg:#8c949f;

  /* Inputs (dark) */
  --field-bg:#1f2937;
  --field-border:rgba(255,255,255,.16);
  --field-fg:#e5e7eb;
  --field-placeholder:rgba(255,255,255,.45);
  --field-focus:#60a5fa;

  /* Header controls */
  --hamburger-right:12px; --hamburger-top:10px; --hamburger-size:40px;
  --header-gap:10px; /* fixed visual gap to hamburger */
  --hc-height:36px; --hc-pad:4px; --hc-gap:4px; --hc-seg-size:28px;
  --hc-active-ring:1px; --hc-active-ring-color:rgba(255,255,255,0.45);
  --hc-nudge-y:1px;
}
:root[data-theme="light"]{
  --bg:#f6f7f9; --text:#1f2937; --text-strong:#111827; --text-dim:#374151;
  --page-bg-image:radial-gradient(ellipse 120% 88% at 50% 6%,rgba(116,159,207,.11) 0%,rgba(151,184,220,.045) 50%,transparent 80%);
  --panel:#fff; --panel-2:#eef2f7; --panel-2-hover:#e7ebf2; --panel-hover:#f7f8fb; --border:#e5e7eb;
  --accent:#2563eb; --accent-strong:#1d4ed8; --link:#1d4ed8;
  --shadow:0 10px 24px rgba(0,0,0,.08);

  --chip-special-bg:#eaf2ff; --chip-special-border:#cfe0ff; --chip-special-text:#0b1220;


  --inactive-fg:#9ca3af;

  --field-bg:#fff; --field-border:rgba(0,0,0,.20);
  --field-fg:#111827; --field-placeholder:#8b8b8b; --field-focus:#3b82f6;
}

/* System theme follows the OS without setting data-theme. */
@media (prefers-color-scheme: light){
  :root:not([data-theme]){
  --bg:#f6f7f9; --text:#1f2937; --text-strong:#111827; --text-dim:#374151;
  --page-bg-image:radial-gradient(ellipse 120% 88% at 50% 6%,rgba(116,159,207,.11) 0%,rgba(151,184,220,.045) 50%,transparent 80%);
  --panel:#fff; --panel-2:#eef2f7; --panel-2-hover:#e7ebf2; --panel-hover:#f7f8fb; --border:#e5e7eb;
  --accent:#2563eb; --accent-strong:#1d4ed8; --link:#1d4ed8;
  --shadow:0 10px 24px rgba(0,0,0,.08);

  --chip-special-bg:#eaf2ff; --chip-special-border:#cfe0ff; --chip-special-text:#0b1220;


  --inactive-fg:#9ca3af;

  --field-bg:#fff; --field-border:rgba(0,0,0,.20);
  --field-fg:#111827; --field-placeholder:#8b8b8b; --field-focus:#3b82f6;

  }
}

/* Shared interface geometry. */
:root{
  --ui-font:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --ui-radius:var(--shape-radius-medium);
  --ui-radius-lg:var(--shape-radius-large);
  --ui-control-radius:var(--shape-radius-medium);
  --ui-small-control-radius:var(--shape-radius-small);
  --ui-button-radius:var(--shape-radius-medium);
  --ui-card-radius:var(--shape-radius-medium);
  --ui-panel-radius:var(--shape-radius-large);
  --ui-large-radius:var(--shape-radius-large);
  --ui-letter-spacing:0;
  --ui-heading-weight:750;
  --ui-meta-label-size:.7rem;
  --ui-meta-label-weight:700;
  --ui-meta-label-line-height:1.2;
  --ui-meta-label-spacing:.08em;
  --ui-panel-shadow:var(--ui-shadow-md);
  --ui-menu-shadow:var(--ui-shadow-lg);
  --ui-card-shadow:0 3px 10px rgba(0,0,0,.08);
  --ui-card-hover-shadow:0 7px 18px rgba(0,0,0,.12);
  --ui-menu-padding:18px;
  --ui-menu-item-padding:14px;
  --ui-input-padding:.65rem .95rem;
  --ui-join-gap:1.15rem;
  --ui-shadow-sm:0 2px 8px rgba(0,0,0,.08);
  --ui-shadow-md:0 8px 24px rgba(0,0,0,.10);
  --ui-shadow-lg:0 16px 40px rgba(0,0,0,.14);
  --ui-surface:color-mix(in srgb,var(--panel) 75%,var(--bg));
  --ui-surface-raised:color-mix(in srgb,var(--panel-2) 55%,var(--panel));
  --ui-surface-border:color-mix(in srgb,var(--border) 45%,transparent);
}

/* ---------- Base --------------------------------------------------------- */
*{box-sizing:border-box}
html,body{height:100%}
body{
  background-color:var(--bg);background-image:var(--page-bg-image); color:var(--text); font-family:var(--ui-font);letter-spacing:var(--ui-letter-spacing);
  margin:0; padding:2rem; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  padding-bottom:var(--footer-h);
}
button,input,select,textarea{font:inherit;color:inherit}
/* Normalize styled buttons without resetting radios, switches, or their focus rings. */
:is(.card-grid button,.button,.choice-btn,.icon-button,.menu-button,button.menu-item){
  -webkit-appearance:none;appearance:none;
}
:is(.button,.choice-btn,button.menu-item){line-height:1.2}
:is(.icon-button,.menu-button){padding:1px 6px;line-height:1}
body.menu-open{overflow:hidden}
a{color:var(--link)}
:focus-visible{outline:2px solid var(--field-focus); outline-offset:2px}
.container{max-width:800px;margin:0 auto;padding:1rem}
.room-return{max-width:800px;margin:12px auto 0;padding:0 1rem}
.room-return[hidden]{display:none}
.room-return a{display:inline-flex;align-items:center;gap:var(--gap-sm);max-width:100%;min-height:40px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--ui-small-control-radius);background:var(--panel);color:var(--text);text-decoration:none;font-size:.85rem;line-height:1.4;vertical-align:middle}
.room-return a:is(:hover,:focus,:active){text-decoration:none}
.room-return a:hover{background:var(--panel-hover);border-color:color-mix(in srgb,var(--text) 25%,var(--border))}
.room-return-arrow{width:16px;height:16px;flex:none}
.room-return-label{flex:none;white-space:nowrap}
/* Ellipsis affects paint only; the complete name remains the link's accessible text. */
.room-return-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
:root .room-return a{background:var(--ui-surface);border-color:var(--ui-surface-border)}
:root .room-return a:hover{background:var(--ui-surface-raised);border-color:color-mix(in srgb,var(--text) 25%,var(--ui-surface-border))}
h1{color:var(--text-strong);margin-bottom:2rem;font-size:1.1rem}
h2{color:var(--text-strong);margin:1.2rem 0 .8rem;font-size:.98rem}
.participant-heading{display:flex;align-items:center;gap:.35rem;margin-bottom:.6rem;font-size:var(--ui-meta-label-size);font-weight:var(--ui-meta-label-weight);line-height:var(--ui-meta-label-line-height);letter-spacing:var(--ui-meta-label-spacing);text-transform:uppercase}
.participant-heading-separator{color:var(--text-dim);font-weight:400}
.participant-count{display:inline-flex;align-items:center;justify-content:center;min-width:1.25rem;min-height:1.25rem;padding:0 .32rem;border:1px solid var(--border);border-radius:calc(var(--shape-radius-small) / 2);background:var(--panel-2);color:var(--text-dim);font-size:.7rem;font-weight:600;line-height:1}
strong{color:var(--text-strong)}
.app-title{display:flex;align-items:center;gap:.5rem;justify-content:flex-start}
.app-title .logo{border-radius:6px;vertical-align:middle;object-fit:contain}
.page-landing .app-title{justify-content:center;text-align:center}
.landing-explainer{font-size:.92rem;line-height:1.6}
.landing-explainer h1{font-size:.94rem;margin:1.2rem 0 .8rem}
.landing-explainer h2{font-size:.9rem;color:var(--text-strong);margin:1rem 0 .5rem}
@media (max-width:560px){.app-title{justify-content:center;text-align:center}}

/* Room metadata */
.main-info{
  display:grid;grid-template-columns:fit-content(50%) minmax(0,1fr);margin:0 0 1.2rem;
  overflow:hidden;border:1px solid var(--ui-surface-border);border-radius:var(--ui-panel-radius);
  background:var(--ui-surface);box-shadow:var(--ui-shadow-sm)
}
.main-info-group{position:relative;min-width:0;padding:10px 14px 10px 48px}
.main-info-group--participant{padding-inline-end:24px}
.main-info-group--room{padding-inline-end:50px}
.main-info-group + .main-info-group{border-inline-start:1px solid var(--ui-surface-border)}
.main-info dt{margin:0;min-width:0;line-height:1.2}
.main-info dd{margin:3px 0 0;min-width:0;line-height:1.35}
.main-info .mi-icon{
  position:absolute;inset-inline-start:16px;top:50%;translate:0 -50%;
  width:22px;display:inline-flex;align-items:center;justify-content:center;font-size:1.15rem;line-height:1
}
.main-info .mi-label{
  display:block;color:var(--text-dim);font-size:var(--ui-meta-label-size);
  font-weight:var(--ui-meta-label-weight);line-height:var(--ui-meta-label-line-height);
  letter-spacing:var(--ui-meta-label-spacing);text-transform:uppercase;white-space:nowrap
}
.main-info dd > strong,.room-with-actions #roomCodeVal{
  display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap
}
.room-with-actions{display:flex;align-items:center;gap:8px;min-width:0;width:100%}
.room-with-actions #roomCodeVal{flex:1 1 auto}
.room-with-actions .icon-button{position:absolute;inset-inline-end:14px;top:50%;translate:0 -50%;flex:none;margin-left:0}
@media (max-width:600px){
  .main-info{grid-template-columns:minmax(0,1fr)}
  .main-info-group + .main-info-group{border-inline-start:0;border-top:1px solid var(--ui-surface-border)}
  .main-info-group{padding-block:9px}
  .main-info-group--participant{padding-inline-end:14px}
  .main-info dd > strong,.room-with-actions #roomCodeVal{
    overflow:visible;text-overflow:clip;white-space:normal;overflow-wrap:anywhere;
  }
}

/* ---------- Topic row ---------------------------------------------------- */
.topic-row{display:grid;grid-template-columns:24px minmax(0,1fr) max-content;gap:8px 12px;align-items:start;padding:12px 14px;background:var(--ui-surface-raised);border:1px solid var(--ui-surface-border);border-radius:var(--ui-panel-radius);margin:.9rem 0 1rem;box-shadow:var(--ui-shadow-sm)}
.topic-panel-icon{width:20px;height:20px;margin-top:1px;color:var(--text-dim);fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.topic-content{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.topic-heading{color:var(--text-dim);font-size:var(--ui-meta-label-size);font-weight:var(--ui-meta-label-weight);line-height:var(--ui-meta-label-line-height);letter-spacing:var(--ui-meta-label-spacing);text-transform:uppercase}
.topic-text{display:block;max-width:100%;min-width:0;color:var(--text-strong);padding:0;background:transparent;border:0;line-height:1.45;font-size:.95rem;font-weight:650;white-space:normal;overflow-wrap:anywhere;word-break:normal}
.topic-ticket-link{display:inline-flex;align-items:center;gap:4px;max-width:100%;color:var(--link);font-size:.78rem;line-height:1.35;text-decoration:none}
.topic-ticket-link::after{content:"↗";font-size:.9em}
.topic-ticket-link:hover{text-decoration:underline}
.topic-ticket-link[hidden]{display:none}
.topic-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;grid-column:3;grid-row:1 / span 2}

/* Optional edit block */
.topic-edit{display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:8px;align-items:center;margin:1.2rem 0 1rem;padding:10px 12px;background:var(--panel);border:1px solid var(--border);border-radius:var(--ui-radius)}
.topic-input{height:36px;border-radius:var(--ui-small-control-radius);border:1px solid var(--border);background:var(--panel);color:var(--text);padding:0 .75rem}

#topicRow .topic-inline-input{width:100%;min-width:0;height:36px;border-radius:var(--ui-small-control-radius);border:1px solid var(--field-border);background:var(--field-bg);color:var(--field-fg);padding:0 .75rem}

/* ---------- Menu trigger ------------------------------------------------- */
.menu-button{
  position:fixed;top:12px;right:12px;z-index:1100;height:40px;width:40px;border:1px solid var(--border);
  border-radius:var(--ui-button-radius);background:var(--panel);color:var(--text-strong);cursor:pointer;box-shadow:var(--ui-panel-shadow);
  display:inline-flex;align-items:center;justify-content:center;font-size:18px;transition:transform 120ms,background 180ms,border-color 180ms,box-shadow 180ms;-webkit-tap-highlight-color:transparent
}
.menu-button:hover{background:var(--panel-hover);border-color:#4a4a4a}
.menu-button:active{transform:translateY(1px) scale(.98)}

/* ---------- Menu overlay & panel ---------------------------------------- */
.hidden{display:none !important}
.menu-overlay{position:fixed;inset:0;z-index:1090}
.menu-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.45);backdrop-filter:blur(1px);padding-bottom:env(safe-area-inset-bottom)}
:root[data-theme="light"] .menu-backdrop{background:rgba(0,0,0,.25)}
.menu-panel{
  position:absolute;top:max(12px,env(safe-area-inset-top));right:12px;width:min(440px,calc(100vw - 24px));
  max-height:calc(100dvh - (max(12px,env(safe-area-inset-top)) + 12px));overflow-y:auto;overflow-x:hidden;
  background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-radius-lg);box-shadow:var(--ui-menu-shadow);
  padding:var(--ui-menu-padding) var(--ui-menu-padding) calc(14px + env(safe-area-inset-bottom));animation:slideIn 180ms ease both
}
@keyframes slideIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
.menu-panel fieldset{border:0;padding:0;margin:0;min-inline-size:auto}
.menu-header{display:flex;align-items:center;justify-content:space-between;padding:6px 6px 8px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--panel);z-index:20}
.menu-header h3{margin:0;font-size:1rem;color:var(--text-strong)}
.menu-section{display:flex;flex-direction:column;gap:10px;padding:8px 4px 10px}
.section-title{margin:6px 8px 6px;font-weight:600;font-size:.9rem;opacity:.85;color:var(--text-strong)}
.section-title-with-icon{display:flex;align-items:center;gap:7px}
.menu-panel :is(.menu-section--sequence,.menu-section--room,.menu-section--personal,.menu-section--secondary){
  border-top:1px solid var(--border);margin-top:6px;
}

/* Closed overlay must not paint at all */
#appMenuOverlay[hidden],
#appMenuOverlay.is-hidden,
#appMenuOverlay[aria-hidden="true"]{display:none !important;pointer-events:none !important}

/* Menu rows */
.menu-item{
  display:grid;grid-template-columns:28px 1fr;align-items:center;gap:12px;padding:var(--ui-menu-item-padding);border-radius:var(--ui-card-radius);background:var(--panel-2);
  border:1px solid var(--border);cursor:pointer;text-align:left;font-size:.9rem;color:var(--text);
  transition:background 180ms,border-color 180ms,box-shadow 180ms
}
.menu-item:hover{background:var(--panel-2-hover);border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,122,204,.12)}
.menu-item.disabled{opacity:.55;cursor:not-allowed}
.menu-item .mi-icon{font-size:18px;line-height:1;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif}

/* Language inline row (menu) */
.lang-inline{display:flex;align-items:center;gap:8px}
.flag-split{position:relative;display:inline-block;width:24px;height:16px;overflow:hidden;border-radius:3px;border:1px solid var(--border)}
.flag-split .flag{position:absolute;inset:-.5px;width:calc(100% + 1px);height:calc(100% + 1px);object-fit:cover}
.flag-split .flag-b{z-index:1;-webkit-mask-image:linear-gradient(135deg,transparent 49.5%,black 50%);mask-image:linear-gradient(135deg,transparent 49.5%,black 50%)}
@supports not (mask-image:linear-gradient(#000,#000)){.flag-split .flag-b{clip-path:polygon(100% 0,100% 100%,0 100%)}}

/* Choice pills */
.menu-choice{display:flex;flex-wrap:wrap;gap:8px}
.choice-btn{display:flex;align-items:center;gap:8px;justify-content:center;padding:10px 12px;height:34px;border-radius:var(--ui-radius);background:var(--panel-2);border:1px solid var(--border);cursor:pointer;font-size:.9rem;color:var(--text);transition:background 180ms,border-color 180ms,box-shadow 180ms}
.choice-btn .mi-icon{font-size:18px;line-height:1}
.choice-btn:hover{background:var(--panel-2-hover);border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,122,204,.12)}
.choice-btn.active,.choice-btn[aria-pressed="true"]{border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,122,204,.20)}

/* Sequence radios */
.menu-choice.vertical{flex-direction:column;gap:6px}
.radio-row{display:flex;align-items:center;gap:10px;padding:8px 10px;min-height:36px;border-radius:var(--ui-radius);background:var(--panel-2);border:1px solid var(--border);user-select:none;transition:background 180ms,border-color 180ms,box-shadow 180ms;font-size:.9rem;white-space:nowrap;overflow:hidden}
.radio-row input[type="radio"]{width:16px;height:16px;accent-color:var(--accent);margin:0;flex:0 0 auto}
.radio-row span{min-width:0;overflow:hidden;text-overflow:ellipsis}
.radio-row:hover{background:var(--panel-2-hover);border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,122,204,.12)}
.radio-row.disabled{opacity:.55;cursor:not-allowed}
.radio-row:has(input[type="radio"]:checked){border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,122,204,.20);background:color-mix(in srgb,var(--panel-2) 84%, var(--accent) 16%)}

/* Switches */
.menu-item.switch{
  grid-template-columns:28px minmax(0,1fr) max-content;
  min-height:56px;background:transparent;border-color:transparent;box-shadow:none;
}
.menu-item.switch:hover:not(.disabled){background:var(--panel-2);border-color:transparent;box-shadow:none}
.menu-item.switch.disabled:hover{background:transparent;border-color:transparent;box-shadow:none}
.switch-text{display:flex;flex-direction:column;gap:3px;align-items:flex-start;min-width:0;white-space:normal;overflow-wrap:anywhere;line-height:1.35}
.switch-text strong{font-weight:600}
.switch-text > span{font-size:.8rem;color:var(--text-dim)}
.switch-control{
  -webkit-appearance:none;appearance:none;width:42px;height:24px;border-radius:999px;background:var(--switch-off-track);
  display:block;margin:0;align-self:center;flex:none;
  border:1px solid var(--switch-off-border);position:relative;cursor:pointer;transition:background 160ms,border-color 160ms
}
.switch-control::after{
  content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.35);transition:transform 160ms ease
}
.switch-control:checked,.switch-control[aria-checked="true"]{background:var(--accent);border-color:var(--accent-strong)}
.switch-control:checked::after,.switch-control[aria-checked="true"]::after{transform:translateX(18px)}
.switch-control:disabled{opacity:.6;cursor:not-allowed}
.switch-control:focus-visible{outline:2px solid var(--accent);outline-offset:3px;box-shadow:none}
.menu-item.switch.disabled .switch-control{opacity:1}
@media (prefers-reduced-motion:reduce){
  .switch-control,.switch-control::after{transition:none}
}

/* Danger CTA inside menu */
#closeRoomBtn.menu-item.danger{
  display:grid;grid-template-columns:28px 1fr;align-items:center;
  background:rgba(255,70,70,.10);border-color:rgba(255,70,70,.25);color:#fecaca;
}
#closeRoomBtn.menu-item.danger:hover{border-color:rgba(255,70,70,.45);box-shadow:0 0 0 2px rgba(239,68,68,.18)}
#closeRoomBtn.menu-item.danger .mi-icon{font-size:18px;line-height:1}
#closeRoomBtn .truncate-1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Individual room exit is shared by the page and the guest menu. */
.room-exit-row{display:flex;flex-direction:column;align-items:center;gap:1.1rem;margin:2rem 0 0}
.room-exit-row::before{
  content:"";width:min(12rem,40%);border-top:1px solid color-mix(in srgb,var(--ui-surface-border) 75%,transparent)
}
.room-exit-action{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  min-height:44px;padding:10px 16px;border:1px solid color-mix(in srgb,var(--danger) 40%,var(--border));
  border-radius:var(--ui-button-radius);background:color-mix(in srgb,var(--danger) 10%,var(--panel));
  color:color-mix(in srgb,var(--danger) 80%,var(--text-strong));font:inherit;font-size:.9rem;font-weight:600;
  cursor:pointer;transition:background 180ms,border-color 180ms,box-shadow 180ms,transform 120ms;
}
.room-exit-action svg{flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.room-exit-action:hover{background:color-mix(in srgb,var(--danger) 17%,var(--panel));border-color:var(--danger)}
.room-exit-action:focus-visible{outline:2px solid var(--field-focus);outline-offset:2px}
.room-exit-action:active{transform:translateY(1px)}
.room-exit-row .room-exit-action{width:200px}
.menu-item.room-exit-action{display:grid;grid-template-columns:28px minmax(0,1fr);justify-content:stretch;text-align:left;width:100%}

/* ---------- Icon button -------------------------------------------------- */
.icon-button{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:var(--ui-button-radius);background:var(--panel-2);color:var(--text);border:1px solid var(--border);cursor:pointer;transition:background 180ms,border-color 180ms,transform 120ms,box-shadow 180ms;-webkit-tap-highlight-color:transparent;font-size:16px;line-height:1}
.room-with-actions .icon-button,.topic-actions .icon-button{border-radius:var(--shape-radius-small)}
.icon-button:hover{background:var(--panel-2-hover);border-color:var(--accent);box-shadow:0 0 0 2px rgba(0,122,204,.12)}
.icon-button:active{transform:translateY(1px) scale(.98)}
:root[data-theme="light"] .icon-button:hover{box-shadow:0 0 0 2px rgba(37,99,235,.12)}

/* ---------- Forms / landing --------------------------------------------- */
.page-landing .home-container{padding-top:3rem}
@media (max-width:600px){.page-landing .home-container{padding-top:2rem}}
.landing-container{display:flex;flex-direction:column;align-items:center;min-height:90vh;padding:2rem;text-align:center;margin-top:6vh}
.join-form{display:flex;flex-direction:column;align-items:center;gap:var(--ui-join-gap);width:100%}
.form-row{display:flex;flex-direction:column;gap:var(--ui-join-gap);width:100%;max-width:400px}
.form-field{width:100%}
.landing-container .join-form .form-row:first-of-type{margin-top:10px}
.page-landing .join-form{max-width:400px;margin-inline:auto;gap:1.1rem}
.page-landing .join-form .form-row{gap:.45rem;text-align:left}
.page-landing .join-form .form-field{display:flex;flex-direction:column;gap:.45rem}
.page-landing .join-form label{display:flex;align-items:center;gap:.4rem;font-weight:600;line-height:1.4}
.page-landing .join-form input:not([type="hidden"]){min-height:48px}
.page-landing .join-form .form-actions{width:100%;margin-top:.15rem}
.page-landing .join-form .form-actions .button{display:block;width:100%;min-height:48px;margin-top:0}

:root .page-landing .join-form{
  padding:1.3rem;border:1px solid var(--ui-surface-border);
  border-radius:var(--ui-large-radius);background:var(--ui-surface);
  box-shadow:var(--ui-shadow-sm);
}

/* Inputs */
input[type="text"],input[type="search"],input[type="email"],input[type="url"],
input[type="password"],input[type="number"],input[type="tel"],
textarea,select{
  display:block;width:100%;
  height:auto;min-height:var(--h-input);
  padding:var(--ui-input-padding);border-radius:var(--ui-control-radius);
  background:var(--field-bg); color:var(--field-fg);
  border:1px solid var(--field-border);
  box-shadow:inset 0 1px 0 rgba(0,0,0,.05);
  -webkit-appearance:none; appearance:none;
  transition:background-color .15s,border-color .15s,box-shadow .15s,color .15s;
}
input::placeholder,textarea::placeholder{color:var(--text-dim)}
input:focus,textarea:focus,select:focus{
  outline:none; border-color:var(--field-focus);
  box-shadow:0 0 0 3px color-mix(in srgb, var(--field-focus) 35%, transparent);
}
input[disabled],textarea[disabled],select[disabled],
input[readonly],textarea[readonly]{opacity:.7;cursor:not-allowed}

/* Safari/iOS autofill & tap highlights */
input:-webkit-autofill,textarea:-webkit-autofill,select:-webkit-autofill{
  -webkit-text-fill-color:var(--field-fg);
  -webkit-box-shadow:0 0 0 1000px var(--field-bg) inset;
  transition:background-color 9999s ease-out 0s;
}
:root[data-theme="dark"] input,:root[data-theme="dark"] textarea,:root[data-theme="dark"] select{
  -webkit-tap-highlight-color:rgba(255,255,255,.08);
}

/* ---------- Buttons ------------------------------------------------------ */
.button{margin-top:1.2rem;height:var(--h-button);padding:0 1.2rem;background:var(--accent);color:#fff;border:none;border-radius:var(--ui-button-radius);cursor:pointer;font-size:1rem;transition:transform 120ms,filter 180ms,box-shadow 180ms,background 180ms;box-shadow:var(--ui-panel-shadow)}
.button:hover{background:var(--accent-strong);filter:brightness(1.04)}
.button:active{transform:translateY(1px) scale(.985)}
.button:disabled{opacity:.6;cursor:not-allowed}
@keyframes shake{0%,100%{transform:translateX(0)}20%,60%{transform:translateX(-6px)}40%,80%{transform:translateX(6px)}}
button.shake{animation:shake .4s}

/* ---------- Cards -------------------------------------------------------- */
.card-grid{display:grid;grid-template-columns:repeat(auto-fit, minmax(var(--card-min-desktop), var(--card-max-desktop)));gap:8px;margin:1rem 0}
.card-grid.fixed4{grid-template-columns:repeat(4,minmax(var(--card-min-desktop),var(--card-max-desktop)))}
.card-grid button{
  /* An explicit track-relative width avoids Firefox's intrinsic button sizing. */
  width:calc(100% - .7rem);min-width:0;min-height:48px;line-height:1.15;
  display:inline-block;padding:.55rem .6rem;margin:.35rem;background:var(--panel);border:1px solid var(--border);border-radius:var(--ui-card-radius);box-shadow:var(--ui-card-shadow);cursor:pointer;
  transition:transform .15s,box-shadow .2s,background .2s,border-color .2s;
  font-size:clamp(1.05rem,2.2vw,1.3rem);text-align:center;color:var(--text);position:relative;aspect-ratio:5/3
}
.card-grid button:hover{background:var(--panel-hover);transform:translateY(-1px);box-shadow:var(--ui-card-hover-shadow);border-color:var(--accent)}
.card-grid button.selected{background:var(--accent-strong) !important;color:#fff !important;font-weight:700;border-color:var(--accent);box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 30%,transparent);transform:none}
.card-grid .grid-break{grid-column:1 / -1;height:0;pointer-events:none}
.card-grid .checkmark{display:none !important}
.card-grid button:disabled{opacity:.55;cursor:not-allowed;filter:grayscale(35%);background:var(--panel-2);border-color:var(--ui-surface-border);box-shadow:none;transform:none !important}
.card-grid button:disabled:hover{background:var(--panel-2);border-color:var(--ui-surface-border);box-shadow:none;transform:none}

/* ---------- Participants (shared) --------------------------------------- */
ul{list-style:none;padding:0;margin:0}
li{margin-bottom:.4rem;line-height:1.5;font-size:1rem}


#liveParticipantList .participant-row{
  display:grid;
  grid-template-columns:var(--icon-col-width) 1fr 1fr;
  align-items:center; column-gap:.4rem;
  margin-bottom:.5rem; padding:10px 12px;
  border-bottom:1px solid var(--border); border-radius:var(--ui-card-radius);
}
#liveParticipantList .participant-row.is-host{background:rgba(0,122,204,.08);outline:1px solid rgba(0,122,204,.22)}
:root[data-theme="light"] #liveParticipantList .participant-row.is-host{background:#e8f1ff;outline-color:rgba(37,99,235,.35)}

.participant-icon{width:var(--icon-col-width);display:inline-flex;justify-content:center;align-items:center;line-height:1}
.participant-icon.host{font-size:1.1rem}
.name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;color:var(--text)}

#liveParticipantList li.disconnected{color:var(--inactive-fg)}
#liveParticipantList li.disconnected .name{color:var(--inactive-fg)}
#liveParticipantList li.disconnected .participant-icon{opacity:.85}

/* Right column base */
.row-right{display:flex;align-items:center;gap:10px;min-height:1.8rem}
.row-right > .row-action:first-of-type{margin-left:auto}
.row-right :where(.vote-chip,.mini-chip,.status-icon) ~ .row-action:first-of-type{margin-left:auto}

/* Status icons */
.status-icon{font-size:1rem;line-height:1;display:inline-flex;align-items:center}
.status-icon.done{color:var(--ok);filter:drop-shadow(0 0 2px rgba(76,175,80,.6))}
.status-icon.pending{color:var(--warn);opacity:.95}

.app-icon-sprite{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
.pp-status-icon{
  display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
}
.participant-role-host .pp-status-icon,.participant-role-spectator .pp-status-icon{width:15px;height:15px}
.participant-role-inactive .pp-status-icon{width:18px;height:18px}

/* Spectator as outlined chip */
#liveParticipantList .status-icon.spectator{
  display:inline-flex;align-items:center;justify-content:center;inline-size:var(--vote-chip-width);
  padding:.15rem .35rem;border-radius:8px;background:transparent;color:var(--text-dim);
  border:1.5px solid rgba(148,163,184,.35);box-shadow:none;line-height:1.2
}
:root[data-theme="light"] #liveParticipantList .status-icon.spectator{
  border-color:var(--chip-special-border,#cfe0ff); color:var(--chip-special-text,#0b1220);
}

/* Vote chips */
.vote-chip{
  display:inline-flex;align-items:center;justify-content:center;inline-size:var(--vote-chip-width);
  padding:.15rem .35rem;border-radius:8px;background:#185a33;color:#fff;font-weight:700;
  border:2px solid #2b7a4a;box-shadow:0 0 6px rgba(24,90,51,.45);font-size:.95rem;line-height:1.2;text-align:center;
  font-variant-numeric:tabular-nums;opacity:0;transform:translateY(6px);animation:chipIn 220ms ease forwards
}
.vote-chip.special{background:#2a2f3a;border-color:#475569;box-shadow:none;color:#cbd5e1}
:root[data-theme="light"] .vote-chip.special{background:var(--chip-special-bg);border-color:var(--chip-special-border);color:var(--chip-special-text)}
@keyframes chipIn{to{opacity:1;transform:translateY(0)}}
.vote-chip.outlier{box-shadow:0 0 0 3px rgba(255,213,79,.22), inset 0 0 0 1px rgba(255,213,79,.55)}
:root[data-theme="light"] .vote-chip.outlier{box-shadow:0 0 0 3px rgba(255,213,79,.28), inset 0 0 0 1px rgba(234,179,8,.55)}
.vote-chip.empty{background:transparent;border:2px solid #475569;color:#cbd5e1;box-shadow:none;font-weight:600}
:root[data-theme="light"] .vote-chip.empty{border-color:#cfe0ff;color:#0b1220}

/* Mini outline chip */
.mini-chip{
  display:inline-flex;align-items:center;justify-content:center;inline-size:var(--vote-chip-width);
  height:1.6rem;padding:.15rem .35rem;border-radius:8px;background:transparent;border:1.5px solid rgba(148,163,184,.35);
  color:var(--text-dim);font-weight:700;font-size:.95rem;line-height:1.2;font-variant-numeric:tabular-nums;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif;
}
:root[data-theme="light"] .mini-chip{border-color:var(--chip-special-border,#cfe0ff);color:var(--chip-special-text,#0b1220)}
.mini-chip.done{border-color:rgba(34,197,94,.45);color:var(--ok)}
.mini-chip.pending{
  border-color:var(--ui-surface-border);background:color-mix(in srgb,var(--panel-2) 55%,transparent);
  color:var(--text-dim);box-shadow:none;font-family:inherit;font-size:0
}
.mini-chip.pending::before{
  content:"";display:block;width:14px;height:14px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12M6 21h12M7 3c0 4 1.4 6.1 5 9-3.6 2.9-5 5-5 9m10-18c0 4-1.4 6.1-5 9 3.6 2.9 5 5 5 9M9 8h6m-6 8h6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12M6 21h12M7 3c0 4 1.4 6.1 5 9-3.6 2.9-5 5-5 9m10-18c0 4-1.4 6.1-5 9 3.6 2.9 5 5 5 9M9 8h6m-6 8h6'/%3E%3C/svg%3E") center/contain no-repeat
}

/* Heat-colored chips */
.vote-chip.heat{
  --_h: var(--chip-heat-h,120);
  border-color:hsl(var(--_h) 75% 55%); color:hsl(var(--_h) 85% 62%);
  background:color-mix(in oklab, hsl(var(--_h) 80% 50%) 14%, transparent);
}
@supports not (color-mix(in oklab, white, black)){.vote-chip.heat{background:transparent}}
@media (prefers-color-scheme: light){
  .vote-chip,.participant-row .mini-chip{color:#0f172a;font-weight:600}
  .vote-chip.heat{
    --_h: var(--chip-heat-h,120);
    color:#0f172a;border-color:hsl(var(--_h) 72% 42%);
    background:color-mix(in oklab, hsl(var(--_h) 80% 58%) 36%, white);
    box-shadow:inset 0 0 0 1px hsl(var(--_h) 50% 34% / .25);
  }
}
@supports not (color-mix(in oklab, white, black)){
  @media (prefers-color-scheme: light){.vote-chip.heat{background:hsl(var(--_h) 90% 90%)}}
}
html.light .vote-chip, body.light .vote-chip,
:root[data-theme="light"] .vote-chip{color:#0f172a;font-weight:600}
html.light .vote-chip.heat, body.light .vote-chip.heat,
:root[data-theme="light"] .vote-chip.heat{
  --_h: var(--chip-heat-h,120);
  color:#0f172a;border-color:hsl(var(--_h) 72% 42%);
  background:color-mix(in oklab, hsl(var(--_h) 80% 58%) 36%, white);
  box-shadow:inset 0 0 0 1px hsl(var(--_h) 50% 34% / .25);
}
@supports not (color-mix(in oklab, white, black)){
  html.light .vote-chip.heat, body.light .vote-chip.heat,
  :root[data-theme="light"] .vote-chip.heat{background:hsl(var(--_h) 90% 90%)}
}
/* Prevent re-animation while revealed */
.no-chip-anim .vote-chip{animation:none;opacity:1;transform:none}

/* ---------- Results & vote chips rows (centered) ------------------------- */
/* Center the results row itself */
#resultRow{
  display:flex;justify-content:center;align-items:baseline;gap:.35rem .6rem;
  flex-wrap:nowrap;text-align:center;min-height:1.6rem;margin-inline:auto;
  padding:.65rem .75rem;border:1px solid var(--border);border-radius:var(--ui-radius);
  background:var(--panel);font-variant-numeric:tabular-nums;
}
#resultRow .value{font-weight:700}
#resultRow #averageVote{font-size:1rem}
#resultRow #resultLabel,#resultRow #averageVote,#resultRow #medianWrap,#resultRow #rangeWrap{white-space:nowrap}
#resultRow .sep{opacity:.6;margin:0 .45rem}
@media (max-width:640px){
  #resultRow{flex-wrap:wrap;justify-content:center;align-items:baseline;gap:.25rem .5rem;min-height:2rem}
  #resultRow .sep{display:none}
  #medianWrap,#rangeWrap{flex:0 0 100%;text-align:center}
}
/* Center any revealed vote chips container (id/name agnostic) */
.chips-row,#voteChips,#voteChipsRow,#revealedChips,#revealedChipsRow,#votesRow{
  display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;
  margin:.5rem auto .25rem auto;text-align:center;
}

/* Consensus & average label centered */
.pre-vote{margin-top:2.2rem}
.average-label{font-size:1rem;margin-top:1rem;display:flex;justify-content:center;gap:.35rem;text-align:center}
.average-label #averageVote{font-size:.85rem;font-weight:600;opacity:0;animation:avgIn 240ms ease forwards}
@keyframes avgIn{to{opacity:1}}
.average-label.consensus{color:var(--ok);font-weight:700}
.average-label.consensus #averageVote{font-weight:800}
.consensus-row{white-space:nowrap;display:flex;justify-content:center;text-align:center}
.consensus-row.is-consensus .value{animation:pulseOnce .5s ease}
@keyframes pulseOnce{0%{transform:scale(.96);filter:brightness(1.05)}60%{transform:scale(1.03)}100%{transform:scale(1)}}
.average-label .stat{margin-left:.25rem}.average-label .sep{opacity:.6;margin:0 .35rem}

/* Reserve space even when hidden */
#resultRow.is-hidden{visibility:hidden}

/* Preserve host action behavior while aligning it with the voting grid. */
.vote-actions{display:flex;justify-content:center}
.vote-actions .button{width:240px;margin-top:.5rem;font-weight:600;box-shadow:none}

/* ---------- Toast -------------------------------------------------------- */
.toast{position:fixed;top:20px;right:20px;background:rgba(51,51,51,.95);color:#fff;padding:12px 20px;border-radius:var(--ui-radius);z-index:9999;font-size:14px;box-shadow:var(--ui-panel-shadow);transform:translateY(-10px);opacity:0;animation:fadein 220ms ease forwards,fadeout 400ms ease 2400ms forwards}
@keyframes fadein{to{opacity:.95;transform:translateY(0)}}@keyframes fadeout{to{opacity:0}}

/* ---------- QR overlay --------------------------------------------------- */
.qr-overlay{position:fixed;inset:0;z-index:1200}
.qr-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55);backdrop-filter:blur(2px)}
:root[data-theme="light"] .qr-backdrop{background:rgba(0,0,0,.35)}
.qr-dialog{position:absolute;inset:0;margin:auto;width:min(92vw,420px);background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:var(--ui-large-radius);box-shadow:var(--ui-panel-shadow);padding:12px;max-height:92vh;display:grid;grid-template-rows:auto 1fr auto;animation:slideIn 180ms ease both}
.qr-header{display:flex;align-items:center;justify-content:space-between;padding:4px 6px 8px;border-bottom:1px solid var(--border)}
.qr-header h3{margin:0;font-size:1rem;color:var(--text-strong)}
.qr-close{border:1px solid var(--border);background:var(--panel-2);border-radius:var(--ui-button-radius);width:34px;height:34px;cursor:pointer}
.qr-body{display:grid;place-items:center;padding:16px}
.qr-actions{display:flex;justify-content:flex-end;gap:8px}
#qrCanvas{image-rendering:pixelated;width:320px;height:320px;border-radius:var(--ui-radius);background:#fff}
@media (prefers-reduced-motion:reduce){.menu-panel,.qr-dialog{animation:none}}

/* ---------- Footer & sticky CTA spacing --------------------------------- */
.app-footer{position:fixed;left:0;right:0;bottom:0;background:var(--panel);color:var(--text-dim);border-top:1px solid var(--border);text-align:center;padding:8px 12px;font-size:.82rem;line-height:1.2;z-index:4;-webkit-user-select:none;user-select:none}
.app-footer a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.container{padding-bottom:max(24px, calc(var(--footer-h) + 48px))}
@media (max-width:600px){
  .app-footer{font-size:.62rem;padding:6px 10px;margin-top:50px}
  body{padding-bottom:calc(var(--footer-h) + 72px)}
  .vote-actions{position:static}
  #revealButton,#resetButton{
    width:100%;margin-top:.5rem;box-shadow:0 10px 24px rgba(0,0,0,.22);
  }
  .room-exit-row{margin-top:1.5rem;gap:1rem}
  .room-exit-row .room-exit-action{width:100%}
  .container{padding-bottom:calc(var(--footer-h) + 72px)}
}
@media (max-width:768px){
  #resultRow{margin-block:.75rem .5rem}
  #resultRow.is-hidden{display:none}
  .card-grid{margin-block:.5rem}
}
@supports (-webkit-touch-callout:none){.app-footer{font-size:.58rem}}

/* ---------- Utilities ---------------------------------------------------- */
.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0,0,0,0) !important;white-space:nowrap !important;border:0 !important}
.truncate-1{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.no-horizontal-scroll{overflow-x:hidden}
.topic-row.editable{cursor:pointer}
.topic-row.editable:hover{background:rgba(148,163,184,.08)}

/* ---------- Room guide -------------------------------------------------- */
.room-manual{margin-top:1.25rem;padding-bottom:8px}
.room-manual-details{
  overflow:clip;background:var(--panel);border:1px solid var(--border);
  border-radius:var(--ui-large-radius);box-shadow:var(--ui-panel-shadow);
}
.room-manual-details > summary{
  display:grid;grid-template-columns:24px minmax(0,1fr) 20px;align-items:center;gap:10px;
  min-height:48px;padding:10px 14px;cursor:pointer;list-style:none;color:var(--text-strong);
}
.room-manual-details > summary::-webkit-details-marker{display:none}
.room-manual-details > summary:hover{background:var(--panel-2-hover)}
.room-manual-details > summary:focus-visible{outline:2px solid var(--field-focus);outline-offset:-3px}
.room-manual-icon,.room-manual-chevron{
  width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round;
}
.room-manual-icon{color:var(--accent)}
.room-manual-chevron{color:var(--text-dim);transition:transform 160ms ease}
.room-manual-details[open] .room-manual-chevron{transform:rotate(180deg)}
.room-manual-title{font-size:.9rem;font-weight:650}
.room-manual-body{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 22px;
  padding:14px;border-top:1px solid var(--border);color:var(--text);
}
.room-manual-body section{min-width:0}
.room-manual-body section:nth-child(n+3){padding-top:12px;border-top:1px solid var(--border)}
.room-manual-body section:nth-child(3){grid-column:1 / -1}
.room-manual-body h3{margin:0 0 4px;color:var(--text-strong);font-size:.82rem;line-height:1.35}
.room-manual-body p{margin:0;font-size:.78rem;line-height:1.55;overflow-wrap:anywhere}
.room-manual-body ul{margin:4px 0 6px;padding-inline-start:1.15rem;list-style:disc outside}
.room-manual-body li{font-size:.78rem;line-height:1.55;overflow-wrap:anywhere}
.room-manual-body li + li{margin-top:2px}
@media (max-width:600px){
  .room-manual{margin-top:1rem;padding-bottom:12px}
  .room-manual-body{grid-template-columns:1fr}
  .room-manual-body section:nth-child(2){padding-top:12px;border-top:1px solid var(--border)}
  .room-manual-body section:nth-child(3){grid-column:auto}
}
@media (prefers-reduced-motion:reduce){.room-manual-chevron{transition:none}}

/* ---------- Header controls (language pill) ------------------------------ */
.header-controls{
  position:fixed;
  top:calc(var(--hamburger-top) + (var(--hamburger-size) - var(--hc-height)) / 2 + var(--hc-nudge-y));
  right:calc(var(--hamburger-right) + var(--hamburger-size) + var(--header-gap));
  display:flex;align-items:center;gap:10px;z-index:90;pointer-events:auto;
}
/* One presentation for preference controls in the header and settings. */
.preference-control{
  display:inline-flex;align-items:center;align-self:flex-start;flex:none;
  height:40px;width:max-content;max-width:100%;box-sizing:border-box;
  padding:var(--hc-pad);gap:var(--hc-gap);border-radius:var(--shape-radius-small);
  background:var(--surface-2, rgba(255,255,255,0.08));
  border:1px solid var(--border-1, rgba(255,255,255,0.12));
  box-shadow:var(--shadow-1, 0 2px 8px rgba(0,0,0,0.2));
}
.preference-control > button{
  -webkit-appearance:none;appearance:none;
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-width:40px;height:100%;padding:0 10px;box-sizing:border-box;
  border:0;border-radius:var(--shape-radius-small);background:transparent;
  color:color-mix(in srgb,var(--text) 75%,transparent);box-shadow:none;
  cursor:pointer;user-select:none;font-size:.8rem;font-weight:600;line-height:1;
}
.preference-control > button:hover{background:var(--surface-3, rgba(255,255,255,0.10))}
.preference-control > button[aria-pressed="true"]{
  background:transparent;
  color:var(--text);
  box-shadow:none;
}
.preference-control .mi-icon{display:inline-flex;align-items:center;justify-content:center}
.theme-icon{width:18px;height:18px;display:block}

/* Compact: ≤420px (always show both segments, keep pill look) */
@media (max-width:420px){
  :root{--hamburger-size:36px;--header-gap:6px;--hc-height:34px;--hc-seg-size:26px;--hc-gap:3px;--hc-nudge-y:1px}
  .header-controls .hc-group{padding:4px;gap:var(--hc-gap)}
  #hcLang .seg[aria-pressed="false"]{display:inline-flex}
}

/* Desktop/tablet slight nudge */
@media (min-width:421px){ :root{--hc-nudge-y:1px} }

/* ---------- Specials palette (menu) ------------------------------------- */
#rowSpecialsPick{
  margin-top:.25rem;overflow:hidden;transition:max-height .24s ease, opacity .18s ease;
  max-height:0;opacity:.35;pointer-events:none;
}
#rowSpecialsPick[hidden]{display:block}
#rowSpecialsPick[aria-hidden="false"]{max-height:120px;opacity:1;pointer-events:auto}
#rowSpecialsPick .specials-icons{
  display:flex;gap:.5rem;padding:.5rem 0 .25rem;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;align-items:center;
}
#rowSpecialsPick .spc{
  appearance:none;width:40px;height:40px;border-radius:var(--ui-radius);display:grid;place-items:center;font-size:20px;line-height:1;
  border:1px solid var(--spc-brd, rgba(128,128,128,.35));background:var(--spc-bg, rgba(128,128,128,.12));
  user-select:none;cursor:pointer;transition:transform .06s ease, box-shadow .12s ease, background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
#rowSpecialsPick .spc:hover{transform:translateY(-1px)}
#rowSpecialsPick .spc.on,#rowSpecialsPick .spc[aria-pressed="true"]{
  background:var(--spc-active-bg, rgba(0,120,255,.16));
  border-color:var(--spc-active-brd, rgba(0,120,255,.55));
  box-shadow:inset 0 0 0 2px var(--spc-active-brd, rgba(0,120,255,.55));
}
#rowSpecialsPick.disabled{opacity:.6}
#rowSpecialsPick.disabled .spc{cursor:not-allowed}
:root{--spc-bg:rgba(0,0,0,.08);--spc-brd:rgba(0,0,0,.18);--spc-active-bg:rgba(0,120,255,.16);--spc-active-brd:rgba(0,120,255,.55)}
@media (prefers-color-scheme: dark){
  :root{--spc-bg:rgba(255,255,255,.08);--spc-brd:rgba(255,255,255,.16);--spc-active-bg:rgba(0,140,255,.22);--spc-active-brd:rgba(0,140,255,.75)}
}
:root[data-theme="dark"]{
  --spc-bg:rgba(255,255,255,.08);--spc-brd:rgba(255,255,255,.16);--spc-active-bg:rgba(0,140,255,.22);--spc-active-brd:rgba(0,140,255,.75)
}
#rowSpecials.has-expand{align-items:start}
#rowSpecials .mi-icon{grid-row:1;grid-column:1}
#rowSpecials .switch-text{grid-row:1;grid-column:2}
#rowSpecials .switch-control{grid-row:1;grid-column:3}
#rowSpecials #rowSpecialsPick{grid-row:2;grid-column:1 / -1;margin:6px 0 0 0;padding:0;border:0}
#rowSpecials #rowSpecialsPick[hidden]{display:none !important}
#rowSpecials .specials-icons{display:flex;flex-wrap:wrap;gap:6px;align-items:center;overflow-x:hidden}
#rowSpecials .specials-icons .spc{display:inline-flex;justify-content:center;align-items:center;width:34px;height:34px;padding:0;border-radius:var(--shape-radius-small);line-height:1}
#rowSpecials .specials-icons .spc .ico{display:block;font-size:18px;line-height:1}
#rowSpecials .specials-icons .spc:focus{outline-offset:2px}


/* ---------- Mobile: Participants (single, consolidated block) ------------ */
@media (max-width:768px){
  /* One row; participant actions use the same overflow menu as desktop. */
  #liveParticipantList .participant-row{
    display:grid;
    grid-template-columns: var(--icon-col-width) minmax(0,1fr) auto;
    grid-template-rows: auto;
    column-gap:10px; row-gap:0;
    align-items:center; padding:8px 12px;
  }

  /* placements for row 1 */
  #liveParticipantList .participant-row .participant-icon{grid-column:1;grid-row:1}
  #liveParticipantList .participant-row .name{
    grid-column:2;grid-row:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
    line-height:22px;align-self:center;
  }
  #liveParticipantList .participant-row .row-right{
    grid-column:3;grid-row:1;
    display:flex !important;align-items:center;gap:8px;
  }
}

/* ---------- Header controls micro-polish -------------------------------- */
.hc-group .seg{line-height:1;font-size:.8rem;font-weight:600}



/* === Desktop centering for results line + deck grid ====================== */
/* Keep mobile as-is; only >=768px gets the centering tweaks */
@media (min-width: 768px){

  /* Center the result line under the participant list */
  #resultRow{
    /* shrink to content so auto margins can center it */
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
    justify-content: center !important; /* if it's flex already */
  }

  /* Center the card grid as a block and the cards inside each track */
  .card-grid{
    /* make the grid shrink-wrap to its tracks instead of stretching full width */
    width: max-content;
    max-width: 100%;
    margin-inline: auto;            /* centers inside any block/flex parent */

    /* if the grid ever gets wider, keep tracks/cards visually centered */
    justify-content: center !important;   /* center tracks within the grid */
    justify-items: center !important;     /* center each card in its track */
  }

  /* fixed-layout variant gets the same treatment */
  .card-grid.fixed4{
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
    justify-content: center !important;
    justify-items: center !important;
  }
}

/* Fallback for older engines that don't support max-content well */
@supports not (width: max-content){
  @media (min-width: 768px){
    .card-grid,
    .card-grid.fixed4{
      display: inline-grid;      /* shrink-wrap via inline formatting */
      margin-inline: auto;       /* center the inline-grid block */
    }
    #resultRow{ display: inline-flex; margin-inline: auto; }
  }
}




/* === Center result line + deck on desktop; resilient to flex/ids/classes === */
@media (min-width: 768px){

  /* result line (supports id + class) */
  #resultRow,
  .result-row{
    width: max-content;          /* shrink-wrap to content */
    max-width: 100%;
    margin-left: auto;           /* center via auto margins */
    margin-right: auto;
    text-align: center;
    justify-content: center !important;  /* if it's a flex row */
    flex: 0 0 auto;              /* don't stretch if parent is flex */
    align-self: center;          /* center within flex parent */
  }

  /* deck grid (supports class .card-grid and id #cardGrid) */
  .card-grid,
  #cardGrid{
    width: max-content;          /* grid shrinks to its tracks */
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;

    /* when grid has spare room, keep tracks/cards visually centered */
    justify-content: center !important;
    justify-items: center !important;

    /* if parent is a flex container, prevent “fill the row” stretching */
    flex: 0 0 auto;
    align-self: center;
  }
}

/* Fallback for engines without max-content */
@supports not (width: max-content){
  @media (min-width: 768px){
    #resultRow, .result-row{ display: inline-flex; margin-inline: auto; }
    .card-grid, #cardGrid{ display: inline-grid; margin-inline: auto; }
  }
}



/* ==== Center result row + deck on desktop (resilient) =================== */
@media (min-width: 768px){

  /* Result line (support id and class) */
  #resultRow,
  .result-row{
    /* shrink to intrinsic width, then center as a block */
    width: fit-content !important;     /* fallback-friendly vs max-content */
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;

    /* if parent is flex/grid, don't stretch */
    flex: 0 0 auto !important;
    justify-self: center !important;
    align-self: center !important;

    /* if it's a flex container itself, center its contents */
    justify-content: center !important;
    text-align: center;
  }

  /* Deck (support class and id) */
  .card-grid,
  #cardGrid{
    width: fit-content !important;     /* grid shrinks to its tracks */
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;

    /* neutralize parent layout influence */
    flex: 0 0 auto !important;
    justify-self: center !important;
    align-self: center !important;

    /* center cards inside the grid when there is extra space */
    justify-content: center !important;
    justify-items: center !important;
  }
}

/* Fallback for very old engines without fit-content */
@supports not (width: fit-content){
  @media (min-width: 768px){
    #resultRow, .result-row{ display: inline-flex; margin-inline: auto; }
    .card-grid, #cardGrid{ display: inline-grid; margin-inline: auto; }
  }
}


/* === Desktop-only alignment fix: center participant chips with results === */
@media (min-width: 769px){
  /* Make the right column a 3-col grid so the chip can be truly centered
     while host actions stay flush-right. */
  #liveParticipantList .participant-row .row-right{
    display:grid;
    grid-template-columns: 1fr minmax(0,auto) 1fr;
    align-items:center;
    gap:10px; /* keep visual gap for actions */
  }

  /* Center the "chip" (or placeholder/status) in the middle column */
  #liveParticipantList .participant-row .row-right :where(.vote-chip,.mini-chip,.status-icon){
    grid-column:2;
    justify-self:center;
  }

  /* Keep action buttons in the far right */
  #liveParticipantList .participant-row .row-right .row-action{
    grid-column:3;
    justify-self:end;
    margin-left:0; /* override previous flex auto-push */
  }

}



/* === Desktop: align participant vote chip exactly to page center === */
@media (min-width: 769px){
  /* reference box for absolute positioning */
  #liveParticipantList .participant-row{ position: relative; }

  /* place the chip on the exact page center line */
  #liveParticipantList .participant-row .row-right :where(.vote-chip,.mini-chip,.status-icon){
    position: absolute;           /* take it out of the flex flow */
    grid-column: auto;
    left: 50%;                    /* center of the whole row (incl. icon col) */
    translate: -50% 0;            /* keep horizontal centering independent of chipIn */
    transform: none;
    pointer-events: none;         /* don't block clicks on Host/Spectator/Kick */
    z-index: 1;
  }

  /* keep host actions flush-right, unchanged behavior */
  #liveParticipantList .participant-row .row-right{
    display: flex; align-items: center; gap: 10px; min-height: 1.8rem;
  }
  #liveParticipantList .participant-row .row-right > .row-action:first-of-type{
    margin-left: auto;
  }
}

/* ===================================================================
   About Page Styles
   =================================================================== */

body.page-about,
body.page-landing {
  height: auto;
  min-height: 100%;
  padding-bottom: 0;
}

.page-about .app-footer,
.page-landing .app-footer {
  position: static;
  margin-inline: -2rem;
}

.page-about .about-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
  font-size: 0.92rem;
}

.page-about .about-intro {
  margin-bottom: 2rem;
}

.page-about .lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text-muted, #888);
  margin: 0;
}

.page-about .about-section {
  margin: 2.5rem 0;
}

.page-about .about-section h2 {
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text-strong);
}

.page-about .about-section p {
  line-height: 1.7;
  margin-bottom: 1rem;
}

.page-about .feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.page-about .feature-list li {
  padding: 0.5rem 0;
  line-height: 1.6;
  font-size: 0.92rem;
}

.page-about .feature-icon {
  display: inline-block;
  width: 1.5rem;
  margin-right: 0.5rem;
}

.page-about .steps-list {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.page-about .steps-list li {
  padding: 0.5rem 0;
  line-height: 1.6;
  font-size: 0.92rem;
}

.page-about .about-cta {
  margin: 3rem 0 2rem;
  text-align: center;
}

.page-about .button-primary {
  background: var(--color-primary, #2563eb);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: var(--ui-button-radius);
  text-decoration: none;
  display: inline-block;
  font-weight: 500;
  transition: background 0.2s;
}

.page-about .button-primary:hover {
  background: var(--color-primary-hover, #1d4ed8);
}

/* ===================================================================
   Footer Navigation & Landing CTA
   =================================================================== */

.app-footer {
  margin-top: 3rem;
  padding: 10px 1rem;
  text-align: center;
}

.footer-nav {
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.footer-nav a {
  color: var(--color-text-muted, #888);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--color-text, #fff);
  text-decoration: underline;
}

.footer-nav .sep {
  margin: 0 0.5rem;
  color: var(--color-text-muted, #888);
}

.app-footer .footer-credit-link {
  text-decoration: none;
}

.landing-cta {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--color-text-muted, #888);
}

.landing-cta a {
  color: var(--link);
  text-decoration: none;
  margin-left: 0.25rem;
}

.landing-cta a:hover {
  text-decoration: underline;
}

.page-about .about-cta .hint {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--color-text-muted, #888);
}

.page-about .about-cta .hint a {
  color: var(--link);
  text-decoration: none;
}

.page-about .about-cta .hint a:hover {
  text-decoration: underline;
}

/* Specials: "Select all" text action — match host actions (dotted underline) */
#rowSpecialsPick :is(button:not(.spc):not([role="switch"]), a:not(.spc), .text-action){
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 2px 6px !important;       /* keep a small click area */
  border-radius: 0 !important;
  font-weight: 600;
  text-decoration: none !important;  /* no text decoration */
  display: inline-block;              /* ensure border-bottom renders nicely */
  border-bottom: 1px dotted transparent !important; /* dotted baseline (hidden) */
}

#rowSpecialsPick :is(button:not(.spc):not([role="switch"]), a:not(.spc), .text-action):hover{
  background: transparent !important;
  text-decoration: none !important;  /* stay consistent with host actions */
  border-bottom-color: currentColor !important; /* show dotted underline on hover */
}







/* Participants: long names may grow up to the chip (desktop only) */
@media (min-width: 769px){
  /* Let the left area (icon + name) take the remaining space */
  #liveParticipantList .participant-row .row-left{
    flex: 1 1 auto !important;
    min-width: 0 !important; /* required so text can actually shrink before ellipsis */
  }

  /* The name itself can grow; ellipsis only when it truly hits the chip */
  #liveParticipantList .participant-row .row-left .name{
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: none !important; /* remove any hard caps */
    white-space: nowrap;        /* keep single line */
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Keep the right area (chip + actions) content-sized, unchanged */
  #liveParticipantList .participant-row .row-right{
    flex: 0 0 auto !important;
  }
}


/* Participant row: maximize name space on desktop (edge widths) */
@media (min-width: 769px){
  /* Reduce column gap a bit on narrow desktop; scales up on wide screens */
  #liveParticipantList .participant-row{
    column-gap: clamp(8px, 1.2vw, 16px);
  }

  /* Let the left column (icon + name) take all remaining space */
  #liveParticipantList .participant-row .row-left{
    flex: 1 1 auto !important;
    min-width: 0 !important;             /* critical for proper ellipsis */
  }
  #liveParticipantList .participant-row .row-left > *{
    min-width: 0 !important;             /* allow children to shrink */
  }

  /* Name element: single line, no hard caps, ellipsis only at real limit */
  #liveParticipantList .participant-row .row-left [class*="name"]{
    display: block;
    min-width: 0 !important;
    max-width: none !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Right column stays content-sized; tighten internal spacing slightly */
  #liveParticipantList .participant-row .row-right{
    flex: 0 0 auto !important;
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 12px);         /* a touch tighter near 770–900px */
    white-space: nowrap;                  /* keep actions on one line */
  }
  #liveParticipantList .participant-row .row-right .vote-chip{
    flex: 0 0 auto;                       /* chip never shrinks */
  }
  #liveParticipantList .participant-row .row-right .actions{
    white-space: nowrap;                  /* text actions never wrap */
  }
}



/* === Desktop: center participant vote chip exactly on page center === */
@media (min-width: 769px){
  /* reference box for absolute positioning */
  #liveParticipantList .participant-row{ position: relative; }

  /* place the chip on the exact page center line */
  #liveParticipantList .participant-row .row-right :where(.vote-chip,.mini-chip,.status-icon){
    position: absolute;           /* remove from flex flow */
    grid-column: auto;
    left: 50%;                    /* page center */
    translate: -50% 0;            /* keep horizontal centering independent of chipIn */
    transform: none;
    pointer-events: none;         /* keep Host/Spectator/Kick clickable */
    z-index: 1;
  }

  /* host actions remain right-aligned (unchanged behavior) */
  #liveParticipantList .participant-row .row-right > .row-action:first-of-type{
    margin-left: auto;
  }
}

/* Shared typography and surface details. */
h1,h2,h3{font-weight:var(--ui-heading-weight)}
:root .button:hover{filter:none}
:root .choice-btn:hover,
:root .menu-item:not(.danger):not(.switch):not(.room-exit-action):hover{box-shadow:inset 0 0 0 1px var(--accent)}

/* Theme-aware surfaces and typography. */

:root h1{font-size:1.25rem;line-height:1.4}
:root h2{font-size:1.1rem;line-height:1.45}
:root .participant-heading{font-size:var(--ui-meta-label-size);line-height:var(--ui-meta-label-line-height)}
:root h3{line-height:1.45}
:root .page-about .about-section h2{font-size:1.4rem}
:root .page-about .about-section p{line-height:1.8}

/* Raised controls retain their existing focus and disabled affordances. */
:root .button{padding-inline:1.4rem;box-shadow:var(--ui-shadow-sm);font-weight:600}
:root .button:hover:not(:disabled){box-shadow:var(--ui-shadow-md);transform:translateY(-1px)}
:root .button:active:not(:disabled){transform:translateY(1px)}
:root :is(input[type="text"],input[type="search"],input[type="email"],input[type="url"],input[type="password"],input[type="number"],input[type="tel"],textarea,select):not(:focus){
  background:color-mix(in srgb,var(--field-bg) 95%,var(--panel));
  border-color:color-mix(in srgb,var(--field-border) 85%,var(--field-bg));
  box-shadow:var(--ui-shadow-sm);
}
:root .card-grid button{
  min-height:48px;padding:.7rem .6rem;border-color:var(--ui-surface-border);
  background:var(--panel);font-weight:600;
}
:root .card-grid button:hover:not(:disabled):not(.selected){
  background:var(--panel-hover);border-color:var(--accent);transform:translateY(-2px);
}
:root .card-grid button.selected{
  background:var(--accent-strong) !important;border-color:var(--accent);
  box-shadow:0 0 0 2px color-mix(in srgb,var(--accent) 30%,transparent),var(--ui-shadow-sm);
}
:root .card-grid button:disabled{background:var(--panel-2);box-shadow:none}

/* Padding changes do not replace either desktop or mobile participant grids. */
:root #liveParticipantList .participant-row{
  padding:11px 16px;margin-bottom:.6rem;
  border-bottom-color:var(--ui-surface-border);background:var(--ui-surface);box-shadow:var(--ui-shadow-sm);
}
:root #liveParticipantList .participant-row.is-host{
  background:color-mix(in srgb,var(--ui-surface) 92%,var(--accent));
  outline-color:color-mix(in srgb,var(--accent) 30%,transparent);
}
:root #liveParticipantList .name{font-weight:600}
:root :is(.topic-row,.topic-edit){
  border-radius:var(--ui-panel-radius);border-color:var(--ui-surface-border);box-shadow:var(--ui-shadow-sm);
}
:root .topic-row.editable:hover{background:var(--panel-hover)}
:root #resultRow{
  background:var(--ui-surface);border-color:var(--ui-surface-border);
  border-radius:var(--ui-panel-radius);box-shadow:var(--ui-shadow-sm);
}

/* Menu surfaces keep selected states distinct without heavy surrounding rings. */
:root .menu-panel{border-color:var(--ui-surface-border)}
@media (min-width:769px){
  :root .menu-overlay .menu-panel{border-radius:0}
}
:root .menu-header{padding:8px 6px 12px;border-bottom-color:var(--ui-surface-border)}
:root .menu-header h3{font-size:1.1rem}
:root .menu-section{gap:12px;padding-block:12px 14px}
:root .section-title{font-weight:600;opacity:1;color:var(--text-dim)}
:root :is(.menu-item:not(.danger):not(.switch):not(.room-exit-action),.radio-row,.choice-btn){
  background:var(--ui-surface-raised);border-color:var(--ui-surface-border);box-shadow:none;
}
:root .menu-choice:not(.vertical){gap:6px}
:root .choice-btn{height:38px;padding-inline:12px}
:root .radio-row{padding:11px 12px}
:root :is(.menu-item:not(.danger):not(.switch):not(.room-exit-action),.radio-row,.choice-btn):hover{
  background:var(--panel-2-hover);border-color:var(--accent);box-shadow:var(--ui-shadow-sm);
}
:root :is(.choice-btn.active,.choice-btn[aria-pressed="true"],.radio-row:has(input:checked)){
  background:color-mix(in srgb,var(--ui-surface-raised) 84%,var(--accent));
  border-color:var(--accent);box-shadow:var(--ui-shadow-sm);font-weight:600;
}
:root .menu-button{border-color:var(--ui-surface-border);box-shadow:var(--ui-shadow-sm)}
:root .menu-button:hover{border-color:var(--accent);box-shadow:var(--ui-shadow-md)}

/* Explanatory content gets a softer surface and clearer reading rhythm. */
:root .page-about :is(.about-intro,.about-section){
  border:1px solid var(--ui-surface-border);
  border-radius:var(--ui-large-radius);
  background:var(--ui-surface);
  padding:clamp(16px,2vw,24px);
  box-shadow:var(--ui-shadow-sm);
}
:root .page-about .about-intro{
  background:linear-gradient(135deg,color-mix(in srgb,var(--ui-surface) 92%,var(--accent)),var(--ui-surface));
}
:root .page-about .about-container{font-size:.78rem}
:root .page-about .about-container > .app-title{font-size:1.05rem;line-height:1.4}
:root .page-about .lead{color:var(--text);font-size:.86rem;line-height:1.55}
:root .page-about .about-section h2{font-size:.98rem;line-height:1.4}
:root .page-about .about-section p{font-size:.78rem;line-height:1.6}
:root .page-about :is(.feature-list li,.steps-list li){font-size:.78rem;line-height:1.5}
:root .page-about .about-cta .hint{font-size:.78rem}
:root .page-about .about-cta .button-primary{font-size:.85rem}
:root :is(.room-manual-details,.landing-explainer){
  border-radius:var(--ui-large-radius);background:var(--ui-surface);
  border:1px solid var(--ui-surface-border);padding:20px;box-shadow:var(--ui-shadow-md);
}
:root .room-manual-details{padding:0}
:root .room-manual-details > summary{padding:14px 16px}
:root .room-manual-body{padding:16px;border-color:var(--ui-surface-border)}
:root .landing-explainer{line-height:1.75}
:root .landing-explainer h1{font-size:1.1rem;line-height:1.45;margin-top:.25rem;margin-bottom:1rem}
:root .landing-explainer h2{font-size:1.05rem;margin:1.2rem 0 .6rem}

/* Shared header shell; final preference controls are separate redesign stories. */
.app-header{
  display:flex;align-items:center;justify-content:space-between;gap:16px;
  width:calc(100% + 4rem);max-width:none;margin:0 -2rem;
  padding:12px clamp(24px,2.5vw,32px);
}
.app-brand{
  display:flex;align-items:center;gap:8px;min-width:0;
  color:var(--text-strong);text-decoration:none;font-size:1.8em;font-weight:700;
}
.app-brand img{flex:none;object-fit:contain}
.app-brand span{overflow-wrap:anywhere}
.app-utilities{display:flex;align-items:center;gap:10px;flex:none}
.app-header .header-controls{position:static}
.app-header .menu-button{position:relative;inset:auto;flex:none}
.mobile-language{display:none}
.menu-preferences{display:contents}
@media (min-width:769px){
  .menu-preferences{display:none}
}
@media (max-width:768px){
  .app-header{gap:8px;padding:8px 16px}
  .app-brand{font-size:1.4em}
  .desktop-language{display:none}
  .desktop-theme{display:none}
  .mobile-language{display:flex}
  .menu-preferences{display:flex;align-items:flex-end;gap:0}
  .menu-preferences .menu-section{min-width:0;padding-inline:0}
  .menu-preferences .menu-section + .menu-section{position:relative;margin-left:12px;padding-left:12px}
  .menu-preferences .menu-section + .menu-section::before{
    content:"";position:absolute;left:0;top:12px;bottom:10px;border-left:1px solid var(--ui-surface-border);
  }
  .page-room .main-info-group--room{padding-inline-end:62px}
  .page-room .room-with-actions{display:flex;width:100%;min-width:0}
  .page-room #roomCodeVal{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .page-room .room-with-actions .icon-button{flex:none;margin-left:0}
  .page-room .room-with-actions .icon-button,
  .page-room .topic-actions .icon-button{min-width:40px;min-height:40px}
  .page-room #rowSpecials .specials-icons .spc{width:40px;height:40px}
}
/* One modal settings container: desktop drawer and mobile sheet. */
.menu-overlay{z-index:1200}
html.menu-scroll-locked, .menu-scroll-locked body{overflow:hidden}
.menu-overlay .menu-panel{
  top:0;right:0;bottom:0;width:min(440px,100%);height:100vh;height:100dvh;
  max-height:none;border-radius:0;overscroll-behavior:contain;
  padding-top:max(12px,env(safe-area-inset-top));
  padding-bottom:max(14px,env(safe-area-inset-bottom));
  animation:settings-enter 160ms ease-out;
}
.menu-overlay .menu-header{display:flex;align-items:center;justify-content:space-between;gap:12px}
#menuCloseButton{
  flex:none;width:40px;height:40px;min-width:40px;min-height:40px;
  border-radius:var(--ui-button-radius);background:var(--panel);color:var(--text-strong);
  box-shadow:var(--ui-panel-shadow);font-size:18px;
}
:root #menuCloseButton{
  border-color:var(--ui-surface-border);box-shadow:var(--ui-shadow-sm);
}
.app-header .menu-button:hover,#menuCloseButton:hover{
  background:var(--panel-hover);border-color:var(--accent);
}
:root #menuCloseButton:hover{box-shadow:var(--ui-shadow-md)}
@keyframes settings-enter{from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:translateX(0)}}
@media (max-width:768px){
  .menu-overlay .menu-panel{
    top:max(8px,env(safe-area-inset-top));right:8px;bottom:8px;
    width:calc(100% - 16px);height:auto;
    border-radius:var(--ui-radius-lg);
  }
}
@media (prefers-reduced-motion:reduce){
  .menu-overlay .menu-panel{animation:none}
  *,*::before,*::after{transition:none !important;scroll-behavior:auto !important}
  .vote-chip{animation:none;opacity:1;transform:none}
  .toast{animation:none;opacity:1;transform:none}
  .average-label #averageVote{animation:none;opacity:1;transform:none}
  button.shake{animation:none}
  .button:hover,.button:active,.card-grid button:hover{transform:none !important}
}

/* Participant actions share one menu on desktop and mobile. */
#liveParticipantList .participant-more{
  margin-left:auto;flex:none;width:32px;height:32px;padding:0;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid transparent;border-radius:var(--ui-button-radius);
  background:transparent;color:var(--text-dim);box-shadow:none;
  font-size:0;line-height:1;cursor:pointer;
}
#liveParticipantList .participant-more::before{
  content:"";width:3px;height:3px;border-radius:50%;background:currentColor;
  box-shadow:-6px 0 currentColor,6px 0 currentColor;
}
#liveParticipantList .participant-more:hover,
#liveParticipantList .participant-more[aria-expanded="true"]{
  background:var(--panel-hover);border-color:var(--ui-surface-border);color:var(--text-strong);
}
#liveParticipantList .participant-action-menu{
  position:absolute;top:calc(100% - 6px);right:12px;z-index:50;
  width:max-content;max-width:calc(100% - 24px);max-height:calc(100vh - 32px);overflow-y:auto;
  padding:6px;border:1px solid var(--ui-surface-border);border-radius:var(--ui-panel-radius);
  background:var(--ui-surface-raised);box-shadow:var(--ui-shadow-md);
}
#liveParticipantList .participant-action-menu.opens-up{top:auto;bottom:calc(100% - 6px)}
#liveParticipantList .participant-action-menu .row-action{
  display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:8px 10px;text-align:left;
  border:0;border-radius:var(--shape-radius-small);box-shadow:none;
  background:transparent;color:var(--text);font:inherit;font-size:.85rem;cursor:pointer;
}
#liveParticipantList .participant-action-icon{
  flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round;
}
#liveParticipantList .participant-action-menu .row-action:hover{background:var(--panel-hover)}
#liveParticipantList .participant-action-menu .kick{color:var(--danger)}
#liveParticipantList :is(.participant-more,.participant-action-menu .row-action):focus-visible{
  outline:2px solid var(--accent);outline-offset:2px;
}

/* RP-003: calm participant rows with stable identity, vote and action zones. */
.participant-section{
  margin-top:1.2rem;border:1px solid color-mix(in srgb,var(--ui-surface-border) 65%,transparent);
  border-radius:var(--ui-panel-radius);background:transparent;overflow:visible;
}
.participant-section .participant-heading{margin:0;padding:10px 16px}
:root #liveParticipantList{
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
:root #liveParticipantList .participant-row{
  grid-template-columns:var(--icon-col-width) minmax(0,1fr) minmax(0,1fr);
  min-height:54px;margin:0;padding:11px 16px;border:0;border-bottom:1px solid var(--ui-surface-border);
  border-radius:0;background:transparent;box-shadow:none;outline:0;position:relative;
}
:root #liveParticipantList .participant-row:last-child{border-bottom:0}
:root #liveParticipantList .participant-row.is-host{background:transparent;outline:0}
:root #liveParticipantList .participant-icon{
  color:var(--text-dim);font-size:.9rem;opacity:.72;
}
:root #liveParticipantList .participant-identity{
  display:flex;align-items:center;gap:.4rem;min-width:0;
}
:root #liveParticipantList .participant-identity .name{
  min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
:root #liveParticipantList .participant-role{
  flex:none;display:inline-flex;align-items:center;justify-content:center;
  inline-size:auto;block-size:auto;min-width:0;padding:0;border:0;border-radius:0;
  background:transparent;box-shadow:none;color:var(--text-dim);
  font-family:inherit;font-size:.72rem;font-weight:700;line-height:1;
}
:root #liveParticipantList .participant-role-host{font-size:.8rem}
:root #liveParticipantList .participant-role-spectator{font-size:.72rem}
:root #liveParticipantList .participant-role-inactive{
  font-size:.58rem;letter-spacing:-.04em;text-transform:lowercase;
}
:root #liveParticipantList .participant-row.disconnected .participant-identity{opacity:.78}

@media (max-width:768px){
  .participant-section .participant-heading{padding-inline:12px}
  :root #liveParticipantList .participant-row{
    grid-template-columns:var(--icon-col-width) minmax(0,1fr) 40px;
    min-height:52px;padding:10px 12px;
  }
  :root #liveParticipantList .participant-row .participant-identity{
    grid-column:2;grid-row:1;width:auto;min-width:0;overflow:hidden;
  }
  :root #liveParticipantList .participant-row .participant-identity .name{flex:0 1 auto}
  :root #liveParticipantList .participant-row .name{grid-column:auto;grid-row:auto}
  :root #liveParticipantList .participant-row .row-right :where(.vote-chip,.mini-chip,.status-icon){
    position:absolute;left:50%;translate:-50% 0;transform:none;pointer-events:none;z-index:1;
  }
  :root #liveParticipantList .participant-row .row-right{
    min-width:40px;justify-content:flex-end;
  }
}
@media (max-width:600px){
  :root #liveParticipantList .participant-row{
    grid-template-columns:var(--icon-col-width) minmax(0,1fr) auto;
  }
  :root #liveParticipantList .participant-row .row-right :where(.vote-chip,.mini-chip,.status-icon){
    position:static;translate:none;transform:none;
  }
}
:root[data-theme="light"] #liveParticipantList .participant-row.is-host{
  background:transparent;outline:0;
}

/* Mobile voting tracks stay fixed to shared axes inside a centered grid. */
@media (max-width:768px){
  #cardGrid.card-grid,
  #cardGrid.card-grid.fixed4{
    width:100% !important;max-width:100% !important;margin-inline:auto !important;
    grid-template-columns:repeat(auto-fill,minmax(var(--card-min-mobile),var(--card-max-mobile)));
    justify-content:center !important;justify-items:center !important;
  }
}
