/*
Theme Name: dots.name
Author: Petri
Version: 2.0
Description: dots.name app shell and public site renderer.
*/

:root {
  --bg: #f2f2f7;
  --bg2: #ffffff;
  --bg3: #f2f2f7;
  --label: #000000;
  --label2: rgba(60, 60, 67, .6);
  --label3: rgba(60, 60, 67, .3);
  --sep: rgba(60, 60, 67, .29);
  --fill: rgba(120, 120, 128, .12);
  --fill2: rgba(120, 120, 128, .2);
  --press: #d1d1d6;
  --tint: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --bar: rgba(249, 249, 249, .82);
  --sheet-dim: rgba(0, 0, 0, .4);
  --sheet-bg: #f2f2f7;
  --sheet-cell: #ffffff;
  --shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --top: env(safe-area-inset-top, 0px);
  --bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

@media all { /* always dark */
  :root {
    --bg: #000000;
    --bg2: #1c1c1e;
    --bg3: #2c2c2e;
    --label: #ffffff;
    --label2: rgba(235, 235, 245, .6);
    --label3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .6);
    --fill: rgba(118, 118, 128, .24);
    --fill2: rgba(118, 118, 128, .32);
    --press: #3a3a3c;
    --tint: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --bar: rgba(22, 22, 24, .78);
    --sheet-dim: rgba(0, 0, 0, .6);
    --sheet-bg: #1c1c1e;
    --sheet-cell: #2c2c2e;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; overscroll-behavior: none; }
body {
  font: 17px/1.29 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  letter-spacing: -.41px;
  color: var(--label);
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; letter-spacing: inherit; }
input, textarea { font: inherit; letter-spacing: inherit; color: var(--label); background: none; border: 0; outline: 0; padding: 0; margin: 0; width: 100%; min-width: 0; }
input::placeholder, textarea::placeholder { color: var(--label3); }
textarea { resize: none; display: block; }
svg { display: block; }
img { display: block; }

/* ---------- App frame (scales back when a sheet is presented) ---------- */

#app {
  position: fixed;
  inset: 0;
  background: var(--bg);
  overflow: hidden;
  transform-origin: 50% 0;
  transition: transform .5s var(--ease), border-radius .5s var(--ease), filter .5s var(--ease);
}
body.presenting #app {
  transform: translateY(calc(var(--top) + 10px)) scale(.92);
  border-radius: 12px;
  filter: brightness(.9);
}

/* ---------- Navigation stack ---------- */

.screen {
  position: absolute;
  inset: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: transform .5s var(--ease);
  will-change: transform;
}
.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .5s var(--ease);
}
.screen.enter, .screen.leave { transform: translateX(100%); box-shadow: -8px 0 24px rgba(0,0,0,.08); }
.screen.behind { transform: translateX(-30%); }
.screen.behind::after { opacity: .12; }
.screen.fade { transition: opacity .35s ease; }
.screen.fade.enter { transform: none; opacity: 0; box-shadow: none; }

.scroller {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(var(--top) + 44px);
  padding-bottom: calc(var(--bottom) + 40px);
}

.navbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  height: calc(var(--top) + 44px);
  padding-top: var(--top);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  transition: background .2s, box-shadow .2s;
}
.navbar.solid, .scrolled .navbar {
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 .5px 0 var(--sep);
}
.nb-title {
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60vw;
  transition: opacity .2s;
}
.has-large .nb-title { opacity: 0; }
.has-large.scrolled .nb-title { opacity: 1; }
.nb-left, .nb-right { display: flex; align-items: center; min-width: 0; }
.nb-left { padding-left: 8px; }
.nb-right { justify-content: flex-end; padding-right: 16px; gap: 18px; }
.nb-btn {
  color: var(--tint);
  height: 44px;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  min-width: 0;
  transition: opacity .15s;
}
.nb-btn:active { opacity: .35; }
.nb-btn[disabled] { color: var(--label3); pointer-events: none; }
.nb-btn.bold { font-weight: 600; }
.nb-btn span { overflow: hidden; text-overflow: ellipsis; }
.nb-btn .i-back { width: 13px; height: 21px; margin-right: 3px; flex: none; }
.nb-icon svg { width: 25px; height: 25px; }
.nb-left .nb-btn.plain { padding-left: 8px; }

