/* Hallmark: Stocklenz | store workbench | original charcoal, cream and lime */
/* Critique: keep a high-contrast action beside each store task. */
:root {
  color-scheme: dark;
  --paper: #111410;
  --side: #181d15;
  --surface: #1b2018;
  --pale: #242b20;
  --input: #141812;
  --line: #3b4534;
  --line-soft: #2f392a;
  --line-bold: #697661;
  --ink: #f4f1e7;
  --muted: #aeb3a4;
  --quiet: #a4ab9a;
  --soft-ink: #dce0d2;
  --lime: #c9ec83;
  --lime-bright: #e7f7c1;
  --accent-ink: #202915;
  --sage: #a9c77a;
  --selected: #303c24;
  --profit-surface: #263021;
  --gold: #e3b387;
  --gold-bg: #423327;
  --red: #f0a99d;
  --red-bg: #422d28;
  --ghost: transparent;
  --overlay: rgb(6 9 5 / .72);
  --overlay-grad: linear-gradient(180deg, rgb(8 11 7 / .03) 24%, rgb(8 11 7 / .15) 53%, rgb(8 11 7 / .88) 100%);
  --shadow: 0 14px 39px rgb(8 11 7 / .46);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --round: 18px;
  --space: clamp(20px,3vw,48px);
}

*,*::before,*::after {
  box-sizing:border-box;
}

html,body {
  overflow-x:clip;
}

html {
  scroll-padding-bottom:90px;
}

body {
  margin:0;
  min-height:100dvh;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--font);
  font-size:16px;
  line-height:1.5;
}

img,video {
  max-width:100%;
  display:block;
}

h1,h2,h3,p {
  margin:0;
}

h1,h2,h3 {
  min-width:0;
  overflow-wrap:break-word;
  font-weight:640;
  letter-spacing:-.046em;
  line-height:1.12;
}

h1 {
  font-size:clamp(2.1rem,3.7vw,3.5rem);
}

h2 {
  font-size:clamp(1.38rem,2vw,1.8rem);
}

h3 {
  font-size:1.09rem;
  letter-spacing:-.025em;
}

button,a,input,select,textarea {
  font:inherit;
}

button,a {
  -webkit-tap-highlight-color:var(--ghost);
}

button {
  cursor:pointer;
}

button {
  color:inherit;
}

button:disabled {
  cursor:wait;
  color:var(--muted);
  background:var(--pale);
  border-color:var(--line);
}

a {
  color:inherit;
  text-decoration:none;
}

button,input,textarea,select {
  border-radius:9px;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,video:focus-visible {
  outline:3px solid var(--lime);
  outline-offset:3px;
}

::selection { color:var(--accent-ink); background:var(--lime); }

.dark :focus-visible {
  outline-color:var(--lime);
}

.skip {
  position:fixed;
  z-index:100;
  left:12px;
  top:8px;
  transform:translateY(-170%);
  background:var(--surface);
  padding:12px 16px;
}

.skip:focus {
  transform:none;
}

.sr-only,.visually-hidden {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip-path:inset(50%);
  white-space:nowrap;
  border:0;
}

[hidden] {
  display:none!important;
}

svg {
  flex:none;
  vertical-align:middle;
}

input,select,textarea {
  color:var(--ink);
  background:var(--input);
  width:100%;
  min-width:0;
  border:1px solid var(--line-bold);
  padding:12px 16px;
  min-height:48px;
  line-height:1.35;
}

input::placeholder,textarea::placeholder {
  color:var(--quiet);
}

textarea {
  resize:vertical;
  min-height:86px;
}

input[type=file] {
  font-size:.9rem;
  padding:12px;
}

fieldset {
  min-width:0;
  border:0;
  padding:0;
  margin:0;
}

label.field,.field {
  display:grid;
  gap:8px;
  min-width:0;
  font-size:.92rem;
  font-weight:600;
}

label.field small,.field small,.hint {
  font-weight:400;
  color:var(--muted);
  font-size:.86rem;
  line-height:1.45;
}

.form-stack {
  display:grid;
  gap:16px;
}

.form-pair {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
}

.form-error {
  color:var(--red);
  background:var(--red-bg);
  border-radius:9px;
  padding:12px 12px;
  font-size:.92rem;
}

.form-error:empty {
  display:none;
}

.brand {
  display:inline-flex;
  gap:12px;
  align-items:center;
  font-size:1.48rem;
  font-weight:700;
  letter-spacing:-.065em;
  line-height:1;
}

.brand img {
  width:37px;
  height:37px;
  border-radius:11px;
}

.btn,.button,.icon-btn,.nav-link,.text-btn,.filter-pill,.pick,.mini-link,.row-action,.photo-tile,.tool {
  border:0;
  background:var(--ghost);
}

.btn,.button,.icon-btn,.text-btn,.mini-link,.filter-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  font-size:.94rem;
  font-weight:610;
}

