/* ════════════════════════════════════════════════════════════
   Fursarada v2 — project wizard styles (dark default; light overrides in theme.css)
   Works on top of materialize.min.css + styles.css
   ════════════════════════════════════════════════════════════ */

:root {
    --v2-bg: var(--bg, #1A2B36);
    --v2-surface: var(--surface, #1D4D68);
    --v2-surface-2: #163d53;
    --v2-surface-3: #12303f;
    --v2-text: var(--text, #E0F4FF);
    --v2-muted: rgba(224, 244, 255, 0.68);
    --v2-border: rgba(140, 182, 207, 0.32);
    --v2-border-strong: rgba(184, 229, 255, 0.6);
    --v2-accent: var(--accent, #B8E5FF);
    --v2-focus: #ffd54f;
    --v2-success: #7ee2a8;
    --v2-success-bg: rgba(46, 160, 98, 0.22);
    --v2-warn: #ffcf5c;
    --v2-warn-bg: rgba(214, 158, 0, 0.2);
    --v2-danger: #ff8a80;
    --v2-danger-bg: rgba(229, 57, 53, 0.22);
    --v2-info: #8fd0ff;
    --v2-info-bg: rgba(66, 165, 245, 0.18);
    --v2-shadow: 4px 4px 0 rgba(140, 182, 207, 0.35);
    --v2-radius: 0px;
    --paper-desk: #3b4b56;
}

/* ── Base helpers ── */
.v2-sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.v2-skip-link { position: absolute; left: 8px; top: -60px; z-index: 100000; background: var(--v2-focus); color: #000 !important; padding: 8px 14px; font-weight: 700; }
.v2-skip-link:focus { top: 8px; }
.v2-muted { color: var(--v2-muted) !important; }
.v2-small { font-size: 0.86rem; }
.v2-nowrap { white-space: nowrap; }
.v2-spacer { flex: 1 1 auto; }
.v2-mono, .v2-code { font-family: Consolas, "Courier New", monospace; }
.v2-code { background: rgba(255,255,255,0.08); padding: 1px 5px; font-size: 0.82rem; word-break: break-all; }
.v2-pre { white-space: pre-wrap; background: var(--v2-surface-3); padding: 12px; border: 1px solid var(--v2-border); font-family: inherit; }
.v2-text-danger { color: var(--v2-danger) !important; }
.v2-text-warn { color: var(--v2-warn) !important; }
.v2-text-success { color: var(--v2-success) !important; }
.v2-link { background: none; border: 0; padding: 0; color: var(--v2-text); text-decoration: underline; cursor: pointer; text-align: left; font: inherit; }
.v2-page .hidden { display: none !important; }
[hidden] { display: none !important; }

.v2-page :focus-visible { outline: 3px solid var(--v2-focus) !important; outline-offset: 2px; }
.v2-page .btn, .v2-page .btn-small, .v2-page .btn-flat { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.v2-page .btn-flat { color: var(--v2-text) !important; }
.v2-page .btn[disabled], .v2-page .btn-small[disabled], .v2-page .btn-flat[disabled] { opacity: .45; transform: none !important; box-shadow: none !important; cursor: not-allowed; }
.v2-page .btn .material-icons, .v2-page .btn-small .material-icons, .v2-page .btn-flat .material-icons { font-size: 1.15rem; line-height: 1; margin: 0; }
.v2-btn-danger { background-color: var(--v2-danger) !important; color: #1a0000 !important; border-color: var(--v2-danger) !important; }
.v2-btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.v2-icon-btn { background: transparent; border: 1px solid transparent; color: var(--v2-text); width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.v2-icon-btn:hover { border-color: var(--v2-border-strong); background: rgba(255,255,255,0.06); }
.v2-icon-btn[disabled] { opacity: .3; cursor: default; }
.v2-icon-btn .material-icons { font-size: 20px; }
.v2-spin { animation: spinner-border .8s linear infinite; }

/* ── Header ── */
.v2-project-header { background: var(--v2-bg); border-bottom: 2px solid var(--v2-border); padding: 18px 0 14px; }
.v2-header-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.v2-back-link { display: inline-flex; align-items: center; gap: 4px; font-size: .95rem; color: var(--v2-muted) !important; text-decoration: none; }
.v2-back-link:hover { color: var(--v2-text) !important; text-decoration: underline; }
.v2-back-link .material-icons { font-size: 18px; }
.v2-project-header .project-title { font-size: clamp(1.4rem, 2.6vw, 2.1rem); margin: 6px 0 8px; line-height: 1.2; font-weight: 700; }
.v2-header-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v2-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border: 1px solid var(--v2-border); background: rgba(255,255,255,0.05); font-size: .85rem; line-height: 1.6; white-space: nowrap; }
.v2-chip .material-icons { font-size: 16px; }
.v2-chip-btn { cursor: pointer; color: var(--v2-text); font: inherit; font-size: .85rem; }
.v2-chip-btn:hover { border-color: var(--v2-border-strong); background: rgba(255,255,255,0.1); }
.v2-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 12px; }
.v2-deadline { display: inline-flex; align-items: center; gap: 4px; font-size: .9rem; padding: 2px 10px; border: 1px solid var(--v2-border); }
.v2-deadline .material-icons { font-size: 17px; }
.v2-deadline-ok { border-color: var(--v2-border); }
.v2-deadline-soon { border-color: var(--v2-warn); color: var(--v2-warn); }
.v2-deadline-urgent { border-color: var(--v2-danger); color: var(--v2-danger); background: var(--v2-danger-bg); }
.v2-deadline-past { border-color: var(--v2-muted); color: var(--v2-muted); text-decoration: line-through; }
small.v2-deadline-soon, small.v2-deadline-urgent, small.v2-deadline-past { border: 0; padding: 0; background: none; }

/* ── Main + stepper ── */
.v2-main { padding-top: 16px !important; }
.v2-main:focus { outline: none; }
.v2-stepper-nav { margin: 6px 0 18px; overflow-x: auto; scrollbar-width: thin; }
.v2-stepper { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: step; min-width: max-content; }
.v2-stepper li { flex: 1 1 0; position: relative; min-width: 108px; }
.v2-stepper li + li::before { content: ""; position: absolute; top: 19px; left: -50%; right: 50%; height: 2px; background: var(--v2-border); z-index: 0; }
.v2-stepper li.done + li::before, .v2-stepper li.reached::before { background: var(--v2-accent); }
.v2-stepper button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; background: none; border: 0; color: var(--v2-muted); cursor: pointer; padding: 2px 4px 6px; font: inherit; }
.v2-step-dot { width: 38px; height: 38px; border: 2px solid var(--v2-border-strong); background: var(--v2-bg); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--v2-text); transition: transform .15s ease; }
.v2-step-dot .material-icons { font-size: 20px; }
.v2-step-label { font-size: .88rem; text-align: center; line-height: 1.2; }
.v2-stepper li.done .v2-step-dot { background: var(--v2-surface); border-color: var(--v2-accent); }
.v2-stepper li.reached .v2-step-dot { border-color: var(--v2-accent); box-shadow: 0 0 0 3px rgba(184,229,255,0.18); }
.v2-stepper li.current .v2-step-dot { background: var(--v2-text); color: var(--v2-bg); border-color: var(--v2-text); box-shadow: var(--v2-shadow); }
.v2-stepper li.current .v2-step-dot .material-icons { color: var(--v2-bg) !important; }
.v2-stepper li.current button, .v2-stepper button:hover { color: var(--v2-text); }
.v2-stepper button:hover .v2-step-dot { transform: translateY(-2px); }

/* ── Step chrome ── */
.v2-step-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.v2-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; color: var(--v2-muted); margin: 0 0 2px; }
.v2-page h2.v2-step-title { font-size: clamp(1.35rem, 2.2vw, 1.8rem); margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-weight: 700; line-height: 1.2; }
.v2-step-title:focus, .v2-page [tabindex="-1"]:focus-visible { outline: none !important; }
.v2-step-desc { margin: 0; color: var(--v2-muted); max-width: 70ch; }
.v2-step-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-step-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 24px 0 8px; padding-top: 14px; border-top: 1px solid var(--v2-border); }
.v2-step-foot-right { display: flex; gap: 8px; flex-wrap: wrap; }
.v2-step-container { min-height: 40vh; }

/* ── Cards ── */
.v2-card { background: var(--v2-surface); border: 1px solid var(--v2-border); margin: 0 0 16px; box-shadow: var(--v2-shadow); }
.v2-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--v2-border); flex-wrap: wrap; }
.v2-page .v2-card-head h3 { font-size: 1.12rem; margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 700; line-height: 1.3; }
.v2-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.v2-card-body { padding: 14px 16px; }
.v2-card-body > :last-child { margin-bottom: 0; }
.v2-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.v2-grid-2 > * > .v2-card { height: calc(100% - 16px); }
.v2-subhead, .v2-h4 { font-size: 1rem !important; font-weight: 700; margin: 18px 0 8px !important; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.v2-subhead .material-icons, .v2-h4 .material-icons { font-size: 19px; }
.v2-row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.v2-row-inline { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.v2-prose p { margin: 0 0 .7em; line-height: 1.6; max-width: 80ch; }
.v2-plain-list { margin: 0; padding: 0; list-style: none; }
.v2-plain-list li { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0; }

/* ── Badges ── */
.v2-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; font-size: .78rem; font-weight: 700; line-height: 1.6; border: 1px solid var(--v2-border-strong); background: rgba(255,255,255,0.06); white-space: nowrap; vertical-align: middle; }
.v2-badge[data-size="lg"] { font-size: 1rem; padding: 4px 12px; }
.v2-badge-success, [class*="v2-badge-"][class*="-done"], [class*="v2-badge-"][class*="-final"], [class*="v2-badge-"][class*="-approved"], [class*="v2-badge-"][class*="-verified"], [class*="v2-badge-"][class*="-addressed"], [class*="v2-badge-"][class*="-won"], [class*="v2-badge-"][class*="-confirmed"], [class*="v2-badge-"][class*="-uploaded"], [class*="v2-badge-"][class*="-responded"], [class*="v2-badge-"][class*="-submitted"], [class*="v2-badge-"][class*="-received"], [class*="v2-badge-"][class*="-sent"], [class*="v2-badge-"][class*="-closed"] { border-color: var(--v2-success); color: var(--v2-success); background: var(--v2-success-bg); }
.v2-badge-warn, [class*="v2-badge-"][class*="-pending"], [class*="v2-badge-"][class*="-planned"], [class*="v2-badge-"][class*="-drafted"], [class*="v2-badge-"][class*="-stale"], [class*="v2-badge-"][class*="-needs_input"], [class*="v2-badge-"][class*="-internal_review"], [class*="v2-badge-"][class*="-client_review"], [class*="v2-badge-"][class*="-requested"], [class*="v2-badge-"][class*="-in_progress"], [class*="v2-badge-"][class*="-responding"], [class*="v2-badge-"][class*="-medium"], [class*="v2-badge-"][class*="-draft"] { border-color: var(--v2-warn); color: var(--v2-warn); background: var(--v2-warn-bg); }
.v2-badge-danger, [class*="v2-badge-"][class*="-failed"], [class*="v2-badge-"][class*="-gap"], [class*="v2-badge-"][class*="-lost"], [class*="v2-badge-"][class*="-rejected"], [class*="v2-badge-"][class*="-missing"], [class*="v2-badge-"][class*="-high"], [class*="v2-badge-"][class*="-critical"], [class*="v2-badge-"][class*="-cancellation"], [class*="v2-badge-"][class*="-rejection"] { border-color: var(--v2-danger); color: var(--v2-danger); background: var(--v2-danger-bg); }
.v2-badge-info, .v2-badge-stage, [class*="v2-badge-"][class*="-generating"], [class*="v2-badge-"][class*="-open"], [class*="v2-badge-"][class*="-new"], [class*="v2-badge-"][class*="-first_draft"], [class*="v2-badge-"][class*="-mvp"] { border-color: var(--v2-info); color: var(--v2-info); background: var(--v2-info-bg); }
.v2-badge-stage { background: var(--v2-text); color: var(--v2-bg); border-color: var(--v2-text); }
.v2-count { display: inline-block; min-width: 20px; padding: 0 6px; font-size: .75rem; font-weight: 700; background: var(--v2-danger); color: #1a0000; border-radius: 10px; text-align: center; }
.v2-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.v2-dot-red { background: var(--v2-danger); } .v2-dot-amber { background: var(--v2-warn); } .v2-dot-green { background: var(--v2-success); }

/* ── Notices / empty / loading ── */
.v2-notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--v2-border); border-left-width: 5px; margin: 0 0 14px; background: rgba(255,255,255,0.04); }
.v2-notice > .material-icons { font-size: 24px; flex: 0 0 auto; margin-top: 1px; }
.v2-notice > div { flex: 1 1 auto; min-width: 0; }
.v2-notice p { margin: 2px 0 6px; }
.v2-notice p:last-child { margin-bottom: 0; }
.v2-notice .btn, .v2-notice .btn-small { margin-top: 4px; }
.v2-notice-info { border-color: var(--v2-info); background: var(--v2-info-bg); }
.v2-notice-warn { border-color: var(--v2-warn); background: var(--v2-warn-bg); }
.v2-notice-error { border-color: var(--v2-danger); background: var(--v2-danger-bg); }
.v2-notice-success { border-color: var(--v2-success); background: var(--v2-success-bg); }
.v2-notice-inline { display: inline-flex; margin: 6px 0; padding: 6px 10px; }
.v2-legacy-banner .v2-notice, #v2-legacy-banner .v2-notice { align-items: center; }
#v2-legacy-banner .v2-notice > .btn { flex: 0 0 auto; }
.v2-empty { text-align: center; padding: 26px 12px; color: var(--v2-muted); }
.v2-empty > .material-icons { font-size: 46px; opacity: .7; }
.v2-empty p { margin: 8px auto 14px; max-width: 54ch; }
.v2-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 30px; color: var(--v2-muted); }
.v2-error-text { color: var(--v2-danger); }

