/* ============ tokens ============ */
:root {
  --bg: #f5f2eb;
  --bg-deep: #ecead9;
  --surface: #ffffff;
  --surface-2: #fafaf6;
  --border: #d9d5c4;
  --border-strong: #b8b29c;
  --ink: #14181f;
  --ink-2: #3a3f48;
  --ink-3: #6b7079;
  --ink-4: #9aa0aa;
  --navy: #0f3a5f;
  --navy-deep: #0a2742;
  --navy-tint: #e8eef5;
  --accent: #c2410c;        /* price orange */
  --accent-tint: #fdebd6;
  --success: #15803d;
  --success-tint: #dcfce7;
  --warn: #ca8a04;
  --warn-tint: #fef3c7;
  --danger: #b91c1c;
  --danger-tint: #fee2e2;
  --shadow-sm: 0 1px 0 rgba(20,24,31,0.04), 0 1px 2px rgba(20,24,31,0.06);
  --shadow-md: 0 2px 4px rgba(20,24,31,0.05), 0 8px 24px rgba(20,24,31,0.08);
  --shadow-lg: 0 12px 40px rgba(20,24,31,0.12), 0 2px 6px rgba(20,24,31,0.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Sans JP", "Hiragino Sans", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0.005em;
}

.mono { font-family: "JetBrains Mono", ui-monospace, "SF Mono", monospace; }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

button { font-family: inherit; cursor: pointer; }

/* ============ app shell ============ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--navy-deep);
  color: #f5f2eb;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid #000;
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.topbar .brand-mark {
  width: 22px; height: 22px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 12px;
  border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
}
.topbar .brand-name { font-size: 13px; }
.topbar .brand-sub { font-size: 11px; color: #a8b0bd; font-weight: 400; padding-left: 8px; border-left: 1px solid #2a3a4f; }
.topbar .spacer { flex: 1; }
.topbar .topbar-meta {
  display: flex; gap: 18px;
  font-size: 11px; color: #a8b0bd;
}
.topbar .topbar-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); display: inline-block; margin-right: 6px; vertical-align: middle; }

/* tabs */
.tabs {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  padding: 0 24px;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  position: relative;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab .tab-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-4);
  background: var(--bg-deep);
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.05em;
}
.tab.is-active .tab-num { background: var(--accent); color: #fff; }
.tab .tab-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  font-weight: 600;
  background: var(--navy-tint);
  color: var(--navy);
}
.tab .tab-badge.core { background: var(--accent-tint); color: var(--accent); }

.tabs .tabs-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ink-4);
  padding-right: 4px;
}

