/* CERC Grants — one stylesheet for the public page (/) and the application (/app/).
   Layout modelled on Goodstack Pro (icon rail, gradient hero, plan cards, Kanban); CERC palette and type. */
@font-face { font-family: "Draft Natural"; font-weight: 400; font-display: swap; src: url("/assets/fonts/draft-natural-regular.woff2") format("woff2"); }
@font-face { font-family: "Draft Natural"; font-weight: 700; font-display: swap; src: url("/assets/fonts/draft-natural-bold.woff2") format("woff2"); }

:root {
  --navy: #3b3a5e; --navy-dk: #27273e; --navy-2: #4b4a78; --amber: #eca327; --amber-dk: #ce8812; --amber-lt: #fdf3df;
  --green: #2e8a5f; --green-lt: #e4f4ec; --red: #d1495b; --blue: #3790ab;
  --bg: #f6f6f9; --card: #ffffff; --text: #26263a; --muted: #6b6b80; --rule: #e4e4ec; --soft: #f0eff7;
  --tint: #ecebf6; --shadow: 0 1px 2px rgba(39,39,62,.06), 0 4px 16px rgba(39,39,62,.06);
  --hero: linear-gradient(180deg, #ecebf7 0%, #f9f2e4 100%);
  --display: "Draft Natural", "Barlow", system-ui, sans-serif; --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --navy: #a9a7e6; --navy-dk: #e9e8ff; --navy-2: #8f8cd8; --amber: #f0b14a; --amber-dk: #f0b14a; --amber-lt: #3a2f1a;
  --green: #5cc493; --green-lt: #183a2a; --bg: #15151f; --card: #1f1f2c; --text: #ececf3; --muted: #a3a3b8; --rule: #33334a;
  --soft: #262636; --tint: #2a2940; --shadow: 0 1px 2px rgba(0,0,0,.3); --hero: linear-gradient(180deg, #23223a 0%, #2a2418 100%); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #a9a7e6; --navy-dk: #e9e8ff; --navy-2: #8f8cd8; --amber: #f0b14a; --amber-dk: #f0b14a; --amber-lt: #3a2f1a;
    --green: #5cc493; --green-lt: #183a2a; --bg: #15151f; --card: #1f1f2c; --text: #ececf3; --muted: #a3a3b8; --rule: #33334a;
    --soft: #262636; --tint: #2a2940; --shadow: 0 1px 2px rgba(0,0,0,.3); --hero: linear-gradient(180deg, #23223a 0%, #2a2418 100%); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--body); }
a { color: var(--navy); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
.display { font-family: var(--display); font-weight: 700; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }
html[lang="fr"] [lang="en"]:not(html), html[lang="en"] [lang="fr"]:not(html) { display: none !important; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 16px; height: 16px; }

/* buttons, inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 40px; padding: .5em 1em; border-radius: 10px;
  border: 1px solid var(--rule); background: var(--card); color: var(--text); font: 600 .95rem var(--body); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--navy-2); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #15151f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #15151f; } }
.btn.primary:hover { background: var(--navy-dk); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #27273e; }
.btn.amber:hover { background: var(--amber-dk); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { min-height: 32px; padding: .3em .7em; font-size: .85rem; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.pill { display: inline-flex; align-items: center; gap: .4em; padding: .25em .75em; border-radius: 999px; border: 1px solid var(--rule); background: var(--card); font-size: .85rem; font-weight: 600; }
input, textarea, select { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--rule); border-radius: 10px; padding: .6em .8em; width: 100%; }
input:focus, textarea:focus, select:focus, .btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }
label.f { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 .3em; }
.field { margin: 0 0 1rem; }
.badge { display: inline-flex; align-items: center; gap: .35em; padding: .2em .65em; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--soft); color: var(--muted); }
.badge.excellent { background: var(--green-lt); color: var(--green); }
.badge.good { background: var(--tint); color: var(--navy); }
.badge.possible { background: var(--amber-lt); color: var(--amber-dk); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); }

/* ---------- public page ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .7rem max(16px, calc((100vw - 1120px) / 2));
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--navy); }
.brand img { height: 34px; }
.brand b { font: 700 1.35rem var(--display); }
.topbar .sp { flex: 1; }
.lang { font-weight: 700; font-size: .85rem; }
.page { max-width: 1120px; margin: 0 auto; padding: 0 16px 64px; }
.upg-hero { text-align: center; padding: 40px 0 28px; }
.upg-hero .pill { color: var(--navy); background: var(--tint); border-color: transparent; }
.upg-hero h1 { font: 700 clamp(2rem, 5vw, 3.3rem) var(--display); margin: .5rem 0 .4rem; color: var(--navy-dk); }
.upg-hero h1 em { font-style: normal; color: var(--amber-dk); }
.upg-hero p { margin: 0; color: var(--muted); }
.stars { color: var(--amber); letter-spacing: 2px; margin-right: .4em; }

.agent { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; padding: 36px; border-radius: 24px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, #5b5a92 0%, #3b3a5e 45%, #27273e 100%); box-shadow: 0 10px 40px rgba(39,39,62,.25); }
.agent h2 { font: 700 2.4rem var(--display); margin: 0 0 .3rem; }
.agent .lead { font-size: 1.1rem; margin: 0 0 .4rem; }
.agent .sub { color: #c9c8e6; font-size: .92rem; margin: 0 0 1.2rem; }
.agent .price { font: 700 3.2rem/1 var(--body); margin: 1rem 0 .2rem; }
.agent .price small { font-size: 1rem; font-weight: 500; color: #c9c8e6; }
.agent .fine { color: #c9c8e6; font-size: .85rem; margin: 0 0 1.2rem; }
.agent .k { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: #c9c8e6; font-weight: 700; margin: 1.6rem 0 .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips span { padding: .3em .8em; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .85rem; }
.deliver { display: grid; gap: 12px; align-content: start; }
.deliver .box { border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); border-radius: 14px; padding: 16px 18px; }
.deliver .big { font-size: 1.6rem; font-weight: 700; }
.deliver .row { display: flex; align-items: center; gap: .7rem; font-weight: 600; }
.ok { width: 22px; height: 22px; border-radius: 50%; background: #2fae74; display: grid; place-items: center; flex: none; }
.ok svg { width: 14px; height: 14px; stroke: #fff; stroke-width: 3; fill: none; }
.stat { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat .box b { display: block; font-size: 1.5rem; color: var(--amber); }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 28px 0; }
.plan { padding: 28px; position: relative; }
.plan.best { border: 2px solid var(--navy); }
.plan .tag { position: absolute; top: -13px; left: 24px; background: var(--navy); color: #fff; font-size: .78rem; font-weight: 700; padding: .25em .8em; border-radius: 999px; }
:root[data-theme="dark"] .plan .tag { color: #15151f; }
.plan h3 { font-size: 1.05rem; color: var(--muted); font-weight: 600; }
.plan .price { font: 700 2.8rem/1 var(--body); margin: .3rem 0; color: var(--navy-dk); }
.plan .price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.plan .strike { text-decoration: line-through; color: var(--muted); margin-right: .5em; }
.plan .save { display: inline-block; background: var(--green-lt); color: var(--green); font-weight: 700; font-size: .8rem; padding: .15em .6em; border-radius: 6px; }
.plan ul { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: .55rem; }
.plan li { display: flex; gap: .6rem; align-items: flex-start; }
.plan li .ok { width: 20px; height: 20px; margin-top: 2px; background: var(--navy); }
.plan .btn { width: 100%; min-height: 48px; }
.section-k { text-align: center; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--muted); margin: 48px 0 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile { padding: 22px; }
.tile .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--tint); color: var(--navy); display: grid; place-items: center; margin-bottom: .8rem; }
.tile h3 { font-size: 1.1rem; }
.tile p { margin: 0; color: var(--muted); }
.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--rule); padding: 1rem 0; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: .6rem 0 0; color: var(--muted); }
.pay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pay .card { padding: 16px; }
.pay b { display: block; }
.pay code { font: 600 .95rem ui-monospace, Menlo, monospace; word-break: break-all; }
.cta { text-align: center; padding: 40px 24px; margin-top: 48px; border-radius: 24px; background: var(--hero); }
.cta h2 { font: 700 2rem var(--display); color: var(--navy-dk); }
.cta .btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 32px 16px; }

/* ---------- application ---------- */
.shell { display: grid; grid-template-columns: 72px 1fr; min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 0;
  background: var(--card); border-right: 1px solid var(--rule); z-index: 30; }
.rail .logo { width: 40px; height: 40px; margin-bottom: 10px; }
.rail hr { width: 36px; border: 0; border-top: 1px solid var(--rule); margin: 6px 0; }
.rail a, .rail button { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--navy);
  background: none; border: 0; cursor: pointer; text-decoration: none; }
.rail a:hover, .rail button:hover { background: var(--soft); }
.rail a.on { background: var(--tint); }
.rail .tip { position: absolute; left: 54px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--navy-dk); color: #fff;
  font-size: .8rem; font-weight: 600; padding: .3em .6em; border-radius: 6px; opacity: 0; pointer-events: none; transition: opacity .12s; }
:root[data-theme="dark"] .rail .tip { color: #15151f; }
.rail a:hover .tip, .rail button:hover .tip, .rail a:focus-visible .tip { opacity: 1; }
.rail .sp { flex: 1; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--amber), var(--navy)); }
.dotn { position: absolute; top: 8px; right: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--red); border: 2px solid var(--card); }
.main { min-width: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 24px 64px; }
.menu { position: fixed; left: 80px; bottom: 16px; z-index: 40; width: 260px; padding: 8px; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.menu a, .menu button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border-radius: 8px; border: 0; background: none; color: var(--text); font: inherit; text-decoration: none; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--soft); }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-h h1 { font-size: 1.7rem; margin: 0; }
.page-h p { margin: .2rem 0 0; color: var(--muted); }

