/* Layout and look modelled on Bangladesh public-sector portals (e-GP, BPPA):
   green bands, white page, link lists, dotted section rules, plain tables. No cards. */
:root {
  --green: #006a4e;        /* deep green (logo) */
  --green-bright: #5ba532; /* band green */
  --green-pale: #eef6e6;   /* menu rows / subheading bands */
  --green-text: #4c8a26;   /* section titles */
  --band: linear-gradient(180deg, #7dbf4f 0%, #5ba532 55%, #4a9227 100%);
  --band-edge: #3f7f22;
  --pale-band: linear-gradient(180deg, #f6fbf1 0%, #e6f2da 100%);
  --red: #d62828;
  --orange: #c2410c;
  --blue: #1d4f91;
  --ink: #222;
  --muted: #666;
  --line: #c9d8bd;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: #fff; color: var(--ink);
  font-family: Arial, "Hind Siliguri", Helvetica, sans-serif; font-size: 14px; line-height: 1.55;
}
.bn { font-family: "Hind Siliguri", Arial, sans-serif; }
a { color: #0645ad; text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }

.strip {
  background: var(--band); color: #fff; text-align: center; font-weight: bold;
  font-size: 15px; padding: 7px 12px; border-bottom: 1px solid var(--band-edge);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}
.wrap { width: 100%; padding: 0 28px; }

.head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0 10px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo img { width: 58px; height: 58px; flex: none; }
.logo .name { display: block; font-size: 26px; font-weight: bold; color: #2a5f16; line-height: 1.2; }
.logo .tag { display: block; font-size: 12.5px; color: var(--muted); }
.head-right { text-align: right; }
.toplinks { font-weight: bold; font-size: 13.5px; color: #555; }
.toplinks a { color: #333; }
.clock { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.searchbar {
  display: flex; align-items: center; gap: 6px; background: var(--band); padding: 8px 10px;
  border: 1px solid var(--band-edge); border-bottom: 0; border-radius: 3px 3px 0 0;
}
.searchbar input {
  flex: 1; padding: 5px 8px; border: 1px solid #3f7f22; font-size: 14px; min-width: 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.searchbar button {
  background: linear-gradient(180deg, #55615a 0%, #2f3833 100%); color: #fff; border: 1px solid #1e2420;
  padding: 5px 16px; font-weight: bold; cursor: pointer; border-radius: 2px;
}
.searchbar button:hover { background: linear-gradient(180deg, #65736b 0%, #3a453f 100%); }
.searchbar .adv { color: #fff; font-weight: bold; margin-left: 8px; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }

/* Pale "Go To" menu row under the search bar */
.gonav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; padding: 7px 10px;
  background: var(--pale-band); border: 1px solid #c4dcb0; border-top: 0; border-radius: 0 0 3px 3px;
  font-weight: bold; font-size: 13.5px;
}
.gonav .lbl { color: #555; }
.gonav a { color: #2f3a2f; display: inline-flex; align-items: center; gap: 6px; }
.gonav svg { width: 19px; height: 19px; flex: none; }
.gonav .lbl svg { width: .85em; height: .85em; }

.ticker {
  display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px dotted var(--line);
  color: var(--red); font-weight: bold; font-size: 14px;
}
.ticker .tick-ic { width: 20px; height: 20px; flex: none; }
.ticker marquee { flex: 1; }

.layout { display: grid; grid-template-columns: 270px 1fr; gap: 32px; padding: 16px 0 28px; }
.side h3 { color: var(--green-text); font-size: 17px; margin: 0 0 6px; }
.side h3 + .links { margin-bottom: 18px; }
.links { list-style: none; margin: 0; padding: 0; border-top: 1px dotted #999; }
.links li { border-bottom: 1px dotted #999; padding: 7px 4px 7px 16px; position: relative; font-weight: bold; }
.links li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 10px; height: 10px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M4 2.5L7.5 6 4 9.5' fill='none' stroke='%234c8a26' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.links a { color: #333; }

main h1 { color: var(--green-text); font-size: 20px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px dotted #999; }
main h2 {
  color: #2f5f17; font-size: 15.5px; margin: 22px 0 10px; padding: 6px 10px;
  background: var(--pale-band); border-left: 3px solid var(--green-bright);
}
main p { margin: 0 0 10px; text-align: justify; }
.sub { color: var(--muted); margin-bottom: 10px; }

/* "At a glance": plain label ...... value rows, no boxes */
.facts { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.facts li { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.facts .label { flex: none; }
.facts .leader { flex: 1 1 24px; min-width: 24px; border-bottom: 1px dotted #aaa; transform: translateY(-4px); }
.facts .val { flex: 0 1 auto; font-weight: bold; color: var(--green); }

ul.plain { margin: 0; padding-left: 18px; }
ul.plain li { margin: 4px 0; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
th { background: var(--pale-band); font-weight: bold; color: #2f3a2f; }
tr:hover td { background: #f7fbf3; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.title { max-width: 380px; }

/* Risk flags as a plain list with coloured markers */
.flags { list-style: none; margin: 0; padding: 0; }
.flags li { padding: 6px 0 6px 22px; position: relative; border-bottom: 1px dotted #ccc; }
.flags li::before { content: ""; position: absolute; left: 0; top: 9px; width: 15px; height: 15px; background: no-repeat center / contain; }
.flags li.high::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.2 1h5.6L15 5.2v5.6L10.8 15H5.2L1 10.8V5.2z' fill='%23d62828'/%3E%3Cpath d='M8 4.2v4.6' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.6' r='1.1' fill='%23fff'/%3E%3C/svg%3E"); }
.flags li.medium::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.2l7.2 13.3H.8z' fill='%23c2410c' stroke-linejoin='round'/%3E%3Cpath d='M8 5.6v4.2' stroke='%23fff' stroke-width='1.9' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='12.2' r='1' fill='%23fff'/%3E%3C/svg%3E"); }
.flags li.info::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%231d4f91'/%3E%3Cpath d='M8 7v4.6' stroke='%23fff' stroke-width='1.9' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='4.6' r='1.1' fill='%23fff'/%3E%3C/svg%3E"); }
.flags .lvl { font-weight: bold; margin-right: 4px; }
.flags li.high .lvl { color: var(--red); }
.flags li.medium .lvl { color: var(--orange); }
.flags li.info .lvl { color: var(--blue); }
.flags .bn { display: block; color: var(--muted); }
.flags .detail { display: block; color: var(--muted); font-size: 12.5px; }
.important { color: var(--red); font-weight: bold; font-style: italic; }

.tagdeb { color: var(--red); font-weight: bold; font-size: 12px; }
.tagdom { color: var(--orange); font-weight: bold; font-size: 12px; }

.share { display: flex; align-items: center; gap: 6px; }
.share .track { width: 90px; height: 7px; background: #e6e6e6; }
.share .track span { display: block; height: 100%; background: var(--orange); }

.years { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.years li { display: grid; grid-template-columns: 48px 1fr 220px; gap: 8px; align-items: center; padding: 2px 0; }
.years .b { height: 10px; background: var(--green-bright); }
.years .v { color: var(--muted); font-size: 12.5px; }

.foot {
  background: var(--band); color: #fff; text-align: center; font-size: 12.5px; padding: 12px 16px;
  border-top: 1px solid var(--band-edge); text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
}

/* Grid/flex children must be allowed to shrink, or a wide table widens the whole page. */
.layout > *, main { min-width: 0; }
main h1, main h2 { overflow-wrap: anywhere; }
.facts .label { min-width: 0; }
.facts .val { text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tablet ---------- */
@media (max-width: 1024px) {
  .wrap { padding: 0 18px; }
  .layout { grid-template-columns: 220px 1fr; gap: 22px; }
  td.title { max-width: 260px; }
}
/* Small tablets: give tables the full width; sidebar goes below */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { order: 2; }
  td.title { max-width: none; }
}

/* ---------- AI review priority ---------- */
.pill { display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 12px; font-weight: bold;
        color: #fff; white-space: nowrap; line-height: 1.6; }
.pill.very_high { background: var(--red); }
.pill.high { background: var(--orange); }
.pill.elevated { background: #b8860b; }
.pill.typical { background: #6b7b6b; }
.risk { padding: 8px 0 10px; border-bottom: 1px dotted #ccc; max-width: 900px; }
.riskhead { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.meter { position: relative; height: 8px; margin: 10px 0 8px; max-width: 520px;
         background: linear-gradient(90deg, #cfe3bf 0%, #e8e3a6 70%, #f0b27a 90%, #d62828 100%); }
.meter span { position: absolute; top: -4px; width: 3px; height: 16px; margin-left: -1px; background: #222; }
.why { font-weight: bold; color: #444; margin-top: 4px; }
.reasons { margin: 2px 0 4px; padding-left: 18px; }
.reasons li { margin: 2px 0; }
.caveat { margin-top: 10px; padding: 8px 10px; background: #fff8e6; border-left: 3px solid #e0a100; font-size: 13px; }
.caveat .bn { display: block; color: var(--muted); }
.tabs { margin: 4px 0 8px; }
b.up { color: var(--orange); }
b.down { color: var(--green); }
details.more { margin: 6px 0 4px; }
details.more summary { cursor: pointer; color: #0645ad; font-weight: bold; padding: 4px 0; }

/* inline hand-drawn signs */
.ic { width: .85em; height: .85em; vertical-align: -1px; display: inline-block; }
.gonav .lbl .ic { vertical-align: -2px; }

/* ---------- Floating "Prohori AI" assistant ---------- */
.aifab [hidden], .aipanel [hidden], .aipanel[hidden], .aifab-tip[hidden] { display: none !important; }
.aifab {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; width: 62px; height: 62px; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer; display: grid; place-items: center;
  background: linear-gradient(160deg, #6cb43f 0%, #2c6e1c 100%);
  box-shadow: 0 6px 16px rgba(20, 60, 10, .35), 0 0 0 4px rgba(255, 255, 255, .9);
  transition: transform .15s ease;
}
.aifab:hover { transform: scale(1.06); }
.aifab svg { width: 34px; height: 34px; }
.aifab-tip {
  position: absolute; right: 74px; top: 50%; transform: translateY(-50%); white-space: nowrap;
  background: #fff; color: #2a5f16; font-size: 14px; font-weight: bold; padding: 7px 12px; border-radius: 6px;
  border: 1px solid #8fbf6d; box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
}
.aifab-tip::after { content: ""; position: absolute; right: -6px; top: 50%; margin-top: -6px;
  border: 6px solid transparent; border-right: 0; border-left-color: #8fbf6d; }

.aipanel {
  position: fixed; right: 24px; bottom: 100px; z-index: 51; width: 400px;
  height: min(620px, calc(100vh - 130px)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid #8fbf6d; border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.aihead { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
  background: var(--band); color: #fff; border-bottom: 1px solid var(--band-edge); }
.aititle { display: flex; gap: 10px; align-items: center; }
.aititle .aic { width: 28px; height: 28px; background: #fff; border-radius: 50%; padding: 3px; }
.aititle b { display: block; font-size: 17px; line-height: 1.2; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.aititle span { display: block; font-size: 12px; opacity: .95; }
.aiclose { background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; border-radius: 4px; }
.aiclose:hover { background: rgba(255, 255, 255, .2); }
.aictx { padding: 6px 12px; font-size: 13px; background: var(--green-pale); border-bottom: 1px solid var(--line);
  color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aibody { position: relative; flex: 1; overflow-y: auto; padding: 12px; background: #fafcf8; }
.aimsg { margin: 0 0 10px; padding: 8px 11px; border-radius: 8px; font-family: "Hind Siliguri", Arial, sans-serif;
  font-size: 14.5px; line-height: 1.65; max-width: 92%; }
.aimsg.bot { background: #fff; border: 1px solid #dbe8d0; border-top-left-radius: 2px; }
.aimsg.me { background: #2c6e1c; color: #fff; margin-left: auto; border-top-right-radius: 2px; width: fit-content; white-space: pre-wrap; overflow-wrap: anywhere; }
.aimsg.err { color: var(--red); border-color: #f1c4c4; }
.aimsg p { margin: 0 0 6px; }
.aimsg p:last-child { margin-bottom: 0; }
.aimsg ul { margin: 0 0 6px; padding-left: 18px; }
.aityping { color: var(--muted); }
.aityping i { font-style: normal; animation: aiblink 1.2s infinite; }
.aityping i:nth-child(2) { animation-delay: .2s; }
.aityping i:nth-child(3) { animation-delay: .4s; }
@keyframes aiblink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
.aic { width: 18px; height: 18px; vertical-align: -4px; flex: none; }
.aibtn { display: inline-flex; gap: 8px; align-items: center; margin: 2px 0 10px; padding: 7px 12px; cursor: pointer;
  background: #fff; color: #2a5f16; border: 1px solid #8fbf6d; border-radius: 6px; font-weight: bold; font-size: 14px; }
.aibtn:hover { background: var(--green-pale); }
.aichips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.chip { background: var(--green-pale); border: 1px solid var(--line); border-radius: 14px; padding: 3px 10px;
  font-size: 13.5px; cursor: pointer; color: #2a5f16; text-align: left; }
.chip:hover { border-color: var(--green-bright); }
.aiask { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--line); background: #fff; }
.aiask textarea { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid #8fbf6d; border-radius: 6px; font-size: 15px;
  font-family: "Hind Siliguri", Arial, sans-serif; line-height: 1.45; resize: none; overflow-y: auto; max-height: 150px; }
.aisend { background: linear-gradient(160deg, #6cb43f 0%, #2c6e1c 100%); border: 0; border-radius: 6px; padding: 0 11px; height: 38px; cursor: pointer; }
.aifoot { margin: 0; padding: 5px 10px 7px; font-size: 11.5px; color: var(--muted); background: #fff; line-height: 1.4; }
.aifoot .bn { display: block; }
@media (max-width: 760px) {
  .aifab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  .aipanel { left: 8px; right: 8px; bottom: 8px; width: auto; height: 82vh; }
  body.ai-open .aifab { display: none; }
  .aiask textarea { font-size: 16px; }   /* 16px stops iOS zooming on focus */
}

/* ---------- Plans, sign-up form, Probashi, Contractor Check Report ---------- */
.btn-main, .btn-line { display: inline-block; padding: 6px 14px; border-radius: 3px; font-weight: bold; font-size: 14px;
  cursor: pointer; line-height: 1.4; }
.btn-main { background: var(--band); color: #fff; border: 1px solid var(--band-edge); text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.btn-line { background: #fff; color: #2a5f16; border: 1px solid #8fbf6d; }
.btn-line:hover { background: var(--green-pale); text-decoration: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.lead { font-size: 16px; color: #2a5f16; }
.small { font-size: 12.5px; }
b.bad { color: var(--red); }
b.good { color: var(--green); }
table.plans td { vertical-align: top; }
table.plans td:first-child { white-space: nowrap; }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 12px; }
.modal-box { background: #fff; width: min(460px, 100%); max-height: calc(100vh - 24px); overflow-y: auto; border-radius: 8px;
  padding: 14px 16px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.modal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 16px; color: #2a5f16; flex: 1; }
.modal-head .bn { order: 3; width: 100%; color: var(--muted); font-size: 13px; }
.modal-head .aiclose { color: #444; }
.modal-box label { display: block; margin: 8px 0; font-weight: bold; font-size: 13px; color: #333; }
.modal-box label input:not([type=checkbox]), .modal-box label select, .modal-box label textarea {
  display: block; width: 100%; margin-top: 3px; padding: 7px 8px; border: 1px solid #8fbf6d; border-radius: 4px;
  font: 15px Arial, "Hind Siliguri", sans-serif; font-weight: normal; }
.modal-box label.check { font-weight: normal; display: flex; gap: 8px; align-items: center; }
.modal-box .btn-main { width: 100%; margin-top: 6px; padding: 9px; }
.notice { background: #fff8e6; border-left: 3px solid #e0a100; padding: 6px 10px; font-size: 13px; }
.notice .bn { display: block; }

.districts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 20px; }
.districts h3 { margin: 10px 0 4px; font-size: 14px; color: var(--green-text); }
.districts li { padding: 2px 0; }
.inline-search { display: flex; gap: 6px; max-width: 520px; margin: 6px 0; }
.inline-search input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid #8fbf6d; border-radius: 3px; font-size: 15px; }

.report { max-width: 900px; }
.report-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px;
  background: var(--pale-band); border: 1px solid var(--line); }
.report-head b { display: block; font-size: 17px; color: #2a5f16; }
.report-head .muted { text-align: right; font-size: 12.5px; }
.report-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.report h3 { font-size: 14px; margin: 12px 0 4px; }
@media print {
  .strip, .head, .searchbar, .gonav, .ticker, .side, .foot, .aifab, .aipanel, .report-actions, .modal { display: none !important; }
  .layout { display: block; }
  body { font-size: 12px; }
  a { color: inherit; }
}
ul.choices { list-style: none; padding: 0; margin: 8px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
ul.choices a { display: block; height: 100%; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--green-bright);
  background: #fff; color: var(--ink); }
ul.choices a:hover { background: var(--green-pale); text-decoration: none; }
ul.choices b { display: block; font-size: 16px; color: #2a5f16; }
ul.choices .bn { display: block; color: var(--muted); font-size: 13px; margin-bottom: 4px; }
ul.choices span:last-child { display: block; font-size: 13.5px; }
#dlist [hidden] { display: none; }

/* ---------- Language switch (English / বাংলা) ---------- */
.lang { display: inline-block; margin-left: 2px; padding: 1px 9px; border: 1px solid #8fbf6d; border-radius: 12px;
  background: var(--green-pale); color: #2a5f16; font-weight: bold; }
.lang:hover { background: #dcedcb; text-decoration: none; }
body.lang-bn, body.lang-bn input, body.lang-bn textarea, body.lang-bn select, body.lang-bn button {
  font-family: "Hind Siliguri", Arial, sans-serif; }
body.lang-bn { font-size: 15px; }
body.lang-bn .lang { font-family: Arial, sans-serif; }

/* Header row: links, language button, Menu button (phone only) */
.toprow { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.menubtn, .drawer-head, .navshade { display: none; }
.menubtn { align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border: 1px solid var(--band-edge); border-radius: 6px;
  background: var(--band); color: #fff; font-weight: bold; font-size: 14.5px; cursor: pointer; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.menubtn svg { width: 20px; height: 20px; }
.drawer-close { background: none; border: 0; color: #fff; width: 40px; height: 40px; border-radius: 6px; cursor: pointer; }
.drawer-close svg { width: 24px; height: 24px; }
.drawer-close:hover { background: rgba(255, 255, 255, .2); }

/* ---------- Phone (max 760px) ----------
   Patterns from government design systems (GOV.UK, USWDS): a compact header with a "Menu" button that opens
   the navigation, 44px tap targets, and long records shown as summary rows instead of wide tables. */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .wrap { padding: 0 14px; }
  .strip, .toplinks, .clock, .logo .tag, .ticker, .searchbar .adv { display: none; }

  /* Header: logo on the left, language + Menu on the right; stays at the top while scrolling */
  .head { position: sticky; top: 0; z-index: 40; flex-direction: row; align-items: center; gap: 8px;
          margin: 0 -14px; padding: 8px 14px; background: #fff; border-bottom: 3px solid var(--green-bright);
          box-shadow: 0 2px 6px rgba(0, 0, 0, .06); }
  .logo { gap: 8px; }
  .logo img { width: 36px; height: 36px; }
  .logo .name { font-size: 23px; line-height: 1; }
  .head-right { text-align: right; }
  .toprow { gap: 8px; }
  .lang { min-height: 38px; display: inline-flex !important; align-items: center; padding: 0 12px !important; }
  .menubtn { display: inline-flex; }

  /* Search right under the header */
  .searchbar { margin-top: 10px; padding: 6px; border-radius: 6px; border-bottom: 1px solid var(--band-edge); }
  .searchbar input { font-size: 16px; padding: 10px; border-radius: 4px; }   /* 16px stops iOS zooming on focus */
  .searchbar button { padding: 10px 14px; border-radius: 4px; }

  /* Side menu becomes a drawer that slides in from the right */
  .layout { display: block; padding: 14px 0 88px; }
  .side { position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(88vw, 340px); overflow-y: auto;
          padding: 0 16px 28px; background: #fff; box-shadow: -8px 0 24px rgba(0, 0, 0, .2);
          transform: translateX(105%); visibility: hidden; transition: transform .22s ease, visibility .22s; }
  body.nav-open .side { transform: none; visibility: visible; }
  body.nav-open { overflow: hidden; }
  .navshade { display: block; position: fixed; inset: 0; z-index: 79; background: rgba(0, 0, 0, .45);
              opacity: 0; pointer-events: none; transition: opacity .22s; }
  body.nav-open .navshade { opacity: 1; pointer-events: auto; }
  .drawer-head { display: flex; position: sticky; top: 0; z-index: 1; justify-content: space-between; align-items: center;
                 margin: 0 -16px 12px; padding: 12px 16px; background: var(--band); color: #fff; }
  .drawer-head b { font-size: 18px; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
  .side h3 { font-size: 15px; margin: 14px 0 4px; }
  .links li { padding: 0 0 0 18px; }
  .links li::before { top: 17px; }
  .links a { display: block; padding: 11px 0; }          /* 44px tap targets */

  main h1 { font-size: 20px; line-height: 1.3; }
  main h2 { font-size: 15.5px; margin: 22px 0 10px; padding: 8px 10px; }
  main p { text-align: left; line-height: 1.6; }

  /* "At a glance" facts become two-column tiles: big value, small label */
  .facts { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row dense; gap: 8px; }
  .facts li { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 3px; padding: 10px 11px;
              border: 1px solid var(--line); border-radius: 8px; background: #fbfdf8; }
  .facts li.wide { grid-column: 1 / -1; }
  .facts .leader { display: none; }
  .facts .label { font-size: 12.5px; color: #5b6559; line-height: 1.35; }
  .facts .val { text-align: left; font-size: 17px; line-height: 1.3; }
  .facts li.wide .val { font-size: 15px; }

  .years li { grid-template-columns: 38px 1fr auto; gap: 8px; padding: 3px 0; }
  .years .v { font-size: 12px; white-space: nowrap; }

  .hide-sm { display: none; }

  /* Tables become summary rows: the main item on top, the other fields two per line with small labels */
  table.rtable, .rtable tbody { display: block; width: 100%; border: 0; }
  .rtable tr:has(th) { display: none; }
  .rtable tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid #e1ead8; }
  .rtable tr.clip { display: none; }
  .rtable tr:hover td { background: none; }
  .rtable td { display: block; min-width: 0; max-width: none; padding: 0; border: 0; text-align: left; font-size: 14px;
               white-space: normal; overflow-wrap: anywhere; }
  .rtable td::before { content: attr(data-label); display: block; font-size: 11.5px; color: #6b7468; line-height: 1.3; }
  .rtable td[data-label=""]::before { content: none; }
  .rtable td:first-child { grid-column: 1 / -1; font-size: 15.5px; font-weight: bold; }
  .rtable td:first-child::before { content: none; }
  /* rows that have a work description: the description is the main item, the date becomes a normal field */
  .rtable tr:has(td.title) td:first-child { grid-column: auto; font-size: 14px; font-weight: normal; }
  .rtable tr:has(td.title) td:first-child::before { content: attr(data-label); }
  .rtable td.title { order: -1; grid-column: 1 / -1; font-size: 14.5px; font-weight: 600; color: #222; line-height: 1.45;
                     display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .rtable td.title::before { content: none; }
  .rtable td.wide { grid-column: 1 / -1; }
  /* watchlist: hide the rank number, the company becomes the main item */
  .rtable td[data-label="#"] { display: none; }
  .rtable td[data-label="#"] + td { grid-column: 1 / -1; font-size: 15.5px; font-weight: bold; }
  .rtable td[data-label="#"] + td::before { content: none; }
  .share { justify-content: flex-start; }
  .share .track { width: 64px; }
  .more-rows { display: block; width: 100%; margin: 10px 0 4px; padding: 11px; border: 1px solid var(--line); border-radius: 8px;
               background: var(--green-pale); color: #2a5f16; font-weight: bold; font-size: 14.5px; cursor: pointer; }

  .actions .btn-line, .actions .btn-main { flex: 1 1 100%; text-align: center; padding: 11px 12px; }
  .btn-main, .btn-line { min-height: 44px; }
  .tabs { line-height: 2; }
  .riskhead { font-size: 14px; }
  .caveat { font-size: 13.5px; }
  .districts { grid-template-columns: 1fr 1fr; gap: 0 14px; }
  .report-head .muted { text-align: left; }
  .foot { font-size: 12px; padding: 14px 14px 84px; }
  .aifab-tip { display: none !important; }
}

/* Phone menu: the "Go To" links with their icons at the top of the drawer (hidden on desktop) */
.m-only { display: none; }
@media (max-width: 760px) {
  .side .m-only { display: block; }
  .golinks li { padding-left: 0; }
  .golinks li::before { content: none; }
  .golinks a { display: flex; align-items: center; gap: 10px; }
  .golinks svg { width: 20px; height: 20px; flex: none; }
}

/* Phone: the "Go To" row stays under the search bar as one swipeable line of buttons */
@media (max-width: 760px) {
  .gonav { flex-wrap: nowrap; gap: 8px; margin: 0 -14px; padding: 10px 14px 4px; overflow-x: auto;
           background: none; border: 0; border-radius: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch;
           scroll-padding: 0 14px; -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
           mask-image: linear-gradient(to right, #000 88%, transparent); }
  .gonav::-webkit-scrollbar { display: none; }
  .gonav .lbl { display: none; }
  .gonav a { flex: none; white-space: nowrap; min-height: 38px; padding: 0 13px; gap: 7px; font-size: 13.5px;
             border: 1px solid #c4dcb0; border-radius: 19px; background: var(--pale-band); color: #2f3a2f; }
  .gonav a.active { background: #2c6e1c; border-color: #2c6e1c; color: #fff; }
  .gonav a.active svg { filter: brightness(0) invert(1); }
  .gonav a.active svg [fill="#eaf4e0"], .gonav a.active svg [fill="#fff"], .gonav a.active svg [fill="#e9a23b"] { fill: transparent; }
  .gonav a:last-child { margin-right: 28px; }
}
.gonav a.active span { text-decoration: underline; text-underline-offset: 3px; }