/* main area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.view {
  flex: 1;
  padding: 24px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.view-header .crumb {
  font-size: 11px;
  color: var(--ink-4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.view-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.view-header .sub {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 13px;
  max-width: 560px;
}
.view-header .header-side {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ============ generic atoms ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px; }
.card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-head .h {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-deep); }
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { background: #a8370a; }
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover { background: var(--bg-deep); }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 14px; font-weight: 600; letter-spacing: 0.04em; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-3);
}
.chip.success { background: var(--success-tint); color: var(--success); border-color: transparent; }
.chip.warn { background: var(--warn-tint); color: #92670a; border-color: transparent; }
.chip.danger { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.chip.navy { background: var(--navy-tint); color: var(--navy); border-color: transparent; }
.chip.accent { background: var(--accent-tint); color: var(--accent); border-color: transparent; }

.kbd {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink-3);
}

/* ============ stopwatch ============ */
.stopwatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #0a2742;
  color: #fff;
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
}
.stopwatch .sw-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #8aa1bd;
  text-transform: uppercase;
}
.stopwatch .sw-time {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}
.stopwatch.running .sw-label::before {
  content: "● ";
  color: #ef4444;
  animation: pulse 1s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ============ core view ============ */
.core-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.step {
  position: relative;
  padding: 14px 16px 14px 48px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-3);
}
.step:last-child { border-bottom: 0; }
.step .step-n {
  position: absolute;
  left: 16px; top: 14px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--surface);
}
.step .step-t { font-weight: 600; color: var(--ink-2); display: block; margin-bottom: 2px; font-size: 13px; }
.step .step-d { font-size: 11px; color: var(--ink-4); line-height: 1.4; }
.step.is-done { color: var(--ink-3); }
.step.is-done .step-n { background: var(--success); color: #fff; border-color: var(--success); }
.step.is-done .step-n::after { content: "✓"; font-size: 12px; }
.step.is-done .step-n .num { display: none; }
.step.is-active { background: var(--accent-tint); }
.step.is-active .step-n { background: var(--accent); color: #fff; border-color: var(--accent); }
.step.is-active .step-t { color: var(--accent); }

/* uploader */
.uploader {
  border: 1.5px dashed var(--border-strong);
  border-radius: 4px;
  padding: 40px 24px;
  text-align: center;
  background: var(--surface-2);
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.uploader:hover { border-color: var(--accent); background: var(--accent-tint); }
.uploader.is-drag { border-color: var(--accent); background: var(--accent-tint); }
.uploader .up-icon {
  width: 48px; height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #fff;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  font-size: 22px;
  color: var(--ink-3);
}
.uploader .up-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.uploader .up-sub { font-size: 12px; color: var(--ink-4); }

/* analyzing */
.analyzing {
  padding: 60px 24px;
  text-align: center;
  background: var(--surface-2);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.scan-frame {
  width: 165px;
  aspect-ratio: 1086/1448;
  margin: 0 auto 20px;
  background: #0a1530 center/cover no-repeat url('assets/card-soukyu.png');
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,58,95,0.3), 0 0 0 2px rgba(255,215,0,0.4);
}
.scan-frame::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.25), rgba(0,0,0,0.1));
}
.scan-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(120, 200, 255, 0.65) 50%, transparent 100%);
  animation: scan 1.5s infinite;
  z-index: 2;
}
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.scan-text { font-size: 13px; color: var(--ink-3); }
.scan-text .blink { animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }

/* card preview */
.card-preview {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 20px;
}
/* card art */
.card-art {
  aspect-ratio: 1086/1448;
  border-radius: 8px;
  overflow: hidden;
  background: #0a1530;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25), 0 0 0 2px rgba(255,215,0,0.55);
}
.card-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.id-field .id-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 4px;
}
.id-field .id-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.id-field .id-value .conf {
  font-size: 11px;
  color: var(--success);
  margin-left: 6px;
  font-weight: 500;
}
.id-field .id-value.warn .conf { color: var(--warn); }

/* rarity selector */
.rarity-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.rarity-chip {
  padding: 10px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 110px;
  text-align: left;
}
.rarity-chip:hover { border-color: var(--accent); background: var(--accent-tint); }
.rarity-chip.is-selected {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.rarity-chip.is-selected .rc-pop { color: #c5d1de; }
.rarity-chip .rc-name { font-weight: 600; font-size: 13px; }
.rarity-chip .rc-pop { font-size: 10px; color: var(--ink-4); font-family: "JetBrains Mono", monospace; }

/* market table */
.market-table {
  width: 100%;
  border-collapse: collapse;
}
.market-table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  background: var(--surface-2);
}
.market-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.market-table tr:last-child td { border-bottom: 0; }
.market-table .src-name { font-weight: 600; font-size: 13px; }
.market-table .src-meta { font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.market-table .price-cell { text-align: right; }
.market-table .price-num {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.market-table .price-num.loading { color: var(--ink-4); }
.market-table .listings { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

.skeleton {
  display: inline-block;
  height: 16px; width: 80px;
  background: linear-gradient(90deg, var(--bg-deep) 0%, #f0eddc 50%, var(--bg-deep) 100%);
  background-size: 200% 100%;
  animation: skl 1.4s infinite;
  border-radius: 2px;
}
@keyframes skl {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.final-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--bg-deep));
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.final-bar .fp-block { flex: 1; min-width: 160px; }
.final-bar .fp-block.fp-recommend {
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 4px;
  padding: 10px 14px;
  min-width: 240px;
}
.final-bar .fp-divider {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 4px 0;
}

/* history (Step 5) */
.hist-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.hs-block {
  padding: 14px 16px;
  border-right: 1px solid var(--border);
}
.hs-block:last-child { border-right: 0; }
.hs-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  margin-bottom: 4px;
}
.hs-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.hs-meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 4px;
}

.cond-badge {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 22px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  border-radius: 2px;
}
.cond-badge.cond-S { background: var(--accent-tint);  color: var(--accent); }
.cond-badge.cond-A { background: var(--success-tint); color: var(--success); }
.cond-badge.cond-B { background: var(--bg-deep);      color: var(--ink-3); }

.hist-table td { padding: 9px 16px; }
.hist-table th { background: var(--surface); }

/* confirm bar — Step 6 editable price */
.final-bar-grid {
  background: linear-gradient(180deg, var(--surface-2), #f1eedf);
}

.confirm-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  padding: 20px;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  align-items: stretch;
}
.cb-left { min-width: 0; }
.cb-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
  margin-bottom: 10px;
}
.cb-label .cb-sub {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-4);
  font-weight: 500;
  margin-left: 4px;
}

