:root {
  color-scheme: light;
  --accent: #e85d2a;
  --accent-dark: #bd3f16;
  --accent-soft: #fff0e9;
  --ink: #25211e;
  --muted: #746c65;
  --line: #e9e3dd;
  --surface: #ffffff;
  --canvas: #f7f5f2;
  --success: #267a50;
  --success-soft: #eaf6ef;
  --warning: #9a5d09;
  --warning-soft: #fff5dc;
  --danger: #bd3131;
  --danger-soft: #fff0ef;
  --shadow: 0 8px 30px rgb(52 37 25 / 7%);
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--accent-dark); }
img { display: block; max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }
::selection { background: #ffd9c8; }

h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: 1.55rem; letter-spacing: -.03em; }
h2 { margin-bottom: .5rem; font-size: 1.3rem; letter-spacing: -.02em; }
h3 { margin-bottom: .5rem; font-size: 1.05rem; }
p { line-height: 1.65; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.tiny { font-size: .75rem; }
.unknown { color: var(--muted); font-style: normal; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.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; }

.app-shell { min-height: 100vh; }
.app-header { position: sticky; z-index: 30; top: 0; padding-top: env(safe-area-inset-top); border-bottom: 1px solid rgb(233 227 221 / 80%); background: rgb(247 245 242 / 94%); backdrop-filter: blur(16px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100%, 780px); min-height: 64px; margin: 0 auto; padding: 10px 18px; }
.brand-button { display: flex; align-items: center; gap: 10px; padding: 0; color: var(--ink); border: 0; background: transparent; cursor: pointer; text-align: left; }
.brand-button strong { display: block; font-size: 1.06rem; }
.brand-button small { display: block; margin-top: 1px; color: var(--muted); font-size: .68rem; }
.brand-mark { display: grid; flex: 0 0 auto; width: 46px; height: 46px; place-items: center; color: white; border-radius: 15px; background: var(--accent); box-shadow: 0 7px 20px rgb(232 93 42 / 20%); font-size: 1.35rem; font-weight: 800; }
.brand-mark.small-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 1.05rem; }
.network-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 5px 9px; color: var(--success); border-radius: 999px; background: var(--success-soft); font-size: .72rem; white-space: nowrap; }
.network-pill::before { width: 7px; height: 7px; content: ""; border-radius: 50%; background: currentColor; }
.network-pill.offline { color: var(--danger); background: var(--danger-soft); }

.main-content { width: min(100%, 780px); margin: 0 auto; padding: 18px 16px calc(104px + env(safe-area-inset-bottom)); }
.view-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 2px 2px 18px; }
.view-heading h1 { margin-bottom: 4px; }
.view-heading p { margin-bottom: 0; color: var(--muted); font-size: .86rem; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 24px 2px 12px; }
.section-heading h2, .section-heading h3 { margin: 0; }
.section-heading:first-child { margin-top: 0; }

.bottom-nav { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, 1fr); width: min(100%, 780px); margin: 0 auto; padding: 8px 10px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgb(255 255 255 / 96%); box-shadow: 0 -8px 30px rgb(52 37 25 / 5%); backdrop-filter: blur(18px); }
.nav-button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 4px; color: var(--muted); border: 0; border-radius: 14px; background: transparent; cursor: pointer; font-size: .69rem; }
.nav-button svg { width: 23px; height: 23px; }
.nav-button[aria-current="page"] { color: var(--accent-dark); background: var(--accent-soft); font-weight: 700; }
.nav-button.add-nav { color: white; }
.nav-button.add-nav .add-circle { display: grid; width: 44px; height: 44px; margin-top: -23px; place-items: center; border: 4px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 5px 16px rgb(232 93 42 / 30%); }
.nav-button.add-nav .add-circle svg { width: 24px; height: 24px; }
.nav-button.add-nav[aria-current="page"] { color: var(--accent-dark); background: transparent; }

