:root {
  color-scheme: light;
  --ink: #20211f;
  --muted: #6a6d68;
  --line: #d9dcd6;
  --soft: #f6f6f2;
  --panel: #ffffff;
  --accent: #245d5f;
  --accent-2: #9f5a43;
  --shadow: 0 16px 50px rgba(32, 33, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-width: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #ededeb;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: #f2f2ef;
}

.auth-overlay.open {
  display: grid;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  font-size: 30px;
  line-height: 1;
}

.auth-card p {
  color: var(--muted);
}

.auth-card input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  color: var(--ink);
  background: #fafafa;
}

button,
input {
  font: inherit;
}

textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  cursor: pointer;
}

button:hover {
  background: #000;
}

button:disabled {
  cursor: wait;
  opacity: 0.46;
}

button.ghost {
  background: #eceee8;
  color: var(--ink);
}

button.compact {
  padding: 10px 12px;
}

.app-shell {
  position: fixed;
  inset: 0;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(251, 251, 250, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 10;
}

.topbar-cluster {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(217, 220, 214, 0.86);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 24px rgba(32, 33, 31, 0.06);
}

.search-toolbar-cluster {
  margin-left: auto;
}

.search-toggle-button {
  position: relative;
}

.search-active-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 2px #fff;
}

.topbar-right {
  margin-left: 0;
}

.icon-toolbar-button.small {
  width: 32px;
  height: 32px;
  font-size: 17px;
}

.zoom-level-button {
  min-width: 52px;
  height: 32px;
  padding: 0 6px;
  border-radius: 8px;
  color: var(--ink);
  background: #eceee8;
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.zoom-level-button:hover {
  background: #e2e5dc;
}

.toolbar-divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.text-toolbar-button {
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--ink);
  background: #eceee8;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.text-toolbar-button:hover {
  background: #e2e5dc;
}

.text-toolbar-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.app-menu-wrap,
.create-menu-wrap {
  position: relative;
}

.app-menu-button {
  position: relative;
  width: 52px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 8px;
  padding: 0;
  color: var(--accent);
  background: #efe5ff;
}

.app-menu-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  padding: 0 5px;
  color: white;
  background: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.app-menu-button:hover,
.app-menu-button[aria-expanded="true"] {
  color: #7a35d8;
  background: #eadbff;
}

.app-menu-button .brand-mark {
  width: 24px;
  height: 24px;
}

.menu-chevron {
  font-size: 16px;
  line-height: 1;
  transform: translateY(-2px);
}

.app-menu,
.create-menu {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 30;
  display: none;
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border-radius: 12px;
  background: #1f1f1f;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
}

.app-menu {
  left: 0;
  width: 230px;
}

.create-menu {
  right: 0;
  width: 190px;
}

.app-menu.open,
.create-menu.open {
  display: grid;
}

.menu-section {
  display: grid;
  gap: 2px;
}

.menu-section[hidden] {
  display: none;
}

.menu-section > span {
  padding: 8px 12px 6px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-menu button,
.create-menu button {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  border-radius: 7px;
  padding: 12px 14px;
  color: white;
  background: transparent;
  text-align: left;
}

.app-menu button:hover,
.create-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.board-name {
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-toolbar-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: #eceee8;
  font-size: 22px;
  line-height: 1;
}

.icon-toolbar-button:hover {
  background: #e2e5dc;
}

.icon-toolbar-button:disabled {
  cursor: default;
  opacity: 0.4;
}

.sync-status {
  min-width: 64px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-align: center;
}

.sync-status.is-saving {
  color: var(--accent);
  border-color: rgba(35, 97, 97, 0.28);
}

.sync-status.is-error {
  color: #a43d30;
  border-color: rgba(164, 61, 48, 0.3);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: block;
  object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 18px;
  line-height: 1.2;
}

.empty-inspector p,
.status {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.workspace {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(220px, 32vw, 320px);
  overflow: hidden;
}

.home-view {
  display: none;
}

body.home-mode .topbar,
body.home-mode .workspace {
  display: none;
}

body.home-mode .app-shell {
  grid-template-rows: 1fr;
}

body.home-mode .home-view {
  display: block;
  min-height: 0;
  overflow-y: auto;
  padding: 30px 34px 44px;
}

.home-header {
  max-width: 1180px;
  margin: 0 auto 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-brand .brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.home-brand h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1;
}

.home-view .status {
  max-width: 1180px;
  margin: 0 auto 14px;
  min-height: 18px;
  color: var(--muted);
  font-size: 13px;
}

.board-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.board-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  overflow: hidden;
  transition: box-shadow 120ms ease, transform 120ms ease;
}

.board-card:hover {
  box-shadow: 0 10px 30px rgba(32, 33, 31, 0.12);
  transform: translateY(-1px);
}

.board-card-open {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  text-align: left;
}

.board-card-open:hover {
  background: none;
}

.board-card-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 4 / 3;
  background: var(--soft);
  border-bottom: 1px solid var(--line);
}

.board-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.board-card-preview img:only-child {
  grid-column: 1 / -1;
}

.board-card-empty {
  grid-column: 1 / -1;
  place-self: center;
  color: var(--muted);
  font-size: 13px;
}