.cb-input-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}
.cb-step {
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  border-radius: 3px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  min-width: 56px;
  transition: background 0.12s, border-color 0.12s;
}
.cb-step:hover:not(:disabled) { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.cb-step:disabled { opacity: 0.4; cursor: not-allowed; }

.cb-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 4px;
  padding: 4px 14px 4px 12px;
  box-shadow: 0 0 0 4px var(--accent-tint);
  min-width: 240px;
}
.cb-yen {
  font-family: "Noto Sans JP", sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-3);
  margin-right: 4px;
}
.cb-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: "JetBrains Mono", monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding: 4px 0;
  width: 100%;
}
.cb-input:disabled { color: var(--ink-3); }
.cb-input::-webkit-outer-spin-button,
.cb-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cb-input { -moz-appearance: textfield; }

.cb-reset {
  padding: 0 14px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 3px;
  font-size: 12px;
  color: var(--ink-3);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
}
.cb-reset:hover:not(:disabled) { background: var(--bg-deep); color: var(--ink); }
.cb-reset:disabled { opacity: 0.3; cursor: not-allowed; }

.cb-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  min-height: 22px;
}

.cb-note-row { display: flex; }
.cb-note {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 3px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink);
}
.cb-note:focus { outline: 0; border-color: var(--accent); background: #fff; }
.cb-note::placeholder { color: var(--ink-4); }

.cb-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  align-items: stretch;
  text-align: right;
  min-width: 200px;
}
.cb-confirm-meta {
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}

@media (max-width: 1180px) {
  .confirm-bar { grid-template-columns: 1fr; }
  .cb-right { align-items: stretch; text-align: left; }
}
.final-bar .fp-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.final-bar .fp-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-top: 4px;
}
.final-bar .fp-amount.accent2 { color: var(--navy); }
.final-bar .fp-amount .yen { font-size: 16px; margin-right: 3px; color: var(--ink-2); font-weight: 500; }
.final-bar .fp-amount .delta { display: block; font-size: 11px; color: var(--ink-4); margin-top: 4px; font-family: "Noto Sans JP", sans-serif; font-weight: 500; letter-spacing: 0; }

