:root {
  /* fuelgo palette (owner's choice, 2026-10-26): Deep Teal #335765, Sage Teal #74A8A4, White,
     Pale Blue #D5E6E7, Amber #FFB547. Profit stays green and expenses red, as the owner asked. */
  --teal: #335765;
  --teal-dark: #264550;
  --sage: #74a8a4;
  --pale: #d5e6e7;
  --pale-2: #e9f2f2;
  --pale-3: #f3f8f8;
  --amber: #ffb547;
  --page: var(--pale-2);
  --surface: #ffffff;
  --line: #c9dcdd;
  --line-soft: #e1ecec;
  --line-strong: #a9c6c8;
  --ink: #1b2e35;
  --ink-2: #48606a;
  --ink-3: #5a6f78;
  --accent: var(--teal);
  --accent-ink: #ffffff;
  --good: #0a7a0a;
  --good-bg: #e6f4e6;
  --warn: #8a5a00;
  --warn-bg: #fff3dc;
  --bad: #b42626;
  --bad-bg: #fbe6e6;
  /* chart series, fixed order: regular, gold, super, diesel */
  --series-1: #335765;
  --series-2: #ffb547;
  --series-3: #74a8a4;
  --series-4: #a8692a;
  --chart-profit: #008300;
  --chart-loss: #d03b3b;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 16px; margin: 0 0 12px; }
h2 small { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.neg { color: var(--bad); }
.profit { color: var(--good); }
.expense { color: var(--bad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- shell */
.topbar {
  padding: 0 24px; background: var(--teal); border-bottom: 1px solid var(--teal-dark); color: #fff;
  position: sticky; top: 0; z-index: 20;
}
.topbar .hrow { display: flex; align-items: center; gap: 16px; padding: 14px 0 6px; }
.topbar .hrow .lang { margin-left: auto; }
/* The language button and the signed-in account stay on the right in Farsi too (owner, 2026-10-26),
   so the logo row keeps its English order; only the account text inside reads right to left. */
[dir="rtl"] .topbar .hrow { direction: ltr; }
[dir="rtl"] .topbar .hrow .who { direction: rtl; }
[dir="rtl"] .langbar { justify-content: flex-start; }
.brand { font-weight: 700; color: #fff; }
.wordmark { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.wordmark b { font-style: normal; font-weight: inherit; color: var(--amber); }
.brand:hover { text-decoration: none; }
.authbrand { display: grid; justify-items: center; gap: 6px; margin-bottom: 18px; padding: 22px 16px; border-radius: var(--radius);
  background: linear-gradient(180deg, #3f6876, var(--teal)); color: #fff; }
.authbrand .wordmark { font-size: 34px; }
.authbrand small { font-size: 12px; letter-spacing: .18em; color: var(--pale); }
.topbar nav { display: flex; gap: 4px; margin: 0 -12px; overflow-x: auto; }
.topbar nav { scrollbar-width: thin; scrollbar-color: var(--sage) transparent; }
.topbar nav::-webkit-scrollbar { height: 4px; }
.topbar nav::-webkit-scrollbar-track { background: transparent; }
.topbar nav::-webkit-scrollbar-thumb { background: var(--sage); border-radius: 4px; }
.topbar nav a {
  padding: 15px 12px 13px; color: var(--pale); border-bottom: 3px solid transparent; white-space: nowrap;
}
.topbar nav a:hover { color: #fff; text-decoration: none; }
.topbar nav a.on { color: #fff; border-bottom-color: var(--amber); font-weight: 600; }
.topbar a:focus-visible, .topbar button:focus-visible { outline-color: var(--amber); }
.topbar .who { color: var(--pale); }
.topbar button.link { color: #fff; }
.topbar .lang button { background: transparent; color: #fff; border-color: var(--sage); }
.topbar .lang button:hover { background: var(--teal-dark); }
.who { display: flex; gap: 12px; align-items: center; color: var(--ink-2); font-size: 14px; }
.lang { display: flex; }

main { max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; }
main.narrow { max-width: 420px; padding-top: 10vh; }
main.medium { max-width: 760px; }
main.wide { max-width: none; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.pagehead p { margin: 4px 0 0; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card.empty { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.grid2 > .card { margin-bottom: 16px; min-width: 0; }

/* ---- controls */
input, select, button, .button { font: inherit; }
input:not([type=checkbox]):not([type=file]), select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--ink); font-variant-numeric: tabular-nums;
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.inline input:not([type=checkbox]):not([type=file]), .inline select { width: auto; }
label { display: block; font-size: 13px; color: var(--ink-2); }
label input, label select { margin-top: 4px; font-size: 15px; }
label.check { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
label.check input { margin: 0; }
button, .button {
  display: inline-block; padding: 8px 14px; border-radius: 7px; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.button:hover, button:hover { text-decoration: none; background: var(--pale-3); }
.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.primary:hover, .button.primary:hover { background: var(--teal-dark); }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
button.link:hover { text-decoration: underline; background: none; }
button.link.danger { color: var(--bad); }

.fields { display: grid; gap: 14px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fields.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields + p, table + .fields, .scroll + p { margin-top: 12px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid transparent; }
.flash.good { background: var(--good-bg); color: var(--good); border-color: #bfe3bf; }
.flash.bad { background: var(--bad-bg); color: var(--bad); border-color: #f1c2c2; }
.flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #ffd99a; }
.card .flash { margin: 10px 0; }

.auth { display: grid; gap: 14px; }
.auth h1 { margin-bottom: 2px; }

/* ---- dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 2px; }
.tile .k { font-size: 13px; color: var(--ink-2); }
.tile { min-width: 0; align-content: start; }
.tile .v { font-size: clamp(21px, 2vw, 28px); font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 15px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.tile .s { font-size: 13px; color: var(--ink-3); }
.big { font-size: 28px; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 4px; font-variant-numeric: tabular-nums; }

.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.alerts li { padding-left: 12px; border-left: 3px solid var(--warn); }
.alerts li.bad { border-left-color: var(--bad); }
.count { display: inline-block; min-width: 22px; padding: 0 6px; text-align: center; border-radius: 99px; background: var(--pale); font-size: 12px; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; font-size: 13px; }
.chip { padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink); }
.chip:hover { border-color: var(--sage); text-decoration: none; }

.chart { position: relative; height: 240px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .zero { stroke: var(--line-strong); stroke-width: 1; }
.chart .hit { fill: transparent; }
.chart .hit:hover, .chart .hit.on { fill: rgba(51, 87, 101, 0.07); }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 150px;
  background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12.5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.tip b { display: block; margin-bottom: 4px; }
.tip div { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }
.tip i, .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: -4px 0 8px; }

/* ---- tables */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
td, th { font-variant-numeric: tabular-nums; }
.mini { margin: 10px 0 12px; }
.mini caption { text-align: left; font-size: 13px; color: var(--ink-3); padding-bottom: 4px; }
.mini th { text-align: left; font-weight: 400; color: var(--ink-2); padding: 6px 12px 6px 0; }
.mini td { text-align: right; padding: 6px 0; white-space: nowrap; }
.mini tr + tr th, .mini tr + tr td { border-top: 1px solid var(--line-soft); }
.mini thead th { font-size: 12.5px; color: var(--ink-3); }
.mini.tanks th:not(:first-child) { text-align: right; padding-right: 0; padding-left: 12px; }
.mini.people td { text-align: left; padding-left: 12px; }
.mini.people td:last-child { text-align: right; }

.data { font-size: 13.5px; }
.data th, .data td { padding: 7px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line-soft); }
.data thead th { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--pale-2); border-bottom: 1px solid var(--line); }
.data tbody th, .data tfoot th, .data thead th:first-child { text-align: left; font-weight: 500; }
.data tbody tr:hover td, .data tbody tr:hover th { background: var(--pale-3); }
.data tfoot td, .data tfoot th { font-weight: 650; border-top: 1px solid var(--line); border-bottom: 0; background: var(--pale-2); }
.data tr.blank td, .data tr.blank th { color: var(--ink-3); }
.report th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.report thead th:first-child, .report tfoot th:first-child { background: var(--pale-2); }
.report .g { border-left: 1px solid var(--line); }
.report thead .groups th { text-align: center; color: var(--ink); }
.report thead .groups th:first-child { text-align: left; }
.report .scroll, .card.flush .scroll { max-height: calc(100vh - 230px); overflow: auto; }
.report thead { position: sticky; top: 0; z-index: 3; }
.report tfoot { position: sticky; bottom: 0; z-index: 2; }

.tabs { display: flex; gap: 4px; margin-bottom: 12px; overflow-x: auto; }
.tabs { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.tabs a { padding: 7px 14px; border-radius: 99px; color: var(--ink-2); white-space: nowrap; }
.tabs a:hover { background: var(--pale); text-decoration: none; }
.tabs a.on { background: var(--teal); color: #fff; font-weight: 600; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: var(--line-soft); color: var(--ink-2); }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }

/* ---- upload and review */
.data td.left, .data th.left { text-align: left; }
.mini.kinds td { text-align: left; white-space: normal; color: var(--ink-2); padding-left: 12px; }
.mini.kinds th { color: var(--ink); white-space: nowrap; }
.mini.kinds th .muted { font-size: 12.5px; margin-left: 4px; }
details.card summary { cursor: pointer; }
#mailbox details { margin-top: 14px; }
#mailbox details summary { cursor: pointer; color: var(--accent); }
details.card summary h2 { display: inline; }
details.card[open] summary { margin-bottom: 14px; }
.dochead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dochead h2 { margin-bottom: 2px; }
.dochead .check { margin: 0; font-size: 14px; color: var(--ink); white-space: nowrap; }
.review tr.same td, .review tr.same th, .review tr.info td { color: var(--ink-3); }
.review tr.change td { background: #fff6e6; }
.review select { width: auto; padding: 4px 8px; font-size: 13px; }
.review td.left { white-space: normal; min-width: 220px; }
.savebar { gap: 10px; }
.verdict { margin: 14px 0 0; }

/* ---- follow-up */
h3 { font-size: 15px; margin: 0 0 4px; }
h2 .count, h3 .count { vertical-align: 2px; margin-left: 4px; font-weight: 500; }
h3.group { margin: 22px 0 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px; }
textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff;
  color: var(--ink); font: inherit; font-size: 15px; margin-top: 4px; resize: vertical;
}
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 70px; }
.item:last-child { border-bottom: 0; padding-bottom: 0; }
.item:target { background: var(--pale-3); box-shadow: -12px 0 0 var(--pale-3), 12px 0 0 var(--pale-3); }
.item .detail { color: var(--ink-2); white-space: pre-line; margin: 4px 0 6px; max-width: 78ch; }
.item .noted { margin: 6px 0; max-width: 78ch; white-space: pre-line; }
.item.row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 4px 14px; }
.item.row .when { color: var(--ink-2); font-size: 13.5px; padding-top: 1px; }
.item.row .amount { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.item details summary { cursor: pointer; color: var(--accent); font-size: 13.5px; margin-top: 4px; }
.respond { display: grid; gap: 10px; margin-top: 8px; max-width: 78ch; }
.gap { margin-top: 12px; }
.followcard { display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; color: var(--ink); padding: 14px 20px; }
.followcard span { color: var(--ink-2); }
.followcard .go { margin-left: auto; color: var(--accent); }
@media print {
  .topbar, .noprint, .flash { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0 0 12px; }
  details.card > *:not(summary) { display: block; }
}
@media (max-width: 720px) {
  .item.row { grid-template-columns: minmax(0, 1fr) auto; }
  .item.row .when { grid-column: 1 / -1; }
}

/* ---- daily entry */
.entry th { text-align: left; font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 4px 10px 4px 0; white-space: nowrap; }
.entry td { padding: 4px 10px 4px 0; }
.entry td:last-child, .entry th:last-child { padding-right: 0; }
.entry .calc { text-align: right; color: var(--ink-2); white-space: nowrap; min-width: 90px; }
.entry tfoot th, .entry tfoot td { padding-top: 10px; font-weight: 650; color: var(--ink); }
.entry.loads input { min-width: 110px; }
.savebar {
  position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--page) 35%);
  display: flex; justify-content: flex-end; z-index: 10;
}
.savebar button { padding: 10px 22px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 0 32px; margin: 14px 0 0; }
.facts div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.steps { margin: 0 0 14px; padding-left: 20px; }
.steps li { margin-bottom: 4px; }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .topbar .hrow { gap: 12px; }
  .topbar .hrow { flex-wrap: wrap; }
  main { padding: 16px 16px 56px; }
  .fields.three, .fields.four, .fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; }
  .tile .v, .big { font-size: 24px; }
  .entry .calc { min-width: 62px; }
  .entry input { min-width: 0; }
  .entry th, .entry td { padding-right: 6px; }
}

/* ---- language button */
.lang button { padding: 4px 12px; border-radius: 99px; font-size: 13.5px; }
.langbar { display: flex; justify-content: flex-end; padding: 14px 24px 0; }

/* ---- Farsi: right-to-left. Amounts stay left-to-right so signs and $ sit where they should. */
[dir="rtl"] body { font-family: "Vazirmatn", "SF Arabic", "Geeza Pro", Tahoma, -apple-system, "Segoe UI", sans-serif; line-height: 1.7; }
[dir="rtl"] h1, [dir="rtl"] .tile .v, [dir="rtl"] .big { letter-spacing: 0; }
[dir="rtl"] .num, [dir="rtl"] .data td, [dir="rtl"] .mini td, [dir="rtl"] .entry .calc,
[dir="rtl"] .chip, [dir="rtl"] .count { unicode-bidi: plaintext; }
[dir="rtl"] .tile .v.num, [dir="rtl"] .big.num, [dir="rtl"] .tile .s .num { display: inline-block; }
[dir="rtl"] .tile, [dir="rtl"] .big { text-align: right; }
[dir="rtl"] .data th, [dir="rtl"] .data td { text-align: left; }
[dir="rtl"] .data tbody th, [dir="rtl"] .data tfoot th, [dir="rtl"] .data thead th:first-child,
[dir="rtl"] .data td.left, [dir="rtl"] .data th.left { text-align: right; }
[dir="rtl"] .report thead .groups th { text-align: center; }
[dir="rtl"] .report thead .groups th:first-child { text-align: right; }
[dir="rtl"] .report th:first-child { left: auto; right: 0; }
[dir="rtl"] .report .g { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .mini th { text-align: right; padding: 6px 0 6px 12px; }
[dir="rtl"] .mini td { text-align: left; }
[dir="rtl"] .mini caption { text-align: right; }
[dir="rtl"] .mini.tanks th:not(:first-child) { text-align: left; padding-left: 0; padding-right: 12px; }
[dir="rtl"] .mini.people td { text-align: right; padding-left: 0; padding-right: 12px; }
[dir="rtl"] .mini.people td:last-child { text-align: left; }
[dir="rtl"] .mini.kinds td { text-align: right; padding-left: 0; padding-right: 12px; }
[dir="rtl"] .entry th { text-align: right; padding: 4px 0 4px 10px; }
[dir="rtl"] .entry td { padding: 4px 0 4px 10px; }
[dir="rtl"] .entry td:last-child, [dir="rtl"] .entry th:last-child { padding-left: 0; }
[dir="rtl"] .entry .calc { text-align: left; }
[dir="rtl"] .facts dd, [dir="rtl"] .item.row .amount { text-align: left; }
[dir="rtl"] .alerts li { padding-left: 0; padding-right: 12px; border-left: 0; border-right: 3px solid var(--warn); }
[dir="rtl"] .alerts li.bad { border-right-color: var(--bad); }
[dir="rtl"] .steps { padding-left: 0; padding-right: 20px; }
[dir="rtl"] h2 small { margin-left: 0; margin-right: 6px; }
[dir="rtl"] h2 .count, [dir="rtl"] h3 .count { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .tip i, [dir="rtl"] .legend i { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .followcard .go { margin-left: 0; margin-right: auto; }
[dir="rtl"] .followcard .go::after { content: " ←"; }
[dir="ltr"] .followcard .go::after { content: " →"; }
[dir="rtl"] .chart { direction: ltr; }
[dir="rtl"] .daynav { direction: ltr; }
[dir="rtl"] input[inputmode="decimal"], [dir="rtl"] input[type="email"], [dir="rtl"] input[type="password"],
[dir="rtl"] input[type="date"], [dir="rtl"] .entry input { direction: ltr; text-align: right; }
[dir="rtl"] .item:target { box-shadow: -12px 0 0 var(--pale-3), 12px 0 0 var(--pale-3); }
@media (max-width: 720px) {
  .langbar { padding: 12px 16px 0; }
}
[dir="rtl"] .mini td .num { unicode-bidi: isolate; direction: ltr; display: inline-block; }

/* ---- documents */
.docs { display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); gap: 16px; align-items: start; }
.doclist { max-height: calc(100vh - 220px); overflow: auto; }
.doclist .listhead { padding: 12px 16px 0; margin: 0; }
.doclist h3.group { margin: 14px 16px 4px; }
.doclist ul { list-style: none; margin: 0; padding: 0; }
.doclist a.doc { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 2px 12px; padding: 9px 16px;
  color: var(--ink); border-top: 1px solid var(--line-soft); }
.doclist a.doc:hover { background: var(--pale-3); text-decoration: none; }
.doclist a.doc.on { background: var(--pale); box-shadow: inset 3px 0 0 var(--accent); }
.doclist .when { color: var(--ink-2); font-size: 13px; padding-top: 1px; }
.doclist .what { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.doclist .figs { grid-column: 2; display: flex; gap: 4px 14px; flex-wrap: wrap; font-size: 13px; }
.viewer { position: sticky; top: 70px; padding: 0; overflow: hidden; }
.viewhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--line); }
.viewhead .small { display: block; }
.viewer iframe { display: block; width: 100%; height: calc(100vh - 230px); min-height: 480px; border: 0; background: var(--pale-2); }
.daydocs { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
[dir="rtl"] .doclist a.doc.on { box-shadow: inset -3px 0 0 var(--accent); }
[dir="rtl"] .daydocs { padding-left: 0; padding-right: 18px; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; }
  .viewer { display: none; }
  .doclist { max-height: none; }
}

.doclist .listhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 16px 6px; }
.doclist .listhead .inline { gap: 4px; font-size: 13px; color: var(--ink-3); }
.doclist details.month { border-top: 1px solid var(--line); }
.doclist details.month > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 11px 16px; font-weight: 600; font-size: 14.5px; }
.doclist details.month > summary::-webkit-details-marker { display: none; }
.doclist details.month > summary:hover { background: var(--pale-3); }
.doclist details.month > summary .tag { font-weight: 500; }
.doclist .chev { width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.doclist details.month[open] > summary .chev { transform: rotate(45deg); }
[dir="rtl"] .doclist .chev { transform: rotate(135deg); margin-right: 0; margin-left: 2px; }
[dir="rtl"] .doclist details.month[open] > summary .chev { transform: rotate(45deg); }
.doclist h3.group { display: none; }
.docfilters label { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.docfilters label input, .docfilters label select { margin-top: 0; }
.docfilters { align-items: flex-end; }
.viewempty { padding: 60px 24px; text-align: center; }

[hidden] { display: none !important; }

/* ---- checks */
.checktiles .tile { color: var(--ink); }
.checktiles .tile:hover { border-color: var(--accent); text-decoration: none; }
ul.plain { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 4px; }
#pos details, #statements details { margin-top: 12px; }
#pos details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }

/* ---- dashboard period picker */
.periodpick select { min-width: 170px; }
.periodpick input[type=date] { width: 150px; }

/* ---- "?" explanations: a round button in each dashboard box's top-right corner, in Farsi too */
.whyhost { position: relative; }
.whyhost > h2, .tile.whyhost > .k { padding-right: 30px; }
.followcard.whyhost { padding-right: 52px; }
.whybtn {
  position: absolute; top: 12px; right: 12px; left: auto; width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-3);
  font-size: 12.5px; font-weight: 700; line-height: 20px; text-align: center;
}
.whybtn:hover { color: var(--teal); border-color: var(--sage); background: #fff; }
.whybtn.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.why { font-size: 13px; line-height: 1.45; color: var(--ink-2); background: var(--pale-3); border-left: 3px solid var(--sage);
       border-radius: 0 6px 6px 0; padding: 8px 10px; margin: 0 0 12px; }
.why p { margin: 0 0 6px; } .why p:last-child { margin: 0; }
.tile .why { margin: 8px 0 0; }
.followcard .why { flex-basis: 100%; margin: 4px 0 0; }
[dir="rtl"] .why { border-left: 0; border-right: 3px solid var(--sage); border-radius: 6px 0 0 6px; }

/* ---- Every word of a heading starts with a capital: "Parkland Account" (owner, 2026-10-26). Done in
   CSS so the English source texts, and the Farsi looked up from them, stay as they are. The small
   grey notes after a heading are sentences and keep their case, as do follow-up question titles. */
h1, h2, h3.group, .topbar nav a, .tabs a, .tile .k, .followcard > strong,
.data thead th, .mini thead th, .mini caption { text-transform: capitalize; }
h2 small, h2 .count, h3.group .count { text-transform: none; }

/* ---- Sheet vs Documents */
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 16px 20px 8px; }
.cardhead h2 { margin: 0; }
.cardhead .tabs { margin: 0; }
.pad { padding: 12px 20px 20px; }
.warnval { color: var(--warn); font-weight: 600; }
.data tbody tr.on th, .data tbody tr.on td { background: var(--pale); }
.mini.cmp th:not(:first-child), .mini.cmp td { text-align: right; padding-left: 14px; }
.mini.cmp { width: 100%; }
.mini.cmp th:first-child { min-width: 170px; white-space: normal; }

/* ---- the phone app (/app) */
html:has(body.phone) { background: var(--teal); }
body.phone { background: var(--teal); }
.appshell { background: var(--page); min-height: 100vh; min-height: 100dvh; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
.appbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--teal); color: #fff; }
.appbar .wordmark { font-size: 24px; }
.appbar-end { display: flex; gap: 8px; }
.pill { padding: 5px 12px; border-radius: 99px; font-size: 13px; background: transparent; color: #fff; border: 1px solid var(--sage); }
.pill:hover { background: var(--teal-dark); }
.appmain { max-width: 640px; margin: 0 auto; padding: 14px 14px 24px; }
.apphead { margin: 2px 0 14px; display: grid; gap: 8px; }
.apphead h1 { font-size: 22px; }
.apphead p { margin: 0; }
.apphead .periodpick { display: grid; gap: 8px; }
.apphead .periodpick select, .apphead .periodpick input { width: 100%; }
.apphead .periodpick .custom:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.apphead .periodpick .custom button { grid-column: 1 / -1; }
.apptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.apptiles .tile { padding: 12px 14px; }
.apptiles .tile .v { font-size: 21px; }
.appmain .card { padding: 16px; margin-bottom: 12px; }
.appmain .chart { height: 200px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 4px 7px; color: var(--ink-3);
  font-size: 11.5px; text-decoration: none; text-transform: capitalize; }
.tabbar a svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar a.on { color: var(--teal); font-weight: 650; }
.tabbar a.on svg { fill: var(--teal); }
.tankrow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tankrow > div { display: grid; gap: 1px; }
.tankrow .k { font-size: 12px; color: var(--ink-2); }
.tankrow .v { font-size: 18px; font-weight: 650; }
.tankrow .v small { font-size: 12px; font-weight: 400; color: var(--ink-2); }
.tankrow .s { font-size: 12px; color: var(--ink-3); }
.kindpick { border: 0; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.kindpick legend { font-weight: 600; margin-bottom: 6px; }
.kindopt { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong);
  border-radius: 10px; font-size: 16px; color: var(--ink); background: #fff; }
.kindopt:has(input:checked) { border-color: var(--teal); background: var(--pale-3); box-shadow: inset 0 0 0 1px var(--teal); }
.kindopt input[type=radio] { margin: 0; padding: 0; width: 20px; height: 20px; flex: none; accent-color: var(--teal); }
.button.wide, button.wide { display: block; width: 100%; text-align: center; }
.shoot { padding: 16px; font-size: 17px; cursor: pointer; }
.center { text-align: center; }
.photo { display: block; width: 100%; max-height: 55vh; object-fit: contain; border-radius: 8px; background: var(--pale-2); margin-bottom: 12px; }
.warnlist li { color: var(--warn); }
.appviewer { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.appviewer img { display: block; width: 100%; height: auto; }
.appviewer iframe { display: block; width: 100%; height: 70vh; border: 0; }
.back { font-size: 14px; }
.back::before { content: "‹ "; }
[dir="rtl"] .back::before { content: "› "; }
.chipsrow { flex-wrap: nowrap; margin-bottom: 12px; }
.appmonth summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; cursor: pointer; font-weight: 600; text-transform: capitalize; }
.applist { list-style: none; margin: 0; padding: 0; }
.applist a { display: grid; gap: 2px; padding: 11px 16px; border-top: 1px solid var(--line-soft); color: var(--ink); text-decoration: none; }
.applist a:hover { background: var(--pale-3); }
.applist .t { font-weight: 550; }
.applist .s { font-size: 12.5px; color: var(--ink-2); }
.appmain input:not([type=checkbox]):not([type=radio]):not([type=file]), .appmain select { font-size: 16px; } /* no zoom on iPhone */
.askcard { border-color: var(--amber); box-shadow: inset 4px 0 0 var(--amber); }
[dir="rtl"] .askcard { box-shadow: inset -4px 0 0 var(--amber); }

/* ---- Accounts: one box per person */
.people { display: grid; gap: 0; }
.person summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; list-style: none; }
.person summary::-webkit-details-marker { display: none; }
.person summary::before { content: "›"; font-size: 20px; line-height: 1; color: var(--ink-3); transition: transform .15s; }
.person[open] summary::before { transform: rotate(90deg); }
[dir="rtl"] .person summary::before { content: "‹"; }
[dir="rtl"] .person[open] summary::before { transform: rotate(-90deg); }
.person .who-name { font-weight: 600; }
.person .tags { display: flex; gap: 4px; flex-wrap: wrap; }
.person .last { margin-left: auto; }
[dir="rtl"] .person .last { margin-left: 0; margin-right: auto; }
.person[open] summary { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.personform .areas { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 12px 0; display: grid; gap: 6px; }
.personform .areas legend { font-weight: 600; padding: 0 4px; }
.personform .area { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink); }
.personform .area input { margin: 0; flex: none; }
.personform details.pw summary { cursor: pointer; color: var(--accent); font-size: 14px; }

/* Year So Far: the year once, beside its months */
.data tbody th.yearcell { vertical-align: top; font-weight: 650; border-right: 1px solid var(--line-soft); }
[dir="rtl"] .data tbody th.yearcell { border-right: 0; border-left: 1px solid var(--line-soft); }
.data tbody tr:hover th.yearcell { background: var(--surface); }

/* ---- tank pictures */
.tankviz { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 10px; }
.tankfig { margin: 0; display: grid; justify-items: center; align-content: start; gap: 6px; text-align: center; }
.tankfig svg { width: 100%; max-width: 160px; height: auto; }
.tankfig .tankbody { fill: #f4f7f7; }
.tankfig .tankedge { fill: none; stroke: #7d8f95; stroke-width: 2.5; }
.tankfig .tankpart { fill: #a7b6ba; stroke: #7d8f95; stroke-width: 1.2; }
.tankfig .tankground { stroke: var(--line-strong); stroke-width: 2; stroke-linecap: round; }
.tankfig .tankpct { font: 700 20px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: var(--ink);
  paint-order: stroke; stroke: rgba(255, 255, 255, .9); stroke-width: 4px; }
.tankfig .tankpct.unknown { font-size: 14px; fill: var(--ink-3); }
.tankfig.low .tankedge { stroke: var(--warn); }
.tankfig.over .tankedge { stroke: var(--bad); }
.tankfig figcaption { display: grid; gap: 1px; font-size: 13px; line-height: 1.35; }
.tankfig figcaption .num { font-weight: 600; }
.tanksizes summary { cursor: pointer; color: var(--accent); font-size: 14px; }
.tanksizes form { align-items: end; }

/* ---- pull down to reload, in the phone app */
.ptr { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 56px); z-index: 40; width: 38px; height: 38px;
  margin-left: -19px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  display: grid; place-items: center; transform: translateY(-80px); opacity: 0; pointer-events: none; }
.ptr svg { width: 20px; height: 20px; fill: var(--teal); }
.ptr.ready svg { fill: var(--amber); }
.ptr.spin svg { animation: ptrspin .8s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }
/* Year So Far reads left to right, every column aligned to its left edge (owner, 2026-10-26) */
.data.leftcols th, .data.leftcols td { text-align: left; }
[dir="rtl"] .data.leftcols th, [dir="rtl"] .data.leftcols td { text-align: right; }