.card { margin-bottom: 14px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-title { margin-bottom: 12px; }
.divider { height: 1px; margin: 16px 0; border: 0; background: var(--line); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 10px 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; font-weight: 650; line-height: 1.25; text-align: center; text-decoration: none; }
.button svg { width: 19px; height: 19px; }
.button.primary { color: white; border-color: var(--accent); background: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); }
.button.secondary { color: var(--accent-dark); border-color: #f6c6b3; background: var(--accent-soft); }
.button.danger { color: var(--danger); border-color: #f0caca; background: var(--danger-soft); }
.button.ghost { border-color: transparent; background: transparent; }
.button.small-button { min-height: 38px; padding: 7px 11px; border-radius: 11px; font-size: .8rem; }
.button.full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row > .button.grow { flex: 1 1 160px; }
.icon-button { display: inline-grid; flex: 0 0 auto; width: 44px; height: 44px; padding: 0; place-items: center; color: var(--ink); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); cursor: pointer; }
.icon-button svg { width: 20px; height: 20px; }
.text-button { min-height: 40px; padding: 4px; color: var(--accent-dark); border: 0; background: transparent; cursor: pointer; font-weight: 650; }
.text-button.danger { color: var(--danger); }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .field > label, .field-label { color: #514a44; font-size: .82rem; font-weight: 650; }
.field small { color: var(--muted); font-size: .74rem; line-height: 1.45; }
.input, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { width: 100%; min-height: 46px; padding: 11px 12px; color: var(--ink); border: 1px solid #ddd5cd; border-radius: 12px; outline: 0; background: #fff; }
textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(232 93 42 / 12%); }
input::placeholder, textarea::placeholder { color: #aaa098; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent); }
.check-label { display: flex; align-items: flex-start; gap: 9px; min-height: 44px; padding: 10px 0; font-size: .85rem; line-height: 1.5; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-section { margin-top: 20px; }
.form-section > h3 { margin-bottom: 12px; }
.form-actions { position: sticky; z-index: 10; bottom: calc(78px + env(safe-area-inset-bottom)); display: flex; gap: 10px; margin: 20px -4px 0; padding: 10px 4px; background: linear-gradient(transparent, var(--canvas) 20%); }
.form-actions .button { flex: 1; }
.search-row { display: flex; gap: 9px; }
.search-row .search-input { position: relative; flex: 1; }
.search-row input { padding-left: 40px !important; }
.search-row .search-icon { position: absolute; top: 13px; left: 13px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }

.filter-panel { margin-top: 12px; }
.filter-panel > summary { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; cursor: pointer; color: var(--accent-dark); font-size: .85rem; font-weight: 700; list-style: none; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filter-panel > summary svg { width: 18px; height: 18px; }
.filter-content { padding-top: 10px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 0; }
.filter-chip, .badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; min-height: 25px; padding: 3px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); font-size: .7rem; font-weight: 650; }
.badge.neutral { color: var(--muted); background: #f1eeea; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }

.timeline-date { margin: 23px 4px 10px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.meal-list { display: flex; flex-direction: column; gap: 11px; }
.meal-card { display: flex; width: 100%; min-height: 132px; padding: 0; overflow: hidden; color: inherit; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 5px 20px rgb(52 37 25 / 5%); cursor: pointer; text-align: left; }
.meal-card:active { transform: scale(.993); }
.meal-thumb { position: relative; flex: 0 0 112px; min-height: 132px; overflow: hidden; background: #eee8e1; }
.meal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.meal-thumb.no-photo { display: grid; place-items: center; color: #a99d91; }
.meal-thumb.no-photo svg { width: 34px; height: 34px; }
.photo-count { position: absolute; right: 7px; bottom: 7px; padding: 3px 7px; color: #fff; border-radius: 999px; background: rgb(0 0 0 / 58%); font-size: .68rem; }
.meal-card-content { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 13px 13px 12px; }
.meal-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.meal-card h3 { margin: 0; overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.meal-amount { flex: 0 0 auto; color: var(--accent-dark); font-size: .92rem; font-weight: 800; }
.meal-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 7px 0; color: var(--muted); font-size: .73rem; }
.meal-review { display: -webkit-box; margin: 0 0 9px; overflow: hidden; color: #5d554e; font-size: .78rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.meal-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.more-button { width: 100%; margin-top: 16px; }
.result-count { margin: 18px 3px 0; color: var(--muted); font-size: .78rem; }

.empty-state { padding: 40px 22px; color: var(--muted); border: 1px dashed #dcd2c9; border-radius: var(--radius); background: rgb(255 255 255 / 50%); text-align: center; }
.empty-state svg { width: 45px; height: 45px; margin: 0 auto 13px; color: #b7aa9e; }
.empty-state h2, .empty-state h3 { color: var(--ink); }
.empty-state p { margin-bottom: 18px; font-size: .86rem; }
.error-state { padding: 18px; color: var(--danger); border: 1px solid #f0caca; border-radius: var(--radius); background: var(--danger-soft); }
.error-state p { margin-bottom: 10px; }
.loading-state { display: grid; min-height: 180px; place-items: center; color: var(--muted); }
.spinner { display: inline-block; width: 24px; height: 24px; border: 3px solid #eadfd6; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { min-height: 130px; margin-bottom: 12px; border-radius: 17px; background: linear-gradient(100deg, #eee9e4 25%, #f8f6f3 45%, #eee9e4 65%); background-size: 250% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -250%; } }

.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 190px; padding: 24px; color: var(--muted); border: 2px dashed #dacbc0; border-radius: var(--radius); background: #fcfaf8; cursor: pointer; text-align: center; }
.upload-zone.dragging { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone svg { width: 42px; height: 42px; margin-bottom: 12px; color: var(--accent); }
.upload-zone strong { margin-bottom: 6px; color: var(--ink); }
.upload-zone p { margin: 0; font-size: .78rem; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.preview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
.preview-item { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.preview-item img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #eee8e1; }
.preview-info { padding: 7px; }
.preview-info p { margin: 0; overflow: hidden; font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.preview-info small { color: var(--muted); font-size: .62rem; }
.preview-remove { position: absolute; top: 5px; right: 5px; display: grid; width: 32px; height: 32px; padding: 0; place-items: center; color: white; border: 0; border-radius: 50%; background: rgb(0 0 0 / 60%); cursor: pointer; }
.preview-remove svg { width: 17px; height: 17px; }
.recognition-card { margin-top: 16px; padding: 18px; border: 1px solid #f0d2c2; border-radius: var(--radius); background: var(--accent-soft); }
.recognition-heading { display: flex; align-items: center; gap: 12px; }
.recognition-heading .spinner { flex: 0 0 auto; }
.recognition-heading h3 { margin: 0 0 4px; }
.recognition-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.recognition-error { margin: 12px 0 0; color: var(--danger); font-size: .8rem; white-space: pre-wrap; }
.manual-create { margin-top: 18px; }
.manual-create > summary { min-height: 44px; cursor: pointer; color: var(--accent-dark); font-weight: 700; }
.manual-create[open] > summary { margin-bottom: 14px; }

.detail-back { margin: -4px 0 12px -8px; }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.detail-title-row h1 { margin-bottom: 7px; overflow-wrap: anywhere; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.recognition-strip { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 15px; padding: 12px; border-radius: 13px; background: #f1eeea; }
.recognition-strip p { margin: 3px 0 0; color: var(--muted); font-size: .75rem; }
.gallery { display: flex; gap: 10px; margin: 0 -16px 18px; padding: 0 16px 8px; overflow-x: auto; scroll-padding: 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.photo-card { position: relative; flex: 0 0 84%; min-height: 250px; padding: 0; overflow: hidden; border: 0; border-radius: 18px; background: #e8e1da; cursor: zoom-in; scroll-snap-align: center; }
.photo-card img { width: 100%; height: 100%; min-height: 250px; max-height: 480px; object-fit: cover; }
.photo-kind { position: absolute; right: 10px; bottom: 10px; padding: 5px 9px; color: white; border-radius: 999px; background: rgb(0 0 0 / 58%); font-size: .72rem; }
.image-fallback { display: grid; min-height: 130px; height: 100%; place-items: center; padding: 20px; color: var(--muted); background: #eee8e1; font-size: .78rem; text-align: center; }
.photo-dialog { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; color: white; border: 0; background: #111; }
.photo-dialog::backdrop { background: #111; }
.viewer-toolbar { position: absolute; z-index: 2; top: 0; right: 0; left: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px; background: linear-gradient(rgb(0 0 0 / 70%), transparent); }
.viewer-toolbar .icon-button, .viewer-toolbar .button { color: white; border-color: rgb(255 255 255 / 25%); background: rgb(0 0 0 / 35%); }
.viewer-count { font-size: .85rem; }
.viewer-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.viewer-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-nav { position: absolute; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); left: 0; display: flex; justify-content: center; gap: 16px; }
.viewer-nav .icon-button { color: white; border-color: rgb(255 255 255 / 25%); background: rgb(0 0 0 / 50%); }

.item-list { display: flex; flex-direction: column; gap: 12px; }
.item-row { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fcfaf8; }
.item-row-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.item-row-header strong { font-size: .85rem; }
.item-row .form-grid { gap: 10px; }
.item-row input { min-height: 42px !important; font-size: .84rem; }
.item-name { grid-column: 1 / -1; }
.danger-zone { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.unsaved-indicator { color: var(--warning); font-size: .75rem; }

.stats-filter { margin-bottom: 16px; }
.preset-row { display: flex; gap: 8px; margin: 12px 0; overflow-x: auto; }
.preset-row .button { flex: 0 0 auto; }
.metrics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.metric-card.wide { grid-column: 1 / -1; }
.metric-label { margin-bottom: 8px; color: var(--muted); font-size: .74rem; }
.metric-value { overflow-wrap: anywhere; font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; }
.metric-note { margin-top: 5px; color: var(--muted); font-size: .67rem; }
.chart-card { margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.chart-card h2 { font-size: 1rem; }
.chart-list { display: flex; flex-direction: column; gap: 13px; margin-top: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(64px, .7fr) minmax(80px, 1.4fr) auto; align-items: center; gap: 10px; font-size: .75rem; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; overflow: hidden; border-radius: 999px; background: #f0ebe6; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar-value { color: var(--muted); text-align: right; white-space: nowrap; }
.chart-note { margin: 8px 0 0; color: var(--muted); font-size: .72rem; }
.donut-layout { display: flex; align-items: center; gap: 22px; margin-top: 18px; }
.donut { display: grid; flex: 0 0 124px; width: 124px; height: 124px; place-items: center; border-radius: 50%; }
.donut-center { display: grid; width: 76px; height: 76px; place-items: center; border-radius: 50%; background: var(--surface); font-size: .75rem; text-align: center; }
.donut-center strong { display: block; font-size: 1.2rem; }
.legend { display: flex; flex: 1; flex-direction: column; gap: 9px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 9px 1fr auto; align-items: center; gap: 8px; font-size: .75rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-row span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings-stack { display: flex; flex-direction: column; gap: 16px; }
.setting-section { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.setting-section > h2 { margin-bottom: 5px; }
.setting-section > p { margin-bottom: 16px; color: var(--muted); font-size: .8rem; }
.setting-section .form-grid { margin: 14px 0; }
.key-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; padding: 11px 12px; border-radius: 12px; background: #f5f2ee; font-size: .8rem; }
.device-list { display: flex; flex-direction: column; gap: 10px; }
.device-card { padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fcfaf8; }
.device-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.device-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.device-name svg { flex: 0 0 auto; width: 22px; height: 22px; color: var(--accent); }
.device-name strong { overflow-wrap: anywhere; }
.device-meta { margin: 8px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.65; }
.device-actions { margin-top: 10px; text-align: right; }
.enroll-form { display: flex; flex-direction: column; gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.enrollment-result { margin-top: 16px; padding: 16px; border: 1px solid #efc6b4; border-radius: 16px; background: var(--accent-soft); }
.qr-wrap { width: min(230px, 75vw); margin: 12px auto; padding: 10px; border-radius: 15px; background: white; }
.qr-wrap img { width: 100%; aspect-ratio: 1; }
.enrollment-link { padding: 10px; overflow-wrap: anywhere; border-radius: 10px; background: rgb(255 255 255 / 65%); font-size: .7rem; line-height: 1.55; }
.expiry { margin: 10px 0; color: var(--warning); font-size: .78rem; font-weight: 700; }
.pwa-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.bind-page { min-height: 100vh; padding: calc(34px + env(safe-area-inset-top)) 20px calc(30px + env(safe-area-inset-bottom)); background: linear-gradient(160deg, #fff7f1, var(--canvas) 48%); }
.bind-container { width: min(100%, 480px); margin: 0 auto; }
.bind-brand { margin-bottom: 32px; text-align: center; }
.bind-brand .brand-mark { width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 21px; font-size: 1.8rem; }
.bind-brand h1 { margin-bottom: 8px; font-size: 1.8rem; }
.bind-brand p { margin: 0; color: var(--muted); font-size: .88rem; }
.bind-card { padding: 22px; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); box-shadow: 0 15px 50px rgb(77 46 26 / 10%); }
.bind-card h2 { font-size: 1.15rem; }
.bind-card > p { color: var(--muted); font-size: .82rem; }
.bind-card .field { margin-bottom: 15px; }
.bind-note { margin: 18px 4px 0; color: var(--muted); font-size: .72rem; text-align: center; }

.boot-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 30px; text-align: center; }
.boot-screen .brand-mark { margin-bottom: 18px; }
.boot-screen h1 { margin-bottom: 7px; }
.boot-screen .spinner { margin-top: 12px; }
.toast { position: fixed; z-index: 100; right: 18px; bottom: calc(92px + env(safe-area-inset-bottom)); left: 18px; width: fit-content; max-width: min(440px, calc(100% - 36px)); margin: auto; padding: 12px 16px; color: white; border-radius: 13px; background: rgb(37 33 30 / 94%); box-shadow: 0 8px 30px rgb(0 0 0 / 20%); opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s, transform .2s; font-size: .82rem; line-height: 1.45; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: rgb(157 38 38 / 96%); }
.noscript { margin: 20px; padding: 20px; color: var(--danger); background: var(--danger-soft); }

@media (min-width: 560px) {
  .main-content { padding-right: 22px; padding-left: 22px; }
  .form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid .span-two { grid-column: 1 / -1; }
  .item-row .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metrics-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-card.wide { grid-column: auto; }
  .metric-card:first-child { grid-column: span 2; }
  .photo-card { flex-basis: 70%; }
  .gallery { margin-right: -22px; margin-left: -22px; padding-right: 22px; padding-left: 22px; }
}

@media (min-width: 900px) {
  .bottom-nav { bottom: 14px; border: 1px solid var(--line); border-radius: 22px; }
  .main-content { padding-bottom: 116px; }
  .form-actions { bottom: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
