/* ==========================================================================
   Anbar — barkod skaneri
   Mobil-öncəli, sıfır asılılıq, GPU-dostu animasiyalar.
   ========================================================================== */

/* ---------- 1. Tokenlər ---------- */
:root {
  --bg:          #0A0A0B;
  --bg-elev:     #121214;
  --surface:     #17171A;
  --surface-2:   #1F1F23;
  --line:        #2B2B31;
  --line-soft:   #212127;
  --text:        #F4F4F2;
  --text-dim:    #A2A2A8;
  --text-faint:  #6C6C74;

  --accent:      #FF7A1A;
  --accent-ink:  #14100C;
  --accent-glow: rgba(255, 122, 26, .16);
  --accent-line: rgba(255, 122, 26, .34);

  --ok:          #34D07F;
  --ok-glow:     rgba(52, 208, 127, .14);
  --warn:        #F5B93B;
  --bad:         #FF5A6E;
  --bad-glow:    rgba(255, 90, 110, .14);

  --r-sm: 10px;  --r-md: 14px;  --r-lg: 20px;  --r-xl: 26px;
  --shadow: 0 18px 46px -18px rgba(0,0,0,.75), 0 2px 8px -2px rgba(0,0,0,.5);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "Roboto Mono", Menlo, monospace;

  --tap: 46px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

:root[data-theme="light"] {
  --bg:          #F6F5F3;
  --bg-elev:     #FFFFFF;
  --surface:     #FFFFFF;
  --surface-2:   #F1EFEC;
  --line:        #E2DFDA;
  --line-soft:   #ECEAE6;
  --text:        #17150F;
  --text-dim:    #6B675F;
  --text-faint:  #9A958C;

  --accent:      #E15C00;
  --accent-ink:  #FFFFFF;
  --accent-glow: rgba(225, 92, 0, .10);
  --accent-line: rgba(225, 92, 0, .28);

  --ok:          #12864F;
  --ok-glow:     rgba(18, 134, 79, .10);
  --bad:         #D32B44;
  --bad-glow:    rgba(211, 43, 68, .10);

  --shadow: 0 16px 38px -20px rgba(40, 30, 15, .40), 0 1px 3px rgba(40, 30, 15, .07);
}

/* ---------- 2. Baza ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { display: block; max-width: 100%; }
svg { width: 100%; height: 100%; display: block; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- 3. Karkas ---------- */
.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100dvh;
  max-width: 640px;
  margin-inline: auto;
  position: relative;
}

