/*
 * TummyStay Merchant — a phone-first shell.
 *
 * Built for a thumb on a 5-inch screen in daylight: one column, large type on
 * the numbers that matter, tap targets no smaller than 44px, and a bottom bar
 * rather than a hamburger. The wide layout is a courtesy for a tablet or a
 * desktop browser, not the design it was drawn for.
 */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #fafbfc;
  --ink: #14171c;
  --ink-2: #454c57;
  --muted: #78818f;
  --line: #e2e6eb;
  --line-2: #eef1f4;

  --brand: #217346;
  --brand-soft: #e7f2ec;
  --brand-ink: #ffffff;

  --up: #067647;
  --down: #b42318;
  --warn: #b54708;

  --rooms: #2563c9;
  --food: #c2701c;
  --other: #7b4bc4;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);

  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bar-height: 58px;

  color-scheme: light;
}

/*
 * Dark, two ways.
 *
 * The theme has three states, not two: Light, Dark, and Follow the phone —
 * and the third is the default, because most people set this once at the
 * system level and expect everything to obey it.
 *
 *   no data-theme          follow the phone
 *   data-theme="light"     light, whatever the phone says
 *   data-theme="dark"      dark, whatever the phone says
 *
 * So the palette below is written twice: once for a dark phone the user has
 * not overridden to light, and once for an explicit choice of dark. The two
 * blocks must stay identical — change one, change the other. CSS has no way
 * to share a declaration block between a media query and a bare selector, and
 * the alternative, a second layer of custom properties pointing at custom
 * properties, costs more in confusion than this costs in duplication.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1014;
    --panel: #171a20;
    --panel-2: #1c2028;
    --ink: #e9ecf1;
    --ink-2: #b9c0cb;
    --muted: #8b95a3;
    --line: #272c35;
    --line-2: #1f242c;

    --brand: #3d9b68;
    --brand-soft: #16291f;

    --up: #4ac08a;
    --down: #f08a7f;
    --warn: #e0a45c;

    --rooms: #6ba3f5;
    --food: #e0a45c;
    --other: #a889e8;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4);

    color-scheme: dark;
  }
}

/* The same palette, chosen deliberately. Keep in step with the block above. */
:root[data-theme="dark"] {
  --bg: #0e1014;
  --panel: #171a20;
  --panel-2: #1c2028;
  --ink: #e9ecf1;
  --ink-2: #b9c0cb;
  --muted: #8b95a3;
  --line: #272c35;
  --line-2: #1f242c;

  --brand: #3d9b68;
  --brand-soft: #16291f;

  --up: #4ac08a;
  --down: #f08a7f;
  --warn: #e0a45c;

  --rooms: #6ba3f5;
  --food: #e0a45c;
  --other: #a889e8;

  --shadow: 0 1px 2px rgba(0, 0, 0, .4);

  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

.hidden { display: none !important; }

/* Tabular figures everywhere money appears, so columns of rupees line up and
   a changing total does not make the layout twitch. */
.num, .kpi-value, .money, table td.n, .stat b {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ============================= Sign in ============================= */

#login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  background: linear-gradient(180deg, var(--brand-soft), var(--bg) 42%);
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px 24px;
  box-shadow: var(--shadow);
}

.login-logo { margin: 0 0 10px; }
.login-logo img { display: block; width: 200px; height: auto; }

.login-card h1 { margin: 0 0 4px; font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.login-card .sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; }

/* The wordmark in the header. Small, and it gives way on sub-screens: the
   title is what tells you where you are, and on a 375px row it has to win. */
.topbar-logo { height: 21px; width: auto; display: block; flex: 0 0 auto; margin-right: 2px; }

/* The wordmark at the foot of the More screen — the one place in the app
   where branding is the point rather than an interruption. */
.brand-foot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 0 18px;
  opacity: .75;
}
.brand-foot img { width: 132px; height: auto; display: block; }
.brand-foot span {
  font-size: 11px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}

label {
  display: block;
  font-size: 12.5px; font-weight: 550;
  color: var(--ink-2);
  margin: 14px 0 6px;
}

input[type="text"], input[type="password"], input[type="search"],
input[type="date"], input[type="month"], input[type="number"], input[type="tel"] {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  /* 16px or iOS Safari zooms the page the moment the field is focused. */
  font-size: 16px;
}
input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 0 16px;
  border-radius: var(--radius-sm);
  font-weight: 600; font-size: 15px;
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line);
}
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; }
.btn.ghost { background: none; border-color: var(--line); }

.msg { margin-top: 14px; font-size: 13.5px; min-height: 18px; }
.msg.err { color: var(--down); }
.msg.ok { color: var(--up); }

/* ============================= Shell ============================= */

#app { min-height: 100dvh; padding-bottom: calc(var(--bar-height) + var(--safe-bottom) + 8px); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 0;
}

