/* INDIA workspace theme (G1-R1).  Loaded after styles.css and goals.css: it re-tokens the shared shell and styles the chart/dashboard result.  No inline styles, no external fonts or images
 * (the page's content security policy allows only same-origin CSS).  Colours are tokens; dark mode is a selected set, not an inversion. */
:root {
  --bg: #f5f7fa; --panel: #ffffff; --ink: #121a26; --muted: #5a6575; --line: #e1e6ed; --line-strong: #c9d1dc;
  --accent: #2155c4; --accent-hover: #1a44a0; --accent-ink: #ffffff; --accent-soft: #e8efff;
  --ok: #17703a; --ok-bg: #e4f6ea; --warn: #8a5300; --warn-bg: #fff3d6; --bad: #b3261e; --bad-bg: #fde8e6; --info-bg: #e8efff; --focus: #1d4ed8;
  --radius: 12px; --radius-sm: 8px; --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06); --shadow-2: 0 4px 14px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .06);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* chart series: fixed order, validated for colour-vision differences between neighbours */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100; --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --viz-surface: #ffffff; --viz-muted: #5a6575; --viz-grid: #9aa5b5; --viz-rest: #c3cad4; --viz-ok: #cfe8d5; --viz-warn: #fbe7b5; --viz-none: #e3e6ea; --viz-bad: #f4c7c3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #151b24; --ink: #e8edf4; --muted: #9aa6b6; --line: #28313d; --line-strong: #3a4554;
    --accent: #6ea0ff; --accent-hover: #8db4ff; --accent-ink: #0b1220; --accent-soft: #17233b;
    --ok: #5fd68a; --ok-bg: #11291b; --warn: #f0b84a; --warn-bg: #2b2210; --bad: #ff8a80; --bad-bg: #2f1517; --info-bg: #14233d; --focus: #8db4ff;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 6px 18px rgba(0, 0, 0, .5);
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500; --series-5: #d55181; --series-6: #2fa12f; --series-7: #9085e9; --series-8: #e66767;
    --viz-surface: #151b24; --viz-muted: #9aa6b6; --viz-grid: #5d6b7e; --viz-rest: #4a5565; --viz-ok: #1f4a30; --viz-warn: #5a4616; --viz-none: #2d3541; --viz-bad: #5e2a29;
  }
}
body { font-family: var(--font); font-size: 15px; line-height: 1.55; letter-spacing: -.005em; -webkit-font-smoothing: antialiased; }
h2 { font-size: 24px; font-weight: 680; letter-spacing: -.02em; margin: 6px 0 14px; } h3 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; } h4 { font-size: 14px; font-weight: 650; text-transform: none; }
a { text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* shell */
header#banner { background: var(--panel); border-bottom: 1px solid var(--line); padding: 12px 24px; }
header#banner h1 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
nav#nav { background: var(--panel); border-bottom: 1px solid var(--line); padding: 8px 24px; gap: 2px; box-shadow: var(--shadow-1); }
nav#nav a { color: var(--muted); font-weight: 560; padding: 7px 14px; border-radius: 999px; transition: background .15s, color .15s; }
nav#nav a:hover { background: var(--accent-soft); color: var(--accent); }
nav#nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
main { padding: 24px; max-width: 1240px; }
section.panel, .panel { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-1); padding: 18px 20px; }

/* controls */
button, .btn { border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; padding: 8px 16px; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
button:hover:not(:disabled), .btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button:active:not(:disabled) { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
button.secondary:hover:not(:disabled), .btn.secondary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
button.linklike { background: none; border: none; color: var(--accent); font-weight: 560; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
button.linklike:hover:not(:disabled) { background: none; color: var(--accent-hover); }
input[type=text], input[type=number], input[type=password], textarea, select { border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--panel); padding: 9px 11px; transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
label { font-weight: 600; font-size: 13.5px; }
textarea#g-goal { min-height: 96px; font-size: 16px; line-height: 1.5; padding: 12px 14px; }
.goal-hint { margin-top: 6px; }
details.g-advanced { margin: 14px 0 4px; border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 8px 12px; }
details.g-advanced > summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; }
details > summary { cursor: pointer; }
fieldset { border-radius: var(--radius-sm); border-color: var(--line); }

/* data */
table { font-size: 14px; } th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 650; border-bottom: 1px solid var(--line-strong); }
td, th { padding: 8px 10px; } tbody tr:hover { background: var(--accent-soft); } td { border-bottom: 1px solid var(--line); }
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); }
.badge { border: 1px solid transparent; font-weight: 620; padding: 2px 10px; }
.badge.ok { background: var(--ok-bg); } .badge.warn { background: var(--warn-bg); } .badge.bad { background: var(--bad-bg); } .badge.info { background: var(--info-bg); } .badge.muted { background: transparent; border-color: var(--line-strong); }
.notice { border-radius: var(--radius-sm); border-left-width: 4px; }