.btn,.button {
  padding:12px 16px;
  border-radius:11px;
  border:1px solid var(--line-bold);
  background:var(--surface);
}

.btn.primary,.button.primary,.primary-btn {
  background:var(--lime);
  color:var(--accent-ink);
  border-color:var(--lime);
}

.btn.lime {
  background:var(--lime);
  color:var(--accent-ink);
  border-color:var(--lime);
}

.btn.subtle,.button.secondary {
  background:var(--pale);
  border-color:var(--pale);
}

.btn:hover,.button:hover,.pick:hover,.tool:hover,.photo-tile:hover .thumb {
  border-color:var(--lime);
}

.btn.primary:hover {
  background:var(--lime-bright);
}

.btn.full {
  width:100%;
}

.icon-btn {
  width:44px;
  height:44px;
  border-radius:12px;
}

.icon-btn:hover,.text-btn:hover,.mini-link:hover,.nav-link:hover,.row-action:hover {
  background:var(--pale);
}

.text-btn,.mini-link {
  padding:8px 12px;
  color:var(--lime);
}

.mini-link {
  font-size:.875rem;
  white-space:nowrap;
}

.danger {
  color:var(--red);
}

.boot {
  min-height:100dvh;
  display:grid;
  align-content:center;
  justify-items:center;
  gap:16px;
  color:var(--muted);
}

.boot img,.boot video {
  border-radius:18px;
}

.auth-page {
  max-width:1512px;
  margin:0 auto;
  min-height:100dvh;
  padding:0 clamp(20px,3.4vw,56px) 28px;
}

.auth-top {
  height:82px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.language {
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  padding:0 12px;
  background:var(--surface);
  border-radius:30px;
}

.language select {
  font-size:.9rem;
  padding:0 4px;
  background:var(--ghost);
  width:auto;
  border:0;
  min-height:40px;
}

.auth-grid {
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  gap:clamp(32px,7vw,100px);
  align-items:stretch;
  min-height:min(705px,calc(100dvh - 110px));
}

.auth-visual {
  background:var(--side);
  border-radius:26px;
  position:relative;
  overflow:hidden;
  min-height:530px;
  margin:0;
  color:var(--ink);
}

.auth-visual img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:52% 48%;
}

.auth-visual::after {
  content:"";
  position:absolute;
  inset:0;
  background:var(--overlay-grad);
}

.auth-caption {
  position:absolute;
  z-index:1;
  left:clamp(25px,3.3vw,55px);
  bottom:clamp(28px,3.3vw,48px);
  max-width:85%;
  font-size:clamp(2rem,3.9vw,4.05rem);
  font-weight:580;
  line-height:1.02;
  letter-spacing:-.065em;
  text-wrap:balance;
}

.auth-side {
  display:grid;
  align-content:center;
  max-width:465px;
  width:100%;
  padding:28px 16px 36px 0;
}

.auth-heading {
  margin-bottom:24px;
}

.auth-heading h1 {
  font-size:clamp(2.2rem,3.9vw,3.9rem);
  letter-spacing:-.065em;
}

.auth-heading p {
  margin-top:12px;
  color:var(--muted);
  max-width:36ch;
}

.mode-switch,.segmented {
  display:flex;
  gap:4px;
  background:var(--pale);
  padding:4px;
  border-radius:12px;
}

.mode-switch {
  margin-bottom:24px;
}

.mode-switch button,.segmented button {
  flex:1;
  border:0;
  background:var(--ghost);
  border-radius:9px;
  padding:8px 12px;
  min-height:39px;
  font-size:.94rem;
  font-weight:590;
}

