/* ==========================================================================
   Revisely — design system modelled on Apple's Human Interface Guidelines.
   System font (SF Pro on Apple devices), iOS system colours, inset grouped
   lists, large titles, translucent bars, light + dark appearance.
   ========================================================================== */
:root {
  --bg: #f2f2f7; --bg2: #ffffff; --bg3: #f2f2f7;
  --card: #ffffff; --elev: #ffffff;
  --label: #000000; --label2: rgba(60,60,67,.6); --label3: rgba(60,60,67,.3);
  --sep: rgba(60,60,67,.18); --sep-opaque: #c6c6c8;
  --fill: rgba(118,118,128,.12); --fill2: rgba(118,118,128,.08);
  --bar: rgba(249,249,249,.78); --side: rgba(242,242,247,.85);
  --blue: #007aff; --green: #34c759; --red: #ff3b30; --orange: #ff9500; --yellow: #ffcc00;
  --indigo: #5856d6; --purple: #af52de; --pink: #ff2d55; --teal: #30b0c7; --gray: #8e8e93;
  --tint: var(--blue);
  --radius: 12px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --bg2: #1c1c1e; --bg3: #2c2c2e;
    --card: #1c1c1e; --elev: #2c2c2e;
    --label: #ffffff; --label2: rgba(235,235,245,.6); --label3: rgba(235,235,245,.3);
    --sep: rgba(84,84,88,.6); --sep-opaque: #38383a;
    --fill: rgba(118,118,128,.24); --fill2: rgba(118,118,128,.16);
    --bar: rgba(22,22,24,.78); --side: rgba(28,28,30,.85);
    --blue: #0a84ff; --green: #30d158; --red: #ff453a; --orange: #ff9f0a; --yellow: #ffd60a;
    --indigo: #5e5ce6; --purple: #bf5af2; --pink: #ff375f; --teal: #40c8e0; --gray: #8e8e93;
    --shadow: none;
  }
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--label); font: 400 17px/1.35 var(--font); letter-spacing: -.41px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-tap-highlight-color: transparent; }
@media (min-width: 1024px) { body { font-size: 15px; letter-spacing: -.24px; } }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: none; opacity: .85; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0 0 .75em; }
img { max-width: 100%; }
.ic { width: 1.15em; height: 1.15em; fill: currentColor; flex: none; vertical-align: -.2em; }
.hidden { display: none !important; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.muted { color: var(--label2); }
.small { font-size: 13px; letter-spacing: -.08px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt0 { margin-top: 0; }
.nowrap { white-space: nowrap; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* --------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main { flex: 1; min-width: 0; }
.content { max-width: 980px; margin: 0 auto; padding: 8px 16px calc(96px + var(--safe-b)); }
@media (min-width: 1024px) {
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: 260px; flex: none; padding: 18px 12px 12px; background: var(--side); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-right: .5px solid var(--sep); overflow-y: auto; }
  .content { padding: 8px 40px 64px; }
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--label); font-weight: 700; font-size: 19px; letter-spacing: -.4px; padding: 0 10px 14px; }
.brand img { border-radius: 7px; }
.side-group { margin-bottom: 14px; }
.side-label { font-size: 11px; font-weight: 600; color: var(--label2); padding: 0 10px 4px; letter-spacing: .06px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 8px; color: var(--label); font-size: 14px; font-weight: 500; }
.side-link .ic { color: var(--tint); width: 18px; height: 18px; }
.side-link:hover { background: var(--fill2); opacity: 1; }
.side-link.active { background: var(--tint); color: #fff; }
.side-link.active .ic { color: #fff; }
.count-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: var(--fill); color: var(--label2); font-size: 12px; font-weight: 600; text-align: center; }
.side-link.active .count-badge { background: rgba(255,255,255,.25); color: #fff; }
.side-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-top: .5px solid var(--sep); }
.side-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-user-text b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-text small { color: var(--label2); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #a1a1a6, #8e8e93); color: #fff; font-weight: 600; flex: none; }
.avatar.lg { width: 72px; height: 72px; font-size: 30px; }

/* navigation bar */
.navbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; min-height: 44px; padding: calc(env(safe-area-inset-top, 0px) + 4px) 12px 4px; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid transparent; transition: border-color .2s; }
.navbar.scrolled { border-bottom-color: var(--sep); }
.nav-title { font-weight: 600; font-size: 17px; opacity: 0; transition: opacity .2s; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw; }
.navbar.scrolled .nav-title { opacity: 1; }
.nav-back, .nav-brand { display: inline-flex; align-items: center; gap: 2px; font-size: 17px; justify-self: start; min-height: 44px; }
.nav-back .ic { width: 22px; height: 22px; }
.nav-brand { gap: 8px; color: var(--label); font-weight: 600; }
.nav-brand img { border-radius: 6px; }
.nav-actions { justify-self: end; display: flex; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--tint); }
.icon-btn:hover { background: var(--fill2); opacity: 1; }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn .dot { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
@media (min-width: 1024px) { .nav-brand { visibility: hidden; } .navbar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; } .navbar.scrolled { background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); } }

