.depth-app { min-width: 360px; }
.depth-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.depth-layout > * { min-width: 0; }
.depth-app .header-actions { max-width: 600px; }
.depth-app .panel { overflow: hidden; }
.depth-app .toolbar { flex-wrap: wrap; }
.depth-app .toolbar strong { font-size: 14px; }
.panel-body { padding: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 600; }
.field input, .field select, .depth-app textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #08171b; color: var(--text); outline: none; }
.field input, .field select { min-height: 40px; font-size: 14px; font-weight: 650; }
.field input:focus, .field select:focus, .depth-app textarea:focus { border-color: var(--accent); }
.field input:invalid { border-color: var(--over-photon); }
.field input:disabled { opacity: .45; cursor: not-allowed; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field-help, .table-help { color: var(--muted); font-size: 11px; line-height: 1.8; margin: 4px 0 14px; }
.model-badge { color: var(--accent); background: #77e4c811; border: 1px solid #77e4c833; border-radius: 5px; padding: 3px 6px; font-size: 10px; }
.formula-card { display: grid; gap: 8px; background: #08171b; padding: 14px; border: 1px solid var(--line); border-radius: 8px; margin: 18px 0; }
.formula-card span { color: var(--muted); font-size: 10px; }
.formula-card strong { color: var(--accent); font-family: ui-monospace, monospace; font-size: 13px; font-weight: 500; line-height: 1.7; overflow-wrap: anywhere; }
.formula-card span { line-height: 1.7; }
.result-metrics { display: grid; grid-template-columns: repeat(3, 1fr); padding: 20px 22px 8px; gap: 16px; }
.result-metrics > div { display: grid; gap: 6px; padding-left: 13px; border-left: 2px solid var(--line); }
.result-metrics span { color: var(--muted); font-size: 10px; }
.result-metrics strong { color: var(--text); font-size: 20px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.depth-source { gap: 12px; }
.depth-source label { flex: 1; min-width: 140px; }
.depth-source input, .depth-source select { width: 100%; min-width: 0; font-size: 15px; }
.calculation-status { padding: 10px 18px; color: var(--muted); font-size: 11px; }
.calculation-status.warning { color: var(--auger); }
.calculation-error { padding: 14px 18px; background: #29151b; color: #ffb1bd; border-top: 1px solid #713846; }
.peak-panel, .calibration-panel, .model-panel { grid-column: 1 / -1; }
.structure-body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .75fr); gap: 20px; padding: 20px; }
.structure-body > * { min-width: 0; }
.depth-app textarea { display: block; resize: vertical; font: 12px/1.65 ui-monospace, Consolas, monospace; margin-bottom: 16px; min-height: 90px; }
.miller-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.miller-fields label { display: flex; align-items: center; gap: 8px; }
.miller-fields input { min-width: 0; }
.surface-controls { display: flex; flex-direction: column; align-self: start; }
.primary-action { color: #06201a; background: var(--accent); border: none; border-radius: 7px; padding: 11px 16px; font-weight: 700; cursor: pointer; margin-bottom: 8px; }
.primary-action:hover { background: #a3f3dd; }
.structure-summary { padding: 12px; margin: 5px 0 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); font-size: 12px; line-height: 1.9; white-space: pre-line; }
.slab-preview { border-left: 1px solid var(--line); padding-left: 24px; align-self: start; }
#structurePlot { display: block; width: 100%; height: 450px; max-height: none; }
.dielectric-panel { grid-column: 1 / -1; }
.dielectric-panel[hidden] { display: none; }
.dielectric-body { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 20px; }
.dielectric-body > * { min-width: 0; }
.field-help a { color: var(--accent); }
.import-status { margin: 0 20px 14px; color: var(--accent); font-size: 12px; }
.import-status.error { color: #ffb1bd; }
.table-help { margin: 14px 18px; }
.peak-table-scroll { overflow: auto; max-height: 600px; }
.prediction-table { width: 100%; min-width: 1320px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 12px; }
.prediction-table th { position: sticky; top: 0; background: #12272c; color: var(--muted); font-size: 10px; font-weight: 600; z-index: 1; }
.prediction-table td, .prediction-table th { padding: 12px 10px; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--line); }
.prediction-table td:first-child, .prediction-table th:first-child { text-align: left; white-space: nowrap; padding-left: 18px; }
.prediction-table th:last-child, .prediction-table td:last-child { text-align: left; }
.prediction-table td:last-child { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.prediction-table label { display: inline-flex; align-items: center; gap: 8px; }
.prediction-table input[type="checkbox"], .calibration-toggle input { accent-color: var(--accent); }
.prediction-table input[type="number"] { display: block; width: 100%; max-width: 100px; margin-inline: auto; padding: 6px; text-align: center; color: var(--text); border: 1px solid var(--line); border-radius: 5px; background: #08171b; font-size: 12px; }
.prediction-table input[type="number"]:focus { outline: 1px solid var(--accent); }
.prediction-table input::placeholder { color: #a1bcb7; opacity: 1; }
.auto-value { display: block; font-size: 9px; margin-top: 4px; color: var(--muted); white-space: nowrap; }
.auto-button { padding: 0; border: 0; color: var(--accent); background: transparent; cursor: pointer; font-size: 9px; text-decoration: underline; }
.area-value { color: var(--accent); font-weight: 700; }
.prediction-table tr.disabled td { opacity: .45; }
.prediction-table tr.disabled td:first-child { opacity: 1; }
.prediction-table .row-warning { color: var(--auger); }
.calibration-panel summary, .model-panel summary { padding: 16px 20px; cursor: pointer; font-size: 13px; font-weight: 600; }
.calibration-fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-top: 18px; }
.calibration-toggle { color: var(--accent); display: inline-flex; align-items: center; gap: 8px; font-size: 12px; }
.model-notes { color: var(--muted); line-height: 1.9; font-size: 12px; padding-top: 0; }
.model-notes a { color: var(--accent); }
.depth-footer { margin: 20px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.storage-status { margin: 0 0 12px; padding: 10px 14px; color: var(--auger); border: 1px solid var(--line); border-radius: 8px; }
.peak-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); padding-bottom: 20px; }
#filmThickness, #filmAtomsPerCell { color: var(--accent); }
.film-estimator { margin: 14px 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.film-estimator[open] { padding-bottom: 12px; }
.film-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.film-estimator[open] > .film-heading { margin-bottom: 12px; }
.film-estimator > .film-heading { color: var(--text); list-style: none; }
.film-heading::-webkit-details-marker { display: none; }
.film-heading::before { content: '▸'; color: var(--accent); }
.film-estimator[open] > .film-heading::before { content: '▾'; }
.film-heading:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.film-heading strong { font-size: 13px; }
.film-heading button { margin-left: auto; }
.film-measurements-scroll { overflow-x: auto; }
.film-measurements-scroll:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.film-measurements { display: grid; grid-template-columns: .65fr .65fr 1fr 1.1fr 1.1fr 1.3fr; gap: 10px; min-width: 980px; align-items: end; }
.film-transport-row { display: flex; align-items: end; flex-wrap: wrap; gap: 0 12px; }
.film-transport-row > .field { flex: 0 1 220px; }
.film-transport-fields { display: flex; flex: 1; align-items: end; flex-wrap: wrap; gap: 0 12px; }
.film-transport-fields > .field { flex: 1 1 145px; min-width: 0; }
.film-transport-fields[hidden] { display: none; }
.film-inline { color: var(--muted); font-size: 11px; }
.film-inline output { color: var(--accent); font-variant-numeric: tabular-nums; }
.film-inline .field-help { margin-bottom: 0; }
.film-secondary { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.film-secondary output { color: var(--text); font-variant-numeric: tabular-nums; }
.film-estimator .calculation-status { padding: 0; line-height: 1.8; }
.film-estimator summary { cursor: pointer; font-size: 12px; color: var(--muted); padding: 12px 0; }
.film-results .model-notes { padding:0; }
@media(max-width:700px){ .peak-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; } }
@media (min-width: 851px) and (max-width: 1250px) { .structure-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); } .slab-preview { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 16px 0 0; } #structurePlot { max-height: 250px; } }
@media (max-width: 1100px) { .depth-layout { grid-template-columns: minmax(0, 1fr) 300px; } .depth-app header { align-items: start; gap: 20px; } .result-metrics strong { font-size: 16px; } .structure-body { gap: 18px; } .calibration-fields { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 850px) { .depth-layout { grid-template-columns: 1fr; } .depth-app header { flex-direction: column; gap: 16px; } .depth-app .header-actions { max-width: none; justify-content: start; } .depth-app .app-menu { flex-basis: auto; justify-content: start; } .structure-body { grid-template-columns: 1fr 1fr; } .slab-preview { grid-column: 1/-1; border-left: none; border-top: 1px solid var(--line); padding: 16px 0 0; } #structurePlot { max-height: 300px; } }
@media (max-width: 540px) { .depth-app .app { padding: 16px 12px; } .depth-app h1 { font-size: 26px; } .depth-app .subtitle { font-size: 12px; } .depth-app .toolbar { padding: 12px; } .depth-app .toolbar .hint { width: 100%; } .result-metrics { padding: 18px 12px 6px; gap: 6px; } .result-metrics > div { padding-left: 7px; } .result-metrics strong { font-size: 14px; } .result-metrics span { font-size: 9px; } .structure-body { grid-template-columns: 1fr; padding: 15px; } .slab-preview { grid-column: auto; } .calibration-fields { grid-template-columns: 1fr 1fr; } .depth-source label { min-width: 120px; } .depth-source { padding: 12px; } }
@media (max-width: 1250px) { #structurePlot { max-height: none; } } @media (max-width: 850px) { .dielectric-body { grid-template-columns: 1fr; } }