.large-title {
  font-size: 34px;
  line-height: 41px;
  font-weight: 700;
  letter-spacing: .37px;
  margin: 0;
  padding: 3px 16px 12px;
  overflow-wrap: anywhere;
}

/* ---------- Grouped inset lists ---------- */

.group { margin: 0 16px 35px; }
.group-header {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -.08px;
  color: var(--label2);
  text-transform: uppercase;
  padding: 0 16px 7px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.group-header button { color: var(--tint); text-transform: none; font-size: 15px; }
.group-footer {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: -.08px;
  color: var(--label2);
  padding: 7px 16px 0;
}
.group-footer.bad { color: var(--red); }
.group-footer.good { color: var(--green); }
.cells { background: var(--bg2); border-radius: 12px; overflow: hidden; }

.cell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 16px;
  width: 100%;
  text-align: left;
  background: var(--bg2);
  transition: background .25s;
}
.cell + .cell::before, .cell + .sortable-fallback::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  left: var(--inset, 16px);
  border-top: .5px solid var(--sep);
}
.cells.with-icons .cell { --inset: 57px; }
.cells.with-thumbs .cell { --inset: 76px; }
button.cell:active, .cell.tap:active { background: var(--press); transition: none; }
.cell-body { flex: 1; min-width: 0; padding: 11px 0; }
.cell-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; font-size: 15px; color: var(--label2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.cell-detail { color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.chev { width: 8px; height: 14px; color: var(--label3); flex: none; margin-left: 2px; }
.cell.action { color: var(--tint); }
.cell.action svg { width: 22px; height: 22px; }
.cell.destructive { color: var(--red); justify-content: center; }
.cell.center { justify-content: center; }
.cell[disabled] { color: var(--label3); pointer-events: none; }

.tile {
  width: 29px; height: 29px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.tile svg { width: 18px; height: 18px; }

.thumb {
  width: 48px; height: 48px;
  border-radius: 11px;
  flex: none;
  object-fit: cover;
  background: var(--fill);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  overflow: hidden;
  margin: 8px 0;
}
.cells.with-thumbs .cell { min-height: 64px; }

.cell input, .cell textarea { padding: 11px 0; line-height: 22px; }
.cell .prefix { color: var(--label2); white-space: nowrap; }
.cell .stack { flex: 1; min-width: 0; }
.cell .stack input + input { border-top: .5px solid var(--sep); }
.cell .grip { color: var(--label3); width: 22px; height: 44px; display: grid; place-items: center; flex: none; touch-action: none; cursor: grab; }
.cell .grip svg { width: 18px; height: 18px; }
.cell .remove { color: var(--red); flex: none; width: 24px; height: 44px; display: grid; place-items: center; }
.cell .remove svg { width: 22px; height: 22px; }
.sortable-ghost { opacity: .35; }
.sortable-drag, .sortable-chosen.sortable-fallback { box-shadow: 0 12px 30px rgba(0,0,0,.18); border-radius: 12px; }

/* Switch */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--fill2); transition: background .25s; }
.switch i::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 3px 1px rgba(0,0,0,.06); transition: transform .3s var(--ease); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

/* Segmented control */
.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; position: relative; }
.segmented button { flex: 1; height: 28px; border-radius: 7px; font-size: 13px; font-weight: 500; letter-spacing: -.08px; position: relative; z-index: 1; transition: background .2s; }
.segmented button.on { background: var(--bg2); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 3px 1px rgba(0,0,0,.04); font-weight: 600; }
@media all { /* always dark */ .segmented button.on { background: #636366; } }

/* Buttons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 50px;
  border-radius: 14px;
  background: var(--tint); color: #fff;
  font-weight: 600;
  transition: opacity .15s, transform .15s;
}
.btn:active { opacity: .7; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.btn.secondary { background: var(--fill); color: var(--tint); }
.btn.small { width: auto; height: 30px; padding: 0 14px; border-radius: 99px; font-size: 15px; }
.btn svg { width: 18px; height: 18px; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sheets ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--sheet-dim);
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.overlay.show { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 101;
  max-height: calc(100% - var(--top) - 10px);
  background: var(--sheet-bg);
  border-radius: 12px 12px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .5s var(--ease);
  box-shadow: 0 -2px 20px rgba(0,0,0,.1);
  margin: 0 auto;
  max-width: 700px;
}
.sheet .cells, .sheet .cell, .sheet .type-grid button { background: var(--sheet-cell); }
.sheet .cell .tile + .cell-body { color: var(--label); }
.sheet.full { height: calc(100% - var(--top) - 10px); }
.sheet.show { transform: none; }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--fill2); margin: 5px auto 0; flex: none; }
.sheet-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 52px; padding: 0 16px; flex: none; }
.sheet-bar .nb-title { font-weight: 600; }
.sheet-bar .nb-btn:last-child { justify-self: end; }
.sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 0 calc(var(--bottom) + 24px); flex: 1; }
.sheet-body .pad { padding: 0 16px; }

/* Action sheet */
.actions {
  position: fixed;
  left: 8px; right: 8px;
  bottom: calc(var(--bottom) + 8px);
  z-index: 102;
  max-width: 500px;
  margin: 0 auto;
  transform: translateY(calc(100% + 20px));
  transition: transform .45s var(--ease);
}
.actions.show { transform: none; }
.actions .box { background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 14px; overflow: hidden; margin-bottom: 8px; }
.actions .box:last-child { background: var(--bg2); margin: 0; }
.actions .head { padding: 14px 16px; text-align: center; font-size: 13px; color: var(--label2); line-height: 18px; }
.actions .head b { display: block; font-weight: 600; }
.actions button { display: block; width: 100%; height: 57px; font-size: 20px; letter-spacing: .38px; color: var(--tint); border-top: .5px solid var(--sep); }
.actions .box > button:first-child { border-top: 0; }
.actions button.destructive { color: var(--red); }
.actions button.cancel { font-weight: 600; }
.actions button:active { background: var(--fill); }

/* HUD */
.hud {
  position: fixed;
  top: calc(var(--top) + 8px);
  left: 50%;
  z-index: 200;
  transform: translate(-50%, -150%);
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 99px;
  background: var(--bg2);
  box-shadow: 0 8px 30px rgba(0,0,0,.14), 0 0 0 .5px var(--sep);
  font-size: 15px;
  font-weight: 600;
  transition: transform .5s var(--ease);
  pointer-events: none;
}
.hud.show { transform: translate(-50%, 0); }
.hud svg { width: 20px; height: 20px; flex: none; }
.hud.ok svg { color: var(--green); }
.hud.error svg { color: var(--red); }

/* ---------- Welcome ---------- */

.welcome { background: #000; color: #fff; justify-content: flex-end; padding: 0 24px calc(var(--bottom) + 24px); }
.welcome .mark { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.welcome .dots { display: flex; gap: 10px; margin-bottom: 28px; }
.welcome .dots i { width: 18px; height: 18px; border-radius: 50%; background: #fff; animation: dot 2.4s var(--ease) infinite; }
.welcome .dots i:nth-child(2) { animation-delay: .15s; background: #0a84ff; }
.welcome .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-12px); } }
.welcome h1 { font-size: 52px; line-height: 1; letter-spacing: -1.6px; margin: 0; font-weight: 800; }
.welcome p { font-size: 22px; line-height: 1.25; letter-spacing: .35px; color: rgba(255,255,255,.6); margin: 14px 0 0; max-width: 14em; }
.welcome .btn { margin-top: 12px; }
.welcome .btn.light { background: #fff; color: #000; }
.welcome .btn.dark { background: rgba(255,255,255,.14); color: #fff; }

/* ---------- Site screen ---------- */

.hero-card { display: flex; gap: 16px; align-items: stretch; margin: 0 16px 35px; }
.phone {
  width: 128px;
  aspect-ratio: 9 / 19.5;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg2);
  box-shadow: 0 0 0 .5px var(--sep), 0 10px 30px rgba(0,0,0,.12);
  position: relative;
  flex: none;
}
.phone iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.phone button.hit { position: absolute; inset: 0; z-index: 1; }
.hero-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding-bottom: 4px; }
.hero-meta .addr { font-size: 15px; color: var(--label2); overflow-wrap: anywhere; }
.hero-meta .row { display: flex; gap: 10px; align-items: center; }
.icon-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--tint); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:active, .btn.small:active { opacity: .5; }

.type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px; }
.type-grid button { background: var(--bg2); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; font-weight: 600; text-align: left; transition: transform .2s var(--ease); }
.type-grid button:active { transform: scale(.96); }
.type-grid button[disabled] { opacity: .35; pointer-events: none; }
.type-grid .tile { width: 36px; height: 36px; border-radius: 9px; }
.type-grid .tile svg { width: 21px; height: 21px; }

/* Media field */
.media-cell { gap: 14px; }
.media-thumb { width: 60px; height: 60px; border-radius: 10px; background: var(--fill); flex: none; overflow: hidden; margin: 10px 0; position: relative; display: grid; place-items: center; color: var(--label3); }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; }
.media-thumb.round { border-radius: 50%; }
.media-thumb svg { width: 24px; height: 24px; }
.media-thumb .pct { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; font-weight: 600; }
.media-cell .actions-inline { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.link-btn { color: var(--tint); padding: 4px 0; }
.link-btn.red { color: var(--red); }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
.gallery .g { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--fill); }
.gallery .g img, .gallery .g video { width: 100%; height: 100%; object-fit: cover; }
.gallery .g .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; display: grid; place-items: center; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.gallery .g .x svg { width: 12px; height: 12px; }
.gallery .add { aspect-ratio: 1; border-radius: 8px; background: var(--fill); color: var(--tint); display: grid; place-items: center; }
.gallery .add svg { width: 26px; height: 26px; }
.gallery .g .pct { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font-size: 13px; font-weight: 600; }