/* tab bar (phones and tablets) */
.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 6px 4px calc(var(--safe-b) + 4px); background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--sep); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--gray); font-size: 10px; font-weight: 500; letter-spacing: .1px; padding: 2px 0; }
.tab .ic { width: 25px; height: 25px; }
.tab.active { color: var(--tint); }
.tab-add .ic { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--tint); color: #fff; margin-top: -2px; }
@media (min-width: 1024px) { .tabbar { display: none; } }

/* large title */
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.large-title { font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: .37px; }
.subtitle { color: var(--label2); margin: 2px 0 0; font-size: 15px; letter-spacing: -.24px; }
@media (min-width: 1024px) { .large-title { font-size: 30px; line-height: 36px; } }

/* --------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; border-radius: var(--radius); background: var(--tint); color: #fff; font: 600 17px/1 var(--font); letter-spacing: -.41px; cursor: pointer; text-align: center; transition: opacity .15s, transform .1s; white-space: nowrap; }
.btn:hover { opacity: .88; color: #fff; }
.btn:active { transform: scale(.98); opacity: .75; }
.btn:disabled { opacity: .35; cursor: default; }
.btn-lg { min-height: 50px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 12px; border-radius: 16px; font-size: 15px; letter-spacing: -.24px; }
.btn-tinted { background: color-mix(in srgb, var(--tint) 15%, transparent); color: var(--tint); }
.btn-tinted:hover { color: var(--tint); }
.btn-gray { background: var(--fill); color: var(--tint); }
.btn-gray:hover { color: var(--tint); }
.btn-plain { background: transparent; color: var(--tint); padding: 0 6px; }
.btn-plain:hover { color: var(--tint); }
.btn-danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn-danger:hover { color: var(--red); }
.btn-green { background: var(--green); }
.btn .ic { width: 1.1em; height: 1.1em; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form { display: inline; margin: 0; }
@media (min-width: 1024px) { .btn { font-size: 15px; min-height: 38px; border-radius: 10px; } .btn-lg { min-height: 46px; font-size: 16px; border-radius: 12px; } .btn-sm { min-height: 30px; font-size: 13px; } }

/* ------------------------------------------------------- lists and cards */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 26px 16px 7px; }
.section-head h2 { font-size: 13px; font-weight: 400; color: var(--label2); text-transform: uppercase; letter-spacing: -.08px; }
.section-head a, .section-head .sh-extra { font-size: 15px; }
.section-head.big h2 { font-size: 22px; font-weight: 700; text-transform: none; color: var(--label); letter-spacing: .35px; }
.section-foot, .foot-note { margin: 7px 16px 0; color: var(--label2); font-size: 13px; letter-spacing: -.08px; }
.list, .card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.card { padding: 16px; }
.card + .card, .list + .list { margin-top: 16px; }
.list-flush { box-shadow: none; border-radius: 0; background: transparent; margin: 0 -16px; }
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 16px; color: var(--label); }
.row + .row::before, .row + .field::before, .field + .row::before, .field + .field::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.row.has-icon + .row::before, .row + .row.has-icon::before { left: 58px; }
a.row:hover { background: var(--fill2); opacity: 1; }
a.row:active { background: var(--fill); }
.row-icon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--gray); color: #fff; flex: none; }
.row-icon .ic { width: 18px; height: 18px; }
.ic-blue { background: var(--blue); } .ic-green { background: var(--green); } .ic-red { background: var(--red); } .ic-orange { background: var(--orange); } .ic-indigo { background: var(--indigo); } .ic-purple { background: var(--purple); } .ic-teal { background: var(--teal); } .ic-pink { background: var(--pink); } .ic-gray { background: var(--gray); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-weight: 400; }
.row-title.strong { font-weight: 600; }
.row-sub { color: var(--label2); font-size: 15px; letter-spacing: -.24px; }
.row-meta { color: var(--label2); font-size: 13px; letter-spacing: -.08px; }
.row-detail { color: var(--label2); white-space: nowrap; }
.row-end { display: flex; align-items: center; gap: 8px; flex: none; }
.chev { color: var(--label3); width: 14px; height: 14px; margin-right: -4px; }
.row.destructive { color: var(--red); justify-content: center; }
.row.center { justify-content: center; color: var(--tint); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: var(--label2); }
@media (min-width: 1024px) { .row-sub { font-size: 13px; } }

