/* @qv/design apple.css: the Hashtag Labs v2 look (the Apple layer from The System and Dots).
   Grouped grey page, borderless 22px cards, inset grouped lists, glass only on navigation, large titles, iOS
   switches, steppers, segmented controls and sheets, spring motion. One tint per app: an app sets --tint (light and
   dark) in its own CSS, after this file. Hashtag Labs rules kept: Manrope + JetBrains Mono, yellow as a fill only and
   one yellow thing per screen (.primary), the system theme with no switch. Rules: packages/design/DESIGN.md. */
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("/fonts/manrope-latin-ext-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --page: #F2F2F7; --card: #FFFFFF; --ink: #1C1C1E; --mut: #6B6B70; --fill: rgba(118,118,128,.12); --sep: rgba(60,60,67,.14);
  --glass: rgba(249,249,249,.8); --edge: rgba(255,255,255,.8); --rim: rgba(0,0,0,.10); --shade: 0 1px 3px rgba(0,0,0,.05);
  --float: 0 16px 40px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06); --hi: inset 0 1px 0 rgba(255,255,255,.9); --thumb: #FFFFFF; --hs: 0%;
  --red: #D70015; --orange: #C93400; --amber: #A35200; --green: #1F7A36; --teal: #007D91; --blue: #0040DD; --indigo: #3634A3; --purple: #8944AB; --pink: #C2185B;
  --tint: var(--blue); --switch: #34C759; --destructive: #FF3B30;
  --brand: #FFD600; --on-brand: #0B0B0A;
  --spring: cubic-bezier(.3,1.5,.5,1); --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) { :root {
  color-scheme: dark;
  --page: #000000; --card: #1C1C1E; --ink: #F5F5F7; --mut: #9A9AA0; --fill: rgba(118,118,128,.24); --sep: rgba(84,84,88,.55);
  --glass: rgba(30,30,32,.78); --edge: rgba(255,255,255,.13); --rim: rgba(0,0,0,.5); --shade: none;
  --float: 0 16px 44px rgba(0,0,0,.6); --hi: inset 0 1px 0 rgba(255,255,255,.1); --thumb: #636366; --hs: 25%;
  --red: #FF6B66; --orange: #FF8552; --amber: #F2A541; --green: #4CD471; --teal: #45C6DC; --blue: #5EA2FF; --indigo: #8E8CFF; --purple: #D08BEF; --pink: #FF6F9F;
  --switch: #30D158; --destructive: #FF453A;
} }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 17px/1.4 "Manrope", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--brand); color: var(--on-brand); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 60%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* page and top bar */
.wrap { max-width: 1120px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 2px 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 32px; height: 32px; border-radius: 8px; box-shadow: 0 1px 3px var(--rim); }
.brand b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.brand { min-width: 0; }
.bt { display: grid; min-width: 0; line-height: 1.2; }
.status { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--mut); }
.rowi.link.danger { color: #FF3B30; }
@media (prefers-color-scheme: dark) { .rowi.link.danger { color: #FF453A; } }
.brand .status b { color: var(--ink); font-weight: 600; font-size: inherit; letter-spacing: 0; }
.ptitle { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; margin: 6px 4px 12px; }
/* type scale (iOS text styles in px; DESIGN.md section 3) */
.t1 { font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.02em; }
.t2 { font-size: 22px; line-height: 28px; font-weight: 700; letter-spacing: -.01em; }
.t3 { font-size: 20px; line-height: 25px; font-weight: 600; }
.th { font-size: 17px; line-height: 22px; font-weight: 600; }
.tc { font-size: 16px; line-height: 21px; font-weight: 400; }
.ts { font-size: 15px; line-height: 20px; font-weight: 500; }
.tcap { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--mut); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* inset grouped lists */
.gh { font-size: 13px; font-weight: 500; color: var(--mut); text-transform: uppercase; letter-spacing: .02em; margin: 26px 16px 7px; }
.panel > .gh:first-child, .panel > .group:first-child { margin-top: 0; }
.gf { font-size: 13px; color: var(--mut); margin: 7px 16px 0; line-height: 1.45; }
.gf:empty { display: none; }
.gf a { color: var(--tint); text-decoration: none; }
.group { background: var(--card); border-radius: 22px; box-shadow: var(--shade); padding: 0 0 0 16px; overflow: hidden; }
.group + .group { margin-top: 14px; }
.rowi { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 48px; padding: 8px 16px 8px 0; width: 100%; text-align: left; font-size: 17px; font-weight: 500; }
.rowi + .rowi, .group > * + .rowi, .group > div > .rowi { border-top: 1px solid var(--sep); }
.group > :first-child { border-top: 0; }
.rowi.col { flex-direction: column; align-items: stretch; gap: 9px; padding: 12px 16px 12px 0; }
.rowi.col > span { font-size: 15px; font-weight: 500; }
.rowi.link { color: var(--tint); font-weight: 500; text-decoration: none; justify-content: flex-start; }
.rowi.link.center { justify-content: center; padding-right: 0; margin-top: 6px; }
.rowi .end { display: inline-flex; align-items: center; gap: 10px; }
.val { min-width: 0; max-width: 62%; border: 0; background: none; color: var(--mut); font: 500 17px "Manrope", system-ui, sans-serif; text-align: right; padding: 4px 0; }
.val:focus { color: var(--ink); outline: none; }
select.val { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 18px; text-align-last: right;
  background: linear-gradient(45deg, transparent 50%, var(--mut) 50%) right 6px center / 5px 5px no-repeat, linear-gradient(-45deg, transparent 50%, var(--mut) 50%) right 1px center / 5px 5px no-repeat; }
input[type=date].val { -webkit-appearance: none; background: var(--fill); color: var(--ink); border-radius: 8px; padding: 6px 11px; }
input[type=date].val::-webkit-calendar-picker-indicator { display: none; }
input[type=color] { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; } input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* iOS switch */
.switch { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 999px; background: var(--fill); cursor: pointer; transition: background .25s; }
.switch::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 .35s var(--spring); }
.switch:checked { background: #34C759; }
@media (prefers-color-scheme: dark) { .switch:checked { background: #30D158; } }
.switch:checked::after { transform: translateX(20px); }

/* stepper, as in iOS: two halves of one grey pill */
.stepval { font-weight: 500; color: var(--mut); min-width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.stepper { display: inline-grid; grid-template-columns: 1fr 1fr; width: 94px; height: 32px; border-radius: 9px; background: var(--fill); overflow: hidden; }
.stepper button { font-size: 22px; font-weight: 400; line-height: 1; position: relative; }
.stepper button + button::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: var(--sep); }
.stepper button:disabled { color: var(--mut); opacity: .45; }

/* segmented control with a sliding thumb */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; border-radius: 10px; background: var(--fill); }
.seg::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n, 2)); border-radius: 8px; background: var(--thumb);
  box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); transform: translateX(calc(100% * var(--i, 0))); transition: transform .42s cubic-bezier(.3,1.25,.5,1); }