/* ---------- result: chart and dashboard ---------- */
.viz { margin: 8px 0 20px; }
.vr-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; margin: 0 0 14px; }
.vr-title { font-size: 24px; font-weight: 700; letter-spacing: -.022em; line-height: 1.2; margin: 0 0 4px; }
.vr-sub { margin: 0; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.vr-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vr-card { margin: 0 0 14px; padding: 18px 18px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); }
.vr-cap { margin: 8px 2px 0; color: var(--muted); font-size: 12.5px; }
.viz-svg { width: 100%; max-width: none; overflow: visible; }
.viz-svg svg, .viz-chart { width: 100%; height: auto; max-width: none; display: block; font-family: var(--font); color: var(--ink); }
.viz-chart text { font-family: var(--font); }
.viz-chart .viz-mark { cursor: pointer; transition: opacity .12s; }
.viz-chart .viz-mark:hover, .viz-chart .viz-mark:focus { opacity: .78; outline: none; }
.viz-chart .viz-mark:focus-visible > * { stroke: var(--focus); stroke-width: 2.5; }
.vr-interp { font-size: 16px; line-height: 1.6; max-width: 76ch; margin: 6px 0 14px; }
.vr-interp .answer-markdown p { margin: .4rem 0; }
.vr-qual { margin: 12px 0; padding: 12px 16px 12px; background: var(--warn-bg); border: 1px solid transparent; border-left: 4px solid var(--warn); border-radius: var(--radius-sm); }
.vr-qual h4 { margin: 0 0 6px; color: var(--warn); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.vr-qual ul { list-style: none; margin: 0; padding: 0; }
.vr-qual li { display: flex; gap: 10px; align-items: flex-start; margin: 5px 0; font-size: 14px; }
.vr-qi { flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--warn); color: var(--panel); font-size: 12px; font-weight: 800; line-height: 18px; text-align: center; margin-top: 2px; }
.vr-qual li.info .vr-qi { background: var(--muted); }
.vr-evidence { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); padding: 10px 14px; }
.vr-evidence > summary { font-weight: 650; }
.vr-evidence[open] > summary { margin-bottom: 10px; }
.vr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.vr-menu { position: relative; }
.vr-menu > summary { list-style: none; } .vr-menu > summary::-webkit-details-marker { display: none; }
.vr-menu > summary::after { content: "▾"; margin-left: 8px; font-size: 11px; }
.vr-menu-body { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 14rem; display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }
.vr-menu-body button { text-align: left; border-color: transparent; background: transparent; }
.vr-custom { margin: 12px 0; padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.vr-custom[hidden] { display: none; }
.vr-custom h5 { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vr-follow-row { display: flex; gap: 8px; } .vr-follow-row input { flex: 1 1 auto; }
.vr-say.bad { margin-top: 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bad-bg); color: var(--bad); font-size: 14px; }
.seg-row { display: flex; flex-wrap: wrap; gap: 6px; }
button.seg { background: var(--panel); color: var(--ink); border: 1px solid var(--line-strong); font-weight: 560; padding: 6px 12px; border-radius: 999px; }
button.seg:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
button.seg.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.vr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; align-items: end; }
.vr-ctl { display: flex; flex-direction: column; gap: 4px; } .vr-ctl > span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.vr-why, .vr-more-opts { margin: 10px 0 0; } .vr-why ul { margin: 6px 0 0 18px; padding: 0; font-size: 13.5px; color: var(--muted); }
.viz-chips { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; margin: 10px 0 0; } .viz-chips legend { font-size: 12.5px; color: var(--muted); }
.viz-chips label { font-weight: 500; }
.vr-list { list-style: none; padding: 0; } .vr-list li { padding: 10px 14px; margin: 6px 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* dashboard */
.viz-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.viz-card { max-width: none; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.kpi-label { font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.viz-kpi { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: 4px 0 6px; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi-def { line-height: 1.35; }
.viz-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 26rem), 1fr)); gap: 16px; }
.viz-panel { padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-1); }
.viz-phead { margin-bottom: 6px; } .viz-phead strong { font-size: 14.5px; }
.viz-notes { color: var(--muted); }
.vr-filters { position: relative; } .vr-filters > summary { list-style: none; } .vr-filters > summary::-webkit-details-marker { display: none; }
.vr-filters[open] > .viz-controls { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 22rem; padding: 12px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-2); }
.viz-drill { background: var(--accent-soft); border-radius: var(--radius-sm); border-left: 4px solid var(--accent); }

@media (max-width: 720px) { main { padding: 14px; } .vr-title { font-size: 20px; } .vr-card { padding: 12px 10px 8px; } .vr-follow-row { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.vr-measures { align-items: center; margin: 0 0 10px; } .vr-h5 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vr-keys { margin: 4px 0 12px; } .vr-keys h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.vr-keys ul { list-style: none; margin: 0; padding: 0; } .vr-keys li { padding: 3px 0; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.viz-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 36rem), 1fr)); }
.vr-info { margin: 6px 0 0; } .vr-info > summary { font-size: 13px; color: var(--muted); font-weight: 600; } .vr-info ul { list-style: none; margin: 6px 0 0; padding: 0; }
.vr-info li { display: flex; gap: 10px; align-items: flex-start; margin: 5px 0; font-size: 14px; }

/* T1-A document tables */
.tbl-list { list-style: none; padding: 0; margin: .5rem 0; }
.tbl-row { margin: .6rem 0; padding: .4rem .6rem; border: 1px solid var(--line, #d0d4da); border-radius: 6px; }
.tbl-paths, .tbl-recs { border-collapse: collapse; margin: .5rem 0; font-size: .9em; }
.tbl-paths th, .tbl-paths td, .tbl-recs th, .tbl-recs td { border: 1px solid var(--line, #d0d4da); padding: .2rem .5rem; text-align: left; vertical-align: top; }
.tbl-inspect { margin: 1rem 0; padding: .6rem .8rem; border: 1px solid var(--line, #d0d4da); border-radius: 6px; }
.tbl-q { flex: 1 1 30rem; min-width: 18rem; width: 100%; max-width: 46rem; }