.mode-switch button[aria-pressed=true],.segmented button[aria-pressed=true] {
  background:var(--selected);
  color:var(--lime);
  box-shadow:0 1px 3px var(--line);
}

.password-wrap {
  position:relative;
  display:flex;
}

.password-wrap input {
  padding-right:52px;
}

.password-wrap button {
  position:absolute;
  top:2px;
  right:3px;
}

.shell {
  max-width:1800px;
  margin:auto;
  display:grid;
  grid-template-columns:232px minmax(0,1fr);
  min-height:100dvh;
}

.side-nav {
  position:sticky;
  top:0;
  height:100dvh;
  background:var(--side);
  border-right:1px solid var(--line);
  padding:28px 16px 20px;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.side-nav .brand {
  padding:0 12px;
}

.nav-list {
  display:grid;
  gap:4px;
  margin-top:48px;
}

.side-group {
  display:grid;
  gap:4px;
  border-top:1px solid var(--line);
  margin-top:20px;
  padding-top:20px;
}

.nav-link {
  display:flex;
  gap:12px;
  align-items:center;
  color:var(--muted);
  padding:12px 16px;
  min-height:45px;
  border-radius:10px;
  font-weight:550;
  font-size:.95rem;
  white-space:nowrap;
  text-align:left;
}

.nav-link[aria-current=page] {
  background:var(--selected);
  color:var(--lime-bright);
  font-weight:680;
}

.nav-foot {
  margin-top:auto;
  padding-top:24px;
}

.store-mini {
  display:flex;
  gap:12px;
  align-items:center;
  width:100%;
  text-align:left;
  border:0;
  border-top:1px solid var(--line);
  background:var(--ghost);
  padding:20px 8px 0;
  min-height:52px;
}

.initial {
  display:grid;
  place-items:center;
  flex:none;
  width:40px;
  height:40px;
  border-radius:50%;
  font-size:1rem;
  font-weight:700;
  background:var(--selected);
  color:var(--lime);
}

.store-meta {
  min-width:0;
}

.store-meta strong,.store-meta small {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.store-meta small {
  font-size:.8rem;
  color:var(--muted);
}

.main-zone {
  min-width:0;
}

.top-bar {
  min-height:77px;
  border-bottom:1px solid var(--line);
  padding:12px var(--space);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.crumb {
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  font-size:.88rem;
  color:var(--muted);
}

.crumb strong {
  color:var(--ink);
  font-weight:620;
}

.crumb span,.crumb strong {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.toolbar {
  display:flex;
  gap:8px;
  align-items:center;
}

.top-bar .brand {
  display:none;
}

.view {
  max-width:1350px;
  margin:auto;
  padding:32px var(--space) 60px;
  min-width:0;
}

.view:focus {
  outline:0;
}

.page-head,.section-head,.line-head,.sheet-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.page-head {
  margin-bottom:24px;
}

.page-head p,.section-head p,.muted {
  color:var(--muted);
}

.page-head p {
  margin-top:8px;
}

.date-label {
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--muted);
  font-size:.9rem;
}

.card,.panel {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--round);
  padding:clamp(20px,2vw,28px);
  min-width:0;
}

.dash-top {
  display:grid;
  grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);
  gap:20px;
}

.profit {
  position:relative;
  overflow:hidden;
  background:var(--profit-surface);
  border:1px solid var(--line);
  color:var(--ink);
  border-radius:var(--round);
  padding:clamp(24px,2.5vw,36px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:24px;
}

.profit .line-head {
  align-items:flex-start;
}

.profit h2 {
  font-size:1.1rem;
  letter-spacing:-.02em;
}

.profit-val {
  font-size:clamp(2.25rem,4.6vw,4.4rem);
  line-height:1.05;
  letter-spacing:-.065em;
  font-weight:590;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}

.profit-val small {
  font-size:.34em;
  letter-spacing:-.035em;
  vertical-align:baseline;
  padding-right:4px;
}

.profit-meta {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
}

.profit-note {
  color:var(--soft-ink);
  font-size:.88rem;
}

.profit-graph {
  width:43%;
  height:50px;
  color:var(--lime);
  flex-shrink:1;
}

.mini-stats {
  display:grid;
  align-content:stretch;
  padding:0 24px;
}

.mini-stat {
  display:flex;
  gap:16px;
  align-items:center;
  padding:16px 0;
  border-bottom:1px solid var(--line);
}

.mini-stat:last-child {
  border:0;
}

.stat-icon,.row-icon {
  display:grid;
  place-items:center;
  flex:none;
  width:42px;
  height:42px;
  border-radius:12px;
  background:var(--pale);
  color:var(--lime);
}

.stat-data {
  display:grid;
  gap:2px;
}

.stat-data small,.row-meta,.item-count,.meta {
  color:var(--muted);
  font-size:.88rem;
}

.stat-data strong,.row-value {
  font-weight:650;
  font-variant-numeric:tabular-nums;
}

.stat-data strong {
  font-size:1.22rem;
  letter-spacing:-.03em;
}

.section {
  margin-top:28px;
  min-width:0;
}

.section-head {
  margin-bottom:16px;
}

.section-head h2,.card-head h2 {
  font-size:1.4rem;
}

.quick-tools {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}

.tool {
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-start;
  min-width:0;
  text-align:left;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  font-weight:610;
}

.tool>svg:last-child {
  margin-left:auto;
  color:var(--muted);
}

.tool .row-icon {
  width:35px;
  height:35px;
  border-radius:9px;
}

.badge {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:30px;
  background:var(--pale);
  color:var(--lime);
  padding:4px 8px;
  font-size:.76rem;
  font-weight:620;
}

.badge.warn {
  background:var(--gold-bg);
  color:var(--gold);
}

.badge.empty-stock {
  background:var(--red-bg);
  color:var(--red);
}

.entry-list {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--round);
  overflow:hidden;
}

.entry-row {
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  min-width:0;
}

.entry-row:last-child {
  border-bottom:0;
}

.entry-row .grow {
  min-width:0;
  flex:1;
}

.grow strong {
  overflow-wrap:anywhere;
}

.row-meta {
  display:block;
  font-weight:400;
}

.entry-row .row-value {
  text-align:right;
  max-width:42%;
  overflow-wrap:anywhere;
}

.row-value.money-in { color:var(--sage); }
.row-value.money-out { color:var(--gold); }

.row-icon.sale,.row-icon.income {
  background:var(--selected);
}

.row-icon.purchase,.row-icon.expense {
  background:var(--gold-bg);
  color:var(--gold);
}

.entry-row.clickable {
  width:100%;
  background:var(--surface);
  text-align:left;
  border:0;
  border-radius:0;
  border-bottom:1px solid var(--line);
}

.entry-row.clickable:hover {
  background:var(--pale);
}

.empty-state {
  border:1px dashed var(--line-bold);
  border-radius:var(--round);
  padding:clamp(28px,4vw,48px) 20px;
  background:var(--surface);
  display:grid;
  justify-items:center;
  gap:8px;
  text-align:center;
}

.empty-state .row-icon {
  margin-bottom:4px;
}

.empty-state p {
  color:var(--muted);
  max-width:43ch;
  font-size:.94rem;
}

.empty-state .btn {
  margin-top:4px;
}

.bottom-nav {
  display:none;
}

.filter-bar {
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:20px;
}

.search-field {
  display:flex;
  align-items:center;
  position:relative;
  flex:1;
  min-width:160px;
}

.search-field svg {
  position:absolute;
  left:13px;
  color:var(--muted);
}

.search-field input {
  padding-left:44px;
}

.filter-pill {
  padding:8px 12px;
  border:1px solid var(--line-bold);
  border-radius:30px;
  background:var(--surface);
  white-space:nowrap;
}

.filter-pill[aria-pressed=true] {
  background:var(--lime);
  border-color:var(--lime);
  color:var(--accent-ink);
}

.chips {
  display:flex;
  gap:8px;
  align-items:center;
  overflow:auto;
  max-width:100%;
}

.chips .filter-pill {
  min-height:39px;
  font-size:.85rem;
}

.photo-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(min(168px,100%),1fr));
  gap:20px 16px;
}