/* result */
.result-banner {
  background: var(--success-tint);
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.result-banner .rb-check {
  width: 48px; height: 48px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.result-banner .rb-title { font-size: 16px; font-weight: 700; color: #14532d; }
.result-banner .rb-sub { font-size: 12px; color: #166534; margin-top: 2px; }
.result-banner .rb-side { margin-left: auto; }

/* ============ LINE view ============ */
.line-stage {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: start;
}
.phone {
  width: 360px;
  background: #1a1d24;
  border-radius: 36px;
  padding: 12px;
  box-shadow: var(--shadow-lg);
  margin: 0 auto;
}
.phone-screen {
  background: #8ba9c4;
  border-radius: 28px;
  overflow: hidden;
  height: 700px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 120px; height: 24px;
  background: #1a1d24;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  z-index: 2;
}
.line-header {
  background: #6a8aa8;
  color: #fff;
  padding: 36px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.line-header .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
}
.line-header .acct-name { font-size: 14px; font-weight: 600; }
.line-header .acct-meta { font-size: 10px; opacity: 0.8; }
.line-header .h-icons { margin-left: auto; display: flex; gap: 14px; color: rgba(255,255,255,0.85); font-size: 18px; }

.chat {
  flex: 1;
  background: #8ba9c4;
  padding: 14px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-date {
  align-self: center;
  background: rgba(0,0,0,0.15);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 10px;
  margin: 4px 0 8px;
}
.msg {
  display: flex;
  gap: 6px;
  max-width: 80%;
}
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .bub {
  background: #fff;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  position: relative;
}
.msg.user .bub { background: #8ee06d; }
.msg .time { font-size: 9px; color: rgba(255,255,255,0.85); align-self: flex-end; padding-bottom: 2px; }
.msg .bub.has-img { padding: 4px; background: #fff; }
.msg .bub.has-img .img-card {
  width: 160px;
  aspect-ratio: 1086/1448;
  background: #0a1530 center/cover no-repeat url('assets/card-soukyu.png');
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.msg .bub.has-img .img-card::before { content: none; }
.msg .bub.has-img .img-card .img-tag {
  position: absolute; top: 6px; left: 6px;
  font-size: 9px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 2px 5px;
  border-radius: 2px;
  font-family: "JetBrains Mono", monospace;
}
.msg .bub.has-table { padding: 0; min-width: 220px; overflow: hidden; }
.msg .bub.has-table .qt-title {
  padding: 10px 12px;
  background: var(--navy);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.msg .bub.has-table .qt-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 11px;
}
.msg .bub.has-table .qt-row:last-child { border-bottom: 0; background: #fef9f3; }
.msg .bub.has-table .qt-row .qt-amt {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--accent);
}
.msg .bub.has-table .qt-note {
  font-size: 10px;
  padding: 8px 12px;
  background: #fffbeb;
  color: #92670a;
  border-top: 1px solid #fde68a;
  line-height: 1.4;
}

.typing {
  display: inline-flex; gap: 3px;
  padding: 10px 14px;
}
.typing span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ink-4);
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing {
  0%, 80%, 100% { opacity: 0.3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.line-input {
  background: #f2f2f2;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #d9d9d9;
}
.line-input .li-pill {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--ink-4);
}

/* LINE side panel */
.line-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline {
  list-style: none; margin: 0; padding: 0;
}
.tl-row {
  position: relative;
  padding: 0 0 18px 24px;
  border-left: 1px dashed var(--border-strong);
  margin-left: 6px;
}
.tl-row:last-child { border-left: 0; padding-bottom: 0; }
.tl-row .dot {
  position: absolute;
  left: -5px; top: 2px;
  width: 11px; height: 11px;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
  border-radius: 50%;
}
.tl-row.future .dot { background: var(--bg-deep); }
.tl-row .tl-time { font-size: 10px; font-family: "JetBrains Mono", monospace; color: var(--ink-4); letter-spacing: 0.04em; }
.tl-row .tl-text { font-size: 12px; color: var(--ink-2); margin-top: 1px; }
.tl-row .tl-text .em { color: var(--accent); font-weight: 600; }

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.replay-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--navy);
  color: #fff;
  border: 0;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
}
.replay-btn:hover { background: var(--navy-deep); }

/* ============ POS view ============ */
.pos-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
.pos-state-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-deep);
  padding: 4px;
  border-radius: 4px;
  width: fit-content;
}
.pos-state-tab {
  padding: 8px 14px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pos-state-tab:hover { color: var(--ink); }
.pos-state-tab .led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ink-4);
}
.pos-state-tab.success .led { background: var(--success); }
.pos-state-tab.warn .led { background: var(--warn); }
.pos-state-tab.danger .led { background: var(--danger); }
.pos-state-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.pos-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.pos-status-card {
  padding: 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}
.pos-icon-big {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 32px;
  color: #fff;
  flex-shrink: 0;
}
.pos-icon-big.success { background: var(--success); }
.pos-icon-big.warn { background: var(--warn); animation: spin 1.6s linear infinite; }
.pos-icon-big.danger { background: var(--danger); }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.pos-status-card .ps-head {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.pos-status-card .ps-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.pos-status-card .ps-side {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pos-log {
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  background: #0a2742;
  color: #d6e1ed;
  border-radius: 0;
}
.pos-log li {
  padding: 9px 18px;
  border-bottom: 1px solid #15334f;
  display: grid;
  grid-template-columns: 90px 70px 1fr;
  gap: 14px;
}
.pos-log li:last-child { border-bottom: 0; }
.pos-log .t-stamp { color: #6f8aa6; }
.pos-log .t-lvl { font-weight: 700; }
.pos-log .t-lvl.ok { color: #4ade80; }
.pos-log .t-lvl.warn { color: #fcd34d; }
.pos-log .t-lvl.err { color: #f87171; }
.pos-log .t-msg { color: #d6e1ed; }

.pos-side-card {
  padding: 18px;
}
.pos-payload {
  background: #0a2742;
  color: #d6e1ed;
  padding: 14px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  border-radius: 3px;
  white-space: pre;
  overflow-x: auto;
  line-height: 1.55;
}
.pos-payload .k { color: #93c5fd; }
.pos-payload .s { color: #fda4af; }
.pos-payload .n { color: #fcd34d; }

.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 12px; }
.kv-list dt { color: var(--ink-4); }
.kv-list dd { margin: 0; color: var(--ink); font-weight: 500; font-family: "JetBrains Mono", monospace; }

/* ============ POP view ============ */
.pop-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 20px;
  align-items: start;
}
.tmpl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tmpl-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  padding: 10px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  align-items: center;
  transition: border-color 0.12s;
}
.tmpl-card:hover { border-color: var(--border-strong); }
.tmpl-card.is-selected {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.tmpl-thumb {
  width: 56px;
  aspect-ratio: 1/1.4;
  border-radius: 2px;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid var(--border);
  overflow: hidden;
}
.tmpl-card .tmpl-name { font-size: 13px; font-weight: 600; }
.tmpl-card .tmpl-desc { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

.pop-preview-wrap {
  background: var(--bg-deep);
  border-radius: 4px;
  padding: 28px;
  display: grid;
  place-items: center;
  min-height: 600px;
  position: relative;
}
.pop-page {
  width: 420px;
  aspect-ratio: 210/297;
  background: #fff;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* pop templates — full-bleed image + price overlay */
.pop-tmpl {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}
.pop-tmpl .pop-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── BOLD: gold seal at bottom-right ── */
.pop-overlay-bold {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 18px 110px 0;
}
.pop-price-plate.bold {
  background: linear-gradient(180deg, #fff4d6, #ffd166 60%, #c2410c);
  color: #1a0a02;
  padding: 12px 18px 14px;
  border-radius: 6px;
  border: 2px solid #fffaea;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(0,0,0,0.25);
  transform: rotate(-3deg);
  text-align: center;
  min-width: 150px;
}
.pop-price-plate.bold .pp-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #5a1a02;
  margin-bottom: 2px;
}
.pop-price-plate.bold .pp-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 36px;
  font-weight: 800;
  color: #7a1a02;
  line-height: 1;
  text-shadow: 0 1px 0 #fff5cc;
}
.pop-price-plate.bold .pp-amount .y { font-size: 20px; margin-right: 2px; }
.pop-price-plate.bold .pp-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  color: #5a1a02;
  margin-top: 4px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ── MINIMAL: elegant gold price card on left ── */
.pop-overlay-minimal {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 110px 26px;
}
.pop-price-plate.minimal {
  background: rgba(8, 16, 36, 0.85);
  border: 1px solid rgba(255, 210, 138, 0.5);
  padding: 14px 20px 16px;
  text-align: left;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.pop-price-plate.minimal .pp-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  color: #d4af6b;
}
.pop-price-plate.minimal .pp-rule {
  height: 1px;
  background: linear-gradient(90deg, #d4af6b, transparent);
  margin: 6px 0 8px;
}
.pop-price-plate.minimal .pp-amount {
  font-family: "Noto Serif JP", "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 40px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  letter-spacing: 0.01em;
}
.pop-price-plate.minimal .pp-amount .y { font-size: 22px; color: #d4af6b; margin-right: 4px; font-weight: 500; }
.pop-price-plate.minimal .pp-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: #d4af6b;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ── FESTIVE: big yellow price slab over "今だけ注目価格！" ── */
.pop-overlay-festive {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 18px;
}
.pop-price-plate.festive {
  background: linear-gradient(180deg, #fff200, #ffb800);
  color: var(--danger);
  padding: 10px 28px 12px;
  border: 4px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 3px var(--danger), 0 6px 16px rgba(0,0,0,0.4);
  transform: rotate(-2deg);
  min-width: 220px;
  text-align: center;
}
.pop-price-plate.festive .pp-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 46px;
  font-weight: 800;
  color: var(--danger);
  line-height: 1;
  text-shadow: 0 2px 0 #fff;
  letter-spacing: -0.02em;
}
.pop-price-plate.festive .pp-amount .y { font-size: 26px; margin-right: 2px; }

/* pop fields */
.field-group { margin-bottom: 14px; }
.field-group label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 4px;
  font-weight: 600;
}
.field-group input,
.field-group textarea,
.field-group select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 3px;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}
.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  outline: 0;
  border-color: var(--accent);
}

.pop-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-toast {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.25s;
}
.export-toast .check {
  color: #4ade80; font-weight: 700;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
}

/* misc */
.muted { color: var(--ink-4); }
.row { display: flex; gap: 12px; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.gap-sm { gap: 8px; }
.divider-v { width: 1px; height: 20px; background: var(--border); }

.cross-event {
  background: var(--accent-tint);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  font-size: 11px;
  color: #8a3008;
  border-radius: 0 3px 3px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}
.cross-event .ce-em {
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.04em;
}

.ascii-arrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--ink-4);
}

/* ============ POS dashboard additions ============ */

/* sync bar — L1 bi-directional flow */
.sync-bar {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  gap: 18px;
}
.sync-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  font-size: 12px;
}
.sync-row .sync-dir {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 700;
  width: 22px;
  text-align: center;
}
.sync-row.write .sync-dir { color: var(--accent); }
.sync-row.read  .sync-dir { color: var(--navy); }
.sync-row .sync-label { color: var(--ink-2); }
.sync-row .sync-label b { font-weight: 700; }
.sync-row .sync-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ink-4);
  letter-spacing: 0.02em;
}
.sync-divider {
  width: 1px;
  background: var(--border);
  align-self: stretch;
  margin: 0;
}

/* auto-strip — L2 automation summary */
.auto-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(180deg, var(--accent-tint), #fff8f1);
  border: 1px solid #f5c39a;
  border-radius: 4px;
  margin-bottom: 14px;
}
.auto-strip .auto-stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.auto-strip .num-big {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.auto-strip .auto-u { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.auto-strip .auto-lbl { font-size: 11px; color: var(--ink-3); margin-left: 6px; letter-spacing: 0.04em; }
.auto-strip .auto-arrow {
  font-family: "JetBrains Mono", monospace;
  color: var(--ink-4);
  font-size: 14px;
}
.auto-strip .auto-tag {
  margin-left: auto;
  text-align: right;
  padding-left: 14px;
  border-left: 1px solid #f5c39a;
  white-space: nowrap;
}
.auto-strip .auto-tag-em {
  display: block;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent);
  white-space: nowrap;
}
.auto-strip .auto-tag-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
}
@media (max-width: 1180px) {
  .auto-strip { flex-wrap: wrap; }
  .auto-strip .auto-tag { width: 100%; border-left: 0; padding-left: 0; padding-top: 8px; border-top: 1px solid #f5c39a; margin-top: 4px; text-align: left; }
}

.kpi-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.kpi-card.danger {
  border-color: #fca5a5;
  background: linear-gradient(180deg, #fff8f7, var(--surface));
}
.kpi-card.danger::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--danger);
  border-radius: 4px 0 0 4px;
}
.kpi-card.headline {
  background: var(--navy-deep);
  color: #fff;
  border-color: var(--navy-deep);
}
.kpi-card.headline .kpi-label { color: #a8b9cc; display: flex; align-items: center; gap: 8px; }
.kpi-card.headline .kpi-value { color: #fff; font-size: 38px; }
.kpi-card.headline .kpi-value .kpi-unit { color: #fdd28a; font-size: 16px; }
.kpi-card.headline .kpi-trend.headline { color: #fdd28a; }
.kpi-badge {
  font-size: 9px;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 8px;
}
.kpi-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-value .kpi-unit { font-size: 13px; color: var(--ink-3); font-weight: 500; font-family: "Noto Sans JP", sans-serif; }
.kpi-trend {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 10px;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.headline { color: #fdd28a; font-weight: 600; }

/* stock badges — L1 read direction */
.stock-badge {
  display: inline-flex;
  align-items: center;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
  letter-spacing: 0.02em;
}
.stock-badge.zero { background: var(--danger-tint); color: var(--danger); }
.stock-badge.low  { background: var(--warn-tint);   color: #92670a; }
.stock-badge.ok   { background: var(--bg-deep);     color: var(--ink-3); }

.reorder-flag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  margin-left: 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 2px;
  letter-spacing: 0.04em;
  vertical-align: middle;
  white-space: nowrap;
}
.retry-inline {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--ink-4);
  margin-left: 4px;
}

/* toast */
.pos-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px 12px 18px;
  background: #fff7f5;
  border: 1px solid #fca5a5;
  border-left: 4px solid var(--danger);
  border-radius: 4px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.pos-toast .toast-led {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulse 1.2s infinite;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.15);
}
.pos-toast .toast-body { flex: 1; }
.pos-toast .toast-title { font-weight: 700; font-size: 13px; color: #7f1d1d; }
.pos-toast .toast-sub { font-size: 11px; color: #991b1b; margin-top: 2px; }
.btn-x {
  background: transparent;
  border: 0;
  font-size: 18px;
  color: var(--ink-3);
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1;
}
.btn-x:hover { color: var(--ink); }

/* status LED chip */
.status-led {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.status-led .led {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-led.ok .led    { background: var(--success); box-shadow: 0 0 0 2px var(--success-tint); }
.status-led.ok         { color: var(--success); }
.status-led.warn .led  { background: var(--warn); animation: pulse 1.2s infinite; }
.status-led.warn       { color: #92670a; }
.status-led.err .led   { background: var(--danger); box-shadow: 0 0 0 2px var(--danger-tint); }
.status-led.err        { color: var(--danger); }

/* pos table */
.pos-table { table-layout: auto; }
.pos-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
.pos-table tbody tr:hover { background: var(--surface-2); }
.pos-table tbody tr.is-selected { background: var(--accent-tint); }
.pos-table tbody tr.is-selected td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}
.pos-table td { padding: 11px 12px; white-space: nowrap; }
.pos-table th { padding: 9px 12px; white-space: nowrap; }
.pos-table td b { font-weight: 700; }
.pos-table .card-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

/* small button */
.btn-xs {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* queue chart note */
.chart-note {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--success-tint);
  border-radius: 3px;
  border-left: 3px solid var(--success);
}
.chart-note b { color: var(--success); }

/* compact kv list */
.kv-list.compact { gap: 6px 14px; font-size: 12px; }
.kv-list.compact dt { font-size: 11px; }

/* small log */
.pos-log.small li {
  grid-template-columns: 60px 1fr;
  gap: 10px;
  padding: 6px 14px;
  font-size: 11px;
}

/* pos-grid 2 col layout */
.pos-grid.pos-grid-2 {
  grid-template-columns: minmax(0, 1fr) 360px;
  margin-top: 14px;
}
@media (max-width: 1280px) {
  .pos-grid.pos-grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* danger / success action panels (inside detail card, below) */
.danger-action {
  padding: 14px 16px;
  background: var(--danger-tint);
  border-top: 1px solid #fca5a5;
}
.danger-action .da-title { font-weight: 700; font-size: 13px; color: #7f1d1d; margin-bottom: 4px; }
.danger-action .da-text { font-size: 11px; color: #7f1d1d; line-height: 1.55; margin-bottom: 10px; }
.danger-action .da-buttons { display: flex; gap: 8px; }

.success-action {
  padding: 14px 16px;
  background: var(--success-tint);
  border-top: 1px solid #86efac;
  display: flex;
  align-items: center;
  gap: 14px;
}
.success-action .check-big {
  width: 32px; height: 32px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
