.sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 18%),
    var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 1px solid var(--sidebar-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 18px;
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, #1c6b68, #0f3d3e);
  color: #f4efe6;
  font-family: var(--display);
  font-weight: 680;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.brand-copy strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.brand-copy small {
  color: var(--sidebar-muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-label {
  margin: 14px 12px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sidebar-muted);
}

.nav-btn[data-nav="merge"],
.nav-btn[data-nav="samples"] {
  display: none !important;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  color: var(--sidebar-muted);
  font-weight: 600;
  font-size: 14px;
  text-align: left;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}

.nav-btn[hidden],
.nav-label[hidden] {
  display: none !important;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }

.nav-btn.active {
  background: rgba(196, 92, 38, 0.16);
  color: #fff6ee;
  box-shadow: inset 0 0 0 1px rgba(196, 92, 38, 0.28);
}

.nav-btn .count {
  margin-left: auto;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

.nav-btn.active .count { background: var(--clay); color: #fff; }

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar-foot a,
.help-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  text-align: left;
}

.sidebar-foot a:hover,
.help-link:hover { color: #fff; }

.help-link { margin-bottom: 4px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 251, 249, 0.78);
  backdrop-filter: blur(16px);
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.topbar-title strong { font-size: 15px; }
.topbar-title small { color: var(--muted); font-size: 12px; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  transition: transform 140ms var(--ease), background 140ms var(--ease), opacity 140ms;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--pine);
  color: #f4efe6;
}

.btn-primary:hover:not(:disabled) { background: var(--pine-2); }

.btn-accent {
  background: var(--clay);
  color: #fffaf1;
}

.btn-accent:hover:not(:disabled) { background: var(--clay-2); }

.btn-ghost {
  background: #fff;
  color: var(--pine);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn-ghost:hover:not(:disabled) { background: var(--surface); }

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 9px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef4f2;
  color: var(--pine);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.err { background: var(--danger-bg); color: var(--danger); }
.chip.ok { background: var(--ok-bg); color: var(--ok); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.panel-head h2, .panel-head h3 {
  font-size: 16px;
  font-weight: 700;
}

.panel-head .picker-head-row {
  flex: 1;
  min-width: 0;
}

.panel-body { padding: 14px 16px 16px; min-height: 0; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field select,
.search-input {
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  font-size: 14px;
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.search-input { width: 100%; padding-left: 34px; }

.dropzone {
  border: 1.5px dashed #c7d4cf;
  border-radius: 14px;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 24px;
  background:
    linear-gradient(#fbfdfc, #f4f8f6);
  cursor: pointer;
  transition: border-color 160ms var(--ease), background 160ms var(--ease), transform 160ms var(--ease);
}

.dropzone:hover, .dropzone.drag {
  border-color: var(--clay);
  background: #fff6ee;
  transform: translateY(-1px);
}

.dropzone strong { font-size: 17px; }
.dropzone span { color: var(--muted); font-size: 13px; }
.dropzone em {
  color: var(--pine);
  font-style: normal;
  font-weight: 700;
  margin-top: 8px;
}

.drop-icon {
  width: 52px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 10px;
  background:
    linear-gradient(#c45c26, #c45c26) 10px 12px / 28px 3px no-repeat,
    linear-gradient(#0f3d3e, #0f3d3e) 10px 20px / 20px 3px no-repeat,
    linear-gradient(180deg, #e9efe9, #d7e0dc);
}

.status-pill {
  min-width: 132px;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
}

.status-pill.ok { background: var(--ok-bg); color: var(--ok); }
.status-pill.bad { background: var(--danger-bg); color: var(--danger); }
.status-pill.wait { background: var(--warn-bg); color: var(--warn); }

.toast-host {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  min-width: 260px;
  max-width: 380px;
  background: var(--sidebar);
  color: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 220ms var(--ease);
  font-size: 13px;
  font-weight: 600;
}

.toast.ok { box-shadow: 0 12px 32px var(--pine-glow); }
.toast.err { background: #3f1210; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 6px;
  color: var(--muted);
  padding: 28px 16px;
  min-height: 140px;
}

.empty strong { color: var(--ink); font-size: 15px; }

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: #eef3f1;
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--muted);
}

.callout {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ef, #fff1e6);
  border: 1px solid #f0d0b4;
  color: var(--clay-2);
  font-size: 13px;
  line-height: 1.45;
}

.callout strong {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.callout span { color: var(--ink-soft); font-weight: 500; }

.flow-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.flow-steps li b {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4f2;
  font-size: 11px;
}

.flow-steps li.on {
  background: var(--pine);
  color: #f4efe6;
  border-color: var(--pine);
}

.flow-steps li.on b { background: rgba(255,255,255,0.16); color: #fff; }

.flow-steps li.done {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #b7ddc8;
}

.flow-steps li.done b { background: var(--ok); color: #fff; }

.mini-steps {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-steps li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.mini-steps li b {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #eef4f2;
  font-size: 10px;
}

.mini-steps li.on {
  background: var(--pine);
  color: #f4efe6;
  border-color: var(--pine);
}

.mini-steps li.on b { background: rgba(255,255,255,0.18); }

.mini-steps li.done {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #b7ddc8;
}

.iso-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow);
  min-width: 240px;
  max-width: 320px;
}

.iso-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.iso-head span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clay);
}

.iso-head strong { font-size: 13px; }

.iso-card > p,
.guide-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.iso-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
  gap: 4px;
}

.iso-grid.compact {
  max-width: 280px;
  margin: 0 auto 14px;
}

.iso-cell {
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  background: #f4f8f6;
  color: var(--muted);
}

.iso-cell.head {
  background: transparent;
  color: var(--pine);
  padding-bottom: 2px;
}

.iso-cell.lab {
  text-align: left;
  background: #eef4f2;
  color: var(--ink);
}

.iso-cell.yes {
  background: var(--ok-bg);
  color: var(--ok);
}

.iso-cell.no {
  background: #f3f5f4;
  color: var(--faint);
}

.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--guide-z);
  background: rgba(7, 22, 23, 0.52);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.guide-sheet {
  width: min(720px, 100%);
  max-height: min(88dvh, 820px);
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: toast-in 220ms var(--ease);
}

.guide-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px 12px;
  border-bottom: 1px solid var(--line);
}

.guide-head h2 {
  font-family: var(--display);
  font-size: 26px;
  letter-spacing: -0.03em;
  margin-top: 4px;
}

.guide-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  background: #f3f7f5;
}

.guide-close:hover { background: #e7eeeb; color: var(--ink); }

.guide-body {
  overflow: auto;
  padding: 8px 22px 18px;
  display: grid;
  gap: 18px;
}

.guide-block h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.guide-block p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.guide-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 14px;
}

.guide-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.guide-split article {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #fbfdfc;
}

.guide-split p { margin: 8px 0 0; font-size: 13px; }

.guide-foot {
  padding: 12px 22px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
}

.pair-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 2px 2px 0;
}

.pair-bar-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
}

.pair-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border-radius: 999px;
  padding: 2px 4px 2px 4px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #fff;
}

.pair-chip > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
}

.pair-chip.split { background: var(--ok-bg); border-color: #b7ddc8; color: var(--ok); }
.pair-chip.share { background: var(--clay-soft); border-color: #f0d0b4; color: var(--clay-2); }

.pair-chip > button { color: inherit; }

.pair-chip b { font-weight: 800; }
.pair-chip span { opacity: 0.85; }

.pair-chip .pair-x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(16, 32, 31, 0.08);
  font-size: 13px;
  line-height: 1;
}

.pair-chip .pair-x:hover { background: rgba(16, 32, 31, 0.16); }

.pair-chip:hover { transform: translateY(-1px); }

.empty-card {
  max-width: 460px;
  padding: 8px;
}

.empty-card strong { display: block; font-size: 20px; margin-bottom: 8px; }

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: #f4efe6;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}

.picker-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px 10px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.picker-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
}

.lg-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: var(--clay);
}

.lg-swatch.split { background: var(--pine); }
.lg-swatch.share { background: var(--clay); }

.picker-panel.is-waiting {
  opacity: 0.72;
}

.picker-panel.is-waiting .picker-scroll {
  pointer-events: none;
}

@media (max-width: 860px) {
  .guide-split { grid-template-columns: 1fr; }
  .iso-card { max-width: none; }
}