.topbar-row { display: flex; align-items: center; gap: 10px; }

.topbar h1 {
  margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.spacer { flex: 1 1 auto; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 17px;
}
.icon-btn:active { background: var(--line-2); }
.icon-btn.spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* The period strip. Scrolls sideways rather than wrapping, so the bar height
   never changes as the label grows. */
.periods {
  display: flex; gap: 7px;
  overflow-x: auto;
  padding: 11px 0 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.periods::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 13.5px; font-weight: 550;
  white-space: nowrap;
}
.chip[aria-pressed="true"] {
  background: var(--brand); border-color: var(--brand); color: var(--brand-ink);
}

/* The payroll month picker, in the same slot the period chips use. */
.months { display: flex; align-items: center; gap: 4px; padding: 7px 0 9px; }

/* The date the screen is about, as the browser's own date field — tapping it
   is how you get to next May without pressing an arrow two hundred times.
   Kept narrow: it sits between two arrows on a 360px phone. */
input.day-pick {
  width: auto;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}

/* Safari shrink-wraps a date input and then refuses to grow it; these two
   make it behave like the box it is drawn as. */
input.day-pick::-webkit-date-and-time-value { text-align: left; }
input.day-pick::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; }
.months .month-name { font-size: 14.5px; font-weight: 600; min-width: 0; }
.months .icon-btn { width: 32px; height: 32px; font-size: 20px; }
.months .icon-btn[disabled] { opacity: .3; }

/* A filter that is on should be obvious from across the room — it is the
   commonest way to misread a dashboard. */
.scope-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--brand-soft);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.scope-bar b { font-weight: 600; }
.scope-bar button { color: var(--brand); font-weight: 600; font-size: 13.5px; }

/* grid-auto-rows for the same reason as the sheet below: the cards hide their
   overflow, which would otherwise let the grid shrink them past their content. */
.content { padding: 14px 16px 24px; display: grid; gap: 14px; align-content: start; grid-auto-rows: max-content; }

/* ============================= Cards ============================= */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card > h2 {
  margin: 0;
  padding: 14px 16px 0;
  font-size: 12px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted);
}
.card-body { padding: 14px 16px; }
.card-body + .card-body { border-top: 1px solid var(--line-2); }

/* The headline number. */
.hero { padding: 18px 16px 16px; }
.hero .label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.hero .kpi-value {
  font-size: 34px; font-weight: 680; letter-spacing: -.025em;
  margin: 3px 0 6px; line-height: 1.1;
}
.hero .split { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.hero .split > div { min-width: 0; }
.hero .split .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hero .split .v { font-size: 16px; font-weight: 620; margin-top: 1px; }

/* The profit sum, set out as a sum. Money right-aligned in tabular figures so
   the three lines read as one column that adds up. */
.pnl > div {
  display: flex; align-items: baseline; gap: 12px;
  padding: 7px 0;
}
.pnl > div > span { color: var(--muted); font-size: 13.5px; flex: 1 1 auto; }
.pnl > div > b {
  font-variant-numeric: tabular-nums;
  font-size: 15px; font-weight: 620;
}
.pnl > div > b.minus { color: var(--down); }

/*
 * Money that was made and money that was lost, told apart twice: by the sign
 * in front of it and by the colour of it. Either one alone fails somebody —
 * a minus sign is easy to read past at a glance, and one owner in twelve
 * cannot tell the two colours apart at all.
 *
 * The greens and reds are the palette's own, so they follow the theme into
 * dark mode where a hard #0a0 would glare.
 */
.plus { color: var(--up); }
.minus { color: var(--down); }
.pnl .pnl-total {
  border-top: 1px solid var(--line);
  margin-top: 3px; padding-top: 11px;
}
.pnl .pnl-total > span { color: var(--ink); font-weight: 600; }
.pnl .pnl-total > b { font-size: 19px; letter-spacing: -.01em; }

.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted); }
.delta .vs { color: var(--muted); font-weight: 450; }

/* A grid of small numbers. Two across on a phone; it stays readable and the
   labels do not truncate. */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line-2); }
.stats.three { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--panel); padding: 13px 14px; }
.stat span { display: block; font-size: 11.5px; color: var(--muted); letter-spacing: .02em; }
.stat b { display: block; font-size: 18px; font-weight: 640; margin-top: 3px; letter-spacing: -.01em; }
.stat small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ============================= Lists ============================= */

.rows { display: block; }

.row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border-top: 1px solid var(--line-2);
  text-align: left;
}
.rows > .row:first-child { border-top: 0; }
button.row:active { background: var(--panel-2); }

