/* Dots, in the Apple layer used by The System: grouped grey page, solid borderless cards, glass only on navigation
   (floating tab bar on a phone, sidebar from iPad width up), large titles, iOS controls, spring motion.
   Hashtag Labs rules kept: Manrope + JetBrains Mono, yellow as a fill only and one yellow thing (the main button,
   or the app icon on wide screens), follows the system theme with no toggle. */
@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(255,255,255,.72); --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%;
  --tint: #C93400; --blue: #0040DD; --purple: #8944AB; --teal: #007D91; --green: #1F7A36;
  --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,.64); --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%;
  --tint: #FF8552; --blue: #5EA2FF; --purple: #D08BEF; --teal: #45C6DC; --green: #4CD471;
} }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 15px/1.5 "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: 2px solid var(--blue); 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 */
.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)); }
.lt { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 10px 2px 16px; }
.lt > div { min-width: 0; }
.lt .cap { font-size: 13px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .03em; }
.lt h1 { font-size: clamp(32px, 6vw, 40px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.lt .sub { color: var(--mut); margin-top: 2px; font-size: 15px; }
.ring { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px var(--rim); }
.ring circle { fill: none; stroke-width: 4; stroke: var(--fill); }
.ring #ring-on { stroke: var(--accent, var(--tint)); stroke-linecap: round; transition: stroke-dasharray .6s var(--spring); }
.ring text { font: 700 10px "Manrope", sans-serif; text-anchor: middle; fill: var(--ink); }

/* preview: pinned while you change things */
.split { display: grid; gap: 18px; }
.stage { position: sticky; top: max(8px, env(safe-area-inset-top)); z-index: 3; display: grid; gap: 10px; justify-items: center;
  background: var(--card); border-radius: 22px; box-shadow: var(--shade); padding: 16px 14px 12px; }
.device { position: relative; container-type: size; width: min(100%, calc(36vh * var(--ar, .46))); aspect-ratio: var(--ar, .46); border-radius: var(--round, 22px); overflow: hidden;
  background: #1A1A1A; box-shadow: 0 0 0 1px var(--sep), 0 10px 30px rgba(0,0,0,.18); transition: aspect-ratio .35s var(--spring); }
#shot { position: absolute; inset: 0; }
#shot svg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: 100%; }
.device.pad #shot svg { width: auto; height: 100%; }
.device.pad.wide #shot svg { width: 100%; height: auto; }
.stagebar { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; width: 100%; }
.stagebar .seg { width: min(100%, 300px); }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--fill); font-weight: 700; font-size: 13px; transition: transform .3s var(--spring), background .2s; }
.pill[aria-pressed=false] { color: var(--mut); }
.pill:active, .tbi:active, .sbi:active, .tiles button:active, .looks button:active, .primary:active, .swatches button:active, .signs button:active { transform: scale(.95); }

/* What the system draws over a wallpaper, so you can judge the fit. Not part of the picture. */
#overlay { position: absolute; inset: 0; color: #fff; text-align: center; font-family: -apple-system, "Manrope", system-ui, sans-serif; pointer-events: none; }
#overlay.on-light { color: #111; }
#overlay .date { position: absolute; left: 0; right: 0; top: 9.2cqh; font-size: 2.5cqh; font-weight: 600; line-height: 1; }
#overlay .time { position: absolute; left: 0; right: 0; top: 12cqh; font-size: 11.5cqh; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
#overlay .key { position: absolute; bottom: 6.2cqh; width: 13.6cqw; aspect-ratio: 1; border-radius: 50%; background: rgba(128,128,128,.38); }
#overlay .key.l { left: 12.4cqw; } #overlay .key.r { right: 12.4cqw; }
#overlay .bar { position: absolute; bottom: 1.1cqh; left: 32cqw; right: 32cqw; height: .55cqh; min-height: 2px; border-radius: 9px; background: currentColor; }
.device.pad #overlay .date { top: 5.6cqh; font-size: 2.1cqh; }
.device.pad #overlay .time { top: 8.4cqh; font-size: 9.5cqh; }
.device.pad.wide #overlay .date { top: 6.5cqh; font-size: 2.8cqh; }
.device.pad.wide #overlay .time { top: 10cqh; font-size: 13cqh; }
.device.pad #overlay .bar { left: 38cqw; right: 38cqw; }
/* Mac lock screen, measured from a real one: date at 9%, clock to 24%, picture and name from 82%. */
.device.mac #overlay .date { top: 8.2cqh; font-size: 2.6cqh; opacity: .75; }
.device.mac #overlay .time { top: 11.2cqh; font-size: 14.5cqh; letter-spacing: -.01em; }
#overlay .who { position: absolute; top: 82.3cqh; left: 0; right: 0; display: grid; justify-items: center; gap: 1.4cqh; }
#overlay .who i { width: 5cqh; aspect-ratio: 1; border-radius: 50%; background: rgba(128,128,128,.5); }
#overlay .who b { font-size: 1.6cqh; font-weight: 600; }

/* inset grouped lists */
.panel { display: grid; align-content: start; }
.gh { font-size: 13px; font-weight: 700; color: var(--mut); text-transform: uppercase; letter-spacing: .03em; margin: 22px 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(--blue); text-decoration: none; }
.group { background: var(--card); border-radius: 22px; box-shadow: var(--shade); padding: 0 16px; overflow: hidden; }
.group + .group { margin-top: 14px; }
.rowi { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 50px; padding: 8px 0; width: 100%; text-align: left; font-size: 16px; font-weight: 500; }
.rowi + .rowi, .group > * + .rowi, .group > div > .rowi, #map-row .rowi { border-top: 1px solid var(--sep); }
.group > :first-child, #dates > .rowi:first-child { border-top: 0; }
.group > #dates > .rowi:first-child, .group > #map-row > .rowi:first-child { border-top: 1px solid var(--sep); }
.rowi.col { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px 0; }
.rowi.col > span { font-size: 14px; font-weight: 600; color: var(--mut); }
.rowi.link { color: var(--blue); font-weight: 600; text-decoration: none; justify-content: center; }
.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 16px "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; }
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; }
.switch:checked::after { transform: translateX(20px); }

