:root {
  --bg: #efe8d8;
  --panel: rgba(255, 250, 241, 0.82);
  --panel-strong: #fffaf0;
  --ink: #1d2b2a;
  --muted: #6a776f;
  --line: rgba(50, 66, 61, 0.12);
  --accent: #c55b2d;
  --accent-deep: #7a3520;
  --shadow: 0 22px 60px rgba(45, 40, 28, 0.12);
  --radius-lg: 28px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 35%),
    linear-gradient(135deg, #f5efd9 0%, #e9dfca 50%, #e6d4be 100%);
  font-family: "Avenir Next", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.has-modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 24px auto 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 16px;
}

.topbar h1,
.card-header h2,
.wheel-header h2,
.control-card h2 {
  margin: 0;
  font-family: "Futura", "Avenir Next", sans-serif;
  letter-spacing: 0.01em;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(122, 53, 32, 0.86);
}

.topbar h1 {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.02;
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
}

.brand-lockup-logo {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  object-fit: cover;
  flex: 0 0 auto;
  box-shadow: 0 14px 28px rgba(45, 40, 28, 0.12);
}

.brand-lockup-copy {
  display: grid;
  gap: 2px;
}

.card-header h2,
.wheel-header h2 {
  font-size: clamp(22px, 2.1vw, 32px);
  line-height: 1.08;
}

.topbar-actions,
.ai-actions,
.inline-fields {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.plan-switch,
.inline-fields label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.brand-switch {
  min-width: 400px;
  justify-self: end;
}

.brand-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  overflow: visible;
}

.account-panel {
  min-width: min(560px, 100%);
}

.account-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 24px rgba(45, 40, 28, 0.08);
}

.account-entry-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.account-entry-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(122, 53, 32, 0.86);
}

.account-entry-copy strong {
  font-size: 14px;
  line-height: 1.1;
}

.account-entry-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-entry-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.account-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.account-plan-badge.is-member {
  background: rgba(37, 72, 67, 0.92);
  color: #fffaf1;
}

.account-plan-badge.is-free {
  background: rgba(197, 91, 45, 0.12);
  color: var(--accent-deep);
}

.account-entry-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-button {
  min-height: 38px;
  padding: 0 16px;
}

.brand-option-stack {
  position: relative;
  display: block;
  align-items: start;
}

.brand-option-stack.is-ak-open {
  z-index: 2;
}

.brand-option {
  min-height: 54px;
  padding: 8px 12px;
  border-radius: 18px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(45, 40, 28, 0.08);
  position: relative;
}

.brand-option.is-active {
  background: rgba(255, 250, 241, 0.98);
  border-color: rgba(122, 53, 32, 0.18);
  box-shadow: 0 12px 28px rgba(45, 40, 28, 0.12);
}

.brand-option-logo-wrap {
  position: relative;
  width: 56px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-option-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.brand-option-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
  max-width: 118px;
}

.brand-option-copy {
  display: grid;
  gap: 4px;
  align-items: start;
  min-width: 0;
}

.brand-option-mode-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  width: fit-content;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(29, 43, 42, 0.92);
  color: #fffaf1;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.08em;
  box-shadow: 0 6px 14px rgba(29, 43, 42, 0.12);
}

.brand-subpicker {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 16px 34px rgba(45, 40, 28, 0.16);
  transform-origin: top left;
  z-index: 3;
}

.brand-subpicker.is-open {
  animation: akSubpickerPop 220ms ease-out;
}

