/* AI Planter — interactive tools added November 2026.
   Sunlight compass, VPD heatmap, repotting planner, leaf diagnosis tree,
   propagation tracker. Colours follow the interior design tokens in
   styles.css / interior.css. */

.aip-tool {
    --aip-ink: #17201c;
    --aip-muted: #5d6b62;
    --aip-green: #27674e;
    --aip-green-dark: #1f4f3b;
    --aip-soft: #edf4e9;
    --aip-line: #dce4db;
    --aip-card: #fffefa;
    --aip-paper: #f4f7f0;
    --aip-warn: #b5772a;
    --aip-danger: #b4462f;
    margin: 36px 0 8px;
    color: var(--aip-ink);
}
.aip-tool *,
.aip-tool *::before,
.aip-tool *::after { box-sizing: border-box; }
.aip-tool h2 { font-family: var(--font-display, Georgia, serif); font-weight: 400; }
.aip-tool h3 { font-family: inherit; }
.aip-intro { margin: 0 0 22px; max-width: 68ch; color: var(--aip-muted); line-height: 1.75; }
.aip-kicker { margin: 0 0 4px; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #4f6a58; }

.aip-panel {
    padding: 22px;
    border: 1px solid var(--aip-line);
    border-radius: 16px;
    background: var(--aip-card);
}
.aip-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
.aip-split > .aip-panel + .aip-panel { background: var(--aip-soft); border-color: #cfe3d6; }

.aip-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0; }
.aip-field { min-width: 0; margin: 0; }
.aip-field.is-wide { grid-column: 1 / -1; }
.aip-field > label,
.aip-field > .aip-label {
    display: block;
    margin-bottom: 6px;
    color: #2b4a38;
    font-size: .9rem;
    font-weight: 700;
}
.aip-field .aip-value { float: right; color: var(--aip-green); font-variant-numeric: tabular-nums; }
.aip-field input[type="number"],
.aip-field input[type="text"],
.aip-field input[type="date"],
.aip-field select {
    width: 100%;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid #b5c6b9;
    border-radius: 8px;
    background: #fff;
    color: var(--aip-ink);
    font: inherit;
    font-size: .95rem;
}
.aip-field input[type="range"] { width: 100%; min-height: 34px; margin: 0; accent-color: var(--aip-green); }
.aip-hint { margin: 6px 0 0; color: var(--aip-muted); font-size: .8rem; line-height: 1.5; }

.aip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid #b5c6b9;
    border-radius: 9px;
    background: #fff;
    color: var(--aip-green-dark);
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
}
.aip-btn:hover { border-color: var(--aip-green); }
.aip-btn--primary { background: var(--aip-green); border-color: var(--aip-green); color: #fff; }
.aip-btn--primary:hover { background: var(--aip-green-dark); border-color: var(--aip-green-dark); }
.aip-btn--danger { color: var(--aip-danger); border-color: #d9b7ad; }
.aip-btn--danger:hover { border-color: var(--aip-danger); }
.aip-tool :is(button, input, select, a):focus-visible { outline: 3px solid #28684e; outline-offset: 2px; }

/* Window direction picker */
.aip-dirs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.aip-dir {
    min-height: 46px;
    padding: 6px 4px;
    border: 1px solid #ccd8c9;
    border-radius: 10px;
    background: #fff;
    color: #35503d;
    font: inherit;
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
}
.aip-dir small { display: block; font-size: .66rem; font-weight: 500; opacity: .75; }
.aip-dir:hover { border-color: var(--aip-green); }
.aip-dir[aria-pressed="true"] { background: var(--aip-green); border-color: var(--aip-green); color: #fff; }
.aip-dir[aria-pressed="true"] small { opacity: .9; }

/* Diagram */
.aip-diagram { margin-top: 18px; padding: 8px; border: 1px solid var(--aip-line); border-radius: 14px; background: var(--aip-paper); }
.aip-diagram svg { display: block; width: 100%; height: auto; }
.aip-compass-ring { fill: none; stroke: #cfdacb; stroke-width: 1.5; }
.aip-compass-tick { stroke: #b8c7b6; stroke-width: 2; }
.aip-compass-label { fill: #4f5d55; font-family: var(--font-body, system-ui, sans-serif); font-size: 11px; font-weight: 700; }
.aip-room { fill: #fffefa; stroke: #c9d5c7; stroke-width: 1.5; }
.aip-window { stroke: var(--aip-green); stroke-width: 7; stroke-linecap: round; }
.aip-beam { opacity: .85; }
.aip-sun { fill: #e7b64a; stroke: #a9751f; stroke-width: 1.5; }
.aip-sun-glow { fill: #f0cf85; opacity: .32; }
.aip-plant-icon { fill: var(--aip-green); opacity: .8; }
.aip-depth-label { fill: #5d6b62; font-family: var(--font-body, system-ui, sans-serif); font-size: 10px; }

/* Readout */
.aip-readout { min-height: 100%; }
.aip-big { margin: 2px 0 0; color: var(--aip-green-dark); font-family: var(--font-display, Georgia, serif); font-size: clamp(2rem, 5.5vw, 2.7rem); line-height: 1.05; }
.aip-big-label { margin: 2px 0 16px; color: var(--aip-muted); font-size: .82rem; }
.aip-stat { display: flex; justify-content: space-between; gap: 14px; margin: 0 0 8px; padding-bottom: 8px; border-bottom: 1px dashed #cfe0ce; font-size: .9rem; }
.aip-stat:last-of-type { border-bottom: 0; }
.aip-stat strong { color: var(--aip-green-dark); font-variant-numeric: tabular-nums; text-align: right; }
.aip-plants { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.aip-plants a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 7px 9px; border: 1px solid #d5e3d4; border-radius: 8px; background: #fff; color: var(--aip-green-dark); font-size: .86rem; font-weight: 600; text-decoration: none; }
.aip-plants a:hover { border-color: var(--aip-green); text-decoration: underline; text-underline-offset: 2px; }
.aip-plants em { color: var(--aip-muted); font-size: .76rem; font-weight: 500; }
.aip-empty { margin: 8px 0 0; color: var(--aip-muted); font-size: .85rem; }
.aip-note { margin: 14px 0 0; color: var(--aip-muted); font-size: .78rem; line-height: 1.55; }

/* VPD heatmap */
.aip-heatmap { margin: 14px 0 0; }
.aip-heatmap svg { display: block; width: 100%; height: auto; border-radius: 10px; background: #fff; }
.aip-hm-cell { stroke: #fffefa; stroke-width: .8; }
.aip-hm-cell:hover,
.aip-hm-cell.is-active { stroke: #17201c; stroke-width: 2; }
.aip-hm-axis { fill: #5d6b62; font-family: var(--font-body, system-ui, sans-serif); font-size: 10px; }
.aip-hm-axis-title { fill: #2b4a38; font-family: var(--font-body, system-ui, sans-serif); font-size: 11px; font-weight: 700; }
.aip-hm-marker { fill: none; stroke: #17201c; stroke-width: 2.5; pointer-events: none; }
.aip-hm-marker-core { fill: #17201c; pointer-events: none; }
.aip-readout-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; margin: 10px 0 0; font-size: .9rem; color: var(--aip-muted); }
.aip-readout-line strong { color: var(--aip-green-dark); font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.aip-readout-line .aip-band { padding: 2px 9px; border-radius: 99px; background: var(--aip-soft); color: var(--aip-green-dark); font-size: .8rem; font-weight: 700; }
.aip-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 16px; margin: 14px 0 0; padding: 0; list-style: none; font-size: .8rem; color: var(--aip-muted); }
.aip-legend li { display: flex; align-items: center; gap: 8px; }
.aip-swatch { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(23, 32, 28, .15); }

/* Repotting timeline */
.aip-timeline { margin: 16px 0 0; }
.aip-timeline svg { display: block; width: 100%; height: auto; }
.aip-tl-rail { stroke: #c5d6c2; stroke-width: 4; stroke-linecap: round; }
.aip-tl-tick { stroke: #dbe5d8; stroke-width: 1; }
.aip-tl-tick-label { fill: #6b7a6c; font-family: var(--font-body, system-ui, sans-serif); font-size: 10px; }
.aip-tl-marker line { stroke: var(--aip-green); stroke-width: 2; stroke-dasharray: 4 4; }
.aip-tl-marker circle { fill: var(--aip-green); stroke: #fffefa; stroke-width: 3; }
.aip-tl-marker text { fill: var(--aip-green-dark); font-family: var(--font-body, system-ui, sans-serif); font-size: 11px; font-weight: 700; }
.aip-tl-marker { transform-box: fill-box; transform-origin: 50% 100%; animation: aip-pop .5s ease both; animation-delay: calc(var(--i, 0) * 120ms); }
.aip-tl-today { stroke: var(--aip-warn); stroke-width: 1.5; stroke-dasharray: 2 4; }
@keyframes aip-pop {
    from { opacity: 0; transform: scale(.6) translateY(6px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.aip-schedule { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.aip-schedule li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 8px 10px; border: 1px solid #d5e3d4; border-radius: 8px; background: #fff; font-size: .85rem; }
.aip-schedule strong { color: var(--aip-green-dark); }
.aip-schedule span { color: var(--aip-muted); }

/* Sign checkboxes */
.aip-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin: 0; padding: 0; border: 0; }
.aip-checks legend { margin-bottom: 8px; padding: 0; color: #2b4a38; font-size: .9rem; font-weight: 700; }
.aip-check { display: flex; align-items: flex-start; gap: 8px; font-size: .85rem; line-height: 1.45; color: #3b5540; }
.aip-check input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--aip-green); }

/* Leaf diagnosis tree */
.aip-tree-path { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; font-size: .74rem; }
.aip-tree-path li { padding: 3px 9px; border-radius: 99px; background: var(--aip-soft); color: #355842; }
.aip-tree-path li:last-child { background: #cfe3d6; font-weight: 700; }
.aip-question { margin: 0 0 16px; color: var(--aip-ink); font-size: 1.12rem; font-weight: 700; line-height: 1.45; }
.aip-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.aip-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #ccd8c9;
    border-radius: 12px;
    background: #fff;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.aip-option:hover { border-color: var(--aip-green); background: #f6faf4; }
.aip-option svg { flex: 0 0 54px; width: 54px; height: 54px; }
.aip-option b { display: block; font-size: .92rem; line-height: 1.3; }
.aip-option small { display: block; margin-top: 3px; color: var(--aip-muted); font-size: .76rem; line-height: 1.4; }
.aip-diagnosis { padding: 18px; border: 1px solid #cfe3d6; border-left: 4px solid var(--aip-green); border-radius: 0 12px 12px 0; background: var(--aip-soft); }
.aip-diagnosis h3 { margin: 0 0 6px; font-size: 1.25rem; }
.aip-diagnosis p { margin: 0 0 10px; line-height: 1.7; }
.aip-diagnosis ul { margin: 0 0 12px; padding-left: 1.15rem; line-height: 1.7; }
.aip-diagnosis a { color: #205b40; text-decoration: underline; text-underline-offset: 3px; }
.aip-result-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.aip-result-links a { display: inline-block; padding: 6px 11px; border: 1px solid #b5c6b9; border-radius: 99px; background: #fff; color: var(--aip-green-dark); font-size: .8rem; font-weight: 700; text-decoration: none; }
.aip-result-links a:hover { border-color: var(--aip-green); }
.aip-tree-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Propagation tracker */
.aip-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.aip-form .aip-actions { grid-column: 1 / -1; }
.aip-tracker-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin: 30px 0 0; }
.aip-tracker-head h2 { margin: 0; }
.aip-tracker-head p { margin: 0; color: var(--aip-muted); font-size: .85rem; }
.aip-tracker-list { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.aip-cutting { padding: 14px; border: 1px solid var(--aip-line); border-radius: 12px; background: #fff; }
.aip-cutting-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.aip-cutting h3 { margin: 0; font-size: 1rem; }
.aip-cutting .aip-meta { margin: 3px 0 0; color: var(--aip-muted); font-size: .78rem; }
.aip-stage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin: 12px 0 0; }
.aip-stage button {
    min-height: 38px;
    padding: 5px 3px;
    border: 1px solid #ccd8c9;
    border-radius: 7px;
    background: #fff;
    color: #3b5540;
    font: inherit;
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
}
.aip-stage button[aria-pressed="true"] { background: var(--aip-green); border-color: var(--aip-green); color: #fff; }
.aip-stage small { display: block; font-weight: 500; font-size: .62rem; opacity: .8; }
.aip-progress { height: 8px; margin-top: 10px; border-radius: 99px; background: #e4ebe2; overflow: hidden; }
.aip-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5aa47f, #27674e); transition: width .5s ease; }
.aip-cutting-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.aip-cutting-actions .aip-days { color: var(--aip-muted); font-size: .76rem; }
.aip-link-btn { padding: 0; border: 0; background: none; color: var(--aip-danger); font: inherit; font-size: .78rem; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.aip-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.aip-confirm { margin-top: 12px; padding: 12px; border: 1px solid #e2c9c1; border-radius: 10px; background: #fbf1ee; }
.aip-confirm p { margin: 0 0 10px; font-size: .85rem; }
.aip-confirm .aip-actions { display: flex; gap: 8px; }
.aip-status { margin: 10px 0 0; min-height: 1.2em; color: var(--aip-green-dark); font-size: .82rem; }
.aip-privacy { margin: 10px 0 0; color: var(--aip-muted); font-size: .78rem; line-height: 1.5; }

/* Article copy */
.aip-copy { max-width: 72ch; margin-top: 44px; }
.aip-copy h2 { margin: 40px 0 14px; color: var(--aip-ink); font-size: clamp(1.55rem, 2.6vw, 1.9rem); }
.aip-copy h3 { margin: 26px 0 6px; font-size: 1.02rem; }
.aip-copy p,
.aip-copy li { color: var(--aip-muted); line-height: 1.8; }
.aip-copy ul { padding-left: 1.15rem; }
.aip-copy a { color: #205b40; text-decoration: underline; text-underline-offset: 3px; }
.aip-copy table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .88rem; }
.aip-copy th, .aip-copy td { padding: 8px 10px; border-top: 1px solid var(--aip-line); text-align: left; }
.aip-copy thead th { background: var(--aip-soft); color: #2b4a38; }
.aip-related { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--aip-line); }
.aip-related ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; padding: 0; list-style: none; }
.aip-related a { display: inline-block; }

@media (max-width: 760px) {
    .aip-split { grid-template-columns: minmax(0, 1fr); }
    .aip-fields { grid-template-columns: minmax(0, 1fr); }
    .aip-options { grid-template-columns: minmax(0, 1fr); }
    .aip-checks { grid-template-columns: minmax(0, 1fr); }
    .aip-form { grid-template-columns: minmax(0, 1fr); }
    .aip-related ul { grid-template-columns: minmax(0, 1fr); }
    .aip-panel { padding: 16px; }
    .aip-dirs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aip-stage button { font-size: .68rem; }
}

@media (max-width: 420px) {
    .aip-stage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    .aip-tool *,
    .aip-tool *::before,
    .aip-tool *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .aip-tl-marker { opacity: 1; transform: none; }
}

@media print {
    .aip-tool .aip-dirs,
    .aip-tool .aip-toolbar,
    .aip-tool .aip-form,
    .aip-tool .aip-tree-nav,
    .aip-tool .aip-cutting-actions { display: none !important; }
    .aip-panel { break-inside: avoid; border-color: #999; }
}

/* ==========================================================================
   Visual instruments — the five November tools, rebuilt so the graphic
   carries the page. Paper, ink and moss; hairlines instead of fills.
   ========================================================================== */
.aip-inst {
    --aip-ink: #1b211c;
    --aip-muted: #5c675e;
    --aip-green: #2c6a4d;
    --aip-green-dark: #1d4a35;
    --aip-soft: #e7eee5;
    --aip-line: #d8d3c4;
    --aip-card: #fffdf7;
    --aip-paper: #f3f0e7;
    --aip-hair: #d8d3c4;
    --aip-hair-strong: #b9b3a1;
    --aip-moss: #2c6a4d;
    --aip-ochre: #b98a3f;
    --aip-clay: #a85a3b;
    margin: 26px 0 8px;
}
.aip-inst .aip-intro { max-width: 70ch; }

/* figure shell */
.aip-figure {
    position: relative;
    margin: 0;
    width: 100%;
    border: 1px solid var(--aip-hair);
    border-radius: 14px;
    background: var(--aip-card);
    overflow: hidden;
}
.aip-figure > svg { display: block; width: 100%; height: 100%; }
.aip-fig--room { aspect-ratio: 16 / 10; min-height: 300px; }
@media (max-width: 640px) {
    .aip-fig--room { aspect-ratio: 1 / 1; min-height: 360px; }
    .aip-vpd-stage { min-height: 360px; }
    .aip-display--stats > div:last-child { grid-column: 1 / -1; }
}
.aip-scrub .aip-value { float: right; color: var(--aip-green); font-variant-numeric: tabular-nums; }
.aip-fig--repot { aspect-ratio: 4 / 1; min-height: 240px; max-height: 320px; }
.aip-fig--tree { aspect-ratio: 16 / 9; min-height: 320px; max-height: 560px; }
.aip-fig--tree:focus-visible { outline: 3px solid #28684e; outline-offset: 2px; }

/* controls strip under the graphic */
.aip-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px 20px;
    align-items: start;
    margin-top: 12px;
    padding: 14px 16px;
    border: 1px solid var(--aip-hair);
    border-radius: 12px;
    background: var(--aip-card);
}
.aip-controls--vpd { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(230px, 1.15fr); align-items: center; }
.aip-controls--repot { grid-template-columns: minmax(200px, .9fr) minmax(0, 1.6fr); }
.aip-controls .aip-field > label + input[type="range"] { margin-bottom: 8px; }
.aip-controls .aip-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aip-dirs { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.aip-dir { min-height: 40px; font-size: .82rem; }
.aip-dir small { font-size: .58rem; }
.aip-btn--small {
    align-self: flex-start;
    min-height: 34px;
    padding: 4px 12px;
    font-size: .8rem;
}
.aip-phase { margin: 10px 0 0; min-height: 1.3em; color: var(--aip-muted); font-size: .82rem; }

/* readout board */
.aip-display {
    display: grid;
    grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 12px 0 0;
    border: 1px solid var(--aip-hair);
    border-radius: 12px;
    background: var(--aip-hair);
    overflow: hidden;
}
.aip-display > div { min-width: 0; padding: 12px 14px; background: var(--aip-card); }
.aip-display dt {
    margin: 0 0 3px;
    color: var(--aip-muted);
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.aip-display dd {
    margin: 0;
    color: var(--aip-green-dark);
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.aip-display .is-hero dd { font-size: clamp(2rem, 4.4vw, 2.9rem); line-height: 1; }
.aip-display--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.aip-plants-head { margin: 22px 0 2px; font-size: 1rem; }
.aip-inst .aip-plants { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; min-height: 148px; }
.aip-inst .aip-plants a { height: 100%; align-items: center; }

/* VPD stage */
.aip-vpd-stage {
    position: relative;
    width: 100%;
    margin-top: 12px;
    aspect-ratio: 16 / 9;
    min-height: 340px;
    border: 1px solid var(--aip-hair);
    border-radius: 14px;
    background: var(--aip-card);
    overflow: hidden;
    touch-action: none;
}
.aip-vpd-stage canvas,
.aip-vpd-stage .aip-vpd-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.aip-vpd-overlay svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.aip-vpd-stage:focus-visible { outline: 3px solid #28684e; outline-offset: 2px; }
.aip-vpd-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-left: 14px;
    border-left: 1px solid var(--aip-hair);
}
.aip-vpd-line { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.aip-vpd-line strong {
    color: var(--aip-green-dark);
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(1.8rem, 3.6vw, 2.4rem);
    font-weight: 400;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.aip-unit { color: var(--aip-muted); font-size: .78rem; }
.aip-vpd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0 0; color: var(--aip-muted); font-size: .74rem; }
.aip-vapour { flex: 0 0 78px; width: 78px; height: 52px; }

/* diagnosis tree */
.aip-tree-wrap { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 16px; align-items: start; }
.aip-tree-panel { padding: 16px; border: 1px solid var(--aip-hair); border-radius: 12px; background: var(--aip-card); }
.aip-tree-panel .aip-tree-path { margin-bottom: 12px; }
.aip-opt-n {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--aip-hair-strong);
    border-radius: 50%;
    color: var(--aip-muted);
    font-size: .7rem;
    font-weight: 700;
}
.aip-option svg { flex: 0 0 46px; width: 46px; height: 46px; }
.aip-diag-art { width: 84px; height: 84px; margin-bottom: 8px; }
.aip-diag-art svg { display: block; width: 100%; height: 100%; }
.aip-link--new { animation: aip-draw .55s ease-out both; }
@keyframes aip-draw { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }

/* propagation cards */
.aip-cut {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--aip-hair);
    border-radius: 12px;
    background: var(--aip-card);
}
.aip-cut-art { border: 1px solid var(--aip-hair); border-radius: 10px; background: var(--aip-paper); overflow: hidden; }
.aip-cut-art svg { display: block; width: 100%; height: auto; }
.aip-cut-body { min-width: 0; }
.aip-cut-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.aip-cut-head h3 { margin: 0; font-size: 1rem; }
.aip-cut-full { display: none; }
.aip-cut-foot { margin-top: 8px; }
.aip-inst .aip-form { padding: 14px 16px; border: 1px solid var(--aip-hair); border-radius: 12px; background: var(--aip-card); }

/* scrubber */
.aip-scrub {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 14px;
    align-items: center;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid var(--aip-hair);
    border-radius: 12px;
    background: var(--aip-card);
}
.aip-scrub label { grid-column: 1 / -1; margin: 0; color: #2b4a38; font-size: .84rem; font-weight: 700; }
.aip-scrub input[type="range"] { width: 100%; margin: 0; accent-color: var(--aip-green); }
.aip-root-warn { margin: 10px 0 0; color: var(--aip-muted); font-size: .86rem; }
.aip-root-warn[data-level="mid"] { color: #7a5a1f; }
.aip-root-warn[data-level="warn"] { color: #8f4227; font-weight: 600; }
.aip-inst .aip-big { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.aip-inst .aip-big-label { margin-bottom: 10px; }

/* hub card minis */
.interior-page .tool-card.aip-live-card { padding: 16px 16px 20px; }
.tool-card-mini {
    position: relative;
    aspect-ratio: 16 / 7;
    margin: 2px 0 4px;
    border: 1px solid #d8d3c4;
    border-radius: 10px;
    background: #f3f0e7;
    overflow: hidden;
}
.tool-card-mini svg { display: block; width: 100%; height: 100%; }
/* Canvas sits out of flow: tool-hub-minis.js writes its pixel width from the box, and in flow that
   width fed back into the card's min-content size and ratcheted the hub wider on phones. */
.tool-card-mini canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

@media (max-width: 900px) {
    .aip-controls--vpd { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .aip-vpd-box { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--aip-hair); padding-top: 10px; }
}
@media (max-width: 860px) {
    .aip-tree-wrap { grid-template-columns: minmax(0, 1fr); }
    .aip-controls--repot { grid-template-columns: minmax(0, 1fr); }
    .aip-fig--room { aspect-ratio: 4 / 3; }
    .aip-fig--repot { aspect-ratio: 4 / 3; }
}
@media (max-width: 760px) {
    .aip-dirs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .aip-display { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .aip-display .is-hero { grid-column: 1 / -1; }
    .aip-inst .aip-plants { grid-template-columns: minmax(0, 1fr); }
    .aip-cut { grid-template-columns: minmax(0, 1fr); }
    .aip-cut-art { max-width: 340px; }
    .aip-controls .aip-checks { grid-template-columns: minmax(0, 1fr); }
    .aip-fig--tree { aspect-ratio: 1 / 1; min-height: 320px; max-height: 420px; }
}
@media (max-width: 480px) {
    .aip-controls { padding: 12px; }
    .aip-inst .aip-plants { grid-template-columns: minmax(0, 1fr); }
    .aip-cut { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .aip-link--new { animation: none !important; }
    .aip-vapour circle { transition: none !important; }
}

@media print {
    .aip-controls, .aip-scrub, .aip-phase, .aip-toolbar { display: none !important; }
    .aip-figure, .aip-vpd-stage { break-inside: avoid; }
}

/* ==========================================================================
   Shared instrument frame for the calculator pages (plant-tools.js and the
   five older standalone calculators). Canvas sits beside the inputs.
   ========================================================================== */
.page-growth.interior-page .blog-hero { padding: 28px 0 24px; }
.page-growth.interior-page .blog-hero .section-title { font-size: clamp(28px, 3.1vw, 40px); line-height: 1.08; }
.page-growth.interior-page .blog-hero .section-subtitle { margin-top: 8px; }
.page-growth.interior-page .blog-hero nav[aria-label="Breadcrumb"] { margin-bottom: 14px !important; }
.page-growth main > section:nth-of-type(2) { padding-top: 26px; }

.gf-wrap {
    display: grid;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    gap: 20px 28px;
    align-items: start;
    margin: 6px 0 34px;
}
.gf-col { min-width: 0; }
.gf {
    position: sticky;
    top: 88px;
    margin: 0;
    border: 1px solid #d8d3c4;
    border-radius: 14px;
    background: #fffdf7;
    overflow: hidden;
}
.gf canvas { display: block; width: 100%; height: 330px; }
.gf-cap {
    display: block;
    padding: 12px 14px 14px;
    border-top: 1px solid #d8d3c4;
    background: #f3f0e7;
}
.gf-kicker {
    display: block;
    margin-bottom: 2px;
    color: #5c675e;
    font-size: .64rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.gf-value {
    display: block;
    color: #1d4a35;
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 400;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.gf-sub { display: block; margin-top: 3px; color: #5c675e; font-size: .78rem; }

@media (max-width: 900px) {
    .gf-wrap { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .gf { position: static; }
    .gf canvas { height: 250px; }
}
@media (max-width: 480px) {
    .gf canvas { height: 230px; }
}

/* Tool detail heroes: same compact rhythm for the bespoke instruments. */
.page-tools-detail.interior-page .blog-hero { padding: 30px 0 26px; }
.page-tools-detail.interior-page .blog-hero .section-title { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; }
.page-tools-detail.interior-page .blog-hero nav[aria-label="Breadcrumb"] { margin-bottom: 14px !important; }
