/* StraightPass — asphalt & signal green */
:root {
  --green: #16A75C;
  --green-700: #0F7F45;
  --green-50: #E8F6EE;
  --asphalt: #16191D;
  --asphalt-2: #1F242A;
  --asphalt-3: #2B3138;
  --ink: #15181C;
  --text: #2A3036;
  --muted: #69717A;
  --line: #E3E6E9;
  --paper: #F5F6F4;
  --card: #FFFFFF;
  --amber: #E8A317;
  --amber-50: #FDF4E1;
  --red: #D6453D;
  --red-50: #FBEAE9;
  --blue: #2C6FD1;
  --blue-50: #E8F0FB;
  --grey-50: #EEF0F2;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 24, 28, .05), 0 4px 16px rgba(20, 24, 28, .05);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--body); color: var(--text); background: var(--paper); }
a { color: var(--green-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green); }
h1, h2, h3, h4 { font-family: var(--display); color: var(--ink); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.25rem 0; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; }
pre.code { background: var(--grey-50); padding: .75rem; border-radius: 8px; overflow: auto; }
.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 6px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid rgba(22, 167, 92, .45); outline-offset: 2px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 252px; flex: none; background: var(--asphalt); color: #C9CED3; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background-image: linear-gradient(180deg, rgba(255,255,255,.02), transparent 30%); }
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 18px 14px; text-decoration: none; color: #fff; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: var(--display); font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.brand small { font-size: .74rem; color: #8C949C; margin-top: 3px; }
.nav { padding: 6px 10px 16px; display: flex; flex-direction: column; gap: 1px; }
.nav-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: #6E767F; padding: 14px 10px 6px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: #C9CED3; text-decoration: none; font-weight: 500; font-size: .93rem; position: relative; }
.nav a:hover { background: var(--asphalt-2); color: #fff; }
.nav a.active { background: var(--asphalt-3); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.nav a.active .ico { color: var(--green); }
.nav .count { margin-left: auto; font-style: normal; background: var(--green); color: #fff; font-size: .72rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; padding: 14px 20px 18px; border-top: 1px solid var(--asphalt-3); font-size: .82rem; }
.sidebar-foot a { color: #8C949C; text-decoration: none; }
.sidebar-foot a:hover { color: #fff; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(245, 246, 244, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 10px 28px; min-height: 60px; }
.topbar-title { font-family: var(--display); font-weight: 700; font-size: 1.05rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search input { width: 220px; padding: 8px 12px 8px 34px; border-radius: 99px; border: 1px solid var(--line); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2369717A' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat 12px center; font: inherit; font-size: .9rem; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: #cfd4d8; color: var(--ink); }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: .66rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--paper); }
.menu-btn { display: none; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 10px 3px 3px; border-radius: 99px; border: 1px solid var(--line); background: #fff; }
.usermenu summary::-webkit-details-marker { display: none; }
.avatar { width: 32px; height: 32px; border-radius: 99px; background: var(--asphalt); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .78rem; flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar.green { background: var(--green); }
.uname { font-weight: 600; font-size: .9rem; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.12); min-width: 230px; padding: 6px; z-index: 30; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); }
.usermenu .menu a, .usermenu .menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--grey-50); }
.content { padding: 24px 28px 40px; max-width: 1400px; width: 100%; }
.foot { padding: 18px 28px; color: var(--muted); font-size: .8rem; margin-top: auto; }
.scrim { display: none; }

/* Page header */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 9px; border: 1px solid transparent; font: 600 .9rem/1.2 var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn .ico { width: 16px; height: 16px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-700); color: #fff; }
.btn-dark { background: var(--asphalt); color: #fff; }
.btn-dark:hover { background: var(--asphalt-3); color: #fff; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: #c9ced3; color: var(--ink); }
.btn-danger { background: #fff; color: var(--red); border-color: #F0C9C6; }
.btn-danger:hover { background: var(--red-50); color: var(--red); }
.btn-sm { padding: 6px 10px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--green-700); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
form.inline { display: inline; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.card-head .actions, .card-head > a { margin-left: auto; font-size: .86rem; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cols-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols-half { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.stack > * + * { margin-top: 14px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: #cdd3d8; color: inherit; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.stat .value { font-family: var(--display); font-size: 1.85rem; font-weight: 800; color: var(--ink); line-height: 1.1; margin-top: 6px; }
.stat .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.stat.accent { background: var(--asphalt); color: #C9CED3; border-color: var(--asphalt); }
.stat.accent .value { color: #fff; }
.stat.accent .label, .stat.accent .sub { color: #9AA2AA; }
.stat.accent::after { content: ''; position: absolute; right: -20px; bottom: -20px; width: 90px; height: 90px; border-radius: 50%; border: 10px solid rgba(22,167,92,.35); }
.stat.warn .value { color: #B4500F; }

/* Quick actions */
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #FAFBFA; }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #FAFBFA; }
td.actions { text-align: right; white-space: nowrap; }
.card.flush table th:first-child, .card.flush table td:first-child { padding-left: 20px; }
.card.flush table th:last-child, .card.flush table td:last-child { padding-right: 20px; }
.person { display: flex; align-items: center; gap: 10px; }
.person a { font-weight: 600; color: var(--ink); text-decoration: none; }
.person a:hover { color: var(--green-700); }
.person small { display: block; color: var(--muted); font-size: .8rem; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; color: var(--ink); }
.list .meta { color: var(--muted); font-size: .83rem; }
.time-chip { font-family: var(--display); font-weight: 700; background: var(--asphalt); color: #fff; border-radius: 8px; padding: 6px 8px; text-align: center; min-width: 62px; line-height: 1.1; font-size: .95rem; }
.time-chip small { display: block; font-family: var(--body); font-weight: 500; font-size: .7rem; color: #9AA2AA; }
.date-chip { background: var(--green-50); color: var(--green-700); border-radius: 8px; padding: 6px 8px; text-align: center; min-width: 52px; line-height: 1.05; font-weight: 700; }
.date-chip small { display: block; font-size: .68rem; text-transform: uppercase; font-weight: 600; }

/* Badges */
.badge { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge-green { background: var(--green-50); color: var(--green-700); }
.badge-amber { background: var(--amber-50); color: #9A6406; }
.badge-red { background: var(--red-50); color: #B0342D; }
.badge-blue { background: var(--blue-50); color: #1F5AB0; }
.badge-grey { background: var(--grey-50); color: #59616A; }

/* Alerts */
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; font-size: .92rem; }
.alert-success { background: var(--green-50); border-color: #BFE5CF; color: #0C6537; }
.alert-error { background: var(--red-50); border-color: #F2C8C5; color: #8E2A24; }
.alert-warning { background: var(--amber-50); border-color: #F2DDAD; color: #7A5006; }
.alert-info { background: var(--blue-50); border-color: #C6D8F3; color: #1D4E96; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-weight: 600; font-size: .86rem; color: var(--ink); }
.field > span em { font-weight: 400; color: var(--muted); font-style: normal; }
.field small { color: var(--muted); font-size: .8rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=datetime-local], input[type=search], input[type=url], input:not([type]), select, textarea {
  font: inherit; font-size: .93rem; padding: 9px 11px; border: 1px solid #D5DADE; border-radius: 9px; background: #fff; color: var(--ink); width: 100%; min-width: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--green); outline: 3px solid rgba(22,167,92,.18); outline-offset: 0; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--green); width: 16px; height: 16px; }
.form-card { max-width: 860px; }
.form-section { padding-top: 6px; }
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 20px; }
.form-section h3 { margin-bottom: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-bottom: 14px; }
.filters .field { min-width: 150px; }
.filters input, .filters select { padding: 7px 10px; font-size: .88rem; }
.hp { position: absolute; left: -5000px; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--ink); border-color: var(--green); }

/* Profile header */
.profile-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.profile-head h1 { margin: 0; }
.profile-head .meta { color: var(--muted); font-size: .9rem; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.profile-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
dl.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 14px; margin: 0; font-size: .92rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; color: var(--ink); word-break: break-word; }

/* Progress */
.progress { height: 8px; background: var(--grey-50); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: 99px; }
.progress.lg { height: 12px; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--green) calc(var(--p) * 1%), var(--grey-50) 0); flex: none; }
.ring::before { content: ''; grid-area: 1/1; width: 92px; height: 92px; border-radius: 50%; background: #fff; }
.ring b { grid-area: 1/1; font-family: var(--display); font-size: 1.6rem; color: var(--ink); z-index: 1; }
.skill-row { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.skill-row:last-child { border-bottom: 0; }
.levels { display: flex; gap: 4px; }
.levels i { flex: 1; height: 8px; border-radius: 3px; background: var(--grey-50); }
.levels i.on { background: var(--green); }
.lvl-picker { display: flex; gap: 4px; flex-wrap: wrap; }
.lvl-picker label { cursor: pointer; }
.lvl-picker input { position: absolute; opacity: 0; }
.lvl-picker span { display: inline-grid; place-items: center; min-width: 34px; height: 32px; border-radius: 8px; border: 1px solid var(--line); font-weight: 700; font-size: .85rem; background: #fff; }
.lvl-picker input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.lvl-picker input:focus-visible + span { outline: 3px solid rgba(22,167,92,.4); }
.skill-grid th.rot { writing-mode: vertical-rl; transform: rotate(180deg); height: 150px; text-transform: none; letter-spacing: 0; font-size: .76rem; font-weight: 500; padding: 8px 4px; vertical-align: bottom; }
.lv { display: inline-block; width: 24px; height: 24px; border-radius: 6px; text-align: center; line-height: 24px; font-size: .74rem; font-weight: 700; }
.lv-0 { background: var(--grey-50); color: #9aa2aa; }
.lv-1 { background: #FDECEA; color: #A23A33; }
.lv-2 { background: #FDF0DD; color: #95600D; }
.lv-3 { background: #FBF6D2; color: #7C6B08; }
.lv-4 { background: #DFF3E7; color: #1A7A47; }
.lv-5 { background: var(--green); color: #fff; }

/* Calendar */
.cal { display: grid; grid-template-columns: 56px repeat(7, minmax(120px, 1fr)); min-width: 920px; position: relative; }
.cal-head { position: sticky; top: 0; background: #FAFBFA; border-bottom: 1px solid var(--line); padding: 8px; font-weight: 600; font-size: .85rem; text-align: center; z-index: 2; }
.cal-head.today { color: var(--green-700); }
.cal-head small { display: block; color: var(--muted); font-weight: 500; }
.cal-times { border-right: 1px solid var(--line); }
.cal-times div { height: 52px; font-size: .72rem; color: var(--muted); text-align: right; padding: 2px 6px 0 0; }
.cal-day { position: relative; border-right: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, var(--line) 51px, var(--line) 52px); }
.cal-day.today { background-color: #FBFDFB; }
.cal-avail { position: absolute; left: 0; right: 0; background: rgba(22,167,92,.06); border-left: 3px solid rgba(22,167,92,.3); }
.cal-ev { position: absolute; left: 4px; right: 4px; border-radius: 8px; padding: 5px 7px; font-size: .78rem; line-height: 1.25; overflow: hidden; text-decoration: none; color: #fff; background: var(--asphalt); border-left: 4px solid var(--green); box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.cal-ev:hover { color: #fff; filter: brightness(1.15); }
.cal-ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.st-requested { background: #FFF6E3; color: #6E4A06; border-left-color: var(--amber); border: 1px dashed var(--amber); border-left-width: 4px; }
.cal-ev.st-completed { background: #2F3A33; }
.cal-ev.st-cancelled, .cal-ev.st-no_show { background: var(--grey-50); color: #7a828a; text-decoration: line-through; border-left-color: #c3c8cd; box-shadow: none; }
.cal-ev.test { border-left-color: var(--red); background: #3A2523; }
.cal-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.agenda-day { margin-bottom: 14px; }
.agenda-day h3 { font-size: .9rem; color: var(--muted); margin: 0 0 6px; }

/* Charts */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .bar rect { fill: var(--green); transition: fill .15s; }
.chart .bar:hover rect { fill: var(--green-700); }
.chart .val { font-size: 11px; fill: var(--ink); text-anchor: middle; font-weight: 600; font-family: var(--body); }
.chart .lbl { font-size: 11px; fill: var(--muted); text-anchor: middle; font-family: var(--body); }

/* Slots */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slot { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: #fff; cursor: pointer; display: block; }
.slot:hover { border-color: var(--green); }
.slot input { position: absolute; opacity: 0; }
.slot:has(input:checked) { border-color: var(--green); background: var(--green-50); box-shadow: 0 0 0 2px rgba(22,167,92,.25); }
.slot b { display: block; color: var(--ink); }
.slot small { color: var(--muted); }

/* Journal */
.journal-entry { border-left: 3px solid var(--green); padding: 2px 0 2px 16px; margin-bottom: 22px; }
.journal-entry h3 { margin-bottom: 4px; }
.journal-entry .jgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; margin-top: 10px; }
.journal-entry .jgrid div b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
.prewrap { white-space: pre-line; }

/* Messages */
.msg-list a { display: block; text-decoration: none; color: inherit; }
.msg-unread .title { color: var(--ink); }
.msg-unread .title::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-right: 7px; vertical-align: 1px; }
.msg-body { white-space: pre-line; background: #FAFBFA; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }

/* Empty */
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty-state { text-align: center; padding: 60px 20px; max-width: 520px; margin: 0 auto; }
.big-code { font-family: var(--display); font-size: 4rem; font-weight: 800; color: var(--green); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 14px; color: var(--muted); font-size: .86rem; }
.announce { border-left: 4px solid var(--amber); background: var(--amber-50); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.announce b { color: var(--ink); }

/* Auth */
.auth-body { background: var(--paper); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-side { background: var(--asphalt); color: #fff; padding: 40px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.auth-side .road { position: absolute; left: 50%; bottom: -10%; width: 60%; height: 120%; transform: translateX(-50%) perspective(400px) rotateX(55deg); background: #22272D; transform-origin: bottom; }
.auth-side .road::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 8px; transform: translateX(-50%); background: repeating-linear-gradient(to bottom, #fff 0 40px, transparent 40px 80px); opacity: .8; }
.auth-side .brand { position: relative; z-index: 1; padding: 0; }
.auth-pitch { position: relative; z-index: 1; margin-top: auto; max-width: 420px; }
.auth-pitch h2 { color: #fff; font-size: 2.2rem; font-weight: 800; }
.auth-pitch p { color: #B7BEC5; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 30px; }

/* Print */
@media print {
  .sidebar, .topbar, .foot, .no-print, .page-head .actions { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Responsive */
@media (max-width: 1100px) {
  .cols-main { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 10px 16px; }
  .content { padding: 18px 16px 32px; }
  .search { display: none; }
  .cols-half { grid-template-columns: minmax(0, 1fr); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { padding: 22px 20px; min-height: 0; }
  .auth-side .road, .auth-pitch { display: none; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.45rem; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .uname { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .value { font-size: 1.45rem; }
  .page-head .actions { margin-left: 0; width: 100%; }
  .skill-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
  .auth-card { padding: 22px; border-radius: 16px; }
  /* Stack table rows as cards on phones */
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { border-bottom: 1px solid var(--line); padding: 10px 16px; }
  table.stack-sm td { border: 0; padding: 3px 0 !important; }
  table.stack-sm td[data-label]::before { content: attr(data-label) ': '; color: var(--muted); font-size: .8rem; }
  table.stack-sm td.actions { text-align: left; padding-top: 8px !important; }
}
details > summary { cursor: pointer; padding: 6px 0; list-style-position: inside; }
details > summary b { color: var(--ink); }
details .list { margin-top: 4px; }
.list .ico { width: 14px; height: 14px; vertical-align: -2px; }
.cal-nav select { width: auto; padding: 7px 10px; font-size: .88rem; }
a.slot { text-decoration: none; color: inherit; }
.skill-grid th.rot { height: 200px; }
.stat > * { position: relative; z-index: 1; }
.stat.accent::after { width: 70px; height: 70px; right: -26px; bottom: -26px; border-width: 8px; z-index: 0; }
.sidebar { min-height: 100vh; }
@media (max-width: 900px) {
  .auth-wrap { grid-template-rows: auto 1fr; }
  .auth-main { align-items: start; padding-top: 24px; }
}
.chart rect.s-lesson { fill: var(--green); }
.chart rect.s-practice { fill: #8FD3AE; }
.legend i.sw-s-lesson { background: var(--green); }
.legend i.sw-s-practice { background: #8FD3AE; }
.chart.line .stroke { fill: none; stroke: var(--green); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart.line .area { fill: rgba(22,167,92,.10); }
.chart.line .pt circle { fill: #fff; stroke: var(--green); stroke-width: 2.5; }
.chart.line .pt:hover circle { fill: var(--green); }
.milestones { list-style: none; margin: 0; padding: 0; position: relative; }
.milestones li { display: flex; gap: 12px; padding: 0 0 16px; position: relative; }
.milestones li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.milestones li:last-child::before { display: none; }
.milestones .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); background: #fff; display: grid; place-items: center; flex: none; z-index: 1; }
.milestones li.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.milestones li.done::before { background: var(--green); }
.milestones li.next .dot { border-color: var(--green); box-shadow: 0 0 0 4px rgba(22,167,92,.15); }
.milestones .dot .ico { width: 14px; height: 14px; }
.milestones b { display: block; color: var(--ink); }
.milestones small { color: var(--muted); }
.cat-row { margin-bottom: 12px; }
.cat-row .top { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: 5px; }
.cat-row .top b { color: var(--ink); }
.mobile-only { display: none; }
@media (max-width: 1100px) { .mobile-only { display: block; margin-bottom: 16px; } .desktop-only { display: none; } }
#qr svg { display: block; }
/* Route recording & replay */
.recorder { text-align: center; }
.rec-head { display: flex; gap: 10px; align-items: center; justify-content: center; margin-bottom: 14px; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #C3C8CD; flex: none; }
.recorder.is-recording .rec-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(214,69,61,.2); }
.rec-dot.blink { background: var(--green) !important; }
.rec-status { font-weight: 600; color: var(--ink); }
.rec-status.warn { color: #9A6406; }
.rec-status.on { color: var(--green-700); }
.rec-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 18px; }
.rec-stats div { background: var(--paper); border-radius: 10px; padding: 10px 6px; }
.rec-stats small { display: block; color: var(--muted); font-size: .72rem; }
.rec-stats b { font-family: var(--display); font-size: 1.35rem; color: var(--ink); }
.rec-btn { width: 100%; max-width: 420px; padding: 18px; font-size: 1.15rem; border-radius: 14px; }
.rec-tips { text-align: left; max-width: 520px; margin: 18px auto 0; padding-left: 18px; line-height: 1.6; }
.rp-map-wrap { position: relative; }
.rp-map { height: 460px; background: #E8ECE9; }
.rp-callout { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 500; background: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: 0 4px 16px rgba(0,0,0,.18); font-weight: 600; border-left: 5px solid var(--blue); }
.rp-callout.k-good { border-left-color: var(--green); }
.rp-callout.k-improve { border-left-color: var(--red); }
.rp-controls { display: flex; gap: 12px; align-items: center; padding: 14px 16px 6px; flex-wrap: wrap; }
.rp-controls input[type=range] { flex: 1; min-width: 160px; accent-color: var(--green); }
.rp-speeds { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.rp-speeds button { border: 0; background: #fff; padding: 8px 11px; font: 600 .85rem var(--body); cursor: pointer; color: var(--muted); }
.rp-speeds button.on { background: var(--asphalt); color: #fff; }
.rp-readout { display: flex; gap: 18px; padding: 4px 16px 16px; font-size: .9rem; color: var(--muted); flex-wrap: wrap; }
.rp-readout b { color: var(--ink); font-variant-numeric: tabular-nums; }
.note-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--blue); }
.note-dot.k-good { background: var(--green); }
.note-dot.k-improve { background: var(--red); }
.route-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) { .rp-map { height: 340px; } .rec-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
[hidden] { display: none !important; }