/* ── Forms ── */
.v2-form, .v2-form-grid { display: grid; gap: 12px; }
.v2-form-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 6px 0 4px; }
.v2-span-2 { grid-column: 1 / -1; }
.v2-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v2-field > label, .v2-field > .v2-label, .v2-inline-field > span, .v2-fieldset > legend { font-size: .9rem; color: var(--v2-text) !important; font-weight: 600; }
.v2-static-value { margin: 0; padding: 6px 0; color: var(--v2-text); }
.v2-field-inline { flex-direction: row; align-items: center; gap: 8px; max-width: 420px; }
.v2-inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; }
.v2-help { color: var(--v2-muted); font-size: .8rem; line-height: 1.35; display: block; }
.v2-page .v2-input, .v2-page input.v2-input.browser-default, .v2-page select.v2-input, .v2-page textarea.v2-input {
    width: 100%; background: var(--v2-surface-3) !important; color: var(--v2-text) !important; border: 1px solid var(--v2-border) !important;
    border-radius: var(--v2-radius); padding: 7px 9px; font: inherit; font-size: .95rem; height: auto; min-height: 36px; margin: 0; box-shadow: none !important; box-sizing: border-box;
}
.v2-page textarea.v2-input { resize: vertical; min-height: 60px; line-height: 1.45; }
.v2-page select.v2-input[multiple] { min-height: 70px; }
.v2-page .v2-input:focus { border-color: var(--v2-accent) !important; outline: 2px solid var(--v2-focus); outline-offset: 0; }
.v2-page .v2-input[disabled], .v2-page .v2-input[aria-readonly="true"] { opacity: .75; cursor: default; border-style: dashed !important; }
.v2-page .v2-input[aria-invalid="true"] { border-color: var(--v2-danger) !important; }
.v2-input-num { max-width: 100px; }
.v2-input-short { max-width: 90px; }
.v2-table-edit .v2-input-wide { min-width: 220px; }
.v2-table-edit .v2-input-mid { min-width: 120px; }
.v2-table-edit .v2-input-num { min-width: 72px; }
.v2-page .v2-input-title { font-size: 1.05rem; font-weight: 700; background: transparent !important; border-color: transparent !important; padding-left: 4px; }
.v2-page .v2-input-title:hover, .v2-page .v2-input-title:focus { border-color: var(--v2-border) !important; background: var(--v2-surface-3) !important; }
.v2-fieldset { border: 0; padding: 0; margin: 12px 0 0; min-width: 0; }

