/* Gift List styles. Colors: navy ink, teal actions, amber for anything sale-related.
   Sale and bought states always carry a label or icon, never color alone. */
:root {
  --bg: #F3F5F7; --card: #FFFFFF; --ink: #14213D; --muted: #55607A; --line: #DDE2EA; --soft: #E8ECF1;
  --teal: #0F5C5C; --teal-dark: #0A4040; --teal-tint: #E1F0EF;
  --amber: #B45309; --amber-dark: #7A3E00; --amber-tint: #FFE9C7;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 'DM Sans', system-ui, sans-serif; }
.app { max-width: 480px; margin: 0 auto; padding: 28px 16px 48px; display: flex; flex-direction: column; gap: 16px; min-height: 100vh; }
.loading, .empty { text-align: center; color: var(--muted); padding: 40px 12px; }
h1, h2 { font-family: var(--display); margin: 0; line-height: 1.1; }
a { color: var(--teal); } a:hover { color: var(--teal-dark); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1 1 0; min-width: 0; }

/* Buttons */
.btn { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.big { min-height: 56px; border-radius: 16px; font-size: 17px; }
.btn.block { width: 100%; }
.btn.dashed { border: 1.5px dashed var(--muted); background: transparent; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.danger { color: var(--amber-dark); }
.linkbtn { background: none; border: 0; padding: 0; min-height: 44px; color: var(--teal); font-weight: 600; text-decoration: underline; display: inline-flex; align-items: center; gap: 6px; }

/* Entry screen */
.entry { padding-top: 44px; gap: 28px; }
.entry-head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.logo { width: 64px; height: 64px; border-radius: 20px; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; }
.logo .icon { width: 32px; height: 32px; }
.site-title { font-size: 15px; font-weight: 600; color: var(--muted); }
.entry h1 { font-size: 38px; }
.person-btn { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); font-weight: 600; font-size: 17px; text-align: left; width: 100%; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; background: var(--soft); }
.avatar.c0 { background: var(--teal-tint); color: var(--teal); }
.avatar.c1 { background: var(--amber-tint); color: var(--amber-dark); }
.avatar.c2 { background: #E3E8F8; color: #2A3F8F; }
.avatar.c3 { background: #EFE4F5; color: #5B2A7A; }
.avatar.big { width: 52px; height: 52px; font-size: 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--teal-tint); color: var(--teal-dark); font-size: 14px; line-height: 1.4; }
.notice.warn { background: var(--amber-tint); color: var(--amber-dark); }
.notice .icon { margin-top: 1px; }
.entry-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* List screen */
.topbar h1 { font-size: 24px; }
.viewing { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }
.viewing strong { color: var(--ink); }
.tabs { display: flex; gap: 8px; overflow: hidden; }
.tab { min-height: 44px; padding: 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); font-weight: 600; font-size: 15px; white-space: nowrap; flex: none; }
.tab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.picker-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 600; font-size: 17px; width: 100%; text-align: left; }
.picker-btn .hint { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.picker-menu { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 6px; display: flex; flex-direction: column; }
.picker-opt { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 12px; border: 0; border-radius: 10px; background: none; font-size: 16px; font-weight: 500; text-align: left; }
.picker-opt[aria-selected="true"] { background: var(--teal-tint); color: var(--teal-dark); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.item.bought { background: var(--soft); }
.item-top { display: flex; gap: 12px; }
.item-text { display: flex; flex-direction: column; gap: 4px; }
.item-title { font-weight: 600; font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.item.bought .item-title { text-decoration: line-through; color: var(--muted); }
.item-note { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font-family: var(--display); font-weight: 700; font-size: 26px; }
.item.bought .price { font-size: 20px; color: var(--muted); }
.was { font-size: 15px; color: var(--muted); text-decoration: line-through; }
.badge { padding: 2px 8px; border-radius: 6px; background: var(--amber-tint); color: var(--amber-dark); font-size: 13px; font-weight: 600; }
.photo { width: 84px; height: 84px; flex: none; border-radius: 12px; object-fit: cover; background: var(--soft); }
.strip { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.strip .icon { width: 16px; height: 16px; }
.strip.sale { background: var(--amber-tint); color: var(--amber-dark); }
.strip.urgent { background: var(--amber); color: #fff; }
.strip.ended { background: var(--soft); color: var(--muted); }
.strip.bought { background: var(--card); color: var(--teal-dark); padding: 10px 12px; }
.strip.bought .rest { font-weight: 400; color: var(--muted); }
.actions { display: flex; gap: 10px; }
.actions .btn { flex: 1 1 0; }
.actions .btn.primary { flex: 1.4 1 0; }
.edit-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Forms */
label, .label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; }
.field { display: flex; flex-direction: column; gap: 6px; }
input[type=text], input[type=url], input[type=date], input[type=password], select { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-weight: 500; font-size: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.error { color: var(--amber-dark); font-weight: 600; font-size: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 4px; }
.section-head h2 { font-size: 18px; font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--soft); border: 0; }
.pill.c0 { background: var(--teal-tint); color: var(--teal-dark); }
.pill.c1 { background: var(--amber-tint); color: var(--amber-dark); }
.pill.c2 { background: #E3E8F8; color: #2A3F8F; }
.pill.c3 { background: #EFE4F5; color: #5B2A7A; }
button.pill { min-height: 44px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; }
button.pill[aria-pressed="false"] { background: var(--card); color: var(--muted); border: 1px dashed var(--muted); }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 60px; padding: 8px 0; }
.setting-row + .setting-row { border-top: 1px solid var(--line); }
.setting-row .t { font-weight: 600; font-size: 15px; }
.switch { width: 52px; height: 32px; flex: none; border: 0; border-radius: 999px; background: var(--muted); padding: 3px; display: flex; justify-content: flex-start; }
.switch[aria-checked="true"] { background: var(--teal); justify-content: flex-end; }
.switch span { width: 26px; height: 26px; border-radius: 50%; background: #fff; }
.switch-label { font-size: 13px; font-weight: 600; min-width: 26px; text-align: right; }

/* Dialogs */
.overlay { position: fixed; inset: 0; background: rgba(20, 33, 61, .55); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { width: 100%; max-width: 480px; max-height: 94vh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 28px 24px 32px; display: flex; flex-direction: column; gap: 16px; }
.sheet h2 { font-size: 28px; }
.sheet p { margin: 0; }
@media (min-width: 560px) { .overlay { align-items: center; } .sheet { border-radius: 24px; } }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 20; max-width: 90vw; }
.demo-bar { background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.demo-bar button { background: none; border: 0; color: #fff; text-decoration: underline; font-weight: 600; min-height: 32px; }
