:root {
  color-scheme: light;
  --ink: #192922;
  --muted: #58655e;
  --light-text: #acbcb3;
  --pine: #172a24;
  --pine-deep: #12231d;
  --green: #255841;
  --canvas: #f6f7f3;
  --surface: #fff;
  --line: #e4e9e1;
  --accent: #f4a36b;
  --accent-hover: #ffb781;
  --display: 'Manrope', system-ui, sans-serif;
  --font: 'DM Sans', system-ui, sans-serif;
  --radius: 15px;
  --shadow: 0 1px 2px #14261d0a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
[lang='ar'] { --font: 'Noto Sans Arabic', system-ui, sans-serif; --display: 'Noto Sans Arabic', system-ui, sans-serif; }
[dir='rtl'] h1, [dir='rtl'] h2, [dir='rtl'] h3, [dir='rtl'] .brand strong, [dir='rtl'] .nav-label { letter-spacing: 0; }
body { margin: 0; font: 400 1rem/1.5 var(--font); color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #469676; outline-offset: 3px; }
:focus:not(:focus-visible) { outline: none; }
svg.icon { width: 19px; height: 19px; flex: none; display: inline-block; vertical-align: middle; }
p, h1, h2, h3 { margin: 0; }
h1, h2, h3, .number, .brand strong { font-family: var(--display); }
h1 { font-weight: 800; font-size: clamp(1.8rem, 3.2vw, 2.22rem); line-height: 1.18; letter-spacing: -.045em; }
h2 { font-size: 1.1rem; font-weight: 800; letter-spacing: -.024em; }
h3 { font-size: 1rem; font-weight: 800; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.skip { position: fixed; z-index: 20; top: 10px; left: 10px; background: white; padding: 10px; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar { color: #eaf0eb; background: var(--pine); height: 100vh; height: 100dvh; position: sticky; top: 0; display: flex; flex-direction: column; padding: 28px 16px 16px; overflow-y: auto; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 8px; margin-bottom: 43px; }
.brand-mark { width: 39px; height: 39px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--pine-deep); flex: none; }
.brand-mark .icon { width: 23px; height: 23px; }
.brand strong { display: block; font-size: 1.09rem; line-height: 1.25; font-weight: 800; letter-spacing: -.035em; }
.brand small { display: block; font-size: .73rem; color: var(--light-text); margin-top: 3px; }
.nav-group + .nav-group { margin-top: 24px; }
.nav-label { margin: 0 10px 8px; font-size: .69rem; text-transform: uppercase; letter-spacing: .105em; font-weight: 700; color: var(--light-text); }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 11px; min-height: 43px; font-size: .9rem; font-weight: 600; color: #d9e3dc; border-radius: 8px; margin: 3px 0; }
.nav-item:hover { background: #ffffff12; }
.nav-item[aria-current="page"] { color: #fff; background: #31483e; }
.nav-item[aria-current="page"] .icon { color: #ffb484; }
.nav-item[aria-current="page"]::before { content: ''; position: absolute; top: 10px; bottom: 10px; left: 0; width: 2px; background: var(--accent); border-radius: 4px; }
.sidebar-spacer { flex: 1; min-height: 35px; }
.workshop { border: 1px solid #ffffff16; background: #ffffff08; border-radius: 11px; display: flex; align-items: center; gap: 9px; padding: 10px; width: 100%; text-align: left; color: #f4f7f4; }
.workshop:hover { background: #ffffff14; }
.workshop > .icon { margin-left: auto; width: 15px; }
.workshop > span:nth-child(2) { flex: 1; min-width: 0; }
.workshop strong, .workshop small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workshop strong { font-size: .82rem; }
.workshop small { color: var(--light-text); font-size: .73rem; }
.workshop-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 7px; background: #e9f0e419; color: #d0e3cc; }
.topbar { min-height: 68px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px clamp(22px, 3vw, 44px); border-bottom: 1px solid var(--line); }
.crumb, .top-actions { display: flex; align-items: center; gap: 11px; }
.crumb { color: var(--muted); font-size: .87rem; }
.crumb strong { color: var(--ink); font-weight: 700; }
.crumb .icon { width: 13px; height: 13px; }
.top-actions { gap: 13px; }
.language-toggle { min-width: 38px; min-height: 34px; padding: 4px 7px; }
.language-toggle [lang='ar'] { font-family: 'Noto Sans Arabic',system-ui,sans-serif; }
.theme-toggle { border: 1px solid var(--line); }
.site-home-link { margin-bottom: 8px; }
.avatar { min-width: 34px; height: 34px; padding: 0 6px; border: none; border-radius: 50%; display: inline-grid; place-items: center; background: #dce9de; color: #264134; font-weight: 800; font-size: .78rem; }
.avatar:hover { background: #cfe2d3; }
.menu-toggle { display: none !important; }
.page { max-width: 1490px; margin: 0 auto; padding: 27px clamp(22px, 3vw, 44px) 45px; }
.page-head { display: flex; align-items: end; gap: 16px 22px; justify-content: space-between; margin-bottom: 23px; }
.page-head p { margin-top: 6px; color: var(--muted); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); white-space: nowrap; font-weight: 700; font-size: .86rem; line-height: 1.3; }
.btn .icon { width: 17px; height: 17px; }
.btn:hover { border-color: #a8b9ac; background: #f5f8f4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #2d2319; }
.btn.primary:hover { background: var(--accent-hover); border-color: #e98c51; }
.btn.pine { background: var(--pine); color: white; border-color: var(--pine); }
.btn.pine:hover { background: #2c4a3d; }
.btn.subtle { background: transparent; border-color: transparent; }
.btn.subtle:hover { background: #edf1eb; }
.btn.danger { color: #862b24; }
.hero { isolation: isolate; overflow: hidden; position: relative; display: flex; align-items: center; min-height: 206px; border-radius: var(--radius); padding: 24px 29px; color: white; background: #1c3529; }
.hero::before { content: ''; position: absolute; z-index: -2; inset: 0 0 0 40%; background: url('/cnc-atelier.webp') center 55% / cover no-repeat; }
.hero::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #1c3529 29%, #1c3529f5 41%, #1c35293b 72%, #142c2020); }
.hero > div { max-width: 490px; }
.hero h2 { font-size: clamp(1.54rem, 3vw, 2.12rem); line-height: 1.14; letter-spacing: -.045em; }
.hero p { margin-top: 9px; color: #e2ebe4; max-width: 41ch; font-size: .94rem; }
.hero .btn { margin-top: 15px; }
.stats { margin: 18px 0 23px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { padding: 15px 16px; display: block; min-width: 0; }
a.stat:hover, .shortcut:hover { border-color: #a5bcb0; background: #fbfdfa; }
.stat-top { display: flex; align-items: center; gap: 9px; color: #4b5a52; font-size: .82rem; font-weight: 700; }
.stat-icon { display: inline-grid; place-items: center; width: 31px; height: 31px; flex: none; border-radius: 8px; color: #3a654f; background: #eaf3eb; }
.stat-icon.warm { background: #fff0df; color: #8d4a26; }
.stat-icon.pale { background: #edf0f4; color: #465c74; }
.stat-icon .icon { width: 16px; height: 16px; }
.stat .number { display: block; font-weight: 800; font-size: clamp(1.19rem, 2.1vw, 1.66rem); letter-spacing: -.05em; margin: 6px 0 0; line-height: 1.29; }
.stat small { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; }
.dashboard-grid, .split { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr); gap: 17px; align-items: start; }
.split { gap: 20px; }
.panel { min-width: 0; }
.panel-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head p { margin-top: 3px; }
.panel-body { padding: 17px 19px; }
.padded { padding: 19px; }
.text-link { padding: 0; border: 0; background: transparent; color: #2f6449; font-size: .84rem; font-weight: 800; white-space: nowrap; text-align: left; }
.text-link:hover { text-decoration: underline; }
.shortcut-list { display: grid; gap: 7px; padding: 0 13px 13px; }
.shortcut { border: 1px solid var(--line); border-radius: 9px; padding: 9px; display: flex; align-items: center; gap: 8px; }
.shortcut strong { display: block; font-size: .83rem; }
.shortcut small { color: var(--muted); display: block; font-size: .73rem; line-height: 1.3; }
.shortcut > .icon { width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .86rem; }
th { padding: 8px 14px; background: #f6f8f4; border-block: 1px solid var(--line); font-weight: 700; color: var(--muted); white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 18px; }
th:last-child, td:last-child { padding-right: 18px; }
.document-cell { display: flex; align-items: center; gap: 9px; }
.document-cell .icon { color: #486355; width: 17px; height: 17px; }
.document-cell button { color: var(--ink); }
.document-cell small { display: block; white-space: nowrap; font-size: .73rem; }
.money-cell { white-space: nowrap; text-align: right; font-weight: 700; }
.pill { display: inline-flex; gap: 5px; align-items: center; vertical-align: middle; padding: 3px 7px; border-radius: 6px; font-size: .74rem; font-weight: 700; white-space: nowrap; color: #42544a; background: #eef1ed; }
.pill.green { color: #1f6547; background: #e7f2e7; }
.pill.amber { color: #7b4b19; background: #fff1d9; }
.pill.blue { color: #315d79; background: #e9f2f8; }
.pill.red { color: #852d24; background: #ffebe8; }
.demo-pill { background: #f5efe5; color: #795021; border-radius: 20px; padding: 5px 9px; }
.demo-pill::before { content: ''; width: 6px; height: 6px; background: #ac6927; border-radius: 100%; }
.form { display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; align-content: start; gap: 4px; color: #374b40; font-weight: 700; font-size: .89rem; min-width: 0; }
.field.wide, .wide { grid-column: 1 / -1; }
.field small { font-weight: 400; color: var(--muted); }
input:not([type='checkbox'], [type='radio']), textarea, select { width: 100%; min-width: 0; min-height: 41px; border: 1px solid #dce3da; border-radius: 8px; background: #fdfefc; color: var(--ink); padding: 8px 10px; }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%234d6255' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.4' d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-position: right 10px center; background-repeat: no-repeat; }
textarea { resize: vertical; }
input[type='checkbox'] { accent-color: #316b53; }
.field-group { border: 0; padding: 0; margin: 0; min-width: 0; }
.field-group + .field-group { border-top: 1px solid var(--line); padding-top: 12px; }
.field-group h3 { margin-bottom: 8px; }
.estimate-head { display: flex; gap: 4px; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.estimate-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.estimate-total { padding: 12px 0 4px; align-items: center; }
.estimate-total b { font: 800 1.52rem var(--display); letter-spacing: -.05em; }
.price-box { position: sticky; top: 16px; }
.price-box .actions { margin-top: 12px; }
.notice { padding: 11px 13px; border: 1px solid #e2eae1; border-radius: 8px; background: #f1f6ef; color: #355546; font-size: .88rem; }
.notice.warn { background: #fff7e9; border-color: #f4e0ba; color: #674822; }
.notice.error { background: #fdf0ed; border-color: #f2d6d0; color: #812e27; }
.notice + .notice { margin-top: 5px; }
.subscription-notice { margin-bottom: 12px; }
.trial-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px; margin-bottom: 16px; }
.trial-banner > div { display: flex; align-items: flex-start; gap: 10px; }
.trial-banner h2 { color: inherit; }
.trial-banner .stat-icon { margin-top: 2px; }
.trial-summary { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; }
.trial-summary time { font-weight: 700; }
.trial-summary + p { margin-top: 6px; }
.empty { text-align: center; padding: 30px 15px; color: var(--muted); }
.empty .stat-icon { margin: 0 auto 6px; }
.empty h3 { color: var(--ink); }
.empty p { margin: 5px auto 9px; max-width: 43ch; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 17px; flex-wrap: wrap; }
.toolbar input { width: auto; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; border-radius: 6px; background: transparent; font-weight: 700; font-size: .85rem; color: var(--muted); padding: 6px 9px; }
.tabs button[aria-pressed='true'], .tabs button:hover { background: #eaf2ea; color: #264937; }
.dropzone { border: 1px dashed #8fa99a; border-radius: 12px; display: grid; justify-items: center; gap: 5px; text-align: center; padding: 18px 12px; background: #f5faf4; }
.dropzone.drag, .dropzone:hover { background: #edf7ee; }
.dropzone .stat-icon { width: 39px; height: 39px; }
.dropzone p { overflow-wrap: anywhere; }
.preview { min-height: 290px; display: grid; place-items: center; margin: 12px 0; border: 1px solid var(--line); border-radius: 10px; background: #f6f9f6 radial-gradient(#a7b9ab66 1px, transparent 1px) 0 0 / 15px 15px; }
.preview img { display: block; width: 100%; height: 285px; padding: 12px; object-fit: contain; }
.layer-list { display: grid; gap: 2px; margin: 5px 0 8px; max-height: 172px; overflow: auto; }
.layer-list label { display: flex; gap: 7px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 3px; font-size: .87rem; }
.stack { display: grid; gap: 15px; }
.machine-list { display: grid; gap: 8px; }
.machine-row { border: 1px solid var(--line); border-radius: 8px; padding: 9px; display: flex; gap: 8px; align-items: center; }
.machine-row section { flex: 1; min-width: 0; }
.machine-row h3, .machine-row p { overflow-wrap: anywhere; }
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.plans .panel { padding: 12px; display: grid; gap: 4px; justify-items: start; }
.plans .btn { min-height: 36px; margin-top: 3px; }
.bank-order { border: 1px solid var(--line); border-radius: 11px; padding: 13px; }
.bank-order .estimate-head { flex-wrap: wrap; margin-bottom: 0; }
.bank-reference { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; font-size: .86rem; }
.bank-reference .btn { min-height: 32px; padding: 3px 6px; }
.bank-details { display: grid; gap: 7px; margin: 0; }
.bank-details > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 10px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.bank-details dt { color: var(--muted); font-size: .87rem; }
.bank-details dd { margin: 0; font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.locked-workshop { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); }
.access-panel { align-content: start; }
.access-panel > .stat-icon { width: 43px; height: 43px; }
.access-panel .stat-icon .icon { width: 21px; height: 21px; }
.access-panel h2 { margin-bottom: 5px; }
.access-panel p { max-width: 52ch; }
.access-steps { display: grid; gap: 6px; margin: 0; padding-inline-start: 24px; font-size: .9rem; }
dialog { border: 1px solid var(--line); border-radius: 15px; width: min(540px, calc(100% - 26px)); max-height: calc(100% - 30px); padding: 18px 21px 21px; color: var(--ink); box-shadow: 0 22px 80px #14261d39; }
dialog.doc-dialog { width: min(730px, calc(100% - 26px)); }
dialog::backdrop { background: #14251db0; }
.dialog-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 12px; }
.dialog-head h2 { font-size: 1.25rem; }
.dialog-actions { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.icon-btn { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 4px; border: none; border-radius: 7px; background: transparent; color: inherit; }
.icon-btn:hover { background: #eaf1ea; }
.paper { padding: 15px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; }
.paper h2 { font-size: 1.35rem; }
.paper h3 { margin-bottom: 3px; }
.paper p { white-space: pre-line; }
.paper .fields { margin: 10px 0; }
.paper-table { margin: 12px 0; }
.paper-table td, .paper-table th { padding: 7px; }
.doc-totals { margin-left: auto; max-width: 280px; }
.catalog-panel { overflow: hidden; }
.catalog-table-wrap:focus-visible { outline: 2px solid #469676; outline-offset: -2px; }
.catalog-table { min-width: 650px; }
.catalog-table td { overflow-wrap: anywhere; }
.catalog-category { display: block; }
.catalog-actions { flex-wrap: wrap; }
.catalog-actions .btn { min-height: 34px; padding: 5px 8px; }
.quote-editor { display: grid; gap: 12px; }
.quote-lines { display: grid; gap: 12px; }
.quote-line {
  min-width: 0;
  padding: 10px 12px 12px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.quote-line legend { padding-inline: 4px; font-weight: 800; }
.quote-line-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.quote-editor-total {
  width: min(100%, 300px);
  margin-inline-start: auto;
  border-top: 1px solid var(--line);
}
.quote-line-summary { margin-top: 6px; }
.quote-line-summary .btn { min-height: 34px; }
.quote-paper-table table, .quote-share__line-items table { min-width: 460px; }
#public-quote { min-height: 100vh; }
#public-quote .quote-share { max-width: 780px; margin-inline: auto; }
.quote-share__header { align-items: center; }
.quote-share__paper { background: var(--surface); }
.quote-share__metadata { margin: 0; }
.quote-share__metadata dt { color: var(--muted); font-size: .88rem; }
.quote-share__metadata dd { margin: 2px 0 0; font-weight: 700; }
.quote-share__totals { width: min(100%, 340px); max-width: none; margin-block: 0; }
.quote-share__totals dd { margin: 0; text-align: end; font-weight: 700; }
.quote-share__notes { border-top: 1px solid var(--line); padding-top: 12px; }
.quote-share__actions:empty { display: none; }
.cut-setup-fields { grid-template-columns: repeat(4,minmax(0,1fr)); }
.cut-import { display: grid; gap: 5px; }
.cut-import input { max-width: 100%; }
.cut-parts-head, .cut-result-head { flex-wrap: wrap; gap: 8px; }
.cut-input-scroll { max-height: 34rem; }
.cut-input-table { min-width: 700px; }
.cut-input-table th { position: sticky; top: 0; z-index: 1; }
.cut-input-table td { padding: 6px 8px; }
.cut-input-table :is(input,select) { width: 100%; min-width: 0; }
.cut-input-table td:first-child { min-width: 145px; }
.cut-input-table td:nth-child(4) { width: 88px; }
.cut-input-table td:nth-child(5) { min-width: 140px; }
.cut-input-table .btn { min-height: 35px; padding: 4px 8px; }
.cut-planner [data-cut-output]:not(:empty) { margin-top: 18px; }
.cut-metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 8px;
  margin: 0;
}
.cut-metrics > div { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; }
.cut-metrics dt { font-size: .87rem; color: var(--muted); }
.cut-metrics dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }
.cut-panel-selector { max-width: 260px; }
.cut-figure { display: grid; gap: 9px; margin: 0; }
.cut-board {
  position: relative;
  width: 100%;
  min-width: 1px;
  min-height: 1px;
  background: var(--canvas);
  box-shadow: 0 0 0 1px var(--muted);
  overflow: hidden;
}
.cut-block { display: block; position: absolute; overflow: hidden; }
.cut-piece {
  background: #a7d3b5;
  color: #173b29;
  outline: 1px solid #30634a;
  outline-offset: -1px;
}
.cut-block.cut-piece { display: grid; place-items: center; font-size: clamp(.68rem,1.6vw,.94rem); }
.cut-offcut { background: repeating-linear-gradient(135deg,#f5f2e6 0 5px,#d9d1b7 5px 6px); }
.cut-kerf { background: #9b4c37; }
.cut-kerf-length { min-height: 1px; }
.cut-kerf-width { min-width: 1px; }
[data-theme='dark'] .cut-piece { background: #3e6b53; outline-color: #90c5a3; color: #f2f9f5; }
[data-theme='dark'] .cut-offcut { background: repeating-linear-gradient(135deg,#403c32 0 5px,#8d7c58 5px 6px); }
[data-theme='dark'] .cut-kerf { background: #f5a686; }
.cut-figure figcaption, .cut-legend, .cut-legend > span { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.cut-figure figcaption { gap: 6px 16px; font-size: .88rem; }
.cut-legend i { display: inline-block; width: 15px; height: 11px; border-radius: 2px; }
.cut-result-details { display: grid; gap: 8px; margin-top: 14px; }
.cut-result-details summary { cursor: pointer; font-weight: 700; }
.cut-result-details :is(section,details) { min-width: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.cut-result-details .table-scroll { max-height: 24rem; margin-top: 6px; }
.cut-detail-table { min-width: 340px; }
.cut-planner .table-scroll:focus-visible { outline: 2px solid #469676; outline-offset: -2px; }
.production { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
.production summary { color: #2f6449; cursor: pointer; font-size: .9rem; font-weight: 800; }
.production form { margin-top: 10px; }
.production input { max-width: 190px; }
.toast { z-index: 10; position: fixed; bottom: 16px; right: 16px; max-width: min(440px, calc(100% - 32px)); display: none; background: #172a24; color: white; padding: 11px 15px; border-radius: 8px; box-shadow: 0 8px 25px #14261d33; }
.toast:not(:empty) { display: block; }
#print-area { display: none; }

[dir='rtl'] .nav-item[aria-current='page']::before { left: auto; right: 0; }
[dir='rtl'] .workshop, [dir='rtl'] .text-link, [dir='rtl'] table { text-align: start; }
[dir='rtl'] .workshop > .icon, [dir='rtl'] .shortcut > .icon, [dir='rtl'] .doc-totals { margin-left: 0; margin-inline-start: auto; }
[dir='rtl'] .crumb > .icon, [dir='rtl'] .shortcut > .icon, [dir='rtl'] .workshop > .icon { transform: scaleX(-1); }
[dir='rtl'] th:first-child, [dir='rtl'] td:first-child { padding: 8px 18px 8px 14px; }
[dir='rtl'] th:last-child, [dir='rtl'] td:last-child { padding: 8px 14px 8px 18px; }
[dir='rtl'] .money-cell { text-align: end; }
[dir='rtl'] .hero::before { inset: 0 40% 0 0; }
[dir='rtl'] .hero::after { transform: scaleX(-1); }
[dir='rtl'] select { padding: 8px 10px 8px 34px; background-position: left 10px center; }
[dir='rtl'] input[type='email'], [dir='rtl'] input[type='tel'], [dir='rtl'] input[type='number'] { direction: ltr; text-align: right; }
[dir='rtl'] .toast { left: 16px; right: auto; }

[data-theme='dark'] {
  color-scheme: dark;
  --ink: #f2f4ef;
  --muted: #b2c2b7;
  --canvas: #131d18;
  --surface: #1b2a22;
  --line: #384b40;
  --pine: #102018;
  --pine-deep: #102018;
  --shadow: 0 1px 2px #0004;
}
[data-theme='dark'] :is(dialog,.skip,.btn) { background: var(--surface); }
[data-theme='dark'] :is(.btn:hover,.icon-btn:hover,a.stat:hover,.shortcut:hover,.tabs button:hover,.tabs button[aria-pressed='true']) { background: #2a4134; color: var(--ink); }
[data-theme='dark'] .btn.primary { background: var(--accent); color: #2d2319; }
[data-theme='dark'] .btn.primary:hover { background: var(--accent-hover); }
[data-theme='dark'] .btn.pine { background: #365d49; border-color: #436d55; }
[data-theme='dark'] .btn.pine:hover { background: #42705a; }
[data-theme='dark'] .btn.subtle { background: transparent; }
[data-theme='dark'] :is(.field,.stat-top,.document-cell .icon) { color: var(--muted); }
[data-theme='dark'] :is(.text-link,.production summary) { color: #a5d7b6; }
[data-theme='dark'] :is(th,input:not([type='checkbox'],[type='radio']),textarea,select) { background-color: #15241c; border-color: var(--line); }
[data-theme='dark'] select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath stroke='%23c6d8cb' fill='none' stroke-width='1.4' d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); }
[data-theme='dark'] :is(.stat-icon,.pill.green,.notice) { background-color: #273e2f; border-color: #43644d; color: #c7ebd1; }
[data-theme='dark'] :is(.stat-icon.warm,.pill.amber,.demo-pill,.notice.warn) { background-color: #402d1f; border-color: #694933; color: #fed2aa; }
[data-theme='dark'] :is(.stat-icon.pale,.pill.blue) { background-color: #263a47; color: #c4e1f5; }
[data-theme='dark'] :is(.pill.red,.notice.error,.btn.danger) { background-color: #492e2d; border-color: #694340; color: #ffcac5; }
[data-theme='dark'] .pill:not([class*='green']):not([class*='amber']):not([class*='blue']):not([class*='red']):not(.demo-pill) { color: #cedbd2; background: #303e35; }
[data-theme='dark'] .dropzone { background: #17291e; border-color: #5f806b; }
[data-theme='dark'] :is(.dropzone.drag,.dropzone:hover) { background: #213a2b; }
[data-theme='dark'] .preview:not(:has(img)) { background-color: #17291e; }
@media (max-width: 1120px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .shortcut-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 192px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .topbar, .page { padding-inline: 16px; }
  .split, .locked-workshop { grid-template-columns: minmax(0, 1fr); }
  .price-box { position: static; }
  .page-head { align-items: start; flex-direction: column; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cut-setup-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .shell { display: block; }
  .sidebar { display: none; position: fixed; width: min(275px, calc(100vw - 35px)); height: 100dvh; top: 0; left: 0; box-shadow: 0 0 0 100vmax #14261d75; }
  [dir='rtl'] .sidebar { right: 0; left: auto; }
  .sidebar.open, .menu-toggle { display: flex !important; }
  .sidebar .menu-toggle { margin: 0 0 10px auto; }
  .sidebar .menu-toggle:hover { color: var(--ink); }
  .sidebar .brand { margin-bottom: 19px; }
  .topbar { min-height: 57px; gap: 5px; }
  .crumb { gap: 5px; }
  .crumb > span, .crumb > .icon { display: none; }
  .top-actions { gap: 5px; }
  .trial-pill { display: none; }
  .page { padding-top: 17px; }
  .hero { padding: 17px 15px; min-height: 210px; }
  .hero::before { inset: 0 0 0 10%; }
  [dir='rtl'] .hero::before { inset: 0 10% 0 0; }
  .hero::after { background: linear-gradient(90deg, #1c3529 5%, #1c3529e8 43%, #1c35298a 100%); }
  .stats { gap: 7px; margin: 10px 0 15px; }
  .stat { padding: 9px 7px; }
  .stat-top { gap: 4px; }
  .stat-icon { width: 25px; height: 25px; }
  .shortcut-list { grid-template-columns: minmax(0, 1fr); }
  .padded { padding: 13px; }
  .fields { gap: 8px; }
  .cut-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .cut-input-scroll { max-height: 24rem; }
  .cut-input-table { display: block; min-width: 0; }
  .cut-input-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .cut-input-table tbody, .cut-input-table tr { display: block; }
  .cut-input-table tr { padding: 8px; }
  .cut-input-table tr + tr { border-top: 1px solid var(--line); }
  .cut-input-table tr td:nth-child(n) {
    display: grid;
    grid-template-columns: minmax(0,.9fr) minmax(0,1.2fr);
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    border: 0;
    width: auto;
    min-width: 0;
  }
  .cut-input-table td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; }
  .cut-input-table .btn { justify-self: start; }
  .catalog-table { display: block; min-width: 0; }
  .catalog-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .catalog-table tbody, .catalog-table tr { display: block; }
  .catalog-table tr { padding: 9px 13px; }
  .catalog-table tr + tr { border-block-start: 1px solid var(--line); }
  .catalog-table td:nth-child(n) {
    display: grid;
    grid-template-columns: minmax(0,.8fr) minmax(0,1fr);
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border: none;
    text-align: start;
  }
  .catalog-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: .87rem;
    font-weight: 700;
  }
}
@media (max-width: 360px) { .fields, .plans { grid-template-columns: minmax(0, 1fr); } .demo-pill { display: none; } }
@media print {
  body { background: white; color: #161916; }
  .shell, #landing, dialog, .toast, .skip { display: none !important; }
  #print-area { display: block; }
  #print-area .paper { border: 0; padding: 0; }
  #print-area table { break-inside: avoid; }
  #print-area :is(p,td,th,small) { color: #161916 !important; background-color: transparent !important; }
  @page { size: A4; margin: 17mm; }
}
