/* Kopi Trace — пергамент, базальт, вишня кофе, лист и цитрус Кинтамани. Общие стили паспорта, фермы, кабинета. */
:root {
  --bg: #F5F1E8; --surf: #FFFDF8; --surf2: #ECE5D6; --ink: #1E1B17; --mut: #6E665B; --line: #DDD3C1;
  --basalt: #24211D; --acc: #A3242B; --acc-ink: #FFF7F2; --leaf: #3E6B3A; --citrus: #C9761A; --ok: #3E6B3A; --bad: #A3242B;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 12px 32px -14px rgba(40, 30, 20, .28);
  --disp: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130F; --surf: #1D1B17; --surf2: #29261F; --ink: #EFE9DD; --mut: #A79E90; --line: #37332B;
    --basalt: #EFE9DD; --acc: #E06A63; --acc-ink: #1A0F0E; --leaf: #8DBF84; --citrus: #F0A24B; --ok: #8DBF84; --bad: #E06A63;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -14px rgba(0, 0, 0, .65); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14130F; --surf: #1D1B17; --surf2: #29261F; --ink: #EFE9DD; --mut: #A79E90; --line: #37332B;
  --basalt: #EFE9DD; --acc: #E06A63; --acc-ink: #1A0F0E; --leaf: #8DBF84; --citrus: #F0A24B; --ok: #8DBF84; --bad: #E06A63;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -14px rgba(0, 0, 0, .65); color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--body); min-height: 100vh; overflow-x: hidden; }
[hidden] { display: none !important; }
img { max-width: 100%; display: block; }
a { color: var(--acc); }
h1, h2, h3 { font-family: var(--disp); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
.gut { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.wrap { max-width: 560px; margin: 0 auto; }
.wide { max-width: 1080px; margin: 0 auto; }
.eb { text-transform: uppercase; letter-spacing: .1em; font-size: 11.5px; font-weight: 600; color: var(--mut); }
.mut { color: var(--mut); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }

body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 10; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: var(--ink); }
.brand .logo { width: 34px; height: 34px; flex: none; }
.brand b { font: 600 21px/1 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.brand small { display: block; font-size: 10.5px; color: var(--mut); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > span { min-width: 0; }
.seg { display: inline-flex; background: var(--surf2); border-radius: 999px; padding: 3px; flex: none; }
.seg button { border: 0; background: none; color: var(--mut); font: 600 12.5px var(--body); padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surf); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
@media (max-width: 360px) { .brand small { display: none; } .seg button { padding: 6px 8px; } }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: var(--acc); color: var(--acc-ink); font: 600 15.5px var(--body); padding: 13px 18px; cursor: pointer; text-decoration: none; transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.97); }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.leaf { background: var(--leaf); color: var(--bg); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
input, textarea, select { font: 16px var(--body); color: var(--ink); background: var(--surf); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%; min-width: 0; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--acc); outline-offset: 1px; border-color: transparent; }
label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 500; min-width: 0; }
.panel { background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { min-width: 0; }

/* Паспорт партии */
.hero { position: relative; overflow: hidden; aspect-ratio: 4/3; max-height: 360px; width: 100%; background: var(--surf2); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 8, 6, .1) 30%, rgba(10, 8, 6, .72)); }
.hero .cap { position: absolute; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: 18px; z-index: 1; color: #FBF6EC; display: grid; gap: 6px; }
.hero .cap h1 { font-size: clamp(32px, 8.5vw, 46px); }
.hero .cap .eb { color: rgba(251, 246, 236, .8); }
.verified { display: inline-flex; align-items: center; gap: 6px; background: rgba(251, 246, 236, .16); border: 1px solid rgba(251, 246, 236, .35); color: #FBF6EC; font: 500 12.5px var(--body); padding: 5px 10px; border-radius: 999px; width: max-content; max-width: 100%; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.verified.broken { background: rgba(163, 36, 43, .7); }
.stack { display: grid; gap: 16px; padding-block: 20px 8px; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; background: var(--surf); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts div { padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.facts div:nth-child(odd) { border-right: 1px solid var(--line); }
.facts div:nth-last-child(-n+2) { border-bottom: 0; }
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--mut); }
.facts dd { margin: 2px 0 0; font: 600 21px/1.2 var(--disp); overflow-wrap: anywhere; }
.facts dd small { font: 400 13px var(--body); color: var(--mut); }
.cup { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; }
.score { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; text-align: center; border: 2px solid var(--acc); color: var(--acc); }
.score b { font: 600 32px/1 var(--disp); display: block; }
.score span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.notes { margin: 0; font: italic 500 20px/1.35 var(--disp); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tags span { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: color-mix(in srgb, var(--citrus) 16%, var(--surf)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--citrus) 40%, transparent); }
.farmer { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.farmer .av { width: 64px; height: 64px; border-radius: 50%; background: var(--leaf); color: var(--bg); display: grid; place-items: center; font: 600 24px var(--disp); }
.farmer p { margin: 0; }

.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; left: 15px; top: 10px; bottom: 10px; width: 2px; background: var(--line); }
.tl li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 8px 0; position: relative; }
.tl .pt { width: 32px; height: 32px; border-radius: 50%; background: var(--surf); border: 2px solid var(--leaf); color: var(--leaf); display: grid; place-items: center; z-index: 1; }
.tl .pt svg { width: 16px; height: 16px; }
.tl li.wait .pt { border-style: dashed; border-color: var(--line); color: var(--mut); }
.tl li.wait b { color: var(--mut); }
.tl .bd { min-width: 0; display: grid; gap: 1px; padding-top: 4px; }
.tl b { font-weight: 600; }
.tl .meta { font-size: 13px; color: var(--mut); }
.tl .note { font-size: 14.5px; }
.tl .h { font: 11px var(--mono); color: var(--mut); letter-spacing: .02em; overflow-wrap: anywhere; }
.seal { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.seal svg { width: 48px; height: 48px; color: var(--leaf); }
.seal.broken svg { color: var(--bad); }
.seal code { font: 12.5px var(--mono); overflow-wrap: anywhere; }
.map { display: block; position: relative; border-radius: var(--r); overflow: hidden; text-decoration: none; color: inherit; }
.bars { display: grid; gap: 7px; }
.bars div { display: grid; grid-template-columns: 52px minmax(0, 1fr) 34px; gap: 8px; white-space: nowrap; align-items: center; font-size: 13.5px; }
.bars i { display: block; height: 8px; border-radius: 4px; background: var(--leaf); min-width: 4px; }
.bars span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--mut); }
.lots { display: grid; gap: 12px; }
.lotc { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; text-decoration: none; color: inherit; padding: 10px; }
.lotc img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
.lotc h3 { font-size: 22px; }
.lotc p { margin: 2px 0 0; font-size: 14px; color: var(--mut); }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--leaf) 16%, var(--surf)); color: var(--leaf); }
.pill.wip { background: color-mix(in srgb, var(--citrus) 18%, var(--surf)); color: var(--citrus); }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(140%); background: var(--basalt); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 600; transition: transform .3s; z-index: 20; max-width: calc(100% - 32px); text-align: center; }
.toast:not(.show) { visibility: hidden; transition: transform .3s, visibility 0s .3s; }
.toast.show { transform: translateX(-50%); }
.foot { text-align: center; padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); font-size: 12px; color: var(--mut); display: grid; gap: 6px; }
.foot a { color: var(--mut); }
.demo-note { font-size: 13px; background: var(--surf2); border-radius: 12px; padding: 10px 14px; }