/* ---------- Design screen ---------- */

.design-preview { display: flex; justify-content: center; padding: 8px 0 28px; }
.design-preview .phone { width: min(46vw, 210px); border-radius: 30px; }
.swatches { display: flex; gap: 14px; padding: 14px 16px; overflow-x: auto; scrollbar-width: none; }
.swatches::-webkit-scrollbar { display: none; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--label2); flex: none; }
.swatch i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 700; font-size: 16px; box-shadow: inset 0 0 0 .5px rgba(128,128,128,.4); position: relative; }
.swatch.on i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2.5px solid var(--tint); }
.swatch.on { color: var(--label); font-weight: 600; }
.fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.font-opt { background: var(--fill); border-radius: 12px; padding: 14px; text-align: left; position: relative; }
.font-opt b { display: block; font-size: 30px; line-height: 1.1; margin-bottom: 6px; font-weight: 700; }
.font-opt span { font-size: 13px; color: var(--label2); }
.font-opt.on { box-shadow: inset 0 0 0 2.5px var(--tint); }
.seg-pad { padding: 12px; }

/* ---------- Stats ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 16px 35px; }
.stat { background: var(--bg2); border-radius: 12px; padding: 14px; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--label2); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding: 16px; }
.bars i { flex: 1; background: var(--tint); border-radius: 3px 3px 1px 1px; min-height: 2px; opacity: .9; }
.bars i.zero { background: var(--fill2); }
.bars-axis { display: flex; justify-content: space-between; padding: 0 16px 12px; font-size: 12px; color: var(--label2); }

/* ---------- Posts ---------- */

