/* Organizer dashboard. Light workspace under the app's sky header. Built from the approved mockups. */

/* Layout: sky header (the app's world) over a calm light workspace; sidebar left, a 12-column grid of panels right.
   Single deliberate light look; team colors are the app's team colors and always carry a text label. */
:root {
  color-scheme: light;
  --sky-top: #2A6296; --sky-low: #163C62; --track: #0C243D; --lane: #2F6A9C;
  --page: #EEF3F8; --panel: #FFFFFF; --ink: #0F2235; --ink-2: #4A5F74; --ink-3: #7A8CA0; --line: #DCE5EE; --grid: #E8EEF4;
  --green: #52D93C; --green-d: #2E9E1C; --green-ink: #0B1B2B; --mint: #8EF07B;
  --blue: #3D9BFF; --red: #FF5A4E; --purple: #9B7BFF; --gold: #E0A21A; --teal: #14A383;
  --warn: #B26A00; --warn-bg: #FFF4DF;
  --display: 'Nunito', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --body: 'Nunito Sans', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
aside { background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 900; font-size: 16px; padding: 4px 8px 16px; }
.brand .ic { width: 32px; height: 32px; border-radius: 9px; background: #0B1B2B; display: flex; align-items: center; justify-content: center; }
.brand .ic i { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px var(--green); }
.org { border-radius: 14px; padding: 10px 12px; background: var(--page); margin-bottom: 14px; }
.org b { display: block; font-family: var(--display); font-weight: 900; }
.org span { font-size: 13px; color: var(--ink-2); }
.org span.small { display: block; margin-top: 4px; font-weight: 700; color: var(--green-d); }
.org .org-logo { display: block; max-width: 100%; max-height: 48px; object-fit: contain; margin-bottom: 8px; }
.logo-preview { display: block; max-width: 260px; max-height: 90px; object-fit: contain; margin: 0 0 12px; padding: 10px; border-radius: 12px; background: #F6F9FC; }
nav.side a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 800; font-size: 14.5px; }
nav.side a.on { background: #E3F6DE; color: #1E5A12; }
nav.side a .n { margin-left: auto; font-size: 12px; background: var(--page); border-radius: 999px; padding: 1px 8px; color: var(--ink-2); }
nav.side .sep { height: 1px; background: var(--line); margin: 12px 6px; }
.privacy-note { margin-top: 18px; font-size: 12.5px; color: var(--ink-2); background: var(--page); border-radius: 12px; padding: 10px 12px; }
.privacy-note b { color: var(--ink); }

/* header */
.top { position: relative; overflow: hidden; color: #fff; background: linear-gradient(180deg, var(--sky-top), var(--sky-low)); padding: 22px 28px 70px; }
.top::after { content: ""; position: absolute; width: 640px; height: 640px; right: -180px; top: -300px; border-radius: 50%; background: radial-gradient(closest-side, rgba(82,217,60,.28), transparent); }
.top .row1 { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.top h1 { font-family: var(--display); font-weight: 900; font-size: 32px; margin: 0; letter-spacing: -.01em; }
.top .sub { color: #CFE6FA; font-weight: 600; }
.top .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 0; cursor: pointer; border-radius: 12px; padding: 10px 14px; font-family: var(--display); font-weight: 900; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.btn.go { background: var(--green); color: var(--green-ink); }
.btn.glass { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); }
.btn.line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.filters { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.seg { display: inline-flex; background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: transparent; color: #D7ECFF; border-radius: 999px; padding: 6px 12px; font-family: var(--display); font-weight: 800; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; line-height: 1; background: rgba(255,255,255,.1); color: #D7ECFF; border: 0; border-radius: 999px; padding: 0 16px; font-family: var(--display); font-weight: 800; font-size: 13px; cursor: pointer; }
.pill::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.seg { height: 38px; align-items: center; }
.top .track { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: var(--track); }
.top .track::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--lane); }
.runner { position: absolute; bottom: 14px; height: 74px; z-index: 3; }

main { padding: 0 28px 40px; margin-top: -40px; position: relative; z-index: 4; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.panel { background: var(--panel); border-radius: 18px; padding: 18px; box-shadow: 0 0 0 1px var(--line), 0 18px 30px -26px rgba(15,34,53,.45); min-width: 0; }
.panel h2 { font-family: var(--display); font-weight: 900; font-size: 17px; margin: 0; }
.panel .hd { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.panel .hd .meta { color: var(--ink-3); font-size: 13px; font-weight: 700; }
.panel .hd .right { margin-left: auto; }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; } .c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; grid-column: span 12; }
.kpi { padding: 16px 18px; }
.kpi .lbl { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.kpi .val { font-family: var(--display); font-weight: 900; font-size: 32px; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 15px; color: var(--ink-3); font-weight: 800; }
.kpi .ctx { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.delta.up { background: #E3F6DE; color: #1E5A12; }
.delta.down { background: #FDE9E7; color: #9A2A20; }
.spark { display: block; margin-top: 8px; width: 100%; height: 30px; }

/* live challenge */
.live { position: relative; overflow: hidden; color: #fff; background: linear-gradient(160deg, #1D4A76, #12273B 70%); }
.live .tag { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 900; font-size: 12.5px; color: #FF9A90; }
.live .tag i { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(255,90,78,.25); }
.live h2 { color: #fff; font-size: 22px; margin: 4px 0 2px; }
.live .meta2 { color: #BFD3E6; font-size: 13.5px; font-weight: 600; }
.face { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin: 16px 0 10px; }
.face .side { text-align: center; }
.face img { height: 92px; display: block; margin: 0 auto 4px; }
.face .tn { font-family: var(--display); font-weight: 900; }
.face .pct { font-family: var(--display); font-weight: 900; font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.face .of { font-size: 12px; color: #BFD3E6; font-weight: 700; }
.face .vs { font-family: var(--display); font-weight: 900; color: #7E95AB; padding-bottom: 30px; }
.split { height: 10px; border-radius: 6px; display: flex; gap: 2px; overflow: hidden; }
.split b { display: block; height: 100%; }
.days { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.day { flex: 1 1 0; min-width: 38px; text-align: center; font-size: 11.5px; font-weight: 800; color: #BFD3E6; }
.day i { display: block; height: 26px; border-radius: 8px; margin-bottom: 4px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; font-style: normal; color: #fff; font-size: 11px; }
.live .acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* insights */
.ins { display: grid; gap: 12px; }
.in { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: #F6F9FC; }
.in .ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 900; font-size: 15px; }
.in p { margin: 0; font-weight: 700; }
.in .why { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-top: 2px; }
.in .act { margin-top: 8px; display: inline-flex; font-family: var(--display); font-weight: 900; color: var(--green-d); font-size: 13.5px; background: transparent; border: 0; padding: 0; cursor: pointer; }

/* charts */
svg.chart text { font-family: var(--body); }
svg.chart { display: block; width: 100%; height: auto; overflow: visible; }
.axis text { font-size: 11px; fill: var(--ink-3); font-weight: 700; font-family: var(--body); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.segl { display: inline-flex; background: var(--page); border-radius: 999px; padding: 3px; }
.segl button { border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font-family: var(--display); font-weight: 800; font-size: 12.5px; cursor: pointer; }
.segl button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: #0F2235; color: #fff; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; font-weight: 700; box-shadow: 0 10px 24px rgba(0,0,0,.25); }
.tip[hidden] { display: none; }
.tip b { font-family: var(--display); font-weight: 900; font-size: 14px; }

/* teams table */
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 720px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 800; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 11px 10px; border-bottom: 1px solid var(--grid); font-weight: 700; }
td .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.mini { display: flex; align-items: center; gap: 8px; }
.mini .b { flex: 1; height: 8px; border-radius: 4px; background: var(--grid); overflow: hidden; min-width: 80px; }
.mini .b i { display: block; height: 100%; border-radius: 4px; background: var(--green-d); }
tr.prot td { color: var(--ink-3); background: #F6F9FC; }
.lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: var(--ink-2); background: var(--page); border-radius: 999px; padding: 2px 10px; }
.sync-warn { color: var(--warn); background: var(--warn-bg); border-radius: 999px; padding: 1px 8px; font-size: 12.5px; font-weight: 800; }

/* recap */
.recap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mail { border-radius: 16px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.mail .mh { background: linear-gradient(180deg, var(--sky-top), var(--sky-low)); color: #fff; padding: 16px; }
.mail .mh b { font-family: var(--display); font-weight: 900; font-size: 18px; display: block; }
.mail .mh span { font-size: 12.5px; color: #CFE6FA; }
.mail .mb { padding: 14px 16px; display: grid; gap: 10px; font-size: 14px; }
.mail .mb .r { display: flex; justify-content: space-between; border-bottom: 1px solid var(--grid); padding-bottom: 8px; font-weight: 700; }
.mail .mb .r b { font-family: var(--display); font-weight: 900; }
.set { display: grid; gap: 12px; }
.set .row { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px; border-radius: 12px; background: #F6F9FC; font-weight: 700; }
.sw2 { width: 44px; height: 26px; border-radius: 999px; background: var(--green); position: relative; flex: none; }
.sw2::after { content: ""; position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; }

.stat3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 10px; }
.stat3 div { background: #F6F9FC; border-radius: 12px; padding: 10px; }
.stat3 b { display: block; font-family: var(--display); font-weight: 900; font-size: 20px; }
.stat3 span { font-size: 12px; color: var(--ink-2); font-weight: 700; }
.note { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; font-weight: 600; }


/* challenge page */
.crumb { position: relative; z-index: 2; font-family: var(--display); font-weight: 800; font-size: 14px; color: #BFE3FF; text-decoration: none; }
.status { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,90,78,.18); color: #FFB3AC; border-radius: 999px; padding: 4px 10px; font-family: var(--display); font-weight: 900; font-size: 12.5px; }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.facts { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; color: #D7ECFF; font-weight: 700; font-size: 14px; }
.facts b { color: #fff; font-family: var(--display); font-weight: 900; }
.code { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border-radius: 10px; padding: 4px 6px 4px 10px; font-family: var(--display); font-weight: 900; letter-spacing: .12em; color: #fff; }
.code button { border: 0; background: #fff; color: var(--ink); border-radius: 7px; padding: 3px 8px; font-family: var(--display); font-weight: 900; font-size: 12px; cursor: pointer; letter-spacing: 0; }

.board { position: relative; overflow: hidden; color: #fff; background: linear-gradient(160deg, #1D4A76, #12273B 70%); }
.board .vsrow { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; }
.board .tm { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 14px; align-items: end; }
.board .tm.r { grid-template-columns: minmax(0,1fr) auto; text-align: right; }
.board .tm img { height: 120px; }
.board .nm { font-family: var(--display); font-weight: 900; font-size: 20px; }
.board .big { font-family: var(--display); font-weight: 900; font-size: 54px; line-height: 1; font-variant-numeric: tabular-nums; }
.board .small { color: #BFD3E6; font-size: 13px; font-weight: 700; }
.board .mid { text-align: center; }
.board .mid .wins { font-family: var(--display); font-weight: 900; font-size: 30px; }
.board .mid .lbl { color: #BFD3E6; font-size: 12.5px; font-weight: 800; }
.board .callout { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.board .callout span { background: rgba(255,255,255,.08); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 800; color: #DDEBF7; }

.cmp { display: grid; grid-template-columns: minmax(0,1fr) 110px minmax(0,1fr); gap: 0; }
.cmp div { padding: 10px 6px; border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
.cmp .l { text-align: right; font-family: var(--display); font-weight: 900; font-size: 18px; }
.cmp .r { font-family: var(--display); font-weight: 900; font-size: 18px; }
.cmp .k { text-align: center; color: var(--ink-3); font-weight: 800; font-size: 12.5px; display: flex; align-items: center; justify-content: center; }
.cmp .win { color: var(--green-d); }
.cmp .hdr { border-bottom: 2px solid var(--line); font-size: 14px !important; }

.feed { display: grid; gap: 10px; }
.mom { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #F6F9FC; }
.mom .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 900; color: #fff; }
.mom p { margin: 0; font-weight: 700; }
.mom time { font-size: 12.5px; color: var(--ink-3); font-weight: 700; }

.tools { display: grid; gap: 10px; }
.tool { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: #F6F9FC; }
.tool b { font-family: var(--display); font-weight: 900; display: block; }
.tool span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tmpl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tmpl button { border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); padding: 6px 12px; font-family: var(--display); font-weight: 800; font-size: 13px; cursor: pointer; color: var(--ink); }
.tmpl button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.msgbox { margin-top: 10px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); padding: 12px; font-weight: 600; color: var(--ink); min-height: 64px; }
.to { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; font-size: 13px; font-weight: 800; color: var(--ink-2); }

.daytbl td.w { font-family: var(--display); font-weight: 900; }
@media (max-width: 760px) {
  .board .vsrow { grid-template-columns: 1fr; text-align: center; }
  .board .tm, .board .tm.r { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .board .tm.r img { order: -1; }
}

/* RESPONSIVE */
@media (max-width: 1180px) { .kpis { grid-template-columns: repeat(3, minmax(0,1fr)); } .c3, .c4, .c5 { grid-column: span 6; } .c7, .c8 { grid-column: span 12; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  nav.side { display: flex; overflow-x: auto; gap: 4px; }
  nav.side .sep, .privacy-note, .org { display: none; }
  .c3, .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .recap { grid-template-columns: 1fr; }
  .top, main { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 560px) { .kpis { grid-template-columns: 1fr 1fr; } .runner { display: none; } }

/* ---------- real app additions ---------- */
a { color: inherit; }
.brand img { width: 32px; height: 32px; border-radius: 9px; display: block; }
.brand { text-decoration: none; color: var(--ink); }
.org select { margin-top: 6px; width: 100%; border: 0; background: #fff; border-radius: 8px; padding: 6px 8px; font: inherit; font-weight: 700; font-size: 13px; box-shadow: inset 0 0 0 1px var(--line); }
nav.side a:hover { background: #F2F6FA; }
nav.side a.on:hover { background: #E3F6DE; }
.side-foot { margin-top: 14px; display: grid; gap: 4px; font-size: 13px; font-weight: 700; }
.side-foot a, .side-foot button { color: var(--ink-2); text-decoration: none; background: none; border: 0; padding: 4px 10px; text-align: left; cursor: pointer; font: inherit; font-weight: 700; font-size: 13px; }
.side-foot a:hover, .side-foot button:hover { color: var(--green-d); }
.top a.btn { text-decoration: none; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.line.small, .btn.small { padding: 7px 11px; font-size: 13px; border-radius: 10px; }
.btn.danger { background: #fff; color: #9A2A20; box-shadow: inset 0 0 0 1.5px #F2C9C4; }
.link { color: var(--green-d); font-weight: 800; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-weight: 800; }
.link:hover { text-decoration: underline; }
.pillsel { position: relative; display: inline-flex; }
.pillsel select { appearance: none; -webkit-appearance: none; height: 38px; background: rgba(255,255,255,.1); color: #D7ECFF; border: 0; border-radius: 999px; padding: 0 38px 0 16px; font-family: var(--display); font-weight: 800; font-size: 13px; cursor: pointer; max-width: 260px; }
.pillsel select option { color: var(--ink); }
.pillsel::after { content: ""; position: absolute; right: 16px; top: 14px; width: 7px; height: 7px; border-right: 2px solid #D7ECFF; border-bottom: 2px solid #D7ECFF; transform: rotate(45deg); pointer-events: none; }
.empty { text-align: center; padding: 26px 16px; color: var(--ink-2); font-weight: 600; }
.empty b { display: block; font-family: var(--display); font-weight: 900; font-size: 18px; color: var(--ink); margin-bottom: 4px; }
.empty .btn { margin-top: 12px; }
.muted { color: var(--ink-2); font-weight: 600; }
.small { font-size: 13px; }
.dash-val { color: var(--ink-3); }
.loading { padding: 40px; text-align: center; color: var(--ink-3); font-weight: 800; }
.skel { background: linear-gradient(90deg, #EEF3F8, #F7FAFC, #EEF3F8); background-size: 200% 100%; animation: sk 1.2s infinite linear; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* characters: the app's two-layer art, tinted with CSS masks */
.char { position: relative; display: block; margin: 0 auto; }
.char i { position: absolute; inset: 0; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center bottom; mask-position: center bottom; }
.board .tm .char { margin: 0; }

/* forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
input[type=text], input[type=email], input[type=number], input[type=date], select.in, textarea {
  font: inherit; font-weight: 600; color: var(--ink); background: #fff; border: 0; border-radius: 10px; padding: 10px 12px; box-shadow: inset 0 0 0 1.5px var(--line); width: 100%; }
input:focus, select.in:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--green-d); }
select.in { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row-form .field { margin: 0; flex: 1 1 200px; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; }
.radios label { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #F6F9FC; cursor: pointer; flex: 1 1 200px; font-weight: 700; color: var(--ink); font-size: 14px; }
.radios label span { display: block; font-weight: 600; color: var(--ink-2); font-size: 12.5px; }
.radios input { margin-top: 3px; accent-color: var(--green-d); }

/* lists */
.rows { display: grid; gap: 10px; }
.rowi { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: #F6F9FC; flex-wrap: wrap; }
.rowi .grow { flex: 1 1 220px; min-width: 0; }
.rowi b { font-family: var(--display); font-weight: 900; }
.rowi .sub { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; font-family: var(--display); border-radius: 999px; padding: 2px 10px; background: var(--page); color: var(--ink-2); }
.badge.live { background: #FDE9E7; color: #9A2A20; }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.badge.up { background: #E8F1FF; color: #1E5FA8; }
.badge.done { background: #EEF3F8; color: var(--ink-2); }
.badge.owner { background: #E3F6DE; color: #1E5A12; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }

/* challenge cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.ccard { display: block; text-decoration: none; color: var(--ink); }
.ccard:hover { box-shadow: 0 0 0 2px var(--green-d), 0 18px 30px -26px rgba(15,34,53,.45); }
.ccard h3 { font-family: var(--display); font-weight: 900; font-size: 18px; margin: 8px 0 2px; }
.ccard .meta { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.ccard .foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; font-weight: 800; color: var(--ink-2); }

/* QR */
.qr { background: #fff; padding: 10px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); display: inline-block; line-height: 0; }
.qr img, .qr canvas { width: 100%; height: auto; display: block; }
.qrcard { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 16px; align-items: center; }
.bigcode { font-family: var(--display); font-weight: 900; font-size: 30px; letter-spacing: .14em; }

/* modal + toast */
.scrim { position: fixed; inset: 0; background: rgba(9,22,36,.55); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: #fff; border-radius: 20px; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.modal h2 { font-family: var(--display); font-weight: 900; font-size: 20px; margin: 0 0 6px; }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; right: 16px; top: 16px; z-index: 90; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px; font-weight: 700; font-size: 14px; box-shadow: 0 14px 30px -12px rgba(0,0,0,.4); }
.toast.err { background: #9A2A20; }
.toast.ok { background: #1E5A12; }
.banner { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--warn-bg); color: #6B4200; font-weight: 700; font-size: 14px; flex-wrap: wrap; grid-column: span 12; }
.banner.info { background: #E8F1FF; color: #17497F; }
.banner .link { margin-left: auto; }

/* signed out */
.gate { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.gate .top { padding-bottom: 110px; }
.gate .top .row1 { max-width: 980px; margin: 0 auto; }
.gate main { max-width: 520px; width: 100%; margin: -80px auto 0; }
.gate .panel { padding: 24px; }
.gate h2 { font-size: 22px !important; }
.gbtn { width: 100%; justify-content: center; padding: 12px 14px; font-size: 15px; }
.or { text-align: center; color: var(--ink-3); font-weight: 800; font-size: 13px; margin: 14px 0; }

/* plans */
.plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 12px; }
.plancard { border-radius: 14px; padding: 14px; background: #F6F9FC; display: grid; gap: 6px; align-content: start; }
.plancard.current { box-shadow: inset 0 0 0 2px var(--green-d); background: #fff; }
.plancard h3 { margin: 0; font-family: var(--display); font-weight: 900; font-size: 16px; }
.plancard .price { font-family: var(--display); font-weight: 900; font-size: 24px; }
.plancard .price small { font-size: 13px; color: var(--ink-3); }
.plancard .feats { margin: 2px 0 6px; padding-left: 18px; color: var(--ink-2); display: grid; gap: 2px; }
/* Capped features show as buttons with a star; tapping one opens the matching upgrade. */
.capped::before, .capped-text::before { content: "★"; color: #C98A00; font-weight: 900; margin-right: 6px; }
.btn.go.capped::before { color: #0B1B2B; }
.upgrade-offer { border-radius: 14px; padding: 12px 14px; background: #F6F9FC; box-shadow: inset 0 0 0 1px var(--line); }
.upgrade-offer b { font-family: var(--display); font-weight: 900; font-size: 17px; }
details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font-family: var(--display); font-weight: 900; color: var(--green-d); }

@media print {
  aside, .top .actions, .filters, .tools-panel, .no-print, .toasts, .tip { display: none !important; }
  .shell { display: block; }
  .top { padding-bottom: 24px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  main { margin-top: 12px; }
  .panel { break-inside: avoid; box-shadow: 0 0 0 1px var(--line); }
  .board, .live { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
}

/* phone fixes */
@media (max-width: 700px) {
  .set .row { flex-wrap: wrap; gap: 4px 12px; min-width: 0; }
  .set .row > span { min-width: 0; overflow-wrap: anywhere; }
  .tbl table.people, .tbl.people table { min-width: 0; }
}
/* Sign-in buttons: clear hover and press feedback */
.gbtn { transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease; }
.gbtn:not([disabled]):hover { transform: translateY(-2px); }
.gbtn:not([disabled]):active { transform: translateY(0); }
.btn.line.gbtn:not([disabled]):hover { background: #E3F6DE; color: #1E5A12; box-shadow: inset 0 0 0 2px var(--green), 0 6px 14px rgba(46,158,28,.18); }
.btn.go.gbtn:not([disabled]):hover { box-shadow: 0 6px 14px rgba(46,158,28,.3); }
@media (prefers-reduced-motion: reduce) { .gbtn, .gbtn:hover { transition: none; transform: none; } }
/* Narrow screens: a tidy top bar (brand, org, links on one row, menu scrolls sideways) */
@media (max-width: 900px) {
  aside { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 12px 16px 8px; }
  aside .brand { padding: 0; order: 1; }
  aside .org { display: block; order: 2; flex: 1 1 0; min-width: 0; padding: 0; margin: 0; background: none; text-align: right; }
  aside .org b { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  aside .org span, aside .org .org-logo { display: none; }
  aside .org select { max-width: 100%; }
  .side-foot { order: 3; margin: 0; display: flex; gap: 0; flex: none; }
  .side-foot a, .side-foot button { padding: 4px 8px; }
  nav.side { order: 4; width: 100%; flex-wrap: nowrap; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav.side::-webkit-scrollbar { display: none; }
  nav.side a { flex: none; white-space: nowrap; padding: 8px 12px; }
  .top { padding-top: 16px; }
  .top h1 { font-size: 26px; }
  .top .actions { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .top .actions .btn { font-size: 13px; padding: 8px 10px; }
  .filters { gap: 6px; }
}
@media (max-width: 560px) { aside .org:not(:has(select)) { display: none; } }
/* Lists of rows (activity, invites, settings) stay inside their panel at any width */
.set { grid-template-columns: minmax(0, 1fr); }
.set .row { min-width: 0; flex-wrap: wrap; gap: 4px 12px; }
.set .row > span { min-width: 0; overflow-wrap: anywhere; }
.set .row > span.note { margin-left: auto; }
/* Sign-in header: the logo leads, the words step back */
.gate-brand { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.gate-brand img { width: 52px; height: 52px; border-radius: 14px; box-shadow: 0 0 0 2px rgba(142,240,123,.55), 0 0 22px rgba(82,217,60,.45); }
.gate-brand .gb-text { display: flex; flex-direction: column; line-height: 1.15; }
.gate-brand .gb-name { font-family: var(--display); font-weight: 900; font-size: 19px; color: #fff; }
.gate-brand .gb-sub { font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mint); }

/* challenge people and teams */
.teamchip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #F6F9FC; font-size: 13px; }
.teamchip i { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(10,30,60,.12); }
.teamchip .muted { font-weight: 600; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #E9F2FA; color: #0F63A6; font-size: 12px; font-weight: 800; }
.tag.ok { background: rgba(43,196,160,.16); color: #127A5F; }
.tag.muted { background: #F1F3F6; color: var(--ink-2); }
table.ppl { min-width: 0; width: 100%; }
table.ppl td { vertical-align: middle; }
table.ppl select.in { padding: 7px 34px 7px 10px; background-position: right 12px center; font-size: 13px; max-width: 190px; display: block; }
.panel input[type="search"] { font: inherit; font-weight: 600; color: var(--ink); background: #fff; border: 0; border-radius: 10px; padding: 9px 12px; box-shadow: inset 0 0 0 1.5px var(--line); }
.panel input[type="search"]:focus { outline: none; box-shadow: inset 0 0 0 2px var(--green-d); }
.segl { flex-wrap: wrap; }
@media (max-width: 640px) {
  table.ppl thead { display: none; }
  table.ppl tr { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 4px 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.ppl td { padding: 0; border: 0; }
  table.ppl td:nth-child(4) { grid-column: 2 / 4; }
  table.ppl td div { overflow-wrap: anywhere; }
  .segl { border-radius: 14px; }
}

/* sidebar logo matches the sign-in header */
.side-brand { gap: 12px; }
.side-brand img { width: 44px; height: 44px; border-radius: 12px; box-shadow: 0 0 0 2px rgba(82,217,60,.45), 0 0 16px rgba(82,217,60,.35); }
.side-brand .gb-text { display: flex; flex-direction: column; line-height: 1.15; }
.side-brand .gb-name { font-family: var(--display); font-weight: 900; font-size: 16px; color: var(--ink); }
.side-brand .gb-sub { font-family: var(--display); font-weight: 800; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--green-d); margin-top: 2px; }
@media (max-width: 900px) { .side-brand img { width: 36px; height: 36px; border-radius: 10px; } .side-brand .gb-name { font-size: 15px; } .side-brand .gb-sub { font-size: 10px; } }
