.studio-toolbar {
  background: var(--surface-warm);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pill-group {
  display: inline-flex;
  background: #2C3338;
  border-radius: 8px;
  padding: 3px;
}

.pill-btn {
  border: none;
  background: transparent;
  color: #E7DFD3;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  min-height: 44px;
}

.pill-btn.active {
  background: var(--accent);
  color: #fff;
}

.mobile-jump-bar {
  display: none;
  margin-bottom: 14px;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .mobile-jump-bar { display: flex; }
}

.studio-layout {
  display: grid;
  grid-template-columns: 470px 1fr;
  gap: 18px;
  align-items: start;
}

@media (max-width: 980px) {
  .studio-layout { grid-template-columns: 1fr; }
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}

.field-input, .cell-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  font-family: var(--font-sans);
  background: #fff;
  min-height: 44px;
}

@media (max-width: 980px) {
  .field-input, .cell-input {
    font-size: 16px; /* Prevents iOS Safari auto-zoom on tap */
    min-height: 44px;
  }
}

.cell-input { padding: 6px 8px; }
.cell-qty { width: 64px; }
.cell-dim { width: 88px; font-family: var(--font-mono); }

.select-inline {
  width: auto;
  max-width: 240px;
}

.input-invalid {
  border-color: var(--red);
  background: var(--red-bg);
}

.error-banner {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 14px;
}

.hero-savings {
  background: linear-gradient(135deg, #174F33 0%, #1E6B45 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

.hero-savings h2 { margin: 4px 0; font-size: 21px; }

.table-wrap { overflow-x: auto; }
.cut-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cut-table th, .cut-table td {
  padding: 7px 5px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}
.cut-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 820px) {
  .cut-table thead { display: none; }
  .cut-table, .cut-table tbody, .cut-table tr, .cut-table td { display: block; width: 100%; }
  .cut-table tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    background: #FAF8F4;
  }
  .cut-table td {
    border-bottom: none;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .cut-table td::before {
    content: attr(data-label);
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    flex-shrink: 0;
  }
  .cell-qty, .cell-dim { width: 140px; }
}

.edge-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.edge-chk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.edge-chk input {
  width: 18px;
  height: 18px;
}

.edge-mini {
  display: inline-block;
  width: 24px;
  height: 14px;
  border: 1px solid #999;
  background: #F6F3EC;
  flex-shrink: 0;
}

.edge-mini.edge-l1 { border-top: 3px solid var(--accent); }
.edge-mini.edge-l2 { border-bottom: 3px solid var(--accent); }
.edge-mini.edge-w1 { border-left: 3px solid var(--accent); }
.edge-mini.edge-w2 { border-right: 3px solid var(--accent); }

.vault-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #FAF8F4;
}

.vault-row.vault-active {
  border-color: var(--green);
  background: var(--green-bg);
}

.muted-note { font-size: 12px; color: var(--muted); }

.tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--surface-warm);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}

.tab-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.board-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
  background: #FCFBF8;
  break-inside: avoid;
}

.board-card-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.cut-svg {
  width: 100%;
  height: auto;
  display: block;
  background: #F3EFE6;
  border: 1px solid #B7AC99;
  border-radius: 4px;
}

.cut-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #FAF8F4;
  cursor: pointer;
  min-height: 48px;
  break-inside: avoid;
}

.cut-step-row.done {
  opacity: 0.6;
  text-decoration: line-through;
  background: var(--green-bg);
}

.glove-checkbox {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  accent-color: var(--green);
}

.labels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.avery-card {
  border: 1.5px dashed #7D7466;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.avery-card.avery-vault {
  border-color: var(--green);
  background: #F4FBF6;
}

.locked-card {
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 18px;
  background: #FFF9F3;
  text-align: center;
}

.status-box {
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  background: var(--surface-warm);
}
.status-ok { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.status-err { background: var(--red-bg); color: var(--red); border-color: var(--red); }

.toast-bar {
  position: fixed;
  bottom: 18px;
  right: 18px;
  background: #1C2124;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: none;
  z-index: 60;
}
.toast-bar.visible { display: block; }

body.shop-mode-active .studio-inputs-col {
  display: none;
}

body.shop-mode-active .studio-layout {
  grid-template-columns: 1fr;
}

body.shop-mode-active .cut-step-row {
  min-height: 58px;
  padding: 14px;
}

body.shop-mode-active .glove-checkbox {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

@media print {
  header.site-header,
  .studio-toolbar,
  .mobile-jump-bar,
  .studio-inputs-col,
  .tabs-bar,
  .export-card,
  footer.site-footer,
  .toast-bar {
    display: none !important;
  }
  .studio-layout { display: block; }
  .card { border: none; padding: 0; }
  .hero-savings {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000;
  }
  #tab-diagrams,
  #tab-sequence {
    display: block !important;
  }
}