.photo-tile {
  text-align:left;
  padding:0;
  min-width:0;
  border-radius:12px;
  align-self:start;
}

.thumb {
  aspect-ratio:1.28;
  border:1px solid var(--line);
  border-radius:13px;
  overflow:hidden;
  display:grid;
  place-items:center;
  background:var(--pale);
  position:relative;
}

.thumb>img {
  width:100%;
  height:100%;
  object-fit:cover;
}

.thumb .badge {
  position:absolute;
  bottom:8px;
  left:8px;
}

.photo-tile h3 {
  margin-top:12px;
  line-height:1.3;
  overflow-wrap:anywhere;
}

.placeholder {
  display:grid;
  place-items:center;
  width:43%;
  aspect-ratio:1;
  border:1px solid var(--line-bold);
  border-radius:30%;
  color:var(--lime);
  background:var(--surface);
}

.placeholder svg {
  width:50%;
  height:50%;
  stroke-width:1.2;
}

.photo-tile .item-count {
  display:block;
  margin-top:4px;
}

.metrics-row {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-bottom:20px;
}

.metrics-row .stat-data {
  gap:4px;
}

.metrics-row .stat-data strong {
  font-size:1.5rem;
}

.menu-list {
  display:grid;
  gap:0;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
}

.row-action {
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 20px;
  border:0;
  border-bottom:1px solid var(--line);
  background:var(--surface);
  border-radius:0;
  text-align:left;
  min-width:0;
  width:100%;
  min-height:58px;
}