.post-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; margin: 10px 0; }
.cell-body .cell-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Misc ---------- */

.empty { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 12vh 32px 0; text-align: center; }
.empty .glyph { width: 64px; height: 64px; color: var(--label3); }
.empty .btn { max-width: 280px; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--label2); background: var(--bg); }
.pad-x { padding: 0 16px; }
.mt { margin-top: 12px; }
[hidden] { display: none !important; }

@media (min-width: 700px) {
  .scroller > * { max-width: 680px; margin-left: auto; margin-right: auto; }
  .scroller > .group, .scroller > .hero-card, .scroller > .stat-grid { margin-left: max(16px, calc(50% - 340px)); margin-right: max(16px, calc(50% - 340px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}

.screen:not(.has-large) .scroller { padding-top: calc(var(--top) + 44px + 20px); }
.screen:not(.has-large) .scroller > .design-preview:first-child { padding-top: 0; }

/* ---------- Premium layer (iOS 26 / Liquid Glass) ---------- */

:root {
  --glass: rgba(255, 255, 255, .72);
  --glass-edge: inset 0 0 0 .5px rgba(255, 255, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .9);
  --glass-shadow: 0 6px 20px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .06);
  --r-group: 22px;
  --r-sheet: 34px;
}
@media all { /* always dark */
  :root {
    --glass: rgba(58, 58, 60, .55);
    --glass-edge: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .1);
    --glass-shadow: 0 6px 20px rgba(0, 0, 0, .4);
  }
}

/* Header: no colour of its own – content fades out under floating glass controls */
.navbar { height: calc(var(--top) + 56px); padding: var(--top) 0 0; }
.navbar::before {
  content: "";
  position: absolute;
  inset: 0 0 -24px;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(var(--bg) 0%, var(--bg) calc(var(--top) + 30%), transparent 100%);
  transition: opacity .25s;
}
.navbar.solid, .scrolled .navbar { background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.navbar.solid::before, .scrolled .navbar::before { opacity: 1; }
.nb-left { padding-left: 16px; }
.nb-right { padding-right: 16px; gap: 10px; }
.nb-title { font-size: 17px; font-weight: 600; letter-spacing: -.43px; }
.scroller { padding-top: calc(var(--top) + 56px); }
.screen:not(.has-large) .scroller { padding-top: calc(var(--top) + 56px + 16px); }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  color: var(--label);
}
.nb-btn.glass { height: 44px; transition: transform .25s var(--ease), opacity .15s, background .2s; }
.nb-btn.glass:active { transform: scale(.92); opacity: 1; }
.nb-btn.round { width: 44px; border-radius: 50%; justify-content: center; padding: 0; }
.nb-btn.round svg { width: 20px; height: 20px; }
.nb-btn.round .i-back { width: 11px; height: 18px; margin: 0 2px 0 0; }
.nb-btn.capsule { padding: 0 18px; border-radius: 999px; font-size: 17px; font-weight: 500; }
.nb-btn.primary { background: var(--tint); color: #fff; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 6px 16px color-mix(in srgb, var(--tint) 35%, transparent); }
.nb-btn[disabled].primary, .nb-btn[disabled].capsule { background: var(--glass); color: var(--label3); box-shadow: var(--glass-edge); }
.nb-btn.avatar { font-size: 16px; font-weight: 600; }
.nb-btn.round svg[viewBox="0 0 24 24"] { stroke-width: 2.4; }

/* Titles */
.large-title { font-size: 34px; line-height: 41px; letter-spacing: -.02em; font-weight: 700; padding: 6px 20px 14px; }

/* Lists */
.group { margin: 0 16px 32px; }
.group-header { text-transform: none; font-size: 15px; font-weight: 600; letter-spacing: -.24px; color: var(--label); padding: 0 6px 10px; }
.group-footer { padding: 8px 6px 0; }
.cells { border-radius: var(--r-group); }
.cell { min-height: 52px; padding: 0 18px; }
.cells.with-icons .cell { --inset: 63px; }
.cells.with-thumbs .cell { --inset: 84px; min-height: 72px; }
.cell + .cell::before { left: var(--inset, 18px); }
.cell-body { padding: 13px 0; }
.cell-sub { font-size: 14px; margin-top: 2px; }
.chev { color: var(--label3); }

.tile {
  width: 32px; height: 32px;
  border-radius: 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.08);
  background-image: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 60%) !important;
}
.tile svg { width: 19px; height: 19px; }
.thumb { width: 52px; height: 52px; border-radius: 14px; box-shadow: inset 0 0 0 .5px rgba(128,128,128,.25); }