.main { min-height: 0; overflow: hidden; display: grid; }
.view { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.view[hidden] { display: none; }

.view__title {
  margin: 22px 20px 12px;
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.view__title--sub { margin-top: 30px; }

/* ---------- 4. Üst panel ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 12px) 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--bg);
}

.brand { display: flex; align-items: center; gap: 9px; }
.brand__mark {
  width: 30px; height: 30px; padding: 5px;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 9px;
  display: grid; place-items: center;
}
.brand__text {
  font-size: .95rem; font-weight: 700;
  letter-spacing: .18em;
}

.topbar__right { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-glow); }
.pill[data-off] { color: var(--bad); border-color: var(--bad); }
.pill[data-off] i { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-glow); }

.icon-btn {
  width: 38px; height: 38px; padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text-dim);
  transition: color .16s, border-color .16s;
}
.icon-btn:active { color: var(--text); border-color: var(--accent-line); }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }

/* ---------- 5. Skaner ---------- */
.view--scan { display: grid; grid-template-rows: minmax(0, 1fr) auto; padding: 14px 14px 6px; gap: 12px; }

.scanner {
  position: relative;
  min-height: 0;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  isolation: isolate;
}

#video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s var(--ease);
  background: #000;
}
.scanner[data-state="live"] #video { opacity: 1; }
.scanner[data-state="live"] { border-color: var(--accent-line); }

/* Boş hal */
.scanner__idle {
  position: absolute; inset: 0; z-index: 3;
  display: grid; align-content: center; justify-items: center;
  gap: 6px; padding: 26px; text-align: center;
  background:
    radial-gradient(115% 90% at 50% 0%, var(--accent-glow), transparent 62%),
    var(--bg-elev);
  transition: opacity .28s var(--ease), visibility .28s;
}
/* Fonda zerif barkod zolaqlari - bos qutu hissi yaratmasin. */
.scanner__idle::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(90deg,
    currentColor 0 2px, transparent 2px 7px,
    currentColor 7px 10px, transparent 10px 13px,
    currentColor 13px 14px, transparent 14px 22px);
  color: var(--text);
  opacity: .028;
  -webkit-mask-image: radial-gradient(80% 70% at 50% 50%, transparent 30%, #000 100%);
          mask-image: radial-gradient(80% 70% at 50% 50%, transparent 30%, #000 100%);
}
.scanner:not([data-state="idle"]) .scanner__idle { opacity: 0; visibility: hidden; }

.scanner__idle-icon {
  width: 62px; height: 62px; padding: 15px; margin-bottom: 12px;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  border-radius: 18px;
  background: var(--accent-glow);
}
.scanner__idle-title {
  margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em;
}
.scanner__idle-sub {
  margin: 0 0 20px; max-width: 25ch;
  font-size: .92rem; color: var(--text-dim);
}

/* Nişangah */
.reticle { position: absolute; inset: 0; z-index: 2; opacity: 0; transition: opacity .3s var(--ease); }
.scanner[data-state="live"] .reticle { opacity: 1; }

.reticle__mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,.62) 0%, rgba(0,0,0,.62) 28%,
    rgba(0,0,0,.10) 33%, rgba(0,0,0,.10) 67%,
    rgba(0,0,0,.62) 72%, rgba(0,0,0,.62) 100%);
}
.reticle__window {
  position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.c { position: absolute; width: 26px; height: 26px; border: 2.5px solid var(--accent); }
.c--tl { top: -1px; left: -1px;  border-right: 0; border-bottom: 0; border-radius: 12px 0 0 0; }
.c--tr { top: -1px; right: -1px; border-left: 0;  border-bottom: 0; border-radius: 0 12px 0 0; }
.c--bl { bottom: -1px; left: -1px;  border-right: 0; border-top: 0; border-radius: 0 0 0 12px; }
.c--br { bottom: -1px; right: -1px; border-left: 0;  border-top: 0; border-radius: 0 0 12px 0; }

.laser {
  position: absolute; inset: 0;
  animation: sweepPct 2.1s var(--ease) infinite;
  will-change: transform;
}
.laser::after {
  content: "";
  position: absolute; left: 10px; right: 10px; top: 0; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px 1px var(--accent);
}
@keyframes sweepPct {
  0%   { transform: translate3d(0, 3%, 0);  opacity: .22; }
  45%  { opacity: 1; }
  100% { transform: translate3d(0, 95%, 0); opacity: .22; }
}

/* Uğurlu oxunuş anı */
.scanner[data-hit="1"] .reticle__window { animation: hit .45s var(--ease); }
.scanner[data-hit="1"] .c { border-color: var(--ok); }
@keyframes hit {
  0%   { box-shadow: inset 0 0 0 1px var(--ok), 0 0 0 0 var(--ok-glow); }
  60%  { box-shadow: inset 0 0 0 2px var(--ok), 0 0 0 22px transparent; }
  100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
}

.scanner__tools {
  position: absolute; z-index: 4; right: 12px; top: 12px;
  display: grid; gap: 8px;
}
.tool-btn {
  width: 42px; height: 42px; padding: 10px;
  color: #fff;
  background: rgba(12,12,14,.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 13px;
}
.tool-btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.tool-btn--stop { color: #fff; }

.scanner__hint {
  position: absolute; z-index: 4; left: 14px; right: 14px; bottom: 14px;
  margin: 0; padding: 10px 14px;
  text-align: center; font-size: .85rem; font-weight: 550;
  color: #fff;
  background: rgba(12,12,14,.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  opacity: 0; transform: translate3d(0, 6px, 0);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.scanner__hint[data-show] { opacity: 1; transform: none; }
.scanner__hint[data-tone="bad"] { background: rgba(180, 30, 48, .82); }
.scanner__hint[data-tone="ok"]  { background: rgba(16, 110, 66, .84); }

.scan-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 4px; }

.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: var(--tap); padding: 0 15px;
  font-size: .88rem; font-weight: 600;
  color: var(--text-dim);
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  transition: color .16s, border-color .16s;
}
.ghost-btn svg { width: 17px; height: 17px; }
.ghost-btn:active { color: var(--accent); border-color: var(--accent-line); }

.scan-counter { font-size: .8rem; color: var(--text-faint); }
.scan-counter b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 6. Düymələr ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--tap); padding: 0 20px;
  font-size: .95rem; font-weight: 650; letter-spacing: -.005em;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  transition: transform .12s var(--ease), opacity .16s, background .16s;
}
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 18px; height: 18px; }