.seg button, .seg a { position: relative; display: grid; place-items: center; text-decoration: none; color: inherit; z-index: 1; min-height: 32px; padding: 0 4px; border-radius: 8px; font-size: 13px; font-weight: 500; white-space: nowrap; transition: font-weight .2s; }
.seg [aria-pressed=true], .seg [aria-current=page] { font-weight: 650; }


.swatches { display: flex; gap: 2px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: transform .3s var(--spring); }
.swatches i { width: 30px; height: 30px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.1); }
.swatches button[aria-pressed=true] i { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--tint); }
.swatches input[type=color] { width: 34px; height: 34px; margin: 5px; padding: 3px; border-radius: 50%; background: conic-gradient(#FF3B30, #FF9500, #FFCC00, #34C759, #5AC8FA, #007AFF, #AF52DE, #FF3B30); }
.swatches input[type=color]::-webkit-color-swatch { box-shadow: 0 0 0 2px var(--card); }

.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 20px 26px; color: var(--mut); }
.empty .ic { font-size: 44px; color: var(--tint); stroke-width: 1.6; margin-bottom: 6px; }
.empty b { color: var(--ink); font-size: 20px; font-weight: 700; }
.empty p { font-size: 15px; max-width: 34ch; }

/* Settings-style squircles */
.sq { --k: color-mix(in srgb, var(--c), #000 var(--hs)); width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 17px; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--k) 78%, #fff), var(--k)); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.12); }
.sq .ic { stroke-width: 2.2; }
.sq svg:not(.ic) { width: 18px; height: 18px; }

/* numbered steps */
.steps { margin: 0; padding: 6px 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 11px 16px 11px 40px; font-size: 16px; line-height: 1.45; color: var(--mut); }
.steps li + li { border-top: 1px solid var(--sep); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 9px; width: 26px; height: 26px; border-radius: 50%; background: var(--tint); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.steps b { color: var(--ink); font-weight: 700; }
.primary { display: grid; place-items: center; width: 100%; min-height: 50px; margin-top: 18px; border-radius: 14px; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 17px; text-decoration: none; transition: transform .3s var(--spring); }

/* sheets */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.4); display: grid; align-items: end; justify-items: center; animation: fade .25s ease; }
.sheet-box { position: relative; width: min(100%, 520px); max-height: 92vh; overflow: auto; background: var(--page); border-radius: 26px 26px 0 0; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); animation: rise .45s cubic-bezier(.3,1.15,.5,1); }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 48px; margin-bottom: 6px; }
.sheet-box::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--sep); }
.sheet-head h2 { font-size: 17px; font-weight: 600; }
.sheet-head > :first-child { justify-self: start; } .sheet-head > :last-child { justify-self: end; }
.textbtn { color: var(--tint); font-size: 17px; font-weight: 400; padding: 10px 4px; }
.textbtn.strong { font-weight: 650; }
.textbtn:focus:not(:focus-visible) { outline: none; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* glass navigation */
.tabbar { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 12px); transform: translateX(-50%); z-index: 20; width: min(400px, calc(100% - 28px)); }
.tbin { position: relative; display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); padding: 5px; border-radius: 999px; background: var(--glass);
  -webkit-backdrop-filter: blur(30px) saturate(190%); backdrop-filter: blur(30px) saturate(190%); border: 1px solid var(--edge); box-shadow: var(--hi), var(--float); }
.tbthumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / var(--n, 4)); border-radius: 999px; background: var(--fill); box-shadow: var(--hi);
  transform: translateX(calc(100% * var(--i, 0))); transition: transform .5s cubic-bezier(.3,1.35,.45,1); }
.tbi { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 10px; font-weight: 600; transition: color .25s, transform .3s var(--spring); }
.tbi .ic { font-size: 22px; stroke-width: 1.8; }
.tbi[aria-current=page] { color: var(--tint); }

@media (min-width: 900px) {
  .tabbar { display: none; }
  .wrap { padding: 22px 32px 48px; max-width: 1280px; }
  .top { margin-bottom: 18px; }
  .sheet { align-items: center; } .sheet-box { border-radius: 26px; max-height: 86vh; animation: pop .35s cubic-bezier(.3,1.2,.5,1); } .sheet-box::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
