:root {
  --ink: #18322c;
  --muted: #6f7d76;
  --forest: #173f35;
  --forest-2: #23594b;
  --lime: #d9f06f;
  --cream: #f5f2e9;
  --paper: #fffdf8;
  --line: #dedfd6;
  --soft: #eceee7;
  --danger: #a63b35;
  --warning: #d9902d;
  --shadow: 0 14px 40px rgba(23, 63, 53, .08);
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--cream);
  font-family: "DM Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--forest);
  color: white;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--lime); color: var(--forest); font: 800 22px/1 Manrope; transform: rotate(-3deg); }
.brand strong, .brand small { display: block; }
.brand strong { font: 800 17px/1.1 Manrope; letter-spacing: .02em; }
.brand small { margin-top: 4px; opacity: .7; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.button { border: 0; border-radius: 11px; min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, opacity .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--lime); color: var(--forest); }
.button-secondary { background: rgba(255,255,255,.11); color: white; border: 1px solid rgba(255,255,255,.16); }
.button-small { min-height: 35px; padding: 0 12px; font-size: 13px; }
.button-outline { border: 1px solid var(--line); background: white; color: var(--ink); }
.save-state { display: flex; gap: 8px; align-items: center; font-size: 13px; color: rgba(255,255,255,.76); margin-right: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #83d7a5; box-shadow: 0 0 0 3px rgba(131,215,165,.13); }
.save-state.saving .status-dot { background: var(--lime); animation: pulse 1s infinite; }
.save-state.dirty .status-dot { background: #efbf67; }
.save-state.error .status-dot { background: #ff7c70; }
@keyframes pulse { 50% { opacity: .35; } }

.workspace { display: grid; grid-template-columns: 318px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { padding: 30px 22px 22px; border-right: 1px solid var(--line); background: #eeece3; display: flex; flex-direction: column; }
.sidebar-heading { display: flex; align-items: end; justify-content: space-between; padding: 0 5px 18px; }
.eyebrow { margin: 0 0 5px; color: #76847c; text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 800; }
.sidebar h1 { margin: 0; font: 800 24px/1.1 Manrope; }
.count, .tab-count { min-width: 27px; height: 24px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 999px; background: #dfe2d8; font-size: 12px; font-weight: 700; }
.search-box { height: 45px; display: flex; align-items: center; gap: 9px; padding: 0 13px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: #73817a; }
.search-box:focus-within { outline: 2px solid rgba(35,89,75,.18); border-color: var(--forest-2); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px; }
.product-list { display: flex; flex-direction: column; gap: 7px; min-height: 80px; }
.product-item { position: relative; width: 100%; padding: 14px 14px 13px 17px; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 13px; color: var(--ink); cursor: pointer; }
.product-item::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; border-radius: 3px; background: transparent; }
.product-item:hover { background: rgba(255,255,255,.55); }
.product-item.active { background: var(--paper); border-color: #dadcd3; box-shadow: 0 5px 18px rgba(25,55,47,.06); }
.product-item.active::before { background: var(--forest-2); }
.product-name { display: block; margin-bottom: 5px; font-weight: 700; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.badge { max-width: 105px; padding: 3px 7px; border-radius: 99px; background: #e8e6dc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge.complete, .badge.approved { color: #21603f; background: #dcebdc; }
.badge.review { color: #855717; background: #f7e8c8; }
.list-empty { padding: 34px 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5; }
.sidebar-tip { margin-top: auto; padding: 15px; display: flex; gap: 11px; border-radius: 13px; color: #456058; background: #e2e8d7; font-size: 12px; line-height: 1.45; }
.sidebar-tip p { margin: 0; }

.editor-shell { min-width: 0; background: var(--paper); }
.empty-state { min-height: calc(100vh - 76px); padding: 32px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state h2 { margin: 8px 0; font: 800 32px/1.15 Manrope; }
.empty-state > p:not(.eyebrow) { margin: 0 0 22px; max-width: 430px; color: var(--muted); }
.empty-illustration { width: 82px; height: 82px; margin-bottom: 22px; border-radius: 24px; display: grid; place-items: center; background: var(--forest); color: var(--lime); font-size: 35px; transform: rotate(3deg); }
.editor { max-width: 1160px; margin: auto; padding: 38px 46px 50px; }
.editor-header { display: flex; justify-content: space-between; gap: 32px; align-items: end; }
.breadcrumbs { margin-bottom: 14px; color: #8a958f; font-size: 12px; }
.breadcrumbs span { margin-left: 7px; }
.title-group h2 { max-width: 720px; margin: 0; font: 800 34px/1.12 Manrope; letter-spacing: -.025em; }
.meta-row { display: flex; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.completion-card { min-width: 180px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f3; }
.completion-copy { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.completion-copy strong { font: 800 20px/1 Manrope; }
.completion-copy span { color: var(--muted); font-size: 11px; }
.progress { height: 5px; margin-top: 10px; overflow: hidden; border-radius: 5px; background: #e1e3dc; }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--forest-2); transition: width .25s; }
.tabs { display: flex; gap: 26px; margin-top: 34px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { position: relative; flex: 0 0 auto; padding: 0 1px 14px; border: 0; background: transparent; color: #75817b; font-weight: 700; font-size: 13px; cursor: pointer; }
.tabs button.active { color: var(--forest); }
.tabs button.active::after { content: ""; position: absolute; height: 3px; left: 0; right: 0; bottom: -1px; border-radius: 3px 3px 0 0; background: var(--forest); }
.tab-count { min-width: 20px; height: 19px; margin-left: 4px; font-size: 10px; }
.tab-panel { display: none; padding-top: 26px; }
.tab-panel.active { display: block; }
.form-section { margin-bottom: 24px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fffefa; box-shadow: 0 3px 14px rgba(24,50,44,.025); }
.section-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 21px; }
.section-heading h3 { margin: 0 0 5px; font: 800 17px/1.2 Manrope; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.section-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: #edf0e4; color: var(--forest); font-weight: 800; }
.field-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 17px; }
.field { grid-column: span 4; min-width: 0; }
.field.half { grid-column: span 6; }
.field.full { grid-column: 1 / -1; }
.field.quarter { grid-column: span 3; }
.field label { display: flex; gap: 5px; align-items: center; margin-bottom: 7px; color: #40564f; font-size: 12px; font-weight: 700; }
.required { color: var(--danger); }
.hint { display: block; margin-top: 6px; color: #8a958f; font-size: 10px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #d8dcd4; border-radius: 9px; background: white; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
.field input, .field select { min-height: 43px; padding: 0 11px; }
.field textarea { min-height: 92px; padding: 11px; line-height: 1.5; resize: vertical; }
.field textarea.tall { min-height: 150px; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(35,89,75,.1); }
.field input.invalid, .field select.invalid { border-color: #d9857f; background: #fffaf9; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 11px; top: 12px; color: #7c8982; font-size: 12px; }
.input-prefix input { padding-left: 42px; }

.variations-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 14px; }
.variations-toolbar p { margin: 0; color: var(--muted); font-size: 12px; }
.variation-card { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.variation-header { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 15px; border: 0; background: #f7f6ef; color: var(--ink); text-align: left; cursor: pointer; }
.variation-header strong { display: block; font-size: 13px; }
.variation-header small { display: block; margin-top: 3px; color: var(--muted); }
.variation-body { padding: 17px; border-top: 1px solid var(--line); }
.variation-card.collapsed .variation-body { display: none; }
.variation-actions { display: flex; justify-content: flex-end; margin-top: 15px; }
.text-danger { border: 0; background: transparent; color: var(--danger); font-weight: 700; cursor: pointer; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 8px 3px 0; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: min(390px, calc(100vw - 48px)); padding: 13px 16px; border-radius: 11px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 13px; transform: translateY(20px); opacity: 0; pointer-events: none; transition: .2s; z-index: 50; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #8e332e; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 250px minmax(0, 1fr); }
  .editor { padding: 30px 25px 45px; }
  .field, .field.quarter { grid-column: span 6; }
  .field.full { grid-column: 1 / -1; }
  .save-state { display: none; }
}
@media (max-width: 680px) {
  .topbar { height: auto; min-height: 70px; padding: 12px 15px; }
  .brand small { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar .button { min-height: 39px; padding: 0 11px; font-size: 12px; }
  .workspace { display: block; }
  .sidebar { min-height: auto; max-height: 320px; border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 15px; overflow: auto; }
  .sidebar-tip { display: none; }
  .product-list { display: grid; grid-auto-flow: column; grid-auto-columns: 220px; overflow-x: auto; }
  .editor { padding: 26px 16px 40px; }
  .editor-header { display: block; }
  .completion-card { margin-top: 20px; }
  .title-group h2 { font-size: 28px; }
  .tabs { gap: 20px; }
  .form-section { padding: 18px 15px; }
  .field, .field.half, .field.quarter { grid-column: 1 / -1; }
  .editor-footer { align-items: flex-start; }
}

/* Matrix-first workspace */
.matrix-page { background: #f1efe7; }
.matrix-topbar { min-height: 76px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: var(--forest); color: white; position: sticky; top: 0; z-index: 30; }
.matrix-main { padding: 32px 0 60px; }
.matrix-intro { width: 100%; margin: 0 0 24px; padding: 0 24px; display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.matrix-intro h1 { margin: 0; font: 800 clamp(28px, 3vw, 42px)/1.08 Manrope; letter-spacing: -.035em; }
.matrix-intro > div > p:last-child { max-width: 680px; margin: 12px 0 0; color: var(--muted); }
.matrix-stats { display: flex; padding: 13px 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,253,248,.7); }
.matrix-stats div { min-width: 100px; padding: 0 20px; border-right: 1px solid var(--line); }
.matrix-stats div:last-child { border: 0; }
.matrix-stats strong, .matrix-stats span { display: block; }
.matrix-stats strong { font: 800 22px/1.1 Manrope; }
.matrix-stats span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.matrix-card { width: 100%; margin: 0; overflow: hidden; border-top: 1px solid #d6d8d0; border-bottom: 1px solid #d6d8d0; background: var(--paper); box-shadow: 0 12px 34px rgba(23,63,53,.07); }
.matrix-toolbar { min-height: 68px; padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.matrix-search { width: min(410px, 100%); margin: 0; background: white; }
.legend { display: flex; gap: 16px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }
.legend-simple { background: #b8c7bf; }
.legend-variable { background: var(--lime); border: 1px solid #acbf51; }
.matrix-scroll { position: relative; min-height: 420px; overflow: auto; scrollbar-gutter: stable; }
.matrix-scroll::-webkit-scrollbar { width: 13px; height: 13px; }
.matrix-scroll::-webkit-scrollbar-track { background: #e5e4dc; }
.matrix-scroll::-webkit-scrollbar-thumb { border: 3px solid #e5e4dc; border-radius: 10px; background: #899991; }
.product-matrix { width: 100%; min-width: 3390px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.product-matrix th { height: 42px; padding: 0 10px; position: sticky; top: 0; z-index: 5; border-right: 1px solid #e1e2dc; border-bottom: 1px solid #d8dad3; background: #f4f3ed; color: #65736c; text-align: left; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; font-weight: 800; }
.product-matrix th:nth-child(1) { width: 250px; }
.product-matrix th:nth-child(2) { width: 135px; }
.product-matrix th:nth-child(3) { width: 150px; }
.product-matrix th:nth-child(4) { width: 175px; }
.product-matrix th:nth-child(5) { width: 155px; }
.product-matrix th:nth-child(6), .product-matrix th:nth-child(7) { width: 130px; }
.product-matrix th:nth-child(8), .product-matrix th:nth-child(9) { width: 140px; }
.product-matrix th:nth-child(10) { width: 100px; }
.product-matrix th:nth-child(11) { width: 135px; }
.product-matrix th:nth-child(n+12):nth-child(-n+20) { width: 125px; }
.product-matrix th:nth-child(21) { width: 125px; }
.product-matrix th:nth-child(22) { width: 250px; }
.product-matrix th:nth-child(23) { width: 185px; }
.product-matrix th:nth-child(24) { width: 54px; }
.product-matrix td { height: 57px; padding: 0; border-right: 1px solid #e4e5df; border-bottom: 1px solid #e4e5df; background: white; vertical-align: middle; }
.product-matrix tr:hover td { background: #fcfcf7; }
.product-matrix tr.row-saving td:first-child { box-shadow: inset 3px 0 #e0ad4f; }
.product-matrix tr.row-saved td:first-child { box-shadow: inset 3px 0 #6eb486; }
.product-matrix tr.row-error td:first-child { box-shadow: inset 3px 0 #cf665d; }
.product-matrix .sticky-col { position: sticky; left: 0; z-index: 4; box-shadow: 5px 0 12px rgba(24,50,44,.035); }
.product-matrix th.sticky-col { z-index: 7; }
.cell-input, .cell-select { width: 100%; height: 56px; padding: 0 10px; border: 0; border-radius: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; }
.cell-input:focus, .cell-select:focus { background: #f7fae9; box-shadow: inset 0 0 0 2px var(--forest-2); }
.combo-input { background-color: #fffefa; }
.cell-product-wrap { height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 10px 0 12px; }
.type-stripe { width: 5px; height: 34px; flex: 0 0 auto; border-radius: 4px; background: #b8c7bf; }
.type-stripe.variable { background: var(--lime); }
.cell-product-wrap input { min-width: 0; padding: 0; font-weight: 700; }
.cell-money { position: relative; }
.cell-money::before { content: "$"; position: absolute; left: 9px; top: 19px; color: #89948f; font-size: 11px; }
.cell-money input { padding-left: 22px; }
.variation-cell { height: 56px; padding: 0 10px; display: flex; align-items: center; gap: 8px; }
.variation-pill { min-width: 29px; height: 27px; padding: 0 8px; display: grid; place-items: center; border-radius: 99px; background: #e8efd2; font-weight: 800; font-size: 11px; }
.variation-cell small { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.variation-actions-cell { height: 56px; display: flex; align-items: center; }
.variation-actions-cell .variation-cell { min-width: 0; flex: 1; }
.variation-actions-cell .variation-cell b { margin-left: auto; font-size: 10px; }
.inline-add { min-width: 42px; height: 34px; margin-right: 7px; border: 1px solid #cfd6c9; border-radius: 8px; background: #eef4d5; color: var(--forest); font-size: 12px; font-weight: 800; cursor: pointer; }
.inline-add:hover { background: var(--lime); }
.inline-add.subtle { width: calc(100% - 14px); margin: 0 7px; white-space: nowrap; }
.row-menu { width: 100%; height: 56px; border: 0; background: transparent; color: #61716a; font-size: 20px; cursor: pointer; }
.row-menu:hover { background: #eef1e8; }
.action-menu { width: 270px; position: fixed; z-index: 55; padding: 7px; border: 1px solid #d7dad2; border-radius: 12px; background: white; box-shadow: 0 18px 45px rgba(15,34,29,.2); }
.action-menu > button { width: 100%; padding: 11px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.action-menu > button:hover, .action-menu > button:focus-visible { outline: 0; background: #f0f3e7; }
.action-menu > button > span:first-child { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; background: #e9ede3; font-size: 15px; }
.action-menu strong, .action-menu small { display: block; }
.action-menu strong { font-size: 12px; }
.action-menu small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.action-menu > button.danger { color: var(--danger); }
.action-menu > button.danger > span:first-child { background: #f5e7e3; }
.variation-row td { height: 45px; background: #f8f8f2; }
.variation-row .sticky-col { padding-left: 34px; background: #f8f8f2; color: #53665e; font-size: 11px; }
.variation-row input, .variation-row select { height: 44px; font-size: 11px; }
.matrix-empty { min-height: 420px; display: grid; place-content: center; justify-items: center; text-align: center; }
.matrix-empty > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: #e8eadf; font-size: 24px; }
.matrix-empty h2 { margin: 14px 0 6px; font: 800 21px Manrope; }
.matrix-empty p { margin: 0 0 18px; color: var(--muted); }
.matrix-footer { min-height: 43px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
kbd { padding: 2px 5px; border: 1px solid #cfd2ca; border-bottom-width: 2px; border-radius: 4px; background: white; font: inherit; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(16,35,30,.28); backdrop-filter: blur(2px); }
.detail-drawer { width: min(760px, 94vw); position: fixed; inset: 0 0 0 auto; z-index: 41; display: flex; flex-direction: column; background: var(--paper); box-shadow: -24px 0 60px rgba(16,35,30,.2); transform: translateX(103%); transition: transform .24s ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-header { padding: 25px 28px 18px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font: 800 26px/1.15 Manrope; }
.drawer-header > div > span { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); font-size: 22px; cursor: pointer; }
.drawer-tabs { padding: 0 28px; display: flex; gap: 22px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.drawer-tabs button { min-height: 48px; position: relative; flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.drawer-tabs button.active { color: var(--forest); }
.drawer-tabs button.active::after { content: ""; position: absolute; height: 3px; left: 0; right: 0; bottom: -1px; background: var(--forest); }
.drawer-content { flex: 1; overflow: auto; padding: 24px 28px; }
.drawer-section { margin-bottom: 27px; }
.drawer-section h3 { margin: 0 0 4px; font: 800 16px Manrope; }
.drawer-section > p { margin: 0 0 16px; color: var(--muted); font-size: 11px; }
.drawer-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 15px; }
.drawer-grid .field { grid-column: auto; }
.drawer-grid .field.full { grid-column: 1 / -1; }
.drawer-footer { min-height: 62px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.modal-layer { position: fixed; inset: 0; z-index: 60; padding: 24px; background: rgba(15,34,29,.56); backdrop-filter: blur(5px); overflow: auto; }
.duplicate-card { width: min(520px, 100%); margin: 14vh auto; overflow: hidden; border-radius: 18px; background: var(--paper); box-shadow: 0 30px 80px rgba(8,25,20,.28); }
.duplicate-card header { padding: 24px 25px 16px; display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.duplicate-card h2 { margin: 0; font: 800 23px/1.2 Manrope; }
.duplicate-card > p { margin: 0; padding: 0 25px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.duplicate-name { display: block; padding: 22px 25px 27px; }
.duplicate-name span { display: block; margin-bottom: 8px; color: #40564f; font-size: 12px; font-weight: 700; }
.duplicate-name b { color: var(--danger); }
.duplicate-name input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #d8dcd4; border-radius: 9px; outline: 0; }
.duplicate-name input:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(35,89,75,.1); }
.duplicate-card footer { min-height: 70px; padding: 0 25px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.wizard-card { width: min(900px, 100%); min-height: 620px; margin: 3vh auto; display: flex; flex-direction: column; overflow: hidden; border-radius: 20px; background: var(--paper); box-shadow: 0 30px 80px rgba(8,25,20,.28); }
.wizard-header { padding: 24px 28px 19px; display: flex; justify-content: space-between; align-items: start; }
.wizard-header h2 { margin: 0; font: 800 25px Manrope; }
.wizard-progress { height: 4px; background: #e1e3db; }
.wizard-progress span { display: block; width: 25%; height: 100%; background: var(--forest-2); transition: width .25s; }
.wizard-layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 190px minmax(0,1fr); }
.wizard-steps { margin: 0; padding: 28px 20px; list-style: none; background: #f0efe7; }
.wizard-steps li { position: relative; display: flex; gap: 10px; align-items: start; padding: 0 0 31px; color: #88928d; }
.wizard-steps li:not(:last-child)::after { content: ""; position: absolute; width: 1px; height: 25px; top: 29px; left: 14px; background: #cfd3cb; }
.wizard-steps b { width: 29px; height: 29px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid #cbd0c8; border-radius: 50%; background: #f8f7f1; font-size: 11px; }
.wizard-steps strong, .wizard-steps small { display: block; }
.wizard-steps strong { margin-top: 1px; font-size: 12px; }
.wizard-steps small { margin-top: 3px; font-size: 9px; }
.wizard-steps li.active, .wizard-steps li.done { color: var(--forest); }
.wizard-steps li.active b { border-color: var(--forest); background: var(--forest); color: var(--lime); }
.wizard-steps li.done b { border-color: #9fb35b; background: var(--lime); }
.wizard-content { padding: 30px 34px; overflow: auto; }
.wizard-content h3 { margin: 0 0 7px; font: 800 23px/1.2 Manrope; }
.wizard-lead { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.wizard-section { margin: 0 0 24px; padding: 19px; border: 1px solid var(--line); border-radius: 13px; background: #fffefa; }
.wizard-section h4 { margin: 0 0 4px; font: 800 15px Manrope; }
.wizard-section > p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }
.wizard-fields .field label { justify-content: space-between; }
.wizard-fields .field label small { margin-left: auto; color: #929d97; font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.wizard-skip { min-height: 330px; display: grid; place-content: center; justify-items: center; text-align: center; }
.wizard-skip > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--lime); color: var(--forest); font-weight: 800; }
.wizard-skip h3 { margin-top: 16px; }
.wizard-skip p { max-width: 430px; color: var(--muted); }
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.type-card { min-height: 230px; padding: 23px; border: 2px solid var(--line); border-radius: 15px; background: white; color: var(--ink); text-align: left; cursor: pointer; }
.type-card:hover { border-color: #aab8b0; }
.type-card.selected { border-color: var(--forest-2); background: #f5f8e9; box-shadow: 0 0 0 3px rgba(35,89,75,.08); }
.type-card-icon { width: 44px; height: 44px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 12px; background: #e8ece4; font-size: 20px; }
.type-card.selected .type-card-icon { background: var(--lime); }
.type-card strong { display: block; font: 800 16px Manrope; }
.type-card > span { display: block; margin: 7px 0 17px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.type-card ul { margin: 0; padding-left: 17px; color: #4e625a; font-size: 11px; line-height: 1.7; }
.wizard-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wizard-fields .field { grid-column: auto; }
.wizard-fields .field.full { grid-column: 1 / -1; }
.wizard-variation { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #faf9f3; }
.wizard-variation input { min-width: 0; height: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; }
.wizard-variation button { min-height: 32px; grid-column: 4; border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.review-box { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #f7f7f0; }
.review-row { padding: 10px 0; display: flex; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); font-size: 12px; }
.review-row:last-child { border: 0; }
.review-row span { color: var(--muted); }
.wizard-footer { min-height: 70px; padding: 0 28px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); }
.wizard-footer > span { color: var(--muted); font-size: 11px; }

@media (max-width: 800px) {
  .matrix-topbar { padding: 12px 15px; align-items: flex-start; }
  .matrix-topbar .brand small, .matrix-topbar .save-state { display: none; }
  .matrix-topbar .topbar-actions { flex-wrap: wrap; justify-content: flex-end; }
  .matrix-topbar .button { min-height: 37px; padding: 0 9px; font-size: 11px; }
  .matrix-main { padding: 25px 0 45px; }
  .matrix-intro { padding: 0 14px; }
  .matrix-intro { display: block; }
  .matrix-stats { margin-top: 19px; }
  .matrix-stats div { min-width: 0; flex: 1; padding: 0 12px; }
  .legend { display: none; }
  .wizard-layout { display: block; }
  .wizard-steps { padding: 15px 18px; display: flex; justify-content: space-between; }
  .wizard-steps li { padding: 0; }
  .wizard-steps li:not(:last-child)::after, .wizard-steps li span { display: none; }
  .wizard-content { padding: 25px 20px; }
  .type-cards, .wizard-fields { grid-template-columns: 1fr; }
  .wizard-fields .field { grid-column: 1; }
  .wizard-variation { grid-template-columns: 1fr 1fr; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
  .wizard-variation button { grid-column: 2; }
  .drawer-grid { grid-template-columns: 1fr; }
  .drawer-grid .field { grid-column: 1; }
}