.brand-suboption {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-suboption.is-active {
  background: rgba(29, 43, 42, 0.88);
  color: #fffaf1;
  box-shadow: 0 8px 20px rgba(29, 43, 42, 0.14);
}

@keyframes akSubpickerPop {
  0% {
    opacity: 0;
    transform: translateY(-6px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.wide-field {
  min-width: 280px;
  flex: 1;
}

select,
input {
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid rgba(56, 57, 42, 0.15);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

button {
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary-button {
  color: #fff9f2;
  background: linear-gradient(135deg, #b54b22 0%, #d57a2f 100%);
  box-shadow: 0 12px 24px rgba(181, 75, 34, 0.2);
}

.secondary-button,
.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(35, 43, 39, 0.1);
}

.layout,
.content-grid,
.insight-grid,
.workspace-grid,
.top-row,
.view-panel {
  display: grid;
  gap: 18px;
}

.toolbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.top-row {
  grid-template-columns: 1fr;
}

.view-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.view-tab {
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.view-tab.is-active {
  background: rgba(29, 43, 42, 0.9);
  color: #fffaf1;
  box-shadow: 0 10px 24px rgba(29, 43, 42, 0.16);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: grid;
}

.workspace-grid {
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 320px);
  align-items: start;
}

.control-card,
.wheel-card,
.list-card,
.detail-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.control-card,
.list-card,
.detail-card {
  padding: 20px;
}

.wheel-card {
  position: relative;
  padding: 18px 18px 10px;
  overflow: visible;
}

.helper-text {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wheel-header,
.card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.wheel-tools,
.zoom-actions,
.selection-tools,
.combo-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wheel-tools {
  justify-content: flex-end;
}

.selection-tools {
  justify-content: end;
}

.inventory-header {
  display: grid;
  gap: 14px;
}

.inventory-heading {
  min-width: 0;
}

.inventory-heading h2 {
  white-space: nowrap;
}

.inventory-tools {
  justify-content: flex-start;
  width: 100%;
  padding: 4px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(35, 43, 39, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.inventory-tool-button {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: none;
  position: relative;
}

.inventory-tool-button:hover {
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 6px 14px rgba(45, 40, 28, 0.08);
}

.inventory-tool-button.is-active {
  background: rgba(29, 43, 42, 0.9);
  color: #fffaf1;
  border-color: rgba(29, 43, 42, 0.22);
  box-shadow: 0 10px 20px rgba(29, 43, 42, 0.12);
}

.inventory-tool-button.has-login-hint::after {
  content: attr(data-login-hint);
  position: absolute;
  top: -7px;
  right: -3px;
  min-height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(197, 91, 45, 0.92);
  color: #fffaf1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 6px 12px rgba(45, 40, 28, 0.12);
  pointer-events: none;
}

.inventory-tool-clear {
  margin-left: auto;
}

.owned-manager-content {
  display: grid;
  gap: 18px;
}

.owned-manager-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.owned-manager-toolbar,
.owned-manager-actions {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.owned-manager-brand-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 1;
  flex-wrap: wrap;
}

.owned-manager-brand-summary,
.owned-manager-brand-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.owned-manager-brand-meta strong,
.brand-card strong {
  display: block;
  font-size: 15px;
}

.owned-manager-brand-meta span,
.brand-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.owned-search-field {
  min-width: 280px;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 220px));
  gap: 16px;
}

.brand-card {
  min-height: 180px;
  padding: 20px 18px;
  border-radius: 24px;
  border: 1px solid rgba(55, 60, 43, 0.1);
  background: linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(247, 239, 223, 0.92));
  display: grid;
  justify-items: start;
  align-content: start;
  gap: 14px;
  box-shadow: 0 16px 38px rgba(45, 40, 28, 0.08);
}

.brand-logo,
.brand-logo-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 22px;
  overflow: hidden;
}

.brand-logo {
  width: 116px;
  height: 44px;
  padding: 0;
  border-radius: 0;
  justify-content: flex-start;
}

.brand-logo-chip {
  width: 78px;
  height: 30px;
  padding: 0;
  border-radius: 0;
}

.brand-logo-image,
.brand-logo-chip-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.brand-logo-charcoal,
.brand-logo-chip-charcoal {
  background: transparent;
  box-shadow: none;
}

.brand-logo-carmine,
.brand-logo-chip-carmine {
  background: transparent;
  box-shadow: none;
}

.brand-logo-olive,
.brand-logo-chip-olive {
  background: transparent;
  box-shadow: none;
}

.selection-entry {
  margin-top: 16px;
  display: flex;
  align-items: end;
  gap: 12px;
}

.lab-actions {
  margin-top: 16px;
}

.lab-material-picker {
  margin-top: 16px;
  position: relative;
  flex: 1;
  min-height: 0;
}

.lab-material-list-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.lab-material-list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lab-material-list-title,
.lab-material-menu-header {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
}

.lab-material-add-btn,
.lab-selected-material-remove,
.lab-material-menu-arrow {
  min-height: 32px;
  width: 32px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lab-material-add-btn {
  background: rgba(35, 43, 39, 0.92);
  color: #fffaf1;
  font-size: 20px;
  font-weight: 500;
  box-shadow: 0 10px 24px rgba(29, 43, 42, 0.16);
}

.lab-material-selection-list {
  display: grid;
  gap: 10px;
  flex: 1;
  min-height: 0;
  align-content: start;
  grid-auto-rows: min-content;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.lab-selected-material-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  height: 48px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.92);
  border: 1px solid rgba(55, 60, 43, 0.08);
}

.lab-selected-material-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.lab-selected-material-remove {
  background: rgba(35, 43, 39, 0.08);
  color: rgba(33, 56, 53, 0.9);
  font-size: 18px;
  font-weight: 500;
}

.lab-material-empty,
.lab-material-menu-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.lab-material-menu-popover {
  position: absolute;
  top: 0;
  left: calc(100% + 14px);
  z-index: 8;
  display: grid;
  grid-template-columns: 220px;
  gap: 10px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 250, 241, 0.98);
  box-shadow: 0 18px 40px rgba(45, 40, 28, 0.18);
}

.lab-material-menu-popover.is-showing-children {
  grid-template-columns: 220px 220px;
}

.lab-material-menu-column {
  display: grid;
  align-content: start;
  gap: 8px;
}

.lab-material-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.lab-material-menu-main {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(35, 43, 39, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  display: flex;
  align-items: center;
  text-align: left;
  justify-content: flex-start;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lab-material-menu-main.is-child {
  justify-content: flex-start;
}

.lab-material-menu-main.is-active,
.lab-material-menu-arrow.is-active {
  background: rgba(47, 95, 86, 0.14);
  border-color: rgba(47, 95, 86, 0.3);
  color: #244843;
}

.lab-material-menu-arrow {
  background: rgba(35, 43, 39, 0.08);
  color: rgba(33, 56, 53, 0.9);
  font-size: 20px;
  font-weight: 500;
}

.selection-entry-field {
  flex: 1;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.selection-helper {
  margin-bottom: 0;
}

.wheel-meta,
.count-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(43, 58, 56, 0.07);
  color: var(--muted);
  font-size: 12px;
}

.tool-button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.eye-toggle {
  position: relative;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(36, 72, 67, 0.64);
}

.eye-toggle:hover {
  background: rgba(255, 250, 241, 0.28);
  box-shadow: none;
}

.chart-eye {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 5;
}

.eye-icon {
  display: block;
  width: 28px;
  height: 18px;
  color: currentColor;
}

.eye-icon-shape {
  fill: currentColor;
}

.eye-icon-iris {
  fill: rgba(255, 250, 241, 0.96);
}

.eye-icon-pupil {
  fill: currentColor;
}

.eye-icon-glint {
  fill: rgba(255, 250, 241, 0.98);
}

.eye-toggle:not(.is-active) {
  color: rgba(36, 72, 67, 0.34);
}

.eye-toggle:not(.is-active) .eye-icon {
  opacity: 0.92;
}

.eye-toggle:not(.is-active)::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transform: rotate(-32deg);
}

.mode-switch {
  position: relative;
  min-width: 152px;
  min-height: 42px;
  padding: 0 68px 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(35, 43, 39, 0.1);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 0 8px 20px rgba(45, 40, 28, 0.06);
}

.mode-switch::before {
  content: "";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 28px;
  border-radius: 999px;
  background: rgba(35, 43, 39, 0.14);
  border: 1px solid rgba(35, 43, 39, 0.08);
  transition: background 160ms ease;
}

.mode-switch::after {
  content: "";
  position: absolute;
  right: 35px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdf7, #f3eee2);
  box-shadow: 0 3px 8px rgba(25, 30, 28, 0.18);
  transition: transform 160ms ease;
}

.mode-switch-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.mode-switch-track {
  display: none;
}

.mode-switch-thumb {
  display: none;
}

.mode-switch.is-active {
  background: rgba(244, 251, 248, 0.95);
  border-color: rgba(47, 95, 86, 0.32);
}

.mode-switch.is-active .mode-switch-label {
  color: #244843;
}

.mode-switch.is-active::before {
  background: rgba(47, 95, 86, 0.78);
}

.mode-switch.is-active::after {
  transform: translate(24px, -50%);
}

.tool-button.is-active {
  background: rgba(47, 95, 86, 0.14);
  border-color: rgba(47, 95, 86, 0.4);
  color: #244843;
  box-shadow: 0 0 0 2px rgba(47, 95, 86, 0.12);
}

.tool-button.is-locked {
  border-style: dashed;
  color: rgba(122, 53, 32, 0.92);
}

.inventory-tools .inventory-tool-button.is-active {
  background: rgba(29, 43, 42, 0.9);
  color: #fffaf1;
  border-color: rgba(29, 43, 42, 0.22);
  box-shadow: 0 10px 20px rgba(29, 43, 42, 0.12);
}

.svg-wrap {
  position: relative;
  margin-top: 12px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.zoom-slider {
  position: absolute;
  left: 10px;
  bottom: 14px;
  z-index: 5;
  width: 38px;
  display: grid;
  justify-items: center;
  gap: 8px;
  user-select: none;
}

.zoom-slider-label {
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  color: rgba(36, 72, 67, 0.52);
}

.zoom-slider-track {
  position: relative;
  width: 38px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
}

.zoom-slider-rail {
  width: 6px;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(36, 72, 67, 0.16), rgba(36, 72, 67, 0.38));
  box-shadow: inset 0 0 0 1px rgba(255, 250, 241, 0.22);
}

.zoom-slider-thumb {
  position: absolute;
  left: 50%;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.98);
  border: 1px solid rgba(36, 72, 67, 0.2);
  box-shadow: 0 8px 20px rgba(26, 34, 31, 0.14);
  transform: translate(-50%, 0);
}

.zoom-slider-thumb::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(36, 72, 67, 0.66);
  transform: translate(-50%, -50%);
}

.zoom-slider.is-dragging .zoom-slider-thumb,
.zoom-slider:hover .zoom-slider-thumb {
  box-shadow:
    0 0 0 4px rgba(36, 72, 67, 0.1),
    0 10px 24px rgba(26, 34, 31, 0.18);
}

.candidate-hint {
  position: absolute;
  left: 56px;
  top: 16px;
  z-index: 4;
  max-width: min(70%, 420px);
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(244, 251, 248, 0.94);
  border: 1px solid rgba(47, 95, 86, 0.22);
  color: #244843;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(47, 95, 86, 0.1);
}

.svg-wrap.is-searching {
  box-shadow:
    inset 0 0 0 2px rgba(47, 95, 86, 0.28),
    0 0 0 8px rgba(47, 95, 86, 0.08);
  border-radius: 24px;
}

.svg-wrap.is-searching::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(47, 95, 86, 0.34);
  border-radius: 22px;
  pointer-events: none;
}

.wheel-card.is-searching {
  box-shadow:
    0 22px 60px rgba(45, 40, 28, 0.12),
    0 0 0 2px rgba(47, 95, 86, 0.12);
}

.guide-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

.guide-card {
  position: absolute;
  pointer-events: auto;
  min-height: 0;
  padding: var(--guide-pad-y, 10px) var(--guide-pad-x, 14px);
  border-radius: var(--guide-radius, 20px);
  border: 1px solid rgba(34, 34, 34, 0.16);
  box-shadow: 0 10px 24px rgba(35, 26, 22, 0.14);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: var(--guide-gap, 4px);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.guide-card.is-code-only {
  justify-content: center;
}

.guide-card.is-swatch-only {
  padding: 0;
  justify-content: center;
}

.guide-card-code {
  display: block;
  width: 100%;
  font-size: var(--guide-code-size, 24px);
  font-weight: 800;
  line-height: 0.98;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-card-name {
  display: block;
  width: 100%;
  font-size: var(--guide-name-size, 20px);
  line-height: 1;
  opacity: 0.92;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.guide-card.is-in-combo {
  border: 3px dashed #b55a2d;
}

.guide-card.is-hover-linked {
  transform: translateY(-1px);
  border-color: rgba(37, 70, 65, 0.42);
  box-shadow:
    0 0 0 3px rgba(37, 70, 65, 0.18),
    0 12px 28px rgba(37, 70, 65, 0.16);
}

.svg-wrap.is-dragging {
  cursor: grabbing;
}

#wheelSvg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.selected-list,
.owned-list {
  margin-top: 18px;
}

.selected-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 6px 14px;
  margin: 4px -8px -6px -8px;
}

.lab-result-list {
  gap: 16px;
}

.lab-control-scroll,
.lab-result-list {
  flex: 1;
  min-height: 0;
  padding-right: 6px;
}

.lab-control-scroll {
  display: flex;
  flex-direction: column;
  align-content: stretch;
  overflow: visible;
}

.lab-material-group {
  display: grid;
  gap: 12px;
}

.lab-material-group-header h3 {
  margin: 0;
  font-size: 15px;
}

.lab-material-group-header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lab-generated-stack {
  display: grid;
  gap: 10px;
}

.owned-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 6px;
}

.owned-manager-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: min(72vh, 980px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px;
}

.owned-manager-list .owned-group-grid {
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.inventory-card,
.selection-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.owned-group {
  display: grid;
  gap: 10px;
}

.owned-group-label {
  padding-left: 2px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
}

.owned-group-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.selected-item,
.owned-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid rgba(55, 60, 43, 0.08);
}

.selected-list .selected-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-rows: auto auto;
  gap: 8px 10px;
  padding-right: 18px;
}

.selected-list .selected-item .paint-chip-wrap {
  grid-row: 1 / span 2;
}

.selected-list .selected-item .paint-meta {
  grid-row: 1 / span 2;
  align-self: center;
}

.selected-list .selected-item .owned-action-button {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
}

.selected-list .selected-item .info-icon {
  grid-column: 4;
  grid-row: 1 / span 2;
  align-self: center;
}

.selected-list .selected-item .remove-icon {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 3;
  min-height: 34px;
  width: 34px;
  background: rgba(255, 250, 241, 1);
  border: 1px solid rgba(197, 91, 45, 0.2);
  box-shadow: 0 10px 18px rgba(45, 40, 28, 0.14);
}

.paint-chip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(34, 34, 34, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.paint-chip-wrap {
  position: relative;
  display: inline-flex;
}

.paint-chip-wrap .paint-chip-favorite {
  position: absolute;
  top: -5px;
  left: -5px;
  z-index: 2;
  min-height: 14px;
  width: 14px;
  border-radius: 999px;
  padding: 0;
  font-size: 9px;
  line-height: 1;
  background: rgba(255, 250, 241, 0.98);
  border: 1px solid rgba(197, 91, 45, 0.22);
  box-shadow: 0 4px 10px rgba(45, 40, 28, 0.12);
}

.paint-chip-wrap .paint-chip-favorite:hover {
  background: rgba(255, 246, 238, 1);
}

.paint-chip-wrap .paint-chip-favorite.is-active {
  background: rgba(255, 241, 234, 1);
  border-color: rgba(197, 91, 45, 0.3);
}

.paint-chip-wrap .paint-chip-favorite.is-locked {
  background: rgba(255, 250, 241, 0.98);
  border-style: dashed;
}

.paint-chip-mark {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(23, 43, 39, 0.78);
  color: #fffaf1;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.paint-meta strong {
  display: block;
  font-size: 14px;
}

.paint-meta span,
.paint-meta small {
  display: block;
  color: var(--muted);
}

.paint-meta {
  min-width: 0;
}

.paint-meta strong,
.paint-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
  border: 1px solid rgba(55, 60, 43, 0.08);
  position: relative;
  overflow: visible;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.selected-item:hover {
  transform: translateY(-1px);
  border-color: rgba(181, 75, 34, 0.18);
}

.selected-item.is-in-combo {
  border: 2px dashed rgba(181, 75, 34, 0.72);
  box-shadow: 0 0 0 2px rgba(181, 75, 34, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 250, 241, 0.98), rgba(255, 246, 236, 0.96));
}

.selected-item.is-hover-linked {
  border-color: rgba(47, 95, 86, 0.6);
  box-shadow: 0 0 0 3px rgba(47, 95, 86, 0.16);
  background: #fffdf8;
}

.lab-generated-item {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  cursor: default;
}

.lab-generated-item:hover {
  transform: none;
}

.lab-tone-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(35, 43, 39, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.favorite-icon,
.owned-action-button,
.info-icon,
.remove-icon {
  min-height: 30px;
  width: 30px;
  padding: 0;
  border-radius: 999px;
}

.favorite-icon {
  background: rgba(197, 91, 45, 0.08);
  color: rgba(143, 69, 49, 0.88);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.favorite-icon:hover {
  background: rgba(197, 91, 45, 0.14);
}

.favorite-icon.is-active {
  background: rgba(197, 91, 45, 0.18);
  color: #b34728;
  box-shadow: 0 0 0 2px rgba(197, 91, 45, 0.12);
}

.favorite-icon.is-locked {
  background: rgba(35, 43, 39, 0.06);
  color: rgba(104, 91, 69, 0.9);
  border: 1px dashed rgba(104, 91, 69, 0.24);
  box-shadow: none;
}

.favorite-icon.is-locked:hover {
  background: rgba(35, 43, 39, 0.1);
}

.owned-action-button {
  background: rgba(36, 72, 67, 0.08);
  color: #244843;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.owned-action-button:hover {
  background: rgba(36, 72, 67, 0.14);
}

.owned-action-button.is-active {
  background: rgba(37, 72, 67, 0.88);
  color: #fffaf1;
  box-shadow: 0 0 0 2px rgba(37, 72, 67, 0.14);
}

.owned-action-button.is-locked {
  background: rgba(35, 43, 39, 0.06);
  color: rgba(104, 91, 69, 0.9);
  border: 1px dashed rgba(104, 91, 69, 0.24);
  box-shadow: none;
}

.owned-action-button.is-locked:hover {
  background: rgba(35, 43, 39, 0.1);
}

.info-icon {
  background: rgba(35, 43, 39, 0.08);
  color: rgba(33, 56, 53, 0.9);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.info-icon:hover {
  background: rgba(47, 95, 86, 0.14);
}

.remove-icon {
  background: rgba(35, 43, 39, 0.08);
  color: var(--accent-deep);
  font-size: 22px;
  line-height: 1;
}

.remove-icon:hover {
  background: rgba(197, 91, 45, 0.14);
}

.owned-swatch {
  position: relative;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(55, 60, 43, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.owned-swatch.is-compact {
  min-height: 34px;
  border-radius: 10px;
}

.owned-swatch:hover {
  box-shadow:
    0 8px 18px rgba(77, 64, 40, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.owned-swatch.is-selected {
  border-color: rgba(29, 43, 42, 0.72);
  box-shadow:
    0 0 0 3px rgba(29, 43, 42, 0.2),
    0 10px 18px rgba(32, 39, 37, 0.12),
    inset 0 0 0 2px rgba(255, 250, 241, 0.5);
}

.owned-swatch.is-owned {
  border-color: rgba(35, 67, 61, 0.38);
  box-shadow:
    0 0 0 2px rgba(35, 67, 61, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34);
}

.owned-swatch.is-hover-linked {
  border-color: rgba(47, 95, 86, 0.78);
  box-shadow:
    0 0 0 3px rgba(47, 95, 86, 0.2),
    0 10px 20px rgba(47, 95, 86, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.owned-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(23, 43, 39, 0.74);
  color: #fffaf1;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  z-index: 2;
}

.favorite-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(197, 91, 45, 0.9);
  color: #fff7f2;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(90, 38, 24, 0.2);
}

.owned-swatch.is-manager {
  cursor: pointer;
}

.owned-swatch.is-manager:hover {
  box-shadow:
    0 10px 20px rgba(77, 64, 40, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.selected-mark {
  position: absolute;
  right: 4px;
  bottom: 4px;
  min-width: 28px;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(29, 43, 42, 0.86);
  color: #fffaf1;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(22, 26, 24, 0.18);
}

.owned-swatch.is-compact .owned-mark {
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  font-size: 8px;
}

.owned-swatch.is-compact .favorite-mark {
  top: 3px;
  left: 3px;
  width: 13px;
  height: 13px;
  font-size: 8px;
}

.owned-tooltip-layer {
  --tooltip-arrow-left: 50%;
  position: fixed;
  left: 0;
  top: 0;
  min-width: 146px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(27, 37, 35, 0.94);
  color: #fffaf1;
  box-shadow: 0 14px 30px rgba(28, 24, 18, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 1000;
}

.owned-tooltip-layer.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.owned-tooltip-layer::after {
  content: "";
  position: absolute;
  left: var(--tooltip-arrow-left);
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(27, 37, 35, 0.94);
}

.owned-tooltip-layer[data-placement="bottom"] {
  transform: translateY(-6px);
}

.owned-tooltip-layer[data-placement="bottom"].is-visible {
  transform: translateY(0);
}

.owned-tooltip-layer[data-placement="bottom"]::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(27, 37, 35, 0.94);
}

.owned-tooltip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.owned-tooltip-row strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.owned-tooltip-swatch {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid rgba(255, 250, 241, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.owned-tooltip-text {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 250, 241, 0.82);
}

.lab-control-card,
.lab-result-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.lab-control-card {
  position: relative;
  z-index: 12;
  overflow: visible;
}

.lab-result-card {
  overflow: hidden;
}

.lab-wheel-card .svg-wrap {
  aspect-ratio: 1 / 1;
  min-height: 0;
  cursor: grab;
}

.lab-svg-wrap {
  margin-top: 12px;
}

#labWheelSvg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
}

.lab-material-label {
  font-size: 18px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 250, 241, 0.92);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.lab-point {
  cursor: pointer;
}

.lab-point-hitbox {
  cursor: pointer;
}

.lab-point.is-hover-linked circle:first-child {
  stroke: #244843;
  stroke-width: 3.2;
}

.lab-point.is-hover-linked circle:nth-child(2) {
  stroke: #244843;
  stroke-width: 3;
}

.lab-empty-copy {
  fill: rgba(35, 43, 39, 0.62);
  font-size: 28px;
  font-weight: 700;
}

#labWheelSvg .lab-lightness-marker,
#labWheelSvg .lab-lightness-hitbox {
  cursor: pointer;
}

#labWheelSvg .lab-lightness-marker.is-hover-linked circle:first-child {
  stroke: rgba(37, 70, 65, 0.72);
  stroke-opacity: 1;
  stroke-width: 3;
}

#labWheelSvg .lab-lightness-marker.is-hover-linked circle:nth-child(2) {
  stroke: #254641;
  stroke-width: 3.2;
}

#wheelSvg .chart-point.is-hover-linked circle:first-child {
  stroke: #254641;
  stroke-width: 4;
}

#wheelSvg .chart-point.is-hover-linked circle:nth-child(2) {
  stroke-opacity: 0.55;
  stroke-width: 3;
}

#wheelSvg .candidate-point.is-hover-linked circle:first-child {
  stroke: #244843;
  stroke-width: 3.6;
}

#wheelSvg .candidate-point.is-hover-linked circle:nth-child(2) {
  stroke-opacity: 1;
}

#wheelSvg .guide-line.is-hover-linked polyline {
  stroke-width: 4.8;
  stroke: #244843;
  opacity: 1;
}

#wheelSvg .guide-line,
#wheelSvg .lightness-marker {
  cursor: pointer;
}

#wheelSvg .lightness-marker.is-hover-linked line {
  stroke-width: 4.2;
  stroke-opacity: 1;
}

#wheelSvg .lightness-marker.is-in-combo line {
  stroke-dasharray: 6 5;
  stroke-width: 3;
}