.board-card-open strong {
  display: block;
  padding: 12px 14px 2px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-card-meta {
  display: block;
  padding: 0 14px 10px;
  color: var(--muted);
  font-size: 12px;
}

.board-card-actions {
  display: flex;
  gap: 6px;
  padding: 0 12px 12px;
}

.board-card-action {
  padding: 6px 9px;
  font-size: 12px;
}

.workspace.inspector-hidden {
  grid-template-columns: minmax(0, 1fr);
}

.canvas-wrap {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  position: relative;
  overscroll-behavior: none;
}

.mobile-show-items {
  position: sticky;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: none;
  width: max-content;
  border: 1px solid rgba(32, 33, 31, 0.12);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 26px rgba(32, 33, 31, 0.16);
}

.board {
  position: relative;
  width: 40000px;
  height: 30000px;
  background-color: #fbfbfa;
  --dot-size: 20px;
  --dot-radius: 0.9px;
  background-image: radial-gradient(rgba(125, 132, 124, 0.38) var(--dot-radius), transparent calc(var(--dot-radius) + 0.25px));
  background-size: var(--dot-size) var(--dot-size);
  transform-origin: 0 0;
}

.board-hint {
  position: absolute;
  top: 120px;
  left: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

.board-hint strong {
  color: var(--ink);
}

.search-palette {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  justify-self: center;
  display: none;
  flex-direction: column;
  gap: 10px;
  width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  z-index: 25;
}

.search-palette.open {
  display: flex;
}

.search-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--soft);
}

.search-field-icon {
  color: var(--muted);
  font-size: 15px;
}

.search-field-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  padding: 11px 0;
  color: var(--ink);
}

.search-field-input:focus {
  outline: none;
}

.search-palette-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  font-size: 16px;
  line-height: 1;
}

.search-palette-close:hover {
  color: var(--ink);
  background: var(--line);
}

.search-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--ink);
  background: var(--soft);
  font-size: 12px;
  font-weight: 600;
}

.filter-chip:hover {
  background: #eceee8;
}

.filter-chip.active {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.filter-chip.active:hover {
  background: var(--accent);
}

.search-filter-selects {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.search-select {
  min-width: 0;
  flex: 1 1 120px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--ink);
  background: white;
  font-size: 12px;
}

.search-price-range {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 140px;
}

.search-price-input {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--ink);
  background: white;
  font-size: 12px;
}

.search-price-sep {
  color: var(--muted);
}

.search-clear-filters {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--ink);
  background: #eceee8;
  font-size: 12px;
  font-weight: 600;
}

.search-clear-filters:hover {
  background: #e2e5dc;
}

.search-clear-filters:disabled {
  cursor: default;
  opacity: 0.4;
}

.search-results {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow-y: auto;
  max-height: 46vh;
}

.search-results-empty {
  margin: 6px 2px;
  color: var(--muted);
  font-size: 12px;
}

.search-result-row {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.search-result-row:hover {
  background: var(--soft);
}

.search-result-row.active {
  background: rgba(36, 93, 95, 0.1);
}

.search-result-thumb {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--soft);
  overflow: hidden;
}

.search-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.search-result-glyph {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.search-result-text {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.search-result-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.search-result-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.search-result-price {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.minimap {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: end;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  margin: 0 16px 16px 0;
  z-index: 15;
}

.minimap-toggle {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 6px 20px rgba(32, 33, 31, 0.14);
}

.minimap-toggle:hover {
  background: white;
}

.minimap-canvas {
  display: block;
  width: 180px;
  height: 135px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfbfa;
  box-shadow: 0 12px 32px rgba(32, 33, 31, 0.18);
  cursor: crosshair;
  touch-action: none;
}

.minimap.collapsed .minimap-canvas {
  display: none;
}

.board-item {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  user-select: none;
}

.image-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6px;
}

.board-item.cutout {
  background: transparent;
  box-shadow: none;
}

.board-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 93, 95, 0.18), 0 10px 28px rgba(0, 0, 0, 0.16);
}

/* Search palette filters (MAC-262): dim rather than hide so spatial context
   on the board is preserved. */
.board-item.filter-dimmed {
  opacity: 0.25;
  transition: opacity 0.15s ease;
}

.board-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
  transform-origin: center;
}

.board-item img.rotated-quarter-turn {
  max-width: none;
  max-height: none;
}

.board-item.cutout img {
  object-fit: contain;
  filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.13));
}

.board-item.cutout:not(.processed) img {
  mix-blend-mode: multiply;
}

.board-item.pending img {
  opacity: 0.68;
}

.text-board-item {
  place-items: stretch;
  background: transparent;
  box-shadow: none;
}

.text-board-item.selected {
  background: rgba(255, 255, 255, 0.45);
}

.text-item-content,
.text-item-editor {
  width: 100%;
  height: 100%;
  padding: 8px 10px;
  color: var(--text-color);
  font-size: var(--text-size);
  font-weight: var(--text-weight);
  line-height: 1.22;
  white-space: pre-wrap;
}

.text-item-content {
  overflow-wrap: anywhere;
}