.row-action:last-child {
  border-bottom:0;
}

.row-action>svg:last-child,.row-action>.trailing {
  margin-left:auto;
}

.row-action .row-meta {
  margin-top:2px;
}

.profile-panel {
  display:flex;
  gap:16px;
  align-items:center;
  margin-bottom:20px;
}

.profile-panel .initial {
  width:50px;
  height:50px;
  font-size:1.35rem;
}

.profile-panel p {
  color:var(--muted);
  overflow-wrap:anywhere;
}

.settings-grid {
  display:grid;
  max-width:850px;
  gap:20px;
}

.settings-grid h2 {
  font-size:1.2rem;
  margin-bottom:12px;
}

dialog {
  color:var(--ink);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:20px;
  padding:0;
  max-width:min(540px,calc(100% - 28px));
  width:100%;
  max-height:90dvh;
  box-shadow:var(--shadow);
}

dialog::backdrop {
  background:var(--overlay);
}

dialog[open] {
  display:flex;
  flex-direction:column;
}

body:has(dialog[open]) {
  overflow-y:hidden;
}

.sheet-head {
  padding:20px 20px 12px;
  border-bottom:1px solid var(--line);
}

.sheet-head h2 {
  font-size:1.5rem;
}

.sheet-body {
  padding:20px 24px 24px;
  overflow:auto;
  overscroll-behavior:contain;
}

.sheet-actions,.button-row {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.sheet-actions {
  justify-content:flex-end;
  margin-top:4px;
}

.sheet-actions .grow {
  flex:1;
}

.notice,.trade-preview {
  padding:12px 16px;
  border-radius:11px;
  background:var(--pale);
  font-size:.92rem;
  color:var(--soft-ink);
}

.notice.warn {
  background:var(--gold-bg);
  color:var(--gold);
}

.trade-preview {
  display:grid;
  gap:4px;
}

.trade-preview .line-head span {
  color:var(--muted);
}

.trade-preview strong {
  font-variant-numeric:tabular-nums;
}

.item-detail {
  display:grid;
  grid-template-columns:100px minmax(0,1fr);
  gap:20px;
  align-items:center;
  margin-bottom:20px;
}

.item-detail .thumb {
  aspect-ratio:1;
}

.item-detail h3 {
  font-size:1.35rem;
}

.item-detail .item-count {
  margin-top:4px;
}

.detail-actions {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.detail-info {
  display:grid;
  gap:8px;
  margin:20px 0;
}

.detail-info>div {
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:.93rem;
}

.detail-info dt {
  color:var(--muted);
}

.detail-info dd {
  margin:0;
  font-weight:600;
}

.preview-wrap {
  border:1px dashed var(--line-bold);
  border-radius:12px;
  padding:12px;
  display:flex;
  align-items:center;
  gap:16px;
}

.preview-wrap>img,.preview-wrap>.row-icon {
  width:60px;
  height:60px;
  object-fit:cover;
  border-radius:10px;
}

.preview-wrap .button-row {
  flex:1;
}

.upload-label {
  cursor:pointer;
  position:relative;
}

.upload-label:focus-within {
  outline:3px solid var(--lime);
}

.upload-label input {
  position:absolute;
  width:1px;
  height:1px;
  min-height:1px;
  opacity:0;
  padding:0;
  border:0;
  left:50%;
  top:50%;
}

.voice-zone {
  border-top:1px solid var(--line);
  padding-top:12px;
}

.voice-zone summary {
  cursor:pointer;
  font-weight:600;
  padding:8px 0;
}

.voice-input {
  display:grid;
  gap:8px;
  margin-top:8px;
}

.ledger-detail .detail-info {
  margin-top:0;
}

.skeleton-status {
  display:flex;
  align-items:center;
  gap:12px;
}

.skeleton-status img {
  width:34px;
  height:34px;
  border-radius:8px;
}

.mobile-only {
  display:none;
}

.empty-link {
  color:var(--lime);
  font-weight:650;
}

.table-wrap {
  overflow-x:auto;
}

table {
  width:100%;
  border-collapse:collapse;
}

td,th {
  text-align:left;
  padding:12px;
  border-bottom:1px solid var(--line);
  font-size:.9rem;
}

#toast {
  position:fixed;
  z-index:30;
  left:50%;
  bottom:24px;
  transform:translateX(-50%);
  padding:12px 20px;
  color:var(--accent-ink);
  background:var(--lime-bright);
  border-radius:12px;
  box-shadow:var(--shadow);
  max-width:min(460px,calc(100% - 28px));
  width:max-content;
  font-size:.93rem;
}

#toast:empty {
  display:none;
}