/* Buttons */
.btn { height: 54px; border-radius: 999px; font-size: 17px; box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 8px 22px color-mix(in srgb, var(--tint) 28%, transparent); transition: transform .25s var(--ease), filter .2s, opacity .2s; }
.btn:active { transform: scale(.97); opacity: 1; filter: brightness(.95); }
.btn.secondary { box-shadow: none; }
.btn.small { height: 34px; padding: 0 18px; box-shadow: inset 0 1px 0 rgba(255,255,255,.22); }
.icon-btn { width: 34px; height: 34px; }
.segmented { border-radius: 999px; padding: 3px; }
.segmented button { border-radius: 999px; height: 30px; }

/* Sheets float with a margin and deep corners */
.sheet {
  left: 8px; right: 8px; bottom: calc(8px + var(--bottom) * .5);
  border-radius: var(--r-sheet);
  box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 0 0 .5px var(--sep);
  overflow: hidden;
}
.sheet .grabber { margin-top: 7px; }
.sheet-bar { height: 60px; padding: 0 12px; }
.sheet-body { padding-top: 4px; }
.actions .box { border-radius: 28px; }
.actions button { height: 58px; font-size: 18px; letter-spacing: -.3px; }
.hud { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: var(--glass-edge), 0 10px 30px rgba(0,0,0,.16); }