#wheelSvg .lightness-marker.is-in-combo circle:nth-child(3) {
  stroke: #fff6ea;
  stroke-width: 3.2;
}

#wheelSvg .lightness-marker.is-hover-linked circle:first-child {
  stroke: rgba(37, 70, 65, 0.28);
  stroke-width: 2;
}

#wheelSvg .lightness-marker.is-hover-linked circle:nth-child(2) {
  stroke: #254641;
  stroke-width: 3.2;
}

#wheelSvg .lightness-marker.is-hover-linked text {
  fill: #1d3a35;
}

.detail-panel,
.ai-panel {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.paint-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
}

.paint-modal[hidden] {
  display: none;
}

.paint-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(24, 26, 25, 0.36);
  backdrop-filter: blur(10px);
}

.paint-modal-backdrop:hover {
  transform: none;
}

.paint-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 36px));
  max-height: min(92vh, 960px);
  overflow: auto;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.98), rgba(248, 241, 228, 0.96));
  box-shadow: 0 28px 90px rgba(28, 24, 19, 0.22);
}

.account-modal-panel {
  width: min(640px, calc(100vw - 36px));
}

.paint-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 38px;
  width: 38px;
  padding: 0;
  border-radius: 999px;
  background: rgba(32, 40, 38, 0.08);
  color: var(--accent-deep);
  font-size: 28px;
  line-height: 1;
}