@media(min-width:1600px) {
  .shell {
    border-inline:1px solid var(--line);
  }

}

@media(max-width:1080px) {
  .shell {
    grid-template-columns:198px minmax(0,1fr);
  }

  .side-nav {
    padding-inline:12px;
  }

  .tool {
    gap:8px;
    padding:12px;
  }

  .tool>svg:last-child {
    display:none;
  }

  .dash-top {
    grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);
  }

}

@media(max-width:800px) {
  .shell {
    display:block;
  }

  .side-nav {
    display:none;
  }

  .top-bar {
    padding:12px var(--space);
    min-height:66px;
    background:var(--surface);
  }

  .top-bar .brand {
    display:inline-flex;
  }

  .top-bar .brand img {
    width:32px;
    height:32px;
  }

  .top-bar .crumb {
    display:none;
  }

  .bottom-nav {
    position:fixed;
    z-index:4;
    bottom:0;
    left:0;
    right:0;
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    background:var(--surface);
    border-top:1px solid var(--line);
    padding:4px 4px max(8px,env(safe-area-inset-bottom));
    min-height:65px;
  }

  .bottom-nav .nav-link {
    display:flex;
    flex-direction:column;
    justify-content:center;
    gap:4px;
    padding:4px 1px;
    min-height:49px;
    font-size:.69rem;
    border-radius:9px;
  }

  .bottom-nav .nav-link[aria-current=page] {
    background:var(--selected);
  }

  .view {
    padding-bottom:100px;
  }

  .mobile-only {
    display:block;
  }

  .desktop-only {
    display:none;
  }

  #toast {
    bottom:calc(78px + env(safe-area-inset-bottom));
  }

  .auth-grid {
    gap:32px;
    grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);
  }

  .auth-side {
    padding-right:0;
  }

  .auth-visual {
    min-height:500px;
  }

}