/* Site header block */
.hero-card { gap: 18px; margin: 4px 20px 32px; }
.phone {
  border-radius: 24px;
  background: #000;
  padding: 3px;
  box-shadow: 0 0 0 .5px rgba(128,128,128,.35), 0 18px 40px rgba(0,0,0,.18);
}
.phone iframe { top: 3px; left: 3px; border-radius: 21px; }
.hero-meta { gap: 12px; }
.hero-meta .addr { font-size: 15px; font-weight: 500; color: var(--label2); }

/* Welcome (mobile) */
.welcome .btn.light { box-shadow: 0 8px 24px rgba(255,255,255,.12); }
.welcome .btn.dark { background: rgba(255,255,255,.12); box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }

/* Pointer devices */
@media (hover: hover) {
  button.cell:hover { background: color-mix(in srgb, var(--bg2) 88%, var(--label) 4%); }
  .nb-btn.glass:hover { filter: brightness(1.06); }
}

/* Desktop studio: editor left, live page right */
#stage { display: none; }
@media (min-width: 900px) {
  body.staged:not(.guest) #app { left: max(24px, calc(50% - 640px)); right: auto; width: 620px; box-shadow: none; }
  body.staged #stage {
    display: flex;
    position: fixed;
    top: 0; bottom: 0;
    right: max(24px, calc(50% - 640px));
    left: calc(max(24px, calc(50% - 640px)) + 620px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: var(--bg);
  }
  #stage .phone { width: min(360px, calc((100vh - 140px) * 9 / 19.5)); border-radius: 44px; padding: 5px; box-shadow: 0 0 0 .5px rgba(128,128,128,.35), 0 40px 90px rgba(0,0,0,.28); }
  #stage .phone iframe { top: 5px; left: 5px; border-radius: 39px; pointer-events: auto; }
  .stage-addr { display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; color: var(--label2); font-size: 15px; font-weight: 500; transition: background .2s, color .2s; }
  .stage-addr svg { width: 15px; height: 15px; }
  .stage-addr:hover { background: var(--fill); color: var(--label); }
  body.staged .phone-wrap, body.staged .design-preview { display: none; }
  body.staged .hero-meta { justify-content: flex-start; padding-bottom: 0; }
  body.staged .hero-card { margin-top: -4px; }
}

/* Admin: Mine / All */
.view-switch { margin: 0 20px 22px; }
.view-switch .segmented { max-width: 260px; }

/* ---------- Desktop ---------- */

.auth-form .group { margin-left: 0; margin-right: 0; }
.auth-form .pad { padding: 0; }

