/* My Gulpit app (my.gulpit.store). Brand tokens from the live site (Accounts spec §4.5). */
:root {
  --sun: #FFCF23;
  --sun-soft: #FFF3C2;
  --honey: #D3931D;
  --ink: #161616;
  --black: #000;
  --mint: #ECF5EA;
  --green: #3F9E5A;
  --red: #D60000;
  --grey: #727272;
  --line: #ECE6D6;
  --bg: #FFFCF2;
  --card: #fff;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 22, 22, .05), 0 6px 20px rgba(22, 22, 22, .06);
  --tabbar: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.45 "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; border-radius: 8px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.boot { display: grid; place-items: center; min-height: 100vh; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--sun-soft); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { padding: 24px; text-align: center; }

/* ---------- Header ---------- */
.hero {
  background: var(--sun);
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 28px;
  border-radius: 0 0 28px 28px;
}
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { height: 30px; width: auto; display: block; }
.logo.dark { filter: brightness(0); } /* white logo → black on the yellow header */
.wordmark { font-weight: 700; font-size: 20px; letter-spacing: -.02em; }
.hero h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; margin: 18px 0 4px; }
.hero p { margin: 0; color: rgba(22, 22, 22, .72); }
.chip-id { font-size: 12px; font-weight: 500; background: rgba(255, 255, 255, .55); padding: 4px 10px; border-radius: 999px; }
.back { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .55); border: 0; border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 14px; font-weight: 500; cursor: pointer; }

/* ---------- Page body ---------- */
main.page { padding: 16px 16px calc(var(--tabbar) + var(--safe-b) + 24px); }
.page.no-tabs { padding-bottom: 32px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--grey); margin: 24px 4px 10px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px; margin: 0 0 12px; border: 1px solid rgba(236, 230, 214, .6);
}
.card h2 { font-size: 18px; margin: 0 0 6px; letter-spacing: -.01em; }
.card p { margin: 0 0 6px; }
.muted { color: var(--grey); font-size: 14px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack > * + * { margin-top: 10px; }
.card.link { display: block; text-decoration: none; transition: transform .12s ease; }
.card.link:active { transform: scale(.99); }
.empty { text-align: center; padding: 28px 18px; }
.empty .big { font-size: 40px; line-height: 1; margin-bottom: 10px; }

/* ---------- Buttons and inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer;
  width: 100%; transition: opacity .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.btn.small { min-height: 38px; padding: 8px 14px; width: auto; font-size: 14px; }
.btn.danger { background: transparent; border-color: var(--red); color: var(--red); }
.link-btn { background: none; border: 0; padding: 8px 0; color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
label.field { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.input {
  width: 100%; min-height: 54px; border: 2px solid var(--line); border-radius: 14px; background: #fff;
  padding: 12px 14px; font-size: 18px; transition: border-color .15s ease;
}
.input:focus { border-color: var(--ink); outline: none; }
.phone-wrap { display: flex; align-items: stretch; border: 2px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.phone-wrap:focus-within { border-color: var(--ink); }
.phone-wrap .cc { display: flex; align-items: center; padding: 0 12px; font-weight: 700; background: var(--sun-soft); }
.phone-wrap .input { border: 0; border-radius: 0; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 26px; font-weight: 700; padding-left: .5em; }
.error { color: var(--red); font-size: 14px; margin: 8px 2px 0; min-height: 20px; }
.hint { color: var(--grey); font-size: 13px; margin-top: 10px; }

/* ---------- Bits ---------- */
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--sun-soft); white-space: nowrap; }
.pill.done { background: var(--mint); color: var(--green); }
.pill.bad { background: #FDE8E8; color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--mint); color: #24563A; font-weight: 500; }
.thumbs { display: flex; gap: 8px; margin: 10px 0 4px; }
.thumbs img, .thumb-ph { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--sun-soft); }
.score { --v: 0; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--green) calc(var(--v) * 1%), var(--sun-soft) 0); }
.score span { width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; border: 1px solid rgba(236, 230, 214, .6); font-weight: 700; cursor: pointer; text-align: left; }
.tile .ico { width: 36px; height: 36px; border-radius: 12px; background: var(--sun); display: grid; place-items: center; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid rgba(236, 230, 214, .6); }
.list a, .list button.item, .list .item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 16px 18px; text-decoration: none; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; cursor: pointer;
}
.list > :first-child { border-top: 0; }
.list .sub { display: block; font-size: 13px; color: var(--grey); font-weight: 400; }
.toggle { position: relative; width: 52px; height: 32px; flex: none; }
.toggle input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.toggle span { position: absolute; inset: 0; background: #D9D4C7; border-radius: 999px; transition: background .2s ease; pointer-events: none; }
.toggle span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s ease; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid var(--honey); outline-offset: 2px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.kv dt { color: var(--grey); }
.kv dd { margin: 0; text-align: right; }
.addr { white-space: pre-line; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + var(--safe-b) + 16px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 30; box-shadow: var(--shadow); max-width: 90vw; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(22, 22, 22, .45); display: grid; place-items: end center; z-index: 40; }
.modal { background: #fff; width: 100%; max-width: 480px; border-radius: 24px 24px 0 0; padding: 24px 20px calc(24px + var(--safe-b)); }
.modal h2 { margin: 0 0 8px; }
.modal .btn + .btn { margin-top: 10px; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
.tabbar nav { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--tabbar); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; font-weight: 500; text-decoration: none; color: var(--grey); }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] .tab-ico { background: var(--sun); }
.tab-ico { padding: 4px 14px; border-radius: 999px; display: grid; place-items: center; transition: background .2s ease; }

@media (min-width: 520px) {
  body { background: linear-gradient(180deg, var(--sun) 0, var(--sun) 220px, var(--bg) 220px); }
  #app { background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
