/* Crossly on your phone (/phone/): the site's Ink & Citrus look (style.css) at phone size.
   Text inputs are 16px so iPhones don't zoom in on them. */

body.phone { min-height: 100vh; min-height: 100dvh; }
.sprite { position: absolute; }
.ic { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* The site's .btn font shorthand doesn't apply to buttons, so it's spelt out here */
.phone .btn, .phone .link-btn { font-family: inherit; font-size: 16px; font-weight: 650; line-height: 1; }
.phone .btn.big { font-size: 17px; }
.phone .btn[disabled] { cursor: default; }
.link-btn { border: 0; background: none; color: var(--accent-text); padding: 10px 4px; min-height: 44px; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.phone .link-btn { font-size: 15px; font-weight: 600; }
.link-btn[disabled] { opacity: .5; cursor: default; }

/* ---------- bar and screens ---------- */
.app-bar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); border-bottom: 1px solid var(--line);
}
.app-bar .brand { font-size: 20px; }
.app-bar .brand img { width: 28px; height: 28px; border-radius: 7px; }
.app {
  max-width: 560px; margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.screen h1 { font-size: 32px; letter-spacing: -.04em; margin-bottom: 10px; }
.screen h2 { font-size: 20px; letter-spacing: -.025em; }
.lead { color: var(--muted); font-size: 16.5px; margin-bottom: 22px; }
.stack { display: grid; gap: 10px; margin-bottom: 10px; }
.screen > .small { margin-top: 18px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 340px) { .two { grid-template-columns: 1fr; } }

/* ---------- home ---------- */
.new-item { gap: 10px; min-height: 64px; font-size: 19px; }
.new-item .ic { width: 22px; height: 22px; stroke-width: 2.6; }
#homeMsg:not(:empty) { margin-top: 10px; }
#homeMsg:focus { outline: none; }
#draftsMsg:not(:empty) { margin-bottom: 8px; }
.drafts-space { margin-top: 12px; }
#computerNote { margin-top: 12px; }
/* A warning in a box: no signal, an inventory over a day old, no computer connected */
.note { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid currentColor; background: var(--warn-soft); color: var(--warn); font-size: 14.5px; font-weight: 600; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 8px; }
.drafts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.draft { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 6px 10px 10px;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel); }
.draft .thumb { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--bg-2); border: 1px solid var(--line); display: block; }
.draft-text { display: grid; gap: 2px; min-width: 0; }
.draft-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.draft.unfinished .draft-text span { color: var(--warn); }
/* Goes in a few days unless the computer collects it */
.draft.expiring .draft-text span { color: var(--warn); }
#inactiveMsg:not(:empty) { margin-top: 12px; }
.signed-in { margin-top: 26px; text-align: center; overflow-wrap: anywhere; }

/* ---------- new item ---------- */
.editor-head { display: flex; align-items: center; gap: 8px; margin: -6px 0 12px -4px; }
.editor-head h1 { margin: 0; font-size: 28px; }
.panel { padding: 16px; border-radius: 16px; border: 1.5px solid var(--line-strong); background: var(--panel); margin-bottom: 14px; }
.panel h2 { margin-bottom: 12px; }
.panel h2 .small { font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif; font-weight: 500; letter-spacing: 0; }
.panel .two .btn { gap: 8px; padding: 0 10px; font-size: 15px; white-space: nowrap; }
#photoMsg { margin-top: 10px; }

