/* Ceevara design system v1
   One set of tokens and components for the Citizen app (incl. My place) and the Official portal.
   Colours: India green for action, Ashoka navy for information, saffron for attention.
   All text colours meet WCAG AA on their intended surfaces in both themes. */

:root{
  /* surfaces */
  --bg:#F6F7F4; --surface:#FFFFFF; --surface-2:#F0F3EF; --surface-3:#E7ECE6; --overlay:rgba(12,18,14,.48);
  --line:#E2E6E0; --line-strong:#C9D0C7;
  /* text */
  --text:#121815; --text-2:#46505A; --text-3:#646D75; --text-inv:#FFFFFF;
  /* brand + status */
  --green:#0A6B3D; --green-hover:#085A33; --green-50:#E6F3EB; --green-100:#CBE7D6; --on-green:#FFFFFF;
  --navy:#1E3A8A; --navy-hover:#18306F; --navy-50:#EAF0FB; --navy-100:#D3DFF6; --on-navy:#FFFFFF;
  --saffron:#F28C28; --saffron-text:#A54A05; --saffron-50:#FFF2E3; --saffron-100:#FFE1C0;
  --red:#B42318; --red-50:#FDECEA; --red-100:#F9D2CD;
  --amber:#B54708; --amber-50:#FEF4E6;
  --violet:#5B3FB8; --violet-50:#F0ECFB;
  --teal:#0E7490; --teal-50:#E3F4F8;
  --wa:#25D366; --wa-dark:#075E54; --wa-bubble:#D9FDD3;
  /* status mapping (complaints) */
  --st-new:var(--saffron-text); --st-new-bg:var(--saffron-50);
  --st-assigned:var(--navy); --st-assigned-bg:var(--navy-50);
  --st-progress:var(--violet); --st-progress-bg:var(--violet-50);
  --st-resolved:var(--teal); --st-resolved-bg:var(--teal-50);
  --st-reopened:var(--red); --st-reopened-bg:var(--red-50);
  --st-verified:var(--green); --st-verified-bg:var(--green-50);
  /* shape */
  --r-xs:6px; --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:22px; --r-full:999px;
  --sh-sm:0 1px 2px rgba(16,24,20,.06),0 1px 1px rgba(16,24,20,.04);
  --sh-md:0 2px 6px rgba(16,24,20,.06),0 8px 24px rgba(16,24,20,.07);
  --sh-lg:0 12px 40px rgba(16,24,20,.16);
  --ring:0 0 0 3px color-mix(in oklab,var(--green) 35%,transparent);
  /* type */
  --font:"Mukta","Noto Sans Devanagari","Noto Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --fs-xs:12px; --fs-sm:13.5px; --fs-md:15px; --fs-base:16px; --fs-lg:18px; --fs-xl:21px; --fs-2xl:26px; --fs-3xl:32px; --fs-4xl:40px;
  --ease:cubic-bezier(.2,.7,.2,1); --dur:.18s;
  --tap:44px;
  --logo-ink:#0A6B3D; --logo-face:#FFFFFF;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0D110F; --surface:#151A17; --surface-2:#1B211E; --surface-3:#232B27; --overlay:rgba(0,0,0,.6);
  --line:#29312C; --line-strong:#3A443E;
  --text:#ECF0ED; --text-2:#B4BDB7; --text-3:#8F9993; --text-inv:#0D110F;
  --green:#3CC17E; --green-hover:#5ACF93; --green-50:#132A1D; --green-100:#1C3D2A; --on-green:#06200F;
  --navy:#93AEF5; --navy-hover:#AFC3F8; --navy-50:#18223B; --navy-100:#223154; --on-navy:#0B1530;
  --saffron:#F5A04A; --saffron-text:#F7B067; --saffron-50:#33230F; --saffron-100:#4A3216;
  --red:#F2837A; --red-50:#3A1916; --red-100:#552520;
  --amber:#F4A65B; --amber-50:#34230F;
  --violet:#B4A2F2; --violet-50:#241D3D; --teal:#5DC6DE; --teal-50:#10282E;
  --wa-bubble:#144D37;
  --sh-sm:0 1px 2px rgba(0,0,0,.4); --sh-md:0 4px 18px rgba(0,0,0,.45); --sh-lg:0 16px 48px rgba(0,0,0,.6);
  --logo-ink:#3CC17E; --logo-face:#0D110F;
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0D110F; --surface:#151A17; --surface-2:#1B211E; --surface-3:#232B27; --overlay:rgba(0,0,0,.6);
  --line:#29312C; --line-strong:#3A443E;
  --text:#ECF0ED; --text-2:#B4BDB7; --text-3:#8F9993; --text-inv:#0D110F;
  --green:#3CC17E; --green-hover:#5ACF93; --green-50:#132A1D; --green-100:#1C3D2A; --on-green:#06200F;
  --navy:#93AEF5; --navy-hover:#AFC3F8; --navy-50:#18223B; --navy-100:#223154; --on-navy:#0B1530;
  --saffron:#F5A04A; --saffron-text:#F7B067; --saffron-50:#33230F; --saffron-100:#4A3216;
  --red:#F2837A; --red-50:#3A1916; --red-100:#552520;
  --amber:#F4A65B; --amber-50:#34230F;
  --violet:#B4A2F2; --violet-50:#241D3D; --teal:#5DC6DE; --teal-50:#10282E;
  --wa-bubble:#144D37;
  --sh-sm:0 1px 2px rgba(0,0,0,.4); --sh-md:0 4px 18px rgba(0,0,0,.45); --sh-lg:0 16px 48px rgba(0,0,0,.6);
  --logo-ink:#3CC17E; --logo-face:#0D110F;
  color-scheme:dark;
}
/* larger text setting (Citizen app > Me > Text size) */
:root[data-text="lg"]{ --fs-xs:13.5px; --fs-sm:15px; --fs-md:17px; --fs-base:18px; --fs-lg:20px; --fs-xl:23px; --fs-2xl:28px; --fs-3xl:34px; }
:root[data-contrast="high"]{ --text-2:var(--text); --text-3:var(--text-2); --line:var(--line-strong); }