@media(max-width:620px) {
  .auth-page {
    padding:0 20px 32px;
    max-width:500px;
  }

  .auth-top {
    height:66px;
  }

  .auth-grid {
    display:flex;
    flex-direction:column;
    min-height:0;
    gap:20px;
  }

  .auth-visual {
    order:0;
    min-height:0;
    height:clamp(120px,25vh,188px);
    border-radius:16px;
  }

  .auth-visual img {
    object-position:50% 40%;
  }

  .auth-caption {
    font-size:1.75rem;
    left:17px;
    bottom:14px;
    max-width:67%;
    text-align:left;
  }

  .auth-side {
    padding:0;
    max-width:none;
  }

  .auth-heading {
    margin-bottom:16px;
  }

  .auth-heading h1 {
    font-size:2.3rem;
  }

  .auth-heading p {
    margin-top:4px;
  }

  .mode-switch {
    margin-bottom:16px;
  }

  .auth-page .form-stack {
    gap:16px;
  }

  .brand {
    font-size:1.29rem;
    gap:8px;
  }

  .brand img {
    width:31px;
    height:31px;
  }

  .view {
    padding-top:24px;
  }

  .page-head {
    align-items:flex-start;
    margin-bottom:20px;
  }

  .page-head p {
    font-size:.9rem;
  }

  .date-label {
    font-size:.82rem;
  }

  .page-head .date-label {
    display:none;
  }

  .dash-top {
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  .profit {
    gap:24px;
    min-height:185px;
  }

  .profit-val {
    font-size:2.85rem;
  }

  .mini-stats {
    grid-template-columns:repeat(3,minmax(0,1fr));
    padding:12px;
    gap:8px;
  }

  .mini-stat {
    display:grid;
    align-content:start;
    gap:8px;
    border:0;
    padding:4px 4px;
  }

  .mini-stat .stat-icon {
    width:28px;
    height:28px;
    border-radius:8px;
  }

  .mini-stat .stat-icon svg {
    width:16px;
    height:16px;
  }

  .stat-data small {
    font-size:.78rem;
  }

  .mini-stat .stat-data strong {
    font-size:.95rem;
    overflow-wrap:anywhere;
  }

  .quick-tools {
    gap:8px;
  }

  .tool {
    padding:12px 8px;
    flex-direction:column;
    align-items:center;
    text-align:center;
    font-size:.84rem;
    line-height:1.25;
  }

  .section {
    margin-top:24px;
  }

  .section-head {
    margin-bottom:12px;
  }

  .section-head h2 {
    font-size:1.24rem;
  }

  .photo-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:16px 12px;
  }

  .entry-row {
    padding:12px 12px;
    gap:8px;
  }

  .row-icon {
    width:36px;
    height:36px;
    border-radius:10px;
  }

  .row-meta {
    font-size:.79rem;
  }

  .row-value {
    font-size:.93rem;
  }

  .entry-row strong {
    font-size:.94rem;
  }

  .sheet-body {
    padding:20px;
  }

  .photo-tile h3 {
    font-size:1.02rem;
  }

  .page-head>.btn {
    padding-inline:12px;
  }

  .filter-bar {
    gap:8px;
  }

  .filter-bar .search-field {
    flex-basis:100%;
  }

  .metrics-row .stat-data strong {
    font-size:1.17rem;
  }

  .meta {
    font-size:.83rem;
  }

  .btn,.button {
    font-size:.9rem;
  }

  .mini-link {
    padding:8px;
  }

  .toolbar {
    gap:2px;
  }

  .form-pair {
    gap:12px;
  }

  dialog {
    width:100%;
    max-width:none;
    max-height:92dvh;
    margin:auto 0 0;
    border-radius:20px 20px 0 0;
    border-bottom:0;
  }

  .sheet-body {
    padding-bottom:max(24px,env(safe-area-inset-bottom));
  }

  .sheet-head {
    padding:12px 16px 8px;
  }

  .sheet-head h2 {
    font-size:1.3rem;
  }

}

@media(max-width:380px) {
  :root {
    --space:15px;
  }

  .auth-page {
    padding-inline:16px;
  }

  .profit-val {
    font-size:2.45rem;
  }

  .stat-data small {
    font-size:.75rem;
  }

  .quick-tools {
    gap:8px;
  }

  .top-bar .brand {
    font-size:1.18rem;
  }

  .photo-grid {
    gap:12px 8px;
  }

  .mini-stat .stat-data strong {
    font-size:.86rem;
  }

  .form-pair {
    grid-template-columns:1fr;
  }

  .row-action {
    padding-inline:12px;
  }

  .entry-row .row-value {
    max-width:38%;
  }

}

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

}

button:active:not(:disabled),a.nav-link:active,.btn:active {
  transform:translateY(1px);
}

h1,h2 {
  text-wrap:balance;
}

.stat-data,.row-meta,.item-count {
  font-variant-numeric:tabular-nums;
}
.bottom-nav .nav-link[aria-current="location"] {
  color: var(--lime-bright);
  background: var(--selected);
}

.auth-wordmark {
  display: block;
  inline-size: clamp(9rem, 17vw, 12rem);
  block-size: auto;
}
@media (max-width: 38rem) {
  .auth-wordmark { inline-size: clamp(8.7rem, 39vw, 10rem); }
}
