:root {
  color-scheme: light;
  --navy: #10253a;
  --navy-soft: #1b3952;
  --teal: #086f70;
  --teal-dark: #07595b;
  --ink: #172c40;
  --muted: #52677a;
  --line: #dbe4ea;
  --surface: #fff;
  --canvas: #f4f7fa;
  --soft: #eaf4f3;
  --shadow: 0 8px 24px rgba(16, 37, 58, .055);
  --radius: 12px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--teal-dark); }
:focus-visible { outline: 3px solid #31a6a3; outline-offset: 3px; }
::selection { background: #cceae6; color: var(--navy); }
h1, h2, h3 { color: var(--navy); line-height: 1.25; letter-spacing: -.025em; }
h1 { font-size: clamp(26px, 2.5vw, 34px); margin: 0 0 8px; font-weight: 750; }
h2 { font-size: 21px; margin: 28px 0 13px; font-weight: 700; }
h3 { font-size: 16px; margin: 18px 0 10px; }
p { color: var(--muted); margin: 8px 0 16px; }
small, .muted { color: var(--muted); }
.muted { font-size: 13px; }

/* Application shell */
.app-shell .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 252px; display: flex; flex-direction: column; gap: 20px; overflow-y: auto; background: var(--navy); color: #e5eef4; padding: 25px 15px 18px; }
.sidebar-brand { padding: 0 12px 5px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 780; letter-spacing: -.035em; text-decoration: none; }
.sidebar .brand { color: #fff; font-size: 22px; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #2bb7aa; color: var(--navy); font-size: 22px; font-weight: 800; }
.sidebar-brand small { display: block; margin: 6px 0 0 44px; color: #a9bfce; font-size: 12px; }
#navigation { display: grid; align-content: start; gap: 5px; flex: 1; }
#navigation a, #navigation summary { display: block; position: relative; padding: 10px 12px; border-radius: 8px; color: #d6e2ea; text-decoration: none; font-size: 13px; font-weight: 540; line-height: 1.3; cursor: pointer; }
#navigation a:hover, #navigation summary:hover { background: #254158; color: #fff; }
#navigation a.active { background: #234e60; color: #fff; font-weight: 700; }
#navigation a.active::before { content: ""; position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; border-radius: 3px; background: #49d4c3; }
#navigation details { margin: 2px 0; }
#navigation summary { list-style: none; color: #a9bfce; font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
#navigation summary::-webkit-details-marker { display: none; }
#navigation summary::after { content: "⌄"; float: right; font-size: 16px; line-height: 10px; letter-spacing: 0; }
#navigation details:not([open]) summary::after { transform: rotate(-90deg); }
#navigation details a { margin-left: 10px; padding-left: 16px; }
#navigation .active-group summary { color: #d8f6f1; }
.sidebar-footer { display: grid; gap: 5px; border-top: 1px solid #345066; padding: 14px 8px 0; }
.sidebar-user { color: #fff; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; margin-bottom: 5px; }
.sidebar-action { width: 100%; min-height: 38px; padding: 8px 10px; text-align: left; border: 0; border-radius: 7px; color: #d6e2ea; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.sidebar-action:hover { background: #254158; color: #fff; }
.app-main { width: min(calc(100% - 252px), 1540px); margin-left: 252px; padding: 0 34px 56px; }
.app-topbar { display: flex; align-items: center; gap: 18px; min-height: 76px; margin: 0 0 30px; border-bottom: 1px solid var(--line); }
.topbar-business { display: grid; gap: 1px; min-width: 0; }
.topbar-business small { font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.topbar-business span { color: var(--navy); font-size: 15px; font-weight: 720; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-account { display: block; max-width: 260px; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.topbar-account:hover { border-color: #9bc8c4; background: var(--soft); }
.nav-toggle, .nav-backdrop { display: none; }
#notice { position: sticky; top: 12px; z-index: 10; }

/* Shared components */
.panel, .metric, .chart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { margin: 16px 0 22px; padding: 24px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 225px), 1fr)); gap: 15px 18px; }
.narrow { max-width: 480px; }
label { display: block; margin-bottom: 12px; color: #30475a; font-size: 13px; font-weight: 630; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 6px; padding: 10px 12px; border: 1px solid #b8c8d3; border-radius: 8px; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #829eac; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 111, 112, .13); outline: 0; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--teal); vertical-align: middle; }
input[type=color] { padding: 4px; }
textarea { min-height: 86px; resize: vertical; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin: 3px 6px 3px 0; padding: 9px 16px; border: 1px solid var(--teal); border-radius: 8px; background: var(--teal); color: #fff; font-size: 13px; font-weight: 690; text-decoration: none; line-height: 1.2; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
button:hover, .button:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: #fff; }
button:active, .button:active { transform: translateY(1px); }
button.secondary, .button.secondary { color: var(--ink); background: #edf2f5; border-color: #d7e1e7; }
button.secondary:hover, .button.secondary:hover { background: #dfe9ed; border-color: #b8cbd4; }
button:disabled { opacity: .55; cursor: wait; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 10px 15px; }
.toolbar label { min-width: 170px; flex: 1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.badge, .status-badge { display: inline-block; padding: 4px 9px; border-radius: 999px; background: #e7f2ef; color: #205d55; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-badge.is-warning { background: #fff1d9; color: #81530c; }
.status-badge.is-negative { background: #fce9e6; color: #9c302b; }
.status-badge.is-neutral { background: #eaf0f4; color: #435b6e; }
.positive { color: #16704a; font-weight: 700; }
.negative { color: #a52d2d; font-weight: 700; }
.warning, .error, .success { padding: 13px 16px; margin: 12px 0; border: 1px solid; border-radius: 9px; font-size: 13px; }
.warning { color: #704e13; border-color: #ebce91; background: #fff8e8; }
.error { color: #922c29; border-color: #f0c2bc; background: #fff0ee; }
.success { color: #175f45; border-color: #b7dfc7; background: #eaf8ef; }
.empty { margin: 12px 0 20px; padding: 30px 20px; border: 1px dashed #c4d4dd; border-radius: var(--radius); background: #fbfdfe; color: var(--muted); text-align: center; }
.table-wrap { overflow: auto; max-width: 100%; margin: 14px 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e7edf1; text-align: left; vertical-align: middle; white-space: nowrap; }
th { background: #f3f7f9; color: #476071; font-size: 11px; font-weight: 750; letter-spacing: .055em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7fbfb; }
th.numeric, td.numeric { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: normal; min-width: 180px; }
.table-wrap button, .table-wrap .button { min-height: 34px; padding: 6px 10px; white-space: nowrap; }
.table-wrap input, .table-wrap select { min-width: 120px; }
details > summary { cursor: pointer; color: var(--teal); font-weight: 680; padding: 9px 0; }
details.panel > summary { color: var(--navy); font-size: 16px; }
details.panel[open] > summary { margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.quote { display: flex; flex-wrap: wrap; gap: 18px; align-items: start; }
.quote .panel { flex: 1; min-width: min(100%, 250px); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 15px; }
.metric { padding: 19px 20px; }
.metric small { display: block; margin-bottom: 11px; color: var(--muted); font-size: 12px; font-weight: 610; text-transform: capitalize; }
.metric strong { color: var(--navy); font-size: clamp(19px, 2vw, 25px); font-weight: 760; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.chart { padding: 20px; }
.chart h2, .chart h3 { margin-top: 0; }
.chart canvas { width: 100%; max-height: 290px; }
.dashboard-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.dashboard-header p { margin: 0; }
.dashboard-header .button { margin-left: auto; }
.dashboard-section { margin: 26px 0; }
.dashboard-section h2 { margin-bottom: 14px; }
code, pre { overflow-wrap: anywhere; }
pre { max-width: 100%; max-height: 230px; overflow: auto; white-space: pre-wrap; font-size: 11px; }
.code-editor { min-height: 480px; font: 13px/1.5 monospace; }

/* Account pages */
.account-page { min-height: 100vh; background: linear-gradient(145deg, #e8f3f3 0%, var(--canvas) 45%, #f6f8fa 100%); }
.account-topbar { display: flex; align-items: center; justify-content: space-between; width: min(1100px, calc(100% - 40px)); margin: auto; padding: 28px 0; }
.account-topbar .brand { color: var(--navy); font-size: 23px; }
.account-topbar .brand:hover { color: var(--teal); }
.account-topbar > a:last-child { font-size: 13px; font-weight: 650; }
.account-layout { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(0, 620px); gap: clamp(25px, 5vw, 90px); align-items: start; width: min(1100px, calc(100% - 40px)); margin: 25px auto 70px; }
.account-intro { padding: 38px 0; }
.account-intro .eyebrow { display: block; margin-bottom: 20px; color: var(--teal); font-size: 11px; font-weight: 780; letter-spacing: .16em; text-transform: uppercase; }
.account-intro h2 { font-size: clamp(27px, 3.5vw, 41px); line-height: 1.14; }
.account-intro p { max-width: 350px; line-height: 1.65; }
.account-card { width: 100%; padding: clamp(22px, 4vw, 38px); border: 1px solid #dce7eb; border-radius: 18px; background: #fff; box-shadow: 0 20px 50px rgba(16, 37, 58, .09); }
.account-card h1 { margin-bottom: 10px; }
.account-card > p { line-height: 1.65; }
.account-card .pilot-note { padding: 13px 16px; border: 1px solid #c5e2dc; border-radius: 10px; background: #f0faf7; color: #25574f; font-size: 13px; }
.account-card .pilot-note + .pilot-note { border-color: #e0e7ec; background: #f8fafb; color: var(--muted); }
.account-card .pilot-help { font-size: 13px; }
.account-content { margin: 22px 0; }
.account-content form { margin: 16px 0; }
.account-content form button { margin-top: 8px; }
.account-content > a:not(.button), .account-content details > a { display: inline-block; margin: 9px 18px 8px 0; font-size: 13px; }
.account-primary { width: 100%; min-height: 48px; font-size: 14px; }
.account-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 6px; color: var(--muted); font-size: 12px; }
.account-divider::before, .account-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.account-option { border-top: 1px solid var(--line); margin-top: 18px; }
.account-option summary { color: var(--ink); font-size: 13px; }
.account-message { min-height: 22px; }
.account-footer { padding-top: 18px; margin-top: 22px; border-top: 1px solid var(--line); font-size: 12px; }
.workspace-list { display: grid; gap: 10px; margin: 18px 0; }
.workspace-choice { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 65px; margin: 0; padding: 14px 17px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-align: left; font-size: 15px; }
.workspace-choice:hover { background: var(--soft); border-color: #8bc9c1; color: var(--navy); }
.workspace-choice::after { content: "→"; color: var(--teal); font-size: 20px; }
.account-card img { max-width: min(100%, 240px); }
.account-card code { display: block; }
.account-privacy { max-width: 780px; }
.account-page:has(.account-privacy) .account-layout { grid-template-columns: 1fr minmax(0, 780px); }
.account-job { max-width: 650px; margin: 10vh auto; padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }

@font-face { font-family: DocketTamil; src: url(/static/vendor/NotoSansTamil.ttf) format('truetype'); font-display: swap; }
html[lang=ta] body { font-family: DocketTamil, system-ui, sans-serif; }
@media (max-width: 900px) {
  .app-shell .sidebar { width: min(290px, calc(100vw - 50px)); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 12px 0 36px #10253a33; }
  .app-shell .sidebar.is-open { transform: translateX(0); }
  .app-main { width: 100%; margin-left: 0; padding: 0 22px 40px; }
  .nav-toggle { display: inline-grid; place-items: center; width: 42px; height: 42px; min-height: 42px; margin: 0; padding: 0; border: 1px solid var(--line); background: white; color: var(--navy); font-size: 19px; }
  .nav-toggle:hover { background: var(--soft); color: var(--navy); }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; z-index: 25; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: #0d1e31a6; }
  body.drawer-open { overflow: hidden; }
  .account-layout { grid-template-columns: 1fr; max-width: 670px; gap: 10px; }
  .account-intro { padding: 0; }
  .account-intro h2 { max-width: 500px; margin: 6px 0; font-size: 30px; }
  .account-intro p { max-width: none; }
  .account-page:has(.account-privacy) .account-layout { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .app-main { padding: 0 14px 32px; }
  .app-topbar { min-height: 64px; margin-bottom: 22px; gap: 10px; }
  .topbar-account { max-width: 105px; }
  .panel { padding: 17px; }
  .grid, .charts { grid-template-columns: 1fr; }
  .account-topbar, .account-layout { width: calc(100% - 28px); }
  .account-layout { margin-top: 8px; }
  .account-card { padding: 22px 18px; }
  .account-intro h2 { font-size: 27px; }
  .toolbar label { flex-basis: 100%; }
  .dashboard-header .button { width: 100%; margin-left: 0; }
  .metric { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media print { .sidebar, .app-topbar, .nav-backdrop, #notice, button, .button { display: none !important; } .app-main { width: 100%; margin: 0; padding: 0; } .panel, .table-wrap { box-shadow: none; } }