.btn--primary { color: var(--accent-ink); background: var(--accent); }
.btn--ghost   { color: var(--text); border-color: var(--line); background: var(--surface); }
.btn--quiet   { color: var(--text-dim); }
.btn--danger  { color: var(--bad); border-color: var(--line); background: var(--surface); }
.btn--lg      { min-height: 54px; padding-inline: 30px; font-size: 1rem; border-radius: var(--r-lg); }
.btn--block   { width: 100%; }

.btn.is-busy { position: relative; color: transparent; }
.btn.is-busy::after {
  content: ""; position: absolute; width: 19px; height: 19px;
  border: 2.4px solid currentColor; border-radius: 50%;
  animation: spin .62s linear infinite;
}
.btn--primary.is-busy::after { border-color: rgba(0,0,0,.28); border-top-color: var(--accent-ink); }
.btn--ghost.is-busy::after,
.btn--danger.is-busy::after { border-color: var(--line); border-top-color: var(--text-dim); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 7. Alt naviqasiya ---------- */
.tabbar {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 8px calc(var(--safe-b) + 6px);
  border-top: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.tab {
  display: grid; justify-items: center; gap: 3px;
  padding: 8px 4px 6px;
  font-size: .68rem; font-weight: 600; letter-spacing: .01em;
  color: var(--text-faint);
  border-radius: var(--r-md);
  transition: color .16s;
}
.tab svg { width: 22px; height: 22px; }
.tab.is-on { color: var(--accent); }
.tab:active { background: var(--surface); }

/* ---------- 8. Axtarış və süzgəc ---------- */
.search { position: relative; margin: 14px 16px 10px; }
.search__icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--text-faint); pointer-events: none;
}
.search input {
  width: 100%; min-height: 48px;
  padding: 0 42px 0 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: .95rem;
  transition: border-color .16s;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent-line); }
.search input::placeholder { color: var(--text-faint); }
.search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; font-size: 1.4rem; line-height: 1;
  color: var(--text-faint); border-radius: 9px;
}

.chips { display: flex; gap: 8px; padding: 0 16px 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  min-height: 36px; padding: 0 15px;
  font-size: .84rem; font-weight: 600;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color .16s, background .16s, border-color .16s;
}
.chip.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* ---------- 9. Siyahı ---------- */
.list { display: grid; gap: 9px; padding: 0 16px 22px; }

.card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  align-items: center; gap: 13px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  contain: layout style;
  transition: border-color .16s, transform .12s var(--ease);
}
.card:active { transform: scale(.99); border-color: var(--accent-line); }

