/* Site pages: start page, sign-in, templates, dashboard. Profile pages have their own file (profile.css). */
:root {
  --paper: #e9ebff; --white: #ffffff; --ink: #17133a; --muted: #5a5682; --blue: #3d2eff; --blue-soft: #d9d6ff;
  --sun: #ffd23f; --danger: #c81e3a; --ok: #0a7d52; --line: #c5c3e6;
  --display: "Bricolage Grotesque", "Arial Black", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16.5px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px clamp(16px, 4vw, 40px); }
.logo { font: 800 22px var(--display); letter-spacing: -.03em; color: var(--ink); text-decoration: none; }
.top nav { display: flex; align-items: center; gap: clamp(12px, 2.5vw, 26px); font-weight: 600; }
.top nav a:not(.btn) { color: var(--ink); text-decoration: none; }
.top nav a:not(.btn):hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: 2px solid var(--ink); border-radius: 999px;
  background: var(--blue); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 15px; box-shadow: 2px 2px 0 var(--ink); }
.btn.plain { background: var(--white); color: var(--ink); }
.btn.sun { background: var(--sun); color: var(--ink); }
.btn.danger { background: var(--white); color: var(--danger); border-color: var(--danger); box-shadow: 2px 2px 0 var(--danger); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.danger { color: var(--danger); }

footer.site { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; padding: 28px clamp(16px, 4vw, 40px) 36px; color: var(--muted); font-size: 15px; }
footer.site a { color: var(--muted); }
footer.site nav { display: flex; gap: 18px; }

/* Start page */
.hero { padding: clamp(28px, 7vw, 84px) clamp(16px, 4vw, 40px) 0; max-width: 1240px; margin: 0 auto; }
.claim { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 0; font: 800 clamp(34px, 8.4vw, 112px)/1 var(--display); letter-spacing: -.045em; }
.claim label { white-space: nowrap; }
.claim input { flex: 1 1 4ch; min-width: 4ch; width: 6ch; padding: 0; border: 0; border-bottom: .07em solid var(--ink); border-radius: 0; background: none; color: var(--blue);
  font: inherit; letter-spacing: inherit; outline: none; caret-color: var(--blue); }
.claim input::placeholder { color: #a9a4ee; }
.claim input:focus { border-bottom-color: var(--blue); }
.hero-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: clamp(20px, 3vw, 34px); }
.hero-row p { flex: 1 1 320px; max-width: 54ch; font-size: clamp(17px, 1.6vw, 20px); }
.claim-status { min-height: 1.5em; margin-top: 10px; font-weight: 600; color: var(--muted); }
.claim-status.ok { color: var(--ok); } .claim-status.bad { color: var(--danger); }

.demo { max-width: 1240px; margin: clamp(26px, 4vw, 52px) auto 0; padding: 0 clamp(16px, 4vw, 40px); }
.demo-window { height: min(640px, 78vh); border: 2px solid var(--ink); border-radius: 28px; overflow: hidden; box-shadow: 8px 8px 0 var(--ink); background: #0b0b16; }
.looks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 22px; }
.looks span { font-weight: 600; margin-right: 6px; }
.chip { min-height: 38px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); font-weight: 600; cursor: pointer; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; }

.about { max-width: 1240px; margin: 0 auto; padding: clamp(48px, 8vw, 110px) clamp(16px, 4vw, 40px) 0; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 80px); }
.about h2 { font-size: clamp(30px, 4.4vw, 56px); font-weight: 800; }
.about > div > p { margin-top: 18px; max-width: 40ch; font-size: 18px; }
.about dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 36px; }
.about dl div { padding: 16px 0; border-top: 2px solid var(--ink); }
.about dt { font: 700 19px var(--display); }
.about dd { margin: 4px 0 0; color: var(--muted); }
.count { max-width: 1240px; margin: 0 auto; padding: clamp(40px, 7vw, 90px) clamp(16px, 4vw, 40px); }
.count-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding: clamp(22px, 4vw, 44px); border: 2px solid var(--ink); border-radius: 28px; background: var(--sun); }
.count-box p { font: 700 clamp(22px, 3vw, 36px)/1.2 var(--display); letter-spacing: -.02em; max-width: 26ch; }

/* Sign-in pages, text pages, not-found */
.narrow { max-width: 460px; margin: clamp(24px, 6vw, 70px) auto; padding: 0 16px; }
.narrow h1 { font-size: clamp(32px, 6vw, 46px); font-weight: 800; }
.narrow > p { margin-top: 10px; color: var(--muted); }
.text { max-width: 720px; margin: clamp(24px, 6vw, 60px) auto; padding: 0 16px; }
.text h1 { font-size: clamp(32px, 6vw, 46px); font-weight: 800; margin-bottom: 18px; }
.text h2 { font-size: 22px; margin: 28px 0 8px; }
.text p, .text li { margin-top: 10px; }
.note { margin-top: 16px; padding: 12px 16px; border-radius: var(--r); background: var(--sun); font-weight: 500; }