@media (min-width: 900px) {
  /* Welcome: brand + form left, live examples right */
  .welcome.desk {
    display: grid;
    grid-template-columns: minmax(360px, 420px) 1fr;
    align-items: center;
    gap: clamp(40px, 6vw, 110px);
    padding: 48px max(clamp(40px, 7vw, 120px), calc((100% - 1240px) / 2));
    overflow: hidden;
    background: radial-gradient(120% 90% at 85% 50%, #16161a 0%, #000 60%);
  }
  .welcome.desk .mark { flex: none; display: block; }
  .welcome.desk .dots { margin-bottom: 36px; }
  .welcome.desk h1 { font-size: clamp(56px, 5.6vw, 84px); letter-spacing: -.04em; }
  .welcome.desk p { font-size: 22px; margin-top: 16px; max-width: none; }

  .auth-card {
    margin-top: 44px;
    padding: 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, .06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(30px);
    backdrop-filter: blur(30px);
    color: #fff;
    --label: #fff;
    --label2: rgba(235, 235, 245, .6);
    --label3: rgba(235, 235, 245, .3);
    --sep: rgba(84, 84, 88, .6);
    --fill: rgba(118, 118, 128, .24);
    --tint: #0a84ff;
    --red: #ff453a;
  }
  .auth-card .segmented { margin-bottom: 18px; background: rgba(118, 118, 128, .24); }
  .auth-card .segmented button { height: 32px; font-size: 14px; }
  .auth-card .segmented button.on { background: #636366; box-shadow: none; }
  .auth-card .cells { background: rgba(255, 255, 255, .07); }
  .auth-card .cell { background: transparent; }
  .auth-card .group { margin-bottom: 18px; }
  .auth-card .btn { height: 48px; }
  .auth-card .btn:hover { filter: brightness(1.1); }
  .auth-card .link-btn { font-size: 15px; }

  .showcase { position: relative; height: min(78vh, 720px); min-width: 0; }
  .showcase .phone.ex {
    position: absolute;
    top: 50%; left: 50%;
    width: min(18vw, 270px);
    border-radius: 34px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 40px 80px rgba(0,0,0,.6);
    animation: float 9s ease-in-out infinite;
  }
  .showcase .ex0 { z-index: 3; transform: translate(-50%, -50%); }
  .showcase .ex1 { z-index: 2; transform: translate(-128%, -44%) rotate(-7deg) scale(.88); animation-delay: -3s; opacity: .9; }
  .showcase .ex2 { z-index: 1; transform: translate(28%, -56%) rotate(7deg) scale(.88); animation-delay: -6s; opacity: .9; }
  @keyframes float { 50% { margin-top: -14px; } }

  /* Signed in: the app sits in a centred column */
  body:not(.guest) { background: var(--bg); }
  body:not(.guest) #app {
    left: max(0px, calc((100% - 760px) / 2));
    right: max(0px, calc((100% - 760px) / 2));
    box-shadow: 0 0 0 .5px var(--sep);
  }
  body:not(.guest) .scroller > * { max-width: none; }
  body:not(.guest) .scroller > .group,
  body:not(.guest) .scroller > .hero-card,
  body:not(.guest) .scroller > .stat-grid { margin-left: 24px; margin-right: 24px; }
  body:not(.guest) .large-title { padding-left: 24px; padding-right: 24px; }
  body:not(.guest) .nb-right { padding-right: 20px; }

  /* Sheets become centred dialogs */
  body.presenting #app { transform: none; border-radius: 0; filter: none; }
  .sheet {
    left: 50%; top: 50%; right: auto; bottom: auto; margin: 0;
    width: 480px;
    max-height: 80vh;
    border-radius: 30px;
    opacity: 0;
    transform: translate(-50%, -46%) scale(.97);
    transition: transform .35s var(--ease), opacity .25s;
    box-shadow: 0 30px 80px rgba(0,0,0,.35), 0 0 0 .5px var(--sep);
  }
  .sheet.show { opacity: 1; transform: translate(-50%, -50%); }
  .sheet.full { width: 440px; height: min(86vh, 900px); }
  .sheet .grabber { display: none; }
  .sheet-bar { height: 56px; }
  .actions {
    top: 50%; bottom: auto;
    max-width: 320px;
    opacity: 0;
    transform: translateY(-45%) scale(.97);
    transition: transform .3s var(--ease), opacity .2s;
  }
  .actions.show { opacity: 1; transform: translateY(-50%); }

  /* Pointer affordances */
  button.cell:hover, .type-grid button:hover { background: var(--press); }
  .btn:hover { filter: brightness(1.08); }
  .nb-btn:hover { opacity: .7; }
}

@media (min-width: 900px) and (max-height: 640px) {
  .welcome.desk .dots { display: none; }
  .auth-card { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .showcase .phone.ex { animation: none; }
}


/* ---------- Desktop workspace (signed in) ---------- */

.large-title.desk-only { display: none; }

@media (min-width: 900px) {
  :root { --ws: 1040px; --ed: 560px; --gap: 80px; }

  /* Editor column; centred alone, or together with the live preview */
  body:not(.guest) #app,
  body.staged:not(.guest) #app {
    left: calc(50% - var(--ed) / 2);
    right: auto;
    width: var(--ed);
    overflow: visible;
    box-shadow: none;
    background: transparent;
  }
  body.staged:not(.guest) #app { left: max(32px, calc(50% - var(--ws) / 2)); }
  body.staged #stage {
    left: calc(max(32px, calc(50% - var(--ws) / 2)) + var(--ed) + var(--gap));
    right: auto;
    width: calc(var(--ws) - var(--ed) - var(--gap));
  }

  /* Screens cross-fade instead of sliding sideways */
  body:not(.guest) .screen { will-change: auto; transition: opacity .28s ease, transform .28s var(--ease); }
  body:not(.guest) .screen::after { display: none; }
  body:not(.guest) .screen.enter,
  body:not(.guest) .screen.leave { transform: translateY(10px); opacity: 0; box-shadow: none; }
  body:not(.guest) .screen.behind { transform: none; opacity: 0; pointer-events: none; }

  /* Window-level controls: back far left, actions far right */
  body:not(.guest) .navbar {
    position: fixed;
    inset: 0 0 auto 0;
    height: 92px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
    background: none;
  }
  body:not(.guest) .navbar::before,
  body:not(.guest) .nb-title { display: none; }
  body:not(.guest) .nb-left,
  body:not(.guest) .nb-right { padding: 0; pointer-events: auto; }

  /* Content sits in the vertical middle and scrolls when taller than the window */
  body:not(.guest) .scroller,
  body:not(.guest) .screen:not(.has-large) .scroller {
    display: flex;
    flex-direction: column;
    padding: 104px 0 72px;
    overflow-x: visible;
  }
  body:not(.guest) .scroller > :first-child { margin-top: auto; }
  body:not(.guest) .scroller > :last-child { margin-bottom: auto; }
  body:not(.guest) .scroller > * { flex: none; }

  body:not(.guest) .large-title,
  body:not(.guest) .large-title.desk-only {
    display: block;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -.035em;
    padding: 0 4px 28px;
  }
  body:not(.guest) .scroller > .group,
  body:not(.guest) .scroller > .hero-card,
  body:not(.guest) .scroller > .stat-grid,
  body:not(.guest) .view-switch { margin-left: 0; margin-right: 0; }
  body:not(.guest) .group-header { padding-left: 4px; }
  body:not(.guest) .pad-x { padding: 0; }
  body:not(.guest) .empty { padding-top: 0; }

  /* Stage: phone and address centred in their column */
  body.staged #stage { gap: 18px; }
  #stage .phone { width: min(340px, calc((100vh - 180px) * 9 / 19.5)); }
}

@media (min-width: 900px) {
  body:not(.guest) .scroller > * { align-self: stretch; margin-left: 0; margin-right: 0; max-width: none; }
  body:not(.guest) .scroller > .empty { align-self: center; }
}
@media (min-width: 900px) {
  body:not(.guest) .scroller .group,
  body:not(.guest) .scroller .hero-card,
  body:not(.guest) .scroller .stat-grid,
  body:not(.guest) .scroller .view-switch { margin-left: 0; margin-right: 0; }
}

/* noiz logo on the welcome screen */
.welcome h1 .logo { display: block; width: 150px; height: auto; color: #1ed760; }
@media (min-width: 900px) { .welcome.desk h1 .logo { width: clamp(180px, 16vw, 240px); } }
.welcome .btn.light, .auth-card .btn { background: #1ed760; color: #000; box-shadow: 0 8px 24px rgba(30, 215, 96, .22), inset 0 1px 0 rgba(255,255,255,.35); }
.auth-card .link-btn { color: #1ed760; }

