/* İlaç Sayım — Prospektüs world. See the contract comment in index.html. */

@font-face { font-family: 'Atkinson Next'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(./fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Next'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(./fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Atkinson Mono'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(./fonts/atkinson-hyperlegible-mono-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Atkinson Mono'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(./fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --paper: oklch(0.99 0.002 100);
  --paper-2: oklch(0.962 0.003 100);
  --paper-3: oklch(0.93 0.004 100);
  --ink: oklch(0.2 0.012 265);
  --ink-2: oklch(0.44 0.012 265);
  --ink-3: oklch(0.6 0.01 265);
  --rule: oklch(0.86 0.005 265);
  --red: oklch(0.5 0.19 25);
  --red-wash: oklch(0.955 0.025 25);
  --green: oklch(0.44 0.1 160);
  --green-wash: oklch(0.955 0.03 160);
  --font: 'Atkinson Next', 'Segoe UI', system-ui, sans-serif;
  --mono: 'Atkinson Mono', ui-monospace, 'Cascadia Mono', monospace;
  --gutter: 16px;
  --tabbar: 64px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
b, strong { font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); font-size: 0.94em; letter-spacing: 0; }
.muted { color: var(--ink-2); }
.red { color: var(--red); }
.fine { font-size: 14px; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 14px; z-index: 50; }
.skip:focus { top: 8px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.i-triangle { width: 0.8em; height: 0.8em; vertical-align: -0.02em; color: var(--red); }

/* ---------- shell ---------- */
.app { min-height: 100dvh; }
.masthead {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 var(--gutter); padding-top: env(safe-area-inset-top);
  background: color-mix(in oklch, var(--paper) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ink);
}
.wordmark { font-weight: 800; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
.user-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; color: var(--ink-2); min-height: 44px; }
.initials { display: grid; place-items: center; width: 30px; height: 30px; border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; font-size: 12px; }
.user-name { display: none; }

.page { display: block; max-width: 760px; margin: 0 auto; padding: 20px var(--gutter) calc(var(--tabbar) + 40px + env(safe-area-inset-bottom)); outline: none; }
.booting { color: var(--ink-2); padding: 40px 0; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--paper); border-top: 2px solid var(--ink);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-size: 12px; font-weight: 600; color: var(--ink-2);
}
.tabbar a .i { width: 24px; height: 24px; }
.tabbar a.on { color: var(--ink); }
.tabbar a.on::before { content: ''; position: absolute; top: -2px; left: 22%; right: 22%; height: 4px; background: var(--ink); }
.tabbar .tab-scan { justify-content: flex-end; padding-bottom: 7px; }
.tabbar .tab-scan .plate {
  position: absolute; top: -18px; display: grid; place-items: center; width: 56px; height: 52px;
  background: var(--ink); color: var(--paper); box-shadow: 0 6px 14px -6px oklch(0.2 0.012 265 / 0.55);
}
.tabbar .tab-scan .plate .i { width: 28px; height: 28px; }
.tabbar .tab-scan.on::before { display: none; }
.tabbar .tab-scan.on { color: var(--ink); }

/* ---------- leaflet typography ---------- */
.page-head { margin-bottom: 20px; }
.page-head h1, .mode-title, .front-title { font-size: 28px; line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; text-wrap: balance; }
.page-sub { margin-top: 6px; color: var(--ink-2); font-size: 15px; }
.page-head.with-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.back { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 10px -4px; min-height: 36px; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--ink-2); }
.back:hover { color: var(--ink); }

h2, .section-head h2 { font-size: 19px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 28px 0 10px; padding-top: 10px; border-top: 2px solid var(--ink); }
section > .section-head:first-child { margin-top: 0; }
.section-actions { display: flex; gap: 8px; }
.lead-text { font-size: 17px; line-height: 1.55; max-width: 62ch; }
.lead-text + * { margin-top: 14px; }
.more { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 15px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Fold mark: a leaflet crease with printer's ticks at the margins. */
.fold { position: relative; border: 0; height: 1px; margin: 32px 0; background-image: linear-gradient(90deg, var(--rule) 50%, transparent 0); background-size: 8px 1px; overflow: visible; }
.fold::before, .fold::after { content: ''; position: absolute; top: -6px; width: 1px; height: 13px; background: var(--ink); }
.fold::before { left: calc(-1 * var(--gutter) + 4px); }
.fold::after { right: calc(-1 * var(--gutter) + 4px); }

ul.dash li { position: relative; padding-left: 18px; margin-top: 6px; }
ul.dash li::before { content: '–'; position: absolute; left: 0; }

.notice { border: 1.5px solid var(--ink); padding: 14px 16px; margin: 16px 0; }
.notice p + p, .notice p + ul, .notice p + pre { margin-top: 8px; }
.notice-warn { border-color: var(--red); background: var(--red-wash); }
.notice-error { border-color: var(--red); background: var(--red-wash); }
.notice-ok { border-color: var(--green); background: var(--green-wash); }
.notice .btn { margin-top: 12px; }
.code { font-family: var(--mono); font-size: 14px; background: var(--paper); border: 1px solid var(--rule); padding: 8px 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.raw { word-break: break-all; font-size: 14px; color: var(--ink-2); }

.attention h2 { color: var(--red); margin-bottom: 8px; }
.attention h2 .i-triangle { width: 0.75em; height: 0.75em; }
.warn-line { color: var(--red); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 150ms var(--ease), color 150ms var(--ease), transform 150ms var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn[aria-busy='true'] { cursor: progress; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover:not(:disabled) { background: oklch(0.32 0.014 265); }
.btn-secondary:hover:not(:disabled) { background: var(--paper-2); }
.btn-danger { border-color: var(--red); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red); color: var(--paper); }
.btn-ghost { border-color: transparent; padding: 0 10px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.btn-ghost:hover:not(:disabled) { background: var(--paper-2); }
.btn-ghost[aria-pressed='true'] { background: var(--ink); color: var(--paper); text-decoration: none; }
.btn-icon { width: 44px; padding: 0; border-color: transparent; }
.btn-icon:hover { background: var(--paper-2); }
.btn-xl { min-height: 60px; width: 100%; font-size: 18px; }
.btn-xl .i { width: 24px; height: 24px; }
.more-btn { width: 100%; margin-top: 16px; }

.field { display: grid; gap: 6px; }
.field label, .opt-label { font-size: 14px; font-weight: 700; }
.hint { font-size: 14px; color: var(--ink-2); }
input:not([type='checkbox']):not([type='radio']), select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--ink); border-radius: 0; background: var(--paper);
  font-size: 16px; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea { resize: vertical; font-family: var(--mono); font-size: 15px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--ink); width: 20px; height: 20px; margin: 0; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.stack { display: grid; gap: 16px; }
.stack.narrow { max-width: 420px; }
.inline-form { display: grid; gap: 14px; padding: 16px; margin: 12px 0; background: var(--paper-2); border-top: 2px solid var(--ink); }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions, .action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.action-row { margin: 18px 0 4px; }
.form-error { color: var(--red); font-weight: 700; }

/* Chips: radio pills drawn as label tabs. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--ink-3); font-size: 15px; font-weight: 600; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--ink-3); font-size: 13px; font-weight: 700; }
.tag-open { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.tag-done { border-color: var(--green); color: var(--green); }
.tag-warn, .tag-out { border-color: var(--red); color: var(--red); }

/* ---------- entries (leaflet list) ---------- */
.entries > li + li, .products > li + li { border-top: 1px solid var(--rule); }
.entries, .products { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.entry { display: flex; gap: 12px; align-items: center; padding: 14px 0; text-decoration: none; min-height: 64px; }
a.entry:hover .entry-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-main { flex: 1; min-width: 0; }
.entry-title { font-weight: 700; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.entry-sub { font-size: 14px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.entry-codes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.entry-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; font-size: 14px; }
.entry-facts .i { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.entry-side { display: flex; align-items: center; gap: 4px; flex: none; color: var(--ink-2); }
.entry.is-out { opacity: 0.6; }
.entry.static { cursor: default; }
.compact .entry { min-height: 0; padding: 10px 0; }

.expiry { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.expiry .exp-label { font-weight: 700; }
.exp-expired { color: var(--red); }
.exp-expired .mono { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.exp-soon { color: var(--red); }
.exp-ok { color: var(--ink-2); }

.spec { display: grid; grid-template-columns: max-content 1fr; border-top: 1px solid var(--ink); margin: 16px 0; }
.spec dt, .spec dd { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.spec dt { padding-right: 18px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.spec dd { overflow-wrap: anywhere; }

.status-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 4px 0 8px; border-left: 0; background: var(--paper-2); }
.status-line.is-in { background: var(--green-wash); color: var(--green); }
.status-line.is-in span { color: var(--ink); }
.status-line.is-out { background: var(--red-wash); }
.status-line.is-out .i { color: var(--red); }
.box-panel:empty { display: none; }

/* movements */
.moves { margin-top: 8px; }
.move { display: grid; grid-template-columns: 32px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--rule); }
.moves > .move:first-child { border-top-color: var(--ink); }
.move-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1.5px solid var(--ink-3); color: var(--ink-2); }
.move-mark .i { width: 18px; height: 18px; }
.move-in .move-mark { border-color: var(--green); color: var(--green); }
.move-out .move-mark { border-color: var(--red); color: var(--red); }
.move-use .move-mark { border-color: var(--ink); color: var(--ink); }
.move-body p { font-size: 15px; }
.move-product { margin-top: 2px; }
.move-product a { font-weight: 600; }
.move-note { font-style: italic; color: var(--ink-2); }
.move-meta { font-size: 13.5px !important; color: var(--ink-2); margin-top: 2px; }

.empty { padding: 24px 0; }
.empty-title { font-weight: 800; font-size: 17px; }
.empty p + p { margin-top: 6px; color: var(--ink-2); max-width: 52ch; }
.empty .btn { margin-top: 14px; }

.skeleton { display: grid; gap: 12px; padding: 16px 0; }
.skeleton span { display: block; height: 14px; background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton .w60 { width: 60%; height: 18px; } .skeleton .w75 { width: 75%; } .skeleton .w90 { width: 90%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* toolbar & search */
.toolbar { display: grid; gap: 10px; margin-bottom: 16px; }
.search { position: relative; }
.search .i { position: absolute; left: 12px; top: 13px; color: var(--ink-2); }
.search input[type='search'] { padding-left: 42px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-row select { width: auto; min-height: 40px; }

/* ---------- gate (login) ---------- */
.gate-sheet { max-width: 440px; margin: 6vh auto 0; }
.front { padding-bottom: 18px; margin-bottom: 22px; border-bottom: 3px solid var(--ink); }
.front-title { font-size: 40px; letter-spacing: -0.03em; }
.front-lede { margin-top: 8px; font-size: 17px; color: var(--ink-2); }
.notice-box { margin-top: 28px; font-size: 15px; }
.gate .notice-warn .i-triangle { margin-right: 2px; }

/* ---------- home ---------- */
.scan-cta { margin: 0 0 28px; }
.scan-cta .fine { margin-top: 8px; }

/* ---------- scan ---------- */
.scan-view { --mode: var(--ink); }
.scan-view[data-mode='cikis'] { --mode: var(--red); }
.scan-view[data-mode='giris'] { --mode: var(--green); }
.scan-view[data-mode='sorgula'] { --mode: var(--ink-2); }
.modes { display: grid; grid-template-columns: repeat(5, 1fr); border: 1.5px solid var(--ink); margin: -4px 0 16px; }
.mode { min-height: 44px; padding: 0 2px; border: 0; border-left: 1px solid var(--ink); background: var(--paper); font-weight: 700; font-size: 14px; cursor: pointer; }
.mode:first-child { border-left: 0; }
.mode[aria-pressed='true'] { background: var(--mode); color: var(--paper); }
.scan-view[data-mode='cikis'] .mode[aria-pressed='true'], .scan-view[data-mode='giris'] .mode[aria-pressed='true'] { background: var(--mode); }
.mode-head { margin-bottom: 12px; padding-top: 10px; border-top: 3px solid var(--mode); }
.mode-title { font-size: 26px; }
.mode-help { margin-top: 4px; font-size: 15px; color: var(--ink-2); max-width: 60ch; }
.mode-options { display: grid; gap: 10px; margin-bottom: 14px; }
.mode-options:empty { display: none; }
.count-pick { display: grid; gap: 10px; }

.camera { margin: 0 calc(-1 * var(--gutter)); }
.viewer { position: relative; aspect-ratio: 4 / 3; max-height: 52vh; width: 100%; background: oklch(0.18 0.01 265); overflow: hidden; }
.viewer video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewer[data-on='false'] video { visibility: hidden; }
.viewer-idle { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; color: oklch(0.85 0.005 265); font-size: 14px; }
.viewer-idle .btn-primary { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.viewer[data-on='true'] .viewer-idle { display: none; }
/* Printer's crop marks as the viewfinder. */
.crop { position: absolute; inset: 14% 22%; pointer-events: none; transition: inset 220ms var(--ease); }
.crop i { position: absolute; width: 26px; height: 26px; border: 0 solid var(--paper); }
.crop i:nth-child(1) { top: 0; left: 0; border-top-width: 3px; border-left-width: 3px; }
.crop i:nth-child(2) { top: 0; right: 0; border-top-width: 3px; border-right-width: 3px; }
.crop i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 3px; border-left-width: 3px; }
.crop i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 3px; border-right-width: 3px; }
.viewer[data-on='false'] .crop { opacity: 0.35; }
/* Pharmacy rubber stamp (kaşe) as scan feedback. */
.stamp {
  position: absolute; left: 50%; top: 50%; padding: 8px 16px; border: 4px double currentColor; color: var(--paper);
  font-weight: 800; font-size: 28px; letter-spacing: 0.08em; background: oklch(1 0 0 / 0.08);
  transform: translate(-50%, -50%) rotate(-7deg) scale(1.6); opacity: 0; pointer-events: none;
}
.stamp.show { animation: stamp 900ms var(--ease) forwards; }
.stamp-ink { color: var(--paper); background: oklch(0.2 0.012 265 / 0.75); }
.stamp-red, .stamp-error { color: oklch(0.98 0.01 25); background: oklch(0.5 0.19 25 / 0.85); }
.stamp-green { color: oklch(0.98 0.01 160); background: oklch(0.44 0.1 160 / 0.85); }
.stamp-warn { color: oklch(0.98 0.01 25); background: oklch(0.5 0.19 25 / 0.7); }
.stamp-gray { color: var(--paper); background: oklch(0.44 0.012 265 / 0.8); }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(1.7); }
  18% { opacity: 1; transform: translate(-50%, -50%) rotate(-7deg) scale(0.96); }
  26% { transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(-7deg) scale(1); }
}
.cam-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px var(--gutter); border-bottom: 1px solid var(--ink); min-height: 56px; }
.cam-status { font-size: 14px; color: var(--ink-2); }
.cam-actions { display: flex; gap: 4px; }

.cam-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px var(--gutter) 12px; border-bottom: 1px solid var(--ink); }
.tool { display: flex; align-items: center; gap: 8px; }
.tool-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.tool-camera { flex: 1 1 220px; }
.tool-camera select { min-height: 40px; font-size: 15px; }
.zoom { display: flex; border: 1.5px solid var(--ink); }
.zoom-step { min-width: 48px; min-height: 40px; padding: 0 10px; border: 0; border-left: 1px solid var(--ink); background: var(--paper); font-family: var(--mono); font-weight: 700; font-size: 15px; cursor: pointer; }
.zoom-step:first-child { border-left: 0; }
.tool > .zoom-step { border: 1.5px solid var(--ink); font-family: var(--font); }
.zoom-step[aria-pressed='true'] { background: var(--ink); color: var(--paper); }
.tool-tip { flex-basis: 100%; font-size: 13.5px; color: var(--ink-2); }
.viewer[data-on='true'] { cursor: crosshair; }
.focus-ring { position: absolute; z-index: 2; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid oklch(0.9 0.15 95); opacity: 0; pointer-events: none; }
.focus-ring.show { animation: focus 900ms var(--ease) forwards; }
@keyframes focus { 0% { opacity: 1; transform: scale(1.4); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@media (min-width: 960px) { .cam-tools { padding: 10px 0 12px; } }

.manual { display: grid; gap: 8px; margin: 18px 0 8px; }
.manual > label { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.manual-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch; }
.manual-row textarea { min-height: 50px; }

.slips-head { margin-top: 24px; }
.count-pill { font-family: var(--mono); font-size: 14px; font-weight: 700; padding: 0 8px; border: 1.5px solid var(--ink); }
.slips { display: grid; gap: 12px; }
/* Each result is a slip of leaflet paper that unfolds from its top crease. */
.slip {
  position: relative; padding: 14px 16px 16px; background: var(--paper); border: 1px solid var(--ink-3); border-top: 3px solid var(--ink);
  transform-origin: top center; animation: unfold 260ms var(--ease);
}
.slip::after { content: ''; position: absolute; left: 0; right: 0; top: 34%; height: 1px; background-image: linear-gradient(90deg, var(--paper-3) 50%, transparent 0); background-size: 6px 1px; pointer-events: none; }
.slip-ok { border-top-color: var(--green); }
.slip-ok[data-mode='cikis'] { border-top-color: var(--red); }
.slip-ok[data-mode='kullan'], .slip-ok[data-mode='sayim'] { border-top-color: var(--ink); }
.slip-warn, .slip-error { border-top-color: var(--red); background: var(--red-wash); }
.slip-info { border-top-color: var(--ink); }
.slip-status { display: flex; align-items: flex-start; gap: 6px; font-weight: 700; font-size: 15px; }
.slip-ok .slip-status .i { color: var(--green); }
.slip-warn .slip-status, .slip-error .slip-status { color: var(--red); }
.slip-title { margin-top: 6px; font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.slip-codes { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: 13.5px; color: var(--ink-2); }
.slip-exp { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.slip-exp .loc { font-size: 14px; color: var(--ink-2); }
.slip-exp .loc .i { width: 16px; height: 16px; }
.slip-note { margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.slip-body { display: grid; gap: 10px; margin-top: 10px; }
.slip-body:empty { display: none; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.slip .spec { margin: 4px 0 0; }
.remaining { font-size: 17px; }
.done-line { display: flex; align-items: center; gap: 6px; font-size: 16px; }
.done-line .i { color: var(--green); }
@keyframes unfold { from { transform: perspective(700px) rotateX(-70deg); opacity: 0; } to { transform: none; opacity: 1; } }

.stepper { display: grid; grid-template-columns: 52px 1fr 52px; max-width: 220px; border: 1.5px solid var(--ink); }
.stepper button { border: 0; background: var(--paper-2); min-height: 48px; cursor: pointer; display: grid; place-items: center; }
.stepper button:active { background: var(--paper-3); }
.stepper input { border: 0 !important; border-left: 1.5px solid var(--ink) !important; border-right: 1.5px solid var(--ink) !important; text-align: center; font-weight: 800; font-size: 20px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ---------- counts ---------- */
.new-count { grid-template-columns: 1fr; }
.confirm { padding: 14px 16px; margin: 12px 0; border: 1.5px solid var(--ink); background: var(--paper-2); }
.confirm .form-actions { margin-top: 10px; }
.reconcile h2 { margin-bottom: 8px; }
.reconcile details { margin-top: 12px; border-top: 1px solid var(--ink); }
.reconcile summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
.apply { display: grid; gap: 4px; margin-top: 16px; padding: 16px; border: 2px solid var(--ink); }
.apply .btn { margin-top: 10px; justify-self: start; }
.entry.is-open .entry-title::after { content: ''; }

/* ---------- menu ---------- */
.menu { border-top: 1px solid var(--ink); }
.menu li { border-bottom: 1px solid var(--rule); }
.menu-link { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 0; border: 0; background: none; text-align: left; text-decoration: none; cursor: pointer; }
.menu-link > .i:first-child { width: 22px; height: 22px; }
.menu-text { flex: 1; display: grid; }
.menu-text span { font-size: 14px; color: var(--ink-2); }
.menu-link:hover b { text-decoration: underline; text-underline-offset: 3px; }
.settings { display: grid; }
.setting { border-bottom: 1px solid var(--rule); }
.colophon { margin-top: 28px; }

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; display: grid; gap: 8px; width: min(520px, calc(100% - 2 * var(--gutter))); pointer-events: none; }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 600; box-shadow: 0 10px 24px -12px oklch(0.2 0.01 265 / 0.6); animation: unfold 220ms var(--ease); pointer-events: auto; }
.toast-error { background: var(--red); }
.toast-ok .i { color: oklch(0.85 0.1 160); }
.toast.leaving { opacity: 0; transition: opacity 220ms; }
.app[data-state='gate'] ~ .toasts { bottom: 24px; }

/* ---------- wide screens: leaflet opened flat ---------- */
@media (min-width: 960px) {
  :root { --gutter: 32px; }
  .masthead { padding-left: 260px; height: 60px; }
  .wordmark { position: fixed; top: 16px; left: 28px; font-size: 20px; }
  .user-name { display: inline; }
  .tabbar { inset: 60px auto 0 0; width: 232px; height: auto; display: flex; flex-direction: column; gap: 2px; padding: 24px 16px; border-top: 0; border-right: 2px solid var(--ink); }
  .tabbar a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 48px; padding: 0 12px; font-size: 16px; }
  .tabbar a.on::before { inset: 8px auto 8px -16px; width: 4px; height: auto; }
  .tabbar .tab-scan { order: -1; justify-content: flex-start; padding-bottom: 0; margin-bottom: 14px; background: var(--ink); color: var(--paper) !important; }
  .tabbar .tab-scan .plate { position: static; width: auto; height: auto; background: none; box-shadow: none; }
  .tabbar .tab-scan .plate .i { width: 24px; height: 24px; }
  .page { padding: 36px var(--gutter) 64px; margin-left: 232px; max-width: 900px; }
  .app[data-state='gate'] .page { margin-left: auto; }
  .camera { margin: 0; }
  .viewer { max-height: 420px; }
  .cam-bar { padding: 8px 0; }
  .toasts { bottom: 24px; left: calc(50% + 116px); }
  .page-head h1 { font-size: 32px; }
}

@media (max-width: 380px) {
  .mode { font-size: 13px; }
  .inline-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .stamp.show { animation: none; opacity: 1; transform: translate(-50%, -50%) rotate(-7deg); }
}