.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.tile { position: relative; padding-top: 100%; border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line-strong); background: var(--bg-2); }
.tile img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .cover { position: absolute; left: 6px; bottom: 6px; padding: 4px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  border: 1.5px solid var(--ink); font: 700 11.5px/1 var(--display); }
.tile-btn { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(22,21,15,.72); color: #fff; font: 600 22px/1 system-ui, sans-serif; cursor: pointer; display: grid; place-items: center; }
/* No arrow where there's nowhere to move to, and none of them while uploading */
.tile-btn[disabled] { visibility: hidden; }
.tile-order { position: absolute; right: 4px; bottom: 4px; display: flex; gap: 4px; }
.tile-order .tile-btn { position: static; }
button.tile.add { display: block; padding-top: 100%; width: 100%; border: 1.5px dashed var(--line-strong); background: var(--bg); color: var(--muted); cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; }
button.tile.add > * { position: absolute; left: 50%; transform: translateX(-50%); }
button.tile.add .ic { top: 30%; width: 24px; height: 24px; }
/* The label may wrap: on a small screen, or with big text, "Add photos" was cut off (review 2026-10-20) */
button.tile.add span { top: 58%; left: 4px; right: 4px; transform: none; text-align: center; }
button.tile.add[disabled] { opacity: .5; cursor: default; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.item-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-weight: 650; font-size: 15px; }
.field small { font-weight: 500; font-size: 13px; }
.field small.over { color: var(--warn); }
/* What's wrong with a price, under it (the form's 14px gap brings it up close) */
.field-msg { margin: -8px 0 0; color: var(--err); font-size: 14px; font-weight: 600; }
.phone input[aria-invalid="true"] { border-color: var(--err); }
#editorTitle:focus { outline: none; }
.phone input[type=text], .phone input[type=email], .phone input[type=search], .phone select, .phone textarea {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line-strong);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 16px; line-height: 1.4; margin: 0;
}
.phone input.code { font: 700 24px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3em; text-align: center; }
.phone textarea { padding: 12px 14px; resize: vertical; min-height: 92px; display: block; }
.phone select {
  -webkit-appearance: none; appearance: none; padding-right: 38px;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238f8b80' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center/18px no-repeat;
}
.phone input:focus, .phone select:focus, .phone textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px var(--accent); }
.phone input:not([type=checkbox]):disabled, .phone select:disabled, .phone textarea:disabled { opacity: .6; }

.post-to { border: 0; padding: 0; margin: 4px 0 0; min-width: 0; }
.post-to legend { font-weight: 650; font-size: 15px; padding: 0; margin-bottom: 8px; }
/* Three to a row where they fit, two on a small screen or with big text (review 2026-10-20: at 320 px the
   names ran out of their boxes) */
.tick-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.tick { position: relative; cursor: pointer; min-width: 0; }
.tick.wide { grid-column: 1 / -1; }
.tick input { position: absolute; opacity: 0; pointer-events: none; }
.tick span { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 12px; border-radius: 12px;
  border: 1.5px solid var(--line-strong); background: var(--bg); font-weight: 600; font-size: 15px; }