.paint-modal-body {
  display: grid;
  gap: 16px;
}

.account-sheet {
  display: grid;
  gap: 16px;
}

.account-sheet h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.02;
}

.account-sheet-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.account-form {
  display: grid;
  gap: 14px;
}

.account-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-checkout-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.billing-checkout-button {
  justify-content: center;
}

.account-plan-card,
.locked-state {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(55, 60, 43, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.account-plan-card {
  display: grid;
  gap: 8px;
}

.account-plan-card strong {
  font-size: 18px;
}

.account-plan-card span,
.account-plan-card small {
  color: var(--muted);
  line-height: 1.5;
}

.account-feedback {
  margin: 0;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
}

.account-feedback.is-error {
  background: rgba(166, 58, 27, 0.1);
  color: #8a3c24;
  border: 1px solid rgba(166, 58, 27, 0.14);
}

.account-feedback.is-notice {
  background: rgba(37, 72, 67, 0.09);
  color: #254641;
  border: 1px solid rgba(37, 72, 67, 0.1);
}

.account-params {
  margin-top: 0;
}

.billing-order-list {
  display: grid;
  gap: 10px;
}

.billing-order-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(55, 60, 43, 0.08);
  background: rgba(255, 255, 255, 0.68);
}

.billing-order-head,
.billing-order-meta,
.billing-order-foot,
.admin-orders-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.billing-order-head strong {
  font-size: 15px;
}

.billing-order-meta,
.billing-order-foot,
.admin-orders-heading span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.billing-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.billing-order-link {
  text-decoration: none;
}

.admin-sheet {
  min-height: 0;
  display: grid;
  gap: 14px;
}

.admin-sheet-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  flex: 1;
}