/* Checkbox / radio label pattern (materialize draws the box on the span) */
.v2-page .v2-check { display: inline-flex; align-items: flex-start; gap: 6px; cursor: pointer; color: var(--v2-text); margin: 4px 0; }
.v2-page .v2-check span { color: var(--v2-text); font-size: .95rem; }
.v2-page [type="checkbox"] + span:not(.lever)::before, .v2-page [type="checkbox"]:not(.filled-in) + span:not(.lever)::after { border-color: var(--v2-border-strong); }
.v2-page [type="checkbox"]:checked + span:not(.lever)::before { border-right-color: var(--v2-accent); border-bottom-color: var(--v2-accent); border-top-color: transparent; border-left-color: transparent; }
.v2-page [type="checkbox"]:focus-visible + span::before, .v2-page [type="radio"]:focus-visible + span { outline: 3px solid var(--v2-focus); outline-offset: 2px; }
.v2-check-block { display: flex !important; width: 100%; padding: 8px 10px; border: 1px solid var(--v2-border); background: var(--v2-surface-3); }
.v2-check-block span { display: flex; flex-direction: column; gap: 2px; }
.v2-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }

/* chip toggles / radio cards / segmented — hide materialize pseudo boxes */
.v2-chip-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-chip-toggle input, .v2-radio-card input, .v2-segmented input { position: absolute !important; opacity: 0 !important; pointer-events: none; }
.v2-page .v2-chip-toggle input + span, .v2-page .v2-radio-card input + span, .v2-page .v2-segmented input + span { padding-left: 0 !important; height: auto !important; line-height: 1.4 !important; }
.v2-page .v2-chip-toggle input + span::before, .v2-page .v2-chip-toggle input + span::after,
.v2-page .v2-radio-card input + span::before, .v2-page .v2-radio-card input + span::after,
.v2-page .v2-segmented input + span::before, .v2-page .v2-segmented input + span::after { display: none !important; }
.v2-chip-toggle span { display: inline-block; padding: 6px 14px !important; border: 1px solid var(--v2-border-strong); cursor: pointer; color: var(--v2-text) !important; font-size: .92rem !important; user-select: none; }
.v2-chip-toggle input:checked + span { background: var(--v2-text); color: var(--v2-bg) !important; border-color: var(--v2-text); }
.v2-chip-toggle input:focus-visible + span, .v2-radio-card input:focus-visible + span, .v2-segmented input:focus-visible + span { outline: 3px solid var(--v2-focus); outline-offset: 2px; }
.v2-chip-toggle input:disabled + span { cursor: default; opacity: .7; }
.v2-radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.v2-radio-card { position: relative; display: block; cursor: pointer; }
.v2-radio-card span { display: flex !important; flex-direction: column; gap: 4px; padding: 10px 12px !important; border: 1px solid var(--v2-border); background: var(--v2-surface-3); color: var(--v2-text) !important; height: 100% !important; }
.v2-radio-card small { color: var(--v2-muted); font-size: .8rem; line-height: 1.3; }
.v2-radio-card input:checked + span { border: 2px solid var(--v2-accent); box-shadow: var(--v2-shadow); background: var(--v2-surface-2); }
.v2-segmented { display: inline-flex; border: 1px solid var(--v2-border-strong); margin-top: 6px; }
.v2-segmented label { position: relative; cursor: pointer; }
.v2-segmented span { display: inline-block; padding: 7px 18px !important; color: var(--v2-text) !important; font-size: .95rem !important; }
.v2-segmented input:checked + span { background: var(--v2-text); color: var(--v2-bg) !important; font-weight: 700; }

