/* HishabChai styles. Noto Sans Bengali is self-hosted (OFL licence in assets/fonts/LICENSE-OFL.txt).
   No outside requests, nothing imported from other sites. Mobile first; no horizontal scroll down to 320 px. */
@font-face {
  font-family: "Noto Sans Bengali";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/bengali-400-normal.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Sans Bengali";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/bengali-700-normal.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Noto Sans Bengali";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f7f8fa; --card: #ffffff; --ink: #1c2230; --muted: #566074; --line: #dfe3ea;
  --brand: #0b6b4f; --brand-ink: #ffffff; --warn-bg: #fff6e0; --warn-line: #e8c36a; --err: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161d; --card: #1a202a; --ink: #e8ecf2; --muted: #a8b2c2; --line: #2d3644;
    --brand: #3fb68b; --brand-ink: #08150f; --warn-bg: #2a2412; --warn-line: #7a6422; --err: #ff8a80;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Noto Sans Bengali", "Kohinoor Bangla", "Bangla Sangam MN", "Nirmala UI", "Noto Sans", system-ui, sans-serif;
  font-size: 17px; line-height: 1.7; overflow-wrap: anywhere;
}
img, svg, canvas, table, select, input, button { max-width: 100%; }
a { color: var(--brand); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 16px; }
header.site { background: var(--card); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
nav.main { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 16px; }
nav.main a, footer.site a { display: inline-block; padding: 6px 0; min-height: 32px; }
.nav-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.nav-group-name { color: var(--muted); font-size: .9rem; }
.draft-banner { margin: 0; padding: 6px 16px; text-align: center; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); font-size: .95rem; }

h1 { font-size: 1.7rem; line-height: 1.3; margin: 24px 0 8px; }
h2 { font-size: 1.25rem; margin: 28px 0 8px; }
main { padding-bottom: 24px; }
footer.site { margin-top: 40px; padding: 20px 0 32px; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }

/* tool pages and controls */
.field { margin: 10px 0; }
.field label, .assumption .label { display: block; font-size: .95rem; color: var(--muted); }
input, select, button {
  font: inherit; color: var(--ink); min-height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
}
input, select { width: 100%; padding: 8px 10px; }
button { padding: 6px 14px; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.field-error, .error { color: var(--err); display: block; }
.hint { color: var(--muted); font-size: .95rem; margin: 6px 0; }
.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; }
.badge { display: inline-block; margin: 0 6px; padding: 0 8px; border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-size: .85rem; }
.rows { margin: 8px 0; }
.rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rows > div:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); }
.rows dd { margin: 0; font-weight: 700; text-align: right; }
.rows .strong dt { color: var(--ink); }
.rows .strong dd { color: var(--brand); }
.appliance { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.appliance .field-name { grid-column: 1 / -1; }
.appliance button { grid-column: 1 / -1; justify-self: start; }
.assumption { margin: 10px 0; }
.override { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.plot-helper { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line); }

/* generated content */
.tools { display: grid; grid-template-columns: 1fr; gap: 12px; }
.card { display: block; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
.related ul { padding-left: 20px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
table.sources { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.sources th, table.sources td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; min-width: 90px; }
table.sources td { overflow-wrap: anywhere; }
.ad-slot { min-height: 250px; margin: 20px auto; max-width: 860px; }

@media (min-width: 560px) {
  .tools { grid-template-columns: repeat(2, 1fr); }
  .appliance { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .appliance .field-name, .appliance button { grid-column: auto; }
}
@media (min-width: 820px) {
  .tools { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Reserve room for the calculator that JavaScript draws, so the text below does not jump
   when it appears (layout shift). Heights are a little under the real ones. Only when
   scripting is on, so the no-JavaScript page has no empty gap. */
@media (scripting: enabled) {
  #tool-root[data-tool="fdr-dps-savings"] { min-height: 900px; }
  #tool-root[data-tool="land-converter"] { min-height: 830px; }
  #tool-root[data-tool="solar-battery"] { min-height: 1280px; }
}
@media (scripting: enabled) and (max-width: 600px) {
  #tool-root[data-tool="fdr-dps-savings"] { min-height: 1000px; }
  #tool-root[data-tool="land-converter"] { min-height: 880px; }
  #tool-root[data-tool="solar-battery"] { min-height: 1550px; }
}
