/* The field tool's screens (TabStudio.Field, docs/Field-Tech-Plan.md section 4). Shared by every view, so not scoped to one component.
   Touch first: tabs and buttons at least 48 px high, for a gloved thumb. Colours follow TabStudio's dark theme (its variables when there,
   fallbacks otherwise, as in the app). */
.fd { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: hidden; background: var(--bg, #1b1b1c); color: var(--text, #e6e6e8);
      font-size: 15px; -webkit-user-select: none; user-select: none; }
.fd-title { flex: none; padding: 10px 14px; font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            background: var(--panel-2, #252528); border-bottom: 1px solid var(--border-soft, #3a3a3d); }
.fd-view { flex: 1; min-height: 0; overflow: auto; touch-action: pan-x pan-y; }
.fd-note { padding: 24px 16px; color: var(--text-dim, #a8a8ad); }
.fd-tabs { flex: none; display: flex; background: var(--panel-2, #252528); border-top: 1px solid var(--border-soft, #3a3a3d); }
.fd-tab { flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
          background: none; border: none; color: var(--text-dim, #a8a8ad); font: inherit; cursor: pointer; touch-action: manipulation; }
.fd-tab.fd-on { color: #76b900; }
.fd-icon { font-size: 20px; line-height: 1; }
.fd-label { font-size: 12px; }
.fd-empty { padding: 32px 20px; text-align: center; color: var(--text-dim, #a8a8ad); }
.fd-empty-title { font-size: 18px; color: var(--text, #e6e6e8); margin-bottom: 8px; }

/* The busy sign (FieldBusy.razor): TabStudio's green hourglass, drawn the same way here for the app. */
.fd { --fd-green: #76b900; --fd-glow: rgba(118, 185, 0, 0.65); --fd-turn: 2.4s; }
.fd-busy { display: inline-flex; width: 14px; height: 18px; margin: 0 6px 0 0; vertical-align: -3px; filter: drop-shadow(0 0 2px var(--fd-glow)); flex: none; }
.fd-busy svg { width: 100%; height: 100%; overflow: visible; }
.fd-busy-frame { fill: none; stroke: var(--fd-green); stroke-width: 1.3; stroke-linecap: round; }
.fd-busy-top, .fd-busy-bottom { fill: var(--fd-green); transform-box: fill-box; transform-origin: 50% 100%; }
.fd-busy-glass { transform-box: view-box; transform-origin: 6px 8px; animation: fd-busy-turn var(--fd-turn) ease-in-out infinite; }
.fd-busy-top { animation: fd-busy-drain var(--fd-turn) linear infinite; }
.fd-busy-bottom { animation: fd-busy-fill var(--fd-turn) linear infinite; }
@keyframes fd-busy-turn { 0%, 78% { transform: rotate(0deg); } 100% { transform: rotate(180deg); } }
@keyframes fd-busy-drain { 0% { transform: scaleY(1); } 75%, 100% { transform: scaleY(0); } }
@keyframes fd-busy-fill { 0% { transform: scaleY(0); } 75%, 100% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
    .fd-busy-glass, .fd-busy-top, .fd-busy-bottom { animation: none; }
    .fd-busy-bottom { transform: scaleY(0.45); }
}

/* Buttons: glove-sized. The main one is filled. */
.fd-btn { min-height: 48px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--border-soft, #3a3a3d); background: var(--panel-3, #2d2d31);
          color: var(--text, #e6e6e8); font: inherit; cursor: pointer; touch-action: manipulation; }
.fd-btn.fd-main { background: #2f6fd0; border-color: #2f6fd0; color: #fff; }
.fd-btn:disabled { opacity: 0.5; cursor: default; }

/* Summary (4.2) */
.fs { padding: 8px 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.fs-line { padding: 10px 12px; border-radius: 10px; background: var(--panel-2, #252528); display: flex; flex-direction: column; gap: 6px; }
.fs-line.fs-picked { outline: 2px solid #2f6fd0; }
.fs-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.fs-kind { color: var(--text-dim, #a8a8ad); }
.fs-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-tick { min-height: 44px; padding: 0 10px; font-size: 20px; }
.fs-pass { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.fs-link { background: none; border: none; padding: 6px 0; color: #6ea8ff; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.fs-final { color: #6fc3ff; }
.fs-final::after { content: " ✓"; }
.fs-who, .fs-none { color: var(--text-dim, #a8a8ad); font-size: 13px; }
.fs-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fs-session { margin-top: 4px; }
.fs-msg { padding: 8px 12px; border-radius: 8px; background: rgba(118, 185, 0, 0.12); }
.fs-msg.fs-bad { background: rgba(229, 192, 123, 0.14); }
.fs-ask { padding: 10px 12px; border-radius: 10px; background: rgba(229, 192, 123, 0.14); display: flex; flex-direction: column; gap: 8px; }
.fs-earlier { border-top: 1px solid var(--border-soft, #3a3a3d); padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.fd-gen { height: 100%; }

/* Summary progress (4.2) */
.fs-open { background: none; border: none; padding: 4px 0; color: var(--text, #e6e6e8); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.fs-prog { display: flex; align-items: center; gap: 10px; }
.fs-out { color: #f9ab00; }
.fs-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--panel-3, #2d2d31); overflow: hidden; }
.fs-bar > span { display: block; height: 100%; background: #76b900; }
.fs-totals { color: var(--text-dim, #a8a8ad); font-size: 13px; }

/* Status colours (4.3): not read grey, in tolerance green, out amber, final done blue; selected glows Tabi green */
.fd { --st-none: #5f6368; --st-unread: #9aa0a6; --st-in: #34a853; --st-out: #f9ab00; --st-final: #4c8df6; }
.fi-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex: none; background: var(--st-none); }
.fd-st-unread.fi-dot { background: var(--st-unread); }
.fd-st-intolerance.fi-dot { background: var(--st-in); }
.fd-st-outoftolerance.fi-dot { background: var(--st-out); }
.fd-st-finaldone.fi-dot { background: var(--st-final); }

/* Tabi bar (section 5) */
.ft { flex: none; display: flex; gap: 6px; padding: 6px 8px; background: var(--panel-2, #252528); border-bottom: 1px solid var(--border-soft, #3a3a3d); }
.ft-mic, .ft-go { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid var(--border-soft, #3a3a3d); background: var(--panel-3, #2d2d31);
                  color: var(--text, #e6e6e8); font-size: 18px; cursor: pointer; touch-action: none; }
.ft-mic.ft-on { background: #76b900; border-color: #76b900; color: #111; }
.ft-mic:disabled, .ft-go:disabled { opacity: 0.45; }
.ft-text { flex: 1; min-width: 0; min-height: 44px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-soft, #3a3a3d);
           background: var(--bg, #1b1b1c); color: var(--text, #e6e6e8); font: inherit; -webkit-user-select: text; user-select: text; }
.ft-said { flex: none; padding: 4px 12px; font-size: 13px; color: var(--text-dim, #a8a8ad); background: var(--panel-2, #252528); }

/* Item sheet (4.6) and keypad (4.7) */
.fi { flex: none; max-height: 70%; overflow: auto; background: var(--panel-2, #252528); border-top: 2px solid #76b900; }
.fi-peek { display: flex; align-items: center; min-height: 48px; padding: 0 4px 0 10px; }
.fi-peek-text { flex: 1; min-width: 0; min-height: 48px; display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; background: none; border: none;
                color: var(--text, #e6e6e8); font: inherit; text-align: left; cursor: pointer; }
.fi-pc { color: #76b900; }
.fi-close { min-width: 44px; min-height: 44px; background: none; border: none; color: var(--text-dim, #a8a8ad); font-size: 18px; cursor: pointer; }
.fi-body { padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.fi-row { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.fi-label { width: 64px; flex: none; color: var(--text-dim, #a8a8ad); font-size: 13px; }
.fi-value { min-width: 120px; font-weight: 600; font-size: 17px; }
.fi-small { min-height: 40px; font-size: 13px; }
.fi-side { color: var(--text-dim, #a8a8ad); font-size: 13px; }
.fk { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.fk-head { color: var(--text-dim, #a8a8ad); font-size: 13px; }
.fk-value { min-height: 48px; padding: 0 12px; display: flex; align-items: center; justify-content: flex-end; border-radius: 8px; background: var(--bg, #1b1b1c);
            font-size: 26px; font-weight: 600; }
.fk-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fk-key { min-height: 52px; border-radius: 8px; border: 1px solid var(--border-soft, #3a3a3d); background: var(--panel-3, #2d2d31); color: var(--text, #e6e6e8);
          font-size: 22px; cursor: pointer; touch-action: manipulation; }
.fk-row { display: flex; gap: 6px; }
.fk-row .fd-btn { flex: 1; }

/* Drawing (4.3): the marks keep their screen size through --k (mm per px, set by field.js) */
.fdr { display: flex; flex-direction: column; height: 100%; }
.fdr-bar { flex: none; display: flex; gap: 6px; padding: 6px 8px; }
.fdr-level { flex: 1; min-width: 0; min-height: 44px; border-radius: 8px; background: var(--panel-3, #2d2d31); color: var(--text, #e6e6e8);
             border: 1px solid var(--border-soft, #3a3a3d); font: inherit; padding: 0 8px; }
.fdr-z { min-width: 44px; padding: 0; font-size: 20px; }
.fdr-svg { flex: 1; min-height: 0; width: 100%; background: #f4f4f2; touch-action: none; --k: 10; }
.fdr-hint { padding: 6px 12px; font-size: 13px; color: var(--text-dim, #a8a8ad); }
.fdr-mark { cursor: pointer; }
.fdr-hit { r: calc(var(--k) * 22px); fill: transparent; }
.fdr-ring { r: calc(var(--k) * 13px); fill: none; stroke: none; }
.fdr-on .fdr-ring { stroke: #76b900; stroke-width: calc(var(--k) * 4px); }
.fdr-dot { r: calc(var(--k) * 8px); fill: var(--st-none); stroke: #222; stroke-width: calc(var(--k) * 1px); }
.fd-st-unread .fdr-dot { fill: var(--st-unread); }
.fd-st-intolerance .fdr-dot { fill: var(--st-in); }
.fd-st-outoftolerance .fdr-dot { fill: var(--st-out); }
.fd-st-finaldone .fdr-dot { fill: var(--st-final); }
.fdr-tag { font-size: calc(var(--k) * 11px); fill: #222; paint-order: stroke; stroke: #f4f4f2; stroke-width: calc(var(--k) * 3px); }
.fdr-dim { opacity: 0.25; }

/* Systems (4.4) */
.fsy { display: flex; flex-direction: column; }
.fsy-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; position: sticky; top: 0; background: var(--bg, #1b1b1c); z-index: 1; }
.fsy-up { min-width: 44px; padding: 0; font-size: 22px; }
.fsy-crumb { background: none; border: none; color: #6ea8ff; font: inherit; padding: 8px 4px; cursor: pointer; }
.fsy-sep { color: var(--text-dim, #a8a8ad); }
.fsy-sep:last-child { display: none; }
.fsy-row { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 12px; background: none; border: none;
           border-bottom: 1px solid var(--border-soft, #3a3a3d); color: var(--text, #e6e6e8); font: inherit; text-align: left; cursor: pointer; }
.fsy-row.fsy-on { background: rgba(118, 185, 0, 0.14); }
.fsy-icon { width: 20px; text-align: center; color: var(--text-dim, #a8a8ad); }
.fsy-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fsy-tag { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsy-sub, .fsy-sum { font-size: 12px; color: var(--text-dim, #a8a8ad); }
.fsy-go { font-size: 20px; color: var(--text-dim, #a8a8ad); }

/* Schedule (4.5) */
.fsc { display: flex; flex-direction: column; min-height: 100%; }
.fsc-head { display: flex; align-items: center; gap: 6px; padding: 6px 8px 0 12px; }
.fsc-title { flex: 1; font-weight: 600; font-size: 14px; }
.fsc-gear { min-width: 44px; padding: 0; }
.fsc-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px; }
.fsc-f { min-height: 40px; padding: 0 10px; font-size: 13px; }
.fsc-settings { padding: 6px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel-2, #252528); }
.fsc-set { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-dim, #a8a8ad); }
.fsc-set select { min-height: 40px; background: var(--panel-3, #2d2d31); color: var(--text, #e6e6e8); border: 1px solid var(--border-soft, #3a3a3d); border-radius: 8px; }
.fsc-lists { display: flex; flex-wrap: wrap; gap: 6px; }
.fsc-wrap { overflow-x: auto; }
.fsc-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.fsc-table th { position: sticky; top: 0; background: var(--panel-2, #252528); padding: 6px; text-align: left; font-weight: 600; }
.fsc-table td { padding: 8px 6px; border-bottom: 1px solid var(--border-soft, #3a3a3d); white-space: nowrap; }
.fsc-num { text-align: right; }
.fsc-bold td { font-weight: 600; }
.fsc-on td { background: rgba(118, 185, 0, 0.14); }
.fsc-foot { padding: 8px; }
.fi-pc-outoftolerance { color: var(--st-out); }
.fi-pc-finaldone { color: var(--st-final); }