/* switch (files step) */
.v2-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--v2-text); }
.v2-switch input { position: absolute !important; opacity: 0 !important; }
.v2-page .v2-switch input + span::before, .v2-page .v2-switch input + span::after { display: none !important; }
.v2-page .v2-switch input + span { padding-left: 0 !important; height: auto !important; }
.v2-switch-track { width: 40px; height: 22px; background: var(--v2-surface-3); border: 1px solid var(--v2-border-strong); position: relative; flex: 0 0 auto; transition: background .2s; }
.v2-switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--v2-muted); transition: transform .2s, background .2s; }
.v2-switch input:checked ~ .v2-switch-track, .v2-switch input:checked + .v2-switch-track { background: var(--v2-info-bg); border-color: var(--v2-accent); }
.v2-switch input:checked ~ .v2-switch-track::after, .v2-switch input:checked + .v2-switch-track::after { transform: translateX(18px); background: var(--v2-accent); }
.v2-switch input:focus-visible ~ .v2-switch-track { outline: 3px solid var(--v2-focus); outline-offset: 2px; }

/* ── Tables ── */
.v2-table-wrap { overflow-x: auto; margin: 6px 0 10px; border: 1px solid var(--v2-border); }
.v2-page table.v2-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.v2-page .v2-table th, .v2-page .v2-table td { padding: 8px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--v2-border); border-radius: 0; display: table-cell; }
.v2-page .v2-table thead th { background: var(--v2-surface-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--v2-muted); position: sticky; top: 0; z-index: 1; }
.v2-page .v2-table tr { border-bottom: 0; }
.v2-page .v2-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.v2-page .v2-table-edit td { padding: 6px; vertical-align: middle; }
.v2-page .v2-table th[scope="row"] { font-weight: 600; }
.v2-row-current { background: var(--v2-info-bg); }
.v2-row-warn { background: var(--v2-warn-bg); }
.v2-diff-table td.del { background: var(--v2-danger-bg); }
.v2-diff-table td.ins { background: var(--v2-success-bg); }
.v2-diff-inline ins { background: var(--v2-success-bg); text-decoration: none; color: var(--v2-success); }
.v2-diff-inline del { background: var(--v2-danger-bg); color: var(--v2-danger); }
.v2-diff-unified { background: var(--v2-surface-3); padding: 10px; overflow-x: auto; font-size: .85rem; }
.v2-diff-unified .ins { color: var(--v2-success); } .v2-diff-unified .del { color: var(--v2-danger); }
.v2-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 6px 0; }
.v2-dl dt { font-weight: 600; color: var(--v2-muted); }
.v2-dl dd { margin: 0; word-break: break-word; }
.v2-kv { margin-right: 10px; }

/* ── Dialog ── */
.v2-dialog-backdrop { position: fixed; inset: 0; background: rgba(6, 16, 22, 0.66); z-index: 10000; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 12px 12px; opacity: 0; transition: opacity .15s ease; overflow-y: auto; }
.v2-dialog-backdrop.open { opacity: 1; }
.v2-dialog { background: var(--v2-surface); color: var(--v2-text); border: 2px solid var(--v2-border-strong); box-shadow: 8px 8px 0 rgba(0,0,0,0.35); width: 100%; max-height: 88vh; display: flex; flex-direction: column; transform: translateY(8px); transition: transform .15s ease; }
.v2-dialog-backdrop.open .v2-dialog { transform: none; }
.v2-dialog-sm { max-width: 440px; } .v2-dialog-md { max-width: 620px; } .v2-dialog-lg { max-width: 880px; } .v2-dialog-xl { max-width: 1140px; }
.v2-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--v2-border); }
.v2-page .v2-dialog-title, .v2-dialog-title { font-size: 1.2rem !important; margin: 0; font-weight: 700; line-height: 1.3; }
.v2-dialog-body { padding: 14px 16px; overflow-y: auto; }
.v2-dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--v2-border); background: var(--v2-bg); flex-wrap: wrap; }