/* pills */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
.pill .ic { width: 12px; height: 12px; }
.pill-blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.pill-green { background: color-mix(in srgb, var(--green) 16%, transparent); color: color-mix(in srgb, var(--green) 75%, var(--label)); }
.pill-red { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pill-orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: color-mix(in srgb, var(--orange) 80%, var(--label)); }
.pill-gray { background: var(--fill); color: var(--label2); }
.pill-indigo { background: color-mix(in srgb, var(--indigo) 14%, transparent); color: var(--indigo); }

/* banners (flash messages) */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin: 0 0 16px; font-size: 15px; background: var(--card); box-shadow: var(--shadow); }
.banner .ic { width: 20px; height: 20px; }
.banner-success .ic { color: var(--green); }
.banner-error { background: color-mix(in srgb, var(--red) 10%, var(--card)); color: var(--label); }
.banner-error .ic { color: var(--red); }
.banner-info .ic, .banner-warning .ic { color: var(--orange); }
.banner-warning { background: color-mix(in srgb, var(--orange) 12%, var(--card)); }
a.banner { color: var(--label); }
.banner.fade { opacity: 0; transform: translateY(-6px); transition: opacity .4s, transform .4s; }
.errors { list-style: none; padding: 0; margin: 0; }

/* --------------------------------------------------------------- forms */
.form .list { margin-bottom: 8px; }
.field { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; }
.field > span:first-child { flex: 0 0 110px; color: var(--label); }
.field input, .field select, .field textarea { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--label); font: inherit; letter-spacing: inherit; padding: 11px 0; outline: none; }
.field input::placeholder, .field textarea::placeholder { color: var(--label3); }
.field select { appearance: none; -webkit-appearance: none; color: var(--label2); text-align: right; text-align-last: right; cursor: pointer; }
.field.stack { flex-direction: column; align-items: stretch; gap: 0; padding: 10px 16px; }
.field.stack > span:first-child { flex: none; font-size: 13px; color: var(--label2); }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.4; }
.field .hint { font-size: 13px; color: var(--label2); }
@media (max-width: 520px) { .field > span:first-child { flex-basis: 92px; } }
.input, .select, .textarea { width: 100%; min-height: 44px; border: 0; border-radius: var(--radius-sm); background: var(--fill); color: var(--label); font: inherit; letter-spacing: inherit; padding: 10px 12px; outline: none; }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--label2) 50%), linear-gradient(135deg, var(--label2) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
.search { position: relative; }
.search .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--label2); }
.search .input { padding-left: 34px; min-height: 36px; border-radius: 10px; }
.filters { display: grid; gap: 8px; grid-template-columns: 1fr; margin-bottom: 16px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr auto; align-items: center; } .filters.f3 { grid-template-columns: 2fr 1fr auto; } .filters.f2 { grid-template-columns: 1fr auto; } }
.label-sm { display: block; font-size: 13px; color: var(--label2); margin: 0 4px 6px; }
.file-drop { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 64px; border: 1.5px dashed var(--sep-opaque); border-radius: var(--radius-sm); color: var(--tint); cursor: pointer; padding: 12px; text-align: center; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.err-text { color: var(--red); font-size: 13px; margin-top: 6px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* toggle switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* segmented control */
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg-item { flex: 1; padding: 6px 14px; border-radius: 7px; color: var(--label); font-size: 13px; font-weight: 500; text-align: center; white-space: nowrap; }
.seg-item.active { background: var(--elev); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }
.seg-item:hover { opacity: 1; }
.seg-wrap { margin-bottom: 16px; }

/* ---------------------------------------------------------- dashboards */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } .tiles.t3 { grid-template-columns: repeat(3, 1fr); } .tiles.t5 { grid-template-columns: repeat(5, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); color: var(--label); box-shadow: var(--shadow); }
a.tile:hover { opacity: 1; background: color-mix(in srgb, var(--card) 92%, var(--label)); }
.tile-value { font: 700 28px/1.1 var(--rounded); letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.tile-label { color: var(--label2); font-size: 13px; font-weight: 500; }
.tone-blue .tile-value { color: var(--blue); } .tone-red .tile-value { color: var(--red); } .tone-green .tile-value { color: var(--green); } .tone-orange .tile-value { color: var(--orange); } .tone-indigo .tile-value { color: var(--indigo); }

.hero-card { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 120px; height: 120px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 13; stroke-linecap: round; }
.ring-track { stroke: color-mix(in srgb, var(--green) 18%, transparent); }
.ring-fill { stroke: var(--green); transition: stroke-dashoffset .8s ease; }
.ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-text b { font: 700 26px/1 var(--rounded); }
.ring-text small { color: var(--label2); font-size: 11px; margin-top: 3px; }
.hero-lines { display: grid; gap: 6px; flex: 1; min-width: 0; }
.hero-lines h2 { font-size: 22px; font-weight: 700; letter-spacing: .35px; }
.kv { display: flex; gap: 6px; align-items: center; color: var(--label2); font-size: 15px; }
.kv b { color: var(--label); font-variant-numeric: tabular-nums; }

.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 3fr 2fr; align-items: start; } .grid-2.even { grid-template-columns: 1fr 1fr; } }

