:root {
  color-scheme: light;
  --ink: #2e3a4b;
  --muted: #667085;
  --line: #e6e1d8;
  --paper: #f6f4ef;
  --card: #fffefb;
  --accent: #28536b;
  --accent-soft: #e3eef5;
  --green: #1f7049;
  --green-bg: #e3f5ea;
  --yellow: #8a5c00;
  --yellow-bg: #fff3d2;
  --red: #a3283a;
  --red-bg: #fde6ea;
  --blue: #2c5a82;
  --blue-bg: #e4eefb;
  --purple: #5f4b8b;
  --purple-bg: #efe9fb;
  --peach: #93522c;
  --peach-bg: #fdeee2;
  --teal: #1d6b6b;
  --teal-bg: #e0f3f1;
  --danger: #a3283a;
  --field: #fff;
  --subtle: #f3f0ea;
  --soft: #faf8f4;
  --chip: #f0ece4;
  --dash: #d7d0c3;
  --faint: #b3ab9d;
  --brand-ink: #15213b;
  --nav-bg: #1f3d4e;
  --accent-line: #9ebfd3;
  --blue-line: #c4d7ef;
  --red-line: #f1b8c1;
  --late: #b45309;
}
/* Dark theme: public/theme.js sets data-theme from the saved choice or the device setting. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e3e7ee;
  --muted: #9aa4b2;
  --line: #2e3744;
  --paper: #12171e;
  --card: #1a212b;
  --accent: #4a88ad;
  --accent-soft: #1d3444;
  --green: #6fcf97;
  --green-bg: #16332a;
  --yellow: #f0c566;
  --yellow-bg: #362c12;
  --red: #f28b9b;
  --red-bg: #3d1c24;
  --blue: #8fbbea;
  --blue-bg: #1a2a3e;
  --purple: #bca9ec;
  --purple-bg: #2a2342;
  --peach: #f0a878;
  --peach-bg: #3a2519;
  --teal: #6fd0c6;
  --teal-bg: #133230;
  --danger: #c2344a;
  --field: #151b23;
  --subtle: #232b36;
  --soft: #1e2530;
  --chip: #2a323d;
  --dash: #3a4452;
  --faint: #5c6675;
  --brand-ink: #f1f5f9;
  --nav-bg: #0f1a22;
  --accent-line: #36617a;
  --blue-line: #36506e;
  --red-line: #6e2a36;
  --late: #f4a35c;
}
:root[data-theme="dark"] .tone-pink { --t-bg: #3b1d2c; --t-fg: #f29cc4; }
:root[data-theme="dark"] .tone-orange { --t-bg: #3a2119; --t-fg: #f4a184; }
:root[data-theme="dark"] .tone-indigo { --t-bg: #23254a; --t-fg: #a9adf2; }
:root[data-theme="dark"] .tone-brown { --t-bg: #33291c; --t-fg: #d9b98a; }
:root[data-theme="dark"] .tone-sky { --t-bg: #15303f; --t-fg: #86c8ea; }
:root[data-theme="dark"] :is(.login-brand img, .brand-mark) { background: #fff; border-radius: 50%; padding: 2px; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
:root[data-theme="dark"] .leaflet-container { background: #1b222b; }
:root[data-theme="dark"] .leaflet-bar a, :root[data-theme="dark"] .leaflet-control-attribution { background: var(--card); color: var(--muted); border-color: var(--line); }
:root[data-theme="dark"] .leaflet-control-attribution a { color: var(--blue); }
:root[data-theme="dark"] :is(.leaflet-popup-content-wrapper, .leaflet-popup-tip, .leaflet-tooltip) { background: var(--card); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] .leaflet-tooltip::before { border-top-color: var(--card); }
* { box-sizing: border-box; }
/* Each typed value picks its own direction, so Arabic and Urdu read right to left inside left-to-right screens. */
:where(input, textarea) { unicode-bidi: plaintext; }
/* Type comes from the Mantine theme (ui/theme.js), so plain pages and Mantine screens share one scale. */
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--mantine-font-family, "Avenir Next", "Segoe UI", system-ui, sans-serif); font-size: var(--mantine-font-size-sm, 13px); line-height: var(--mantine-line-height-sm, 1.45); }
h1 { margin: 0; font-size: var(--mantine-h1-font-size, 20px); font-weight: 600; }
h2 { margin: 0 0 4px; font-size: var(--mantine-font-size-md, 14px); font-weight: 600; }
h3, strong, b { font-weight: 600; }
code { background: var(--purple-bg); color: var(--purple); border-radius: 4px; padding: 0 4px; }
/* Bare element rules skip Mantine screens (.gms-ui) and stay at zero specificity so class rules still win. */
:where(button:not(.gms-ui *)) { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 6px 10px; background: var(--accent); color: white; cursor: pointer; font-weight: 600; white-space: nowrap; }
:where(button:not(.gms-ui *)):hover { filter: brightness(1.05); }
button.soft { background: var(--accent-soft); color: var(--accent); }
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button.danger { color: var(--red); }
button.icon-only { padding: 5px; }
:where(button:not(.gms-ui *)):disabled { opacity: 0.45; cursor: not-allowed; }
.icon { width: 15px; height: 15px; flex: none; }
:where(:is(input, select, textarea):not(.gms-ui *)) { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--field); color: var(--ink); }
:where(:is(input, select, textarea):not(.gms-ui *)):focus { outline: 2px solid var(--blue-bg); border-color: var(--blue); }
:where(textarea:not(.gms-ui *)) { min-height: 64px; resize: vertical; }
:where(label:not(.gms-ui *)) { display: grid; gap: 3px; font-weight: 500; margin-top: 8px; }
:where(fieldset:not(.gms-ui *)) { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 0; padding: 6px 8px; min-width: 0; }
:where(legend:not(.gms-ui *)) { font-weight: 500; padding: 0 4px; }
.hidden { display: none !important; }
.error { color: var(--red); min-height: 1em; margin: 6px 0 0; }
.error:empty { display: none; }
.eyebrow { margin: 0; letter-spacing: 0.08em; text-transform: uppercase; font-size: 10px; font-weight: 600; color: var(--accent); }
.muted { color: var(--muted); margin: 3px 0 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; background: var(--chip); color: var(--muted); }
.badge .icon { width: 12px; height: 12px; }
.badge.big { font-size: 12px; padding: 4px 12px; }
.badge.GREEN { background: var(--green-bg); color: var(--green); }
.badge.YELLOW, .badge.soft-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge.RED { background: var(--red-bg); color: var(--red); }
.badge.OPEN, .badge.soft-blue, .badge.notification { background: var(--blue-bg); color: var(--blue); }
.badge.soft-purple, .badge.milestone { background: var(--purple-bg); color: var(--purple); }
.badge.wait { background: var(--green-bg); color: var(--green); }
.badge.escalation { background: var(--peach-bg); color: var(--peach); }