/* ── Popover ── */
.v2-popover { position: absolute; z-index: 9000; background: var(--v2-surface); color: var(--v2-text); border: 2px solid var(--v2-border-strong); box-shadow: 6px 6px 0 rgba(0,0,0,0.35); width: min(380px, calc(100vw - 16px)); padding: 12px 14px 12px; }
.v2-popover-wide { width: min(620px, calc(100vw - 16px)); }
.v2-popover:focus { outline: none; }
.v2-popover-close { position: absolute; top: 4px; right: 4px; }
.v2-popover-body { padding-right: 24px; max-height: 60vh; overflow-y: auto; }

/* ── Citations / confidence ── */
.v2-cite { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; margin-left: 4px; border: 1px solid var(--v2-border); background: rgba(255,255,255,0.04); color: var(--v2-text); cursor: pointer; vertical-align: middle; }
.v2-cite .material-icons { font-size: 15px; }
.v2-cite:hover, .v2-cite[aria-expanded="true"] { border-color: var(--v2-accent); background: var(--v2-info-bg); }
.v2-cite-manual { border-style: dashed; }
.v2-cite-manual-note { color: var(--v2-muted); font-size: .88rem; }
.v2-cite-page { margin-top: 10px; max-height: 300px; overflow-y: auto; }
.v2-page-text { white-space: pre-wrap; font-size: .85rem; background: var(--v2-surface-3); padding: 10px; border: 1px solid var(--v2-border); }
.v2-page-text mark { background: #ffe082; color: #000; }
.v2-quote { border-left: 3px solid var(--v2-accent); padding: 4px 10px; margin: 8px 0; font-style: italic; background: rgba(255,255,255,0.04); }
.v2-conf { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,0.25); }
.v2-conf-high { background: var(--v2-success); } .v2-conf-medium { background: var(--v2-warn); } .v2-conf-low { background: var(--v2-danger); }
.v2-warn-icon { color: var(--v2-warn) !important; }

/* ── Job dock ── */
.v2-job-dock { position: fixed; right: 16px; bottom: 16px; z-index: 9500; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.v2-job { background: var(--v2-surface); border: 2px solid var(--v2-border-strong); box-shadow: 6px 6px 0 rgba(0,0,0,0.35); padding: 10px 12px; }
.v2-job-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.v2-job-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v2-job-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-job-status { font-size: .8rem; color: var(--v2-muted); }
.v2-job-last { font-size: .85rem; margin: 6px 0 0; color: var(--v2-muted); overflow-wrap: anywhere; }
.v2-job-hint { font-size: .78rem; margin: 4px 0 0; color: var(--v2-muted); font-style: italic; }
.v2-job-log { max-height: 160px; overflow-y: auto; font-size: .78rem; margin: 6px 0 0; padding-left: 18px; }
.v2-job-log time { color: var(--v2-muted); margin-right: 4px; }
.v2-job-failed { border-color: var(--v2-danger); }
.v2-job-completed { border-color: var(--v2-success); }
.v2-progress { height: 6px; background: var(--v2-surface-3); margin-top: 8px; overflow: hidden; position: relative; }
.v2-progress-bar { height: 100%; background: var(--v2-accent); transition: width .3s ease; }
.v2-progress-bar.indeterminate { animation: v2-indet 1.3s ease-in-out infinite; }
@keyframes v2-indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ── Meters ── */
.v2-meter { height: 10px; background: var(--v2-surface-3); border: 1px solid var(--v2-border); flex: 1 1 auto; min-width: 80px; }
.v2-meter-sm { height: 6px; display: inline-block; width: 70px; min-width: 70px; vertical-align: middle; margin-right: 6px; }
.v2-meter-bar { height: 100%; }
.v2-meter-good { background: var(--v2-success); } .v2-meter-mid { background: var(--v2-warn); } .v2-meter-low { background: var(--v2-danger); }
.v2-meter-label { font-weight: 700; white-space: nowrap; }

/* ── Files step ── */
.v2-dropzone { border: 2px dashed var(--v2-border-strong); padding: 26px 16px; text-align: center; cursor: pointer; background: var(--v2-surface-3); transition: background .15s, border-color .15s; }
.v2-dropzone:hover, .v2-dropzone.dragover, .v2-dropzone:focus-visible { border-color: var(--v2-accent); background: var(--v2-info-bg); }
.v2-dropzone .material-icons { font-size: 42px; }
.v2-drop-help { color: var(--v2-muted); font-size: .88rem; }
.v2-file-input { display: none; }
.v2-upload-opts { display: flex; flex-wrap: wrap; gap: 14px 22px; align-items: center; margin: 12px 0; }
.v2-amend-help { color: var(--v2-muted); font-size: .82rem; }
.v2-upload-status { margin: 10px 0; }
.v2-filetree, .v2-file-list, .v2-tree { list-style: none; margin: 0; padding: 0; }
.v2-filetree ul, .v2-tree ul { list-style: none; margin: 0 0 0 22px; padding: 0; border-left: 1px dashed var(--v2-border); }
.v2-file-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--v2-border); flex-wrap: wrap; }
.v2-file-icon { font-size: 26px; flex: 0 0 auto; }
.v2-file-main { flex: 1 1 260px; min-width: 0; }
.v2-file-name { font-weight: 700; overflow-wrap: anywhere; }
.v2-file-name a { text-decoration: underline; }
.v2-file-meta, .v2-file-desc { font-size: .85rem; color: var(--v2-muted); margin: 2px 0; }
.v2-file-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.v2-file-role { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.v2-role-select { min-width: 190px; }
.v2-folder-label { display: flex; align-items: center; gap: 6px; padding: 8px 4px 4px; font-weight: 600; }
.v2-kids-toggle { margin-top: 4px; }
.v2-file-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.v2-lib-list { max-height: 50vh; overflow-y: auto; }
.v2-file-btn { position: relative; cursor: pointer; }

/* ── Call profile ── */
.cp-statusbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cp-summary { margin: 6px 0 12px; line-height: 1.6; max-width: 90ch; }
.cp-deadline { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 2px solid var(--v2-border); font-weight: 600; flex-wrap: wrap; }
.cp-deadline.v2-deadline-urgent { border-color: var(--v2-danger); background: var(--v2-danger-bg); }
.cp-deadline.v2-deadline-soon { border-color: var(--v2-warn); }
.cp-countdown { font-weight: 800; }
.cp-versions { margin: 4px 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cp-versions ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.cp-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 16px; margin: 4px 0 8px; }
.cp-field { padding: 8px 10px; background: var(--v2-surface-3); border: 1px solid var(--v2-border); position: relative; min-width: 0; }
.cp-field dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--v2-muted); margin-bottom: 2px; }
.cp-field dd { margin: 0; overflow-wrap: anywhere; }
.cp-value { white-space: pre-wrap; }
.cp-changed { border-color: var(--v2-warn) !important; box-shadow: inset 4px 0 0 var(--v2-warn); }
.cp-was { display: block; font-size: .8rem; color: var(--v2-muted); text-decoration: line-through; margin-top: 2px; }
.v2-edit-btn { position: absolute; top: 4px; right: 4px; opacity: .55; }
.cp-field:hover .v2-edit-btn, .v2-edit-btn:focus { opacity: 1; }
.cp-items, .cp-questions, .cp-conflicts { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.cp-item, .cp-questions > li { padding: 8px 10px; background: var(--v2-surface-3); border: 1px solid var(--v2-border); }
.cp-item.disq { border-left: 4px solid var(--v2-danger); }
.cp-item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.cp-item .cp-field { background: transparent; border: 0; padding: 0 30px 0 0; }
.cp-threshold { font-size: .88rem; color: var(--v2-muted); margin: 4px 0 0; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.cp-structure { margin: 0 0 10px; padding-left: 18px; }
.cp-tree { list-style: none; margin: 0; padding: 0; }
.cp-tree .cp-tree { margin-left: 22px; border-left: 1px dashed var(--v2-border); padding-left: 8px; }
.cp-crit { display: grid; grid-template-columns: minmax(48px, max-content) 1fr max-content; gap: 4px 10px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--v2-border); }
.cp-crit-ref { font-weight: 800; font-family: Consolas, monospace; }
.cp-crit-w { font-weight: 700; white-space: nowrap; }
.cp-bar { grid-column: 1 / -1; height: 4px; background: var(--v2-surface-3); display: block; }
.cp-bar > span { display: block; height: 100%; background: var(--v2-accent); }
.cp-guidance { font-size: .88rem; margin: 2px 0 6px 4px; color: var(--v2-muted); }
.cp-guidance summary { cursor: pointer; }
.cp-conflict { padding: 10px; border: 1px solid var(--v2-warn); background: var(--v2-warn-bg); }
.cp-conflict fieldset { border: 0; padding: 0; margin: 0; }
.cp-conflict.resolved { border-color: var(--v2-success); background: var(--v2-success-bg); }
.comp-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.comp-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 8px; }
.comp-filters label { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; color: var(--v2-text); }
.comp-search { min-width: 220px; flex: 1 1 220px; }
.comp-table .comp-status { min-width: 130px; }
.comp-table tr.status-gap td:first-child { box-shadow: inset 4px 0 0 var(--v2-danger); }
.comp-table tr.status-verified td:first-child, .comp-table tr.status-addressed td:first-child { box-shadow: inset 4px 0 0 var(--v2-success); }