/* revision rows */
.rev .row-title { font-weight: 600; color: var(--label); }
.rev-actions { display: flex; gap: 6px; flex: none; }
.rev.overdue .row-icon { background: var(--red); }
.late { color: var(--red); }

/* stages timeline */
.stages { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 2px; scrollbar-width: none; }
.stages::-webkit-scrollbar { display: none; }
.stage { flex: 1 0 64px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 10px; background: var(--fill2); font-size: 12px; text-align: center; }
.stage b { font-size: 13px; }
.stage span { color: var(--label2); }
.stage .ic { width: 16px; height: 16px; }
.st-completed { background: color-mix(in srgb, var(--green) 14%, transparent); } .st-completed .ic { color: var(--green); }
.st-overdue { background: color-mix(in srgb, var(--red) 12%, transparent); } .st-overdue .ic { color: var(--red); }
.st-due { background: color-mix(in srgb, var(--blue) 14%, transparent); } .st-due .ic { color: var(--blue); }
.st-upcoming .ic { color: var(--label3); }
.bar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--tint); }
.bar.green > i { background: var(--green); } .bar.red > i { background: var(--red); } .bar.orange > i { background: var(--orange); }

/* topic cards grid */
.cards { display: grid; gap: 12px; }
@media (min-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }
.topic-card { display: flex; flex-direction: column; gap: 10px; color: var(--label); }
a.topic-card:hover { opacity: 1; background: color-mix(in srgb, var(--card) 94%, var(--label)); }
.topic-card h3 { font-size: 17px; font-weight: 600; }
.tc-top { display: flex; justify-content: space-between; gap: 8px; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--label2); font-size: 13px; }