/* ---------- base ---------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:var(--fs-base);line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
h1,h2,h3,h4{line-height:1.15;margin:0;font-weight:700;letter-spacing:-.01em;text-wrap:balance}
p{margin:0}
a{color:var(--navy);text-underline-offset:2px}
img,svg{display:block;max-width:100%}
.ic{display:inline-block;flex:none;vertical-align:middle}
button,input,select,textarea{font:inherit;color:inherit;letter-spacing:inherit}
button{cursor:pointer;background:none;border:0;padding:0}
button:disabled{cursor:not-allowed;opacity:.5}
:focus{outline:none}
:focus-visible{outline:2px solid var(--green);outline-offset:2px;border-radius:var(--r-xs)}
::selection{background:var(--green-100)}
[hidden]{display:none!important}
.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}
.skip{position:absolute;left:12px;top:-60px;z-index:1000;background:var(--text);color:var(--surface);padding:10px 14px;border-radius:var(--r-sm);font-weight:600;transition:top var(--dur)}
.skip:focus{top:12px}
.num,.tnum{font-variant-numeric:tabular-nums}
.mono{font-family:var(--mono);font-size:.86em;letter-spacing:0}
.muted{color:var(--text-2)}.faint{color:var(--text-3)}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}

/* ---------- buttons ---------- */
.btn{--h:var(--tap);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--h);padding:0 16px;border-radius:var(--r-md);font-weight:600;font-size:var(--fs-md);line-height:1.1;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);transition:background var(--dur),border-color var(--dur),transform var(--dur),box-shadow var(--dur);text-decoration:none;white-space:nowrap;user-select:none}
.btn:hover{background:var(--surface-2)}
.btn:active{transform:translateY(1px)}
.btn .ic{width:18px;height:18px}
.btn-primary{background:var(--green);border-color:var(--green);color:var(--on-green)}
.btn-primary:hover{background:var(--green-hover);border-color:var(--green-hover)}
.btn-navy{background:var(--navy);border-color:var(--navy);color:var(--on-navy)}
.btn-navy:hover{background:var(--navy-hover)}
.btn-danger{background:var(--surface);border-color:var(--red-100);color:var(--red)}
.btn-danger:hover{background:var(--red-50)}
.btn-ghost{border-color:transparent;background:transparent}
.btn-ghost:hover{background:var(--surface-2)}
.btn-sm{--h:34px;padding:0 12px;font-size:var(--fs-sm);border-radius:var(--r-sm)}
.btn-lg{--h:52px;padding:0 22px;font-size:var(--fs-base);border-radius:var(--r-lg)}
.btn-block{display:flex;width:100%}
.btn-icon{--h:var(--tap);width:var(--h);padding:0}
.btn-icon.btn-sm{width:34px}
.link{color:var(--navy);font-weight:600;text-decoration:none;display:inline-flex;align-items:center;gap:4px}
.link:hover{text-decoration:underline}