.text-item-content.is-placeholder {
  color: rgba(111, 112, 108, 0.58);
}

.text-item-editor {
  border: 0;
  outline: 0;
  resize: none;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 6px;
  font-family: inherit;
}

.try-on-frame-item {
  place-items: stretch;
  background: #fbfbfa;
  border: 2px dashed #9f5a43;
  box-shadow: 0 10px 28px rgba(32, 33, 31, 0.1);
}

.try-on-frame-card {
  height: 100%;
  display: grid;
  align-content: start;
  gap: var(--try-frame-gap, 14px);
  padding: var(--try-frame-padding, 18px);
  border-radius: var(--try-frame-radius, 6px);
  background: linear-gradient(180deg, #ffffff 0%, #f7f3ef 100%);
  color: var(--ink);
  overflow: hidden;
}

.try-on-frame-card .eyebrow {
  margin-bottom: var(--try-frame-eyebrow-margin, 8px);
  font-size: var(--try-frame-eyebrow-size, 11px);
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.try-on-frame-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--try-frame-title-size, 18px);
  line-height: 1.2;
  text-overflow: ellipsis;
}

.try-on-frame-stats {
  display: grid;
  min-width: 0;
  gap: var(--try-frame-stat-gap, 8px);
  color: var(--muted);
  font-size: var(--try-frame-body-size, 13px);
  line-height: 1.25;
  overflow: hidden;
}

.try-on-frame-stats span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.try-on-frame-status {
  align-self: end;
  width: fit-content;
  margin-top: auto;
  max-width: 100%;
  padding: var(--try-frame-status-padding-y, 6px) var(--try-frame-status-padding-x, 9px);
  border-radius: 999px;
  background: #eff5f3;
  color: var(--accent);
  font-size: var(--try-frame-status-size, 12px);
  font-weight: 800;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packing-list-frame-item {
  place-items: stretch;
  background: #f8f7f1;
  border: 2px dashed #71806a;
  box-shadow: 0 10px 28px rgba(32, 33, 31, 0.12);
}

.create-menu button[hidden] {
  display: none;
}

.packing-list-frame-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--packing-gap, 10px);
  padding: var(--packing-padding, 16px);
  border-radius: 6px;
  background: linear-gradient(180deg, #fff 0%, #f3f4ee 100%);
  color: var(--ink);
  font-size: var(--packing-body-size, 12px);
  overflow: auto;
  user-select: none;
}