.admin-overview-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(55, 60, 43, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.admin-overview-card span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-overview-card strong {
  font-size: 22px;
  line-height: 1;
}

.admin-table-shell {
  min-height: 0;
  max-height: min(66vh, 820px);
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(55, 60, 43, 0.08);
  background: rgba(255, 255, 255, 0.76);
}

.admin-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  text-align: left;
  background: rgba(245, 238, 223, 0.96);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(55, 60, 43, 0.08);
}

.admin-table tbody td {
  padding: 12px 14px;
  vertical-align: top;
  border-bottom: 1px solid rgba(55, 60, 43, 0.08);
}

.admin-table tbody tr:hover {
  background: rgba(255, 250, 241, 0.72);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table td strong {
  display: block;
  font-size: 14px;
}

.admin-table-subcopy {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 260px;
}

.admin-row-actions .tool-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
}

.admin-orders-panel {
  display: grid;
  gap: 10px;
}

.locked-state {
  display: grid;
  gap: 14px;
}

.locked-state h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.04;
}

.locked-state p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.locked-state-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.paint-modal-hero {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding-right: 40px;
}

.paint-modal-swatch {
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  border: 1px solid rgba(42, 42, 42, 0.12);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.42),
    0 18px 32px rgba(55, 47, 33, 0.12);
}

