/* ===================================================================
   FRANK — site styles
   =================================================================== */

/* ---------- Font: Archivo (self-hosted variable) ---------- */
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/Archivo-Variable-Italic.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: italic;
  font-display: swap;
}

:root {
  --black: #0a0a0a;
  --yellow: #ffc60b;
  --yellow-soft: #fdf3d3;
  --white: #ffffff;
  --gray: #6b6b6b;
  --gray-light: #f2f2f2;
  --placeholder: #9a9a9a;
  --border: #dcdcdc;
  --page: #ececec;
  --green: #1e9e33;
  --green-soft: #e6f5e8;
  --blue: #2f6fd6;
  --blue-soft: #e2ecfb;
  --red: #d33;
  --font: "Archivo", "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, Helvetica, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }
body { min-height: 100%; }

body {
  font-family: var(--font);
  background: var(--page);
  color: var(--black);
  display: flex;
  justify-content: center;
  padding: 32px 16px 24px;
}
button, input { font-family: inherit; }

.page { width: 100%; max-width: 1440px; display: flex; flex-direction: column; }

/* ---------- App card ---------- */
.app {
  background: var(--white);
  border-radius: 40px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28);
  padding: 24px 32px 48px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  min-height: min(1000px, calc(100vh - 220px));
}

header { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: block; width: 190px; height: auto; }

.nav { display: flex; align-items: center; gap: 32px; font-size: 24px; font-weight: 600; }
.nav a { color: var(--black); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--yellow); }
.btn-signup { background: var(--yellow); color: var(--black) !important; padding: 8px 18px; border-radius: 999px; }
.btn-signup:hover { filter: brightness(0.96); }

.menu-dots {
  display: grid; grid-template-columns: repeat(2, 9px); gap: 12px;
  background: none; border: none; cursor: pointer; padding: 8px; margin-left: 8px;
}
.menu-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--black); }

/* ---------- Main ---------- */
main { flex: 1; width: 100%; max-width: 840px; margin: 0 auto; padding-top: clamp(48px, 12vh, 150px); }

h1 { color: var(--yellow); font-size: clamp(36px, 5vw, 48px); font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.sub { font-size: clamp(20px, 2.5vw, 26px); font-weight: 600; margin-top: 22px; }

.search {
  position: relative;
  margin-top: 36px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 20px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.35);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
}

.field {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 8px 0 12px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--white);
}
.field:focus-within { border-color: var(--yellow); }
.field.shake { animation: shake .4s ease; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.field .pin { flex: none; }
.field input {
  flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent;
  font: inherit; font-size: 20px; font-weight: 500; color: var(--black);
}
.field input::placeholder { color: var(--placeholder); }

.btn-plus {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--yellow); background: var(--white); cursor: pointer;
  display: grid; place-items: center; color: var(--black);
  transition: background .15s ease;
}
.btn-plus:hover, .btn-plus.located { background: var(--yellow); }
.btn-plus.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Address suggestions dropdown */
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12); z-index: 20; overflow: hidden;
  display: none;
}
.suggestions.open { display: block; }
.suggestions button {
  display: block; width: 100%; text-align: left; border: none; background: none; cursor: pointer;
  padding: 12px 16px; font-size: 16px; color: var(--black);
}
.suggestions button b { font-weight: 700; }
.suggestions button small { display: block; color: var(--gray); font-size: 13px; margin-top: 2px; }
.suggestions button:hover, .suggestions button.active { background: var(--yellow-soft); }
.suggestions .powered { text-align: right; padding: 4px 12px; font-size: 11px; color: var(--gray); }

.btn-find {
  width: 100%; height: 56px; border: none; border-radius: 14px;
  background: var(--yellow); color: var(--black); font: inherit; font-size: 24px; font-weight: 700; cursor: pointer;
}
.btn-find:hover { filter: brightness(0.96); }

.or { text-align: right; font-size: 22px; font-weight: 600; margin-top: 28px; }
.cards + .or { margin-top: 26px; }
.or a { color: var(--yellow); text-decoration: underline; text-underline-offset: 4px; }

.write { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 26px; font-weight: 600; margin-top: 56px; }
.write .view-list {
  font-size: 15px; font-weight: 700; color: var(--black); text-decoration: none; cursor: pointer; border: none;
  background: var(--yellow-soft); border-radius: 999px; padding: 6px 14px; display: none;
}
.write .view-list.show { display: inline-block; }

.cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin-top: 32px; }
.card {
  flex: 1 1 200px; max-width: 240px; border: 1px solid var(--border); border-radius: 18px;
  padding: 40px 16px 32px; display: flex; flex-direction: column; align-items: center; gap: 26px;
  background: var(--white); text-decoration: none; color: var(--black); cursor: pointer; font: inherit;
  transition: box-shadow .15s ease, transform .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.icon { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon.green  { background: var(--green-soft); color: var(--green); }
.icon.yellow { background: var(--yellow-soft); color: #f5c400; }
.icon.blue   { background: var(--blue-soft); color: var(--blue); }
.icon.red    { background: #fde8e8; color: var(--red); }
.icon.sm { width: 72px; height: 72px; }
.card h2 { font-size: 20px; font-weight: 700; }
.card, .tool { position: relative; }
.badge {
  position: absolute; top: -1px; left: -1px; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center;
  background: var(--black); color: var(--yellow); border-radius: 18px 0 12px 0; padding: 6px 12px 7px 10px; line-height: 1.05; text-align: left;
}
.badge svg { grid-row: 1 / span 2; }
.badge b { font-size: 16px; font-weight: 800; }
.badge small { font-size: 12px; font-weight: 700; }
.tool > .badge { border-radius: 20px 0 12px 0; }

/* ---------- Footer ---------- */
footer { padding: 22px 0 0; font-size: 14px; font-weight: 600; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.frank-day { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin: 0 auto; }
.fd-count { font-size: 20px; font-weight: 800; font-style: italic; }
.fd-what { display: inline-block; background: var(--black); color: var(--yellow) !important; font-size: 18px; font-weight: 700; text-decoration: none; padding: 9px 20px; border-radius: 999px; }
.fd-what:hover { filter: brightness(1.15); }
.foot-row + .foot-row { margin-top: 26px; }
.country { display: flex; align-items: center; gap: 12px; font-size: 18px; }
.country .flag { width: 56px; height: 36px; display: block; }
.country a { font-size: 14px; color: var(--black); }
.stores { display: flex; gap: 8px; }
.stores img { display: block; height: 46px; width: auto; }
footer a { color: var(--black); }
.legal a { text-underline-offset: 3px; }

/* ===================================================================
   Modal system
   =================================================================== */
.modal {
  border: 1px solid #cfcfcf; border-radius: 6px; padding: 0; margin: auto;
  width: min(570px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  background: var(--white); color: var(--black);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}
.modal::backdrop { background: rgba(255, 255, 255, 0.7); }
.modal[open] { animation: modal-in .18s ease-out; }
.modal[open]::backdrop { animation: fade-in .18s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

.modal-body { padding: 28px 36px 40px; }
.modal-head { display: flex; align-items: center; justify-content: center; position: relative; height: 40px; margin-bottom: 32px; }
.modal-head h2 { font-size: 20px; font-weight: 700; }
.modal-close {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: none; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--black); border-radius: 50%;
}
.modal-close:hover { background: var(--gray-light); }

/* full-height sheet on phones for the tool modals */
@media (max-width: 600px) {
  .modal--sheet { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: none; margin: 0; }
  .modal--sheet .modal-body { padding: 20px 20px 32px; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(0.95); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-yellow { background: var(--yellow); color: var(--black); }
.btn-black { background: var(--black); color: var(--yellow); }
.btn-ghost { background: var(--gray-light); color: var(--black); font-weight: 600; }
.btn-outline { background: var(--white); color: var(--black); border-color: #d0d0d0; font-weight: 600; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.btn-row .btn { flex: 1 1 auto; }

/* Login (auth) buttons */
.auth {
  display: flex; align-items: center; justify-content: center; position: relative;
  width: 100%; height: 40px; margin-bottom: 16px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-size: 18px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.auth svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.auth.google   { background: var(--white); color: #3c3c3c; border-color: #d0d0d0; font-weight: 500; }
.auth.facebook { background: #1877f2; color: var(--white); }
.auth.apple    { background: #000; color: var(--white); }
.auth.email    { background: var(--gray-light); color: var(--black); font-weight: 600; margin-top: 30px; }
.auth:hover { filter: brightness(0.95); }
.divider { display: flex; align-items: center; gap: 16px; margin-top: 32px; font-size: 16px; font-weight: 700; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.need { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 22px; font-size: 17px; font-weight: 500; }
.need a { background: var(--black); color: var(--yellow); font-weight: 700; text-decoration: none; padding: 5px 12px; border-radius: 999px; }

/* Intro panels (camera / voice) */
.intro { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 8px 0 4px; }
.intro h3 { font-size: 24px; font-weight: 800; }
.intro p { font-size: 16px; color: var(--gray); max-width: 380px; line-height: 1.45; }
.intro .btn-row { width: 100%; }

/* Modal states */
[data-state] > .state { display: none; }
[data-state="intro"]      > .state-intro,
[data-state="live"]       > .state-live,
[data-state="preview"]    > .state-preview,
[data-state="listening"]  > .state-listening,
[data-state="processing"] > .state-processing,
[data-state="error"]      > .state-error { display: block; }
.state-processing, .state-error { text-align: center; padding: 24px 0 8px; }
.state-processing p, .state-error p { font-size: 18px; font-weight: 600; margin-top: 18px; }
.state-error p.detail { font-size: 14px; font-weight: 500; color: var(--gray); margin-top: 8px; line-height: 1.45; }
.state-error .icon { margin: 0 auto; }

.spinner {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  border: 5px solid var(--yellow-soft); border-top-color: var(--yellow); animation: spin .8s linear infinite;
}

/* ---------- List modal ---------- */
.list-add { display: flex; gap: 10px; }
.list-add .field { flex: 1; height: 52px; }
.list-add .field input { font-size: 18px; }
.list-add .btn-add {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--yellow);
  color: var(--black); cursor: pointer; display: grid; place-items: center;
}
.list-add .btn-add:hover { filter: brightness(.95); }
.list-hint { font-size: 13px; color: var(--gray); margin-top: 8px; }
.list-items { list-style: none; margin-top: 18px; max-height: 44vh; overflow-y: auto; border-top: 1px solid var(--border); }
.list-items li {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--border);
  font-size: 18px; font-weight: 500; animation: item-in .2s ease-out;
}
@keyframes item-in { from { opacity: 0; transform: translateY(-4px); } }
.list-items li.new { background: var(--yellow-soft); }
.list-items li .chk {
  flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--black); background: var(--white);
  cursor: pointer; display: grid; place-items: center; color: transparent; padding: 0;
}
.list-items li.done .chk { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
.list-items li.done .txt { text-decoration: line-through; color: var(--gray); }
.list-items li .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; outline: none; border-radius: 4px; padding: 2px 4px; }
.list-items li .txt:focus { background: var(--yellow-soft); }
.list-items li .del { flex: none; border: none; background: none; cursor: pointer; color: var(--gray); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.list-items li .del:hover { background: var(--gray-light); color: var(--red); }
.list-empty { display: block !important; text-align: center; color: var(--gray); font-size: 16px; padding: 28px 8px; border-bottom: none !important; }
.list-empty svg { display: block; margin: 0 auto 10px; opacity: .5; }
.list-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.list-foot .count { font-size: 14px; color: var(--gray); font-weight: 600; }
.list-foot .tools { display: flex; gap: 8px; }
.list-foot .tools .btn { height: 38px; padding: 0 14px; font-size: 14px; }
.list-cta { margin-top: 18px; }

/* ---------- Camera modal ---------- */
.viewfinder {
  position: relative; width: 100%; aspect-ratio: 4 / 3; background: #111; border-radius: 16px; overflow: hidden;
}
.viewfinder video, .viewfinder img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewfinder .guides { position: absolute; inset: 18px; pointer-events: none; }
.viewfinder .guides i {
  position: absolute; width: 34px; height: 34px; border: 3px solid var(--yellow); border-radius: 4px;
}
.viewfinder .guides i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.viewfinder .guides i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.viewfinder .guides i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.viewfinder .guides i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.viewfinder .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.viewfinder .flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.viewfinder .tip {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.cam-controls { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 22px; }
.shutter {
  width: 76px; height: 76px; border-radius: 50%; border: 4px solid var(--black); background: var(--white);
  cursor: pointer; display: grid; place-items: center; padding: 0;
}
.shutter::after { content: ""; width: 56px; height: 56px; border-radius: 50%; background: var(--yellow); transition: transform .12s ease; }
.shutter:hover::after { transform: scale(.94); }
.shutter:active::after { transform: scale(.85); }
.cam-side { width: 46px; height: 46px; border-radius: 50%; border: 1px solid #d0d0d0; background: var(--white); cursor: pointer; display: grid; place-items: center; color: var(--black); }
.cam-side:hover { background: var(--gray-light); }

/* ---------- Voice modal ---------- */
.wave { display: block; width: 100%; height: 84px; }
.transcript {
  margin-top: 14px; min-height: 120px; max-height: 32vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; font-size: 18px; line-height: 1.5;
}
.transcript .final { color: var(--black); }
.transcript .partial { color: var(--placeholder); }
.transcript .placeholder { color: var(--placeholder); font-style: italic; }
.voice-status { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--gray); }
.voice-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }

/* ---------- Geo blocked popover ---------- */
.popover {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
  width: min(360px, 90vw); background: var(--white); border: 1px solid #cfcfcf; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 16px 18px; font-size: 14px; line-height: 1.45; display: none;
}
.popover.open { display: block; animation: modal-in .15s ease-out; }
.popover::before {
  content: ""; position: absolute; top: -7px; right: 18px; width: 12px; height: 12px;
  background: var(--white); border-left: 1px solid #cfcfcf; border-top: 1px solid #cfcfcf; transform: rotate(45deg);
}
.popover h4 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.popover ol { padding-left: 18px; margin: 6px 0; }
.popover li { margin: 3px 0; }
.popover .btn { height: 34px; font-size: 13px; padding: 0 14px; margin-top: 8px; }

/* ---------- Located: expandable panel with map ---------- */
.btn-clear {
  flex: none; display: none; width: 28px; height: 28px; border: none; background: none; cursor: pointer;
  color: var(--black); border-radius: 50%; place-items: center; opacity: .8;
}
.btn-clear:hover { opacity: 1; }
.search.expanded .btn-clear { display: grid; }
.search.expanded .field input { font-size: 18px; font-weight: 600; }

.search-extra {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows .55s cubic-bezier(.4,0,.2,1), opacity .35s ease .1s;
}
.search.expanded .search-extra { grid-template-rows: 1fr; opacity: 1; }
.search-extra-inner { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.search.expanded .search-extra-inner { overflow: visible; }

.addr-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.addr-extra input {
  height: 56px; border: 1px solid var(--border); border-radius: 14px; padding: 0 16px;
  font: inherit; font-size: 16px; font-weight: 500; color: var(--black); outline: none; background: var(--white); min-width: 0;
}
.addr-extra input:focus { border-color: var(--yellow); }
.addr-extra input::placeholder { color: var(--placeholder); }

.map-wrap {
  position: relative; height: clamp(320px, 48vh, 520px); margin: 4px -14px 0; background: #f4f4f4; overflow: hidden;
}
.map { position: absolute; inset: 0; }
.map-wrap.editing { cursor: grab; }
.pin-f {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); pointer-events: none; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  transition: transform .2s ease;
}
.pin-f svg { display: block; filter: drop-shadow(0 4px 6px rgba(0,0,0,.25)); }
.pin-f .pin-dot { width: 10px; height: 10px; border: 2px solid var(--black); border-radius: 50%; background: var(--white); margin-top: 4px; }
.map-wrap.editing .pin-f { transform: translate(-50%, -112%); }
.map-edit {
  position: absolute; right: 12px; bottom: 34px; z-index: 3; height: 40px; font-size: 14px; padding: 0 16px;
  box-shadow: 0 4px 14px rgba(0,0,0,.14);
}
.map-wrap.editing .map-edit { background: var(--yellow); border-color: var(--yellow); }
.map-hint {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3;
  background: rgba(10,10,10,.85); color: #fff; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  white-space: nowrap; display: none;
}
.map-wrap.editing .map-hint { display: block; }
.map-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--gray); font-size: 14px; padding: 20px;
}
@media (max-width: 720px) {
  .addr-extra { grid-template-columns: 1fr; }
  .search.expanded .field input { font-size: 15px; }
}

/* ===================================================================
   /lists/ pages (index · create · view)
   =================================================================== */
main.sub { padding-top: clamp(20px, 4vh, 40px); }
.back { display: inline-block; font-size: 15px; font-weight: 700; color: var(--gray); text-decoration: none; margin-bottom: 18px; }
.back:hover { color: var(--black); }
main.sub h1 { font-size: clamp(30px, 4vw, 40px); }

/* page states (view: loading / missing / ready — index: empty / ready) */
main[data-state] > .state { display: none; }
main[data-state="loading"] > .state-loading,
main[data-state="missing"] > .state-missing,
main[data-state="ready"]   > .state-ready,
main[data-state="empty"]   > .state-empty { display: block; }
main.sub .state-loading { padding: 80px 0; }
main.sub .state-missing { text-align: center; padding: 24px 0; }
main.sub .state-missing h1 { margin-top: 18px; }
main.sub .state-missing .icon { margin: 0 auto; }
main.sub .state-missing .detail { color: var(--gray); margin-top: 8px; }
main.sub .state-missing .btn-row .btn { flex: 0 1 auto; }

/* create: desktop layout = sidebar (your lists + premium nudge) | main */
.create-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 0 60px; flex: 1; }
.create-layout main.sub { max-width: 1040px; margin: 0; padding-top: 12px; }
body[data-page="lists-create"] .back { display: none; }
.side { margin-top: 86px; border-right: 3px solid var(--black); display: flex; flex-direction: column; align-self: stretch; margin-bottom: 30px; }
.side-lists { list-style: none; margin-right: 16px; }
.side-lists li { border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.side-lists a { flex: 1; min-width: 0; display: block; padding: 14px 8px; font-size: 15px; font-weight: 700; color: var(--black); text-decoration: none; overflow-wrap: anywhere; }
.side-lists a:hover { background: var(--yellow-soft); }
.side-lists .side-count { color: var(--gray); font-weight: 600; }
.side-del { flex: none; width: 34px; height: 34px; border: none; background: none; color: var(--gray); cursor: pointer; border-radius: 50%; display: grid; place-items: center; }
.side-del:hover { background: var(--gray-light); color: var(--red); }
.side-lists li.active a { color: var(--black); }
.side-lists li:not(.active) a { color: var(--gray); font-weight: 600; }
.side-premium { margin: auto 16px 40px 0; padding-top: 60px; text-align: center; font-size: 16px; color: var(--gray); font-weight: 500; }
.btn-premium { display: inline-block; margin-top: 12px; background: var(--black); color: var(--yellow); font-weight: 700; font-size: 15px; text-decoration: none; padding: 8px 14px; border-radius: 8px; }
.btn-premium:hover { filter: brightness(1.15); }

body[data-page="lists-create"] main.sub { display: flex; flex-direction: column; }
body[data-page="lists-create"] .list-add { margin-left: 84px; }
body[data-page="lists-create"] .list-hint { margin-left: 92px; }
body[data-page="lists-create"] .editor { flex: 1; display: flex; flex-direction: column; margin-top: 44px; }
body[data-page="lists-create"] .list-items { flex: 1; display: flex; flex-direction: column; margin-top: 18px; min-height: 380px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
body[data-page="lists-create"] .list-empty { margin: auto 0; }
body[data-page="lists-create"] .tools-bar { margin: 18px auto 0; }
body[data-page="lists-create"] .list-head { margin-top: 26px; }
body[data-page="lists-create"] .list-head .list-title { font-size: 34px; }
body[data-page="lists-create"] .list-count { font-size: 18px; }
body[data-page="lists-create"] .icon-btn { min-width: 74px; font-size: 15px; }
body[data-page="lists-create"] .icon-btn img { height: 34px; width: auto; }
body[data-page="lists-create"] .list-head-actions { gap: 4px; }

@media (max-width: 960px) {
  .create-layout { display: block; }
  .side { display: none; }
  body[data-page="lists-create"] .back { display: inline-block; }
  body[data-page="lists-create"] .list-add { margin-left: 0; }
  body[data-page="lists-create"] .list-hint { margin-left: 8px; }
}

/* create: list title row (title + count | Rename · Share) */
.list-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 22px; }
.list-head-text { min-width: 0; }
.list-head .list-title { font-size: 26px; font-weight: 700; margin-left: -6px; overflow-wrap: anywhere; }
.list-count { font-size: 14px; font-weight: 600; color: var(--gray); margin-top: 2px; }
.list-head-actions { display: flex; gap: 6px; flex: none; }
.icon-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 4px 6px; border: none; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--gray); cursor: pointer; border-radius: 12px;
}
.icon-btn img { display: block; height: 26px; width: auto; }
.icon-btn:hover { background: var(--gray-light); color: var(--black); }
.tool-tab .tab-badge {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 2px; padding: 2px 6px; border-radius: 999px;
  background: var(--black); color: var(--yellow); font-size: 10px; font-weight: 800; letter-spacing: .01em; line-height: 1;
}
body[data-page="lists-create"] .tool { margin-top: 20px; }

/* create: how-do-you-want-to-add-items tabs */
.tools-bar { display: flex; gap: 8px; margin-top: 22px; background: var(--gray-light); border-radius: 999px; padding: 4px; width: fit-content; max-width: 100%; }
.tool-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: none;
  background: transparent; color: var(--gray); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tool-tab:hover { color: var(--black); }
.tool-tab.active { background: var(--white); color: var(--black); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* create: tool panels (camera / voice) — shown by body[data-mode] */
.tool { display: none; margin-top: 22px; border: 1px solid var(--border); border-radius: 20px; padding: 20px; }
body[data-mode="camera"] #tool-camera, body[data-mode="audio"] #tool-voice { display: block; }
.tool .state-processing, .tool .state-error { padding: 12px 0 4px; }

/* editor (shared by create + view) */
.editor { margin-top: 22px; }
.name-row { margin-top: 22px; }
.name-row .field { height: 52px; }
.name-row .field input { font-size: 17px; }
main.sub .list-items { max-height: none; }
main.sub .list-foot .tools .btn { text-decoration: none; }
main.sub .list-cta { margin-top: 22px; height: 56px; font-size: 20px; }

/* view: title + meta + actions */
.view-head { margin-bottom: 4px; }
.list-title { outline: none; border-radius: 8px; padding: 2px 6px; margin-left: -6px; cursor: text; min-height: 1.2em; }
.list-title:hover { background: var(--gray-light); }
.list-title:focus { background: var(--yellow-soft); }
.list-meta { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--gray); }
.save-state { border: none; background: none; font: inherit; color: var(--gray); padding: 0; cursor: default; }
.save-state[data-state="dirty"], .save-state[data-state="saving"] { color: #b08400; }
.save-state[data-state="saved"] { color: var(--green); }
.save-state[data-state="error"] { color: var(--red); cursor: pointer; text-decoration: underline; }
.view-actions { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 18px; }
.view-actions .btn { height: 42px; font-size: 15px; }
.view-actions .danger { color: var(--red); }

/* index: my lists */
.index-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.index-head .btn { height: 44px; }
.mylists { list-style: none; margin-top: 24px; border-top: 1px solid var(--border); }
.mylists li { border-bottom: 1px solid var(--border); }
.mylists a {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 16px 6px; color: var(--black); text-decoration: none; border-radius: 10px;
}
.mylists a:hover { background: var(--yellow-soft); }
.mylists .ml-title { font-size: 20px; font-weight: 700; grid-column: 1; }
.mylists .ml-meta { font-size: 14px; font-weight: 600; color: var(--gray); grid-column: 1; margin-top: 2px; }
.mylists .ml-arrow { grid-column: 2; grid-row: 1 / span 2; color: var(--gray); }
.index-more { margin-top: 24px; font-size: 15px; font-weight: 600; color: var(--gray); }
.index-more a { color: var(--black); text-underline-offset: 3px; }
main.sub .state-empty .write { margin-top: 24px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--black); color: var(--white); font-size: 15px; font-weight: 600;
  padding: 12px 20px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast b { color: var(--yellow); }
.toast-action { background: none; border: none; color: var(--yellow); font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 720px) {
  /* tighter gutters: less grey around the card, less padding inside it */
  body { padding: 8px 6px 16px; }
  .app { border-radius: 24px; padding: 10px 14px 28px; }

  /* header: everything shrinks so the dots menu stays on-screen */
  header { gap: 8px; }
  .logo { width: clamp(100px, 30vw, 124px); }
  .nav { font-size: 17px; gap: 12px; }
  .btn-signup { padding: 6px 14px; }
  .menu-dots { grid-template-columns: repeat(2, 7px); gap: 8px; padding: 4px; margin-left: 0; }
  .menu-dots span { width: 7px; height: 7px; }

  /* main content moves up */
  main { padding-top: 28px; }
  h1 { font-size: clamp(30px, 8.6vw, 36px); }
  .sub { font-size: 20px; margin-top: 12px; }
  .search { margin-top: 24px; padding: 12px; }
  .map-wrap { margin-left: -12px; margin-right: -12px; }
  .field { height: 52px; }
  .field input { font-size: 17px; }
  .btn-find { font-size: 18px; height: 52px; }
  .or { font-size: 19px; margin-top: 20px; }
  .write { font-size: 20px; margin-top: 30px; }

  /* the three list options sit side by side inside the card */
  .cards { flex-wrap: nowrap; gap: 10px; margin-top: 18px; }
  .card { flex: 1 1 0; min-width: 0; max-width: none; padding: 32px 6px 16px; gap: 14px; border-radius: 14px; }
  .card .icon { width: 52px; height: 52px; }
  .card .icon svg { width: 28px; height: 28px; }
  .card h2 { font-size: clamp(14px, 4.4vw, 17px); line-height: 1.2; text-align: center; max-width: 6em; }

  .card .badge { padding: 4px 8px 5px 7px; column-gap: 5px; border-radius: 14px 0 10px 0; }
  .card .badge b { font-size: 12px; }
  .card .badge small { font-size: 9px; }
  .card .badge svg { width: 10px; height: 12px; }
  .tool > .badge { border-radius: 16px 0 12px 0; }
  .cards + .or { margin-top: 20px; }
  .frank-day { order: 3; width: 100%; margin-top: 4px; }
  .fd-count { font-size: 17px; }
  .fd-what { font-size: 15px; padding: 7px 16px; }

  /* /lists/ pages */
  main.sub { padding-top: 12px; }
  .list-head { margin-top: 14px; gap: 8px; }
  .list-head .list-title { font-size: 19px; }
  .list-head-actions { gap: 2px; }
  .icon-btn { min-width: 48px; font-size: 12px; padding: 4px 2px; }
  .icon-btn img { width: 24px; height: 24px; }

  /* create page feels like an app: tabs pinned to the bottom of the screen */
  .create-layout { display: block; }
  .side { display: none; }
  body[data-page="lists-create"] .back { display: inline-block; }
  body[data-page="lists-create"] .list-add { margin-left: 0; }
  body[data-page="lists-create"] .list-head { margin-top: 14px; }
  body[data-page="lists-create"] .list-head .list-title { font-size: 19px; }
  body[data-page="lists-create"] .list-count { font-size: 14px; }
  body[data-page="lists-create"] .icon-btn { min-width: 48px; font-size: 12px; }
  body[data-page="lists-create"] .icon-btn img { height: 24px; }
  body[data-page="lists-create"] .list-head-actions { gap: 2px; }
  body[data-page="lists-create"] .list-items { min-height: 0; border-top: none; border-bottom: none; }
  body[data-page="lists-create"] { padding-bottom: 96px; }
  body[data-page="lists-create"] .tools-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; width: auto; max-width: none; margin: 0;
    background: var(--page); border-radius: 0; padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    gap: 6px; box-shadow: 0 -1px 0 rgba(0,0,0,.06);
  }
  body[data-page="lists-create"] .tool-tab { position: relative; height: 56px; font-size: 20px; gap: 10px; border-radius: 16px; padding: 0 6px; }
  body[data-page="lists-create"] .tool-tab > svg { width: 28px; height: 28px; }
  body[data-page="lists-create"] .tool-tab.active { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  body[data-page="lists-create"] .tool-tab .tab-badge { position: absolute; top: 3px; right: 4px; margin: 0; padding: 2px 5px; font-size: 9px; }
  body[data-page="lists-create"] .tool-tab .tab-badge svg { width: 8px; height: 9px; }
  body[data-page="lists-create"] .list-hint { display: none; }
  body[data-page="lists-create"] main.sub { min-height: calc(100dvh - 190px); }
  body[data-page="lists-create"] .editor { margin-top: 22px; }
  body[data-page="lists-create"] .list-items { margin-top: 12px; }
  body[data-page="lists-create"] .list-empty { padding: 40px 8px; }
  main.sub h1 { font-size: 28px; }
  .tools-bar { width: 100%; }
  .tool-tab { flex: 1; justify-content: center; padding: 0 8px; }
  .tool { padding: 14px; border-radius: 16px; }
  .view-actions .btn { flex: 1 1 auto; }
  .mylists .ml-title { font-size: 18px; }
}