.row .grow { flex: 1 1 auto; min-width: 0; }
.row .name {
  font-weight: 570; font-size: 14.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.row .val { text-align: right; flex: 0 0 auto; }
.row .val b { display: block; font-weight: 640; font-size: 15px; letter-spacing: -.01em; }
.row .chev { color: var(--muted); font-size: 15px; flex: 0 0 auto; }

.rank {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 680;
}

/* A share-of-total bar behind a row reads faster than the percentage does. */
.bar { height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; margin-top: 7px; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.bar.rooms > i { background: var(--rooms); }
.bar.food > i { background: var(--food); }

.pill {
  display: inline-block;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: var(--line-2); color: var(--ink-2);
}
.pill.live { background: var(--brand-soft); color: var(--brand); }
.pill.warn { background: rgba(181, 71, 8, .12); color: var(--warn); }
.pill.off { background: var(--line-2); color: var(--muted); }

/* ============================= Chart ============================= */

.chart { padding: 6px 12px 12px; }
.chart svg { display: block; width: 100%; height: 122px; }
.chart-peak { font-size: 10.5px; color: var(--muted); margin-bottom: 3px; }

/* Each date sits at the percentage position of its own bar, so the labels
   stay over their columns however wide the card gets. */
.chart-axis { position: relative; height: 15px; margin-top: 6px; }
.chart-axis span {
  position: absolute;
  top: 0;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
}
.legend { display: flex; gap: 14px; padding: 0 16px 13px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ======================= Booking calendar & availability =======================
 *
 * The PMS's own two sheets (live_code pms/booking_calendar.php and
 * pms/availability_calendar.php), drawn the same way so an owner and the front
 * desk recognise one picture: a green title bar, Excel-style grid lines, a row
 * per room, and bars placed to the clock — 12:00 in starts half a column in.
 *
 * The status colours are the PMS's and stay fixed in both themes; the paper
 * (backgrounds, lines, ink) follows the app's theme tokens. */

/* The properties, wrapped rather than scrolled sideways. */
.hotel-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.hotel-chips .chip { white-space: normal; text-align: left; }

/* The calendar screens use the whole width, as the PMS does. */
.content.wide { max-width: none; }
@media (min-width: 700px) { .content.wide { grid-template-columns: 1fr; } }

.bc, .av {
  --g: #107c41; --g-dk: #0a5c30; --r: #b3261e; --b: #0b5cad;
  --grid: var(--line-2); --head: var(--panel-2); --td: rgba(16, 124, 65, .09);
  --col: 44px; --rc: 130px;
  font-size: 12px; color: var(--ink);
  border-radius: 6px;
}
.bc *, .av * { box-sizing: border-box; }

.bc-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; justify-content: space-between;
          background: var(--g); color: #fff; padding: 7px 12px; border-bottom: 2px solid var(--g-dk); }
.bc-top h5 { margin: 0; font-size: 14px; font-weight: 600; color: #fff; }
.bc-top span { font-size: 12px; color: #dff0e5; }

.bc-cards { display: flex; flex-wrap: wrap; background: var(--head); border-bottom: 1px solid var(--line); }
.bc-card { padding: 5px 12px; border-right: 1px solid var(--line); white-space: nowrap; }
.bc-card span { font-size: 11.5px; color: var(--muted); }
.bc-card span::after { content: ":"; }
.bc-card b { font-size: 12.5px; color: var(--brand); margin-left: 4px; }
.bc-card.r b { color: var(--down); }
.bc-card.b b { color: var(--rooms); }

.bc-bar { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 6px 10px;
          background: var(--head); border-bottom: 1px solid var(--line); }
.bc-bar input, .bc-bar select { width: auto; min-height: 0; height: 28px; border: 1px solid var(--line); border-radius: 2px; font-size: 12px;
          padding: 0 6px; background: var(--panel); color: var(--ink); font-family: inherit; }
.bc-bar input:focus, .bc-bar select:focus { outline: none; border-color: var(--g); }
.bc-bar input[type=search] { width: 190px; max-width: 100%; }
.bc-chips { display: inline-flex; }
.bc-chip { height: 28px; min-width: 30px; display: inline-flex; align-items: center; justify-content: center; padding: 0 9px;
           border: 1px solid var(--line); margin-left: -1px; background: var(--panel); color: var(--ink-2);
           font-size: 11.5px; font-weight: 600; cursor: pointer; }
.bc-chip:first-child { margin-left: 0; }
.bc-chip:hover { color: var(--brand); }
.bc-chip.on { background: var(--g); border-color: var(--g-dk); color: #fff; }
.bc-chip[disabled] { opacity: .4; cursor: default; }
.bc-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; font-size: 11px; color: var(--ink-2); }
.bc-legend i { display: inline-block; width: 12px; height: 10px; border-radius: 1px; margin-right: 3px; vertical-align: -1px; }

.bc-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 200px; position: relative; background: var(--panel); }
.bc-grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; width: max-content; }
.bc-grid th, .bc-grid td { width: var(--col); min-width: var(--col); max-width: var(--col); height: 26px; padding: 0;
          border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); text-align: center; font-size: 11px; }
.bc-grid .rc { position: sticky; left: 0; z-index: 6; width: var(--rc); min-width: var(--rc); max-width: var(--rc); text-align: left;
          padding: 0 8px; background: var(--panel); border-right: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-grid thead th { position: sticky; background: var(--head); z-index: 8; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line); }
.bc-grid thead tr:first-child th { top: 0; height: 34px; line-height: 1.15; }
.bc-grid thead tr:nth-child(2) th { top: 34px; height: 20px; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.bc-grid thead th.rc { z-index: 10; background: var(--head); }
.bc-grid thead .dn { display: block; font-size: 10px; color: var(--muted); font-weight: 500; }
.bc-grid .we { background-color: rgba(127, 127, 127, .045); }
.bc-grid thead th.we { background: color-mix(in srgb, var(--head) 88%, #888); }
.bc-grid .td { background-color: var(--td) !important; }
.bc-grid thead th.td { background: var(--g) !important; color: #fff; }
.bc-grid thead th.td .dn { color: #dff0e5; }
.bc-grid thead th.full { color: var(--down); }
.bc-grid thead tr:nth-child(2) th.td { color: #fff; font-weight: 700; }
.bc-grid tr.ty td { background: var(--head); font-size: 10.5px; color: var(--muted); height: 22px; }
.bc-grid tr.ty td.rc { font-weight: 700; color: var(--ink); font-size: 11.5px; cursor: pointer; }
.bc-grid tr.ty td.rc .n { color: var(--muted); font-weight: 500; }
.bc-grid tr.ty .free0 { color: var(--down); font-weight: 700; }
.bc-grid tr.ty .rate { display: block; font-size: 9.5px; color: var(--muted); opacity: .8; line-height: 1; }
.bc-grid tr.rm td.rc { font-weight: 600; }
.bc-grid tr.rm td.day { background-image: linear-gradient(to right, transparent calc(50% - .5px), var(--grid) calc(50% - .5px),
          var(--grid) calc(50% + .5px), transparent calc(50% + .5px)); }
.bc-grid tr.rm td.first { position: relative; overflow: visible; }
.bc-grid tr.rm:hover td.rc { background: var(--brand-soft); }
.bc-grid tfoot td { position: sticky; bottom: 0; background: var(--head); z-index: 7; font-weight: 700;
          border-top: 1px solid var(--line); font-size: 11px; }
.bc-grid tfoot td.rc { z-index: 10; }
.bc-grid tfoot .hi { color: var(--down); }
.bc-now { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: #e53935; z-index: 2; pointer-events: none; }
.bc-empty { padding: 40px; text-align: center; color: var(--muted); }

.bk { position: absolute; top: 3px; height: 19px; z-index: 3; border-radius: 2px; color: #fff; font-size: 11px; font-weight: 600;
      line-height: 19px; padding: 0 5px; display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden;
      cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); text-align: left; font-family: inherit; }
.bk:hover { filter: brightness(1.08); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35), 0 1px 3px rgba(0, 0, 0, .25); z-index: 4; }
.bk .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.bk .src { flex: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; color: #333; font-size: 8.5px; font-weight: 800;
      line-height: 13px; text-align: center; }
.bk .tm { flex: none; font-size: 9.5px; font-weight: 500; opacity: .85; }
.bk .rc2 { flex: none; font-size: 9.5px; background: rgba(255, 255, 255, .28); padding: 0 3px; border-radius: 2px; line-height: 14px; }
.bk .due { flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ffd84d; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.bk.cutL { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bk.cutR { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bk.res { background: var(--b); } .bk.in { background: var(--g); } .bk.out { background: #8b8b8b; }
.bk.hold { background: #c98a00; } .bk.blk { background: repeating-linear-gradient(135deg, #a33 0 6px, #b84a4a 6px 12px); }
.bk.dim { opacity: .18; } .bk.hit { box-shadow: 0 0 0 2px #ffd84d; }
.bc-grid .bk.sm .src, .bc-grid .bk.sm .rc2, .bc-grid .bk:not(.lg) .tm { display: none; }

/* The booking, in a panel from the right — the PMS's side panel. */
.bd-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 60; }
.bd { position: fixed; top: 0; right: 0; bottom: 0; width: min(470px, 100vw); background: var(--panel); z-index: 61;
      box-shadow: -4px 0 18px rgba(0, 0, 0, .25); transform: translateX(100%); transition: transform .18s ease;
      display: flex; flex-direction: column; font-size: 12px; color: var(--ink); }
.bd.open { transform: none; }
.bd-h { background: #107c41; color: #fff; padding: 10px 12px; border-bottom: 2px solid #0a5c30;
        padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.bd-h .t { display: flex; align-items: center; gap: 8px; }
.bd-h h6 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; color: #fff; }
.bd-h .x { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.bd-h .s { font-size: 11.5px; color: #dff0e5; margin-top: 2px; }
.bd-pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 19px; border-radius: 2px;
           background: rgba(255, 255, 255, .2); color: #fff; }
.bd-b { flex: 1; overflow: auto; padding: 8px 12px 12px; }
.bd-sec { border: 1px solid var(--line); margin-top: 8px; }
.bd-sec > b { display: block; background: var(--head, var(--panel-2)); border-bottom: 1px solid var(--line); padding: 3px 8px;
              font-size: 11px; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-2); }
.bd-kv { display: grid; grid-template-columns: auto 1fr auto 1fr; }
.bd-kv > span { padding: 3px 8px; border-bottom: 1px solid var(--line-2); }
.bd-kv > span:nth-child(odd) { color: var(--muted); white-space: nowrap; }
.bd-kv > span:nth-child(even) { font-weight: 600; word-break: break-word; }
.bd-kv a { color: var(--rooms); }
.bd-t { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.bd-t th { background: var(--panel-2); font-weight: 600; color: var(--ink-2); font-size: 10.5px; text-align: left; padding: 3px 6px;
           border-bottom: 1px solid var(--line); }
.bd-t td { padding: 3px 6px; border-bottom: 1px solid var(--line-2); }
.bd-t .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bd-t tr.tot td { font-weight: 700; border-top: 1px solid var(--line); }
.bd-t tr.due td { font-weight: 700; color: #b3261e; background: #fde7e5; }
.bd-t tr.ok td { font-weight: 700; color: #0a5c30; background: #e6f2ea; }
.bd-t tr.sub td { color: var(--muted); font-size: 11px; }
.bd-f { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--line);
        background: var(--panel-2); padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
.bd-f a { height: 30px; padding: 0 10px; border-radius: 2px; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
          font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.bd-f a.g { background: #107c41; border-color: #0a5c30; color: #fff; }
.bd-f .note { font-size: 11px; color: var(--muted); margin-left: auto; }
.bd-load { padding: 30px; text-align: center; color: var(--muted); }

/* ------------- Availability ------------- */
.av { --gs: #e8f5ee; --gl: #b7dfc6; --ys: #fff6d6; --yl: #f0d98a; --yk: #7a5b00; --rs: #fdecea; --rl: #f3c2bd; --rk: #a4262c; --gk: #1a5c38; }
.av-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.av-stat { background: var(--panel); padding: 9px 12px; }
.av-stat span { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.av-stat b { font-size: 20px; font-weight: 600; }
.av-stat small { color: var(--muted); font-size: 11px; margin-left: 4px; }
.av-stat.free b { color: var(--up); }
.av-stat.block b { color: var(--down); }
.av-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12px; color: var(--muted);
             padding: 7px 12px; border-bottom: 1px solid var(--line); }
.av-legend i.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; border: 1px solid; }
.av-wrap { position: relative; overflow: auto; background: var(--panel); max-height: calc(100vh - 300px); min-height: 200px; }
.av-grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 600px; }
.av-grid th, .av-grid td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.av-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--head); font-weight: 600; font-size: 11.5px; color: var(--ink-2);
                    padding: 6px 4px; text-align: center; }
.av-grid thead th.day b { display: block; font-size: 15px; color: var(--ink); line-height: 1.15; }
.av-grid thead th.day small { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.av-grid thead th.wk { background: color-mix(in srgb, var(--head) 88%, #888); }
.av-grid thead th.today { background: var(--g); }
.av-grid thead th.today b, .av-grid thead th.today small { color: #fff; }
.av-grid .type { position: sticky; left: 0; z-index: 2; background: var(--panel); text-align: left; padding: 8px 12px; min-width: 150px; max-width: 220px; }
.av-grid thead th.type { z-index: 4; text-align: left; padding-left: 12px; background: var(--head); }
.av-grid .type b { display: block; font-size: 13px; }
.av-grid .type span { font-size: 11.5px; color: var(--muted); }
.av-grid td.cell { padding: 5px 4px; text-align: center; min-width: 64px; }
.av-grid td.cell.ok { background-color: var(--gs); }
.av-grid td.cell.few { background-color: var(--ys); }
.av-grid td.cell.none { background-color: var(--rs); }
.av-num { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 30px; font-size: 15px; font-weight: 600;
          border-radius: 6px; border: 1px solid; background: #fff; }
.ok .av-num { border-color: var(--gl); color: var(--gk); }
.few .av-num { border-color: var(--yl); color: var(--yk); }
.none .av-num { border-color: var(--rl); color: var(--rk); }
.av-sub { display: block; font-size: 10.5px; color: #6b7885; margin-top: 3px; white-space: nowrap; }
.av-sub .bkd { color: #0b4f94; }
.av-sub .bl { color: var(--rk); font-weight: 600; }
.av-grid tfoot td { background: var(--head); font-weight: 600; text-align: center; padding: 6px 4px; font-size: 12px; }
.av-grid tfoot tr:first-child td { border-top: 1px solid var(--line); }
.av-grid tfoot td.type { font-size: 12px; background: var(--head); }
.av-occ { font-size: 11px; font-weight: 500; color: var(--muted); }
.av-note { padding: 8px 12px; font-size: 11.5px; color: var(--muted); }
.bc-bar .bc-end { margin-left: auto; }

/* An editable cell: the same box, typed into. */
input.av-num { font-family: inherit; text-align: center; padding: 0; cursor: text; -moz-appearance: textfield; }
input.av-num:hover { box-shadow: 0 0 0 1px var(--g); }
input.av-num:focus { outline: 2px solid var(--g); outline-offset: 0; }
input.av-num:disabled { opacity: .55; }

/* ------------- Rate calendar ------------- */
.rt-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.rt-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); min-width: 74px; }
.rt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rt-chips .chip small { font-size: 10px; opacity: .8; font-weight: 500; }
.rt-grid td.rc-c { padding: 3px; text-align: center; min-width: 70px; font-size: 12.5px; }
.rt-grid td.rc-c.unset { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(127, 127, 127, .06) 6px 12px); }
/* A room type that follows another: guest prices shown, not typed. */
.rt-grid td.rc-c.auto { color: var(--muted); font-weight: 600; background-color: var(--head); cursor: default; }
.rt-auto { font-size: 10.5px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.rt-auto-note { margin: 10px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--head); }
.rt-grid tbody td.type { padding: 6px 12px; }
.rt-grid tbody td.type b { font-size: 12.5px; font-weight: 600; }
.rt-grid tr.rt-grp td { background: var(--head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
                        color: var(--ink-2); padding: 5px 12px; }
.rt-more { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; text-transform: inherit; letter-spacing: inherit; }
input.rt-in { width: 100%; min-width: 58px; height: 30px; padding: 0 4px; text-align: center; font: inherit; font-size: 13px; font-weight: 600;
              border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink); }
input.rt-in::placeholder { color: var(--muted); font-weight: 400; }
input.rt-in:hover { border-color: var(--g); }
input.rt-in:focus { outline: 2px solid var(--g); outline-offset: -1px; }
input.rt-in:disabled { opacity: .55; }
.rt-tg { width: 100%; min-width: 44px; height: 28px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel);
         color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.rt-tg[aria-pressed="true"] { background: var(--r); border-color: var(--r); color: #fff; }
.rt-grid td.tg-on { background-color: var(--rs); }
.rt-bulk label { margin: 10px 0 4px; }
.rt-bulk input, .rt-bulk select { padding: 9px 11px; }
.rt-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.rt-h { font-size: 13px; margin: 18px 0 2px; padding-top: 10px; border-top: 1px solid var(--line); }

/* A dark phone: the tinted cells keep their meaning, dimmed to sit on dark paper. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .av { --gs: #15301f; --gl: #2e6b45; --ys: #33290c; --yl: #7a6420; --yk: #f1cf6b;
                                        --rs: #3a1a1a; --rl: #7c3a36; --rk: #f3a39b; --gk: #7fd6a3; }
  :root:not([data-theme="light"]) .av-num { background: var(--panel); }
  :root:not([data-theme="light"]) .av-sub { color: var(--muted); }
  :root:not([data-theme="light"]) .av-sub .bkd { color: #8ab8f5; }
  :root:not([data-theme="light"]) .bd-t tr.due td { background: #3a1a1a; color: #f3a39b; }
  :root:not([data-theme="light"]) .bd-t tr.ok td { background: #15301f; color: #7fd6a3; }
}
:root[data-theme="dark"] .av { --gs: #15301f; --gl: #2e6b45; --ys: #33290c; --yl: #7a6420; --yk: #f1cf6b;
                               --rs: #3a1a1a; --rl: #7c3a36; --rk: #f3a39b; --gk: #7fd6a3; }
:root[data-theme="dark"] .av-num { background: var(--panel); }
:root[data-theme="dark"] .av-sub { color: var(--muted); }
:root[data-theme="dark"] .av-sub .bkd { color: #8ab8f5; }
:root[data-theme="dark"] .bd-t tr.due td { background: #3a1a1a; color: #f3a39b; }
:root[data-theme="dark"] .bd-t tr.ok td { background: #15301f; color: #7fd6a3; }

@media (max-width: 700px) {
  .bc, .av { --rc: 72px; }
  .content.wide { padding-left: 8px; padding-right: 8px; }
  .bc-legend { margin-left: 0; }
  .bc-bar input[type=search] { width: 100%; }
  .bc-grid .rc { padding: 0 6px; }
  .bd-kv { grid-template-columns: auto 1fr; }
  .av-grid .type { min-width: 0; width: 76px; max-width: 76px; padding: 6px; }
  .av-grid .type b { font-size: 11.5px; overflow-wrap: anywhere; }
  .av-grid .type span { font-size: 10px; }
  .bc-scroll, .av-wrap { max-height: none; }

  /* A phone: the week fits the screen with nothing to scroll sideways. The
     cells shrink to the width, the box and the words go, the numbers stay. */
  .av-grid { min-width: 0; table-layout: fixed; }
  .av-grid td.cell { min-width: 0; padding: 4px 1px; }
  .av-grid thead th { padding: 4px 1px; font-size: 10px; }
  .av-grid thead th.day b { font-size: 13px; }
  .av-num { width: auto; min-width: 26px; max-width: 100%; height: 24px; font-size: 13px; padding: 0 3px; }
  .av-sub { font-size: 9.5px; }
  .av-sub .w { display: none; }
  .av-grid tfoot td { padding: 5px 1px; font-size: 11px; }
  .av-stats { grid-template-columns: 1fr 1fr; }
  .av-stat b { font-size: 17px; }

  .bc-cards { display: grid; grid-template-columns: 1fr 1fr; }
  .bc-card { padding: 4px 8px; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; }
  .bc-bar { gap: 6px; }
  .bc-bar .bc-chips { flex: 1 1 auto; }
  .bc-bar .bc-chip { flex: 1 1 auto; }
  .bc-bar input[type=date], .bc-bar select { flex: 1 1 40%; }
  .bc-top span { width: 100%; }
  .bc-card:last-child { grid-column: 1 / -1; }
  .bc-grid tr.ty td.rc { font-size: 10.5px; }
  .hotel-chips { gap: 6px; padding: 10px; }
  .hotel-chips .chip { font-size: 12.5px; padding: 6px 11px; min-height: 0; }
}

/* The narrowest phones: 30 days of availability cannot fit, so it scrolls. */
@media (max-width: 700px) {
  .av-grid.d15, .av-grid.d30 { min-width: 640px; }
  .bc-bar .bc-end { margin-left: 0; }
  /* An input's "auto" width is twenty characters; hold it to the cell. */
  input.av-num { width: 100%; max-width: 44px; min-width: 0; }
  /* Prices need room to be typed: the rate grid scrolls sideways, first column pinned. */
  .rt-grid, .rt-grid.d7 { min-width: 560px; table-layout: auto; }
  .rt-grid.d15 { min-width: 1100px; }
  .rt-grid.d30 { min-width: 2100px; }
  .rt-grid .type { width: 92px; max-width: 92px; }
  .rt-grid td.rc-c { min-width: 62px; }
  .rt-lbl { min-width: 0; width: 100%; }
}

/* ============================= Room calendar =============================
 *
 * A month of nights, seven across. Each cell is a tap target that opens that
 * day, so none of them may be smaller than a thumb: the grid is fluid but the
 * cells have a floor, and on the narrowest phone the card scrolls rather than
 * the squares shrinking into decoration.
 *
 * How full a night is, is drawn rather than written. A column of percentages
 * is read one by one; a wall of part-filled blocks is read at a glance, which
 * is the entire reason this screen exists. */

.cal { padding: 6px 12px 12px; }

.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.cal-dow {
  margin-bottom: 6px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  letter-spacing: .03em;
}

.cal-cell {
  position: relative;
  overflow: hidden;
  min-height: 46px;
  aspect-ratio: 1 / 1;
  padding: 5px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}

/* The days before the 1st. No border and no target — an empty square that
   can be tapped is a square people tap. */
.cal-cell.blank { border: 0; background: none; pointer-events: none; }

/* The share of the house sold that night, growing from the floor of the
   cell. Behind the figures, never over them. */
.cal-cell .fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--rooms);
  opacity: .22;
}

/* A full house is not merely "more blue" — it is the thing being looked for,
   so it changes colour as well as height. */
.cal-cell.full .fill { background: var(--brand); opacity: .34; }

.cal-cell .d { position: relative; font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.cal-cell .p {
  position: relative;
  font-size: 10.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

/* Somebody checks in or out that day. A dot, not a number: the count is in
   the label, and two more digits in a 46px square is a smudge. */
.cal-cell .dot {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

/* A month that has been and gone is context, not the subject. */
.cal-cell.past .d, .cal-cell.past .p { opacity: .6; }

.cal-cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }
.cal-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -1px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.cal-legend i.some { background: color-mix(in srgb, var(--rooms) 22%, var(--panel-2)); }
.cal-legend i.full { background: color-mix(in srgb, var(--brand) 34%, var(--panel-2)); }
.cal-legend i.ring { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* ============================= Bottom bar ============================= */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tabbar button {
  height: var(--bar-height);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted);
  font-size: 10.5px; font-weight: 560;
}
.tabbar button .ico { font-size: 18px; line-height: 1; }
.tabbar button[aria-pressed="true"] { color: var(--brand); }

/* ============================= States ============================= */

.empty { padding: 30px 18px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .big { font-size: 26px; display: block; margin-bottom: 8px; opacity: .5; }

.skeleton { animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.sk-line { height: 12px; border-radius: 6px; background: var(--line-2); margin: 9px 0; }
.sk-line.lg { height: 30px; width: 62%; }
.sk-line.sm { width: 40%; }

.error-note {
  margin: 0; padding: 13px 16px;
  background: rgba(180, 35, 24, .1);
  color: var(--down);
  border-radius: var(--radius);
  font-size: 13.5px;
}

/* Something worth knowing but not worth alarming anyone about — unmarked
   attendance days, people posted nowhere. */
.note {
  margin: 0; padding: 12px 15px;
  background: var(--brand-soft);
  border-radius: var(--radius);
  font-size: 13px; line-height: 1.5;
  color: var(--ink-2);
}

select {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  font-size: 16px;
}

.btn.danger { background: var(--down); border-color: var(--down); color: #fff; }

/* A three-way choice where all three options should be visible at once —
   a switch would hide the third, and there is no "off" state here. */
.segment {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 3px; padding: 3px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.segment button {
  min-height: 40px; padding: 0 8px;
  border-radius: 8px;
  font-size: 13.5px; font-weight: 560;
  color: var(--ink-2);
}
.segment button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}

/* The small ✕ that removes a row. Kept visually quiet and physically large:
   destructive, so it should be easy to hit deliberately and hard to brush. */
.linkish {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 9px;
  color: var(--muted); font-size: 15px;
}
.linkish:active { background: var(--line-2); color: var(--down); }

/* Confirmation of a write. Above the bottom bar, out of the thumb's way. */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(var(--bar-height) + var(--safe-bottom) + 14px);
  z-index: 60;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 11px;
  background: var(--ink); color: var(--bg);
  font-size: 13.5px; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(8, 11, 15, .3);
  animation: toast-in .18s ease-out;
}
.toast.err { background: var(--down); color: #fff; }
@keyframes toast-in { from { transform: translate(-50%, 10px); opacity: 0; } }

/* The sheet used for hotel detail and the menu. */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 11, 15, .45);
  display: flex; align-items: flex-end;
}
.sheet {
  width: 100%; max-height: 92dvh;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  animation: rise .2s ease-out;
}
@keyframes rise { from { transform: translateY(22px); opacity: .4; } }

.sheet-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px 18px 0 0;
}
.sheet-head h2 { margin: 0; font-size: 16.5px; font-weight: 650; }
.sheet-head .sub { font-size: 12.5px; color: var(--muted); }
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(24px + var(--safe-bottom));
  display: grid;
  gap: 14px;
  /* Three separate traps, all of which showed up as cards clipped to a sliver:
     a flex child will not shrink below its content without min-height, so the
     sheet could not scroll; a grid with room to spare stretches its rows; and
     `.card` carries overflow:hidden, which sets a grid item's automatic
     minimum size to zero and so lets a short container squash it well below
     its own content. max-content rows are what actually pin them open. */
  min-height: 0;
  align-content: start;
  grid-auto-rows: max-content;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================= Wider screens ============================= */

@media (min-width: 700px) {
  .content, .sheet-body { max-width: 940px; margin: 0 auto; grid-template-columns: 1fr 1fr; align-items: start; }
  .content > .full, .sheet-body > .full { grid-column: 1 / -1; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .hero .kpi-value { font-size: 38px; }
  .sheet { max-width: 940px; margin: 0 auto; border-radius: 18px; max-height: 88dvh; }
  .sheet-backdrop { align-items: center; padding: 20px; }
}

/* The two ways out of the sign-in card — forgotten password, and back to it.
   Plain <a> in a paragraph of muted text is invisible on a phone otherwise. */
.login-card .sub a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.login-card .sub a:hover,
.login-card .sub a:focus-visible { text-decoration: underline; }

/* Month by month: the year's list, with the total at its foot. */
.month-rows .row { position: relative; }
.month-rows .total-row { background: var(--panel-2); border-top: 2px solid var(--line); }
.month-rows .total-row .val b { color: var(--brand); }