.form { display: grid; gap: 16px; margin-top: 26px; }
.f { display: grid; gap: 6px; }
.f > span, .f > label, .flabel { font-weight: 600; }
.f small, .hint { color: var(--muted); font-size: 14px; }
.input, .f input[type=text], .f input[type=password], .f input[type=email], .f input[type=search], .f input[type=url], .f select, .f textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--white); }
.f textarea { min-height: 110px; resize: vertical; }
.prefix { display: flex; align-items: center; border: 2px solid var(--ink); border-radius: var(--r); background: var(--white); overflow: hidden; }
.prefix span { padding-left: 14px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.prefix input { border: 0 !important; padding-left: 2px !important; min-width: 0; outline: none; }
.prefix:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.msg { min-height: 1.5em; font-weight: 600; }
.msg.bad { color: var(--danger); } .msg.ok { color: var(--ok); }
.hp { position: absolute; left: -9999px; }

/* Templates gallery */
.gallery { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 40px); }
.gallery h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 800; }
.gallery-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.gallery-tools input { flex: 1 1 220px; max-width: 360px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.tcard { display: block; color: var(--ink); text-decoration: none; }
.tthumb { position: relative; aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 20px; overflow: hidden; display: grid; place-items: center; background-size: cover; background-position: center; transition: transform .12s, box-shadow .12s; }
.tcard:hover .tthumb { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.tthumb i { width: 58%; padding: 12% 6%; border-radius: 12px; font: 700 15px/1 system-ui; font-style: normal; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tthumb em { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff; font: 600 11.5px system-ui; font-style: normal; }
.tcard strong { display: block; margin-top: 10px; font: 700 17px var(--display); }
.tcard small { color: var(--muted); }
.empty { padding: 34px 20px; border: 2px dashed var(--line); border-radius: 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font: 700 19px var(--display); margin-bottom: 4px; }

/* Dashboard */
body.p-dashboard { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.p-dashboard footer.site { display: none; }
body.p-dashboard .top { padding-block: 10px; border-bottom: 2px solid var(--ink); background: var(--white); }
body.p-dashboard main { flex: 1; min-height: 0; }
.dash { height: 100%; display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(340px, 42%); }
.tabs { overflow-y: auto; padding: 14px 10px; border-right: 2px solid var(--ink); background: var(--white); display: flex; flex-direction: column; gap: 2px; }
.tabs button { text-align: left; min-height: 40px; padding: 8px 14px; line-height: 1.25; border: 0; border-radius: 10px; background: none; font-weight: 600; cursor: pointer; }
.tabs button:hover { background: var(--paper); }
.tabs button[aria-selected=true] { background: var(--ink); color: #fff; }
.panel { overflow-y: auto; padding: 22px clamp(14px, 2.4vw, 32px) 110px; position: relative; }
.panel h1 { font-size: 30px; font-weight: 800; }
.panel h2 { font-size: 20px; margin: 30px 0 4px; padding-top: 22px; border-top: 2px solid var(--line); }
.panel h1 + p, .panel h2 + p { color: var(--muted); margin-top: 4px; }
.fields { display: grid; gap: 16px; margin-top: 18px; max-width: 640px; }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.toggle input { appearance: none; flex: none; width: 46px; height: 26px; margin: 1px 0 0; border: 2px solid var(--ink); border-radius: 999px; background: var(--white); position: relative; cursor: pointer; transition: background .15s; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); transition: transform .15s, background .15s; }
.toggle input:checked { background: var(--blue); }
.toggle input:checked::after { transform: translateX(20px); background: #fff; }
.toggle span { font-weight: 600; }
.toggle small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.rangef output { float: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.rangef input { width: 100%; accent-color: var(--blue); }
.colorf { display: flex; align-items: center; gap: 10px; }
.colorf input[type=color] { width: 46px; height: 46px; padding: 3px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--white); cursor: pointer; }
.colorf input[type=text] { width: 110px; }
.colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.upload { display: flex; align-items: center; gap: 14px; padding: 12px; border: 2px dashed var(--line); border-radius: var(--r); background: var(--white); }
.upload.drag { border-color: var(--blue); background: var(--blue-soft); }
.upload .thumb { width: 60px; height: 60px; flex: none; border-radius: 12px; background: var(--paper) center / cover no-repeat; display: grid; place-items: center; font-size: 12px; color: var(--muted); overflow: hidden; }
.upload .thumb video { width: 100%; height: 100%; object-fit: cover; }
.upload .info { flex: 1; min-width: 0; }
.upload .info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload .acts { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.progress { height: 6px; margin-top: 6px; border-radius: 3px; background: var(--paper); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--blue); }

.list { display: grid; gap: 8px; margin-top: 14px; max-width: 640px; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--white); }
.item .grow { flex: 1; min-width: 0; display: grid; gap: 6px; }
.item .grow input { min-height: 38px; padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 10px; width: 100%; }
.item .pico { width: 26px; height: 26px; flex: none; background: var(--ink); -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; }
.item img.pico { background: none; -webkit-mask: none; mask: none; border-radius: 6px; object-fit: cover; }
.item .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .sub { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iconbtn { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; cursor: pointer; font-size: 17px; line-height: 1; }
.iconbtn:hover { background: var(--paper); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.addrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; max-width: 640px; }
.addrow select, .addrow input { flex: 1 1 160px; min-height: 46px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--white); }

.savebar { position: absolute; left: 200px; right: 42%; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px clamp(14px, 2.4vw, 32px);
  background: var(--white); border-top: 2px solid var(--ink); }
.savebar span { font-weight: 600; color: var(--muted); }
.savebar.dirty span { color: var(--ink); }
.dash { position: relative; }
.previewpane { display: flex; flex-direction: column; border-left: 2px solid var(--ink); background: #0b0b16; min-height: 0; }
.previewbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }
.previewbar a { color: #fff; }
.previewbar div { display: flex; gap: 6px; }
.previewbar button { min-height: 30px; padding: 0 12px; border: 1.5px solid #fff; border-radius: 999px; background: none; color: #fff; font-weight: 600; font-size: 13px; cursor: pointer; }
.previewbar button[aria-pressed=true] { background: #fff; color: var(--ink); }
.previewwrap { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; }
.previewwrap iframe { width: 100%; height: 100%; border: 0; display: block; background: #000; }
.previewwrap.phone iframe { width: 390px; max-width: 100%; height: min(100% - 24px, 780px); border-radius: 26px; border: 2px solid #3a3a55; }
.fab { display: none; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; max-width: 760px; }
.stat { padding: 14px 16px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--white); }
.stat b { display: block; font: 800 28px var(--display); }
.stat span { color: var(--muted); font-size: 14px; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 180px; margin-top: 16px; padding: 12px 12px 0; max-width: 760px; border: 2px solid var(--ink); border-radius: var(--r) var(--r) 0 0; background: var(--white); }
.chart div { flex: 1; min-width: 2px; background: var(--blue); border-radius: 3px 3px 0 0; position: relative; }
.chart div:hover { background: var(--ink); }
.chart div:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; z-index: 2; }
.chartaxis { display: flex; justify-content: space-between; max-width: 760px; padding: 6px 12px; border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 var(--r) var(--r); background: var(--white); color: var(--muted); font-size: 13px; }
.tops { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin-top: 8px; max-width: 760px; }
.tops h3 { font-size: 17px; margin: 18px 0 8px; }
.toprow { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 6px 10px; margin-top: 4px; border-radius: 8px; overflow: hidden; background: var(--white); font-size: 15px; }
.toprow i { position: absolute; inset: 0 auto 0 0; background: var(--blue-soft); }
.toprow span, .toprow b { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.table { width: 100%; max-width: 900px; margin-top: 14px; border-collapse: separate; border-spacing: 0; background: var(--white); border: 2px solid var(--ink); border-radius: var(--r); overflow: hidden; font-size: 15px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 700; background: var(--paper); }
.tablewrap { overflow-x: auto; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--blue-soft); font-size: 13px; font-weight: 600; }
.tag.bad { background: #ffd9df; color: var(--danger); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; }
.dialog { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(23, 19, 58, .55); }
.dialog > div { width: min(520px, 100%); max-height: 90vh; overflow-y: auto; padding: 26px; border: 2px solid var(--ink); border-radius: 22px; background: var(--white); box-shadow: 6px 6px 0 var(--ink); }
.dialog h2 { font-size: 24px; margin-bottom: 8px; }
.dialog .acts { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; }
.toast.bad { background: var(--danger); }
code.copy { display: block; padding: 10px 12px; border-radius: 10px; background: var(--paper); font: 14px ui-monospace, Menlo, Consolas, monospace; overflow-wrap: anywhere; }

@media (max-width: 1040px) {
  .dash { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .tabs { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 2px solid var(--ink); padding: 8px; }
  .tabs button { white-space: nowrap; }
  .savebar { left: 0; right: 0; }
  .previewpane { display: none; position: fixed; inset: 0; z-index: 40; border: 0; }
  .previewpane.open { display: flex; }
  .fab { display: inline-flex; }
}
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .top nav a:not(.btn):first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