/* ---------- form controls ---------- */
.field{display:flex;flex-direction:column;gap:6px}
.label{font-size:var(--fs-sm);font-weight:600;color:var(--text)}
.hint{font-size:var(--fs-xs);color:var(--text-3)}
.input,.select,.textarea{width:100%;min-height:var(--tap);padding:10px 12px;border:1px solid var(--line-strong);border-radius:var(--r-md);background:var(--surface);font-size:var(--fs-base);transition:border-color var(--dur),box-shadow var(--dur)}
.textarea{min-height:96px;resize:vertical;line-height:1.45}
.input:focus,.select:focus,.textarea:focus{border-color:var(--green);box-shadow:var(--ring);outline:none}
.input-icon{position:relative}.input-icon .ic{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--text-3);pointer-events:none}
.input-icon .input{padding-left:40px}
.check{display:flex;gap:10px;align-items:flex-start;cursor:pointer}
.check input{width:20px;height:20px;accent-color:var(--green);margin:2px 0 0;flex:none}
.switch{position:relative;width:46px;height:28px;border-radius:var(--r-full);background:var(--line-strong);transition:background var(--dur);flex:none}
.switch::after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:var(--sh-sm);transition:transform var(--dur) var(--ease)}
.switch[aria-checked="true"]{background:var(--green)}
.switch[aria-checked="true"]::after{transform:translateX(18px)}