.hero { background: var(--hero); text-align: center; padding: 48px 24px 40px; }
.hero h1 { font: 700 clamp(2rem, 4.5vw, 3rem) var(--display); color: var(--navy-dk); margin: 0 0 .3rem; }
.hero p { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.6rem; }
.searchbox { display: flex; align-items: center; gap: .6rem; max-width: 780px; margin: 0 auto; padding: 8px 8px 8px 16px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--rule); }
.searchbox span { color: var(--muted); white-space: nowrap; }
.searchbox input { border: 0; padding: .5em 0; background: transparent; }
.searchbox input:focus { outline: none; }
.searchbox .btn { min-width: 46px; padding: 0 .9em; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.hero .actions .btn { border-radius: 999px; }

.grant { padding: 20px 22px 0; margin-bottom: 14px; }
.grant h3 { font-size: 1.1rem; margin: 0; }
.grant .funder { color: var(--muted); font-size: .92rem; margin: .1rem 0 .6rem; }
.grant .sum { margin: 0 0 .8rem; }
.grant .why { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: .92rem; margin-bottom: .8rem; }
.grant .why b { color: var(--navy); display: flex; align-items: center; gap: .35rem; font-size: .8rem; margin-bottom: .2rem; }
.grant .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; font-size: .88rem; color: var(--muted); margin-bottom: .9rem; }
.grant .meta span { display: inline-flex; align-items: center; gap: .3rem; }
.grant .acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--rule); padding: 12px 0 14px; }
.grant .acts .sp { flex: 1; }
.grant details { font-size: .9rem; margin-bottom: .8rem; }
.grant details summary { cursor: pointer; color: var(--navy); font-weight: 600; }

