:root {
    --bg: #1b2024;
    --panel: #232a2e;
    --panel-2: #262d31;
    --field: #232a2e;
    --field-focus: #283136;
    --ink: #ece7df;
    --ink-2: rgba(236, 231, 223, 0.74);
    --ink-3: rgba(236, 231, 223, 0.54);
    --hairline: rgba(236, 231, 223, 0.11);
    --teal: #8cc4b2;
    --teal-wash: rgba(140, 196, 178, 0.14);
    --red: #ef8b7f;
    --red-wash: rgba(239, 139, 127, 0.14);
    --amber: #e2bb84;
    --amber-wash: rgba(226, 187, 132, 0.14);
    --on-teal: #12201c;
    --font-text: "KMR Melange Grotesk", -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
}

* { -webkit-tap-highlight-color: transparent; }
html, body, #root { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-text); font-size: 15px; line-height: 24px; }
h1, h2 { font-weight: 600; }

.fc { padding: 16px 16px 32px; max-width: 760px; margin: 0 auto; box-sizing: border-box; }
@media (min-width: 768px) { .fc { padding: 24px 24px 40px; max-width: 1040px; } }

.grp { margin: 22px 0; }
.grp-h { font-size: 19px; line-height: 28px; margin: 0 0 6px; }
.grp-l { font-size: 12px; line-height: 18px; color: var(--ink-3); margin: 0 0 6px; }
.closing { color: var(--ink-3); font-size: 12px; line-height: 20px; margin: 28px 0 0; }
.sub { display: block; font-size: 12px; line-height: 20px; color: var(--ink-2); }

/* buttons */
.btn, .file-button {
    box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--hairline);
    background: var(--panel); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer;
}
.btn:active, .file-button:active { background: #2c353a; }
.btn-primary, .file-button[data-variant="primary"] {
    background: var(--teal); border-color: var(--teal); color: var(--on-teal); font-weight: 600;
}
.btn-primary:active, .file-button[data-variant="primary"]:active { background: #7db4a3; border-color: #7db4a3; }
.file-button[data-variant="ghost"] { background: transparent; border-color: transparent; color: var(--ink-2); }
.shop-btn { min-height: 48px; }
.shop-btn.is-wide { width: 100%; margin: 8px 0; }
.copyrow { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }

/* pin screen */
.standalone { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
.pincard { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--hairline); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.pinh { font-size: 24px; line-height: 32px; margin: 0 0 2px; }
.pincard .btn { width: 100%; margin-top: 10px; }

/* nav */
.shop-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 0 4px; }
.shop-nav a { padding: 11px 4px; text-align: center; font-size: 13px; line-height: 20px; color: var(--ink-2); text-decoration: none; border: 1px solid var(--hairline); border-radius: 10px; }
.shop-nav a[aria-current="page"] { color: var(--teal); font-weight: 600; border-color: var(--teal); background: var(--teal-wash); }
@media (min-width: 380px) { .shop-nav { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 768px) { .shop-nav a { font-size: 15px; } }

/* stats */
.shop-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 14px 0; }
.shop-stats.is-3 { grid-template-columns: repeat(3, 1fr); }
.shop-stats.is-2 { grid-template-columns: repeat(2, 1fr); }
.shop-stat { border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; background: var(--panel); }
.shop-stat span { font-size: 12px; line-height: 18px; color: var(--ink-2); }
.shop-stat b { font-size: 18px; line-height: 26px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.shop-stat.is-teal b { color: var(--teal); }
.shop-stat.is-red b { color: var(--red); }
@media (min-width: 768px) { .shop-stats { grid-template-columns: repeat(4, 1fr); } .shop-stats.is-3 { grid-template-columns: repeat(3, 1fr); } }

/* fields */
.shop-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; margin: 8px 0; }
.shop-field > span { font-size: 12px; line-height: 18px; color: var(--ink-2); }
.shop-in { width: 100%; box-sizing: border-box; min-height: 48px; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--field); color: var(--ink); font: inherit; font-size: 16px; margin: 4px 0; }
.shop-field .shop-in { margin: 0; }
.shop-in::placeholder { color: var(--ink-3); }
.shop-in.is-big { min-height: 56px; font-size: 18px; border-color: var(--teal); background: var(--field-focus); }
.shop-in:focus { outline: 2px solid var(--teal); outline-offset: 0; }
.shop-area { min-height: 140px; font-size: 12px; direction: ltr; text-align: left; }
.shop-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.shop-row > .shop-field { min-width: 130px; }
.shop-step { display: flex; gap: 6px; }
.shop-step input { text-align: center; }
.shop-step button { min-width: 48px; min-height: 48px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--field); font-size: 22px; color: var(--ink); cursor: pointer; }
.shop-step button:active { background: #2c353a; }

/* lists */
.shop-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.shop-pick { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--hairline); border-radius: 12px; background: var(--panel); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.shop-pick:active { border-color: var(--teal); }
.shop-pick-name { font-weight: 600; }
.shop-pick-meta { display: block; font-size: 12px; line-height: 20px; color: var(--ink-2); }
@media (min-width: 900px) { .shop-picks { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; } }

.shop-card { border: 1px solid var(--hairline); border-radius: 14px; padding: 12px; margin: 10px 0; background: var(--panel); }
.shop-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shop-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.shop-line > div:first-child { min-width: 0; display: flex; flex-direction: column; }
.shop-buy { text-align: end; display: flex; flex-direction: column; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.shop-buy span { font-size: 12px; color: var(--ink-2); }

.shop-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.shop-pill { min-height: 44px; padding: 0 16px; border: 1px solid var(--hairline); border-radius: 22px; background: var(--field); color: var(--ink); font: inherit; cursor: pointer; }
.shop-pill.is-on { border-color: var(--teal); color: var(--teal); font-weight: 600; box-shadow: inset 0 0 0 1px var(--teal); background: var(--teal-wash); }
.shop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }

.shop-badge { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; line-height: 20px; font-weight: 600; margin-inline-start: 6px; }
.shop-badge.is-ok { color: var(--teal); background: var(--teal-wash); }
.shop-badge.is-amber { color: var(--amber); background: var(--amber-wash); }
.shop-badge.is-red { color: var(--red); background: var(--red-wash); }

.shop-warn { color: var(--red); margin: 8px 0; }
.shop-ok { color: var(--teal); font-weight: 600; margin: 8px 0; }
.shop-note { color: var(--ink-2); margin: 12px 0; }
.shop-bar { height: 8px; border-radius: 4px; background: var(--hairline); margin: 8px 0; overflow: hidden; }
.shop-bar i { display: block; height: 100%; background: var(--teal); }