.packing-frame-heading {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.packing-frame-heading strong {
  overflow: hidden;
  font-size: var(--packing-title-size, 20px);
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packing-source-strip,
.packing-row-sources {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.packing-source-thumb,
.packing-row-sources button,
.packing-row-sources .missing {
  width: var(--packing-thumb-size, 34px);
  height: var(--packing-thumb-size, 34px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #e7e9e2;
}

.packing-source-thumb img,
.packing-row-sources img,
.packing-inspector-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.packing-source-thumb.missing,
.packing-row-sources .missing {
  display: grid;
  place-items: center;
  color: #8b3e35;
  font-weight: 800;
}

.packing-frame-stats,
.packing-cost-preview,
.packing-analysis-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.packing-frame-actions,
.packing-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.packing-frame-actions button {
  min-width: 0;
  flex: 1 1 auto;
  padding: 7px 9px;
  font-size: inherit;
}

.packing-frame-list {
  display: grid;
  gap: 9px;
  min-height: 0;
}

.packing-frame-category {
  display: grid;
  gap: 4px;
}

.packing-frame-category > strong {
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.packing-frame-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid rgba(125, 126, 119, 0.18);
}

.packing-frame-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packing-frame-row input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.packing-frame-error,
.packing-stale-note {
  margin: 0;
  color: #8b3e35;
  line-height: 1.35;
}

.packing-empty-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.packing-list-inspector,
.packing-draft-panel,
.packing-inspector-sources,
.packing-inspector-category,
.packing-review-panel,
.packing-review-decision,
.packing-review-candidate {
  display: grid;
  gap: 10px;
}

.packing-review-panel {
  padding: 10px;
  border: 1px solid #d0a56d;
  border-radius: 8px;
  background: #fffaf1;
}

.packing-review-banner {
  display: grid;
  gap: 2px;
}

.packing-review-banner span,
.packing-review-neutral,
.packing-review-candidate span {
  color: var(--muted);
  line-height: 1.35;
}

.packing-review-neutral {
  margin: 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: #f3f4f0;
}

.packing-review-decision {
  padding-top: 10px;
  border-top: 1px solid rgba(150, 97, 38, 0.25);
}

.packing-review-candidates {
  display: grid;
  gap: 7px;
}

.packing-review-candidate {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.packing-review-candidate > div:first-child {
  display: grid;
  min-width: 0;
}

.packing-review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.packing-review-actions button {
  min-width: 0;
  min-height: 42px;
  white-space: normal;
}

.packing-inspector-source-heading,
.packing-draft-heading,
.packing-row-main {
  display: flex;
  align-items: center;
  gap: 8px;
}

.packing-inspector-source-heading > strong,
.packing-draft-heading > div {
  flex: 1;
}

.packing-inspector-source {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.packing-source-card {
  display: grid;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.packing-source-summary {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.packing-source-summary strong,
.packing-source-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.packing-source-summary span,
.packing-source-garment span {
  color: var(--muted);
  font-size: 11px;
}

.packing-source-card-actions,
.packing-source-review,
.packing-source-garments,
.packing-add-missing {
  display: grid;
  gap: 8px;
}

.packing-source-review {
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.packing-source-garment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(125, 126, 119, 0.15);
}

.packing-source-garment > div {
  display: grid;
  min-width: 0;
}

.packing-add-missing {
  padding: 9px;
  border-radius: 7px;
  background: #f3f4f0;
}

.packing-add-missing-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 7px;
}

.packing-source-reanalyze {
  min-height: 42px;
}

.packing-inspector-source.missing {
  color: #8b3e35;
}

.packing-inspector-thumb {
  width: 38px;
  height: 38px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eceee8;
}

.packing-cost-preview {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.packing-analysis-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.packing-analysis-progress progress {
  width: 100%;
  accent-color: var(--accent);
}

.packing-draft-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.packing-draft-heading h3,
.packing-inspector-category h4 {
  margin: 2px 0 0;
}

.packing-inspector-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.packing-row-main > div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.packing-row-representative {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eceee8;
}

.packing-row-representative img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

.packing-row-representative.missing {
  display: grid;
  place-items: center;
  color: #8b3e35;
  font-weight: 800;
}

.packing-row-main span {
  color: var(--muted);
  font-size: 12px;
}

.packing-row-sources button,
.packing-row-sources .missing {
  --packing-thumb-size: 30px;
}

.resize-handle {
  position: absolute;
  right: -12px;
  bottom: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  border: 0;
  cursor: nwse-resize;
  display: none;
}

.resize-handle::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
}

.selected .resize-handle {
  display: block;
}

.marquee {
  position: absolute;
  border: 1px solid var(--accent);
  background: rgba(36, 93, 95, 0.09);
  display: none;
  pointer-events: none;
}

.outfit-overlay {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 10px;
  pointer-events: none;
  transition: border-color 0.15s ease;
}

.outfit-overlay.hover {
  border-color: rgba(36, 93, 95, 0.28);
}

.outfit-overlay.selected {
  border-color: rgba(36, 93, 95, 0.5);
}

.outfit-label {
  position: absolute;
  top: -24px;
  left: -1px;
  min-height: 0;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
}

.outfit-label:hover {
  border-color: var(--accent);
  background: #ffffff;
  color: var(--accent);
}

.outfit-label.favorite {
  color: var(--accent-2);
}

.outfit-label.filter-dimmed {
  opacity: 0.25;
  transition: opacity 0.15s ease;
}

body.mobile-readonly .outfit-label {
  pointer-events: none;
}

.outfit-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.outfit-header-row .eyebrow {
  margin-bottom: 0;
}

.favorite-toggle {
  min-height: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.favorite-toggle:hover {
  border-color: var(--accent-2);
  background: #fbf1ec;
  color: var(--accent-2);
}

.favorite-toggle.active {
  border-color: var(--accent-2);
  background: #fbf1ec;
  color: var(--accent-2);
}

.outfit-member-list {
  display: grid;
  gap: 2px;
}

.outfit-member-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #eceee8;
}

.outfit-member-list .outfit-member-row:last-child {
  border-bottom: 0;
}

.outfit-member-thumb {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f0f0ec;
  overflow: hidden;
}

.outfit-member-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.outfit-member-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.outfit-member-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.outfit-member-brand {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outfit-member-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.outfit-member-price {
  color: var(--muted);
  font-size: 12px;
}

.outfit-member-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.outfit-member-link {
  text-decoration: none;
}

.inspector {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  border-left: 1px solid var(--line);
  background: #ffffff;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}

.inspector[hidden] {
  display: none;
}

.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.empty-inspector,
.detail-card {
  display: grid;
  gap: 14px;
}

.compact-inspector {
  gap: 10px;
}

.role-control-block {
  display: grid;
  gap: 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.role-control-block .eyebrow {
  margin: 0;
}

.role-segmented-control button {
  font-weight: 750;
}

.look-itemize-panel {
  display: grid;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.look-section-heading,
.look-garment-main,
.linked-item-row,
.candidate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.look-section-heading .eyebrow {
  margin-bottom: 3px;
}

.look-section-heading h3 {
  font-size: 15px;
}

.look-itemize-copy,
.look-model-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.look-model-note {
  font-size: 10px;
}

.look-garment-list {
  display: grid;
  gap: 8px;
}

.look-garment-row {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfbfa;
}

.look-garment-name {
  min-width: 0;
  padding: 5px 6px;
  font-size: 13px;
  font-weight: 750;
}

.look-garment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 10px;
}

.look-garment-meta .needs-review {
  color: #9f3f35;
  font-weight: 700;
}

.linked-item-row,
.candidate-row {
  color: var(--muted);
  font-size: 11px;
}

.candidate-list {
  display: grid;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid #eceee8;
}

.candidate-row {
  display: grid;
  gap: 8px;
  align-items: stretch;
  padding: 8px 0;
  border-bottom: 1px solid #eceee8;
}

.candidate-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.candidate-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  line-height: 1.35;
}

.candidate-copy strong,
.candidate-copy span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.candidate-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.candidate-reason {
  color: var(--teal);
  font-weight: 700;
}

.candidate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.candidate-actions .tiny-action {
  width: 100%;
  min-height: 30px;
}

.candidate-empty {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.candidate-possible-action {
  justify-self: start;
  min-height: 30px;
  margin-top: 1px;
}

.tiny-action.muted {
  color: var(--muted);
}

.match-action-block {
  display: grid;
  gap: 7px;
}

.match-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.look-secondary-tools {
  padding-top: 2px;
}

.selection-guidance {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.detail-card h2 {
  font-size: 20px;
  line-height: 1.2;
}

.inspector-section {
  display: grid;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.inspector-section:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.inspector-section h3,
.inspector-section summary {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.inspector-section summary {
  cursor: pointer;
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.plain-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.plain-input:hover,
.plain-input:focus,
.price-input:hover,
.price-input:focus {
  border-color: var(--line);
  background: #fbfbfa;
  outline: 0;
}

.eyebrow-input {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 6px;
}

.title-field {
  gap: 4px;
}

.title-input {
  min-height: 58px;
  resize: vertical;
  padding: 5px 6px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.price-input {
  width: 100%;
  border: 1px solid transparent;
  text-align: left;
  font: inherit;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid #eceee8;
  color: var(--muted);
  font-size: 13px;
}

.meta-row strong {
  color: var(--ink);
  text-align: right;
}

.editable-row {
  align-items: center;
}

.meta-input {
  max-width: 58%;
  padding: 5px 6px;
  color: var(--ink);
  font-weight: 700;
  text-align: right;
}

.inspector-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inspector-actions button {
  min-height: 36px;
  padding: 8px 10px;
  background: #eceee8;
  color: var(--ink);
}

.product-compact {
  display: grid;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.compact-store {
  width: fit-content;
  max-width: 100%;
}

.compact-title {
  min-height: 44px;
  max-height: 82px;
  font-size: 18px;
}

.compact-price {
  min-height: 34px;
  padding: 8px 10px;
}

.compact-open-link {
  min-height: 36px;
  margin-top: 2px;
}

.icon-action {
  min-height: 36px;
  background: #eceee8;
  color: var(--ink);
}

.selected-photo-actions {
  grid-template-columns: 1fr;
}

.primary-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.3fr) minmax(0, 0.85fr);
  gap: 6px;
}

.labeled-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 7px 8px;
  color: var(--ink);
  background: #eceee8;
  font-size: 12px;
}

.labeled-action:hover,
.icon-action-row .icon-action:hover {
  background: #dfe3db;
}

.labeled-action span {
  font-size: 15px;
  line-height: 1;
}

.labeled-action strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
}

.action-group {
  display: grid;
  gap: 5px;
}

.action-group-label {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 10px;
}

.icon-action-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.icon-action-row .icon-action {
  position: relative;
}

.icon-action-row .icon-action:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-action-row .icon-action[title]:hover::after,
.icon-action-row .icon-action[title]:focus-visible::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 0;
  z-index: 5;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
}

.background-panel,
.metadata-panel,
.arrange-panel {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf7;
  overflow: hidden;
}

.background-panel summary,
.metadata-panel summary,
.arrange-panel summary {
  cursor: pointer;
  padding: 10px 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.background-panel-body,
.metadata-panel-body,
.arrange-panel-body,
.super-options-body {
  display: grid;
  gap: 8px;
}

.background-panel-body,
.metadata-panel-body,
.arrange-panel-body {
  padding: 0 10px 10px;
}

.background-group {
  display: grid;
  gap: 8px;
}

.background-group h3,
.super-options h3 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.super-options {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.super-options-body {
  padding-top: 8px;
}

.super-options label {
  color: var(--muted);
  font-size: 12px;
}

.super-options select,
.super-options input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
}

.background-choice {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.background-choice-recommended {
  border-color: #aab9b4;
  background: #f4f8f7;
}

.background-choice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.background-choice-heading h3,
.background-choice p {
  margin: 0;
}

.background-choice-heading h3 {
  font-size: 13px;
}

.background-choice-heading span {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.background-choice p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.background-choice-body,
.background-fine-tune,
.background-basic-settings {
  display: grid;
  gap: 8px;
}

.background-choice-body > label,
.background-fine-tune label {
  color: var(--muted);
  font-size: 12px;
}

.background-choice-body select,
.background-fine-tune input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 10px;
  color: var(--ink);
  background: #ffffff;
}

.background-fine-tune summary,
.background-basic-settings summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.recommended-action,
.recommended-action:hover {
  background: var(--accent);
  color: #ffffff;
}

.compact-slider {
  gap: 6px;
}

.compact-icon-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.icon-action {
  flex: 0 0 36px;
  width: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.text-inspector-copy {
  min-height: 120px;
  max-height: none;
  resize: vertical;
  border-color: var(--line);
  background: #fbfbfa;
  font-size: 18px;
}

.text-style-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf7;
}

.font-size-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.font-size-control input {
  width: 72px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--ink);
  background: #ffffff;
  text-align: right;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.segmented-control button {
  min-height: 34px;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--ink);
}

.segmented-control button.active,
.secondary-action.active {
  background: #eff5f3;
  border-color: rgba(36, 93, 95, 0.35);
  color: var(--accent);
}

.color-swatch-row {
  display: flex;
  gap: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch-color);
}

.color-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 93, 95, 0.14);
}

.notes-field {
  display: grid;
  gap: 8px;
}

.notes-field label {
  color: var(--muted);
  font-size: 13px;
}

.notes-field textarea {
  min-height: 92px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fbfbfa;
}

.slider-field {
  display: grid;
  gap: 8px;
}

.slider-field label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.slider-field label strong {
  color: var(--ink);
}

.slider-field input {
  width: 100%;
  accent-color: var(--accent);
}

.super-bg-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf7;
}

.super-bg-panel label {
  color: var(--muted);
  font-size: 13px;
}

.super-bg-panel select,
.super-bg-panel input,
.super-bg-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
}

.super-bg-panel textarea {
  min-height: 78px;
  resize: vertical;
  font: inherit;
}

.super-bg-panel button,
.super-refine-panel button,
.full-width-action,
.secondary-action {
  min-height: 36px;
  padding: 8px 10px;
  background: #eceee8;
  color: var(--ink);
}

.full-width-action,
.secondary-action {
  width: 100%;
}

.secondary-action {
  background: #ffffff;
  border: 1px solid var(--line);
}

.super-refine-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.try-on-refine-panel {
  display: grid;
  gap: 8px;
}

.try-on-refine-body {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
}

.try-on-refine-body label {
  color: var(--muted);
  font-size: 13px;
}

.try-on-refine-body textarea {
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px 10px;
  color: var(--ink);
  background: white;
  font: inherit;
}

.field-error {
  color: #9f3f35;
  font-size: 12px;
}

.try-on-panel {
  border-bottom: 0;
}

.try-on-reference-block {
  display: grid;
  gap: 8px;
}

.try-on-reference-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.try-on-reference-heading strong {
  margin-left: auto;
  color: var(--ink);
}

.tiny-action {
  min-height: 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.try-on-empty-ref {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  background: #fbfbfa;
}

.try-on-prompt {
  min-height: 96px;
  resize: vertical;
  border-color: var(--line);
  padding: 10px;
  background: #fbfbfa;
}

.try-on-ref-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafaf7;
  color: var(--muted);
  font-size: 12px;
}

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

.try-on-ref-row span {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.try-on-ref-row button {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  background: #eceee8;
  color: var(--ink);
  line-height: 1;
}

.total-pill {
  padding: 14px;
  border-radius: 8px;
  background: #eff5f3;
  color: var(--accent);
  font-weight: 800;
}

.link-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  border-radius: 7px;
  color: white;
  text-decoration: none;
  background: var(--ink);
}

dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(32, 33, 31, 0.22);
  backdrop-filter: blur(3px);
}

.import-dialog {
  width: min(940px, 88vw);
}

.dialog-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 300px;
  background: white;
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.close-btn:hover {
  background: white;
}

.inline-close {
  position: static;
  flex: 0 0 auto;
}

.link-queue-dialog {
  width: min(820px, 92vw);
  max-height: 88vh;
}

.link-queue-shell {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  max-height: 88vh;
  padding: 22px;
  background: #fbfbfa;
}

.link-queue-header,
.link-queue-header-actions,
.manual-queue-add {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.link-queue-header h2 {
  margin-top: 3px;
  font-size: 26px;
  line-height: 1;
}

.manual-queue-add input {
  min-width: 0;
  flex: 1 1 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: white;
}

.manual-queue-add button {
  flex: 0 0 auto;
}

.link-queue-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 2px 2px 10px;
}

.link-queue-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  box-shadow: 0 8px 24px rgba(32, 33, 31, 0.07);
}

.link-queue-preview {
  width: 84px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f0f0ec;
  overflow: hidden;
}

.link-queue-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.link-queue-preview-empty span {
  color: var(--muted);
  font-size: 26px;
  font-weight: 700;
}

.link-queue-content {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.link-queue-item-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.link-queue-title,
.link-queue-url,
.link-queue-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-queue-title {
  font-size: 14px;
}

.link-queue-url {
  color: var(--ink);
  font-size: 13px;
}

.link-queue-meta {
  color: var(--muted);
  font-size: 12px;
}

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

.link-queue-actions button,
.link-queue-actions a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 7px 11px;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.link-queue-primary-action {
  min-width: 118px;
}

.link-queue-secondary-action {
  background: #eceee8;
  color: var(--ink);
}

.link-queue-secondary-action:hover {
  background: #e2e5dd;
}

.link-queue-clear-action {
  background: transparent;
  color: var(--muted);
}

.link-queue-clear-action:hover {
  background: #f0f0ec;
  color: var(--ink);
}

/* Inbox tray (MAC-255) reuses the link-queue visual language; it just has no
   manual-add row, so the shell drops to three rows. */
.inbox-shell {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.inbox-source-tag {
  justify-self: start;
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--muted);
  background: #f0f0ec;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Bookmarklet installer (MAC-256): a short static dialog, not a scrolling
   list, so it drops the .link-queue-shell row-sizing entirely. */
.bookmarklet-dialog {
  width: min(460px, 92vw);
}

.bookmarklet-shell {
  grid-template-rows: none;
  max-height: none;
}

.bulk-itemize-dialog {
  width: min(520px, 92vw);
}

.bulk-itemize-shell {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: #fbfbfa;
}

.bulk-itemize-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.bulk-itemize-header h2 {
  margin: 3px 0 0;
  font-size: 24px;
  line-height: 1.1;
}

.bulk-itemize-content {
  display: grid;
  gap: 14px;
}

.bulk-itemize-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.bulk-itemize-counts div {
  min-width: 0;
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.bulk-itemize-counts span,
.bulk-itemize-cost,
.bulk-itemize-progress-copy {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.bulk-itemize-counts strong {
  display: block;
  margin-top: 2px;
  font-size: 19px;
}

.bulk-itemize-cost {
  line-height: 1.45;
}

.bulk-itemize-progress {
  display: grid;
  gap: 6px;
}

.bulk-itemize-progress progress {
  width: 100%;
  height: 8px;
  accent-color: var(--accent);
}

.bulk-itemize-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.bulk-itemize-actions .secondary-action {
  background: #eceee8;
  color: var(--ink);
}

@media (max-width: 480px) {
  .bulk-itemize-counts {
    grid-template-columns: 1fr;
  }

  .bulk-itemize-actions > button {
    flex: 1 1 100%;
  }
}

.bookmarklet-drag-row {
  display: flex;
  justify-content: center;
  padding: 6px 0;
}

.bookmarklet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--accent);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
  box-shadow: 0 6px 18px rgba(36, 93, 95, 0.28);
}

.bookmarklet-link:hover {
  background: #1d4c4e;
}

.bookmarklet-steps {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.bookmarklet-copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Explicit hover so this light button doesn't fall into the global
   `button:hover { background:#000 }` trap (dark-on-dark text). */
.bookmarklet-copy-button {
  background: #eceee8;
  color: var(--ink);
}

.bookmarklet-copy-button:hover {
  background: #e2e5dd;
}

.preview-panel {
  position: relative;
  min-height: 620px;
  display: grid;
  place-items: center;
  background: var(--soft);
  overflow: hidden;
}

.preview-panel img {
  max-width: 86%;
  max-height: 520px;
  border-radius: 8px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
  background: white;
}

.preview-loading {
  display: none;
  place-items: center;
  width: 70%;
  min-height: 320px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
}

.screenshot-import {
  display: none;
  place-items: center;
  gap: 12px;
  width: min(78%, 460px);
  min-height: 360px;
  border: 1px dashed #b8bcb5;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.screenshot-import strong {
  max-width: 330px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.25;
}

.screenshot-import span {
  max-width: 330px;
  font-size: 14px;
  line-height: 1.35;
}

.screenshot-import img {
  max-width: 100%;
  max-height: 290px;
  margin-top: 6px;
  border-radius: 7px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.14);
}

.screenshot-strip {
  position: absolute;
  left: 50%;
  bottom: 62px;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  max-width: min(82%, 520px);
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  overflow-x: auto;
  scrollbar-width: thin;
}

.screenshot-strip button {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  padding: 2px;
  border: 2px solid transparent;
  border-radius: 7px;
  background: transparent;
  opacity: 0.72;
}

.screenshot-strip button.active {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 2px rgba(36, 93, 95, 0.2), 0 8px 18px rgba(0, 0, 0, 0.14);
  opacity: 1;
}

.screenshot-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: none;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  padding: 0;
  font-size: 34px;
  line-height: 1;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.prev {
  left: 18px;
}

.next {
  right: 18px;
}

.image-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

.import-meta {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
}

.import-meta h2 {
  font-size: 26px;
  line-height: 1.1;
}

.price {
  margin-top: 10px;
  font-weight: 800;
  font-size: 20px;
}

.import-meta a {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
}

.screenshot-fields {
  display: none;
  gap: 10px;
}

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

.screenshot-fields input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfbfa;
}

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

.crop-dialog,
.cutout-dialog {
  width: min(1120px, 92vw);
}

@media (max-width: 860px) {
  .topbar {
    gap: 8px;
    padding: 8px;
  }

  .board-name {
    display: none;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) clamp(220px, 40vw, 280px);
  }

  .workspace.inspector-hidden {
    grid-template-columns: minmax(0, 1fr);
  }

  .inspector {
    padding: 16px;
  }

  .link-queue-item {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .link-queue-preview {
    width: 70px;
  }

  .manual-queue-add {
    align-items: stretch;
    flex-direction: column;
  }

  .manual-queue-add button {
    width: 100%;
  }

  .link-queue-actions {
    gap: 7px;
  }

  .link-queue-primary-action {
    min-width: 96px;
  }
}

@media (max-width: 700px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-content: center;
    justify-content: stretch;
    gap: 6px;
  }

  .topbar > .topbar-cluster:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  .search-toolbar-cluster {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
  }

  .topbar-right {
    grid-column: 3;
    grid-row: 1;
  }

  .zoom-toolbar-cluster {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .minimap {
    display: none;
  }
}

@media (max-width: 400px) {
  .topbar-right .sync-status {
    width: 46px;
    min-width: 0;
    overflow: hidden;
    padding-inline: 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

body.mobile-readonly .workspace,
body.mobile-readonly .workspace.inspector-hidden {
  grid-template-columns: minmax(0, 1fr);
}

body.mobile-readonly .canvas-wrap {
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}

body.mobile-readonly .board-item,
body.mobile-readonly .board-hint {
  pointer-events: none;
}

body.mobile-readonly .board-item.selected {
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

body.mobile-readonly .inspector,
body.mobile-readonly .create-menu-wrap,
body.mobile-readonly .zoom-toolbar-cluster,
body.mobile-readonly .minimap {
  display: none;
}

body.mobile-readonly .mobile-show-items {
  display: block;
}

.crop-shell,
.cutout-shell {
  padding: 22px;
  display: grid;
  gap: 18px;
  background: white;
}

.cutout-shell {
  max-height: min(880px, 92vh);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.crop-stage,
.cutout-stage {
  position: relative;
  height: min(68vh, 720px);
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--soft);
  border-radius: 8px;
}

.cutout-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.cutout-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eceee8;
}

.segmented-control button {
  padding: 8px 12px;
  color: var(--ink);
  background: transparent;
}

.segmented-control button.active {
  color: white;
  background: var(--ink);
}

.brush-control {
  display: grid;
  grid-template-columns: auto 130px 34px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.brush-control input {
  accent-color: var(--accent);
}

.brush-control strong {
  color: var(--ink);
  text-align: right;
}

.cutout-undo {
  padding: 8px 10px;
  color: var(--ink);
  background: #eceee8;
}

.cutout-undo:disabled {
  cursor: default;
}

.crop-stage img {
  display: block;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: calc(100% - 48px);
  max-height: calc(100% - 48px);
  object-fit: contain;
  border-radius: 7px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

.cutout-stage {
  align-items: start;
  justify-items: center;
  padding: 24px;
  overflow: auto;
  background-color: #f8f8f4;
  background-image:
    linear-gradient(45deg, #d9dcd6 25%, transparent 25%),
    linear-gradient(-45deg, #d9dcd6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9dcd6 75%),
    linear-gradient(-45deg, transparent 75%, #d9dcd6 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.cutout-stage canvas {
  display: block;
  max-width: 100%;
  max-height: none;
  width: auto;
  height: auto;
  border-radius: 7px;
  cursor: crosshair;
  touch-action: none;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.12);
}

.cutout-status {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  min-height: 18px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.cutout-status:empty {
  display: none;
}

.cutout-brush-preview {
  position: absolute;
  z-index: 2;
  display: none;
  pointer-events: none;
  border: 1px solid rgba(36, 93, 95, 0.85);
  border-radius: 50%;
  background: rgba(36, 93, 95, 0.08);
  transform: translate(-50%, -50%);
}

.crop-box {
  position: absolute;
  width: 260px;
  height: 340px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.36);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--accent);
}

.crop-nw,
.crop-ne,
.crop-se,
.crop-sw {
  width: 16px;
  height: 16px;
}

.crop-nw {
  top: -8px;
  left: -8px;
  cursor: nwse-resize;
}

.crop-n {
  top: -7px;
  left: calc(50% - 6px);
  cursor: ns-resize;
}

.crop-ne {
  top: -8px;
  right: -8px;
  cursor: nesw-resize;
}

.crop-e {
  top: calc(50% - 6px);
  right: -7px;
  cursor: ew-resize;
}

.crop-se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.crop-s {
  bottom: -7px;
  left: calc(50% - 6px);
  cursor: ns-resize;
}

.crop-sw {
  bottom: -8px;
  left: -8px;
  cursor: nesw-resize;
}

.crop-w {
  top: calc(50% - 6px);
  left: -7px;
  cursor: ew-resize;
}

.crop-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* MAC-241: Supabase sign-in — Google button + input spacing on the auth card. */
#gkvSbForm input { margin-bottom: 8px; }
.gkv-google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 8px; padding: 10px 14px;
  background: #fff; color: #1f2328;
  border: 1px solid rgba(0,0,0,0.15); border-radius: 10px;
  font: inherit; font-weight: 600; cursor: pointer;
}
.gkv-google-btn:hover { background: #f6f7f8; }
.gkv-account-email { font-size: 12px; color: rgba(0,0,0,0.55); padding: 2px 0 6px; word-break: break-all; }
.auth-card button.gkv-link-btn { display: block; width: 100%; background: none; border: none; box-shadow: none; color: rgba(0,0,0,0.55); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: underline; padding: 8px 0 2px; }
.auth-card button.gkv-link-btn:hover { background: none; color: rgba(0,0,0,0.85); }