/* ── Brief (single-document projects) ── */
.v2-brief-outline { margin: 4px 0 10px; padding-left: 22px; display: grid; gap: 6px; }
.v2-brief-outline li { line-height: 1.35; }
.v2-brief-outline li::marker { color: var(--v2-muted); font-weight: 700; }

/* ── Strategy ── */
.v2-fit-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.v2-fit-score { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; }
.v2-qlist { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.v2-q label { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; color: var(--v2-text); font-size: .95rem; }
.v2-q.answered > label::after { content: "✓"; color: var(--v2-success); font-weight: 800; }
.v2-gap-list { list-style: none; margin: 4px 0 0; padding: 0; font-size: .82rem; color: var(--v2-warn); }
.v2-gap-list li { display: flex; gap: 4px; align-items: flex-start; }
.v2-gap-list .material-icons { font-size: 15px; color: var(--v2-warn) !important; }
.v2-theme-item { border: 1px solid var(--v2-border); padding: 10px 12px; margin-bottom: 10px; background: var(--v2-surface-3); display: grid; gap: 8px; }
.v2-theme-head { display: flex; gap: 10px; align-items: flex-end; }
.v2-theme-head .v2-field { flex: 1 1 auto; }
.v2-theme-num { width: 30px; height: 30px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; background: var(--v2-text); color: var(--v2-bg); font-weight: 800; margin-bottom: 3px; }
.v2-theme-tools { display: flex; gap: 2px; }

/* ── Plan ── */
.v2-plan-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.v2-plan-item { border: 1px solid var(--v2-border); background: var(--v2-surface); box-shadow: var(--v2-shadow); transition: box-shadow .15s, opacity .15s; }
.v2-plan-item.open { border-color: var(--v2-border-strong); }
.v2-plan-item.dragging { opacity: .45; }
.v2-plan-item.drop-before { box-shadow: 0 -4px 0 var(--v2-focus); }
.v2-plan-item.drop-after { box-shadow: 0 4px 0 var(--v2-focus); }
.v2-plan-item-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.v2-drag-handle { cursor: grab; color: var(--v2-muted); display: inline-flex; }
.v2-drag-handle:active { cursor: grabbing; }
.v2-plan-num { width: 28px; height: 28px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--v2-border-strong); font-weight: 800; }
.v2-plan-title { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.v2-plan-badges { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 4px; }
.v2-plan-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.v2-plan-item-body { padding: 4px 14px 14px; border-top: 1px solid var(--v2-border); }
.v2-sections-table tr.v2-sec-l2 td:first-child { padding-left: 22px; }
.v2-sections-table tr.v2-sec-l3 td:first-child { padding-left: 38px; }
.v2-sections-table tr.v2-sec-l4 td:first-child { padding-left: 54px; }
.v2-sections-table td:first-child { min-width: 220px; }
.v2-sections-table td:nth-child(6) { min-width: 120px; }
.v2-sections-table td:nth-child(7) { min-width: 200px; }

/* ── Drafting ── */
.v2-draft-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.v2-draft-list { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; border: 1px solid var(--v2-border); background: var(--v2-surface); padding: 10px; }
/* a single document: the list becomes a strip above the workspace so the paper gets the full width */
.v2-draft-layout.v2-draft-single { grid-template-columns: minmax(0, 1fr); }
.v2-draft-single .v2-draft-list { position: static; max-height: none; }
.v2-draft-single .v2-draft-list ul { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
/* the drafting step uses a wider page so the preview can show a true A4 width beside the outline (desktop only) */
@media (min-width: 1101px) {
    .v2-page:has(.v2-draft-layout) .v2-main.container,
    .v2-page:has(.v2-draft-layout) .v2-header-inner.container { width: min(95%, 1720px); max-width: none; }
}
.v2-page .v2-list-title { font-size: 1rem !important; margin: 2px 4px 8px !important; font-weight: 700; }
.v2-draft-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.v2-doc-link { width: 100%; text-align: left; background: transparent; border: 1px solid transparent; color: var(--v2-text); padding: 8px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; font: inherit; }
.v2-doc-link:hover { background: rgba(255,255,255,0.05); border-color: var(--v2-border); }
.v2-doc-link.active { background: var(--v2-surface-3); border-color: var(--v2-accent); box-shadow: inset 4px 0 0 var(--v2-accent); }
.v2-doc-link-name { display: flex; gap: 6px; align-items: flex-start; font-weight: 600; overflow-wrap: anywhere; }
.v2-doc-link-name .material-icons { font-size: 18px; margin-top: 2px; }
.v2-doc-link-meta { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 24px; }
.v2-draft-main { min-width: 0; border: 1px solid var(--v2-border); background: var(--v2-surface); padding: 14px; min-height: 50vh; }
.v2-doc-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 10px; }
.v2-page .v2-doc-title { font-size: 1.3rem !important; margin: 0 0 6px !important; display: flex; align-items: center; gap: 8px; font-weight: 700; line-height: 1.25; }
.v2-doc-title:focus { outline: none; }
.v2-doc-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.v2-doc-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v2-download { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--v2-border-strong); padding: 2px 4px 2px 8px; }
.v2-dl-link { padding: 4px 8px; font-weight: 700; font-size: .82rem; text-decoration: none; }
.v2-dl-link:hover { background: var(--v2-text); color: var(--v2-bg) !important; }
.v2-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--v2-border); margin: 10px 0 12px; overflow-x: auto; }
.v2-tabs [role="tab"] { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--v2-muted); padding: 9px 14px; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; margin-bottom: -2px; }
.v2-tabs [role="tab"]:hover { color: var(--v2-text); }
.v2-tabs [role="tab"][aria-selected="true"] { color: var(--v2-text); border-bottom-color: var(--v2-accent); }
.v2-tabpanel { min-height: 200px; }
.v2-preview-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 14px; align-items: start; }
.v2-preview-layout:has(> .v2-paper-host:only-child) { grid-template-columns: 1fr; }
/* outline + a full 210mm page need ~1060px; below that the outline stacks above the paper instead of squeezing it */
.v2-draft-main .v2-tabpanel { container-type: inline-size; }
@container (max-width: 1060px) {
    .v2-preview-layout { grid-template-columns: 1fr; }
    .v2-preview-layout .v2-outline { position: static; max-height: 220px; }
}
.v2-outline { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; font-size: .88rem; border: 1px solid var(--v2-border); padding: 8px; background: var(--v2-surface-3); }
/* the outline is a <nav>: undo Materialize's global nav styles (fixed height/line-height, colours, tall icons) */
nav.v2-outline { height: auto; line-height: 1.4; color: inherit; box-shadow: none; width: auto; }
nav.v2-outline i, nav.v2-outline [class^="mdi-"], nav.v2-outline i.material-icons { height: auto; line-height: 1; display: inline-block; font-size: 16px; }
nav.v2-outline ul a, nav.v2-outline a { color: inherit; display: inline; padding: 0; }
.v2-page .v2-outline h4 { font-size: .85rem !important; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 6px !important; color: var(--v2-muted); }
.v2-outline ol { list-style: none; margin: 0; padding: 0; }
.v2-outline li { display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.v2-outline li .v2-link { flex: 1 1 auto; text-decoration: none; padding: 3px 2px; }
.v2-outline li .v2-link:hover { text-decoration: underline; }
.v2-outline-d1 { padding-left: 12px !important; } .v2-outline-d2 { padding-left: 24px !important; } .v2-outline-d3 { padding-left: 36px !important; }
.v2-outline-tools { display: inline-flex; opacity: .5; }
.v2-outline li:hover .v2-outline-tools, .v2-outline-tools:focus-within { opacity: 1; }
.v2-outline-tools .v2-icon-btn { width: 26px; height: 26px; }
.v2-outline-tools .material-icons { font-size: 16px; }
.v2-paper-host { min-width: 0; }
.v2-block-edit { border: 1px solid var(--v2-border); padding: 8px 10px; margin-bottom: 8px; background: var(--v2-surface-3); display: grid; gap: 6px; }
.v2-block-tools { display: flex; align-items: center; gap: 2px; }
.v2-block-tools .v2-badge { margin-right: auto; }
.v2-slot-table th[scope="row"] { min-width: 200px; max-width: 340px; }
.v2-needs-user { background: var(--v2-warn-bg); }
.v2-needs-user th[scope="row"] { box-shadow: inset 4px 0 0 var(--v2-warn); }
.v2-sign-panel { margin-top: 16px; }
.v2-score-head { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.v2-score-big { font-size: 2.6rem; font-weight: 800; line-height: 1; }
.v2-issue-list, .v2-claim-list, .v2-gate-list, .v2-req-list, .v2-msg-list, .v2-answer-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.v2-issue { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--v2-border); border-left-width: 4px; background: var(--v2-surface-3); }
.v2-issue p { margin: 0 0 3px; }
.v2-issue-block { border-left-color: var(--v2-danger); } .v2-issue-warn { border-left-color: var(--v2-warn); } .v2-issue-info { border-left-color: var(--v2-info); }
.v2-claim { padding: 10px; border: 1px solid var(--v2-border); background: var(--v2-surface-3); }
.v2-claim blockquote { margin: 0 0 8px; padding-left: 10px; border-left: 3px solid var(--v2-accent); font-style: italic; }
.v2-claim-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v2-claim-approved { border-color: var(--v2-success); } .v2-claim-rejected { border-color: var(--v2-danger); opacity: .8; }

/* ── Submission ── */
.v2-rag { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 2px solid var(--v2-border); margin-bottom: 10px; }
.v2-rag p { margin: 2px 0 0; }
.v2-rag-light { width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 4px rgba(255,255,255,0.08), 0 0 18px currentColor; }
.v2-rag-red { border-color: var(--v2-danger); background: var(--v2-danger-bg); color: var(--v2-danger); } .v2-rag-red .v2-rag-light { background: var(--v2-danger); }
.v2-rag-amber { border-color: var(--v2-warn); background: var(--v2-warn-bg); color: var(--v2-warn); } .v2-rag-amber .v2-rag-light { background: var(--v2-warn); }
.v2-rag-green { border-color: var(--v2-success); background: var(--v2-success-bg); color: var(--v2-success); } .v2-rag-green .v2-rag-light { background: var(--v2-success); }
.v2-rag strong { color: var(--v2-text); font-size: 1.05rem; } .v2-rag p { color: var(--v2-text); }
.v2-gate-item { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--v2-border); border-left-width: 5px; background: var(--v2-surface-3); }
.v2-gate-item p { margin: 0 0 3px; }
.v2-gate-red { border-left-color: var(--v2-danger); } .v2-gate-amber { border-left-color: var(--v2-warn); } .v2-gate-green { border-left-color: var(--v2-success); }
.v2-gate-item.overridden { opacity: .75; border-left-style: dashed; }
.v2-gate-actions { display: flex; gap: 4px; flex-wrap: wrap; flex: 0 0 auto; }
.v2-answer { border: 1px solid var(--v2-border); background: var(--v2-surface-3); padding: 10px; }
.v2-answer.over { border-color: var(--v2-danger); }
.v2-answer-a { margin: 6px 0; line-height: 1.55; white-space: normal; }
.v2-answer-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Rounds ── */
.v2-tabs-scroll [role="tab"] .v2-badge { font-size: .7rem; }
.v2-req { border: 1px solid var(--v2-border); border-left-width: 4px; padding: 10px; background: var(--v2-surface-3); display: grid; gap: 6px; }
.v2-req-open { border-left-color: var(--v2-info); } .v2-req-drafted { border-left-color: var(--v2-warn); } .v2-req-approved, .v2-req-sent { border-left-color: var(--v2-success); }
.v2-req-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.v2-msg { border: 1px solid var(--v2-border); background: var(--v2-surface-3); }
.v2-msg-new { border-left: 4px solid var(--v2-info); }
.v2-msg-head { width: 100%; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; color: var(--v2-text); padding: 10px; cursor: pointer; text-align: left; font: inherit; flex-wrap: wrap; }
.v2-msg-head:hover { background: rgba(255,255,255,0.04); }
.v2-msg-subject { font-weight: 700; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.v2-msg-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.v2-msg-body { padding: 0 12px 12px; border-top: 1px solid var(--v2-border); }
.v2-msg-text { white-space: normal; line-height: 1.55; margin: 6px 0 10px; max-height: 320px; overflow-y: auto; padding: 8px; background: rgba(0,0,0,0.12); }
.v2-analysis { padding: 8px 10px; border-left: 3px solid var(--v2-accent); background: var(--v2-info-bg); margin-bottom: 10px; }
.v2-analysis p { margin: 0 0 4px; }
.v2-action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.v2-action-tile { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 14px; border: 1px solid var(--v2-border-strong); background: var(--v2-surface-3); color: var(--v2-text); cursor: pointer; font: inherit; transition: transform .12s, box-shadow .12s; }
.v2-action-tile:hover { transform: translate(-2px, -2px); box-shadow: var(--v2-shadow); }
.v2-action-tile .material-icons { font-size: 28px; }
.v2-action-tile small { color: var(--v2-muted); line-height: 1.35; }

/* ── Toasts (materialize) ── */
#toast-container .toast.v2-toast-error { background: #7f1d1d; color: #fff; }
#toast-container .toast.v2-toast-success { background: #14532d; color: #fff; }
#toast-container .toast.v2-toast-warn { background: #78510a; color: #fff; }

/* ── Read-only role ── */
.v2-readonly .v2-drag-handle { display: none; }

/* ── Nav extras (language/theme toggles injected by shared.js) ── */
.lang-toggle, .theme-toggle { display: inline-flex !important; align-items: center; gap: 4px; }
.lang-toggle-label { font-weight: 700; letter-spacing: .03em; }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .v2-draft-layout { grid-template-columns: 1fr; }
    .v2-draft-list { position: static; max-height: none; }
    .v2-draft-list ul { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    .v2-preview-layout { grid-template-columns: 1fr; }
    .v2-outline { position: static; max-height: 240px; }
}
@media (max-width: 860px) {
    .v2-grid-2 { grid-template-columns: 1fr; }
    .v2-grid-2 > * > .v2-card { height: auto; }
    .v2-step-label { font-size: .78rem; }
    .v2-stepper li { min-width: 84px; }
}
@media (max-width: 600px) {
    .v2-card-body { padding: 12px; }
    .v2-step-head { flex-direction: column; }
    .v2-step-actions { width: 100%; }
    .v2-plan-item-head { flex-wrap: wrap; }
    .v2-plan-tools { width: 100%; justify-content: flex-end; }
    .v2-dl { grid-template-columns: 1fr; }
    .v2-dl dd { margin-bottom: 6px; }
    .v2-dialog-backdrop { padding: 0; }
    .v2-dialog { max-height: 100vh; min-height: 100vh; }
    .v2-job-dock { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
    .v2-gate-item, .v2-issue { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .v2-page *, .v2-page *::before, .v2-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media print {
    nav, .v2-stepper-nav, .v2-step-foot, .v2-job-dock, .v2-step-actions, .v2-draft-list { display: none !important; }
}