/* 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 { position: relative; z-index: 1; min-height: 32px; padding: 0 4px; border-radius: 8px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }

/* picture choices */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 0; }
.tiles.pics { grid-template-columns: repeat(4, 1fr); }
.tiles button { display: grid; justify-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--mut); transition: transform .3s var(--spring); }
.tiles .pic { display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 14px; background: var(--fill); overflow: hidden; color: var(--ink); }
.tiles.pics .pic { aspect-ratio: .62; background: #1A1A1A; }
.tiles .pic svg { display: block; width: 100%; height: 100%; }
.tiles button[aria-pressed=true] { color: var(--ink); }
.tiles button[aria-pressed=true] .pic { box-shadow: 0 0 0 2.5px var(--card), 0 0 0 4.5px var(--blue); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: transform .3s var(--spring); }
.swatches i { width: 28px; height: 28px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.1); }
.swatches button[aria-pressed=true] { box-shadow: 0 0 0 2px var(--blue); }
.swatches input[type=color] { width: 34px; height: 34px; 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); }

/* starting looks */
.looks { display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 16px; }
.looks::-webkit-scrollbar { display: none; }
.looks .look { position: relative; flex: none; width: 74px; scroll-snap-align: start; }
.looks .look > button:first-child { display: grid; gap: 6px; width: 100%; font-size: 12.5px; font-weight: 600; color: var(--mut); transition: transform .3s var(--spring); }
.looks .thumb { display: block; aspect-ratio: .46; border-radius: 14px; overflow: hidden; box-shadow: var(--shade), 0 0 0 .5px var(--sep); background: var(--card); }
.looks svg { display: block; width: 100%; height: 100%; }
.looks button[aria-pressed=true] { color: var(--ink); }
.looks button[aria-pressed=true] .thumb { box-shadow: 0 0 0 2.5px var(--page), 0 0 0 4.5px var(--blue); }
.looks .plus { display: grid; place-items: center; background: var(--card); color: var(--blue); font-size: 28px; font-weight: 400; }
.looks .x { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--thumb); color: var(--ink); font-size: 14px; line-height: 1; display: grid; place-items: center; box-shadow: 0 1px 4px var(--rim); }