.paint-modal-hero-copy h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.02;
}

.paint-modal-name {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.24;
}

.paint-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
}

.paint-modal-card {
  height: 100%;
}

.paint-params {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.paint-params div {
  padding: 10px 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(55, 60, 43, 0.08);
}

.paint-params dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.paint-params dd {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.paint-modal-photo {
  display: block;
  width: 100%;
  max-height: min(34vh, 280px);
  object-fit: contain;
  object-position: top center;
  border-radius: 22px;
  border: 1px solid rgba(55, 60, 43, 0.08);
  background: rgba(255, 255, 255, 0.7);
}

.paint-modal-photo-empty {
  min-height: 220px;
  padding: 22px;
  border-radius: 22px;
  border: 1px dashed rgba(55, 60, 43, 0.14);
  background: rgba(255, 255, 255, 0.58);
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
}

.paint-modal-photo-fallback {
  width: 110px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 1px solid rgba(42, 42, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.paint-modal-note {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.detail-empty,
.ai-panel p,
.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.detail-hero {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 16px;
  align-items: start;
}

.detail-swatch {
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  border: 1px solid rgba(42, 42, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.reference-image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  object-position: top center;
  border-radius: 18px;
  border: 1px solid rgba(55, 60, 43, 0.08);
}

.metric-card,
.note-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(55, 60, 43, 0.08);
}

.metric-card h3,
.note-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.metric-card p,
.note-card p,
.note-card ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.note-card ul {
  padding-left: 18px;
}

.site-footer {
  margin-top: 22px;
  padding: 22px 24px 28px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 250, 241, 0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.site-footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr;
  gap: 18px;
}

.site-footer-block {
  display: grid;
  gap: 10px;
  align-content: start;
}

.site-footer-block strong {
  font-size: 13px;
}

.site-footer-block p,
.site-footer-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.site-footer-links a,
.legal-back {
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 700;
}

.site-footer-links a:hover,
.legal-back:hover {
  text-decoration: underline;
}

.site-footer-meta {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(35, 43, 39, 0.08);
  font-size: 12px;
}

.legal-page {
  min-height: 100vh;
}

.legal-shell {
  width: min(980px, calc(100vw - 28px));
  margin: 28px auto 42px;
  display: grid;
  gap: 14px;
}

.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 2px;
}

.legal-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.legal-card h1 {
  margin: 0;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height: 1.04;
  font-family: "Futura", "Avenir Next", sans-serif;
}

.legal-lead {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.legal-section {
  display: grid;
  gap: 8px;
}

.legal-section h2 {
  margin: 0;
  font-size: 18px;
}

.legal-section p,
.legal-section ul {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.legal-section ul {
  padding-left: 20px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.mini-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(181, 75, 34, 0.09);
  color: var(--accent-deep);
  font-size: 12px;
}

.ai-panel .note-card {
  background: linear-gradient(180deg, rgba(255, 251, 244, 0.92), rgba(251, 245, 233, 0.86));
}

@media (max-width: 1180px) {
  .workspace-grid,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .site-footer-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions,
  .toolbar-row {
    width: 100%;
  }

  .toolbar-row {
    flex-direction: column;
  }

  .account-panel {
    width: 100%;
  }

  .brand-switch {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    margin: 10px auto 24px;
  }

  .control-card,
  .list-card,
  .detail-card {
    padding: 16px;
  }

  .wheel-card {
    padding: 14px 10px 6px;
  }

  #wheelSvg {
    height: 100%;
  }

  .detail-hero,
  .detail-grid,
  .paint-modal-hero,
  .paint-modal-grid,
  .paint-params {
    grid-template-columns: 1fr;
  }

  .selection-entry {
    flex-direction: column;
    align-items: stretch;
  }

  .selected-item,
  .owned-item {
    grid-template-columns: auto 1fr;
  }

  .favorite-icon,
  .owned-action-button,
  .info-icon,
  .remove-icon {
    justify-self: start;
  }

  .selected-list .selected-item .owned-action-button,
  .selected-list .selected-item .info-icon {
    grid-row: auto;
  }

  .selection-tools {
    justify-content: start;
  }

  .billing-checkout-grid {
    grid-template-columns: 1fr;
  }

  .admin-sheet-toolbar {
    align-items: stretch;
  }

  .admin-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-table {
    min-width: 980px;
  }

  .admin-row-actions {
    min-width: 220px;
  }

  .inventory-tools {
    gap: 8px;
  }

  .inventory-tool-clear {
    margin-left: 0;
  }

  .inventory-card,
  .selection-card {
    height: auto !important;
  }

  .brand-lockup {
    align-items: center;
    gap: 12px;
  }

  .brand-lockup-logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
  }

  .account-entry,
  .topbar-actions {
    width: 100%;
  }

  .account-entry {
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .account-form-actions,
  .locked-state-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .site-footer,
  .legal-card {
    padding: 18px 16px;
  }

  .legal-shell {
    width: min(100vw - 18px, 100%);
    margin: 14px auto 28px;
  }

}