.dash { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.meter { display: grid; grid-template-columns: 260px 1fr; overflow: hidden; }
.meter .l { background: radial-gradient(120% 140% at 0% 0%, #5b5a92 0%, #3b3a5e 50%, #27273e 100%); color: #fff; display: grid; place-items: center; padding: 24px; text-align: center; }
.ring { width: 150px; height: 150px; position: relative; }
.ring svg { width: 150px; height: 150px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; }
.meter .r { padding: 24px 28px; }
.steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.steps .c { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; }
.steps .done .c { background: var(--navy); border-color: var(--navy); }
.steps .done .c svg { stroke: #fff; width: 13px; height: 13px; stroke-width: 3; fill: none; }
.steps .done strong { text-decoration: line-through; color: var(--muted); }
.steps p { margin: .1rem 0 .5rem; color: var(--muted); font-size: .9rem; }
.notif { padding: 20px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .ic { width: 52px; height: 52px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; margin: 0 auto .6rem; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.quick a { display: flex; align-items: center; gap: .8rem; padding: 16px 18px; text-decoration: none; color: var(--text); font-weight: 700; }
.quick a .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--tint); color: var(--navy); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: 20px; }
.panel .ph { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .8rem; }
.panel .ph h2 { font-size: 1.15rem; margin: 0; }
.mini { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); }
.mini:first-of-type { border-top: 0; }
.mini b { display: block; }

.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--soft); border-radius: 12px; padding: 10px; min-height: 420px; }
.col h3 { font-size: .9rem; display: flex; align-items: center; gap: .45rem; margin: 2px 4px 10px; }
.col h3 .n { margin-left: auto; color: var(--muted); font-weight: 600; }
.col h3 .d { width: 8px; height: 8px; border-radius: 50%; }
.col.drop { outline: 2px dashed var(--navy-2); }
.kcard { padding: 10px 12px; margin-bottom: 8px; cursor: pointer; border-radius: 10px; }
.kcard b { display: block; font-size: .92rem; }
.kcard .small { margin-top: .2rem; }
.newapp { width: 100%; justify-content: flex-start; background: none; border: 0; color: var(--muted); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); font-size: .92rem; vertical-align: top; }
table.list th { color: var(--muted); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { border: 0; background: none; padding: .45em .9em; font: 600 .88rem var(--body); color: var(--muted); cursor: pointer; display: flex; gap: .35rem; align-items: center; }
.seg button.on { background: var(--tint); color: var(--navy); }

.editor { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.editor textarea.doc { min-height: 62vh; font: 15px/1.6 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.preview { padding: 24px 28px; min-height: 62vh; overflow-wrap: anywhere; }
.preview h2, .preview h3 { color: var(--navy); margin-top: 1.2em; }
.preview table { border-collapse: collapse; width: 100%; }
.preview td, .preview th { border: 1px solid var(--rule); padding: 6px 8px; }
.preview .todo { background: var(--amber-lt); color: var(--amber-dk); border-radius: 4px; padding: 0 .2em; font-weight: 600; }
.side { display: grid; gap: 16px; }
.side .panel h3 { font-size: 1rem; }
.review li { margin-bottom: .35rem; }
.score { font: 700 2.4rem var(--body); color: var(--navy); }

.kb { display: grid; grid-template-columns: 1fr 300px; gap: 20px; }
.drop-zone { border: 2px dashed var(--rule); border-radius: 16px; padding: 40px; text-align: center; }
.drop-zone.over { border-color: var(--navy); background: var(--tint); }
.howit ol { padding-left: 1.2rem; }

.chat { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 56px); }
.chat .hello { text-align: center; padding: 32px 0 10px; }
.chat .hello .ic { width: 64px; height: 64px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; margin: 0 auto 12px; }
.chat .hello h1 { font: 700 2.2rem var(--display); color: var(--navy-dk); }
.starters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 640px; margin: 20px auto; }
.starters button { text-align: left; padding: 16px; border-radius: 14px; border: 1px solid var(--rule); background: var(--card); cursor: pointer; font: inherit; color: var(--text); box-shadow: var(--shadow); }
.starters button b { display: block; color: var(--navy); margin: .3rem 0 .1rem; }
.msgs { flex: 1; display: grid; gap: 14px; align-content: start; padding: 10px 0; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 14px; overflow-wrap: anywhere; }
.msg.user { justify-self: end; background: var(--navy); color: #fff; }
:root[data-theme="dark"] .msg.user { color: #15151f; }
.msg.ai { justify-self: start; background: var(--card); border: 1px solid var(--rule); }
.msg.ai p:first-child { margin-top: 0; } .msg.ai p:last-child { margin-bottom: 0; }
.composer { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0 20px; display: flex; gap: 10px; }
.composer textarea { min-height: 52px; max-height: 200px; resize: none; }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(20,20,32,.5); display: grid; place-items: center; padding: 16px; }
.modal > .card { width: min(560px, 100%); max-height: 92vh; overflow: auto; }
.modal .mh { padding: 22px 24px; color: #fff; border-radius: 16px 16px 0 0; background: radial-gradient(120% 140% at 100% 0%, #5b5a92 0%, #3b3a5e 50%, #27273e 100%); position: relative; }
.modal .mh h2 { font-size: 1.35rem; margin: .4rem 0 .2rem; }
.modal .mh p { margin: 0; color: #d6d5ee; }
.modal .mb { padding: 20px 24px 24px; }
.modal .x { position: absolute; top: 12px; right: 12px; color: #fff; background: none; border: 0; cursor: pointer; font-size: 1.4rem; }
.feat { display: flex; gap: .8rem; padding: 12px; border: 1px solid var(--rule); border-radius: 12px; margin-bottom: 8px; }
.feat .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--tint); color: var(--navy); display: grid; place-items: center; flex: none; }
.feat b { display: block; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 70; background: var(--navy-dk); color: #fff; padding: .7em 1.1em; border-radius: 10px; box-shadow: var(--shadow); }
:root[data-theme="dark"] .toast { color: #15151f; }
.spin { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .8s linear infinite; display: inline-block; }
@keyframes s { to { transform: rotate(360deg); } }
.working { text-align: center; padding: 40px 16px; color: var(--muted); }
.working .spin { width: 32px; height: 32px; color: var(--navy); margin-bottom: 1rem; }
.signin { max-width: 440px; margin: 8vh auto; padding: 32px; }
.signin h1 { font: 700 2rem var(--display); color: var(--navy-dk); }
.timeline { position: relative; padding-left: 40px; }
.timeline::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 0; width: 2px; background: var(--rule); }
.timeline .day { position: relative; font-weight: 700; margin: 0 0 12px; }
.timeline .day::before { content: ""; position: absolute; left: -34px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 4px var(--tint); }
.hist { margin-bottom: 12px; }
.hist > summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.hist > summary .q { flex: 1; }
.hist .body { padding: 0 18px 4px; border-top: 1px solid var(--rule); }
.hist .body .grant { box-shadow: none; margin: 14px 0; }
.adm table.list td { font-size: .85rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

@media (max-width: 960px) {
  .agent, .plans, .dash, .two, .editor, .kb, .meter { grid-template-columns: 1fr; }
  .tiles, .quick { grid-template-columns: 1fr; }
  .pay { grid-template-columns: 1fr 1fr; }
  .agent { padding: 24px; }
}
@media (max-width: 640px) {
  .shell { grid-template-columns: 1fr; padding-bottom: 64px; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 60px; flex-direction: row; justify-content: space-around; padding: 0 6px; border-right: 0; border-top: 1px solid var(--rule); }
  .rail .logo, .rail hr, .rail .sp, .rail .tip { display: none; }
  .menu { left: 8px; right: 8px; bottom: 70px; width: auto; }
  .wrap { padding: 20px 16px 40px; }
  .pay, .starters, .stat, .grid2 { grid-template-columns: 1fr; }
  .searchbox span { display: none; }
  .topbar .hide-m { display: none; }
}

/* ---------- Goodstack /pro/ look (2026-11-28): soft gradient behind every page, home details ---------- */
.main, .pro-bg { background: linear-gradient(135deg, #f3f2fb 0%, #f8f5fb 45%, #fbf3e6 100%); min-height: 100vh; }
:root[data-theme="dark"] .main, :root[data-theme="dark"] .pro-bg { background: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .main, :root:not([data-theme="light"]) .pro-bg { background: var(--bg); } }
.pro-bg .topbar { background: transparent; border-bottom: 0; backdrop-filter: none; position: static; }
.home .hello { font-size: 2.1rem; margin: 22px 0 .2rem; }
.home .org { margin: 0 0 32px; font-weight: 600; }
.home .dash { grid-template-columns: 1fr 290px; gap: 24px; }
.home .meter { grid-template-columns: 300px 1fr; min-height: 470px; }
.home .meter .l { background: linear-gradient(180deg, #4b4a7c 0%, #3b3a5e 55%, #2e2d4c 100%); }
.home .ring, .home .ring svg { width: 170px; height: 170px; transform: none; }
.home .ring b { font-weight: 600; letter-spacing: .04em; }
.home text.arc { font: 700 11px var(--body); letter-spacing: .16em; fill: rgba(255,255,255,.55); }
.home .meter .r { padding: 52px 48px 24px; }
.home .meter .r h2 { font-size: 1.15rem; font-weight: 600; margin: 0; }
.chev { width: 22px; height: 22px; border: 1px solid var(--rule); border-radius: 50%; display: grid; place-items: center; color: var(--muted); margin: 20px 0 6px; }
.chev:last-child { margin: 8px 0 0; }
.steps.tl { position: relative; gap: 18px; margin: 8px 0 0; }
.steps.tl::before { content: ""; position: absolute; left: 11px; top: -24px; bottom: -10px; width: 2px; background: var(--rule); z-index: 0; }
.steps.tl li { position: relative; z-index: 1; }
.steps.tl .c { background: var(--card); }
.steps.tl .now .c { border-color: var(--tint); background: var(--tint); color: var(--navy); }
.steps.tl .now strong { color: var(--navy); font-weight: 600; }
.steps.tl strong { font-weight: 500; }
.steps.tl p { margin: .05rem 0 .6rem; font-size: .88rem; }
.home .notif h2 { font-size: 1.1rem; font-weight: 600; margin: 4px 0 0; }
.home .quick { margin: 28px 0; gap: 24px; }
.home .quick a { padding: 10px 12px; font-weight: 600; border-radius: 10px; }
.home .quick a .ic { width: 32px; height: 32px; border-radius: 8px; background: var(--navy); color: #fff; }
.home .two { gap: 24px; }
.home .panel { min-height: 360px; padding: 24px; }
.home .panel .ph h2 { font-weight: 600; }
.link { color: var(--navy-2); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.grow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; box-shadow: none; border-radius: 10px; text-decoration: none; color: var(--text); }
.grow > div { flex: 1; min-width: 0; }
.grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow .lg { width: 40px; height: 40px; border-radius: 8px; background: var(--soft); color: var(--navy); display: grid; place-items: center; font-weight: 700; flex: none; }
.grow .btn.sm { min-height: 30px; padding: 0 .55em; }
@media (max-width: 960px) { .home .meter { grid-template-columns: 1fr; min-height: 0; } .home .meter .r { padding: 24px; } .home .dash { grid-template-columns: 1fr; } }
.steps.tl .done .c { background: var(--navy); border-color: var(--navy); }