/* special days */
.days { list-style: none; margin: 0; padding: 0; }
.days li { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; }
.days li + li { border-top: 1px solid var(--sep); }
.days .sq { --c: var(--mark, var(--purple)); }
.days li span.t { flex: 1; min-width: 0; display: grid; }
.days li b { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.days li small { color: var(--mut); font-size: 13px; }
.days li button { width: 32px; height: 32px; border-radius: 50%; color: var(--mut); font-size: 20px; display: grid; place-items: center; }
#marks-group:has(.days:empty) { display: none; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 20px 26px; color: var(--mut); }
.empty .ic { font-size: 40px; color: var(--purple); stroke-width: 1.6; margin-bottom: 6px; }
.empty b { color: var(--ink); font-size: 18px; font-weight: 700; }
.empty p { font-size: 14px; max-width: 34ch; }
.signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 8px; padding: 14px 0; }
.signs button { aspect-ratio: 1; border-radius: 12px; background: var(--fill); display: grid; place-items: center; color: var(--ink); transition: transform .3s var(--spring), background .2s; }
.signs svg { width: 22px; height: 22px; display: block; }
.signs button[aria-pressed=true] { background: var(--purple); color: #fff; }

/* 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; }

/* install */
.steps { margin: 0; padding: 6px 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 40px; font-size: 15px; 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(--teal); color: #fff; font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.steps b { color: var(--ink); font-weight: 700; }
.url, pre { font: 400 12px/1.55 var(--mono); color: var(--mut); padding: 14px 0; word-break: break-all; margin: 0; }
pre { white-space: pre-wrap; max-height: 220px; overflow: auto; }
.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: 800; font-size: 16px; text-decoration: none; transition: transform .3s var(--spring); }
footer { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--mut); padding: 26px 4px 0; }
footer b { color: var(--ink); font-weight: 600; }

/* 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 { width: min(100%, 520px); max-height: 92vh; overflow: auto; background: var(--page); border-radius: 22px 22px 0 0; padding: 10px 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-head h2 { font-size: 17px; font-weight: 700; }
.sheet-head > :first-child { justify-self: start; } .sheet-head > :last-child { justify-self: end; }
.textbtn { color: var(--blue); font-size: 16px; font-weight: 500; padding: 8px 2px; }
.textbtn.strong { font-weight: 700; }
.saved-img { display: grid; place-items: center; padding: 6px 0 4px; }
.saved-img img { display: block; max-width: 100%; max-height: 58vh; border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.2); -webkit-touch-callout: default; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { 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(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) / 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: 10.5px; font-weight: 700; transition: color .25s, transform .3s var(--spring); }
.tbi .ic { font-size: 21px; }
.tbi[aria-current=page] { color: var(--tint); }
.side { display: none; }

@media (min-width: 900px) {
  body { display: grid; grid-template-columns: 260px minmax(0, 1fr); align-items: start; }
  .tabbar { display: none; }
  .side { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; padding: 16px 10px; border-radius: 28px;
    background: var(--glass); -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%); border: 1px solid var(--edge); box-shadow: var(--hi), var(--float); }
  .sbhead { display: flex; gap: 11px; align-items: center; padding: 4px 8px 14px; }
  .sbhead b { display: block; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
  .sbhead small { display: block; font-size: 12px; color: var(--mut); }
  .appicon { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(180deg, #FFE14D, #FFD600); display: grid; place-items: center; box-shadow: 0 1px 3px var(--rim); }
  .appicon svg { width: 30px; height: 30px; }
  .sbi { display: flex; align-items: center; gap: 11px; padding: 6px 8px; border-radius: 12px; text-decoration: none; font-weight: 600; font-size: 15px; transition: background .18s, transform .25s var(--spring); }
  .sbi:hover { background: var(--fill); }
  .sbi[aria-current=page] { background: color-mix(in srgb, var(--c) 15%, var(--card)); font-weight: 700; }
  .wrap { width: 100%; padding: 22px 32px 40px; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); align-items: start; gap: 24px; }
  .stage { top: 22px; padding: 26px 20px 16px; }
  .device { width: min(100%, calc(66vh * var(--ar, .46))); }
  .looks { margin: 0 -10px; padding: 6px 10px 8px; }
  .primary { background: var(--blue); color: #fff; } /* the yellow thing on a wide screen is the app icon */
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