.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue-bg), var(--purple-bg) 55%, var(--peach-bg)); }
.login form { width: min(340px, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: grid; gap: 4px; box-shadow: 0 12px 40px rgb(40 83 107 / 0.12); }
.login h1 { font-size: 24px; margin-bottom: 4px; }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.login-brand div { display: grid; line-height: 1.2; }
.login-brand strong { font-size: 20px; color: var(--brand-ink); }
.login-brand span { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.login button { justify-content: center; margin-top: 12px; padding: 8px; }

#app { display: grid; grid-template-columns: 188px minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns 0.15s; }
#app.collapsed { grid-template-columns: 54px minmax(0, 1fr); }
#nav { position: sticky; top: 0; height: 100vh; background: var(--nav-bg); color: white; display: flex; flex-direction: column; gap: 2px; padding: 10px 8px; }
#nav .brand { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 10px; min-height: 28px; }
#nav .brand button { background: transparent; color: white; }
#nav .brand-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* The logo's black G needs a light backing on the dark panel. */
#nav .brand-logo { flex: none; background: white; border-radius: 50%; padding: 2px; }
#app.collapsed #nav .brand-name { display: none; }
#nav .nav { justify-content: flex-start; background: transparent; color: #dce7ee; padding: 8px 10px; }
#nav .nav:hover { background: rgb(255 255 255 / 0.08); }
#nav .nav.active { background: #e4eefb; color: #1f3d4e; }
#nav .nav-end { margin-top: auto; }
#nav .nav-demo:not(.hidden) + .nav-end { margin-top: 0; }
#nav .nav-demo { color: #ffc27a; }
#app.collapsed .label { display: none; }
#app.collapsed #nav .nav { justify-content: center; padding: 8px 0; }
#app.collapsed #nav .brand { justify-content: center; }
#main { padding: 14px 18px 32px; min-width: 0; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.card { display: grid; gap: 8px; align-content: start; }
.card-head { display: flex; align-items: center; gap: 6px; }
.card-head h2 { margin: 0; flex: 1; }
.card-head .icon { color: var(--accent); width: 17px; height: 17px; }
.title-input { font-size: 16px; font-weight: 600; border-color: transparent; background: transparent; width: 280px; }
.title-input:hover { border-color: var(--line); }
:where(table:not(.gms-ui *)) { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
:where(th:not(.gms-ui *)) { background: var(--subtle); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
:where(:is(th, td):not(.gms-ui *)) { text-align: left; border-bottom: 1px solid var(--line); padding: 7px 10px; vertical-align: middle; }
:where(tbody tr:not(.gms-ui *)):hover { background: var(--soft); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.builder { display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(240px, 290px); gap: 10px; align-items: start; }
.builder > .panel { min-width: 0; }
.builder > .panel:last-child { position: sticky; top: 68px; max-height: calc(100vh - 80px); overflow: auto; }
.palette-card { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; background: var(--field); padding: 8px; margin-top: 6px; cursor: grab; }
.palette-card:hover { box-shadow: 0 2px 10px rgb(0 0 0 / 0.06); }
.palette-card .icon { margin-top: 2px; }
.palette-card.notification .icon, .box.notification .box-icon { color: var(--blue); }
.palette-card.wait .icon, .box.wait .box-icon { color: var(--green); }
.palette-card.milestone .icon, .box.milestone .box-icon { color: var(--purple); }
.palette-card.escalation .icon, .box.escalation .box-icon { color: var(--peach); }
.canvas { list-style: none; margin: 0; padding: 6px; min-height: 260px; border: 1px dashed var(--dash); border-radius: 10px; background: var(--soft); }
.canvas.over { background: var(--blue-bg); border-color: var(--blue); }
.canvas .empty { color: var(--muted); text-align: center; padding: 60px 0; }
.box { display: grid; grid-template-columns: 20px 22px 1fr auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--field); padding: 8px; margin-bottom: 6px; cursor: pointer; }
.box:hover { border-color: var(--dash); }
.box.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.box strong { margin-right: 6px; }
.step-no { color: var(--muted); font-size: 11px; font-weight: 600; text-align: center; }
.box-icon .icon { width: 18px; height: 18px; }
.preview { margin-top: 10px; padding: 8px; border-radius: 8px; background: var(--blue-bg); }
.preview p { margin: 2px 0 0; }

.player-top { margin-bottom: 10px; display: grid; gap: 6px; }
.clock-wrap { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.clock-wrap .icon { width: 26px; height: 26px; }
.clock { font-size: 36px; font-weight: 600; margin: 0; font-variant-numeric: tabular-nums; color: var(--ink); }
.sequence { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.step { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--dash); border-radius: 10px; padding: 9px 12px; }
.step.GREEN { border-left-color: #7cc9a0; }
.step.YELLOW { border-left-color: #f1c35a; }
.step.RED { border-left-color: #ec8a99; background: color-mix(in srgb, var(--red-bg) 35%, var(--card)); }
.step.OPEN { border-left-color: #8fb4df; background: color-mix(in srgb, var(--blue-bg) 25%, var(--card)); }
.when { display: grid; gap: 4px; justify-items: start; font-variant-numeric: tabular-nums; }
.step h2 { margin: 0; }
.step-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.line { margin: 4px 0 0; padding: 4px 8px; border-radius: 6px; background: var(--subtle); color: var(--muted); }
.line.RED { background: var(--red-bg); color: var(--red); }

.act-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(135deg, var(--blue-bg), var(--purple-bg) 55%, var(--peach-bg)); font-size: 15px; }
.act-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: grid; gap: 8px; box-shadow: 0 12px 40px rgb(40 83 107 / 0.12); }
.act-card h1 { font-size: 22px; }
.act-card .big { justify-content: center; padding: 14px; font-size: 17px; border-radius: 12px; margin-top: 8px; }

.badge.decision { background: var(--teal-bg); color: var(--teal); }
.palette-card.decision .icon, .box.decision .box-icon { color: var(--teal); }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.choices button { justify-content: center; }
button.alt { background: var(--peach-bg); color: var(--peach); }
.step-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.responders { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; align-items: center; }
.responders .badge { font-weight: 600; }
.responder-count { font-size: 11px; color: var(--muted); margin-right: 2px; }
.choice-made { font-weight: 600; color: var(--teal); }
.option-list { display: grid; gap: 4px; }
.option-row { display: flex; gap: 4px; }

.member-page { background: linear-gradient(160deg, var(--blue-bg), var(--purple-bg) 55%, var(--peach-bg)); min-height: 100vh; font-size: 15px; }
.member-login { display: grid; place-items: center; padding: 6vh 0 16px; }
.member-card { width: min(380px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; display: grid; gap: 8px; box-shadow: 0 12px 40px rgb(40 83 107 / 0.14); }
.member-card h1 { margin: 6px 0 0; font-size: 24px; }
.brand-mark { display: block; flex: none; object-fit: contain; }
.app-brand { display: flex; align-items: center; gap: 10px; }
.app-brand strong { font-size: 18px; color: var(--brand-ink); }
.member-card .big, .action-card .big { justify-content: center; padding: 13px; font-size: 16px; border-radius: 12px; }
.member-top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.member-top strong { font-size: 17px; }
.bell { position: relative; background: var(--accent-soft); color: var(--accent); border-radius: 50%; width: 44px; height: 44px; justify-content: center; padding: 0; }
.bell .icon { width: 22px; height: 22px; }
.bell.ringing .icon { animation: ring 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
.bell-count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; border-radius: 999px; background: var(--danger); color: white; font-size: 11px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--card); }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
.member-main { width: min(560px, 100%); margin: 0 auto; padding: 12px 14px 40px; display: grid; gap: 14px; }
.member-main h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 6px 2px 8px; }
.member-panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 10px 30px rgb(40 83 107 / 0.12); }
.member-panel-head { display: flex; justify-content: space-between; align-items: center; }
.member-panel-head h2 { margin: 0; }
.note-item { display: flex; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); }
.note-item p { margin: 3px 0; }
.note-item.unread { background: var(--blue-bg); border-radius: 10px; padding: 10px 8px; }
.note-item.escalation .note-icon { color: var(--peach); }
.note-item.request .note-icon { color: var(--teal); }
.note-icon { color: var(--blue); padding-top: 2px; }
.note-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.action-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; display: grid; gap: 8px; box-shadow: 0 6px 20px rgb(40 83 107 / 0.08); }
.action-card p { margin: 0; }
.action-message:empty { display: none; }
.empty { padding: 10px 2px; }
.small { font-size: 11px; }
#nav .nav-scroll { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
#nav .nav-head { margin: 10px 10px 2px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #9fb6c4; }

.tabs { display: grid; gap: 10px; }
.tab-bar { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.tab { background: transparent; color: var(--muted); padding: 8px 14px; border-radius: 9px; }
.tab:hover { background: var(--subtle); filter: none; }
.tab[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.placeholder { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 48px 16px; background: var(--card); border: 1px dashed var(--dash); border-radius: 12px; color: var(--accent); }
.placeholder .icon { width: 32px; height: 32px; }
.placeholder h2 { margin: 4px 0 0; font-size: 16px; color: var(--ink); }
.placeholder p { max-width: 420px; }

.member-tools { display: flex; gap: 8px; align-items: center; min-width: 44px; justify-content: flex-end; }
.member-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-back { position: fixed; inset: 0; z-index: 20; background: rgb(31 39 51 / 0.35); opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.drawer { position: fixed; z-index: 21; inset: 0 auto 0 0; width: min(300px, 84vw); display: flex; flex-direction: column; gap: 2px; padding: 14px; padding-top: max(14px, env(safe-area-inset-top)); overflow-y: auto; background: var(--card); box-shadow: 8px 0 30px rgb(31 39 51 / 0.18); transform: translateX(-100%); visibility: hidden; transition: transform 0.22s ease, visibility 0s 0.22s; }
.menu-open { overflow: hidden; }
.menu-open .drawer { transform: none; visibility: visible; transition: transform 0.22s ease; }
.menu-open .drawer-back { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.drawer-head strong { flex: 1; font-size: 16px; }
.drawer-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--accent-soft); }
.drawer-user .muted { margin: 0; }
.drawer-avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: white; font-weight: 600; text-transform: uppercase; }
.drawer-label { margin: 14px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.drawer-links { display: grid; gap: 2px; }
.drawer-link { display: flex; align-items: center; justify-content: flex-start; gap: 12px; width: 100%; padding: 11px 10px; border-radius: 10px; background: transparent; color: var(--ink); font-size: 15px; font-weight: 500; text-decoration: none; }
.drawer-link:hover { background: var(--subtle); filter: none; }
.drawer-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.drawer-link .icon { width: 20px; height: 20px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 4px; padding: 4px; border-radius: 12px; background: var(--subtle); }
.theme-pick button { justify-content: center; gap: 6px; padding: 9px 6px; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 500; }
.theme-pick button[aria-checked="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
.theme-pick .icon { width: 16px; height: 16px; }
.info-page { display: grid; gap: 14px; }
.info-page > h1, .greeting h1 { font-size: 22px; margin: 8px 2px 0; }
.greeting p { margin: 2px 2px 0; }
.hero { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 40px rgb(40 83 107 / 0.12); }
.hero h1 { margin: 6px 0 0; font-size: 26px; }
.hero p { margin: 0; max-width: 380px; }
.cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; padding: 12px 20px; border-radius: 12px; background: var(--accent); color: white; font-size: 16px; font-weight: 600; text-decoration: none; }
.cta .icon { width: 18px; height: 18px; }
.widgets { display: grid; gap: 10px; }
.widget { display: flex; gap: 12px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px rgb(40 83 107 / 0.08); }
.widget > div { flex: 1; min-width: 0; }
.widget p { margin: 3px 0 0; }
.widget-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.widget-icon .icon { width: 20px; height: 20px; }
.push-banner { width: min(560px, calc(100% - 28px)); margin: 12px auto 0; background: var(--yellow-bg); color: var(--yellow); border-radius: 14px; padding: 12px 14px; }
.push-banner p { margin: 4px 0 0; font-size: 13px; }
.push-banner button { margin-top: 8px; }
.geo-banner { background: var(--accent-soft); color: var(--accent); }
.geo-line { display: flex; align-items: center; gap: 5px; margin: 4px 2px 0; color: var(--muted); }
.geo-line.on { color: var(--green); }
.geo-line svg { width: 14px; height: 14px; flex: none; }
.drawer-user .geo-line { margin: 2px 0 0; }
.member-names { font-size: 12px; color: var(--muted); margin: 6px 0 10px; line-height: 1.4; }
.mode-pick { margin: 0; min-width: 180px; }
.stop-chip { margin: 0; font-size: 12px; white-space: nowrap; align-items: center; }
.step.SKIPPED { opacity: 0.55; }
.step.WAITING { opacity: 0.8; }
.badge.SKIPPED, .badge.WAITING { background: var(--chip); color: var(--muted); }

/* Pastel tones. Any element with a tone class gets --t-bg and --t-fg. */
.tone-blue { --t-bg: var(--blue-bg); --t-fg: var(--blue); }
.tone-green { --t-bg: var(--green-bg); --t-fg: var(--green); }
.tone-peach { --t-bg: var(--peach-bg); --t-fg: var(--peach); }
.tone-purple { --t-bg: var(--purple-bg); --t-fg: var(--purple); }
.tone-yellow { --t-bg: var(--yellow-bg); --t-fg: var(--yellow); }
.tone-pink { --t-bg: #fde6ef; --t-fg: #a3285e; }
.tone-teal { --t-bg: var(--teal-bg); --t-fg: var(--teal); }
.tone-gray { --t-bg: var(--chip); --t-fg: var(--muted); }
/* Extra tones for person types only (see core/person-types.js); not offered in colour pickers. */
.tone-orange { --t-bg: #fde8e1; --t-fg: #b24a2c; }
.tone-indigo { --t-bg: #e7e8fb; --t-fg: #4146a0; }
.tone-red { --t-bg: var(--red-bg); --t-fg: var(--red); }
.tone-brown { --t-bg: #f3ebdf; --t-fg: #7a5a2e; }
.tone-sky { --t-bg: #e0f1fa; --t-fg: #1f6f96; }
.tone-harbor { --t-bg: var(--accent-soft); --t-fg: var(--accent); }
.pb.type-badge { white-space: nowrap; }
.gms-tone-icon { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--t-bg); color: var(--t-fg); }

/* Pastel badges. Shapes: pill (status), square (type), circle (icon), tag (sport), hex (stage). */
.pb { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; line-height: 1.5; background: var(--t-bg, var(--chip)); color: var(--t-fg, var(--muted)); white-space: nowrap; vertical-align: middle; }
.pb .icon, .card-head .pb .icon { width: 12px; height: 12px; color: inherit; }
.pb.pill { border-radius: 999px; }
.pb.square { border-radius: 5px; }
.pb.circle { border-radius: 999px; padding: 2px 9px 2px 2px; }
.pb.circle .icon { box-sizing: content-box; width: 11px; height: 11px; padding: 3px; border-radius: 50%; background: color-mix(in srgb, var(--card) 75%, transparent); }
.pb.circle:not(:has(span)) { padding: 2px; }
.pb.tag { border-radius: 0 5px 5px 0; padding-left: 12px; clip-path: polygon(8px 0, 100% 0, 100% 100%, 8px 100%, 0 50%); }
.pb.hex { padding: 2px 12px; clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%); }
.pb.square:not(:has(span)), .pb.hex:not(:has(span)) { padding: 5px; }
.pb.hex:not(:has(span)) { padding: 5px 9px; }
.pb + .pb { margin-left: 3px; }

.avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--t-bg, var(--chip)); color: var(--t-fg, var(--muted)); font-size: 10px; font-weight: 700; object-fit: cover; border: 1px solid rgb(0 0 0 / 0.05); }
.avatar.small { width: 22px; height: 22px; font-size: 9px; }
.avatar.big { width: 42px; height: 42px; font-size: 13px; }
.avatar.flag { background: var(--subtle); font-size: 16px; }
.avatar.flag.small { font-size: 13px; }
.avatar.big.flag { font-size: 24px; }
.avatar .icon { width: 18px; height: 18px; }

.page-head { margin-bottom: 12px; }
.intro { margin: -4px 0 10px; max-width: 780px; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.stack, .when-cell { display: grid; gap: 1px; min-width: 0; }
.stack .muted, .when-cell .muted { margin: 0; font-size: 11px; }
.stack .row { gap: 4px; }
.person-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.team-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; white-space: nowrap; }
.team-chips { display: flex; flex-wrap: wrap; gap: 4px 10px; }

/* Click-through: anything with data-open opens the side panel (core/explore.js). */
a.open-link { color: inherit; text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; cursor: pointer; }
a.open-link:hover { color: var(--accent); text-decoration-style: solid; text-decoration-color: currentColor; }
a.open-wrap, a.open-chip { color: inherit; text-decoration: none; cursor: pointer; border-radius: 999px; }
a.open-wrap:hover .pb, a.open-chip:hover span { filter: brightness(0.96); text-decoration: underline; text-underline-offset: 3px; }
a.open-link:focus-visible, a.open-wrap:focus-visible, a.open-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cal-lane-head[data-open] { cursor: pointer; }
.cal-lane-head[data-open]:hover span:not(.cal-lane-count) { text-decoration: underline; text-underline-offset: 3px; }

.gms-trail { font-size: 12px; }
.gms-trail a, .gms-trail span { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-body { display: grid; gap: 18px; }
.detail-facts { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 0; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.detail-facts dt { color: var(--muted); }
.detail-facts dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.detail-section h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.detail-count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; text-align: center; letter-spacing: 0; }
.detail-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.detail-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; }
.detail-list li + li { border-top: 1px solid var(--line); }
.detail-main { display: block; min-width: 0; }
.detail-main > .muted.small { display: block; margin-top: 2px; }
.detail-main .avatar { vertical-align: middle; }
.detail-side { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: none; max-width: 45%; }
.detail-when { display: block; font-size: 11px; color: var(--muted); font-weight: 600; }
.detail-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 3px; }
.detail-tags:empty { display: none; }
.detail-group { display: flex; align-items: center; gap: 6px; margin: 10px 0 6px; }
.detail-group:first-child { margin-top: 0; }
.detail-person { display: flex; align-items: center; gap: 8px; }
.detail-warn { margin: 0; padding: 10px 12px 10px 28px; border-radius: 10px; background: var(--red-bg); color: var(--red); }
.detail-icon.pb.circle { width: 44px; height: 44px; }
.detail-icon.pb.circle .icon { width: 22px; height: 22px; }

/* Product tour (core/tour.js): the spot's huge shadow dims everything around the lit-up element. */
.tour-layer { position: fixed; inset: 0; z-index: 1000; animation: tour-in 0.18s ease-out; }
.tour-layer.leaving { opacity: 0; transition: opacity 0.18s; }
.tour-block { position: absolute; inset: 0; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(22, 30, 44, 0.58), 0 0 0 3px rgba(255, 255, 255, 0.9), 0 0 24px 6px rgba(255, 255, 255, 0.35); pointer-events: none; transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease; }
.tour-card { position: fixed; top: 0; left: 0; width: min(340px, calc(100vw - 24px)); padding: 14px 16px 12px; border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28); opacity: 0; transition: opacity 0.2s, transform 0.3s ease; }
.tour-card.shown { opacity: 1; }
.tour-card [hidden] { display: none; }
.tour-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tour-count { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
button.tour-skip { padding: 2px 4px; background: none; color: var(--muted); font-weight: 500; }
button.tour-skip:hover { color: var(--ink); text-decoration: underline; }
.tour-title { margin: 6px 0 4px; font-size: 15px; }
.tour-text p { margin: 0 0 6px; color: var(--ink); line-height: 1.5; }
.tour-text ul { margin: 0 0 6px; padding-left: 18px; }
.tour-text p.tour-types { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.tour-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tour-dots i.on { width: 16px; border-radius: 3px; background: var(--accent); }
.tour-buttons { display: flex; gap: 6px; }
@keyframes tour-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-card { transition: none; } .tour-layer { animation: none; } }
.route { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.route .arrow { color: var(--muted); font-weight: 600; }
.flight-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.flight-status .muted.small { flex-basis: 100%; }
.flight-late { color: var(--late); font-size: 12px; font-weight: 600; }
.flight-time { display: inline-grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 6px; }
.flight-time > .muted:last-child { grid-column: 1 / -1; }
.flight-time s { text-decoration-thickness: 1px; }
.flight-next { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.flight-next > .stack:last-child { flex-basis: 100%; }
.message-body { margin: 0; white-space: pre-wrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
td .member-names { margin: 0; }

.empty-state { display: grid; justify-items: center; gap: 6px; padding: 32px 16px; text-align: center; color: var(--muted); }
.empty-state .icon { width: 28px; height: 28px; color: var(--accent); }

.swatch { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--t-bg); border: 1px solid var(--t-fg); cursor: pointer; }
.swatch.on { outline: 2px solid var(--t-fg); outline-offset: 2px; }

.sub-tabs > .tab-bar { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0; gap: 2px; }
.sub-tabs > .tab-bar .tab { border-radius: 0; padding: 7px 12px; }
.sub-tabs > .tab-bar .tab:hover { background: transparent; color: var(--ink); }
.sub-tabs > .tab-bar .tab[aria-selected="true"] { background: transparent; color: var(--accent); box-shadow: inset 0 -2px var(--accent); }

.team-summary { display: grid; gap: 6px; margin: 10px 0 12px; }
.attention-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; border-radius: 8px; }
.attention-item:hover { background: var(--soft); }
.attention-item > .gms-icon:last-child { opacity: 0.45; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.info-card { display: grid; align-content: start; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.info-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.info-head h3 { flex: 1; margin: 0; font-size: 15px; }
.info-head button { padding: 4px 8px; font-size: 12px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.info-row > span:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.summary-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 12px; }
.summary-strip:empty { display: none; }
.summary-card { display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.summary-card .muted { margin: 0; }
.meter { height: 6px; border-radius: 999px; background: var(--chip); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--purple); }

.gms-kpi { width: 100%; text-align: left; transition: border-color 0.15s, transform 0.15s; }
.gms-kpi:hover { border-color: var(--blue-line); transform: translateY(-1px); }
.gms-kpi .pb.circle { padding: 3px; }
.gms-kpi .pb.circle .icon { width: 15px; height: 15px; padding: 5px; }

/* The calendar grid is drawn as HTML inside a Mantine panel, where the plain-page button rule does not reach. */
:where(.gms-ui) :where(.cal-event, .cal-col-head, .cal-date, .cal-more, .cal-block) { display: inline-flex; align-items: center; gap: 5px; border: 0; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.cal-event { width: 100%; min-width: 0; justify-content: flex-start; gap: 4px; padding: 3px 6px; font-size: 11px; font-weight: 600; text-align: left; background: var(--t-bg); color: var(--t-fg); border-left: 3px solid var(--t-fg); border-radius: 6px; }
.cal-event .icon { width: 12px; height: 12px; }
.cal-event .cal-time { font-weight: 700; }
.cal-event .cal-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-event.off { opacity: 0.55; }
.cal-event.off .cal-title { text-decoration: line-through; }
.cal-venue { display: flex; align-items: center; gap: 3px; flex-basis: 100%; font-weight: 500; opacity: 0.85; }
.cal-legend { display: flex; gap: 14px; margin-left: auto; font-size: 11px; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item::before { content: ""; width: 14px; height: 12px; border-radius: 3px; background: var(--blue-bg); border-left: 3px solid var(--blue); }
.legend-item.individual::before { border-left-style: dashed; background: repeating-linear-gradient(135deg, var(--blue-bg) 0 4px, var(--card) 4px 8px); }
.cal-event.individual, .cal-block.individual { border-left-style: dashed; background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--card) 45%, transparent) 6px 12px); }
.legend-plain { display: inline-flex; align-items: center; gap: 5px; }
.cal-gender { display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; margin-right: 2px; border: 1px solid var(--t-fg); border-radius: 50%; background: var(--t-bg); color: var(--t-fg); font-size: 9px; font-weight: 800; line-height: 1; vertical-align: 1px; }
.cal-block strong .cal-gender { margin-right: 4px; }
.cal-clash { display: inline-grid; place-items: center; flex: none; width: 15px; height: 15px; margin-right: 2px; border-radius: 50%; background: #d64545; color: #fff; font-size: 10px; font-weight: 800; line-height: 1; vertical-align: 1px; cursor: help; }
.cal-block strong .cal-clash { margin-right: 4px; }
.cal-stage { padding: 0 5px; border-radius: 4px; background: color-mix(in srgb, var(--card) 70%, transparent); font-size: 10px; font-weight: 600; }
.cal-flags { display: inline-flex; gap: 2px; }
.cal-flags .avatar.small { width: 18px; height: 18px; font-size: 11px; }
.cal-col .cal-flags { flex-basis: 100%; }
.cal-more { align-self: flex-start; background: transparent; color: var(--accent); font-size: 11px; padding: 0 4px; }

.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-weekday { padding: 6px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: var(--subtle); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell { display: flex; flex-direction: column; gap: 3px; min-height: 104px; min-width: 0; padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-cell.outside { background: var(--soft); }
.cal-cell.outside .cal-date { color: var(--faint); }
.cal-date { align-self: flex-start; background: transparent; color: var(--ink); padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.cal-date:hover { background: var(--subtle); filter: none; }
.cal-cell.today .cal-date { background: var(--accent); color: white; }
.cal-cell .cal-event { flex-wrap: wrap; row-gap: 0; white-space: normal; }
.cal-cell .cal-title { flex-basis: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; }

.cal-week { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 6px; overflow-x: auto; }
.cal-col { display: flex; flex-direction: column; gap: 4px; min-height: 240px; padding: 6px; border-radius: 10px; background: var(--soft); }
.cal-col.today { background: var(--accent-soft); }
.cal-col .cal-event { flex-wrap: wrap; white-space: normal; }
.cal-col-head { justify-content: space-between; width: 100%; background: transparent; color: var(--muted); padding: 2px 4px 6px; }
.cal-col-head strong { color: var(--ink); font-size: 15px; }
.cal-col .muted { padding: 0 4px; }

.cal-day { position: relative; display: grid; grid-template-columns: 64px repeat(var(--venues), minmax(170px, 1fr)); box-sizing: content-box; padding-top: 30px; overflow-x: auto; background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 30px / 100% 56px repeat-y; }
.cal-hours { position: relative; }
.cal-hour { position: absolute; left: 0; right: 0; transform: translateY(-50%); font-size: 11px; color: var(--muted); }
.cal-hour span { background: var(--card); padding-right: 6px; }
.cal-lane { position: relative; border-left: 1px solid var(--line); }
.cal-lane-head { position: absolute; top: -28px; left: 0; right: 0; display: flex; align-items: center; gap: 4px; padding: 0 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-lane-head .icon { color: var(--accent); flex: none; }
.cal-lane-head > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-lane-count { flex: none; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; text-align: center; }
.cal-now { position: absolute; left: 64px; right: 0; z-index: 2; height: 0; border-top: 2px solid var(--red); pointer-events: none; }
.cal-now span { position: absolute; left: -62px; top: -9px; padding: 1px 5px; border-radius: 6px; background: var(--danger); color: white; font-size: 10px; font-weight: 600; }
.cal-day-note { margin: 0 0 6px; }
.cal-spread { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.cal-block { position: absolute; left: 4px; width: calc(100% - 8px); display: grid; align-content: start; gap: 1px; padding: 4px 7px; overflow: hidden; text-align: left; white-space: normal; font-size: 11px; font-weight: 500; background: var(--t-bg); color: var(--t-fg); border-left: 3px solid var(--t-fg); border-radius: 8px; }
.cal-block strong { font-size: 12px; }

.next-list { display: grid; gap: 6px; }
.next-item { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; text-align: left; white-space: normal; font-weight: 400; background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.next-item:hover { background: var(--soft); filter: none; }
.next-row { display: contents; }
.next-date { display: grid; }
.next-date .muted { margin: 0; }

.duty { display: grid; gap: 10px; }
.duty-head { display: flex; gap: 12px; align-items: center; }
.duty-head p { margin: 2px 0 0; }
.duty-note { margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--yellow-bg); color: var(--yellow); }
.duty .big { justify-content: center; padding: 13px; font-size: 16px; border-radius: 12px; }
.duty-shift { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.duty-shift.now { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 40%, var(--card)); }
.duty-shift h3 { display: flex; align-items: baseline; gap: 6px; margin: 0; font-size: 15px; }
.duty-now { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: white; font-size: 11px; }
.duty-zone { display: grid; gap: 4px; }
.duty-zone-name { display: flex; align-items: center; gap: 5px; margin: 0; font-weight: 600; color: var(--accent); }
.duty-zone ul, .duty-scans { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.duty-person, .duty-scans li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--soft); }
.duty-person.me { background: var(--accent-soft); }
.duty-person .grow, .duty-scans .grow { display: grid; flex: 1; min-width: 0; }
.duty-avatar { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--blue-bg); color: var(--blue); font-size: 12px; font-weight: 600; }
.duty-avatar.big { width: 64px; height: 64px; font-size: 20px; }
.duty-call { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-bg); color: var(--green); }
.duty-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--blue); }
.duty-scans .tone-ok .duty-dot { background: var(--green); }
.duty-scans .tone-stop .duty-dot { background: var(--danger); }
.duty-scans .tone-none .duty-dot { background: var(--muted); }

.matches section { display: grid; gap: 6px; }
.matches-label { margin: 4px 0 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.match-next { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--accent-line); border-radius: 12px; background: color-mix(in srgb, var(--accent-soft) 40%, var(--card)); }
.match-next.live { border-color: #e8a07a; background: color-mix(in srgb, var(--peach-bg) 45%, var(--card)); }
.match-next p { margin: 0; }
.match-when { font-size: 13px; font-weight: 600; color: var(--accent); }
.match-live { padding: 1px 8px; border-radius: 999px; background: var(--danger); color: white; font-size: 11px; }
.match-title { font-size: 17px; }
.match-vs { font-weight: 600; }
.match-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.match-chip { padding: 1px 8px; border-radius: 999px; background: var(--blue-bg); color: var(--blue); font-size: 11px; font-weight: 600; white-space: nowrap; }
.match-venue { display: flex; align-items: center; gap: 5px; font-size: 13px; }
.match-note { color: var(--yellow); }
.match-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.match-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; background: var(--soft); }
.match-list .grow { display: grid; flex: 1; min-width: 0; }
.match-date { display: grid; min-width: 58px; }
.match-outcome { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--line); color: var(--muted); font-size: 12px; font-weight: 800; }
.match-outcome.won { background: var(--green-bg); color: var(--green); }
.match-outcome.lost { background: var(--red-bg); color: var(--red); }
.match-outcome.draw { background: var(--yellow-bg); color: var(--yellow); }
.match-medal { justify-self: start; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--yellow-bg); color: var(--yellow); font-size: 12px; font-weight: 600; }

.pin-notice { display: grid; gap: 6px; text-align: center; }
.pin-notice p { margin: 0; }
.pin-notice-digits { font-family: ui-monospace, Menlo, monospace; font-size: 38px; font-weight: 700; letter-spacing: 0.25em; color: var(--accent); padding: 8px 0; background: var(--accent-soft); border-radius: 12px; }
.pin-input { font-size: 22px; letter-spacing: 0.4em; text-align: center; padding: 10px 8px; }
button.link-button { justify-self: center; background: none; color: var(--accent); padding: 4px 8px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.forgot-done { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 6px 0; }
.forgot-done p { margin: 0; }
.success { color: var(--green); font-weight: 600; margin: 6px 0 0; }
button.small-button { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.pin-list li { align-items: center; }
.pin-photo { width: 38px; height: 38px; flex: none; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.pin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.pin-given { background: var(--green-bg) !important; }
.pin-digits { font-family: ui-monospace, Menlo, monospace; font-size: 30px; letter-spacing: 0.25em; color: var(--green); margin: 2px 0; }

.scanner-open { overflow: hidden; }
.scanner { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 24px; padding-top: max(12px, env(safe-area-inset-top)); overflow-y: auto; background: var(--paper); }
.scanner > * { width: min(520px, 100%); margin: 0 auto; }
.scanner-top { display: flex; justify-content: space-between; align-items: center; }
.scanner-top strong { font-size: 18px; }
.scanner-zone { margin: 0; }
.scanner-view { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 18px; background: #1f2733; }
.scanner-view video { width: 100%; height: 100%; object-fit: cover; }
.scanner-frame { position: absolute; inset: 18%; border: 3px solid rgb(255 255 255 / 0.9); border-radius: 18px; box-shadow: 0 0 0 999px rgb(31 39 51 / 0.35); }
.scanner-status { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; text-align: center; color: white; font-weight: 500; text-shadow: 0 1px 3px rgb(0 0 0 / 0.6); }
.scanner-manual { display: flex; gap: 8px; }
.scanner-manual input { flex: 1; font-size: 16px; padding: 10px 12px; }
.scanner-result:empty { display: none; }
.scan-card { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); }
.scan-card p { margin: 0; }
.scan-card .big { justify-content: center; padding: 13px; font-size: 16px; border-radius: 12px; }
.scan-verdict { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; }
.scan-verdict .icon { width: 24px; height: 24px; }
.scan-card.tone-ok { border-color: #7cc9a0; background: var(--green-bg); }
.scan-card.tone-ok .scan-verdict { color: var(--green); }
.scan-card.tone-stop { border-color: #ec8a99; background: var(--red-bg); }
.scan-card.tone-stop .scan-verdict { color: var(--red); }
.scan-card.tone-info .scan-verdict { color: var(--blue); }
.scan-person { display: flex; gap: 12px; align-items: center; }

.roster-chip { padding: 4px 6px; border-radius: var(--mantine-radius-md); background: var(--soft); }

.workspace { min-width: 0; display: flex; flex-direction: column; }
#topbar { position: sticky; top: 0; z-index: 10; padding: 8px 18px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.gms-user { padding: 3px 8px 3px 3px; border-radius: 999px; }
.gms-user:hover { background: var(--subtle); }
.griev-row { display: block; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-align: left; }
.griev-row:hover { background: var(--soft); }
.griev-row.unseen { border-color: var(--red-line); background: color-mix(in srgb, var(--red-bg) 30%, var(--card)); }
.mantine-Popover-dropdown .griev-row { border-color: transparent; }
.griev-row.flash { animation: griev-flash 1.2s ease-in-out 4; }
@keyframes griev-flash { 50% { background: var(--red-bg); border-color: var(--red); } }
.griev-note { background: var(--blue-bg); border-color: transparent; }
.griev-new { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: white; font-size: 10px; vertical-align: 1px; }

.member-page :is(input, textarea, select) { font: inherit; font-size: 16px; padding: 10px 12px; }
.menu-dot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); border: 2px solid var(--card); }
.drawer-count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--danger); color: white; font-size: 11px; font-weight: 600; }
.widget-link { color: var(--ink); text-decoration: none; }
.widget-link:hover { border-color: var(--blue-line); }
.back-link { justify-self: start; }
.info-page > .big { justify-content: center; padding: 13px; font-size: 16px; border-radius: 12px; }
.member-main .placeholder h2 { margin: 4px 0 0; font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.placeholder .big { justify-content: center; margin-top: 8px; padding: 13px 18px; font-size: 16px; border-radius: 12px; }
.griev-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.griev-area { display: grid; justify-items: start; align-content: start; gap: 4px; padding: 14px; text-align: left; white-space: normal; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 20px rgb(40 83 107 / 0.08); }
.griev-area.picked { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.griev-area strong { font-size: 15px; }
.griev-area .muted { font-weight: 400; }
.griev-area .widget-icon { margin-bottom: 4px; }
.griev-form { display: grid; gap: 4px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.griev-form .big { justify-content: center; margin-top: 10px; padding: 13px; font-size: 16px; border-radius: 12px; }
.griev-form > .ghost { justify-content: center; }
.griev-picked { display: flex; gap: 12px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.griev-picked .grow { display: grid; }
.griev-list { display: grid; gap: 10px; }
.griev-item { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.griev-item.unread { border-color: var(--red-line); box-shadow: 0 0 0 2px var(--red-bg); }
.griev-item summary { display: flex; gap: 12px; align-items: center; padding: 12px 14px; cursor: pointer; list-style: none; }
.griev-item summary::-webkit-details-marker { display: none; }
.griev-item summary .grow { display: grid; }
.griev-body { display: grid; gap: 8px; padding: 0 14px 14px; }
.griev-text { margin: 0; white-space: pre-wrap; }
.griev-reply { padding: 10px 12px; border-radius: 12px; background: var(--blue-bg); }
.griev-reply p { margin: 0; }
.griev-event { display: flex; align-items: center; gap: 6px; margin: 0; }
.griev-status { flex: none; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.griev-status.open { background: var(--peach-bg); color: var(--peach); }
.griev-status.progress { background: var(--blue-bg); color: var(--blue); }
.griev-status.done { background: var(--green-bg); color: var(--green); }
.griev-status.closed { background: var(--chip); color: var(--muted); }

/* Medical */
.med-banner { position: sticky; top: 55px; z-index: 9; display: flex; align-items: center; gap: 12px; margin: 10px 18px 0; padding: 10px 14px; border-radius: 12px; background: var(--danger); color: #fff; box-shadow: 0 8px 24px rgb(163 40 58 / 0.25); }
.med-banner > .icon { width: 22px; height: 22px; }
.med-banner strong { font-size: 14px; }
.med-banner-item { display: inline-block; margin-right: 14px; opacity: 0.95; }
.med-banner button { background: #fff; color: var(--danger); }
.med-banner.flash { animation: med-flash 1s ease-in-out 3; }
@keyframes med-flash { 50% { background: #d6334a; box-shadow: 0 0 0 6px rgb(214 51 74 / 0.25); } }
.med-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--yellow-bg); color: var(--yellow); }
.med-notice .icon { width: 18px; height: 18px; margin-top: 2px; }
.med-notice p { margin: 2px 0 0; }
.med-map { margin-bottom: 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.med-summary-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.med-days { display: flex; align-items: center; gap: 8px; margin: 0; }
.med-days select { width: auto; }
.med-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.med-tile { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.med-tile .pb.circle { width: 36px; height: 36px; }
.med-tile div { display: grid; line-height: 1.2; }
.med-tile b { font-size: 22px; }
.med-tile span { color: var(--muted); }
.med-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.med-bar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 32px; align-items: center; gap: 10px; margin-top: 8px; }
.med-bar b { text-align: right; }
.med-records { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.med-records h2 { display: flex; align-items: center; gap: 6px; }
.med-records button { margin-top: 12px; }
.med-list { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* Medical help in the player app */
.sos-fab { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 6px; padding: 12px 16px; border-radius: 999px; background: var(--danger); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 8px 22px rgb(163 40 58 / 0.35); }
.sos-fab .icon { width: 20px; height: 20px; }
.drawer-link.drawer-medical { color: var(--red); font-weight: 600; }
.widget-medical .widget-icon, .med-camp-head .widget-icon { background: var(--red-bg); color: var(--red); }
.med-page h2 { display: flex; align-items: center; gap: 6px; margin: 6px 2px 0; }
.med-call { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--danger); color: #fff; text-decoration: none; box-shadow: 0 8px 22px rgb(163 40 58 / 0.25); }
.med-call .icon { width: 26px; height: 26px; }
.med-call span { display: grid; }
.med-call strong { font-size: 18px; }
.med-call small { opacity: 0.9; }
.med-card { display: grid; gap: 8px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.med-card p { margin: 0; }
.med-card .cta { justify-self: start; margin-top: 4px; }
.med-card button { justify-content: center; }
button.med-sos { justify-content: center; padding: 16px; border-radius: 14px; font-size: 18px; background: var(--danger); color: #fff; }
button.med-sos .icon { width: 22px; height: 22px; }
.med-alert-card { border: 2px solid var(--red); background: var(--red-bg); }
.med-alert-card.coming { border-color: var(--green); background: var(--green-bg); }
.med-alert-title { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.med-alert-title .icon { width: 22px; height: 22px; }
.med-camps { display: grid; gap: 10px; }
.med-camp { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.med-camp p { margin: 0; }
.med-camp.nearest { border: 2px solid var(--red); }
.med-camp.closed { opacity: 0.6; }
.med-camp-head { display: flex; align-items: center; gap: 12px; }
.med-camp-head .grow { display: grid; }
.med-away { display: grid; text-align: right; line-height: 1.2; }
.med-away small { color: var(--muted); }
.med-camp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.med-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.med-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.med-btn .icon { width: 17px; height: 17px; }
.med-staff { display: grid; gap: 10px; padding-top: 4px; }
.med-staff h3 { margin: 6px 2px 0; font-size: 15px; }
.med-staff > .big { justify-content: center; padding: 13px; font-size: 16px; border-radius: 12px; }
.med-staff-alert { border: 2px solid var(--red); }
.med-staff-alert.coming { border-color: var(--yellow); }
.med-mine { display: grid; gap: 6px; }
.med-mine-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.med-mine-row .grow { display: grid; }
.med-record { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.med-record .big { justify-content: center; padding: 13px; font-size: 16px; border-radius: 12px; margin-top: 6px; }
.med-row { display: flex; gap: 8px; }
.med-row button { flex: none; }
.med-severity { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.med-severity label, .med-check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.med-severity input, .med-check input { width: auto; }

@media (max-width: 1000px) {
  .builder { grid-template-columns: 1fr; }
  .builder > .panel:last-child { position: static; max-height: none; }
  .step { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #main { padding: 10px; }
  #topbar { padding: 6px 10px; }
  .toolbar { flex-wrap: wrap; }
  .cal-cell { min-height: 64px; }
  .cal-cell .cal-event .cal-title, .cal-cell .cal-event .cal-time { display: none; }
  .next-item { grid-template-columns: 1fr; }
}
