/* Service-specific layout; the underlying controls and theme come from 27fasad. */
.page-title { margin-bottom: 16px; }
.order-meta { grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.5fr) auto; }
.order-meta textarea { resize: vertical; min-height: 35px; max-height: 150px; }
.material-bar { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.material-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.material-tabs button { white-space: normal; text-align: left; max-width: 330px; overflow-wrap: anywhere; }
.material-tabs .on { border-color: var(--accent); background: var(--accent-bg); color: var(--accent-d); }
html[data-theme="dark"] .material-tabs .on, html[data-theme="dark"] .view-controls .tabs .on { color: #a7c8ff; }
.material-tabs button small { display: block; color: var(--muted); margin-top: 3px; }
.material-actions, .view-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.view-controls { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.view-controls .tabs { margin: 0; }
.current-material { color: var(--muted); overflow-wrap: anywhere; }
.cutting-grid { min-width: 1020px; table-layout: fixed; }
.cutting-grid.all-materials { min-width: 1240px; }
.cutting-grid th.col-position { width: 68px; }
.cutting-grid th.col-name { width: 180px; }
.cutting-grid th.col-material { width: 210px; }
.cutting-grid th.col-dimension { width: 96px; }
.cutting-grid th.col-thickness { width: 70px; }
.cutting-grid th.col-quantity { width: 75px; }
.cutting-grid th.col-texture { width: 155px; }
.cutting-grid th.col-status { width: 145px; }
.cutting-grid th.col-actions { width: 92px; }
.cutting-grid td.acts button { margin-left: 2px; padding: 4px 7px; }
.row-note { font-size: 12px; color: var(--muted); }
.row-note.review { color: var(--accent); }
.row-note.incomplete { color: var(--muted); }
.row-note.error, .save-status.error { color: var(--err); }
.save-status { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.save-status.saved { color: var(--ok); }
.totals-foot { gap: 6px 24px; }
.empty-state { padding: 38px 20px; text-align: center; color: var(--muted); }
.empty-state h2 { color: var(--text); }
.empty-state p { margin: 8px 0 16px; }
.list-grid { min-width: 650px; }
.list-grid td { padding: 12px 10px; }
.draft-title { white-space: normal; text-align: left; overflow-wrap: anywhere; max-width: 500px; }
.modal-box form { display: flex; flex-direction: column; gap: 16px; }
.material-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.modal-box .field { width: 100%; min-width: 0; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 740px) { .order-meta { grid-template-columns: 1fr; } .material-dimensions { grid-template-columns: 1fr; } main { padding: 12px; } .page-title .spacer { display: none; } }
.cutting-grid th.col-machining { width: 250px; }
.processing-buttons { white-space: nowrap; }
.processing-buttons button { margin-right: 3px; }
.cutting-controls { display: flex; gap: 12px; align-items: flex-end; padding: 16px; margin-top: 16px; flex-wrap: wrap; }
.cutting-controls .lbl { min-width: 250px; }
.cutting-controls > .small { flex-basis: 100%; }
#cutting-results { scroll-margin-top: 70px; }
.result-summary { margin-top: 20px; }
.result-material { margin: 24px 0 12px; }
.sheet-card { margin: 0 0 18px; }
.sheet-card svg { width: 100%; max-height: calc(100vh - 210px); min-height: 280px; display: block; background: var(--ro); border-radius: 5px; }
.sheet-card details { margin-top: 12px; }
.sheet-card summary { cursor: pointer; font-weight: 600; }
.cut-sequence { max-height: 300px; overflow-y: auto; line-height: 1.8; }
.feature-dialog { max-height: 90vh; overflow: auto; }
.feature-dialog h2 { margin-bottom: 18px; }
.feature-content { display: flex; flex-direction: column; gap: 10px; }
.catalog-dialog { width: min(900px,calc(100vw - 30px)); }
.catalog-search { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 10px; }
.catalog-search .field { width: 100%; min-width: 0; }
.catalog-results { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.catalog-item { text-align: left; white-space: normal; }
.catalog-item strong,.catalog-item span { display: block; }
.template-item { text-align: left; white-space: normal; }
.settings-section { margin: 16px 0; }
.category-list { max-height: 350px; overflow: auto; margin-top: 12px; border: 1px solid var(--line); padding: 8px; }
.category-option { padding: 5px; }
.profile-card { border-bottom: 1px solid var(--line); padding: 12px 0 20px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 12px; }
.profile-fields { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 12px; }
.msg.show { display: block; }
.material-profile-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; width:100%; }
.contour-dialog { width:min(1200px,96vw); }
.contour-layout { display:grid; grid-template-columns:1.1fr 1fr; gap:22px; }
.contour-canvas svg { width:100%; height:60vh; background:var(--ro); }
.contour-canvas line { cursor:pointer; }
.contour-canvas line:hover,.contour-canvas line:focus { stroke:#ee8a22; }
.contour-segment {cursor:pointer;}
.contour-segment:hover .contour-visible,.contour-segment:focus .contour-visible {stroke:#ee8a22;}
.selected-panel { outline:2px solid var(--accent); outline-offset:-2px; }
.login-card {max-width:430px;margin:8vh auto;}
.login-form {display:flex;flex-direction:column;gap:16px;margin-top:20px;}
.login-form .field {width:100%;}
.priority-list .head-row { margin:5px 0; }
.cutout-actions {display:flex;gap:6px;flex-wrap:wrap;margin:10px 0;}
.cutout-item {display:block;width:100%;text-align:left;margin:5px 0;}
.cutout-item.on {border-color:var(--accent);background:var(--bg);}
.cutout-properties {display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:12px 0;}
.cutout-properties .cutout-actions {grid-column:1/-1;}
.cutout-base {min-width:0;margin:0;padding:8px;border:1px solid var(--line);border-radius:6px;}
.cutout-base legend {font-size:12px;}
.cutout-ref-grid {display:grid;grid-template-columns:repeat(3,1fr);gap:3px;margin-bottom:5px;}
.cutout-ref {min-width:0;padding:4px;line-height:1.1;color:var(--muted);}
.cutout-ref.on {background:var(--accent);border-color:var(--accent);color:#fff;}
.cutout-base-note {grid-column:1/-1;margin:0;}
.run-metrics {display:grid;grid-template-columns:repeat(4,minmax(130px,1fr));gap:10px;margin:16px 0;}
.run-metric {padding:12px;border:1px solid var(--line);border-radius:6px;}
.run-metric strong {display:block;font-size:24px;margin-top:7px;}
.run-table-scroll {overflow-x:auto;}
.run-statistics-table {min-width:950px;}
.run-statistics-table td:first-child {min-width:190px;}
.sheet-layout {display:grid;grid-template-columns:minmax(0,1fr) minmax(390px,.65fr);gap:20px;align-items:start;}
.sheet-layout>svg {width:100%;min-width:0;}
.sheet-specification {min-width:0;}
.sheet-specification h3 {margin-top:0;}
.sheet-specification table {width:100%;font-size:13px;}
.sheet-specification table {border-collapse:collapse;border:1px solid var(--muted);}
.sheet-specification th,.sheet-specification td {border:1px solid var(--muted);}
.sheet-specification th {background:var(--bg);}
.sheet-specification th,.sheet-specification td {padding:9px 6px;}
.sheet-specification td {white-space:nowrap;}
@media(max-width:950px){.sheet-layout{grid-template-columns:1fr;}.run-metrics{grid-template-columns:repeat(2,minmax(120px,1fr));}}
@media print{.sheet-layout{grid-template-columns:minmax(0,1fr) minmax(300px,.65fr);}.run-statistics{break-inside:avoid;}.run-metrics{grid-template-columns:repeat(4,1fr);}.run-statistics-table{min-width:0;font-size:9px;}.run-statistics-table td:first-child{min-width:0;}.sheet-specification th,.sheet-specification td{font-size:10px;padding:4px;}}
.cutout-search {display:flex;gap:5px;margin:10px 0;}
.cutout-search input {min-width:0;flex:1;}
.adv-svg [data-contour-edge],.adv-svg [data-cutout-id] {cursor:pointer;}
.adv-svg [data-contour-edge]:hover,.adv-svg [data-contour-edge]:focus {stroke:#f5ac41;stroke-width:9;}
@media(max-width:850px){.contour-layout {grid-template-columns:1fr;}.contour-canvas svg{height:35vh;}}
@media(max-width:600px){.catalog-search {grid-template-columns:1fr;}.cutting-controls .lbl {min-width:0;width:100%;}}
@media print {header,.page-title,.order-meta,.material-bar,.view-controls,.ed-foot,.cutting-controls,.processing-buttons,button,nav,.result-summary .head-row,.cut-sequence {display:none!important;}body{background:#fff;color:#000;}main{padding:0;max-width:none;}.sheet-card{break-inside:avoid;border:0;}.sheet-card svg{max-height:80vh;}#cutting-results details{display:none;}}
@media print { :root,html[data-theme="dark"] { --bg:#fff; --panel:#fff; --text:#000; --muted:#444; --line:#aaa; } }