/* ---------- segmented, tabs, chips ---------- */
.seg{display:inline-flex;gap:2px;padding:3px;border-radius:var(--r-md);background:var(--surface-2);border:1px solid var(--line)}
.seg button{min-height:34px;padding:0 12px;border-radius:9px;font-weight:600;font-size:var(--fs-sm);color:var(--text-2);display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.seg button[aria-pressed="true"],.seg button[aria-selected="true"]{background:var(--surface);color:var(--text);box-shadow:var(--sh-sm)}
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);overflow-x:auto;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tabs [role="tab"]{min-height:42px;padding:0 12px;font-weight:600;font-size:var(--fs-md);color:var(--text-2);border-bottom:2px solid transparent;margin-bottom:-1px;white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.tabs [role="tab"][aria-selected="true"]{color:var(--text);border-bottom-color:var(--green)}
.chip{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:0 12px;border-radius:var(--r-full);border:1px solid var(--line-strong);background:var(--surface);font-size:var(--fs-sm);font-weight:600;color:var(--text);white-space:nowrap}
.chip:hover{background:var(--surface-2)}
.chip[aria-pressed="true"]{background:var(--text);border-color:var(--text);color:var(--surface)}
.chip .ic{width:16px;height:16px}

/* ---------- badges & status ---------- */
.badge{display:inline-flex;align-items:center;gap:5px;height:22px;padding:0 8px;border-radius:var(--r-full);font-size:var(--fs-xs);font-weight:700;line-height:1;white-space:nowrap;background:var(--surface-2);color:var(--text-2)}
.badge .ic{width:13px;height:13px}
.badge-dot::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.st-new{background:var(--st-new-bg);color:var(--st-new)}
.st-assigned{background:var(--st-assigned-bg);color:var(--st-assigned)}
.st-in_progress{background:var(--st-progress-bg);color:var(--st-progress)}
.st-resolved{background:var(--st-resolved-bg);color:var(--st-resolved)}
.st-reopened{background:var(--st-reopened-bg);color:var(--st-reopened)}
.st-verified{background:var(--st-verified-bg);color:var(--st-verified)}
.b-green{background:var(--green-50);color:var(--green)}.b-navy{background:var(--navy-50);color:var(--navy)}.b-saffron{background:var(--saffron-50);color:var(--saffron-text)}.b-red{background:var(--red-50);color:var(--red)}.b-violet{background:var(--violet-50);color:var(--violet)}.b-teal{background:var(--teal-50);color:var(--teal)}
.count{min-width:20px;height:20px;padding:0 6px;border-radius:var(--r-full);background:var(--saffron);color:#1A0D00;font-size:11px;font-weight:800;display:inline-grid;place-items:center}

/* ---------- surfaces ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh-sm)}
.card-pad{padding:16px}
.card-h{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.card-h h2,.card-h h3{font-size:var(--fs-lg)}
.divider{height:1px;background:var(--line);border:0;margin:0}
.avatar{width:36px;height:36px;border-radius:50%;display:inline-grid;place-items:center;font-weight:700;font-size:13px;background:var(--navy-50);color:var(--navy);flex:none;overflow:hidden}
.avatar-sm{width:28px;height:28px;font-size:11px}.avatar-lg{width:52px;height:52px;font-size:18px}
.tile-ic{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;flex:none}
.tile-ic .ic{width:22px;height:22px}

/* list rows */
.rows{display:flex;flex-direction:column}
.row-item{display:flex;align-items:center;gap:12px;width:100%;min-height:60px;padding:12px 16px;text-align:left;border-bottom:1px solid var(--line);background:transparent;color:inherit;text-decoration:none}
.row-item:last-child{border-bottom:0}
.row-item:hover{background:var(--surface-2)}
.row-item .grow{flex:1;min-width:0}
.row-item .t{font-weight:600;font-size:var(--fs-md);line-height:1.3;display:block}
.row-item .s{font-size:var(--fs-sm);color:var(--text-2);display:block;margin-top:2px}
.row-item>.ic:last-child{color:var(--text-3)}

/* timeline / stepper */
.timeline{list-style:none;margin:0;padding:0}
.timeline li{position:relative;display:grid;grid-template-columns:24px 1fr;gap:12px;padding-bottom:18px}
.timeline li::before{content:"";position:absolute;left:11px;top:24px;bottom:2px;width:2px;background:var(--line)}
.timeline li:last-child{padding-bottom:0}.timeline li:last-child::before{display:none}
.timeline li.done::before{background:var(--green)}
.timeline .dot{width:24px;height:24px;border-radius:50%;border:2px solid var(--line-strong);background:var(--surface);display:grid;place-items:center;z-index:1}
.timeline .dot .ic{width:13px;height:13px}
.timeline li.done .dot{background:var(--green);border-color:var(--green);color:var(--on-green)}
.timeline li.now .dot{border-color:var(--green);box-shadow:0 0 0 4px var(--green-50)}
.timeline li.now .dot::after{content:"";width:8px;height:8px;border-radius:50%;background:var(--green)}
.timeline li.bad .dot{background:var(--red);border-color:var(--red);color:#fff}
.timeline b{display:block;font-size:var(--fs-md)}
.timeline small{display:block;color:var(--text-2);font-size:var(--fs-sm)}
.timeline time{font-size:var(--fs-xs);color:var(--text-3)}

/* progress */
.progress{height:8px;border-radius:var(--r-full);background:var(--surface-3);overflow:hidden}
.progress>span{display:block;height:100%;border-radius:inherit;background:var(--green);transition:width .4s var(--ease)}

/* sheet / dialog / toast */
.scrim{position:fixed;inset:0;background:var(--overlay);z-index:80;animation:fade .18s var(--ease)}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:81;background:var(--surface);border-radius:var(--r-xl) var(--r-xl) 0 0;box-shadow:var(--sh-lg);padding:8px 16px calc(16px + env(safe-area-inset-bottom,0px));max-height:88vh;overflow:auto;animation:up .24s var(--ease)}
.sheet .grab{width:40px;height:5px;border-radius:3px;background:var(--line-strong);margin:4px auto 12px}
@media (min-width:720px){ .sheet{left:50%;right:auto;bottom:auto;top:50%;transform:translate(-50%,-50%);width:min(520px,calc(100vw - 32px));border-radius:var(--r-xl);animation:pop .2s var(--ease)} .sheet .grab{display:none} }
.toast{position:fixed;left:50%;bottom:calc(88px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:90;background:var(--text);color:var(--surface);padding:12px 16px;border-radius:var(--r-md);box-shadow:var(--sh-lg);font-size:var(--fs-md);font-weight:500;display:flex;align-items:center;gap:10px;max-width:calc(100vw - 32px);animation:up .22s var(--ease)}
.toast .ic{color:var(--green-100)}
@keyframes fade{from{opacity:0}}
@keyframes up{from{transform:translateY(16px);opacity:0}}
@keyframes pop{from{transform:translate(-50%,-46%);opacity:0}}
@keyframes pulse{0%{box-shadow:0 0 0 0 color-mix(in oklab,var(--green) 45%,transparent)}100%{box-shadow:0 0 0 12px transparent}}
@keyframes shimmer{to{background-position:-200% 0}}
.skeleton{background:linear-gradient(90deg,var(--surface-2) 25%,var(--surface-3) 50%,var(--surface-2) 75%);background-size:200% 100%;animation:shimmer 1.4s linear infinite;border-radius:var(--r-sm)}

/* empty states */
.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:32px 16px;color:var(--text-2)}
.empty .tile-ic{width:56px;height:56px;border-radius:18px;background:var(--surface-2);color:var(--text-3)}

/* keyboard hint */
.kbd{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 5px;border:1px solid var(--line-strong);border-bottom-width:2px;border-radius:5px;font-family:var(--mono);font-size:11px;color:var(--text-2);background:var(--surface)}

/* demo strip (shared top bar for the demo only, not part of the products) */
.demo-strip{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:6px max(16px,env(safe-area-inset-right,0px)) 6px max(16px,env(safe-area-inset-left,0px));background:#121614;color:#E8ECE9;font-size:13.5px}
.demo-strip b{font-weight:700;letter-spacing:.01em}
.demo-strip nav{display:flex;gap:2px;flex-wrap:wrap}
.demo-strip a{color:inherit;text-decoration:none;padding:4px 10px;border-radius:7px;opacity:.72;min-height:30px;display:inline-flex;align-items:center}
.demo-strip a:hover{opacity:1;background:rgba(255,255,255,.08)}
.demo-strip a[aria-current="page"]{background:rgba(255,255,255,.14);opacity:1}
.demo-strip .sp{flex:1}
@media (max-width:640px){ .demo-strip{flex-wrap:nowrap;gap:6px;padding-top:4px;padding-bottom:4px} .demo-strip>b{display:none} .demo-strip nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;flex:1;min-width:0} .demo-strip nav::-webkit-scrollbar{display:none} .demo-strip a{white-space:nowrap;padding:3px 8px;min-height:28px} .demo-strip .sp{display:none} .demo-strip button{white-space:nowrap} }
.demo-strip button{color:inherit;opacity:.72;font-size:13px;min-height:30px;padding:0 8px;border-radius:7px}
.demo-strip button:hover{opacity:1;background:rgba(255,255,255,.08)}
.demo-strip .theme-btn{width:32px;padding:0;display:inline-grid;place-items:center}
.demo-strip .theme-btn .ic{width:16px;height:16px}