/* revise screen */
.recall { text-align: center; padding: 28px 20px; }
.recall h2 { font-size: 28px; font-weight: 700; letter-spacing: .36px; margin: 6px 0 4px; }
.recall .prompt { color: var(--label2); max-width: 460px; margin: 18px auto 22px; }
.ratings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rate { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px; border: 0; border-radius: var(--radius); background: var(--card); color: var(--label); font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: transform .1s; }
.rate:active { transform: scale(.97); }
.rate .ic { width: 28px; height: 28px; }
.rate b { font-size: 17px; }
.rate small { color: var(--label2); font-size: 12px; }
.rate.hard .ic { color: var(--red); } .rate.ok .ic { color: var(--orange); } .rate.easy .ic { color: var(--green); }
.notes-text { white-space: pre-wrap; word-break: break-word; line-height: 1.5; }

/* gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.g-item { display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--fill); }
.g-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.thumb { position: relative; border-radius: 10px; overflow: hidden; background: var(--fill); aspect-ratio: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb small { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb-rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.thumb-check { position: absolute; top: 6px; left: 6px; z-index: 1; width: 20px; height: 20px; accent-color: var(--red); }

/* day chips */
.day-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.day-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-radius: 18px; background: var(--fill); font-size: 15px; }
.day-chip input { width: 52px; border: 0; background: transparent; color: var(--label); font: 600 15px var(--font); text-align: center; outline: none; }
.day-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--label3); color: var(--bg2); cursor: pointer; font-size: 14px; line-height: 1; }
.preview-list { display: grid; gap: 4px; margin-top: 10px; }
.prev-row { display: flex; justify-content: space-between; font-size: 15px; padding: 4px 0; border-bottom: .5px solid var(--sep); }
.prev-row span { color: var(--label2); }
.radio-row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.radio-row input { width: 20px; height: 20px; accent-color: var(--tint); margin: 0; }

/* calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-head h2 { font-size: 22px; font-weight: 700; letter-spacing: .35px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--label2); padding: 4px 0 8px; text-transform: uppercase; }
.cal-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; min-height: 54px; padding: 6px 0; border-radius: 10px; color: var(--label); font-size: 17px; font-variant-numeric: tabular-nums; }
.cal-day:hover { background: var(--fill2); opacity: 1; }
.cal-day.out { color: var(--label3); }
.cal-day.today .cal-num { color: #fff; background: var(--red); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; margin-top: -4px; }
.cal-day.sel { background: var(--fill); }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.cal-dots i.o { background: var(--red); } .cal-dots i.d { background: var(--green); }
.cal-count { font-size: 10px; color: var(--label2); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--label2); font-size: 13px; margin-top: 10px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--blue); }
.legend i.o { background: var(--red); } .legend i.d { background: var(--green); }

/* tables (admin) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .2px; color: var(--label2); padding: 10px 16px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
.table td { padding: 11px 16px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--fill2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table a.who { color: var(--label); font-weight: 600; }
.table small { display: block; color: var(--label2); font-size: 13px; }
@media (min-width: 1024px) { .table { font-size: 14px; } }
.hbar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.hbar .bar { flex: 1; }

/* empty states */
.empty { text-align: center; padding: 36px 20px; color: var(--label2); }
.empty h3 { color: var(--label); font-size: 20px; font-weight: 600; margin: 10px 0 4px; }
.empty p { max-width: 380px; margin: 0 auto 16px; }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--fill); color: var(--label2); }
.empty-icon .ic { width: 30px; height: 30px; }

/* pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 0; }
.pager-info { color: var(--label2); font-size: 13px; text-align: center; }

/* alert sheet (confirm dialog) */
.alert-sheet { width: 270px; padding: 0; border: 0; border-radius: 14px; background: color-mix(in srgb, var(--elev) 92%, transparent); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); color: var(--label); text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.alert-sheet::backdrop { background: rgba(0,0,0,.35); }
.alert-sheet[open] { animation: pop .2s ease; }
@keyframes pop { from { transform: scale(1.12); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.alert-title { font-weight: 600; font-size: 17px; margin: 20px 16px 2px; }
.alert-text { font-size: 13px; margin: 0 16px 18px; color: var(--label); }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid var(--sep); }
.alert-btn { border: 0; background: transparent; color: var(--blue); font: 400 17px var(--font); padding: 12px; cursor: pointer; }
.alert-btn + .alert-btn { border-left: .5px solid var(--sep); }
.alert-destructive { color: var(--red); font-weight: 600; }
.alert-btn:hover { background: var(--fill2); }

/* --------------------------------------------------------------- auth */
.auth-page { background: var(--bg); }
.auth { max-width: 420px; margin: 0 auto; padding: max(48px, 8vh) 20px 40px; text-align: center; }
.auth-logo img { border-radius: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.auth-title { font-size: 28px; font-weight: 700; letter-spacing: .36px; margin: 18px 0 6px; }
.auth-sub { color: var(--label2); margin-bottom: 26px; }
.auth .form { text-align: left; }
.auth .banner { text-align: left; }
.auth-links { margin: 16px 0 0; font-size: 15px; }
.auth-alt { margin-top: 26px; color: var(--label2); font-size: 15px; }
.auth-foot { margin-top: 40px; font-size: 13px; color: var(--label2); }
.auth-foot a { color: var(--label2); }

/* --------------------------------------------------------------- public */
.pub-nav { position: sticky; top: 0; z-index: 10; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--sep); }
.pub-nav .in { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 20px; }
.pub-nav .brand { padding: 0; font-size: 17px; }
.pub-nav .grow { flex: 1; }
.pub-nav a.link { color: var(--label); font-size: 14px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1.05; font-weight: 700; letter-spacing: -.015em; }
.hero h1 span { background: linear-gradient(90deg, var(--blue), var(--indigo) 60%, var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { font-size: clamp(19px, 2.4vw, 24px); color: var(--label2); max-width: 680px; margin: 18px auto 30px; line-height: 1.35; letter-spacing: .1px; }
.hero .btn-row { justify-content: center; }
.hero .btn { border-radius: 980px; min-height: 48px; padding: 0 26px; font-size: 17px; }
.showcase { max-width: 460px; margin: 30px auto 0; text-align: left; }
.features { display: grid; gap: 16px; padding: 40px 0 72px; }
@media (min-width: 820px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { padding: 26px; border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.feature .row-icon { width: 44px; height: 44px; border-radius: 11px; margin-bottom: 14px; }
.feature .row-icon .ic { width: 24px; height: 24px; }
.feature h2 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.feature p { color: var(--label2); margin: 0; }
.pub-foot { text-align: center; color: var(--label2); font-size: 13px; padding: 30px 20px 50px; border-top: .5px solid var(--sep); }
.pub-foot a { color: var(--label2); margin: 0 8px; }
.prose { max-width: 720px; margin: 0 auto; padding: 40px 20px 60px; }
.prose h1 { font-size: 34px; font-weight: 700; margin-bottom: 8px; }
.prose h2 { font-size: 20px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--label); line-height: 1.55; }
.prose .muted { color: var(--label2); }

/* utilities for admin detail page */
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h2 { font-size: 22px; font-weight: 700; }
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart-bars .cb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; font-size: 11px; color: var(--label2); }
.chart-bars .cb-area { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bars .cb i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: var(--tint); min-height: 2px; }
.chart-bars .cb b { font-size: 11px; color: var(--label); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .rev { flex-wrap: wrap; } .rev .rev-actions { width: 100%; padding-left: 42px; } .rev .rev-actions .btn { flex: 1; } .rev .rev-actions .inline-form { flex: 1; display: flex; } }

.thumb:has(.thumb-check:checked) img { opacity: .3; }
.thumb:has(.thumb-check:checked) { outline: 2px solid var(--red); outline-offset: -2px; }
.table td .btn-row { justify-content: flex-end; flex-wrap: nowrap; }
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv-list dt { color: var(--label2); }
.kv-list dd { margin: 0; }