.tick span::before { content: ""; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); background: var(--panel); flex-shrink: 0; }
.tick input:checked + span { background: var(--accent-soft); border-color: var(--ink); }
.tick input:checked + span::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2316150f' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--ink); }
.tick input:focus-visible + span { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.tick input:disabled + span { opacity: .6; }

.save-box { display: grid; gap: 10px; margin-top: 4px; }
.save-box .discard { justify-self: center; color: var(--muted); }
.upload { display: grid; gap: 8px; }
.meter { height: 12px; border-radius: 99px; border: 1.5px solid var(--line-strong); background: var(--bg-2); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
/* An empty status line takes no room, but stays where screen readers will hear it change */
.phone .form-msg:empty { min-height: 0; }

/* ---------- a question ---------- */
dialog.ask { width: calc(100% - 32px); max-width: 420px; padding: 22px; border-radius: 18px; border: 2px solid var(--ink);
  background: var(--panel); color: var(--text); box-shadow: 6px 6px 0 var(--ink); }
dialog.ask::backdrop { background: rgba(22,21,15,.5); }
dialog.ask h2 { font-size: 22px; margin-bottom: 8px; }
dialog.ask p { color: var(--muted); margin-bottom: 18px; }
/* Signing in again over the editor */
#reauth .stack { margin-bottom: 8px; }
#reauth p.form-msg { margin-bottom: 8px; }
#reauth .link-btn { display: block; margin: 0 auto; }

/* Read by screen readers, not shown */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- tab bar: Add items and Inventory ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px max(12px, calc((100% - 560px) / 2), env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(12px, calc((100% - 560px) / 2), env(safe-area-inset-left));
  background: var(--bg); background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); border-top: 1px solid var(--line);
}
.tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 56px; padding: 6px;
  border-radius: 14px; border: 1.5px solid transparent; background: none; color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 650; line-height: 1;
}
.tabbar .ic { width: 22px; height: 22px; }
.tabbar button[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.tabbar button:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
body.with-tabs .app { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ---------- inventory ---------- */
.inv-head { margin: 0 0 2px; }
.inv-head h1 { margin: 0; }
.inv-when { font-size: 14px; margin-bottom: 10px; }
.inv-when:empty { display: none; }
#invMsg:not(:empty) { margin-bottom: 10px; }
.inv-off p { color: var(--muted); }
.inv-off ol { margin: 12px 0; padding-left: 22px; display: grid; gap: 6px; }
.inv-off p.small { margin-top: 4px; }

/* They wrap onto a second line: in one scrolling row, with no scrollbar, "All" was out of sight on every
   phone (review 2026-10-20) */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 2px 0 4px; }
.filter {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px;
  border: 1.5px solid var(--line-strong); background: var(--panel); color: var(--text); cursor: pointer;
  font-family: inherit; font-size: 14.5px; font-weight: 650; line-height: 1;
}
.filter b { color: var(--muted); font-weight: 700; }
.filter.warn b { color: var(--warn); }
.filter[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.filter[aria-pressed="true"] b { color: var(--accent-ink); }
.filter:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }

.search { position: relative; display: block; margin-bottom: 12px; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.phone .search input { padding-left: 44px; -webkit-appearance: none; appearance: none; }

.inv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.inv-row {
  width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px 10px 10px;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--panel); color: var(--text); text-align: left; cursor: pointer;
  font-family: inherit; font-size: 15px; line-height: 1.35;
}
.inv-row:active { background: var(--accent-soft); }
.inv-row:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.inv-row .thumb, .sheet-head .thumb { display: block; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.inv-row .thumb img, .sheet-head .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-text { display: grid; gap: 5px; min-width: 0; }
.inv-title { font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.inv-line { color: var(--muted); overflow-wrap: anywhere; }
.inv-line .to-post { color: var(--warn); }
.inv-price { align-self: start; padding-top: 1px; font: 750 16px/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.inv-more { margin-top: 12px; }
.inv-empty { margin-top: 6px; }
.inv-note { margin-top: 18px; text-align: center; }

.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 6px; border-radius: 99px; border: 1.5px solid var(--line-strong);
  background: var(--bg-2); color: var(--text); font-size: 12.5px; font-weight: 650; line-height: 1.2;
}
.badge i, .market > i { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--c); }
/* Posting or a draft: outlined, so live ones stand out */
.badge.pending, .badge.draft { background: none; border-style: dashed; color: var(--muted); }
.badge.pending i, .badge.draft i, .market.pending > i, .market.draft > i, .market.off > i { background: none; box-shadow: inset 0 0 0 1.5px var(--c); }
.badge.sold { background: var(--ink); border-color: var(--ink); color: var(--accent); }
:root[data-theme="dark"] .badge.sold { border-color: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.sold { border-color: var(--accent); } }

/* ---------- one item ---------- */
dialog.sheet { max-width: 480px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; }
.sheet-head { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 14px; }
.sheet-head .thumb { width: 72px; height: 72px; border-radius: 12px; }
dialog.sheet .sheet-title h2 { margin: 0 0 4px; font-size: 20px; overflow-wrap: anywhere; }
dialog.sheet .sheet-title p { margin: 0; color: var(--text); font: 700 16px/1.3 var(--display); }
.markets { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.market { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 52px; padding: 8px 12px;
  border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.market-text { display: grid; gap: 2px; min-width: 0; }
.market-text b { font-weight: 650; }
.market .open { font-weight: 650; padding: 10px 4px; }
.market.off { color: var(--muted); }
dialog.sheet .facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0 0 14px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
dialog.sheet > p.small { margin-bottom: 14px; }
