/* LedgerNest v10.8 - phone layout (portrait). Loaded after theme.css.
   Only applies on a narrow screen; the PC / laptop layout is unchanged.
   Wide tables that do not fit the phone are turned into one card per row
   by js/mobile.js (class ln-stack), so nothing has to be scrolled sideways. */

@media screen and (max-width: 900px) {
  /* the menu drawer: full height of the visible screen (phone address bar) */
  .app.tb .sidebar.rail { height: 100dvh; }
}

@media screen and (max-width: 600px) {
  /* pop-ups (new ledger, bank split, pick ledger...) fit the screen */
  .mask { padding: 8px !important; align-items: flex-start !important; }
  .modal, .modal.wide {
    box-sizing: border-box; width: calc(100vw - 16px) !important; max-width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 16px); padding: 14px !important; border-radius: 12px;
  }
  .modal .form-2, .modal .form-3, .modal .grid-2 { grid-template-columns: 1fr !important; }
  .lnw-ov { padding: 8px !important; }
  .lnw-ov .card, .lnb-card, .lnb-card.wide { box-sizing: border-box; width: 100% !important; max-height: calc(100dvh - 16px); padding: 16px !important; }

  /* easier to tap */
  .btn, button.tab, .tab-chip, .content select, .modal select { min-height: 36px; }
  .btn.tiny, .btn.small { min-height: 32px; }
  .content input[type=checkbox], .modal input[type=checkbox] { width: 20px; height: 20px; }
  .content input, .content select, .content textarea { max-width: 100%; box-sizing: border-box; }

  /* filter rows: dates and search share the width instead of running off the edge */
  .filter-bar, .filter-bar.compact { gap: 6px; }
  .filter-bar input[type=date], .filter-bar.compact input[type=date] { width: auto; flex: 1 1 130px; min-width: 0; }
  .filter-bar .qbox, .filter-bar input[type=search], .filter-bar input[type=text] { width: auto; flex: 1 1 160px; min-width: 0; }
  .filter-bar select { flex: 1 1 140px; min-width: 0; }

  /* summary boxes two to a row instead of one long column */
  .stat-row { display: grid !important; grid-template-columns: 1fr 1fr; }
  .stat-row .stat { border-bottom: 1px solid var(--line); }
  .stat-row .stat:nth-child(odd) { border-right: 1px solid var(--line); }

  .grid-4 > *, .grid-2 > * { min-width: 0; }
  .kpi .lbl { white-space: normal; overflow-wrap: anywhere; }

  /* page title rows wrap neatly */
  .page-head, .sheet-head, .card-head { flex-wrap: wrap; gap: 8px; }

  /* ---- wide tables as cards (js/mobile.js marks them ln-stack) ----
     each row is a card: the first column is its title, the rest sit two to
     a line with a small label above each value */
  .content table.ln-stack, .modal table.ln-stack, .lnb-card table.ln-stack {
    display: block; width: 100% !important; min-width: 0 !important; border: 0; background: transparent;
  }
  table.ln-stack > thead { display: none; }
  table.ln-stack > tbody, table.ln-stack > tfoot { display: block; }
  table.ln-stack > caption { display: block; }
  table.ln-stack > tbody > tr, table.ln-stack > tfoot > tr {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 14px; position: relative;
    border: 1px solid var(--line, #e2e6e4); border-radius: 10px; padding: 10px 12px; margin: 0 0 8px; background: var(--card, #fff);
  }
  table.ln-stack > tfoot > tr { background: var(--line-soft, #f3f6f4); font-weight: 700; }
  table.ln-stack > tbody > tr > *, table.ln-stack > tfoot > tr > * {
    display: block; width: auto !important; max-width: none !important; min-width: 0 !important; height: auto !important;
    padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal !important;
    position: static !important; overflow-wrap: anywhere; background: transparent !important;
  }
  table.ln-stack > tbody > tr > *::before, table.ln-stack > tfoot > tr > *::before {
    content: attr(data-l); display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .03em; line-height: 1.3;
    text-transform: uppercase; color: var(--muted, #6b7671); margin-bottom: 1px; white-space: normal;
  }
  table.ln-stack > tbody > tr > [data-l=""]::before, table.ln-stack > tfoot > tr > [data-l=""]::before,
  table.ln-stack > tbody > tr > .ln-first::before { display: none; }
  table.ln-stack > tbody > tr > .ln-empty, table.ln-stack > tfoot > tr > .ln-empty { display: none !important; }
  table.ln-stack > tbody > tr > .ln-first { grid-column: 1 / -1; font-weight: 700; font-size: 15px; padding-right: 30px !important; }
  table.ln-stack > tbody > tr > .ln-wide, table.ln-stack > tfoot > tr > .ln-wide { grid-column: 1 / -1; }
  /* the tick box for "Delete selected" sits in the card's corner */
  table.ln-stack > tbody > tr > .ln-chk { position: absolute !important; top: 10px; right: 10px; }
  table.ln-stack > tbody > tr > .ln-chk::before { display: none; }
  /* Edit / Delete buttons: a row along the bottom */
  table.ln-stack > tbody > tr > .ln-act { grid-column: 1 / -1; display: flex !important; flex-wrap: wrap; gap: 6px; }
  table.ln-stack > tbody > tr > .ln-act::before { display: none; }
  /* section headings / "nothing here" rows */
  table.ln-stack > tbody > tr.ln-full, table.ln-stack > tfoot > tr.ln-full { display: block; border: 0; background: transparent; padding: 6px 2px; }
  table.ln-stack > tbody > tr.ln-full > *::before { display: none; }
  table.ln-stack > tbody > tr:hover { background: var(--card, #fff); }
  table.ln-stack > tbody > tr > td > input:not([type=checkbox]):not([type=radio]),
  table.ln-stack > tbody > tr > td > select, table.ln-stack > tbody > tr > td > textarea { width: 100% !important; }
  table.ln-stack > tbody > tr > td .tag, table.ln-stack > tbody > tr > td .pill { display: inline-block; }

  /* statements and short lists: kept as columns, just made to fit */
  .content table.ln-fit, .modal table.ln-fit { width: 100% !important; min-width: 0 !important; font-size: 12px; }
  table.ln-fit th, table.ln-fit td { padding: 6px 5px !important; white-space: normal; }
  table.ln-fit th { font-size: 10px; letter-spacing: .02em; }
  table.ln-fit th, table.ln-fit th.num { white-space: normal !important; }
  table.ln-fit td.num, table.ln-fit .amt { white-space: nowrap; }
  table.ln-fit .c-note { width: 30px !important; }

  #stmt-paper .a4-sheet { padding: 12px 10px; }
  #stmt-paper { padding-left: 0; padding-right: 0; }

  /* the ledger book's period / dates / search bar */
  .led-bar, .led-bar .lb-grp { flex-wrap: wrap !important; gap: 6px; }
  .led-bar label { display: flex; align-items: center; gap: 4px; flex: 1 1 140px; min-width: 0; }
  .led-bar label input { flex: 1; min-width: 0; width: auto !important; }
  .led-bar .lb-search { flex: 1 1 100%; display: flex; gap: 6px; }
  .led-bar .lb-search input { flex: 1; min-width: 0; width: auto !important; }
  .led-pin .between { flex-wrap: wrap; gap: 8px; }
  .led-banner { white-space: normal; }

}

body.lnw-has-inst .content, body.lnw-has-inst .login { padding-bottom: 96px !important; }
/* "Install LedgerNest" bar - phones only, until installed or closed */
.lnw-inst {
  position: fixed; left: 50%; right: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 99990;
  display: flex; align-items: center; gap: 10px; background: #0f1a33; color: #fff; border-radius: 14px;
  padding: 10px 10px 10px 12px; box-shadow: 0 10px 30px rgb(0 0 0 / .3); font: 13px/1.35 Inter, "Segoe UI", sans-serif;
  max-width: 460px; margin: 0 auto;
}
@media screen and (min-width: 601px) { .lnw-inst { transform: translateX(-50%); } }
@media screen and (max-width: 600px) { .lnw-inst { left: 8px; right: 8px; } }
.lnw-inst img { width: 36px; height: 36px; border-radius: 8px; background: #fff; flex: 0 0 auto; }
.lnw-inst div { flex: 1; min-width: 0; }
.lnw-inst b { display: block; font-size: 14px; }
.lnw-inst small { color: #c9d3e6; }
.lnw-inst button { border: 0; border-radius: 9px; font: inherit; font-weight: 700; cursor: pointer; }
.lnw-inst .go { background: #12a37f; color: #fff; padding: 9px 14px; }
.lnw-inst .x { background: transparent; color: #c9d3e6; font-size: 20px; padding: 4px 6px; }
.lnw-inst-ios { position: fixed; inset: 0; z-index: 99995; background: rgb(15 26 51 / .5); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.lnw-inst-ios .card { background: #fff; color: #0f1a33; border-radius: 16px; padding: 18px; width: min(420px, 100%); box-sizing: border-box; font: 14px/1.5 Inter, "Segoe UI", sans-serif; }
.lnw-inst-ios ol { margin: 8px 0 12px; padding-left: 20px; }
.lnw-inst-ios li { margin: 6px 0; }
.lnw-inst-ios .btn { width: 100%; }
.ln-backtoast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 99999; background: #0f1a33; color: #fff; padding: 8px 16px; border-radius: 999px; font: 13px Inter, "Segoe UI", sans-serif; }

/* opened as an installed app: no browser bar, keep clear of the notch */
@media (display-mode: standalone) {
  .login.lnw { padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important; }
}

@media screen and (max-width: 600px) {
  /* ---- lists as compact rows (js/mobile.js marks them ln-list) ----
     line 1: name / narration ........ amount (or Debit | Credit)
     line 2: date · no. · kind · details           tick  Edit */
  .content table.ln-list, .modal table.ln-list { display: block; width: 100% !important; min-width: 0 !important; border: 0; background: transparent; font-size: 13.5px; }
  table.ln-list > thead { display: none; }
  table.ln-list > thead.ln-thead { display: block; }
  table.ln-list > tbody, table.ln-list > tfoot { display: block; }
  table.ln-list > thead > tr, table.ln-list tr.ln-row {
    display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--ln-amts, 1), auto); column-gap: 12px; align-items: baseline;
    padding: 9px 2px; border-bottom: 1px solid var(--line, #e2e6e4); background: transparent;
  }
  table.ln-list.ln-drcr > thead > tr, table.ln-list.ln-drcr tr.ln-row { grid-template-columns: minmax(0, 1fr) 86px 86px; column-gap: 8px; }
  table.ln-list > thead > tr { padding: 6px 2px; border-bottom: 1.5px solid var(--line-strong, #c9d1cd); position: static; }
  table.ln-list > thead > tr > th { display: block; padding: 0 !important; border: 0 !important; background: none !important; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted, #6b7671); position: static !important; }
  table.ln-list > thead > tr > th.ln-h-amt { text-align: right; }
  table.ln-list tr.ln-row > td, table.ln-list tr.ln-row > th {
    display: block; width: auto !important; min-width: 0 !important; max-width: none !important; height: auto !important;
    padding: 0 !important; border: 0 !important; background: none !important; text-align: left; white-space: normal; position: static !important;
  }
  table.ln-list .ln-hide { display: none !important; }
  table.ln-list tr.ln-row > .ln-main {
    order: 0; font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--ink, #14211b); white-space: normal !important;
    display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
  }
  table.ln-list tr.ln-row > .ln-main a, table.ln-list tr.ln-row > .ln-main button.led-link { color: inherit; font: inherit; text-align: left; padding: 0; }
  table.ln-list tr.ln-row > .ln-main * { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; max-width: none !important; display: inline; }
  table.ln-list tr.ln-row > .ln-main .muted, table.ln-list tr.ln-row > .ln-main small { display: block; font-weight: 400; font-size: 12px; }
  table.ln-list tr.ln-row > .ln-amt { text-align: right !important; white-space: nowrap !important; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13.5px; }
  table.ln-list tr.ln-row > .ln-main .to { padding-left: 0 !important; font-weight: 400; }
  table.ln-list tr.ln-row > .ln-meta {
    order: 9; grid-column: 1 / -1; display: flex !important; flex-wrap: wrap; align-items: center; gap: 2px 6px;
    margin-top: 3px; font-size: 12px; line-height: 1.5; color: var(--muted, #6b7671); font-weight: 400;
  }
  .ln-meta .ln-m + .ln-m::before { content: "·"; margin-right: 6px; opacity: .6; }
  .ln-meta .ln-m i { font-style: normal; opacity: .85; }
  .ln-meta .ln-m b, .ln-meta .ln-m strong { font-weight: 600; }
  .ln-meta .tag, .ln-meta .pill, .ln-meta .badge, .ln-meta [class*="pill"], .ln-meta [class*="tag-"] { font-size: 10.5px !important; padding: 1px 7px !important; min-width: 0 !important; line-height: 1.5; }
  .ln-meta .ln-tail { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
  .ln-meta .ln-tail .btn, .ln-meta .ln-tail button { min-height: 28px !important; padding: 3px 10px !important; font-size: 12px !important; }
  .ln-meta .ln-tail input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
  table.ln-list > tfoot tr.ln-row { font-weight: 700; border-bottom: 0; border-top: 1.5px solid var(--line-strong, #c9d1cd); }
  table.ln-list > tfoot tr.ln-row > .ln-meta { font-weight: 600; }
  table.ln-list tr.ln-full { display: block; padding: 8px 2px; border-bottom: 1px solid var(--line, #e2e6e4); }
  table.ln-list tr.ln-full > * { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; }
  table.ln-list tr.ln-row:active { background: var(--line-soft, #f3f6f4); }

  /* summary tiles two to a row, smaller */
  .kpi-grid, .grid-4:has(.kpi-tile) { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .kpi-tile { padding: 10px 12px !important; min-height: 0 !important; }
  .kpi-tile .kpi-num { font-size: 17px !important; }

  /* filter rows: small and tidy */
  .filter-bar { padding: 8px !important; }
  .filter-bar > *, .filter-bar label { font-size: 13px; }
  .filter-bar input, .filter-bar select, .filter-bar .btn { min-height: 34px !important; height: 34px; padding-top: 4px !important; padding-bottom: 4px !important; }
  .filter-bar label { margin: 0; }
  h1 { font-size: 21px !important; }
  .lede { font-size: 12.5px; }
}
@media screen and (max-width: 600px) {
  /* ledger book: Date | Particulars | Debit | Credit, running balance on line 2 */
  table.ln-list.ln-dated > thead > tr, table.ln-list.ln-dated tr.ln-row { grid-template-columns: 50px minmax(0, 1fr) 74px 74px; column-gap: 6px; }
  table.ln-list.ln-dated tr.ln-row > .ln-date, table.ln-list.ln-dated > thead > tr > .ln-h-date { font-size: 11px !important; }
  table.ln-list.ln-dated > thead > tr > th { overflow: visible; white-space: nowrap; }
  /* the entry no. opens the entry, so no separate Edit button on each line */
  table.ln-list.ln-dated .ln-tail .btn, table.ln-list.ln-dated .ln-tail button { display: none !important; }
  table.ln-list.ln-dated tr.ln-row > .ln-meta { font-size: 11.5px; }
  #led-book { padding: 10px 8px !important; margin-left: -6px !important; margin-right: -6px !important; }
  #led-book .led-amt-scroll { padding: 0 !important; margin: 0 !important; overflow: visible !important; }
  table.ln-list.ln-dated tr.ln-row > .ln-date, table.ln-list.ln-dated > thead > tr > .ln-h-date { order: -1; font-size: 12px; color: var(--muted, #6b7671); white-space: nowrap !important; }
  table.ln-list.ln-dated > thead > tr > .ln-h-date { display: block; }
  table.ln-list.ln-dated tr.ln-row > .ln-meta { grid-column: 2 / -1; }
  table.ln-list.ln-drcr tr.ln-row > .ln-amt { font-size: 12.5px; }
  table.ln-list tr.ln-row > .ln-main .led-acct { display: block; font-weight: 600; }
  table.ln-list tr.ln-row > .ln-main .led-acct .muted { display: inline; font-size: inherit; font-weight: 400; }
  table.ln-list tr.ln-row > .ln-main .led-narr { display: block; font-weight: 400; font-size: 12px; color: var(--muted, #6b7671); }
  table.ln-list tr.ln-row > .ln-main:has(.led-acct) { -webkit-line-clamp: 3; }
  table.ln-list tr.cb-row, table.ln-list tr.ob-row { background: var(--line-soft, #f3f6f4) !important; }
}
@media screen and (max-width: 600px) { table.ln-list tr.ob-row > .ln-main, table.ln-list tr.cb-row > .ln-main { display: block !important; -webkit-line-clamp: unset; } }

/* ---- v10.13 phone: top bar, page heads, tabs and filter rows ---- */
@media screen and (max-width: 600px) {
  /* top bar: logo row, then one tidy row - status pills scroll sideways if they do not fit,
     bell and the account button always visible */
  .tb-top .top-right { display: flex; flex-wrap: nowrap !important; gap: 6px !important; min-width: 0; width: 100%; }
  .tb-top .top-right > .saved-pill { flex: 0 0 auto; font-size: 11px; padding: 3px 8px; }
  #plan-pill-slot, #bk-pill-slot { flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; display: inline-flex !important; gap: 6px; }
  #plan-pill-slot::-webkit-scrollbar, #bk-pill-slot::-webkit-scrollbar { display: none; }
  .tb-top .bk-pill { font-size: 11px; padding: 4px 9px; }
  .tb-top .bk-pill.plan-fine, #bk-pill-slot .bk-pill.ok { display: none; }   /* all fine: paid plan, Drive copy up to date */
  .tb-top .top-right .bell { flex: 0 0 auto; margin-left: auto; width: 36px; height: 36px; }
  .tb-top .top-right .avatar-wrap { flex: 0 0 auto; }
  .tb-top .top-right .avatar { width: 36px; height: 36px; }

  /* less space around every screen */
  .content { padding-left: 8px !important; padding-right: 8px !important; }
  .content > .page, .content > div > .panel, .panel { border-radius: 10px; }
  .panel-head { padding: 10px 10px !important; }
  .panel-cap { padding: 0 10px !important; }
  .panel table.ln-list, .card table.ln-list { padding: 0 8px; box-sizing: border-box; }

  /* page head: title on the left, its tabs in one row under it */
  .page-head { margin-bottom: 10px !important; gap: 8px !important; align-items: flex-start !important; }
  .page-head > .row, .page-head .ent-tabs, .page-head > div:last-child:not(:first-child) { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
  .page-head .tab, .page-head .btn { font-size: 12.5px !important; padding: 6px 12px !important; min-height: 32px !important; white-space: nowrap; }
  .due-bar.due-ok { padding: 6px 10px; font-size: 12px; }
  .due-bar.due-ok a.due-btn { padding: 3px 10px; font-size: 12px; }

  /* Sales & Purchases kinds: one row that scrolls sideways */
  .doc-tabs { display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 2px; padding: 0 6px !important; scrollbar-width: none; }
  .doc-tabs::-webkit-scrollbar { display: none; }
  .doc-tab { flex: 0 0 auto; white-space: nowrap; padding: 10px 10px !important; font-size: 13px !important; }

  /* filter rows: From / To side by side, buttons small and on one line */
  .entries-actions { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; width: 100%; align-items: center; }
  .entries-actions > label { flex: 1 1 38%; min-width: 0; font-size: 11.5px !important; }
  .entries-actions > label + .tab-chip, .entries-actions > label + .btn { flex: 0 0 auto; }
  .entries-actions > label input { width: 100% !important; min-width: 0; font-size: 13px; padding: 4px 8px; height: 32px; }
  .entries-actions > .qbox, .entries-actions > input { flex: 1 1 140px; min-width: 0; height: 32px; }
  .entries-actions > select { flex: 0 1 auto; height: 32px; font-size: 13px; }
  .entries-actions .tab-chip, .entries-actions .btn, .entries-actions summary.btn { min-height: 32px !important; height: 32px; padding: 4px 11px !important; font-size: 12.5px !important; white-space: nowrap; }
  .entries-actions .dd-menu { flex: 0 0 auto; }
  .panel-head > .row.entries-actions + .row.entries-actions { margin-top: 0 !important; }

  /* ledger book: title, Add entry, Close, Filters on top; the rest folds */
  #led-book .led-pin .between { flex-wrap: wrap; gap: 6px; }
  #led-book .led-banner { font-size: 12.5px; padding: 4px 8px; }
  #led-book .led-pin .between .row { flex-wrap: wrap !important; gap: 6px !important; }
  #led-book .led-pin .btn { min-height: 32px !important; padding: 4px 11px !important; font-size: 12.5px !important; }
  #led-book:not(.ln-filters-open) .led-bar, #led-book:not(.ln-filters-open) .lb-note { display: none !important; }
  #led-book .led-bar { margin-top: 8px; }
  #led-book .led-bar .btn, #led-book .led-bar select, #led-book .led-bar input { height: 32px; min-height: 32px !important; font-size: 13px; }
}

/* ---- v10.14 phone ledger book (js/mobile.js phoneLedger): like the LedgerNest phone viewer ---- */
@media screen and (max-width: 600px) {
  #led-book.ln-pl { padding: 0 !important; margin: 6px -4px 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  #led-book.ln-pl .led-pin .led-banner, #led-book.ln-pl .led-pin > .between, #led-book.ln-pl .ln-filt-btn { display: none !important; }
  #led-book.ln-pl .lb-one { display: none !important; }
  #led-book.ln-pl.ln-filters-open .lb-one { display: flex !important; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
  #led-book.ln-pl.ln-filters-open .lb-one .lb-title, #led-book.ln-pl.ln-filters-open .lb-one #qe-open, #led-book.ln-pl.ln-filters-open .lb-one [data-ln-act] { display: none !important; }
  #led-book.ln-pl .lb-one .lb-dates { flex: 1 1 100%; }
  #led-book.ln-pl .lb-one .ln-search { flex: 1 1 auto; }
  #led-book.ln-pl.pl-cols .led-amt-scroll { display: none !important; }
  #led-book.ln-pl.pl-cols .led-pin .lb-right { display: none !important; }
  .pl-view { margin: 0 0 8px; }
  .pl-head { display: flex; align-items: center; gap: 10px; padding: 4px 2px 8px; }
  .pl-head .pl-back, .pl-head .pl-add { flex: none; border: 0; background: transparent; color: var(--teal, #0e7a60); font: inherit; font-size: 15px; font-weight: 700; padding: 6px 2px; }
  .pl-head .pl-add { border: 1px solid var(--line, #d9e2de); border-radius: 9px; padding: 6px 10px; font-size: 13px; }
  .pl-head .pl-t { min-width: 0; flex: 1; }
  .pl-head .pl-t b { display: block; font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pl-head .pl-t small { display: block; color: var(--muted, #6b7671); font-size: 12px; }
  .pl-bal { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-radius: 11px; background: var(--teal-soft, #e3f4ee); color: var(--teal, #0e7a60); font-size: 13.5px; margin: 0 0 8px; }
  .pl-bal b { font-size: 19px; font-variant-numeric: tabular-nums; }
  .pl-mode { display: flex; gap: 3px; padding: 3px; background: var(--line-soft, #eef2f1); border-radius: 10px; margin: 0 0 8px; }
  .pl-mode button { flex: 1; height: 34px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: 13px; font-weight: 650; color: var(--ink, #14211b); white-space: nowrap; }
  .pl-mode button.on { background: var(--card, #fff); color: var(--teal, #0e7a60); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
  .pl-mode button.ord { flex: 0 0 auto; padding: 0 9px; color: var(--teal, #0e7a60); }
  .pl-mode button.filt { flex: 0 0 auto; width: 36px; color: var(--muted, #6b7671); font-size: 15px; }
  #led-book.ln-pl.pl-list .pl-wrap { display: none; }
  .pl-wrap { border: 1px solid var(--line, #d9e2de); border-radius: 11px; overflow: hidden; background: var(--card, #fff); }
  table.lcols { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 11.5px; margin: 0; }
  #led-book table.lcols { min-width: 0 !important; width: 100% !important; max-width: 100%; }
  #led-book table.lcols thead th { background: #1e2a3a !important; color: #fff !important; }
  #led-book table.lcols td.lc-p { white-space: normal !important; max-width: 0; }
  #led-book table.lcols th, #led-book table.lcols td { padding: 7px 3px !important; font-size: 11.5px !important; height: auto !important; }
  #led-book table.lcols th { font-size: 10px !important; padding: 8px 3px !important; }
  #led-book table.lcols .lc-d { padding-left: 6px !important; }
  #led-book table.lcols .lc-b { padding-right: 6px !important; }
  #led-book table.lcols .lc-p div { font-size: 12px !important; }
  table.lcols th { position: sticky; top: 0; z-index: 1; background: #1e2a3a; color: #fff; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 8px 4px; text-align: left; border: 0; }
  table.lcols td { padding: 7px 4px; border: 0; border-bottom: 1px solid var(--line-soft, #eef2f1); vertical-align: top; background: transparent; }
  table.lcols .lc-d { width: 1%; color: var(--muted, #6b7671); white-space: nowrap; padding-left: 7px; padding-right: 5px; }
  table.lcols th.lc-d { color: #fff; }
  table.lcols .lc-p { width: 99%; }
  table.lcols .lc-p div { font-size: 12.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
  table.lcols .lc-p small { color: var(--muted, #6b7671); font-size: 10.5px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
  table.lcols .lc-n { width: 1%; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  table.lcols .lc-b { padding-right: 7px; font-weight: 600; }
  table.lcols tr.lc-ob td { background: var(--line-soft, #eef2f1); font-weight: 600; }
  table.lcols tr.lc-cb td { background: var(--line-soft, #eef2f1); font-weight: 800; border-top: 2px solid #1e2a3a; border-bottom: 3px double #1e2a3a; }
  table.lcols tbody tr[data-vid]:active td { background: var(--teal-soft, #e3f4ee); }
  table.lcols .lc-none { text-align: center; color: var(--muted, #6b7671); padding: 18px; }
}
@media screen and (max-width: 380px) { table.lcols { font-size: 10.5px; } table.lcols .lc-p div { font-size: 11.5px; } }
@media screen and (max-width: 600px) {
  #led-book table.lcols.pl-small td.lc-n, #led-book table.lcols.pl-small td.lc-d { font-size: var(--pl-fs, 11px) !important; }
  #led-book table.lcols.pl-small td, #led-book table.lcols.pl-small th { padding-left: 2px !important; padding-right: 2px !important; }
}
@media screen and (max-width: 600px) {
  .entries-actions > select.slim { flex: 1 1 60% !important; }
  .entries-actions > label.ln-dl { flex: 1 1 42% !important; }
  .entries-actions > label.ln-dl input { flex: 1; }
}
@media screen and (max-width: 600px) {
  #stmt-paper table.stmt3 th.num, #stmt-paper table.stmt3 td.num { width: 27% !important; }
  #stmt-paper table.stmt3 th.c-note, #stmt-paper table.stmt3 td.c-note { width: 9% !important; }
  #stmt-paper table.stmt3 th.c-pct, #stmt-paper table.stmt3 td.c-pct { width: 14% !important; }
}
@media screen and (max-width: 600px) {
  table.lcols tr.brs-pend td { background: #fffaf0; }
  table.lcols .lc-d .brs-m { display: block; margin: 2px 0 0; width: 15px; height: 15px; font-size: 9px; }
  .brs-strip { display: none; }
  #led-book.ln-pl.ln-filters-open .brs-strip { display: flex; }
}
@media (max-width: 600px) {
  table.ln-list tr.ln-grp-ph { display: flex !important; justify-content: space-between; align-items: center; background: var(--bg-soft, #f4f3ef); padding: 5px 8px !important; font-size: 12px; }
  table.ln-list tr.ln-grp-ph > td { display: inline !important; }
  table.ln-list tr.ln-grp-ph > td:empty { display: none !important; }
  table.day-grp td.row-acts { display: none !important; }
  table.day-grp td.chk-hov input { opacity: 1; }
}
@media (max-width: 600px) {
  table.lg-tbl .ln-meta, table.lg-tbl .lg-more { display: none !important; }
  table.lg-tbl tr.lg-row > td:first-child { padding-left: 14px !important; }
}
@media (max-width: 600px) {
  .ev-tabs { flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .ev-tabs::-webkit-scrollbar { display: none; }
  .ev-tabs .tab { flex: none; white-space: nowrap; }
}
/* ===== v9.5 phone screens (js/phone.js): one plain vertical style ===== */
@media (max-width: 600px) {
  body.pv-on .menu-btn, body.pv-on .sidebar, body.pv-on .nav-backdrop, body.pv-on aside.summary, body.pv-on .tb-credit { display: none !important; }
  body.pv-on .content { padding-bottom: 84px !important; }
  body.pv-on .ev-tabs, body.pv-on .keys-dot { display: none !important; }
  body.pv-on table.ln-list input[type=checkbox], body.pv-on table.ln-list th:first-child input[type=checkbox] { display: none !important; }
  .pl-mode .pl-mode-t { flex: 1; display: flex; align-items: center; padding-left: 10px; font-size: 13px; font-weight: 650; color: var(--teal, #0e7a60); }
  .pv { padding: 2px 0 8px; font-size: 13.5px; }
  .pv-h { display: flex; align-items: center; gap: 10px; padding: 2px 2px 10px; }
  .pv-t { flex: 1; min-width: 0; }
  .pv-t b { display: block; font-size: 18px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-t small { display: block; color: var(--muted, #6b7671); font-size: 12px; }
  .pv-back { flex: none; border: 0; background: none; color: var(--teal, #0e7a60); font: inherit; font-size: 15px; font-weight: 700; padding: 6px 2px; }
  .pv-add { flex: none; border: 1px solid var(--line, #d9e2de); background: var(--card, #fff); color: var(--teal, #0e7a60); font: inherit; font-size: 13px; font-weight: 700; border-radius: 9px; padding: 7px 11px; }
  .pv-sec { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b7671); }
  .pv-link { border: 0; background: none; color: var(--teal, #0e7a60); font: inherit; font-weight: 700; padding: 2px 4px; }
  .pv-box { border: 1px solid var(--line, #d9e2de); border-radius: 11px; overflow: hidden; background: var(--card, #fff); }
  .pv-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 8px 11px; border: 0; border-top: 1px solid var(--line-soft, #edf1ef); background: none; font: inherit; color: inherit; text-align: left; }
  .pv-box > .pv-row:first-child, .pv-box > .pv-grp:first-child { border-top: 0; }
  button.pv-row:active { background: var(--teal-soft, #e3f4ee); }
  .pv-d { flex: 0 0 62px; font-size: 12px; color: var(--muted, #6b7671); font-variant-numeric: tabular-nums; }
  .pv-p { flex: 1; min-width: 0; }
  .pv-p b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-p small { display: block; font-size: 11.5px; color: var(--muted, #6b7671); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-n { flex: none; min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
  .pv-th { min-height: 32px; background: var(--line-soft, #f3f6f5); font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #6b7671); }
  .pv-th .pv-n, .pv-th .pv-d { font-weight: 700; font-size: 11px; color: var(--muted, #6b7671); }
  .pv-tot { background: var(--line-soft, #f3f6f5); font-weight: 700; }
  .pv-tot .pv-p { font-weight: 700; }
  .pv-grp { padding: 7px 11px 5px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--teal, #0e7a60); background: var(--line-soft, #f3f6f5); border-top: 1px solid var(--line-soft, #edf1ef); }
  .pv-none { padding: 18px 12px; text-align: center; color: var(--muted, #6b7671); }
  .pv-mon { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; border: 1px solid var(--line, #d9e2de); border-radius: 11px; background: var(--card, #fff); }
  .pv-mon button { width: 48px; height: 40px; border: 0; background: none; font-size: 22px; color: var(--teal, #0e7a60); }
  .pv-mon b { font-size: 14.5px; }
  .pv-q { width: 100%; height: 40px; margin: 0 0 8px; padding: 0 12px; border: 1px solid var(--line, #d9e2de); border-radius: 11px; background: var(--card, #fff); font: inherit; font-size: 14px; }
  .pv-narr { margin: 0 0 8px; padding: 10px 12px; border-radius: 11px; background: var(--line-soft, #f3f6f5); font-size: 13px; }
  .pv-acts { display: flex; gap: 8px; margin-top: 12px; }
  .pv-acts .btn { flex: 1; height: 42px; }
  .pv-acts .risk { color: #b42318 !important; }
  #pv-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 400; display: flex; background: var(--card, #fff); border-top: 1px solid var(--line, #d9e2de); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 14px rgb(0 0 0 / .06); }
  #pv-bar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; background: none; font: inherit; font-size: 10.5px; font-weight: 600; color: var(--muted, #6b7671); padding: 5px 0; }
  #pv-bar button.on { color: var(--teal, #0e7a60); }
  #pv-bar .pv-plus b { width: 38px; height: 38px; margin-top: -14px; border-radius: 50%; display: grid; place-items: center; background: var(--teal, #0e7a60); color: #fff; font-size: 24px; font-weight: 400; box-shadow: 0 4px 10px rgb(14 122 96 / .35); }
}
@media (min-width: 601px) { #pv-bar { display: none !important; } }
/* ===== v9.6 phone: richer look ===== */
@media (max-width: 600px) {
  body.pv-on .content { background: linear-gradient(180deg, var(--paper, #f4f6f5) 0%, var(--paper, #f4f6f5) 100%); }
  .pv-hero { position: relative; overflow: hidden; margin: 0 0 6px; padding: 16px 16px 14px; border-radius: 18px; color: #fff;
    background: radial-gradient(120% 140% at 100% 0%, #1fb38b 0%, #0e7a60 45%, #0a4f40 100%); box-shadow: 0 10px 24px rgb(14 122 96 / .28); }
  .pv-hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgb(255 255 255 / .07); }
  .pv-hero-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; opacity: .85; }
  .pv-fy { padding: 2px 9px; border-radius: 999px; background: rgb(255 255 255 / .16); font-weight: 700; font-size: 11px; letter-spacing: .03em; }
  .pv-hello { margin-top: 10px; font-size: 22px; font-weight: 750; letter-spacing: -.01em; line-height: 1.2; }
  .pv-co { font-size: 13px; opacity: .88; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pv-hero-bal { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: rgb(255 255 255 / .13); display: flex; justify-content: space-between; align-items: baseline; }
  .pv-hero-bal small { font-size: 12px; opacity: .9; }
  .pv-hero-bal b { font-size: 21px; font-variant-numeric: tabular-nums; }
  .pv-quick { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
  .pv-quick button { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; color: #fff; font: inherit; font-size: 11.5px; font-weight: 600; padding: 2px 0; }
  .pv-quick i { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-style: normal; font-size: 18px; font-weight: 700; background: rgb(255 255 255 / .95); color: #0e7a60; box-shadow: 0 3px 8px rgb(0 0 0 / .12); }
  .pv-box { border-radius: 14px; box-shadow: 0 1px 2px rgb(16 40 32 / .05), 0 4px 14px rgb(16 40 32 / .05); }
  .pv-sec { margin-top: 18px; }
  .pv-t b { font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
  .pv-mon, .pv-q { border-radius: 13px; box-shadow: 0 1px 2px rgb(16 40 32 / .04); }
  .pv-e .pv-d { line-height: 1.25; }
  .pv-sheet-bg { position: fixed; inset: 0 0 0 0; background: rgb(10 20 16 / .35); z-index: -1; }
  .pv-sheet { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px); background: var(--card, #fff); border-radius: 18px; padding: 12px 12px 14px; box-shadow: 0 -6px 30px rgb(0 0 0 / .18); }
  .pv-sheet-h { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #6b7671); margin: 2px 4px 10px; }
  .pv-sheet-g { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 6px; }
  .pv-sheet-g button { display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink, #14211b); text-align: center; }
  .pv-sheet-g i { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-style: normal; font-size: 19px; font-weight: 700; background: var(--teal-soft, #e3f4ee); color: var(--teal, #0e7a60); }
  #pv-bar { border-radius: 18px 18px 0 0; }
}
html[data-theme="dark"] .pv-quick i { background: rgb(255 255 255 / .92); }
@media (max-width: 600px) { .pl-head .pl-wa { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid #bfe6cf; background: #e7f7ee; display: grid; place-items: center; } .pl-head .pl-wa svg { width: 19px; height: 19px; } }
