/* Field Instrument kit, version 2: styles for the shared components in instrument-kit.js.
   Every selector carries the ik- prefix and reads only the kit's color and font variables,
   so the file also works on an instrument that does not load instrument-kit.css. */

.ik-label {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent, #f0b429);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.ik-fine {
    margin: 0;
    color: var(--text-muted, #7a7568);
    font-size: 0.73rem;
    line-height: 1.5;
}

/* ---------- sensitivity range ---------- */
.ik-band {
    display: grid;
    gap: 8px;
    padding: 13px 15px 14px;
    border: 1px solid var(--border, rgba(240, 180, 41, 0.18));
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    min-width: 0;
}

.ik-band__track {
    position: relative;
    height: 8px;
    margin-top: 4px;
    border-radius: 999px;
    background: rgba(240, 180, 41, 0.1);
}

.ik-band__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    border-radius: 999px;
    background: rgba(240, 180, 41, 0.42);
    transition: left 0.2s ease, width 0.2s ease;
}

.ik-band__tick {
    position: absolute;
    top: -4px;
    bottom: -4px;
    width: 3px;
    margin-left: -1.5px;
    border-radius: 2px;
    background: var(--text-primary, #fff);
    box-shadow: 0 0 0 2px var(--bg-deep, #0c0b09);
    transition: left 0.2s ease;
}

.ik-band__ends {
    position: relative;
    height: 1.1rem;
    color: var(--text-secondary, #ccc7be);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.72rem;
    font-weight: 700;
}

.ik-band__ends span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.ik-band__ends span:first-child { transform: translateX(-100%); padding-right: 4px; }
.ik-band__ends span:last-child { transform: none; padding-left: 4px; }

.ik-band__text {
    margin: 0;
    color: var(--text-secondary, #ccc7be);
    font-size: 0.84rem;
    line-height: 1.55;
}

/* ---------- buttons and inputs ---------- */
.ik-btn,
.ik-link {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.68rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    cursor: pointer;
}

.ik-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 13px;
    border: 1px solid var(--border, rgba(240, 180, 41, 0.18));
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary, #ccc7be);
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.ik-btn:hover { border-color: var(--accent, #f0b429); color: var(--text-primary, #fff); }
.ik-btn--primary { background: var(--accent, #f0b429); border-color: var(--accent, #f0b429); color: var(--bg-deep, #0c0b09); font-weight: 700; }
.ik-btn--primary:hover { color: var(--bg-deep, #0c0b09); }

.ik-link {
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--accent, #f0b429);
}

.ik-link:hover { color: var(--text-primary, #fff); }
.ik-link--quiet { color: var(--text-muted, #7a7568); }

.ik-btn:focus-visible,
.ik-link:focus-visible,
.ik-input:focus-visible { outline: 2px solid var(--accent, #f0b429); outline-offset: 2px; }

.ik-input {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--border, rgba(240, 180, 41, 0.18));
    border-radius: 999px;
    background: rgba(8, 7, 5, 0.5);
    color: var(--text-primary, #fff);
    font-family: var(--font-display, system-ui, sans-serif);
    font-size: 0.84rem;
}

.ik-input::placeholder { color: var(--text-muted, #7a7568); }

/* ---------- scenarios ---------- */
.ik-tools {
    display: grid;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border, rgba(240, 180, 41, 0.18));
    min-width: 0;
}

.ik-save,
.ik-row { display: flex; flex-wrap: wrap; gap: 8px; }

.ik-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }

.ik-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 8px 11px;
    border: 1px solid var(--border, rgba(240, 180, 41, 0.18));
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
}

.ik-list__text { display: grid; gap: 2px; min-width: 0; flex: 1 1 150px; }
.ik-list__name { color: var(--text-primary, #fff); font-size: 0.86rem; font-weight: 600; overflow-wrap: anywhere; }
.ik-list__meta { color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.64rem; letter-spacing: 0.04em; }
.ik-list__acts { display: flex; gap: 14px; }

.ik-status { margin: 0; min-height: 1.2em; color: var(--text-secondary, #ccc7be); font-size: 0.8rem; line-height: 1.45; overflow-wrap: anywhere; }

/* ---------- comparison ---------- */
.ik-panel {
    border: 1px solid var(--accent-border, rgba(240, 180, 41, 0.24));
    border-radius: 12px;
    background: rgba(8, 7, 5, 0.32);
    padding: 15px;
    min-width: 0;
}

.ik-compare { display: grid; gap: 12px; }
.ik-compare[hidden] { display: none; }
.ik-compare__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ik-compare__head h2 { margin: 0; color: var(--text-primary, #fff); font-size: 1rem; line-height: 1.25; }
.ik-compare__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.ik-col {
    padding: 12px;
    border: 1px solid var(--border, rgba(240, 180, 41, 0.18));
    border-radius: 10px;
    min-width: 0;
}

.ik-col + .ik-col { border-color: var(--accent, #f0b429); }
.ik-col p { margin: 0; }
.ik-col__tag { color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; overflow-wrap: anywhere; }
.ik-col__score { margin-top: 6px !important; color: var(--text-primary, #fff); font-family: var(--font-mono, ui-monospace, monospace); font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.ik-col__score span { color: var(--text-muted, #7a7568); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ik-col__tier { margin-top: 4px !important; color: var(--text-primary, #fff); font-size: 0.9rem; font-weight: 600; line-height: 1.3; }
.ik-col__range { margin-top: 6px !important; color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.66rem; letter-spacing: 0.04em; }

.ik-compare__verdict { margin: 0; color: var(--text-secondary, #ccc7be); font-size: 0.88rem; line-height: 1.55; }

.ik-tablewrap { overflow-x: auto; }
.ik-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ik-table caption { padding-bottom: 6px; text-align: left; color: var(--accent, #f0b429); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ik-table th,
.ik-table td { padding: 6px 8px 6px 0; border-top: 1px solid var(--border, rgba(240, 180, 41, 0.18)); text-align: left; vertical-align: top; color: var(--text-secondary, #ccc7be); font-weight: 400; }
.ik-table tr:first-of-type th { border-top: 0; color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.62rem; letter-spacing: 0.08em; }
.ik-table td.is-changed { color: var(--text-primary, #fff); font-weight: 600; }

.ik-more { display: grid; gap: 12px; }
.ik-more summary { color: var(--accent, #f0b429); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.ik-more summary:focus-visible { outline: 2px solid var(--accent, #f0b429); outline-offset: 2px; }
.ik-more[open] summary { margin-bottom: 12px; }
.ik-more > * + * { margin-top: 12px; }
.ik-pairs { display: grid; gap: 9px; }
.ik-pairs__legend { margin: 0; display: flex; gap: 14px; color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.64rem; letter-spacing: 0.08em; }
.ik-key::before { content: ""; display: inline-block; width: 14px; height: 5px; margin-right: 6px; border-radius: 999px; background: var(--accent, #f0b429); vertical-align: middle; }
.ik-key--a::before { background: rgba(204, 199, 190, 0.55); }
.ik-pair { display: grid; gap: 3px; }
.ik-pair__top { display: flex; justify-content: space-between; gap: 12px; color: var(--text-secondary, #ccc7be); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ik-pair__value { color: var(--accent, #f0b429); white-space: nowrap; }
.ik-pair__track { height: 5px; border-radius: 999px; background: rgba(240, 180, 41, 0.1); overflow: hidden; }
.ik-pair__fill { display: block; height: 100%; border-radius: inherit; background: var(--accent, #f0b429); }
.ik-pair__fill--a { background: rgba(204, 199, 190, 0.55); }

/* ---------- cite ---------- */
.ik-cite { margin: 0; color: var(--text-muted, #7a7568); font-size: 0.73rem; line-height: 1.55; }
.ik-cite__label { color: var(--accent, #f0b429); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ik-cite a { color: var(--text-secondary, #ccc7be); }

@media (max-width: 420px) {
    .ik-compare__cols { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .ik-band__fill,
    .ik-band__tick { transition: none; }
}

/* ---------- report (print and the report view) ---------- */
.ik-report { display: none; }

html.ik-report-mode,
html.ik-report-mode body { background: #fff; }
html.ik-report-mode body { display: block; min-height: 0; padding: 0; }
html.ik-report-mode body > *:not(.ik-report) { display: none !important; }

html.ik-report-mode .ik-report {
    display: block;
    max-width: 780px;
    margin: 0 auto;
    padding: 28px 24px 40px;
    color: #171512;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 0.92rem;
    line-height: 1.55;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.ik-report__bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.ik-report .ik-btn { border-color: #b9b3a6; color: #3a362e; }
.ik-report .ik-btn--primary { background: #171512; border-color: #171512; color: #fff; }

.ik-report__head { padding-bottom: 14px; border-bottom: 2px solid #171512; }
.ik-report__brand { margin: 0 0 10px; color: #5b5648; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; }
.ik-report__mono { display: inline-block; padding: 2px 5px; border: 1.5px solid #a97c12; border-radius: 4px; color: #a97c12; font-weight: 700; }
.ik-report h1 { margin: 0; color: #171512; font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.02em; }
.ik-report__meta { margin: 6px 0 0; color: #5b5648; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.7rem; }

.ik-report__section { margin-top: 18px; break-inside: avoid; }
.ik-report__section h2 { margin: 0 0 8px; color: #a97c12; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.ik-report__section p { margin: 0 0 6px; }
.ik-report__score { color: #171512; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 2.2rem; font-weight: 700; line-height: 1; }
.ik-report__score span { color: #5b5648; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ik-report__tier { font-size: 1.1rem; font-weight: 700; }
.ik-report__range { color: #3a362e; }

.ik-report__table { width: 100%; border-collapse: collapse; }
.ik-report__table th,
.ik-report__table td { padding: 5px 10px 5px 0; border-bottom: 1px solid #ddd8cc; text-align: left; vertical-align: top; font-weight: 400; }
.ik-report__table th { width: 48%; color: #5b5648; }
.ik-report__table td { color: #171512; font-weight: 600; }

.ik-report__bar-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) 2.6rem; gap: 10px; align-items: center; padding: 3px 0; }
.ik-report__bar-label { color: #3a362e; }
.ik-report__bar-value { color: #171512; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.78rem; font-weight: 700; text-align: right; }
.ik-report__track { display: block; height: 7px; border: 1px solid #b9b3a6; border-radius: 999px; overflow: hidden; }
.ik-report__fill { display: block; height: 100%; background: #a97c12; }

.ik-report__actions { margin: 0; padding-left: 1.2rem; }
.ik-report__actions li { margin-bottom: 4px; }
.ik-report__notes { margin: 0; }
.ik-report__notes dt { margin-top: 6px; color: #171512; font-weight: 700; }
.ik-report__notes dd { margin: 0; color: #3a362e; }
.ik-report__refs { margin: 0; padding-left: 1.2rem; color: #3a362e; }
.ik-report__refs li { margin-bottom: 3px; }
.ik-report__refs strong { color: #171512; }

.ik-report__foot { margin-top: 22px; padding-top: 12px; border-top: 1px solid #b9b3a6; color: #5b5648; font-size: 0.78rem; }
.ik-report__foot p { margin: 0 0 6px; }
.ik-report__link { overflow-wrap: anywhere; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.66rem; }

/* comparison inside the report: same markup, ink colors */
.ik-report .ik-compare { padding: 0; border: 0; background: none; }
.ik-report .ik-col { border-color: #b9b3a6; }
.ik-report .ik-col + .ik-col { border-color: #171512; }
.ik-report .ik-col__tag,
.ik-report .ik-col__range,
.ik-report .ik-col__score span { color: #5b5648; }
.ik-report .ik-col__score,
.ik-report .ik-col__tier { color: #171512; }
.ik-report .ik-compare__verdict { color: #171512; }
.ik-report .ik-table caption { color: #a97c12; }
.ik-report .ik-table th,
.ik-report .ik-table td { border-color: #ddd8cc; color: #3a362e; }
.ik-report .ik-table td.is-changed { color: #171512; }
.ik-report .ik-pair__top { color: #3a362e; }
.ik-report .ik-pair__value { color: #171512; }
.ik-report .ik-pair__track { background: #ece8dd; }
.ik-report .ik-pair__fill { background: #a97c12; }
.ik-report .ik-key::before { background: #a97c12; }
.ik-report .ik-pair__fill--a,
.ik-report .ik-key--a::before { background: #8d877a; }
.ik-report .ik-pairs__legend { color: #5b5648; }

@media print {
    @page { margin: 14mm; }
    html.ik-report-mode .ik-report { max-width: none; padding: 0; font-size: 10.5pt; }
    .ik-report__bar { display: none; }
}

/* ---------- charts: inline SVG drawn by an instrument, restyled in the report ---------- */
.ik-chart { display: block; width: 100%; height: auto; overflow: visible; }
.ik-chart__grid { stroke: rgba(240, 180, 41, 0.12); stroke-width: 1; }
.ik-chart__axis { fill: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; }
.ik-chart__title { fill: var(--text-secondary, #ccc7be); font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; letter-spacing: 0.06em; }
.ik-chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ik-chart__line--a { stroke: rgba(204, 199, 190, 0.8); }
.ik-chart__line--b { stroke: var(--accent, #f0b429); }
.ik-chart__line--dashed { stroke-dasharray: 5 4; stroke-width: 1.5; }
.ik-chart__tag { fill: var(--text-secondary, #ccc7be); }
.ik-chart__band--a { fill: rgba(204, 199, 190, 0.16); }
.ik-chart__band--b { fill: rgba(240, 180, 41, 0.2); }
.ik-chart__mark { stroke-width: 1.2; stroke-dasharray: 3 3; }
.ik-chart__mark--a { stroke: rgba(204, 199, 190, 0.8); }
.ik-chart__mark--b { stroke: var(--accent, #f0b429); }
.ik-legend { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; }

.ik-report .ik-chart__grid { stroke: #ddd8cc; }
.ik-report .ik-chart__axis,
.ik-report .ik-chart__title { fill: #5b5648; }
.ik-report .ik-chart__tag { fill: #3a362e; }
.ik-report .ik-chart__line--a,
.ik-report .ik-chart__mark--a { stroke: #8d877a; }
.ik-report .ik-chart__line--b,
.ik-report .ik-chart__mark--b { stroke: #a97c12; }
.ik-report .ik-chart__band--a { fill: rgba(141, 135, 122, 0.22); }
.ik-report .ik-chart__band--b { fill: rgba(169, 124, 18, 0.22); }
.ik-report .ik-legend { color: #5b5648; margin-bottom: 6px; }
.ik-report__figure { margin: 0 0 12px; break-inside: avoid; }
.ik-report__figure p { margin: 0 0 4px; color: #3a362e; font-size: 0.82rem; }

/* ---------- hour strip: one cell per hour of a shift ---------- */
.ik-hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.ik-hour { display: grid; gap: 2px; padding: 8px 6px; border: 1px solid var(--border, rgba(240, 180, 41, 0.18)); border-radius: 8px; background: rgba(255, 255, 255, 0.025); text-align: center; min-width: 0; }
.ik-hour__label { color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.6rem; letter-spacing: 0.06em; }
.ik-hour__value { color: var(--text-primary, #fff); font-family: var(--font-mono, ui-monospace, monospace); font-size: 1.05rem; font-weight: 700; line-height: 1.15; }
.ik-hour__unit { color: var(--text-muted, #7a7568); font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.56rem; letter-spacing: 0.04em; }
.ik-hour--rest { border-color: var(--warn, #e0a42f); background: rgba(224, 164, 47, 0.1); }
.ik-hour--rest .ik-hour__value { color: var(--warn, #e0a42f); }
.ik-hour--stop { border-color: var(--risk, #e94f4f); background: rgba(233, 79, 79, 0.12); }
.ik-hour--stop .ik-hour__value { color: var(--risk, #e94f4f); font-size: 0.82rem; }

/* A six-level rating (0 to 5) needs six columns and a four-level one (0 to 3) four; the base kit lays out five. */
.seg[data-max="5"] { grid-template-columns: repeat(6, 1fr); }
.seg[data-max="3"] { grid-template-columns: repeat(4, 1fr); }

/* An input the model is not using at the moment (a distance to an edge that is guarded). */
.control.is-off { opacity: 0.45; }
.control.is-off input[type="range"] { cursor: not-allowed; }

/* ---------- report: a banner line and a photo ---------- */
.ik-report__banner { margin: 12px 0 0; padding: 8px 12px; border: 1.5px solid #171512; color: #171512; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.ik-report__figure img { display: block; max-width: 100%; height: auto; border: 1px solid #b9b3a6; }