.card__img {
  width: 58px; height: 58px;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.card__img--empty {
  display: grid; place-items: center;
  color: var(--text-faint); font-size: .68rem; font-weight: 600;
  border: 1px dashed var(--line);
}

.card__body { min-width: 0; }
.card__name {
  margin: 0 0 3px;
  font-size: .96rem; font-weight: 620; letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card__meta {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: .74rem;
  color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.qty {
  display: grid; justify-items: center;
  min-width: 56px; padding: 7px 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.qty b {
  font-family: var(--mono); font-size: 1.06rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.qty span { font-size: .62rem; color: var(--text-faint); letter-spacing: .04em; }
.qty--zero b { color: var(--bad); }

.tag {
  padding: 2px 7px;
  font-family: var(--sans); font-size: .64rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--warn);
  border: 1px solid currentColor;
  border-radius: 5px;
}

.card__go {
  width: 16px; height: 16px;
  margin-left: -4px;
  color: var(--text-faint);
  flex: none;
}

.empty {
  display: grid; justify-items: center; gap: 6px;
  padding: 54px 30px; text-align: center;
  color: var(--text-faint); font-size: .9rem;
}
.empty b { color: var(--text-dim); font-size: 1rem; }

.skeleton {
  height: 80px; border-radius: var(--r-lg);
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }

/* ---------- 10. Statistika ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.tile {
  padding: 16px 15px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.tile b {
  display: block;
  font-family: var(--mono); font-size: 1.75rem; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.035em;
  line-height: 1.1;
}
.tile span {
  display: block; margin-top: 4px;
  font-size: .76rem; color: var(--text-dim);
}
.tile--accent { background: var(--accent-glow); border-color: var(--accent-line); }
.tile--accent b { color: var(--accent); }

.list--compact .card { grid-template-columns: minmax(0,1fr) auto auto; padding: 12px 14px; }

/* ---------- 11. Panel (sheet) ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 60; }
.sheet-root[hidden] { display: none; }

.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .26s var(--ease);
}
.sheet-root.is-open .sheet-backdrop { opacity: 1; }

.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin-inline: auto;
  max-height: 92dvh;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg-elev);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translate3d(0, 100%, 0);
  transition: transform .32s var(--ease);
  will-change: transform;
}
.sheet-root.is-open .sheet { transform: none; }
.sheet.is-dragging { transition: none; }

.sheet__grip { padding: 10px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet__grip span { width: 38px; height: 4px; border-radius: 3px; background: var(--line); }

.sheet__body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: 4px 20px calc(var(--safe-b) + 22px);
}

/* Panel başlığı */
.sh-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sh-head__code {
  font-family: var(--mono); font-size: 1.12rem; font-weight: 700;
  letter-spacing: .01em; word-break: break-all;
}
.sh-head__sub {
  margin-top: 3px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .74rem; color: var(--text-faint);
}
.sh-head__sub code {
  font-family: var(--mono); font-size: .68rem;
  padding: 2px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-dim);
}
.sh-close { width: 34px; height: 34px; padding: 8px; color: var(--text-faint); border-radius: 10px; background: var(--surface-2); flex: none; }

/* Addım göstəricisi */
.steps { display: flex; gap: 5px; margin-bottom: 18px; }
.steps i { height: 3px; flex: 1; border-radius: 2px; background: var(--line); transition: background .25s; }
.steps i.is-on { background: var(--accent); }

.sh-title { margin: 0 0 4px; font-size: 1.22rem; font-weight: 700; letter-spacing: -.022em; }
.sh-sub { margin: 0 0 18px; font-size: .89rem; color: var(--text-dim); }

/* Sahə */
.field { margin-bottom: 15px; }
.field > label {
  display: block; margin-bottom: 7px;
  font-size: .74rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint);
}
.field input[type="text"], .field textarea, .field input[type="number"] {
  width: 100%; min-height: 50px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 1rem;
  transition: border-color .16s;
}
.field textarea { min-height: 76px; resize: vertical; line-height: 1.4; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }

/* Şəkil sahəsi */
.shot {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

/* Butun daxili elementler mutleq yerlesdirilir.
   Sebeb: telefon kamerasi portret rejimde 1080x1920 (ve ya 1:1) axin verir;
   qrid setri video-nun oz en/boy nisbetine gore qutudan hundur olur ve
   asagidaki deklansor zolagi overflow:hidden ile kesilirdi. */
.shot > video, .shot > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.shot__hollow {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 8px;
  color: var(--text-faint); font-size: .85rem; text-align: center; padding: 16px;
}
.shot__hollow svg { width: 30px; height: 30px; }

.shot__bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px;
  /* Ag deklansor acig sekil uzerinde de secilsin. */
  background: linear-gradient(to top, rgba(0,0,0,.45), transparent);
}
.shutter {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 6px 18px rgba(0,0,0,.4);
  transition: transform .12s var(--ease);
}
.shutter:active { transform: scale(.9); }
.shot__mini {
  min-height: 40px; padding: 0 14px;
  font-size: .82rem; font-weight: 600;
  color: #fff;
  background: rgba(12,12,14,.6);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
}
.shot[data-has="1"] .shutter { display: none; }

.flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
}
.flash.is-on { animation: flash .34s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* Miqdar seçimi */
.counter {
  display: grid; grid-template-columns: 62px minmax(0,1fr) 62px;
  align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.counter__btn {
  height: 62px;
  font-size: 1.7rem; font-weight: 400; line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: transform .12s var(--ease), border-color .16s;
}
.counter__btn:active { transform: scale(.93); border-color: var(--accent); }
.counter__val {
  width: 100%; height: 62px;
  text-align: center;
  font-family: var(--mono); font-size: 2.1rem; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.04em;
  background: transparent; border: 0;
  -moz-appearance: textfield;
}
.counter__val::-webkit-outer-spin-button,
.counter__val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.counter__val:focus { outline: none; }

.quick {
  display: flex; gap: 8px; margin-bottom: 20px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.quick::-webkit-scrollbar { display: none; }
.quick button {
  flex: none; scroll-snap-align: start;
  min-width: 52px; min-height: 40px; padding: 0 15px;
  font-family: var(--mono); font-size: .88rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: color .14s, border-color .14s;
}
/* Vahid adlari reqem deyil - adi sriftle daha oxunaqlidir. */
.quick--text button { font-family: var(--sans); min-width: 0; }
.quick button:active { color: var(--accent); border-color: var(--accent); }

.sh-actions { display: grid; gap: 9px; margin-top: 6px; }
.sh-actions--row { grid-template-columns: 1fr 1fr; }

/* Mövcud məhsul kartı */
.known {
  display: grid; grid-template-columns: 74px minmax(0,1fr); gap: 14px;
  align-items: center;
  padding: 12px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.known img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--r-md); }
.known h3 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 650; letter-spacing: -.015em; }
.known p { margin: 0; font-size: .8rem; color: var(--text-dim); }
.known p b { font-family: var(--mono); color: var(--text); font-size: .95rem; }

/* Uğur ekranı */
.done { display: grid; justify-items: center; text-align: center; padding: 14px 0 6px; }
.done__ring {
  width: 78px; height: 78px; margin-bottom: 16px;
  display: grid; place-items: center;
  color: var(--ok);
  border-radius: 50%;
  background: var(--ok-glow);
  animation: pop .42s var(--ease);
}
.done__ring svg { width: 38px; height: 38px; }
@keyframes pop { 0% { transform: scale(.55); opacity: 0; } 100% { transform: none; opacity: 1; } }
.done h3 { margin: 0 0 4px; font-size: 1.28rem; font-weight: 700; letter-spacing: -.024em; }
.done p { margin: 0 0 22px; font-size: .9rem; color: var(--text-dim); }
.done__sum {
  display: flex; gap: 22px; justify-content: center;
  margin-bottom: 22px; padding: 14px 20px;
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
}
.done__sum div { text-align: center; }
.done__sum b { display: block; font-family: var(--mono); font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.done__sum span { font-size: .68rem; color: var(--text-faint); letter-spacing: .04em; }

/* Tarixçə */
.hist { display: grid; gap: 1px; background: var(--line-soft); border-radius: var(--r-md); overflow: hidden; margin-top: 6px; }
.hist__row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; background: var(--surface); font-size: .84rem;
}
.hist__row b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hist__row .up { color: var(--ok); }
.hist__row .down { color: var(--bad); }
.hist__row time { font-size: .74rem; color: var(--text-faint); font-family: var(--mono); }

/* ---------- 11b. PIN ekrani ---------- */
.gate {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--accent-glow), transparent 60%),
    var(--bg);
}
.gate[hidden] { display: none; }

