/* Pencil & Oak tool family: values taken from the board-and-batten
   base.css, theme.css, layout.css and mobile-inputs.css. Standalone copy. */
:root { --red:#b64c40; --redbg:#fbefeb; }
body { line-height:normal; }
.site-header { padding:24px 40px; gap:30px; background:var(--paper); }
.brand { font-size:29px; letter-spacing:-1.5px; font-weight:500; }
.preview-badge { font-size:10px; letter-spacing:1px; }
main { max-width:none; padding:40px 24px 0; }
.intro { display:none; }
.workspace { grid-template-columns:300px minmax(0,1fr) 300px; gap:22px; }
.card { border-radius:6px; }
.controls { position:sticky; top:18px; max-height:calc(100dvh - 36px); overflow-y:auto; scrollbar-width:thin; scrollbar-color:#b7c1bc transparent; }
.tabs { position:sticky; top:0; z-index:2; background:var(--card); padding:8px; gap:3px; }
.tabs button { padding:11px 6px; border-radius:6px; color:var(--muted); font-size:12px; font-weight:500; }
.panel { padding:19px; }
.panel h2 { font-size:14px; font-weight:500; letter-spacing:-.3px; line-height:normal; margin:0 0 7px; }
.hint { font-size:11px; line-height:1.65; margin:5px 0 18px; }
.panel h2 + .hint { margin:0 0 18px; }
label { color:var(--ink); font-size:11px; font-weight:500; line-height:normal; margin:15px 0; }
.two > label { margin:8px 0; }
label > input,label > select,label > .measurement { margin-top:7px; }
input,select { font-size:14px; font-weight:400; line-height:normal; padding:10px 11px; min-height:38px; background:#f6f8f6; border-radius:5px; }
.measurement { position:relative; border:0; border-radius:5px; background:transparent; }
.measurement input { border:1px solid var(--line); border-radius:5px; padding:10px 38px 10px 11px; background:#f6f8f6; }
.measurement > span { position:absolute; right:12px; top:11px; padding:0; pointer-events:none; font-size:10px; color:#59645d; }
.measurement input:focus,input:focus,select:focus { border-color:#677961; }
label:has(+ .hint) { margin-bottom:0; }
.check { font-size:11px; line-height:1.5; margin:15px 0; gap:8px; }
.check > input { margin:0; }
.divider { margin:22px 0; }
.button { font-size:12px; font-weight:500; line-height:normal; padding:10px 15px; min-height:36px; }
.button.primary { color:var(--paper); }
.panel .button.full + .hint { margin-top:9px; }
.panel #apply-layout { margin-top:12px; }
.colour-inputs { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.colour-inputs label { margin:8px 0; justify-content:space-between; }
.swatches { gap:8px; margin:14px 0; }
.swatches button { width:27px; height:27px; }
.fixture-add { gap:5px; margin-top:14px; }
.fixture-add .button { border:1px dashed #b7c1bc; border-radius:6px; padding:8px 5px; background:#f6f8f6; color:var(--green); font-size:10px; }
.fixture-item { padding:10px; font-size:11px; background:var(--card); border-radius:5px; }
.note { background:#e9eeea; color:#59625e; font-size:11px; padding:12px; line-height:1.6; }
.preset-grid { margin-top:14px; }
.preset { background:var(--card); border-radius:5px; padding:11px; }
.preset:hover { background:#eef2ed; border-color:#87977f; }
.preset span { font-size:11px; line-height:1.4; }
.stage-heading { padding:20px 24px; background:var(--paper); min-height:74px; }
.stage-heading .eyebrow { display:none; }
.stage-heading h1 { font-size:18px; font-weight:400; letter-spacing:-.4px; line-height:1.3; margin:0 0 6px; }
.stage-summary { font-size:11px; color:var(--muted); margin:0; }
.unit-toggle { background:var(--card); border:0; border-radius:7px; padding:3px; }
.unit-toggle button { color:var(--muted); font-size:11px; padding:7px 12px; border-radius:5px; font-weight:500; }
.unit-toggle button.active { color:var(--green); }
.toolbar { background:var(--paper); padding:7px 18px; }
.canvas-viewport { height:510px; background:var(--paper); }
.canvas-caption { padding:10px 24px; font-size:10px; line-height:1.5; }
.stage-tip { font-size:11px; }
.feedback { font-size:11px; line-height:1.5; background:#e8ede7; border-color:#bfcbb9; color:var(--green); padding:12px 14px; margin:0 24px 18px; }
.feedback.warning { background:var(--redbg); border-color:#edc3b9; color:#963f2d; }
.alternatives { background:var(--card); padding:18px 24px; }
.alternatives h3 { font-size:14px; font-weight:500; }
.alternatives p { line-height:1.65; }
.inspector { padding:19px; }
.inspector h2 { font-size:14px; letter-spacing:-.3px; margin-bottom:7px; }
.inspector-heading .eyebrow { display:none; }
.inspector-heading { padding-bottom:0; }
.inspector input { font-size:14px; }
.inspector .hint { font-size:11px; }
.inside-size { background:#eef1ef; }
.arrange-buttons button { background:var(--card); font-size:11px; }
.installation { margin:20px 0 0 322px; padding:22px 24px; }
.installation-heading h2 { font-size:23px; font-weight:400; }
.installation-heading .eyebrow { letter-spacing:.7px; font-size:11px; }
.installation-heading p:not(.eyebrow) { line-height:1.65; }
dialog label { margin:15px 0; }
@media(min-width:1600px) {
  .workspace { grid-template-columns:300px minmax(0,1fr) 300px; gap:22px; }
  .panel { padding:19px; }
  .canvas-viewport { height:510px; }
}

@media(max-width:1220px) {
  .site-header { padding:18px 16px; gap:12px; }
  .brand { font-size:25px; }
  .header-actions { gap:8px; }
  .header-actions .text-button { display:none; }
  main { padding:20px 12px 0; }
  .mobile-nav { background:var(--card); border-radius:6px; margin-bottom:16px; }
  .mobile-nav button { min-height:46px; font-size:12px; font-weight:500; }
  .controls { position:static; max-height:none; overflow:visible; background:transparent; border:0; }
  .tabs { position:static; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; background:transparent; margin:0 0 24px; padding:0; border-bottom:1px solid var(--line); }
  .tabs button { min-height:46px; padding:12px 2px 13px; border-radius:0; border-bottom:2px solid transparent; font-size:13px; font-weight:400; }
  .tabs button.active { background:transparent; border-bottom-color:#303b35; color:var(--ink); font-weight:600; }
  .panel { padding:0 4px; }
  .editor-group { padding:20px 18px; margin:0 0 18px; border:1px solid #d7ddd9; border-radius:10px; background:var(--card); }
  .editor-group > h2 { margin:0 0 9px; font-size:17px; line-height:1.35; font-weight:500; letter-spacing:-.3px; }
  .editor-group > .hint { margin:0 0 20px; font-size:12px; line-height:1.7; color:#59645d; }
  .panel > .divider { display:none; }
  .panel label,.inspector label { font-size:12px; font-weight:500; color:#3d4640; line-height:1.5; margin:16px 0; }
  .two { gap:12px; }
  .two > label { margin:0 0 20px; }
  .panel input,.inspector input,.panel select,.inspector select { min-height:50px; padding-top:12px; padding-bottom:12px; font-size:17px; background:#fff; border-radius:6px; }
  .measurement > span { top:15px; font-size:12px; }
  .panel .hint,.inspector .hint { font-size:12px; line-height:1.65; color:#59645d; }
  .panel .check,.inspector .check { font-size:12px; }
  .panel input[type=checkbox],.inspector input[type=checkbox] { min-height:0; padding:0; }
  .panel input[type=color] { min-height:0; padding:2px; }
  .panel .button { min-height:44px; font-size:12px; }
  .panel #apply-layout { border-radius:6px; min-height:50px; font-size:14px; }
  .panel > #reset,.panel > #add-frame { margin:4px 0 20px; }
  .preset svg { height:65px; }
  .preset span { font-size:12px; }
  .fixture-add { gap:8px; }
  .fixture-add .button { border-style:solid; background:#fff; }
  .stage-heading { padding:18px 16px; }
  .stage-heading h1 { font-size:18px; max-width:230px; }
  .stage-summary { font-size:11px; line-height:1.5; }
  .unit-toggle button { padding:7px 10px; }
  .canvas-viewport { height:340px; }
  .toolbar { padding:8px 10px; }
  .feedback { margin:0 12px 14px; padding:12px; }
  .alternatives { padding:16px 14px; }
  .inspector { background:transparent; border:0; padding:0 4px; }
  .inspector-heading { padding:0 0 16px; margin-bottom:20px; }
  .inspector h2 { font-size:28px; letter-spacing:-.7px; }
  #selection-fields,#empty-selection { background:var(--card); border:1px solid #d7ddd9; border-radius:10px; padding:20px 18px; }
  #selection-fields .two > label { margin-top:16px; margin-bottom:0; }
  .installation { margin:16px 0 0; padding:22px 17px; }
}
/* Keep the drawing directly beneath its heading; secondary actions live
   alongside their context rather than in a separate toolbar. */
.stage-actions { display:flex; align-items:center; gap:12px; flex-shrink:0; }
.history-actions { display:flex; gap:2px; }
.history-actions button { min-width:30px; min-height:32px; border:0; background:transparent; color:var(--ink); border-radius:5px; }
.history-actions button:hover:not(:disabled) { background:var(--soft); }
.diagram-zoom { display:flex; align-items:center; gap:5px; color:var(--muted); }
.diagram-zoom button { width:28px; height:28px; padding:0; background:transparent; border:0; border-radius:5px; font-size:14px; }
.diagram-zoom button:hover:not(:disabled) { background:var(--soft); }
.diagram-zoom output { min-width:34px; text-align:center; font-size:10px; }
.canvas-caption { align-items:center; }
.selection-mode { margin:0 0 16px; padding:8px 12px; font-size:11px; }
.selection-mode[aria-pressed=true] { background:var(--soft); border-color:#829477; }
#wall-svg:focus,#wall-svg:focus-visible { outline:none; }
#wall-svg [role=button]:focus-visible { outline:2px solid #677961; outline-offset:3px; }
@media(max-width:1220px) {
  .stage-heading { flex-wrap:wrap; gap:12px; }
  .stage-actions { margin-left:auto; gap:7px; }
  .history-actions button { min-width:34px; min-height:40px; }
  .diagram-zoom button { width:36px; height:36px; }
  .selection-mode { margin:0; min-height:44px; font-size:12px; }
}
@media print { main { padding:0; } }

/* Expanded diagram: navigation is locked away from geometry edits by default. */
#expand-diagram { padding:5px 0; font-size:11px; white-space:nowrap; }
#diagram-dialog { width:min(1440px,calc(100vw - 32px)); height:min(980px,calc(100dvh - 32px)); max-width:none; max-height:none; padding:20px; overflow:hidden; }
#diagram-dialog[open] { display:grid; grid-template-rows:auto auto auto minmax(0,1fr); gap:14px; }
.viewer-heading { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.viewer-heading h2 { font-size:20px; font-weight:400; margin:0; }
.viewer-tools { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; }
.viewer-modes { display:flex; padding:3px; border:1px solid var(--line); border-radius:6px; }
.viewer-modes button,.viewer-zoom button { padding:8px 12px; min-height:36px; font-size:12px; border:0; border-radius:4px; background:transparent; }
.viewer-modes [aria-pressed=true] { background:var(--soft); color:var(--green); }
.viewer-zoom { display:flex; align-items:center; gap:5px; }
.viewer-zoom output { min-width:40px; text-align:center; font-size:11px; }
.viewer-zoom button:hover { background:var(--soft); }
#diagram-view-help { font-size:12px; color:var(--muted); line-height:1.6; margin:0; }
#expanded-diagram-slot { min-height:0; min-width:0; overflow:hidden; border:1px solid var(--line); border-radius:5px; }
#diagram-dialog .canvas-viewport { height:100%; width:100%; display:flex; align-items:flex-start; overflow:auto; touch-action:none; }
.diagram-sheet { flex:none; margin:auto; }
#diagram-dialog #wall-svg { touch-action:none; }
#diagram-dialog[data-mode=view] .canvas-viewport { cursor:grab; }
#diagram-dialog[data-mode=view] .canvas-viewport:active { cursor:grabbing; }
#diagram-dialog[data-mode=view] #wall-svg * { pointer-events:none; }
#diagram-dialog[data-mode=view] .selection-line,#diagram-dialog[data-mode=view] .resize-handle { display:none; }
@media(max-width:1220px) {
  #diagram-dialog { width:100vw; height:100dvh; margin:0; padding:16px 12px max(12px,env(safe-area-inset-bottom)); border:0; border-radius:0; }
  #diagram-dialog[open] { gap:12px; }
  .viewer-heading h2 { font-size:19px; }
  .viewer-heading .button { min-height:44px; padding:9px 12px; }
  .viewer-tools { gap:8px; }
  .viewer-modes { flex:1; }
  .viewer-modes button { flex:1; }
  .viewer-modes button,.viewer-zoom button { min-height:44px; padding:8px 10px; }
  .viewer-zoom { flex:1 0 100%; justify-content:center; }
  .viewer-zoom button { white-space:nowrap; }
  #diagram-view-help { font-size:12px; }
}
@media print { #diagram-dialog { display:none!important; } }

@media(min-width:1221px) {
  .workspace > .inspector { width:auto; margin-left:0; }
}

.canvas-actions { display:flex; align-items:center; gap:16px; }
.canvas-actions .history-actions { border-right:1px solid var(--line); padding-right:12px; }
@media(min-width:1440px) {
  .workspace { grid-template-columns:300px minmax(0,1fr) 300px; }
  .workspace > .inspector { width:auto; margin-left:0; }
}
@media(min-width:1221px) {
  .stage > .canvas-viewport { height:485px; }
}
/* Same paint choices and independent targets as board and batten. */
.paint-row { margin:20px 0; }
.paint-row > label { font-size:12px; margin:0 0 12px; }
.paint-options { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.paint-swatch { width:27px; height:27px; border:1px solid #0002; border-radius:50%; padding:0; background:var(--swatch); flex:none; }
.paint-swatch[aria-pressed=true] { outline:2px solid var(--ink); outline-offset:3px; }
.paint-custom { display:flex; align-items:center; gap:7px; font-size:10px; margin:0; cursor:pointer; }
.paint-custom input[type=color] { width:30px; height:30px; min-height:0; padding:2px; border:1px solid var(--line); border-radius:5px; background:transparent; margin:0; }
#reset-colours { font-size:10px; }
.desktop-scale-note { margin:12px 24px; padding:10px 12px; background:#f4eee4; border-left:2px solid #a18b66; border-radius:0 4px 4px 0; color:#67583e; font-size:12px; line-height:1.6; }
.canvas-actions > .text-button { font-size:11px; white-space:nowrap; }
.mobile-edit-action { display:none; }
.feedback:not(.warning) { margin:0; padding:10px 24px; border:0; border-radius:0; background:transparent; color:var(--muted); font-size:11px; }
.feedback.warning { margin:14px 24px; }
.alternatives { padding:12px 24px; }
.alternatives #variant-list { margin-top:0; }
@media(max-width:1220px) {
  .canvas-caption { align-items:flex-start; }
  .canvas-actions { flex-wrap:wrap; gap:7px 12px; justify-content:flex-end; }
  .canvas-actions > .text-button { font-size:10px; }
  .mobile-edit-action { display:inline-block; }
  .feedback:not(.warning) { padding:10px 14px; }
  .feedback.warning { margin:12px; }
}

@media(min-width:1221px) {
  .canvas-caption { padding-top:4px; padding-bottom:4px; }
}

/* Keep the existing diagram surface continuous behind its controls. */
.stage,.stage > .canvas-caption,.stage > .mobile-wall-interaction,.stage > .alternatives { background:var(--paper); }

/* The left panel spans the drawing and plan instead of setting the drawing row height. */
@media(min-width:1221px) {
  .workspace { grid-template-rows:min-content auto; }
  .workspace > .controls { grid-column:1; grid-row:1 / span 2; }
  .workspace > .stage { grid-column:2; grid-row:1; }
  .workspace > .inspector { grid-column:3; grid-row:1; }
  .workspace > .installation { grid-column:2 / -1; grid-row:2; margin:0; }
}


@media(min-width:1221px) { .stage { padding-bottom:16px; } }

@media(min-width:1221px) { .stage #canvas-viewport { transform:translateY(-14px); } }
@media(min-width:1221px) { .stage #wall-svg { transform:translateY(-6px); } }
/* Always-visible fine adjustments; retain two-column measurement groups. */
.two:has(.number-field-line) { align-items:start; }
label:has(> .number-field-line) { font-size:13px; line-height:1.45; -webkit-tap-highlight-color:transparent; }
label:has(> .number-field-line) > .field-caption { display:block; margin-bottom:8px; }
.number-field-line { display:flex; flex-direction:column; align-items:stretch; min-width:0; gap:8px; margin:0; }
.number-field-line > .measurement,.number-field-line > input { min-width:0; width:100%; margin:0; }
.field-adjustments { display:flex; justify-content:flex-end; gap:6px; }
.field-adjustments .stepper-button { width:40px; height:40px; min-height:0; min-width:0; margin:0; padding:0; border:1px solid var(--line); border-radius:5px; background:transparent; color:var(--green); font:20px Arial,sans-serif; line-height:1; touch-action:manipulation; user-select:none; -webkit-tap-highlight-color:transparent; }
.two > label .field-adjustments .stepper-button { flex:1; width:auto; }
.field-adjustments .stepper-button:active { background:var(--soft); }
.field-adjustments .stepper-button:disabled { opacity:.35; }

/* Share the caption row so wrapped labels cannot offset the measurement fields. */
@media(min-width:1221px) {
  #row-settings { grid-template-rows:auto auto; row-gap:0; }
  #row-settings > label { display:grid; grid-template-rows:subgrid; grid-row:span 2; }
}

/* Match the Rows selector to the adjacent Columns field. */
label:has(> #rows) { font-size:13px; line-height:1.45; }
label:has(> #rows) > .field-caption { display:block; margin-bottom:8px; }
label > #rows { margin-top:0; }

/* Keep setting labels readable; restore mobile label size. */
label:has(> .number-field-line),label:has(> #rows) { color:var(--ink); }
@media(max-width:1220px) {
  label:has(> .number-field-line),label:has(> #rows) { font-size:14px; }
}

.layout-choice { margin:8px 0 16px; min-width:0; }
.layout-choice > .field-caption { display:block; font-size:13px; line-height:1.45; margin-bottom:8px; color:var(--ink); }
.layout-segment { display:flex; border:1px solid var(--line); border-radius:5px; overflow:hidden; min-height:40px; }
.layout-segment button { flex:1; min-width:0; padding:8px 4px; border:0; border-radius:0; font-size:12px; background:transparent; }
.layout-segment button+button { border-left:1px solid var(--line); }
.layout-segment button[aria-pressed=true] { background:var(--green); color:white; }
#tab-layout .layout-inner { display:flex; width:fit-content; gap:8px; align-items:center; }
#wide[hidden],#rows[hidden],#row-settings[hidden] { display:none; }
#presets button[aria-pressed=true] { border-color:var(--green); background:var(--soft); }
@media(max-width:1220px) { .layout-choice > .field-caption { font-size:14px; } .layout-segment { min-height:48px; } }

.two > .layout-choice { margin:8px 0; }
#tab-layout .layout-inner { font-size:13px; color:var(--ink); }
@media(max-width:1220px) {
  .two > .layout-choice { margin:0 0 20px; }
  #tab-layout .layout-inner { font-size:14px; }
}

/* Compact visual choices explain the frame treatment before applying it. */
#layout-nested[hidden] { display:none; }
.frame-style-options { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; }
.frame-style-options button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:7px; padding:10px 5px; border:1px solid var(--line); border-radius:5px; background:transparent; color:var(--ink); font-size:12px; line-height:1.4; min-width:0; }
.frame-style-options svg { display:block; width:56px; height:39px; fill:none; stroke:currentColor; stroke-width:1.5; }
.frame-style-options button[aria-pressed=true] { background:var(--green); color:#fff; border-color:var(--green); }

/* Keep row choices level with the adjacent numeric input. */
.layout-choice:has([data-layout-rows]) .layout-segment { height:40px; min-height:40px; }
.layout-choice:has([data-layout-rows]) button { white-space:nowrap; font-size:11px; padding:8px 2px; }
@media(max-width:1220px) {
  .layout-choice:has([data-layout-rows]) .layout-segment { height:48px; min-height:48px; }
  .layout-choice:has([data-layout-rows]) button { font-size:12px; }
}

#columns { height:40px; }
@media(max-width:1220px) { #columns { height:48px; } }

#nested[hidden],#selection-gap-controls[hidden],.arrange-buttons button[hidden] { display:none; }
.frame-lock { display:flex; align-items:center; gap:9px; width:fit-content; color:var(--ink); font-size:13px; }
.frame-lock input { width:18px; height:18px; min-height:0; margin:0; }
#individual-fields h3 { margin:20px 0 4px; font-size:15px; font-weight:500; }
#frame-fields .inside-size { font-size:12px; }
.selection-actions #mirror { background:transparent; }
.selection-actions #delete { grid-column:1 / -1; margin-top:8px; }
@media(max-width:1220px) { .frame-lock { font-size:14px; } }

#inside-size { padding:0; margin:8px 0 20px; border:0; border-radius:0; background:transparent; color:var(--muted); font-size:12px; line-height:1.6; }
#inside-size strong { color:var(--ink); font-weight:500; }
#single-position-actions { margin:8px 0 24px; }
#single-position-actions[hidden] { display:none; }
#single-position-actions .frame-lock { margin:12px 0 0; }
#frame-fields > .layout-choice { margin-top:20px; }

#single-center[hidden] { display:none; }

#locked[hidden],#inside-measurements[hidden] { display:none; }
#inside-measurements { margin:10px 0 20px; border:0; padding:0; }
#inside-measurements summary { padding:4px 0; font-size:12px; color:var(--muted); cursor:pointer; }
#inside-measurements #inside-size { margin:8px 0; }


.selection-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.selection-actions .button,.selection-actions #delete { grid-column:auto; width:100%; min-height:44px; margin:0; padding:8px 4px; font-size:12px; line-height:1.4; }

.arrange-buttons { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.arrange-buttons button { display:flex; align-items:center; justify-content:flex-start; gap:7px; padding:9px 7px; min-height:48px; font-size:12px; text-align:left; line-height:1.3; }
.arrange-buttons svg { width:24px; height:24px; flex:none; fill:none; stroke:currentColor; stroke-width:1.4; }
#selection-gap-controls { margin:22px 0; }
#equal-gap-action,#custom-gap-action { margin-top:12px; }
#equal-gap-action[hidden],#custom-gap-action[hidden],#style-mixed[hidden] { display:none; }
#centre-group { margin:4px 0 0; }
#style-mixed { margin:0 0 8px; }
.selection-actions .button { overflow-wrap:normal; }

.arrange-buttons #centre-group { grid-column:1 / -1; margin:0; }

.arrange-buttons #centre-group { grid-column:1 / -1; justify-self:center; width:calc((100% - 8px) / 2); min-height:48px; margin:0; }

.arrange-buttons button,.arrange-buttons #centre-group { height:52px; min-height:52px; }

.arrange-buttons #centre-group { width:max-content; max-width:100%; padding-left:12px; padding-right:12px; white-space:nowrap; }

.arrange-buttons #centre-group { width:calc((100% - 8px) / 2); padding:9px 7px; height:52px; min-height:52px; white-space:nowrap; }

.arrange-buttons #centre-group { grid-column:auto; justify-self:stretch; width:100%; white-space:normal; padding:9px 7px; }

.arrange-buttons svg { stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.arrange-buttons svg rect { fill:currentColor; fill-opacity:.1; }
.arrange-buttons svg .align-guide { stroke-width:2; }
.arrange-buttons svg .align-centre-guide { stroke-width:1.5; stroke-dasharray:2 2; }
.arrange-buttons svg .align-wall { opacity:.5; }

/* Full-width measurements keep typing and adjustment on one line. */
label:not(.two > label) > .number-field-line { flex-direction:row; align-items:stretch; gap:8px; }
label:not(.two > label) > .number-field-line > .measurement,
label:not(.two > label) > .number-field-line > input { flex:1; width:0; min-width:0; }
label:not(.two > label) > .number-field-line > .field-adjustments { flex:none; align-items:stretch; }
label:not(.two > label) > .number-field-line .stepper-button { height:auto; min-height:40px; width:40px; }
@media(max-width:1220px) {
  label:not(.two > label) > .number-field-line .stepper-button { min-height:48px; }
}

.layout-counts { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; margin:14px 0 20px; }
.layout-counts > label,.layout-counts > .layout-choice { margin:0; }
.layout-counts > label > .number-field-line { flex-direction:row; align-items:stretch; gap:8px; }
.layout-counts > label > .number-field-line > input { flex:1; width:0; min-width:0; }
.layout-counts .field-adjustments { flex:none; }
.layout-counts .field-adjustments .stepper-button { flex:none; width:40px; height:40px; }
.layout-counts .layout-choice:has([data-layout-rows]) button { font-size:12px; padding:8px; }
@media(max-width:1220px) { .layout-counts .field-adjustments .stepper-button { height:48px; } }

#tab-layout .layout-group-heading { margin:28px 0 16px; padding-top:22px; border-top:1px solid var(--line); }
#tab-layout .layout-counts { gap:14px; margin-bottom:0; }
#tab-layout .layout-group-heading + .layout-choice { margin-top:0; }
#tab-layout .frame-style-choice { margin-top:18px; }

/* User names can contain a full unbroken 60-character word. */
#selection-title { overflow-wrap:anywhere; }

/* All saved-project actions follow their picker as one row. */
#project-dialog label[for="saved-projects"] { display:block; margin:0 0 8px; }
#project-dialog .saved-project-select { display:block; width:100%; margin:0 0 10px; }
#project-dialog .saved-project-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
#project-dialog .saved-project-actions .button { min-width:0; min-height:44px; padding:10px 8px; margin:0; white-space:nowrap; }


#project-dialog .two > .button { min-height:44px; padding:10px 8px; }

#project-dialog .saved-project-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 8px; }
#project-dialog .saved-project-heading > label { margin:0; }
#project-dialog .saved-project-management { display:flex; flex:none; align-items:center; gap:8px; }
#project-dialog .saved-project-management .text-button { display:inline-flex; align-items:center; justify-content:center; margin:0; padding:6px 12px; min-width:68px; min-height:32px; border:1px solid var(--line); border-radius:999px; background:transparent; font-size:12px; line-height:1; text-decoration:none; }
#project-dialog .saved-project-management .text-button:hover:not(:disabled) { background:var(--soft); }
#project-dialog .saved-project-management .text-button:disabled { opacity:.45; }
@media(max-width:380px) {
 #project-dialog .saved-project-heading > label { font-size:12px; }
 #project-dialog .saved-project-management { gap:6px; }
 #project-dialog .saved-project-management .text-button { min-width:60px; padding:6px 9px; }
}