.gate__card {
  display: grid; justify-items: center;
  width: 100%; max-width: 340px;
  padding: 32px 26px 26px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
}
.gate__mark { width: 42px; height: 42px; padding: 8px; border-radius: 13px; }
.gate__title {
  margin: 16px 0 4px;
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.022em;
}
.gate__sub { margin: 0 0 22px; font-size: .88rem; color: var(--text-dim); }

.gate__pin {
  width: 100%; height: 62px; margin-bottom: 14px;
  text-align: center;
  font-family: var(--mono); font-size: 1.7rem; font-weight: 700;
  letter-spacing: .38em; text-indent: .38em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color .16s;
}
.gate__pin:focus { outline: none; border-color: var(--accent); }

.gate__err {
  margin: -6px 0 12px;
  font-size: .84rem; font-weight: 600; color: var(--bad);
}
.gate__err[hidden] { display: none; }

/* ---------- 12. Bildirişlər ---------- */
.toasts {
  position: fixed; z-index: 80; left: 12px; right: 12px;
  top: calc(var(--safe-t) + 12px);
  display: grid; gap: 8px; justify-items: center;
  pointer-events: none;
}
.toast {
  max-width: 420px; width: fit-content;
  padding: 11px 17px;
  font-size: .88rem; font-weight: 550;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toastIn .28s var(--ease);
}
.toast[data-tone="ok"]  { border-color: var(--ok);  color: var(--ok); }
.toast[data-tone="bad"] { border-color: var(--bad); color: var(--bad); }
.toast.is-out { animation: toastOut .22s var(--ease) forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translate3d(0,-12px,0) scale(.96); } }
@keyframes toastOut { to   { opacity: 0; transform: translate3d(0,-8px,0) scale(.97); } }

/* ---------- 13. Uyğunlaşma ---------- */
@media (min-width: 560px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .reticle__window { left: 14%; right: 14%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
