/* ==========================================================================
   MyFilingCabinet design system  ·  v2 (emerald, cream and gold)
   --------------------------------------------------------------------------
   Opt-in: a page uses this by linking the file and adding class="mtk" to
   <body>. Pages without that class are not affected, so the app can move
   across one page at a time. No JavaScript, fonts or packages required.
   See DESIGN-SYSTEM.md and docs/design-system.html for usage.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Ink: deep evergreen for all text, including small print */
  --ink-950: #0e271f;
  --ink-900: #132f26;
  --ink-800: #24453a;
  --ink-700: #33574a;

  /* Brand. The --brand-blue names are kept so existing pages keep working;
     they now hold the emerald brand colour. */
  --brand-blue: #13795a;
  --brand-blue-light: #3fbf8f;
  --brand-emerald-dark: #0a4a35;
  --brand-cream: #f8f4e9;
  --brand-green: #138a55;
  --brand-green-light: #3fcf8b;
  --brand-gold: #d4a339;

  /* Section tones: one per main area of the app */
  --tone-dashboard: #13795a;   --tone-dashboard-soft: #e3f3ea;
  --tone-receipts: #6a4fd1;    --tone-receipts-soft: #efebfd;
  --tone-expenses: #b83f28;    --tone-expenses-soft: #fdece8;
  --tone-vehicles: #0f7a4a;    --tone-vehicles-soft: #e3f6ec;
  --tone-kilometres: #0b63d1;  --tone-kilometres-soft: #e6f0fd;
  --tone-reports: #946300;     --tone-reports-soft: #fdf3dc;
  --tone-wfh: #0e7490;         --tone-wfh-soft: #e0f2f7;
  --tone-workuse: #9d2b6b;     --tone-workuse-soft: #f8e7f0;

  /* Surfaces and lines */
  --page: #f5f1e6;
  --surface: #ffffff;
  --surface-tint: #f7faf5;
  --line: #e4dcc8;
  --line-strong: #a9ae9c;

  /* Feedback */
  --success-bg: #e3f6ec;  --success-line: #b4e2c9;  --success-ink: #0b4a2e;
  --error-bg: #fdecee;    --error-line: #f2b8bf;    --error-ink: #7d111d;
  --warning-bg: #fff6e2;  --warning-line: #ecc86e;  --warning-ink: #3a2a04;
  --info-bg: #f1f8f3;     --info-line: #cde4d5;

  /* Shape and depth */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 3px 10px rgba(14, 60, 42, .06);
  --shadow: 0 1px 2px rgba(14, 39, 31, .06), 0 10px 28px rgba(14, 60, 42, .09);
  --focus: 0 0 0 4px rgba(19, 121, 90, .25);

  /* Type: system fonts load instantly and look native on every device */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --text-sm: 14px;
  --text: 16px;
  --text-lg: 17px;
  --h1: 28px;
  --h2: 22px;
  --h3: 18px;

  --speed: .14s;
}

/* ---------- 2. Base ---------- */
.mtk, .mtk *, .mtk *::before, .mtk *::after { box-sizing: border-box; }
body.mtk {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--text);
  line-height: 1.5;
  color: var(--ink-900);
  background:
    radial-gradient(1200px 400px at 85% -120px, #dcefe3 0%, transparent 70%),
    linear-gradient(180deg, #fbf8f0 0%, var(--page) 360px);
  -webkit-font-smoothing: antialiased;
}
.mtk h1, .mtk h2, .mtk h3 { color: var(--ink-950); line-height: 1.25; letter-spacing: -.3px; margin: 0 0 .5em; }
.mtk h1 { font-size: var(--h1); letter-spacing: -.5px; }
.mtk h2 { font-size: var(--h2); }
.mtk h3 { font-size: var(--h3); }
.mtk a { color: var(--brand-blue); font-weight: 600; }
.mtk a:hover { color: var(--brand-emerald-dark); }
.mtk :focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
.mtk [hidden], .mtk .hidden { display: none !important; }
.mtk .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mtk .num, .mtk .total strong, .mtk .stat-value, .mtk td { font-variant-numeric: tabular-nums; }

.mtk main { max-width: 1200px; margin: 0 auto; padding: 26px 24px 48px; }
.mtk .intro { margin: 0 0 18px; font-size: var(--text-lg); color: var(--ink-800); max-width: 760px; }
.mtk .small, .mtk .muted, .mtk .note { font-size: var(--text-sm); color: var(--ink-800); line-height: 1.55; }

/* ---------- 3. Icons ---------- */
.mtk svg.icon {
  width: 1.25em; height: 1.25em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 4. App header and navigation ---------- */
.mtk .app-header {
  background:
    linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 60%),
    linear-gradient(120deg, #0a3b2b 0%, #0f5a42 55%, #177e5d 100%);
  color: #fff;
  border-bottom: 3px solid #d4a339;
  box-shadow: 0 6px 20px rgba(10, 59, 43, .25);
}
.mtk .app-header-inner {
  max-width: 1200px; margin: 0 auto; padding: 16px 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
}
.mtk .brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.mtk .brand:hover { color: #fff; }
.mtk .brand-mark {
  width: 48px; height: 48px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  box-shadow: 0 0 0 1.5px rgba(255,255,255,.35), 0 6px 14px rgba(0,0,0,.28);
}
.mtk .brand-mark img { display: block; width: 100%; height: 100%; }
.mtk .brand-name { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.2px; line-height: 1.1; }
.mtk .brand-tag { display: block; font-size: 13px; font-weight: 600; color: #f1e3bd; }

.mtk .app-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.mtk .nav-link {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 4px 12px 4px 6px;
  border-radius: 12px;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 15px;
  border: 1px solid transparent;
  transition: background var(--speed), transform var(--speed);
}
.mtk .nav-link:hover { color: #fff; background: rgba(255,255,255,.12); transform: translateY(-1px); }
.mtk .nav-link .nav-icon {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: var(--tone, var(--brand-blue));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 2px 6px rgba(0,0,0,.25);
}
.mtk .nav-link .nav-icon svg.icon { width: 18px; height: 18px; }
/* Glossy 3D section icons sit on a soft white tile so they read on the dark green */
.mtk .nav-link .nav-icon-art { background: linear-gradient(180deg, #ffffff 0%, #e6efe9 100%); }
.mtk .nav-link .nav-icon-art img { display: block; width: 28px; height: 28px; }
.mtk .nav-link[aria-current="page"] {
  background: #fff; color: var(--ink-950);
  box-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 16px rgba(0,0,0,.18);
}

/* Section tones (used by nav icons, icon badges and dashboard tiles) */
.mtk .tone-dashboard  { --tone: var(--tone-dashboard);  --tone-soft: var(--tone-dashboard-soft); }
.mtk .tone-receipts   { --tone: var(--tone-receipts);   --tone-soft: var(--tone-receipts-soft); }
.mtk .tone-expenses   { --tone: var(--tone-expenses);   --tone-soft: var(--tone-expenses-soft); }
.mtk .tone-vehicles   { --tone: var(--tone-vehicles);   --tone-soft: var(--tone-vehicles-soft); }
.mtk .tone-kilometres { --tone: var(--tone-kilometres); --tone-soft: var(--tone-kilometres-soft); }
.mtk .tone-reports    { --tone: var(--tone-reports);    --tone-soft: var(--tone-reports-soft); }
.mtk .tone-wfh        { --tone: var(--tone-wfh);        --tone-soft: var(--tone-wfh-soft); }
.mtk .tone-workuse    { --tone: var(--tone-workuse);    --tone-soft: var(--tone-workuse-soft); }

/* ---------- 4b. Signed-in layout: office wallpaper and left sidebar ----------
   Opt-in with <body class="mtk has-sidebar"> plus /assets/app-shell.js, which
   builds the sidebar. The old top header stays in the page (its scripts still
   work) but is hidden. The wallpaper is the login page's office scene under a
   cream veil so text and cards stay easy to read. */
body.mtk.has-sidebar { background: #f3eadb; }
body.mtk.has-sidebar::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(251,248,240,.66) 0%, rgba(248,243,230,.56) 100%),
    url("/assets/brand/office-bg.webp") 50% 50% / cover no-repeat,
    #f3eadb;
}
@media (orientation: portrait) {
  body.mtk.has-sidebar::before { background-position: 0 0, 14% 50%, 0 0; }
}
.mtk.has-sidebar .app-header { display: none; }

.mtk .app-sidebar {
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07) 0%, rgba(255,255,255,0) 40%),
    linear-gradient(170deg, #0a3b2b 0%, #0f5a42 60%, #136a4d 100%);
  box-shadow: 4px 0 24px rgba(10, 59, 43, .28);
}
.mtk .sidebar-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mtk .app-sidebar .brand-mark { width: 44px; height: 44px; }
.mtk .app-sidebar .brand-name { font-size: 18px; }
.mtk .app-sidebar .brand-tag { font-size: 12px; line-height: 1.35; white-space: normal; overflow-wrap: break-word; max-width: 170px; margin-top: 2px; }
/* The Private Beta badge (app-stage.js) sits beside the briefcase. Sidebar: the
   briefcase and badge on one row, the name and tagline full width below. */
.mtk .app-sidebar .brand-text { min-width: 0; }
@media (min-width: 1000px) {
  .mtk .app-sidebar .brand:has(.stage-badge) {
    display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; row-gap: 10px;
  }
  .mtk .app-sidebar .brand:has(.stage-badge) .stage-badge { justify-self: start; }
  .mtk .app-sidebar .brand:has(.stage-badge) .brand-text { grid-column: 1 / -1; }
  .mtk .app-sidebar .brand:has(.stage-badge) .brand-tag { max-width: none; }
}
/* Top bar: briefcase, name, then the badge, on one line */
@media (max-width: 999px) {
  .mtk .app-sidebar .stage-badge { order: 2; }
  .mtk .app-sidebar .brand { gap: 10px; min-width: 0; }
}
@media (max-width: 420px) {
  .mtk .app-sidebar .stage-badge { padding: 3px 8px; font-size: 10.5px; letter-spacing: .04em; }
  .mtk .app-sidebar .brand-name { font-size: 17px; white-space: nowrap; }
  .mtk .app-sidebar .brand-mark { width: 38px; height: 38px; }
  /* Room for the name and badge: the Menu button shows its icon only; the
     word stays for screen readers (and still changes to "Close") */
  .mtk .sidebar-toggle { padding: 7px 10px; }
  .mtk .sidebar-toggle .sidebar-toggle-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
.mtk .sidebar-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mtk .sidebar-account { margin-top: 14px !important; padding-top: 14px !important; border-top: 1px solid rgba(241,227,189,.28) !important; }
/* Row layout at every width (the older top-header rules in section 12 stack
   icon above text on small screens; that does not apply to the sidebar) */
.mtk .app-sidebar .nav-link {
  width: 100%; flex-direction: row; gap: 10px; padding: 6px 12px 6px 6px;
  font-size: 15px; text-align: left; line-height: 1.2;
}
/* Sign Out looks like the other links, not a glossy button */
.mtk .app-sidebar button.sidebar-signout {
  justify-content: flex-start; min-height: 40px; border-radius: 12px; border: 1px solid transparent;
  background: none; box-shadow: none; text-shadow: none; font-size: 15px; font-weight: 700; color: #fff;
}
.mtk .app-sidebar button.sidebar-signout:hover:not(:disabled) { background: rgba(255,255,255,.12); filter: none; box-shadow: none; }
.mtk .app-sidebar button.sidebar-signout .nav-icon { background: #8a6a1c; }
.mtk .sidebar-toggle {
  display: none; min-height: 40px; padding: 7px 14px; gap: 8px;
  color: var(--ink-950); text-shadow: none; border-color: #d6c9a6;
  background: linear-gradient(180deg, #fffdf7 0%, #efe6cf 100%);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #b9a777, 0 6px 12px rgba(0,0,0,.2);
}
.mtk .app-sidebar .sidebar-toggle:hover:not(:disabled) { color: var(--ink-950); }

/* Desktop and landscape tablet: fixed sidebar on the left */
@media (min-width: 1000px) {
  body.mtk.has-sidebar { padding-left: 264px; }
  /* Start the office scene beside the sidebar so the filing cabinet shows */
  body.mtk.has-sidebar::before { left: 264px; }
  .mtk .app-sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 264px; z-index: 20;
    display: flex; flex-direction: column; gap: 20px;
    padding: 22px 16px; overflow-y: auto;
    border-right: 3px solid #d4a339;
  }
  .mtk .sidebar-menu { display: flex; flex-direction: column; flex: 1; }
  .mtk .sidebar-account { margin-top: auto !important; }
}
/* Phones and portrait tablets: compact top bar with a Menu button */
@media (max-width: 999px) {
  .mtk .app-sidebar {
    position: sticky; top: 0; z-index: 20;
    padding: 10px 16px; border-bottom: 3px solid #d4a339;
  }
  .mtk .app-sidebar .brand-tag { display: none; }
  .mtk .sidebar-toggle { display: inline-flex; }
  .mtk .sidebar-menu { display: none; padding: 12px 0 6px; max-height: calc(100vh - 80px); overflow-y: auto; }
  .mtk .app-sidebar.is-open .sidebar-menu { display: block; }
  .mtk .sidebar-sections { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .mtk .sidebar-account { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 420px) {
  .mtk .sidebar-sections, .mtk .sidebar-account { grid-template-columns: 1fr !important; }
}

/* ---------- 4c. Automatic-logout warning and unsaved-entry restore ----------
   Built by auth-client.js (startAutoLogout) on signed-in pages. */
.mtk .logout-warning-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  background: rgba(10, 40, 30, .45);
  backdrop-filter: blur(2px);
}
.mtk .logout-warning {
  width: min(440px, 100%);
  padding: 28px 26px 24px; border-radius: 22px; text-align: center;
  background: linear-gradient(180deg, #fffaee 0%, #fbf3e1 100%);
  border: 1px solid rgba(23,107,80,.30);
  box-shadow: inset 0 1px 0 #fff, 0 4px 8px rgba(11,63,47,.12), 0 24px 60px rgba(11,63,47,.35);
}
.mtk .logout-warning h2 { margin: 0 0 10px; font-size: 24px; color: var(--brand-emerald-dark); }
.mtk .logout-warning p { margin: 0 0 12px; color: var(--ink-800); }
.mtk .logout-countdown {
  display: block; margin: 10px auto 4px; font-size: 40px; font-weight: 800; letter-spacing: 1px;
  color: var(--brand-emerald-dark); font-variant-numeric: tabular-nums;
}
.mtk .logout-unsaved {
  padding: 10px 12px; border-radius: 12px; text-align: left; font-size: 15px;
  background: var(--warning-bg); border: 1px solid var(--warning-line); color: var(--warning-ink);
}
.mtk .logout-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 18px; }
.mtk .logout-actions button { flex: 1 1 160px; }

.mtk .draft-restore {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 18px;
  margin: 0 0 22px; padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, #f6fbf7 0%, var(--tone-dashboard-soft) 100%);
  border: 1px solid #bfe0cd; border-left: 6px solid var(--brand-blue);
  box-shadow: var(--shadow-sm);
}
.mtk .draft-restore strong { color: var(--brand-emerald-dark); }
.mtk .draft-restore p { margin: 4px 0 0; color: var(--ink-800); }
.mtk .draft-restore .draft-done { margin: 0; font-weight: 700; color: var(--success-ink); }
.mtk .draft-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- 5. Cards ---------- */
.mtk .card, .mtk .panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.mtk .card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.mtk .card-head h2, .mtk .card-head h3 { margin: 0; }
.mtk .card-head p { margin: 2px 0 0; font-size: 15px; color: var(--ink-700); }
.mtk .icon-badge {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: grid; place-items: center; color: #fff;
  background: var(--tone, var(--brand-blue)); /* fallback for older browsers */
  background: linear-gradient(160deg, color-mix(in srgb, var(--tone, var(--brand-blue)) 55%, #fff) 0%, var(--tone, var(--brand-blue)) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 5px 12px color-mix(in srgb, var(--tone, var(--brand-blue)) 35%, transparent);
}
.mtk .icon-badge svg.icon { width: 24px; height: 24px; }

/* Dashboard-style feature tile (link) */
.mtk .tile {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: var(--ink-900); text-decoration: none; font-weight: 400;
  border-top: 5px solid var(--tone, var(--brand-blue));
  transition: transform var(--speed), box-shadow var(--speed);
}
.mtk .tile:hover { color: var(--ink-900); transform: translateY(-3px); box-shadow: 0 2px 4px rgba(11,23,54,.06), 0 16px 34px rgba(16,45,95,.14); }
.mtk .tile h3 { margin: 4px 0 0; }
.mtk .tile p { margin: 0; color: var(--ink-800); }
.mtk .tile .tile-go { margin-top: auto; font-weight: 800; color: var(--tone, var(--brand-blue)); display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 6. Buttons: glossy, raised, 3D ---------- */
.mtk button, .mtk .button, .mtk .btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 9px 18px;
  border-radius: var(--radius);
  border: 1px solid #0c5a3f;
  font: inherit; font-size: var(--text); font-weight: 700; line-height: 1.2;
  color: #fff; text-decoration: none; text-align: center;
  text-shadow: 0 1px 1px rgba(0, 45, 30, .55);
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.12) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #3fbf8f 0%, #1a9a6c 50%, #13845b 51%, #0e6c4a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), inset 0 -2px 0 rgba(0,40,25,.25), 0 4px 0 #0a4a35, 0 9px 18px rgba(10,74,53,.28);
  transition: transform var(--speed) ease, box-shadow var(--speed) ease, filter var(--speed) ease;
  -webkit-tap-highlight-color: transparent;
}
.mtk button:hover:not(:disabled), .mtk .button:hover, .mtk .btn:hover {
  color: #fff;
  filter: brightness(1.07) saturate(1.05);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(0,40,25,.25), 0 5px 0 #0a4a35, 0 12px 22px rgba(10,74,53,.32);
}
.mtk button:active:not(:disabled), .mtk .button:active, .mtk .btn:active {
  transform: translateY(3px);
  box-shadow: inset 0 2px 5px rgba(0,40,25,.35), 0 1px 0 #0a4a35, 0 3px 6px rgba(10,74,53,.2);
}
.mtk button:disabled, .mtk .button:disabled { opacity: .55; cursor: not-allowed; transform: none; filter: grayscale(.2); }

/* Secondary: soft cream */
.mtk button.secondary, .mtk .button.secondary, .mtk .btn.secondary, .mtk .cancel-button {
  color: var(--ink-900); text-shadow: none; border-color: #d6c9a6;
  background:
    linear-gradient(180deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,.3) 50%, rgba(255,255,255,0) 51%),
    linear-gradient(180deg, #fffdf7 0%, #f7f1e2 50%, #efe6cf 51%, #e9dec3 100%);
  box-shadow: inset 0 1px 0 #fff, 0 4px 0 #cdbd94, 0 8px 16px rgba(90,70,20,.14);
}
.mtk button.secondary:hover:not(:disabled), .mtk .button.secondary:hover, .mtk .btn.secondary:hover, .mtk .cancel-button:hover:not(:disabled) {
  color: var(--ink-900); box-shadow: inset 0 1px 0 #fff, 0 5px 0 #cdbd94, 0 11px 20px rgba(90,70,20,.18);
}
.mtk button.secondary:active:not(:disabled), .mtk .button.secondary:active, .mtk .btn.secondary:active, .mtk .cancel-button:active:not(:disabled) {
  box-shadow: inset 0 2px 5px rgba(90,70,20,.22), 0 1px 0 #cdbd94;
}

/* Success: eucalyptus green */
.mtk button.success, .mtk .button.success, .mtk .btn.success {
  border-color: #0c6a40; text-shadow: 0 1px 1px rgba(0,50,25,.5);
  background:
    linear-gradient(180deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #3fcf8b 0%, #1ea568 50%, #138a55 51%, #0f7447 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 4px 0 #0b5a37, 0 8px 16px rgba(11,90,55,.25);
}
.mtk button.success:active:not(:disabled), .mtk .button.success:active, .mtk .btn.success:active { box-shadow: inset 0 2px 5px rgba(0,50,25,.35), 0 1px 0 #0b5a37; }

/* Danger: for delete only */
.mtk button.danger, .mtk .button.danger, .mtk .btn.danger, .mtk button.delete-button {
  border-color: #8f1724; text-shadow: 0 1px 1px rgba(80,0,10,.5);
  background:
    linear-gradient(180deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #f2646f 0%, #d63343 50%, #bd2333 51%, #a11b2a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 0 #7a1420, 0 8px 16px rgba(122,20,32,.25);
}
.mtk button.danger:hover:not(:disabled), .mtk .button.danger:hover, .mtk .btn.danger:hover, .mtk button.delete-button:hover:not(:disabled) { box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 5px 0 #7a1420, 0 11px 20px rgba(122,20,32,.3); }
.mtk button.danger:active:not(:disabled), .mtk .button.danger:active, .mtk .btn.danger:active, .mtk button.delete-button:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(80,0,10,.35), 0 1px 0 #7a1420; }

.mtk .btn-sm, .mtk button.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 15px; border-radius: 11px; }
.mtk .btn-block { width: 100%; }

/* Buttons on the dark header */
.mtk .app-header button.secondary { min-height: 40px; padding: 7px 14px; }

/* Section-coloured buttons.
   A page sets its colour on <main> (e.g. <main class="tone-expenses">). Every main
   action button inside it, plus the Back to Dashboard button, then uses that colour
   with the same glossy 3D look. Secondary, Cancel, Success and Delete buttons keep
   their own styles. Browsers without color-mix() keep the standard blue. */
.mtk main.tone-dashboard  { --page-tone: var(--tone-dashboard); }
.mtk main.tone-receipts   { --page-tone: var(--tone-receipts); }
.mtk main.tone-expenses   { --page-tone: var(--tone-expenses); }
.mtk main.tone-vehicles   { --page-tone: var(--tone-vehicles); }
.mtk main.tone-kilometres { --page-tone: var(--tone-kilometres); }
.mtk main.tone-reports    { --page-tone: var(--tone-reports); }
.mtk main.tone-wfh        { --page-tone: var(--tone-wfh); }
.mtk main.tone-workuse    { --page-tone: var(--tone-workuse); }
.mtk .back-button,
.mtk main[class*="tone-"] button:not(.secondary):not(.danger):not(.delete-button):not(.success):not(.cancel-button):not(.info-tip),
.mtk main[class*="tone-"] .button:not(.secondary):not(.danger):not(.success) {
  --pt: var(--page-tone, var(--brand-blue));
  border-color: color-mix(in srgb, var(--pt) 65%, #000);
  background:
    linear-gradient(180deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.12) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--pt) 70%, #fff) 0%,
      var(--pt) 50%,
      color-mix(in srgb, var(--pt) 88%, #000) 51%,
      color-mix(in srgb, var(--pt) 72%, #000) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65), inset 0 -2px 0 rgba(0,0,0,.2),
    0 4px 0 color-mix(in srgb, var(--pt) 55%, #000),
    0 9px 18px color-mix(in srgb, var(--pt) 30%, transparent);
}
.mtk .back-button:hover,
.mtk main[class*="tone-"] button:not(.secondary):not(.danger):not(.delete-button):not(.success):not(.cancel-button):not(.info-tip):hover:not(:disabled),
.mtk main[class*="tone-"] .button:not(.secondary):not(.danger):not(.success):hover {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(0,0,0,.2),
    0 5px 0 color-mix(in srgb, var(--pt) 55%, #000),
    0 12px 22px color-mix(in srgb, var(--pt) 35%, transparent);
}
.mtk .back-button:active,
.mtk main[class*="tone-"] button:not(.secondary):not(.danger):not(.delete-button):not(.success):not(.cancel-button):not(.info-tip):active:not(:disabled),
.mtk main[class*="tone-"] .button:not(.secondary):not(.danger):not(.success):active {
  box-shadow:
    inset 0 2px 5px rgba(0,0,0,.35),
    0 1px 0 color-mix(in srgb, var(--pt) 55%, #000),
    0 3px 6px color-mix(in srgb, var(--pt) 20%, transparent);
}
.mtk .back-button { margin: 0 0 18px; }

/* Delete buttons always show a bin icon, so they stand apart from coral or red page colours */
.mtk button.danger:not(:has(svg))::before,
.mtk button.delete-button::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 11v6M14 11v6M6 7l1 13h10l1-13M9 7V4h6v3'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- 7. Forms ---------- */
.mtk .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.mtk .full { grid-column: 1 / -1; }
.mtk .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.mtk .group-title {
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line);
  font-size: var(--text-lg); font-weight: 800; color: var(--ink-950);
}
.mtk .group-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.mtk .group-title svg.icon { color: var(--tone, var(--brand-blue)); width: 22px; height: 22px; }
.mtk label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--ink-950); font-size: var(--text); }
.mtk input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .mtk select, .mtk textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  background-color: #fff; color: var(--ink-950);
  font: inherit; font-size: var(--text);
  box-shadow: inset 0 1px 2px rgba(14,39,31,.06);
  transition: border-color var(--speed), box-shadow var(--speed);
}
.mtk select {
  appearance: none; -webkit-appearance: none; padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230e271f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.mtk textarea { resize: vertical; min-height: 90px; }
.mtk input::placeholder, .mtk textarea::placeholder { color: #5d6e66; }
.mtk input:hover, .mtk select:hover, .mtk textarea:hover { border-color: #6f8a7d; }
.mtk input:focus, .mtk select:focus, .mtk textarea:focus { outline: none; border-color: var(--brand-blue); box-shadow: var(--focus); }
.mtk input[type="checkbox"], .mtk input[type="radio"] { width: 20px; height: 20px; accent-color: var(--brand-blue); }
.mtk .with-unit { position: relative; }
.mtk .with-unit input { padding-right: 52px; }
.mtk .with-unit .unit-tag {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-weight: 700; color: var(--ink-700); pointer-events: none;
}
.mtk .actions { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 22px; }

/* ---------- 8. Messages and callouts ---------- */
.mtk .notice, .mtk .warning {
  display: flex; gap: 14px; align-items: flex-start;
  background: linear-gradient(180deg, #fffaf0, var(--warning-bg));
  border: 1px solid var(--warning-line); border-left: 6px solid var(--brand-gold);
  border-radius: var(--radius); padding: 14px 18px; margin: 0 0 22px;
  color: var(--warning-ink);
}
.mtk .notice > svg.icon, .mtk .warning > svg.icon { width: 26px; height: 26px; color: #a86f00; margin-top: 2px; }
.mtk .notice strong, .mtk .warning strong { color: #2e2100; }
.mtk .notice p { margin: 4px 0 0; }
.mtk .hint {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 18px 0 0; padding: 12px 14px;
  background: var(--info-bg); border: 1px solid var(--info-line); border-radius: 12px;
  font-size: 15px; color: var(--ink-800);
}
.mtk .hint svg.icon { color: var(--brand-blue); margin-top: 2px; }
.mtk .status { margin: 14px 0 0; font-weight: 600; color: var(--ink-800); }
.mtk .status:empty { margin: 0; }
.mtk .status:not(:empty) { padding: 10px 14px; border-radius: 12px; }
.mtk .status.success { background: var(--success-bg); border: 1px solid var(--success-line); color: var(--success-ink); }
.mtk .status.error { background: var(--error-bg); border: 1px solid var(--error-line); color: var(--error-ink); }
/* Loading indicator: add class="is-loading" to a status line while records load */
.mtk .is-loading { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-900); }
.mtk .is-loading::before {
  content: ""; width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--page-tone, var(--brand-blue)) 25%, #fff);
  border-top-color: var(--page-tone, var(--brand-blue));
  animation: mtk-spin .8s linear infinite;
}
@keyframes mtk-spin { to { transform: rotate(360deg); } }

/* ---------- 9. Stat tiles ---------- */
.mtk .totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.mtk .total {
  display: flex; flex-direction: column; gap: 4px; padding: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-size: var(--text-sm); font-weight: 700; color: var(--ink-800);
}
.mtk .tile-icon {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 4px;
  background: var(--tone-soft, var(--tone-kilometres-soft)); color: var(--tone, var(--brand-blue));
}
.mtk .tile-icon svg.icon { width: 20px; height: 20px; }
.mtk .total .value { display: block; margin-top: 2px; }
.mtk .total strong { font-size: 22px; line-height: 1.15; color: var(--ink-950); word-break: break-word; }
.mtk .total .unit { font-size: var(--text-sm); font-weight: 700; color: var(--ink-700); }

/* ---------- 10. Donut chart (SVG, r=48 in a 120 viewBox) ---------- */
.mtk .chart-panel {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 18px; border-radius: 16px;
  background: linear-gradient(160deg, #fbf9f2 0%, #f0f7f2 100%); border: 1px solid #e2dcc8;
}
.mtk .donut-wrap { position: relative; width: 168px; height: 168px; flex: none; margin: 0 auto; }
.mtk .donut { width: 100%; height: 100%; display: block; }
.mtk .donut circle { fill: none; stroke-width: 16; transition: stroke-dasharray .6s ease, stroke-dashoffset .6s ease; }
.mtk .donut .donut-track { stroke: #e7e1d1; }
.mtk .donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.mtk .donut-center strong { font-size: 22px; line-height: 1.1; color: var(--ink-950); font-variant-numeric: tabular-nums; }
.mtk .donut-center span { font-size: 13px; font-weight: 700; color: var(--ink-700); }
.mtk .legend { flex: 1 1 170px; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.mtk .legend li { display: flex; align-items: center; gap: 12px; }
.mtk .swatch { width: 14px; height: 40px; border-radius: 7px; flex: none; background: var(--tone, var(--brand-blue)); }
.mtk .legend-label { display: block; font-size: 15px; font-weight: 700; color: var(--ink-800); }
.mtk .legend strong { display: block; font-size: 26px; line-height: 1.1; color: var(--ink-950); font-variant-numeric: tabular-nums; }

/* ---------- 11. Tables ---------- */
.mtk .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.mtk table { border-collapse: collapse; width: 100%; font-size: 15px; }
.mtk th, .mtk td { padding: 12px 14px; text-align: left; border-bottom: 1px solid #ece6d6; vertical-align: top; }
.mtk th { background: linear-gradient(180deg, #f8f4e8, #efe8d4); color: var(--ink-950); font-weight: 800; white-space: nowrap; }
.mtk td { color: var(--ink-900); }
.mtk tbody tr:nth-child(even) td { background: #fcfaf5; }
.mtk tbody tr:hover td { background: #eef7f1; }
.mtk tbody tr:last-child td { border-bottom: 0; }
.mtk td.actions-cell { white-space: nowrap; }
.mtk td.actions-cell button { margin: 3px 6px 6px 0; }
.mtk .pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px;
  font-weight: 800; font-size: var(--text-sm); white-space: nowrap;
  background: var(--tone-soft, var(--tone-kilometres-soft)); color: var(--tone, var(--brand-blue));
}
.mtk .pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mtk .pill.business { --tone: #0848a0; --tone-soft: var(--tone-kilometres-soft); }
.mtk .pill.private { --tone: #0c6640; --tone-soft: var(--tone-vehicles-soft); }
.mtk .badge-soon {
  padding: 2px 10px; border-radius: 999px; background: #f1ecdf; color: var(--ink-700);
  font-size: 12px; font-weight: 800; white-space: nowrap;
}

/* ---------- 12b. Classes used by the existing pages (and their scripts) ---------- */
.mtk .back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 16px; font-weight: 700; text-decoration: none; }
.mtk form > label, .mtk .panel > label { margin-top: 16px; }
.mtk form > button, .mtk .panel > button { margin: 20px 8px 0 0; }
.mtk .result {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--info-bg); border: 1px solid var(--info-line);
  color: var(--ink-900); font-weight: 600; line-height: 1.5;
  overflow-wrap: anywhere; white-space: pre-line;
}
.mtk .small-button, .mtk .edit-button, .mtk .delete-button {
  min-height: 36px; padding: 6px 12px; font-size: 15px; border-radius: 11px; margin: 0 6px 6px 0;
}
.mtk td.actions { display: table-cell; margin: 0; white-space: nowrap; }
.mtk .amount { text-align: right; white-space: nowrap; }
.mtk .receipt-name { overflow-wrap: anywhere; max-width: 200px; }
.mtk p.total { display: block; margin-top: 18px; padding: 12px 16px; font-size: 18px; font-weight: 800; color: var(--ink-950); }
.mtk .summary-total {
  margin-top: 22px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--tone-soft, var(--surface-tint)); font-size: 18px; font-weight: 800; color: var(--ink-950);
}
.mtk .filter-row { display: flex; align-items: end; gap: 15px; flex-wrap: wrap; }
.mtk .filter-row > div { flex: 1; min-width: 220px; }
/* Category bars: rows, tracks and bars created by the page scripts */
.mtk .summary-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 18px 0 8px; font-weight: 700; color: var(--ink-950); }
.mtk .summary-name { font-weight: 700; }
.mtk .summary-amount { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mtk .summary-track, .mtk .bar-track { width: 100%; height: 12px; border-radius: 999px; background: #ebe5d6; overflow: hidden; }
.mtk .summary-bar, .mtk .bar {
  height: 100%; border-radius: 999px;
  background: var(--tone, var(--brand-blue)); /* fallback */
  background: linear-gradient(90deg, color-mix(in srgb, var(--tone, var(--brand-blue)) 60%, #fff), var(--tone, var(--brand-blue)));
  transition: width .6s ease;
}
/* Metric tiles (Tax Reports) */
.mtk .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.mtk .metric { padding: 18px; background: linear-gradient(160deg, #fff, var(--surface-tint)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); border-top: 4px solid var(--tone, var(--brand-blue)); }
.mtk .metric-label { margin-bottom: 6px; font-size: var(--text-sm); font-weight: 700; color: var(--ink-800); }
.mtk .metric-value { font-size: 26px; font-weight: 800; color: var(--ink-950); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.mtk .page-title { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.mtk .page-title h1 { margin: 0; }
/* Section filing-drawer artwork beside a page heading */
.mtk .page-drawer { width: 64px; height: 64px; flex: none; margin: -6px 0; filter: drop-shadow(0 5px 8px rgba(14,60,42,.18)); }

/* ---------- 12. Responsive ---------- */
@media (max-width: 1000px) {
  .mtk .app-nav { width: 100%; }
  .mtk .app-nav ul { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
  .mtk .nav-link { flex-direction: column; gap: 4px; padding: 8px 4px; font-size: 13px; text-align: center; line-height: 1.15; }
}
/* Tables with class="table-stack" and data-label on each cell become cards on phones */
@media (max-width: 760px) {
  .mtk .table-wrap:has(.table-stack) { border: 0; overflow: visible; background: transparent; }
  .mtk .table-stack, .mtk .table-stack tbody, .mtk .table-stack tr, .mtk .table-stack td { display: block; width: 100%; }
  .mtk .table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .mtk .table-stack tbody tr {
    margin-bottom: 14px; padding: 6px 4px; border: 1px solid var(--line); border-radius: var(--radius);
    background: #fff; box-shadow: var(--shadow-sm);
  }
  .mtk .table-stack tbody tr:nth-child(even) td, .mtk .table-stack tbody tr:hover td { background: transparent; }
  .mtk .table-stack td { border-bottom: 1px solid #efeadd; padding: 9px 12px; }
  .mtk .table-stack td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: 13px; font-weight: 800; color: var(--ink-700); text-transform: uppercase; letter-spacing: .04em;
  }
  .mtk .table-stack td.actions-cell { display: flex; gap: 10px; white-space: normal; }
  .mtk .table-stack td.actions-cell button { flex: 1; margin: 4px 0; }
}
@media (max-width: 650px) {
  .mtk .app-header-inner { padding: 14px 16px; }
  .mtk .app-nav ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mtk main { padding: 18px 16px 40px; }
  .mtk h1 { font-size: 24px; }
  .mtk .card, .mtk .panel { padding: 18px; border-radius: 16px; }
  .mtk .grid, .mtk .totals { grid-template-columns: 1fr; }
  .mtk .total { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
  .mtk .total .tile-icon { margin-bottom: 0; }
  .mtk .total .value { margin: 0 0 0 auto; white-space: nowrap; }
  .mtk .chart-panel { justify-content: center; }
  .mtk .actions > button, .mtk .actions > .button { flex: 1 1 160px; }
  .mtk form > button, .mtk .panel > button { width: 100%; margin-right: 0; }
  .mtk .metric-value { font-size: 22px; }
  .mtk .page-title .icon-badge { width: 40px; height: 40px; }
  .mtk .page-drawer { width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  .mtk *, .mtk *::before, .mtk *::after { transition: none !important; animation: none !important; }
}
@media print {
  body.mtk { background: #fff; }
  .mtk .app-header, .mtk .app-nav, .mtk .app-sidebar, .mtk button { display: none !important; }
  body.mtk.has-sidebar { padding-left: 0; }
  body.mtk.has-sidebar::before { display: none; }
  .mtk .card, .mtk .panel { box-shadow: none; border-color: #999; }
}

/* ---------- 13. Help system: Help and How to Use ----------
   Reusable on any section. Markup: a .help-bar holding two buttons
   (class="help-btn", data-help-toggle, aria-controls="<panel id>") beside the
   heading, and matching .help-panel elements (hidden) placed just below it.
   Panels open inline, so forms and registers stay usable. Colours follow the
   page tone set on <main> (e.g. tone-expenses red, tone-receipts purple).
   Behaviour lives in /assets/help.js. */
.mtk .page-title { flex-wrap: wrap; row-gap: 10px; }
.mtk .help-bar { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mtk .help-bar[hidden] { display: none; }
.mtk main .help-btn {
  min-height: 40px; padding: 6px 14px; margin: 0; gap: 6px;
  font-size: 15px; border-radius: 11px;
}
.mtk main .help-btn svg.icon { width: 18px; height: 18px; }
.mtk main .help-btn[aria-expanded="true"] {
  filter: brightness(.9); transform: translateY(2px);
  box-shadow: inset 0 3px 6px rgba(0,0,0,.35), 0 1px 0 rgba(0,0,0,.25);
}
.mtk main .help-btn:focus-visible, .mtk .help-panel .help-close:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
@media (pointer: coarse) { .mtk main .help-btn, .mtk .help-panel .help-close { min-height: 40px; } }

.mtk .help-panel {
  --ht: var(--page-tone, var(--brand-blue));
  margin: 0 0 18px; padding: 16px 20px 18px;
  background: #fff; color: var(--ink-900);
  border: 1px solid color-mix(in srgb, var(--ht) 25%, #fff);
  border-left: 6px solid var(--ht);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font-size: 16px; line-height: 1.55;
}
.mtk .help-panel[hidden] { display: none; }
.mtk .help-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.mtk .help-panel h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 19px; color: var(--brand-emerald-dark); }
.mtk .help-panel h2 svg.icon { width: 22px; height: 22px; color: var(--ht); }
.mtk .help-panel .help-close { min-height: 38px; padding: 4px 12px; margin: 0; font-size: 14px; gap: 5px; }
.mtk .help-panel .help-close svg.icon { width: 15px; height: 15px; }
.mtk .help-panel p { margin: 0 0 8px; }
.mtk .help-panel ul { margin: 0; padding-left: 22px; }
.mtk .help-panel li { margin: 5px 0; }
.mtk .help-panel h3 { margin: 14px 0 4px; font-size: 16px; color: var(--ink-950); }
/* Numbered steps with section-coloured numbers */
.mtk .help-steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.mtk .help-steps > li { position: relative; margin: 10px 0; padding-left: 40px; counter-increment: step; }
.mtk .help-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ht); color: #fff; font-size: 14px; font-weight: 800;
}
.mtk .help-steps strong { color: var(--ink-950); }
@media (max-width: 480px) { .mtk .help-panel { padding: 14px 14px 16px; font-size: 15px; } }
/* Text for screen readers only (used by Help buttons and other icon labels) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 14. Compact layout standard ----------
   A page opts in with <main class="... compact">. Less space between panels,
   fields and notices so controls and records appear sooner, especially on
   phones. Fields keep their full 48px height and labels keep their size;
   optional explanations live in the Help / How to Use panels (section 13). */
.mtk main.compact .card, .mtk main.compact .panel { padding: 22px; margin-bottom: 18px; }
.mtk main.compact form > label, .mtk main.compact .panel > label { margin-top: 12px; }
.mtk main.compact form > button, .mtk main.compact .panel > button { margin-top: 16px; }
.mtk main.compact .notice, .mtk main.compact .warning { padding: 10px 14px; margin-bottom: 16px; font-size: 15px; }
.mtk main.compact .page-title { margin-bottom: 12px; }
.mtk main.compact .back-button { margin-bottom: 12px; }
.mtk main.compact .help-panel { margin-bottom: 14px; }
@media (max-width: 650px) {
  .mtk main.compact { padding-top: 14px; }
  .mtk main.compact .card, .mtk main.compact .panel { padding: 16px; margin-bottom: 14px; }
  .mtk main.compact .page-drawer { width: 44px; height: 44px; margin: -4px 0; }
  .mtk main.compact h1 { font-size: 22px; }
}

/* ---------- 15. Show More / Show Less (long lists) ----------
   Behaviour in /assets/show-more.js. Show More takes the page colour; Show Less
   is the cream secondary button. Both stay 44px tall for easy tapping. */
.mtk .show-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: 12px 0 0; }
.mtk .show-more[hidden] { display: none; }
.mtk .show-more-count { margin: 0; font-weight: 700; color: var(--ink-800); }
.mtk .show-more-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mtk main .show-more-actions button { margin: 0; min-height: 40px; padding: 7px 14px; font-size: 15px; gap: 6px; }
.mtk main .show-more-actions button svg.icon { width: 18px; height: 18px; }
.mtk main .show-more-actions button[hidden] { display: none; }
.mtk main .show-more-actions button:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
@media (max-width: 480px) {
  .mtk .show-more-actions { width: 100%; }
  .mtk main .show-more-actions button { flex: 1 1 0; }
}

/* ---------- 16. Two-column sections and sideways-scrolling tables ----------
   Two columns: wrap the section in .two-col-host, then .two-col with two .col
   children (form left, records right). Columns follow the space beside the
   sidebar: stacked on phones, even split from ~660px, records wider from ~900px.
   Tables: put .table-wrap inside .scroll-frame with a .scroll-hint before it;
   /assets/scroll-cues.js shows the hint and edge fades only when needed.
   Colours follow the page tone. */
.mtk .two-col-host { container-type: inline-size; }
.mtk .two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 24px; align-items: start; }
.mtk .two-col > .col { min-width: 0; }
.mtk .two-col > .col > .panel:last-child, .mtk .two-col > .col > .card:last-child { margin-bottom: 0; }
.mtk .two-col > .col + .col { margin-top: 20px; }
.mtk .col .panel + .panel, .mtk .col details.panel + details.panel { margin-top: 20px; }
@container (min-width: 900px) {
  .mtk .two-col.two-col { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
@container (min-width: 660px) {
  .mtk .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mtk .two-col > .col + .col { margin-top: 0; }
}

.mtk .scroll-hint {
  display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
  font-size: 15px; font-weight: 700; color: var(--brand-emerald-dark);
}
.mtk .scroll-hint[hidden] { display: none; }
.mtk .scroll-hint span { font-size: 20px; line-height: 1; color: var(--page-tone, var(--brand-blue)); }
.mtk .scroll-frame { position: relative; --st: var(--page-tone, var(--brand-blue)); --st-track: color-mix(in srgb, var(--st) 12%, #fff); }
.mtk .scroll-frame::before, .mtk .scroll-frame::after {
  content: ""; position: absolute; top: 1px; bottom: 14px; width: 28px;
  pointer-events: none; opacity: 0; transition: opacity var(--speed); z-index: 1;
}
.mtk .scroll-frame::before { left: 1px; border-radius: var(--radius) 0 0 0; background: linear-gradient(90deg, rgba(14,39,31,.18), rgba(14,39,31,0)); }
.mtk .scroll-frame::after { right: 1px; border-radius: 0 var(--radius) 0 0; background: linear-gradient(270deg, rgba(14,39,31,.18), rgba(14,39,31,0)); }
.mtk .scroll-frame.more-left::before, .mtk .scroll-frame.more-right::after { opacity: 1; }
.mtk .scroll-frame > .table-wrap { scrollbar-width: thin; scrollbar-color: var(--st) var(--st-track); overscroll-behavior-x: contain; }
.mtk .scroll-frame > .table-wrap::-webkit-scrollbar { height: 10px; }
.mtk .scroll-frame > .table-wrap::-webkit-scrollbar-track { background: var(--st-track); border-radius: 0 0 var(--radius) var(--radius); }
.mtk .scroll-frame > .table-wrap::-webkit-scrollbar-thumb { background: var(--st); border-radius: 10px; border: 2px solid var(--st-track); }
.mtk .scroll-frame > .table-wrap:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }

/* ---------- 17. Section headings and tinted sections ----------
   .form-title: 22px dark-green heading with a 3D icon in the page colour.
   <main class="... tinted">: panels get a soft wash and border in the page colour. */
.mtk .form-title {
  display: flex; align-items: center; gap: 14px; margin: 0 0 6px; padding-bottom: 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--page-tone, var(--brand-blue)) 16%, #ece6d6);
}
.mtk .form-title h2, .mtk .form-title h3 { margin: 0; font-size: 22px; font-weight: 800; color: var(--brand-emerald-dark); letter-spacing: -.2px; }
.mtk .form-title-icon {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 13px;
  color: #fff; border: 1px solid rgba(0,0,0,.18);
  background:
    linear-gradient(180deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    var(--page-tone, var(--brand-blue));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 3px 0 rgba(0,0,0,.25), 0 6px 12px color-mix(in srgb, var(--page-tone, var(--brand-blue)) 25%, transparent);
}
.mtk .form-title-icon svg.icon { width: 24px; height: 24px; }
@media (max-width: 480px) {
  .mtk .form-title h2, .mtk .form-title h3 { font-size: 20px; }
  .mtk .form-title-icon { width: 40px; height: 40px; border-radius: 12px; }
}
.mtk main.tinted .panel, .mtk main.tinted .card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--page-tone) 8%, #fff) 0%, #fff 170px);
  border-color: color-mix(in srgb, var(--page-tone) 22%, var(--line));
}

/* ---------- 18. Search boxes and history toolbars ----------
   <div class="search-field"> holding svg.search-icon, input.search-input and a
   button.secondary.search-clear (hidden until something is typed). A history card
   uses .history-head (heading + Show/Hide), .section-note and .history-tools
   (search beside a Refresh button). Colours follow the page tone. */
.mtk .search-field { position: relative; }
.mtk .search-field .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; color: var(--page-tone, var(--brand-blue)); pointer-events: none;
}
.mtk .search-field input.search-input {
  padding-left: 46px; padding-right: 104px;
  border-color: color-mix(in srgb, var(--page-tone, var(--brand-blue)) 45%, var(--line-strong));
}
.mtk .search-field input.search-input::-webkit-search-cancel-button { display: none; }
.mtk .search-field .search-clear { position: absolute; right: 6px; top: 6px; bottom: 6px; min-height: 0; padding: 0 12px; margin: 0; font-size: 14px; gap: 6px; }
.mtk .search-field .search-clear[hidden] { display: none; }
.mtk .search-field .search-clear svg.icon { width: 16px; height: 16px; }
.mtk .history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.mtk .history-head .form-title { margin: 0; padding: 0; border: 0; flex: 1 1 260px; }
.mtk .section-note { margin: 4px 0 12px; font-size: 15px; color: var(--ink-800); }
.mtk .history-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 0 0 12px; }
.mtk .history-tools .tool-search { flex: 1 1 260px; }
.mtk .history-tools label { margin-top: 0; }
.mtk main .history-tools > button { margin: 0; min-height: 42px; }
@media (max-width: 650px) { .mtk main .history-tools > button { width: 100%; } }

/* ---------- 19. Collapsible summary panels ----------
   <section class="card collapse-card"> with a .collapse-head (heading + a
   button[data-collapse-toggle] aria-controls="<body id>") and the body after it.
   The button uses the page colour's glossy 3D style. Behaviour: /assets/collapsible.js. */
.mtk .collapse-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.mtk .collapse-head .form-title { flex: 1 1 240px; margin: 0; padding: 0; border: 0; }
.mtk .collapse-head h2 { margin: 0; }
.mtk main .collapse-toggle { margin: 0; min-height: 40px; min-width: 168px; padding: 7px 14px; font-size: 15px; gap: 8px; }
.mtk main .collapse-toggle:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
.mtk .collapse-body { margin-top: 14px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, var(--page-tone, var(--brand-blue)) 16%, #ece6d6); }
.mtk .collapse-body[hidden] { display: none; }
.mtk .collapse-body > :first-child { margin-top: 0; }
@media (max-width: 480px) { .mtk main .collapse-toggle { width: 100%; } }

/* ---------- 20. FilingForMe: dashboard module cards and module pages ----------
   FilingForMe has two modules, each with its own glossy illustration (the same
   artwork as the sign-in page): My Filing Cabinet (green) and My Tax Assistant
   (gold). The dashboard shows them as two large equal cards; each module page
   (/filing-cabinet.html, /tax-assistant.html) lists its sections as tiles. */
.mtk .pa-filing { --tone: var(--tone-dashboard); --tone-soft: var(--tone-dashboard-soft); }
.mtk .pa-tax    { --tone: var(--tone-reports);   --tone-soft: var(--tone-reports-soft); }
.mtk .pa-own { color: var(--brand-blue); }
.mtk .pa-pa  { color: #b07c12; }

/* Back buttons take the colour of where they go */
.mtk .back-button.to-dashboard, .mtk .back-button.to-filing { --page-tone: var(--tone-dashboard); }
.mtk .back-button.to-tax { --page-tone: var(--tone-reports); }

/* Compact header banners (dashboard welcome and module pages): the glossy
   icon sits on the left; the heading and subtitle are centred across the whole
   banner. An empty third column as wide as the icon keeps the text centred. */
.mtk .pa-welcome, .mtk .module-head {
  --art: 72px;
  display: grid; grid-template-columns: var(--art) minmax(0, 1fr) var(--art);
  align-items: center; gap: 16px; text-align: center;
  padding: 14px 22px;
}
.mtk .module-head { --art: 120px; }
.mtk .pa-welcome > img, .mtk .module-head > img { grid-column: 1; width: var(--art); height: auto; }
.mtk .pa-welcome > div, .mtk .module-head > div { grid-column: 2; }
.mtk .pa-welcome h1, .mtk .module-head h1 { margin: 0 0 4px; font-size: 33px; }
.mtk .pa-welcome p, .mtk .module-head p { margin: 0; font-size: 18.5px; color: var(--ink-800); }

.mtk .pa-welcome {
  background:
    radial-gradient(500px 160px at 100% 0%, rgba(212,163,57,.14), transparent 70%),
    linear-gradient(135deg, #fffdf6 0%, #eef7f0 100%);
}
.mtk .pa-welcome .pa-mark { filter: drop-shadow(0 5px 8px rgba(10,74,53,.25)); }

/* Dashboard: two large, equal module cards */
.mtk .pa-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 24px; margin: 0 0 24px; }
.mtk .pa-module {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 26px 24px 24px; border-radius: 24px;
  color: var(--ink-900); text-decoration: none; font-weight: 400;
  border: 1px solid color-mix(in srgb, var(--tone) 30%, #fff);
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(11,63,47,.06), 0 14px 30px rgba(11,63,47,.12);
  transition: transform var(--speed), box-shadow var(--speed);
}
.mtk .pa-module.pa-filing { background: linear-gradient(180deg, #f6fcf8 0%, #e3f3ea 100%); }
.mtk .pa-module.pa-tax    { background: linear-gradient(180deg, #fffcf0 0%, #fff0c9 100%); }
.mtk .pa-module:hover { color: var(--ink-900); transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(11,63,47,.06), 0 20px 38px rgba(11,63,47,.18); }
.mtk .pa-module:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
.mtk .pa-module-art {
  display: block; width: 100%; max-width: 240px; height: auto; aspect-ratio: 332 / 315;
  filter: drop-shadow(0 8px 14px rgba(0,0,0,.2));
}
.mtk .pa-module h2 { margin: 6px 0 0; font-size: 27px; color: color-mix(in srgb, var(--tone) 60%, #000); }
.mtk .pa-module p { margin: 0; font-size: 16.5px; color: var(--ink-800); }
.mtk .pa-includes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 6px; padding: 0; list-style: none; }
.mtk .pa-includes li {
  padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: rgba(255,255,255,.75); border: 1px solid color-mix(in srgb, var(--tone) 28%, #fff);
  color: color-mix(in srgb, var(--tone) 70%, #000);
}
/* My Tax Assistant's four longer labels: two rows of two equal pills */
.mtk .pa-includes.pa-includes-pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 460px; }
.mtk .pa-includes-pairs li { display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.25; }

/* Glossy 3D "Open" button inside module cards and section tiles, in their colour */
.mtk .pa-module .tile-go, .mtk .module-tiles .tile .tile-go {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: auto; width: 100%; max-width: 320px;
  padding: 9px 16px; min-height: 42px; border-radius: 13px;
  font-weight: 800; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.35);
  background:
    linear-gradient(180deg, rgba(255,255,255,.38) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    var(--tone);
  border: 1px solid rgba(0,0,0,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 4px 0 rgba(0,0,0,.28), 0 8px 14px rgba(0,0,0,.16);
  transition: transform var(--speed), box-shadow var(--speed), filter var(--speed);
}
.mtk .pa-module:hover .tile-go, .mtk .module-tiles .tile:hover .tile-go { filter: brightness(1.08); }
.mtk .pa-module:active .tile-go, .mtk .module-tiles .tile:active .tile-go { transform: translateY(3px); box-shadow: inset 0 2px 4px rgba(0,0,0,.3), 0 1px 0 rgba(0,0,0,.28); }

/* Module pages: heading with the module illustration, then section tiles */
.mtk .module-head {
  border: 1px solid color-mix(in srgb, var(--tone) 30%, #fff);
}
.mtk .module-head.pa-filing { background: linear-gradient(135deg, #fbfefc 0%, #e3f3ea 100%); }
/* My Tax Assistant: cream to pale blue, so the gold calculator stands out */
.mtk .module-head.pa-tax {
  background:
    radial-gradient(420px 140px at 0% 0%, rgba(226,178,74,.16), transparent 70%),
    linear-gradient(120deg, #fffaf0 0%, #f4f7fc 45%, #e4eefb 100%);
  border-color: #cfdcf0;
}
.mtk .module-head img { aspect-ratio: 332 / 315; filter: drop-shadow(0 6px 10px rgba(0,0,0,.18)); }
.mtk .module-head h1 { color: color-mix(in srgb, var(--tone) 60%, #000); }
.mtk .module-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-bottom: 24px; }
.mtk .module-tiles .tile {
  align-items: center; text-align: center;
  border: 1px solid color-mix(in srgb, var(--tone) 22%, #fff);
  border-top: 5px solid var(--tone);
  background: linear-gradient(180deg, var(--tone-soft) 0%, #fff 78%);
}
.mtk .module-tiles .tile h2 { margin: 2px 0 0; font-size: 20px; }
.mtk .module-tiles .tile-art { width: 88px; height: 88px; margin: -6px 0 -4px; filter: drop-shadow(0 6px 8px color-mix(in srgb, var(--tone) 25%, transparent)); transition: transform var(--speed); }
.mtk .module-tiles .tile:hover .tile-art { transform: translateY(-2px) scale(1.03); }

@media (max-width: 700px) {
  .mtk .pa-module-grid { grid-template-columns: 1fr; gap: 18px; }
  .mtk .pa-module { padding: 20px 18px; }
  .mtk .pa-module-art { max-width: 210px; }
  .mtk .pa-module h2 { font-size: 24px; }
}
@media (max-width: 760px) {
  .mtk .pa-welcome { --art: 56px; }
  .mtk .module-head { --art: 84px; }
  .mtk .pa-welcome, .mtk .module-head { gap: 12px; padding: 12px 16px; }
  .mtk .pa-welcome h1, .mtk .module-head h1 { font-size: 27px; }
  .mtk .pa-welcome p, .mtk .module-head p { font-size: 16.5px; }
}
/* Phones: too narrow for icon + centred text side by side, so the icon sits
   above the centred heading instead of squeezing it */
@media (max-width: 480px) {
  .mtk .pa-welcome, .mtk .module-head { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 6px; padding: 12px 14px; }
  .mtk .pa-welcome { --art: 46px; }
  .mtk .module-head { --art: 76px; }
  .mtk .pa-welcome > img, .mtk .module-head > img, .mtk .pa-welcome > div, .mtk .module-head > div { grid-column: 1; }
  .mtk .pa-welcome h1, .mtk .module-head h1 { font-size: 25px; }
  .mtk .pa-welcome p, .mtk .module-head p { font-size: 16px; }
}

/* ---------- 20b. My Business Portal (royal blue) ----------
   The third module. Its artwork is the approved 3D briefcase, used exactly as
   supplied (square, no tile behind it), so it gets its own size rules. Its
   sections are not built yet: they show as "Coming Soon" cards, never as links. */
.mtk .pa-business { --tone: #1f4fa8; --tone-soft: #e3ecfb; }
.mtk main.tone-business { --page-tone: #1f4fa8; }
.mtk .back-button.to-business { --page-tone: #1f4fa8; }
.mtk .pa-module.pa-business { background: linear-gradient(180deg, #f7f9ff 0%, #e3ecfb 100%); }
/* Square artwork: as tall as the other two module pictures (332 x 315), so the headings line up */
.mtk .pa-module-art.pa-art-square { aspect-ratio: 1 / 1; max-width: calc(240px * 315 / 332); }
@media (max-width: 700px) { .mtk .pa-module-art.pa-art-square { max-width: calc(210px * 315 / 332); } }
.mtk .module-head.pa-business {
  background:
    radial-gradient(420px 140px at 0% 0%, rgba(31,79,168,.12), transparent 70%),
    linear-gradient(120deg, #f8faff 0%, #eef3fd 50%, #e1eafb 100%);
  border-color: #c9d7f2;
}
.mtk .module-head.pa-business img { aspect-ratio: 1 / 1; }
.mtk .pa-soon {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: .02em; color: #1f4fa8;
  background: #fff; border: 1px dashed #8eaae0;
}
.mtk .pa-soon svg.icon { width: 15px; height: 15px; }
/* Dashboard: three module cards side by side when there's room. With room for
   two, the third (Business Portal) sits centred on its own row at the same
   width; narrower, one card per row. Cards keep equal heights. */
.mtk .pa-module-grid.pa-three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.mtk #dashboard:has(.pa-three) { container-type: inline-size; }
@container (min-width: 888px) {
  .mtk .pa-module-grid.pa-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mtk .pa-module-grid.pa-three .tile-go { padding-inline: 12px; font-size: 15.5px; white-space: nowrap; }
}
@container (min-width: 584px) and (max-width: 887.98px) {
  .mtk .pa-module-grid.pa-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mtk .pa-module-grid.pa-three > .pa-business { grid-column: 1 / -1; justify-self: center; width: calc((100% - 24px) / 2); }
}
@container (max-width: 583.98px) {
  .mtk .pa-module-grid.pa-three { grid-template-columns: minmax(0, 1fr); }
}
/* Business Portal feature cards (the approved six-card design): the card's own
   glossy illustration on the left, heading, description and a round arrow on
   the right. Two columns on wide screens, one on narrower ones.
   A section that isn't built yet is a .portal-card.is-soon <article>: no link,
   a "Coming Soon" label and a muted arrow that can't be clicked. A built one
   becomes <a class="portal-card"> with the full glossy arrow. */
.mtk .portal-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 0 0 22px; }
.mtk .portal-card {
  display: grid; grid-template-columns: minmax(0, 45%) minmax(0, 1fr); align-items: center; gap: 4px 14px;
  padding: 12px 18px 12px 10px; border-radius: 22px; color: var(--ink-900); text-decoration: none;
  background: linear-gradient(160deg, #f4f8fe 0%, #edf3fd 55%, #e6effc 100%);
  border: 1px solid #c9d7f2;
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(16,45,95,.05), 0 10px 24px rgba(16,45,95,.10);
}
.mtk .portal-card > img { display: block; width: 100%; max-width: 230px; height: auto; justify-self: center; }
.mtk .portal-card-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-self: stretch; justify-content: center; }
.mtk .portal-card h2 { margin: 0; font-size: 21px; line-height: 1.2; color: #12286b; letter-spacing: -.2px; }
.mtk .portal-card p { margin: 0; font-size: 15.5px; line-height: 1.4; color: #3f5378; }
.mtk .portal-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.mtk .portal-arrow {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; margin-left: auto;
  color: #fff; border: 1px solid rgba(0,0,0,.15);
  background:
    linear-gradient(180deg, rgba(255,255,255,.4) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(160deg, #3b74e6 0%, #1f4fa8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 3px 0 rgba(0,0,0,.22), 0 6px 12px rgba(31,79,168,.3);
}
.mtk .portal-arrow svg.icon { width: 20px; height: 20px; }
.mtk a.portal-card { transition: transform var(--speed, .15s), box-shadow var(--speed, .15s); }
.mtk a.portal-card:hover { transform: translateY(-2px); border-color: #9fb8e6; box-shadow: inset 0 1px 0 #fff, 0 3px 6px rgba(16,45,95,.08), 0 14px 30px rgba(16,45,95,.16); }
.mtk a.portal-card:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .mtk a.portal-card:hover { transform: none; } }
/* Not built yet: the arrow is greyed and flat, and nothing reacts to hover or clicks */
.mtk .portal-card.is-soon { cursor: default; }
.mtk .portal-card.is-soon .portal-arrow {
  color: #f3f6fc; background: #b9c6df; border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}
@container (max-width: 760px) {
  .mtk .portal-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .mtk .portal-card { grid-template-columns: minmax(0, 40%) minmax(0, 1fr); padding: 10px 12px 10px 6px; gap: 4px 10px; }
  .mtk .portal-card h2 { font-size: 18.5px; }
  .mtk .portal-card p { font-size: 14.5px; }
  .mtk .portal-arrow { width: 38px; height: 38px; }
}
/* Sidebar: Business Portal sections not built yet (not links) */
.mtk .sidebar-sections .nav-link.nav-soon { cursor: default; color: rgba(255,255,255,.72); }
.mtk .sidebar-sections .nav-link.nav-soon:hover { background: none; transform: none; color: rgba(255,255,255,.72); }
.mtk .sidebar-sections .nav-link.nav-soon .nav-icon { opacity: .7; }
.mtk .nav-soon-tag {
  margin-left: auto; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 800;
  color: #dbe6ff; border: 1px solid rgba(219,230,255,.55); white-space: nowrap;
}
/* The briefcase artwork has no tile of its own: a soft white tile behind it in the sidebar */
.mtk .nav-link .nav-art.nav-art-tile { background: linear-gradient(180deg, #ffffff 0%, #e6edf9 100%); padding: 2px; box-sizing: border-box; }

/* Dashboard: "About FilingForMe" strip under the module cards. Slim and calm: a
   muted rose-red background, thin red border, a glossy red info icon, a bold
   charcoal heading, the purpose sentence in bold dark red and the rest in
   small charcoal text. Friendly, not an error message. */
.mtk .about-strip {
  display: flex; align-items: center; gap: 12px; margin: -6px 0 18px; padding: 6px 16px;
  border-radius: 14px; background: #fbe3e5; border: 1px solid #d9868d;
  box-shadow: 0 1px 2px rgba(120,30,30,.05), 0 6px 14px rgba(120,30,30,.06);
}
.mtk .about-icon {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f26b6b 0%, #d32f2f 45%, #a3151b 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.45), 0 2px 4px rgba(150,20,20,.35);
}
.mtk .about-icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.mtk .about-strip > div { min-width: 0; }
.mtk .about-strip h2 { margin: 0; font-size: 13.5px; line-height: 1.35; font-weight: 800; color: #2b2a2e; }
.mtk .about-strip p { margin: 0; font-size: 12px; line-height: 1.45; color: #34313a; }
.mtk .about-strip .about-lead { font-size: 12.5px; font-weight: 800; color: #a3151b; }
@media (max-width: 700px) {
  .mtk .about-strip { align-items: flex-start; padding: 8px 14px; }
  .mtk .about-icon { margin-top: 2px; }
  .mtk .about-strip p { font-size: 13.5px; line-height: 1.5; }
  .mtk .about-strip .about-lead { font-size: 13.5px; }
  .mtk .about-strip h2 { font-size: 14.5px; }
}

/* Sidebar: FilingForMe brand and the two module groups */
.mtk .app-sidebar .brand-mark.pa-brand { border-radius: 12px; background: #fffaee; padding: 5px; box-sizing: border-box; }
.mtk .sidebar-sections .nav-group { display: grid; gap: 4px; margin-top: 8px; }
/* Module heading: the module link plus a chevron that opens or closes its sections */
.mtk .sidebar-sections .nav-group-head { display: flex; align-items: center; gap: 4px; }
.mtk .sidebar-sections .nav-group-head > .nav-link { flex: 1 1 auto; min-width: 0; font-weight: 800; }
.mtk .app-sidebar button.nav-group-toggle {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; min-height: 0; margin: 0; padding: 0;
  border-radius: 10px; color: #ffffff; background: rgba(120, 200, 150, .18); border: 1px solid rgba(255,255,255,.45);
  box-shadow: none; text-shadow: none; cursor: pointer; transition: background var(--speed), border-color var(--speed);
}
.mtk .app-sidebar button.nav-group-toggle:hover { background: rgba(120, 200, 150, .3); border-color: rgba(255,255,255,.7); }
.mtk .app-sidebar button.nav-group-toggle:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
.mtk .nav-chevron { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--speed); }
.mtk .nav-group.is-open .nav-chevron { transform: rotate(180deg); }
.mtk .sidebar-sections .nav-sub[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .mtk .nav-chevron { transition: none; } }
/* Phones: a bigger target for the chevron (same look) */
@media (pointer: coarse) { .mtk .app-sidebar button.nav-group-toggle { width: 40px; height: 40px; } }
.mtk .nav-link .nav-art { width: 32px; height: 32px; flex: none; border-radius: 9px; display: block; }
.mtk .nav-link .nav-art img { display: block; width: 100%; height: 100%; }
.mtk .sidebar-sections .nav-sub { display: grid; gap: 4px; padding-left: 14px !important; margin-left: 15px !important; border-left: 2px solid rgba(241,227,189,.3); }
.mtk .sidebar-sections .nav-sub .nav-link { font-size: 14.5px; }
@media (max-width: 999px) {
  .mtk .sidebar-sections { grid-template-columns: 1fr !important; }
  .mtk .sidebar-sections .nav-sub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .mtk .sidebar-sections .nav-sub { grid-template-columns: 1fr; }
}

/* "Back to Your Records to Review" (added by /assets/claim-return.js when a page
   is opened from My Tax Claim Assistant): royal blue, the assistant's colour */
.mtk .back-button.to-claim { --page-tone: #1f4fa8; display: inline-flex; margin: 0 0 10px; }
/* While it's shown, the page's own Back / Return buttons stay (same colours and
   jobs) but drop to a compact secondary row under it */
body.from-claim main .top-nav { gap: 8px; margin-bottom: 14px; }
body.from-claim main .top-nav .button,
body.from-claim main > .back-button:not(.to-claim) {
  flex: 0 1 auto; width: auto; min-height: 40px; padding: 6px 12px; font-size: 14px; gap: 6px;
}
body.from-claim main .top-nav .button { margin: 0; }
body.from-claim main > .back-button:not(.to-claim) { margin: 0 0 14px; }
body.from-claim main .top-nav .button svg.icon,
body.from-claim main > .back-button:not(.to-claim) svg.icon { width: 16px; height: 16px; }

/* ---------- 21. Tidy section headings and navigation ----------
   Pages that have one "How to Use" button (.help-bar-end) show it small, at the
   far right of the heading; on narrow screens it wraps under the title.
   <main class="... tidy-nav"> makes the page's Back / Return buttons compact and
   evenly aligned (the gold "Back to Your Records to Review" keeps its size). */
.mtk .page-title .help-bar-end { margin-left: auto; }
.mtk main .help-bar-end .help-btn { min-height: 36px; padding: 5px 12px; font-size: 14px; border-radius: 10px; }
.mtk main .help-bar-end .help-btn svg.icon { width: 16px; height: 16px; }
@media (pointer: coarse) { .mtk main .help-bar-end .help-btn { min-height: 40px; } }

.mtk main.tidy-nav .top-nav { gap: 8px; margin-bottom: 14px; align-items: center; }
.mtk main.tidy-nav .top-nav .button,
.mtk main.tidy-nav > .back-button:not(.to-claim) {
  min-height: 38px; padding: 6px 13px; font-size: 15px; gap: 7px; border-radius: 12px;
}
.mtk main.tidy-nav > .back-button:not(.to-claim) { margin: 0 0 14px; }
/* Buttons in the top row line up exactly (the compact layout's bottom margin
   on Back buttons would push them up out of line) */
.mtk main.tidy-nav .top-nav .button { margin: 0; }
.mtk main.tidy-nav .top-nav .button svg.icon,
.mtk main.tidy-nav > .back-button:not(.to-claim) svg.icon { width: 17px; height: 17px; }
@media (max-width: 480px) {
  .mtk main.tidy-nav .top-nav .button { flex: 0 1 auto; padding: 7px 12px; font-size: 14px; }
  .mtk main.tidy-nav .top-nav .button, .mtk main.tidy-nav > .back-button:not(.to-claim) { min-height: 40px; }
}

/* ---------- 22. My Tax Assistant card colours ----------
   Financial Year Summary in emerald teal and My Tax Claim Assistant in royal
   blue (Work-Related Use keeps its magenta): the My Tax Assistant cards, those
   two pages and their sidebar entries. */
.mtk .tone-teal  { --tone: #0f766e; --tone-soft: #dff3ef; }
.mtk .tone-royal { --tone: #1f4fa8; --tone-soft: #e3ecfb; }
/* The same colours as the page tone on those two pages (buttons, headings, panels) */
.mtk main.tone-teal  { --page-tone: #0f766e; }
.mtk main.tone-royal { --page-tone: #1f4fa8; }
.mtk .module-tiles .tile.tone-teal,
.mtk .module-tiles .tile.tone-royal {
  background: linear-gradient(180deg, var(--tone-soft) 0%, color-mix(in srgb, var(--tone-soft) 35%, #fff) 70%, #fff 100%);
}

/* ---------- 23. Field information tips ----------
   <div class="label-row"><label>…</label><button class="field-tip" aria-controls="tipX">ⓘ</button></div>
   <p id="tipX" class="field-tip-text" hidden>…</p>   Behaviour: /assets/field-tips.js */
.mtk .label-row { display: flex; align-items: center; gap: 6px; margin-top: 0; }
.mtk .label-row label { margin-bottom: 6px; }
.mtk main button.field-tip {
  flex: none; width: 30px; height: 30px; min-height: 30px; min-width: 30px; padding: 0; margin: 0 0 6px;
  border-radius: 50%; display: inline-grid; place-items: center; color: #fff;
}
.mtk main button.field-tip svg.icon { width: 17px; height: 17px; }
.mtk main button.field-tip[hidden] { display: none; }
.mtk main button.field-tip:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
@media (pointer: coarse) { .mtk main button.field-tip { width: 36px; height: 36px; min-height: 36px; } }
.mtk .field-tip-text {
  margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; font-size: 14.5px; line-height: 1.45;
  background: color-mix(in srgb, var(--page-tone, var(--brand-blue)) 8%, #fff);
  border: 1px solid color-mix(in srgb, var(--page-tone, var(--brand-blue)) 25%, #fff);
  color: var(--ink-900);
}
.mtk .field-tip-text[hidden] { display: none; }

/* ---------- 24. Show All / Hide All ----------
   Added under the page heading by /assets/collapsible.js when two or more
   collapsible sections are on show. Small glossy buttons in the page colour. */
.mtk .section-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin: -4px 0 12px; }
.mtk .section-bar[hidden] { display: none; }
.mtk main .section-bar .section-all { min-height: 34px; padding: 4px 12px; margin: 0; font-size: 14px; border-radius: 10px; gap: 5px; }
.mtk main .section-bar .section-all:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
@media (pointer: coarse) { .mtk main .section-bar .section-all { min-height: 40px; } }

/* ---------- 25. Income Statements gold ----------
   The golden palette of the My Tax Assistant dashboard icon:
   highlight #F9BF3C, warm amber #E2970C, deep metallic gold #D38402,
   dark bronze shadow #915102, cream-gold background #FFF6E4.
   Buttons use a glossy gold gradient with dark bronze text for contrast. */
.mtk .tone-gold { --tone: #D38402; --tone-soft: #FFF6E4; }
.mtk main.tone-gold { --page-tone: #D38402; }
.mtk main.tone-gold button:not(.secondary):not(.danger):not(.delete-button):not(.success):not(.cancel-button):not(.info-tip),
.mtk main.tone-gold .button:not(.secondary):not(.danger):not(.success):not(.back-button),
.mtk .module-tiles .tile.tone-gold .tile-go {
  color: #3b2300; text-shadow: 0 1px 0 rgba(255,255,255,.45);
  border-color: #915102;
  background:
    linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.14) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #F9BF3C 0%, #E2970C 55%, #D38402 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(145,81,2,.35),
    0 4px 0 #915102, 0 9px 18px rgba(145,81,2,.28);
}
.mtk main.tone-gold button:not(.secondary):not(.danger):not(.delete-button):not(.success):not(.cancel-button):not(.info-tip):hover:not(:disabled),
.mtk main.tone-gold .button:not(.secondary):not(.danger):not(.success):not(.back-button):hover,
.mtk .module-tiles .tile.tone-gold:hover .tile-go {
  color: #3b2300; filter: brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(145,81,2,.35),
    0 5px 0 #915102, 0 12px 22px rgba(145,81,2,.32);
}
.mtk .module-tiles .tile.tone-gold { border-color: #f0d49a; border-top-color: #D38402; }
.mtk main.tone-gold .form-title-icon {
  color: #3b2300;
  background: linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(160deg, #F9BF3C 0%, #E2970C 55%, #D38402 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 0 #915102, 0 6px 12px rgba(145,81,2,.25);
}
.mtk main.tone-gold .form-title h2 { color: #915102; }
.mtk main.tone-gold .help-panel h2 svg.icon { color: #D38402; }

/* ---------- 26. General tax guidance notice ----------
   Soft-red warning for "Important: General tax guidance only". Use it on
   every tax estimate or tax bracket feature, whatever the page's tone, so
   it is clear FilingForMe gives general guidance and does not prepare or lodge
   tax returns. Always visible: never collapsible or dismissible.
   The TESTING MODE notice keeps its own yellow style. */
.mtk .guidance-note {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 14px;
  background: #FFF0F0; border: 1px solid #D94A4A; border-left: 6px solid #D94A4A;
  color: #70212A;
}
.mtk .guidance-note h2 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; color: #A61B29; }
.mtk .guidance-note h2 svg.icon { width: 20px; height: 20px; flex: none; color: #B4232C; }
.mtk .guidance-note p { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: #70212A; }

/* ---------- 27. Australian Tax Brackets lavender ----------
   Lavender purple for the Australian Tax Brackets card, page and sidebar entry:
   tone #7452c8 (white text passes AA), deep #4b3592, soft #f2edfc.
   Glossy buttons come from the shared main[class*="tone-"] button rule. */
.mtk .tone-lavender { --tone: #7452c8; --tone-soft: #f2edfc; }
.mtk main.tone-lavender { --page-tone: #7452c8; }
.mtk .module-tiles .tile.tone-lavender {
  background: linear-gradient(180deg, var(--tone-soft) 0%, color-mix(in srgb, var(--tone-soft) 35%, #fff) 70%, #fff 100%);
}
.mtk main.tone-lavender .form-title h2 { color: #4b3592; }

/* ---------- 28. Annual expense report ----------
   Built by /assets/expense-report.js on Expenses (Annual Expense Summary) and on
   Income & Financial Year Summary (Reports & Exports). Buttons and chips follow the
   page colour; the Total recorded expenditure box is always soft blush pink. */
.mtk .expense-report .export-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 6px; }
.mtk main .expense-report .export-row button { margin: 0; }
.mtk .expense-report .report-block + .report-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid color-mix(in srgb, var(--page-tone, var(--brand-blue)) 16%, #ece6d6); }
.mtk .expense-report .report-block h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 18px; color: var(--brand-emerald-dark); }
.mtk .expense-report .record-count {
  display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 999px;
  font-size: 15px; font-weight: 800; letter-spacing: 0; color: var(--ink-950);
  background: color-mix(in srgb, var(--page-tone, var(--brand-blue)) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--page-tone, var(--brand-blue)) 35%, #fff);
}
.mtk .expense-report .details-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.mtk .expense-report .details-head h3 { margin: 0; }
.mtk main .expense-report .details-toggle { margin: 0; min-width: 220px; }
.mtk main .expense-report .details-toggle:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
.mtk .expense-report .details-panel { margin-top: 14px; }
.mtk .expense-report .details-panel > .muted { margin-top: 0; }
.mtk .expense-report .report-total {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px;
  margin-top: 12px; padding: 10px 14px; background: #FCE8EF; border: 1px solid #E8A0B8; white-space: normal;
}
.mtk .expense-report .report-total:empty { display: none; }
.mtk .expense-report .report-total .total-label { color: #77354D; font-weight: 700; font-size: 15px; }
.mtk .expense-report .report-total .total-amount { color: #A52D5A; font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; }
.mtk .expense-report .report-total .total-count { flex-basis: 100%; color: #77354D; font-size: 14px; font-weight: 600; }
/* An expense linked to My Business Portal: shown, but left out of personal totals (Stage 3b) */
.mtk .business-label { display: inline-block; margin: 2px 0 0; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.5; color: #1f4fa8; background: #e3ecfb; border: 1px solid #c9d7f2; white-space: normal; }
.mtk .business-note { margin: 6px 0 0; font-size: 13.5px; font-weight: 600; color: #1f4fa8; }
.mtk .business-note:empty { display: none; }
@media (max-width: 650px) { .mtk main .expense-report .details-toggle { width: 100%; min-width: 0; } }

/* ---------- 29. Record-keeping reminder ----------
   Soft-red "Important: Keep your receipts for tax records" banner, the same on
   every page that has it (filled in by /assets/records-note.js). Compact:
   icon, heading and text side by side; Learn more opens the extra guidance.
   The TESTING MODE notice keeps its own yellow style. */
.mtk .records-note {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 10px 12px;
  margin: 0 0 22px; padding: 14px 18px; border-radius: var(--radius);
  background: #FDE9E9; border: 1.5px solid #D94B4B;
}
.mtk .records-note > svg.icon { flex: none; width: 24px; height: 24px; margin-top: 1px; color: #A61B1B; }
.mtk .records-note-body { min-width: 0; }
.mtk .records-note h2 { margin: 0 0 4px; font-size: 17px; line-height: 1.3; font-weight: 800; color: #A61B1B; }
.mtk .records-note p { margin: 0; font-size: 15px; line-height: 1.5; color: #A61B1B; }
.mtk .records-note p + p, .mtk .records-note p + div p { margin-top: 8px; }
.mtk .records-note [hidden] { display: none; }
.mtk .records-note a { color: #A61B1B; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.mtk .records-note a:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; border-radius: 3px; }
/* Learn more: white / pale-pink glossy 3D button with red accents */
.mtk main button.records-note-more {
  flex: none; align-self: center; margin: 0; min-height: 40px; padding: 5px 14px; gap: 6px;
  font-size: 15px; color: #A61B1B; text-shadow: none; border: 1px solid #E3A3A3;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.4) 50%, rgba(255,255,255,0) 51%),
    linear-gradient(180deg, #fff 0%, #fff6f6 50%, #fde4e4 51%, #fbd6d6 100%);
  box-shadow: inset 0 1px 0 #fff, 0 3px 0 #E0A6A6, 0 7px 14px rgba(166,27,27,.14);
}
.mtk main button.records-note-more:hover:not(:disabled) { color: #8a1515; box-shadow: inset 0 1px 0 #fff, 0 4px 0 #E0A6A6, 0 10px 18px rgba(166,27,27,.18); }
.mtk main button.records-note-more:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(166,27,27,.2), 0 1px 0 #E0A6A6; }
.mtk main button.records-note-more:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
.mtk .records-note-more .chevron { display: inline-block; transition: transform var(--speed); }
.mtk .records-note-more[aria-expanded="true"] .chevron { transform: rotate(180deg); }
/* Compact tax preparation notice (prep-disclaimer.js): one slim row until opened */
.mtk .records-note.is-compact { grid-template-columns: auto minmax(0, 1fr); align-items: center; padding: 8px 14px; }
.mtk .records-note.is-compact:has(.prep-summary:not([hidden])) { align-items: start; padding: 12px 16px; }
.mtk .records-note.is-compact > svg.icon { width: 26px; height: 26px; color: #C0392B; }
.mtk .records-note.is-compact h2 { margin: 0; }
.mtk .records-note.is-compact .prep-toggle { min-height: 36px; padding: 4px 14px; font-size: 15px; font-weight: 800; }
.mtk .records-note.is-compact .prep-summary { margin-top: 10px; }
.mtk .records-note.is-compact .prep-summary p { color: #3d2a2c; font-size: 14.5px; }
.mtk .records-note.is-compact .prep-summary strong { color: #A61B1B; }
.mtk .records-note a.prep-learn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 2px 0;
  font-size: 14px; font-weight: 800; color: #A61B1B; text-decoration: underline; text-underline-offset: 3px;
}
.mtk .records-note a.prep-learn:hover { color: #8a1515; }
.mtk .prep-learn .chevron { display: inline-block; transition: transform var(--speed); }
.mtk .prep-learn[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.mtk .records-note .prep-more { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #E3A3A3; }
.mtk .records-note .prep-more p { font-size: 14px; color: #4a2f31; }
@media (max-width: 560px) {
  .mtk .records-note { padding: 12px 14px; }
  .mtk .records-note.is-compact .prep-toggle { width: auto; padding: 4px 11px; font-size: 14px; white-space: nowrap; }
  .mtk main button.records-note-more { grid-column: 1 / -1; width: 100%; }
}

/* ---------- 30. Record-table action buttons ----------
   Edit, Delete, View Receipt, View Expense and similar buttons inside table rows:
   the same glossy 3D buttons and colours, just slimmer. Touch screens keep a
   40px target. Save buttons and dashboard/navigation buttons are not affected. */
.mtk main td.actions button, .mtk main td.actions .button,
.mtk main td.actions-cell button, .mtk main td.actions-cell .button,
.mtk main td button.view-receipt-button {
  min-height: 36px; padding: 6px 12px; font-size: 14px; line-height: 1.2; gap: 6px; border-radius: 10px;
}
.mtk main td.actions button svg.icon, .mtk main td.actions .button svg.icon,
.mtk main td.actions-cell button svg.icon, .mtk main td.actions-cell .button svg.icon { width: 16px; height: 16px; }
.mtk main td.actions button.delete-button::before, .mtk main td.actions-cell button.delete-button::before { width: 14px; height: 14px; }
@media (pointer: coarse) {
  .mtk main td.actions button, .mtk main td.actions .button,
  .mtk main td.actions-cell button, .mtk main td.actions-cell .button,
  .mtk main td button.view-receipt-button { min-height: 40px; }
}
/* If a record table has to scroll sideways, its action buttons stay in view on the right */
.mtk main .table-wrap td.actions-cell, .mtk main .table-wrap td.actions { position: sticky; right: 0; z-index: 1; background: #fff; }
.mtk main .table-wrap tbody tr:nth-child(even) td.actions-cell, .mtk main .table-wrap tbody tr:nth-child(even) td.actions { background: #fcfaf5; }
.mtk main .table-wrap tbody tr:hover td.actions-cell, .mtk main .table-wrap tbody tr:hover td.actions { background: #eef7f1; }
.mtk main .table-wrap table:has(td.actions-cell, td.actions) th:last-child { position: sticky; right: 0; z-index: 2; }
.mtk .scroll-frame.more-right td.actions-cell, .mtk .scroll-frame.more-right td.actions,
.mtk .scroll-frame.more-right table:has(td.actions-cell, td.actions) th:last-child { box-shadow: -8px 0 10px -8px rgba(40,30,10,.35); }
/* Phone cards (.table-stack) don't scroll, so nothing is pinned there */
@media (max-width: 760px) {
  .mtk main .table-wrap .table-stack tbody tr:nth-child(n) td.actions-cell { position: static; background: transparent; box-shadow: none; }
}

/* ---------- 31. Receipt storage status ----------
   Small labelled badges from /assets/receipt-status.js (icon + words, so not colour alone):
   green cloud = a receipt file is stored in FilingForMe; gold folder = filename only,
   kept by the person; soft red alert = no receipt recorded (information only). */
.mtk .receipt-status {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; padding: 1px 9px 1px 6px;
  border: 1px solid; border-radius: 999px; font-size: 12.5px; font-weight: 800; line-height: 1.5; white-space: nowrap;
}
.mtk .receipt-status svg.icon { width: 15px; height: 15px; flex: none; }
.mtk .receipt-status.is-stored { background: #e3f4ea; border-color: #9fd3b6; color: #14532d; }
.mtk .receipt-status.is-stored svg.icon { color: #138a55; }
.mtk .receipt-status.is-own { background: #fff6e2; border-color: #ecc86e; color: #5c3f00; }
.mtk .receipt-status.is-own svg.icon { color: #b07d12; }
.mtk .receipt-status.is-none { background: #FDE8E8; border-color: #D94B4B; color: #A61B1B; }
.mtk .receipt-status.is-none svg.icon { color: #A61B1B; }
/* In table cells: own line, and wraps rather than spilling into the next column */
.mtk td .receipt-status { display: flex; width: fit-content; max-width: 100%; align-items: flex-start; white-space: normal; border-radius: 10px; font-size: 12px; }
.mtk td .receipt-status svg.icon { margin-top: 1px; }

/* ---------- 32. Information icons (/assets/info-tip.js) ----------
   A small round "i" beside a label; its short explanation shows on hover or
   click (desktop) and on tap (mobile). */
.mtk button.info-tip, .mtk main button.info-tip {
  display: inline-grid; place-items: center; vertical-align: middle;
  width: 22px; height: 22px; min-height: 0; margin: 0 0 0 6px; padding: 0;
  border-radius: 50%; border: 1.5px solid #9db6e6; background: #fff; color: #1f4fa8;
  box-shadow: none; text-shadow: none; transform: none; cursor: pointer; flex: none;
}
.mtk button.info-tip svg.icon { width: 15px; height: 15px; }
.mtk button.info-tip:hover, .mtk button.info-tip[aria-expanded="true"] { background: #1f4fa8; border-color: #1f4fa8; color: #fff; }
.mtk button.info-tip:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
.info-tip-bubble {
  position: absolute; z-index: 1000; padding: 10px 12px; border-radius: 10px;
  background: #12286b; color: #fff; font-size: 14px; line-height: 1.45; font-weight: 500;
  box-shadow: 0 8px 24px rgba(18, 40, 107, .28);
}
.info-tip-bubble[hidden] { display: none; }
@media print { .mtk button.info-tip, .info-tip-bubble { display: none !important; } }

/* ---------- 33. Account notices (account recovery in progress / cooling-off) ----------
   Added by auth-client.js showAccountNotices() at the top of a signed-in page. */
.mtk .mtk-account-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 16px; padding: 12px 16px; border-radius: 14px; font-size: 15px; line-height: 1.5; }
.mtk .mtk-account-notice p { margin: 0; flex: 1 1 320px; }
.mtk .mtk-account-notice.is-warning { background: #fff0f0; border: 1px solid #f0b9b9; border-left: 5px solid #b4232c; color: #5c1a14; }
.mtk .mtk-account-notice.is-info { background: #eef3fd; border: 1px solid #c9d7f2; border-left: 5px solid #1f4fa8; color: #12286b; }
.mtk .mtk-account-notice button { margin: 0; min-height: 40px; }
.mtk [aria-disabled="true"][title^="Paused"] { opacity: .55; cursor: not-allowed; }
@media print { .mtk .mtk-account-notice { display: none !important; } }

/* 34. Accordion sections (Settings, Export & Backup): cream rows with an icon, title, short
   status and arrow; one open at a time. The row buttons are plain (not the
   glossy action buttons), hence !important against mtk.css. */
.acc-list { display: grid; gap: 12px; margin-bottom: 18px; }
.acc {
  border-radius: 18px; border: 1px solid #e2d6b6; overflow: hidden;
  background: linear-gradient(180deg, #fffdf7 0%, #fbf6e9 100%);
  box-shadow: inset 0 1px 0 #fff, 0 2px 0 #e6dcc2, 0 8px 18px rgba(11,63,47,.08);
  transition: box-shadow var(--speed), border-color var(--speed);
}
.acc.is-open { border-color: #c9a85a; box-shadow: inset 0 1px 0 #fff, 0 3px 0 #d9c58f, 0 12px 26px rgba(11,63,47,.14); }
.acc-heading { margin: 0; font-size: inherit; }
.mtk main button.acc-row {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; margin: 0;
  padding: 14px 18px; border: 0 !important; border-radius: 0; text-align: left;
  background: transparent !important; box-shadow: none !important; text-shadow: none;
  color: var(--ink-950); font: inherit; filter: none; transform: none; cursor: pointer;
}
.mtk main button.acc-row:hover:not(:disabled) { background: rgba(255,255,255,.7) !important; transform: none; }
.mtk main button.acc-row:active:not(:disabled) { transform: none; }
.mtk main button.acc-row:focus-visible { outline: 3px solid #ffc94a; outline-offset: -3px; }
.acc-row .icon-badge { flex: none; width: 44px; height: 44px; border-radius: 13px; --tone: var(--tone-dashboard); }
.acc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.acc-title { font-size: 18.5px; font-weight: 800; color: var(--brand-emerald-dark, #0b3f2f); }
.acc-status { font-size: 14px; font-weight: 600; color: var(--ink-700); overflow-wrap: anywhere; }
.acc-arrow {
  flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 50%; color: #6b4a00;
  background: linear-gradient(180deg, #fbe7ae 0%, #e3b341 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 0 #b5841f;
  transition: transform var(--speed);
}
.acc.is-open .acc-arrow { transform: rotate(180deg); }
.acc-body { padding: 4px 20px 20px; border-top: 1px solid #eadfc3; background: #fff; }
.acc-lead { margin: 14px 0 12px; color: var(--ink-800); font-size: 15px; }
/* Editing forms stand out in a soft green panel */
.acc-form { margin: 0 0 4px; padding: 14px 16px; border-radius: 14px; background: #f6fbf8; border: 1px solid #cfe6d9; }
.acc-body .button { margin: 4px 0 0; }
@media (max-width: 560px) {
  .mtk main button.acc-row { gap: 11px; min-height: 66px; padding: 12px 12px; }
  .acc-row .icon-badge { width: 38px; height: 38px; border-radius: 11px; }
  .acc-title { font-size: 17px; }
  .acc-status { font-size: 13.5px; }
  .acc-arrow { width: 30px; height: 30px; }
  .acc-body { padding: 2px 12px 16px; }
  .acc-form { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .acc-arrow { transition: none; } }

/* ---------- 35. Recurring payments and reminders (docs/reminders.md) ----------
   .recurring-notice: shown above an expense form opened from a dashboard reminder.
   .ir-*: the unticked "Remind me to check or enter this expense" option (invoice-reminder.js). */
.recurring-notice {
  display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 14px 16px;
  border-radius: 14px; background: #fff8e3; border: 1px solid #ecd28a; color: var(--ink-900, #1d2b25);
}
.recurring-notice[hidden] { display: none; }
.recurring-notice > .icon { flex: none; width: 26px; height: 26px; margin-top: 2px; color: #a8740b; }
.recurring-notice p { margin: 0; flex: 1; min-width: 0; font-size: 15px; line-height: 1.5; }
.recurring-notice strong { display: block; color: #6b4a00; }
.recurring-notice button { flex: none; align-self: center; }
@media (max-width: 560px) {
  .recurring-notice { flex-wrap: wrap; }
  .recurring-notice button { width: 100%; }
}
.ir-option { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #f6fbf8; border: 1px solid #cfe6d9; }
.ir-check { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 700; cursor: pointer; }
.ir-check input { width: 20px; height: 20px; flex: none; margin: 0; }
.ir-days { margin: 10px 0 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ir-days[hidden] { display: none; }
.ir-days legend { width: 100%; padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--ink-700); }
.ir-days label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }

/* Dashboard bell: a large glossy gold button in the welcome panel's right column,
   with a coral count badge. Steady (no flashing or pulsing). */
.mtk .pa-welcome { position: relative; }
.mtk main button.rb-bell {
  grid-column: 3; justify-self: center; flex-direction: column; gap: 4px; margin: 0;
  min-height: 0; padding: 0; border: 0; border-radius: 16px; background: none; box-shadow: none;
  color: #6b4a00; text-shadow: none; filter: none; transform: none;
}
.mtk main button.rb-bell[hidden] { display: none; }
.mtk main button.rb-bell:hover:not(:disabled), .mtk main button.rb-bell:active:not(:disabled) {
  background: none; box-shadow: none; color: #6b4a00; filter: none; transform: none;
}
.rb-bell-face {
  display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #ffe08a 0%, #f2bf3a 50%, #e0a51f 51%, #c98b0e 100%);
  border: 1px solid #b5841f;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(120,80,0,.25), 0 4px 0 #9a6d10, 0 9px 18px rgba(154,109,16,.3);
  transition: transform var(--speed), box-shadow var(--speed);
}
.mtk main button.rb-bell .rb-bell-face svg.icon { width: 32px; height: 32px; color: #5a3d00; stroke-width: 2.2; }
.mtk main button.rb-bell:hover .rb-bell-face { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(120,80,0,.25), 0 5px 0 #9a6d10, 0 12px 22px rgba(154,109,16,.34); }
.mtk main button.rb-bell:active .rb-bell-face { transform: translateY(3px); box-shadow: inset 0 2px 5px rgba(90,60,0,.35), 0 1px 0 #9a6d10; }
.mtk main button.rb-bell:focus-visible { outline: 3px solid #1a9a6c; outline-offset: 4px; }
.mtk main button.rb-bell[aria-expanded="true"] .rb-bell-face { box-shadow: inset 0 2px 5px rgba(90,60,0,.35), 0 1px 0 #9a6d10, 0 0 0 4px rgba(242,191,58,.35); }
.rb-bell-label { font-size: 13.5px; font-weight: 800; color: #6b4a00; }
.rb-badge {
  position: absolute; top: -6px; right: -8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  display: grid; place-items: center; font-size: 14px; font-weight: 800; line-height: 1; color: #fff;
  background: linear-gradient(180deg, #ff8a72 0%, #e5533b 100%); border: 2px solid #fff;
  box-shadow: 0 2px 5px rgba(150,40,20,.35);
}
.rb-badge[hidden] { display: none; }

/* The reminder list, just below the welcome panel */
.mtk .rb-panel { margin: -6px 0 24px; border: 1px solid #ecd28a; background: linear-gradient(180deg, #fffaf0 0%, #fff 60%); }
.mtk .rb-panel[hidden] { display: none; }
.rb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rb-head h2 { margin: 0; font-size: 22px; }
.rb-head h2:focus { outline: none; }
.rb-panel .status:empty { display: none; }
.rb-empty { margin: 12px 0 4px; font-size: 16px; color: var(--ink-800); }
.rb-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.rb-item {
  display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 4px 12px; align-items: start;
  padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid #eadfc3;
}
.rb-icon { grid-row: 1 / span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff3cf; color: #8a5f00; }
.rb-icon .icon { width: 22px; height: 22px; }
.rb-check .rb-icon { background: #e3f3ea; color: #13795a; }
/* A billing period to record or to add its invoice: soft-red alert card */
.rb-period { background: #fff6f6; border-color: #f0c4c4; box-shadow: inset 4px 0 0 #d9534f; }
.rb-period .rb-icon { background: #fde3e3; color: #b42318; }
.rb-text .rb-due { font-size: 15px; font-weight: 800; color: #b42318; }
.rb-text .rb-ask { color: #7a1d16; }
.rb-text .rb-portal { font-size: 13px; color: var(--ink-700); }
.rb-undo { margin: 0 0 0 6px; }
/* Upload Invoice: glossy gold, matching the bell */
.mtk main .button.rb-gold {
  color: #4a3200; text-shadow: 0 1px 0 rgba(255,255,255,.5); border-color: #b5841f;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #ffe08a 0%, #f2bf3a 50%, #e0a51f 51%, #c98b0e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(120,80,0,.25), 0 4px 0 #9a6d10, 0 9px 18px rgba(154,109,16,.25);
}
.mtk main .button.rb-gold:hover { color: #4a3200; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(120,80,0,.25), 0 5px 0 #9a6d10, 0 12px 22px rgba(154,109,16,.3); }
.mtk main .button.rb-gold:active { box-shadow: inset 0 2px 5px rgba(90,60,0,.35), 0 1px 0 #9a6d10; }
.rb-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rb-text strong { font-size: 16.5px; overflow-wrap: anywhere; }
.rb-text span { font-size: 14.5px; color: var(--ink-700); overflow-wrap: anywhere; }
.rb-actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.rb-actions .button, .rb-actions button { margin: 0; }
.rb-foot { margin: 14px 0 0; font-size: 13.5px; color: var(--ink-700); }
.rb-foot a { font-weight: 700; }
@media (max-width: 480px) {
  /* Top-right corner of the welcome panel (grid-column auto, so it is placed against the panel, not a grid cell) */
  .mtk main button.rb-bell { position: absolute; top: 10px; right: 10px; grid-column: auto; grid-row: auto; width: auto; }
  .rb-bell-face { width: 48px; height: 48px; }
  .mtk main button.rb-bell .rb-bell-face svg.icon { width: 26px; height: 26px; }
  .rb-bell-label { display: none; }
  .rb-badge { top: -6px; right: -6px; min-width: 24px; height: 24px; font-size: 13px; }
  .rb-item { grid-template-columns: 34px minmax(0, 1fr); padding: 10px; gap: 4px 10px; }
  .rb-icon { width: 34px; height: 34px; }
  .rb-actions { grid-column: 1 / -1; }
  .rb-actions .button, .rb-actions button { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) { .rb-bell-face { transition: none; } }
.rb-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 14px 0 0; font-size: 14.5px; font-weight: 700; }

/* Recurring Payments & Subscriptions (subscriptions.js), on Expenses and Business Expenses */
.sub-title-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: #fff3cf; color: #8a5f00; flex: none; }
.sub-title-icon .icon { width: 24px; height: 24px; }
.sub-intro { margin: 4px 0 12px; color: var(--ink-800); font-size: 15px; }
.sub-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0 0 12px; }
.sub-toolbar button { margin: 0; }
.sub-toolbar button[hidden] { display: none; }
.sub-archived { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; cursor: pointer; }
.sub-archived input { width: 18px; height: 18px; margin: 0; }
.sub-form { margin: 0 0 16px; padding: 16px; border-radius: 16px; background: #f6fbf8; border: 1px solid #cfe6d9; }
.sub-form[hidden] { display: none; }
.sub-form.is-editing {
  background: #fff1f4; border-color: #c02d68;
  box-shadow: 0 0 0 2px #c02d68, 0 0 0 6px rgba(192, 45, 104, .14), 0 10px 26px rgba(192, 45, 104, .2);
}
@keyframes sub-edit-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #c02d68, 0 0 0 6px rgba(192, 45, 104, .14), 0 10px 26px rgba(192, 45, 104, .2); }
  50% { box-shadow: 0 0 0 2px #c02d68, 0 0 0 12px rgba(192, 45, 104, .3), 0 12px 32px rgba(192, 45, 104, .32); }
}
.sub-form.is-editing.edit-pulse { animation: sub-edit-pulse .7s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { .sub-form.is-editing.edit-pulse { animation: none; } }
.sub-form-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sub-form-head h3 { margin: 0; font-size: 19px; }
.sub-editing-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px 4px 9px; border-radius: 999px; background: #c02d68; color: #fff; font-size: 14px; font-weight: 800; }
.sub-editing-pill[hidden] { display: none; }
.sub-editing-pill .icon { width: 15px; height: 15px; }
.sub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.sub-grid > div > label { margin-top: 8px; }
.sub-full { grid-column: 1 / -1; }
.sub-hint { margin: 6px 0 0; font-size: 14px; color: #8a5f00; }
.sub-hint[hidden] { display: none; }
.mtk label.sub-check { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 600; cursor: pointer; }
.sub-check input { width: 20px; height: 20px; flex: none; margin: 0; }
.sub-more { margin-top: 12px; }
.sub-more > summary { cursor: pointer; font-weight: 700; color: var(--brand-emerald-dark, #0b3f2f); }
.sub-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.sub-form-actions button { margin: 0; }
.sub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sub-item { padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid #e3e8e2; }
.sub-item.is-archived, .sub-item.is-cancelled { background: #f7f6f3; }
.sub-item.is-edited { border-color: #c02d68; background: #fff7f9; }
.sub-empty { padding: 12px 14px; border-radius: 14px; background: #fafaf7; color: var(--ink-700); }
.sub-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sub-main strong { font-size: 17px; overflow-wrap: anywhere; }
.sub-meta { flex-basis: 100%; font-size: 14.5px; color: var(--ink-700); overflow-wrap: anywhere; }
.sub-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #e3f3ea; color: #0b5a3f; }
.sub-pill.sub-paused { background: #fff3cf; color: #7a5300; }
.sub-pill.sub-cancelled, .sub-pill.sub-archived, .sub-pill.sub-quiet { background: #ecebe6; color: #4a4a44; }
.sub-pill.sub-due { background: #fde4dc; color: #9b2c16; }
.sub-due { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: #fde4dc; color: #9b2c16; }
.sub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sub-actions button { margin: 0; }
.sub-actions button .icon { width: 16px; height: 16px; }
.sub-history { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: #fafaf7; border: 1px dashed #d9d4c4; font-size: 14.5px; }
.sub-history[hidden] { display: none; }
.sub-history ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sub-history li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.sub-history li > span:first-child { font-weight: 700; min-width: 120px; }
.sub-history li a { font-weight: 700; }
.sub-history li button { margin: 0; }
@media (pointer: coarse) { .sub-actions button.btn-sm, .rb-actions .btn-sm { min-height: 40px; } }
@media (max-width: 560px) {
  .sub-grid { grid-template-columns: minmax(0, 1fr); }
  .sub-form { padding: 12px; }
  .sub-actions button { flex: 1 1 auto; }
}

/* Notification Preferences (Settings): glossy on/off switches */
.np-list { display: grid; gap: 4px; }
.mtk label.np-switch { position: relative; display: flex; align-items: center; gap: 14px; margin: 0; padding: 10px 4px; cursor: pointer; font-weight: 400; }
.np-switch + .np-switch { border-top: 1px solid #dcebe2; }
.np-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.np-track {
  flex: none; position: relative; width: 52px; height: 30px; border-radius: 15px;
  background: linear-gradient(180deg, #cfd6d2 0%, #b7c0bb 100%); box-shadow: inset 0 2px 4px rgba(0,0,0,.18);
  transition: background var(--speed);
}
.np-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #eef1ef 100%); box-shadow: 0 2px 4px rgba(0,0,0,.25);
  transition: transform var(--speed);
}
.np-switch input:checked + .np-track { background: linear-gradient(180deg, #3fbf8f 0%, #13845b 100%); }
.np-switch input:checked + .np-track::after { transform: translateX(22px); }
.np-switch input:focus-visible + .np-track { outline: 3px solid #ffc94a; outline-offset: 2px; }
.np-switch input:disabled + .np-track { opacity: .5; }
.np-switch:has(input:disabled) { cursor: not-allowed; color: var(--ink-700); }
.np-switch strong { display: block; font-size: 16px; }
.np-switch small { display: block; font-size: 14px; color: var(--ink-700); }
.np-main strong { font-size: 17px; }
@media (prefers-reduced-motion: reduce) { .np-track, .np-track::after { transition: none; } }

/* Compact recurring-payment panel above an expense form opened from a reminder
   (recurring-context.js): name, billing month and expected amount on one row,
   a blue information icon, and Back to Reminders (only when opened from there) */
.rp-panel {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 14px; padding: 8px 10px 8px 12px;
  border-radius: 14px; background: #fffaf0; border: 1px solid #ecd28a;
}
.rp-panel[hidden] { display: none; }
.rp-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff3cf; color: #8a5f00; }
.rp-icon .icon { width: 20px; height: 20px; }
.rp-text { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.rp-text strong { font-size: 15.5px; overflow-wrap: anywhere; }
.rp-text span { font-size: 14.5px; color: var(--ink-700); }
.mtk main button.info-tip.rp-tip { margin: 0; }
/* Back to Reminders: cream glossy, with the dark-gold bell */
.mtk main button.rp-back { margin: 0 0 0 auto; gap: 6px; white-space: nowrap; }
.mtk main button.rp-back[hidden] { display: none; }
/* Warm antique gold with dark navy-green text, so it stands out from the cream panel */
.mtk main button.rp-back {
  color: #173B32; text-shadow: 0 1px 0 rgba(255,255,255,.35); border: 1px solid #9c7a35;
  background:
    linear-gradient(180deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.1) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #d9b873 0%, #C9A45B 50%, #bb944a 51%, #a9843d 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -2px 0 rgba(80,55,10,.22), 0 3px 0 #8a6a2c, 0 7px 14px rgba(120,90,30,.25);
}
.mtk main button.rp-back:hover:not(:disabled) {
  color: #173B32; filter: brightness(1.05);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), inset 0 -2px 0 rgba(80,55,10,.22), 0 4px 0 #8a6a2c, 0 10px 18px rgba(120,90,30,.3);
}
.mtk main button.rp-back:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(60,40,5,.35), 0 1px 0 #8a6a2c; }
.mtk main button.rp-back svg.icon { width: 18px; height: 18px; color: #173B32; stroke-width: 2.3; }
@media (max-width: 560px) {
  .rp-panel { padding: 8px 10px; }
  .mtk main button.rp-back { flex: 1 1 100%; margin: 2px 0 0; min-height: 40px; }
}
/* Upload Invoice: the receipt section glows gold twice */
@keyframes rp-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 191, 58, 0); }
  50% { box-shadow: 0 0 0 6px rgba(242, 191, 58, .55); }
}
.rp-highlight { border-radius: 14px; outline: 2px solid #e0a51f; outline-offset: 2px; animation: rp-glow .8s ease-in-out 2; }
@media (prefers-reduced-motion: reduce) { .rp-highlight { animation: none; } }

/* Saved without an invoice (recurring-context.js showInvoicePrompt): one compact row */
.rp-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 14px; padding: 8px 10px 8px 14px;
  border-radius: 14px; background: #f1f9f4; border: 1px solid #b9dcc8; }
.rp-prompt[hidden] { display: none; }
.rp-prompt-text { flex: 1 1 220px; font-size: 15px; font-weight: 700; color: #0b4a33; }
.rp-check { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 4px; border-radius: 50%;
  background: #13845b; color: #fff; font-size: 13px; vertical-align: middle; }
.rp-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-prompt-actions button { margin: 0; }
.rp-prompt-error { flex-basis: 100%; font-size: 14px; color: #b42318; }
.rp-prompt-error[hidden] { display: none; }
/* Not Now: glossy gold, the same as Upload Invoice in the reminders */
.mtk main button.rp-notnow {
  color: #4a3200; text-shadow: 0 1px 0 rgba(255,255,255,.5); border-color: #b5841f;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #ffe08a 0%, #f2bf3a 50%, #e0a51f 51%, #c98b0e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(120,80,0,.25), 0 4px 0 #9a6d10, 0 9px 18px rgba(154,109,16,.25);
}
.mtk main button.rp-notnow:hover:not(:disabled) { color: #4a3200; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(120,80,0,.25), 0 5px 0 #9a6d10, 0 12px 22px rgba(154,109,16,.3); }
.mtk main button.rp-notnow:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(90,60,0,.35), 0 1px 0 #9a6d10; }
@media (max-width: 560px) {
  .rp-prompt { padding: 10px; }
  .rp-prompt-actions { flex-basis: 100%; }
  .rp-prompt-actions button { flex: 1 1 auto; min-height: 40px; }
}

/* Expenses and Business Expenses: lighter champagne-gold
   Back to Reminders with dark navy-green text */
.mtk main:is(.tone-expenses, .tone-business) button.rp-back {
  color: #102F28; text-shadow: 0 1px 0 rgba(255,255,255,.45); border-color: #a8873f;
  background:
    linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.14) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #e8cf92 0%, #D8B86A 50%, #c9a656 51%, #b8954a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -2px 0 rgba(80,55,10,.2), 0 3px 0 #94742f, 0 7px 14px rgba(120,90,30,.22);
}
.mtk main:is(.tone-expenses, .tone-business) button.rp-back:hover:not(:disabled) {
  color: #102F28; filter: brightness(1.04);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(80,55,10,.2), 0 4px 0 #94742f, 0 10px 18px rgba(120,90,30,.28);
}
.mtk main:is(.tone-expenses, .tone-business) button.rp-back:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(60,40,5,.32), 0 1px 0 #94742f; }
.mtk main:is(.tone-expenses, .tone-business) button.rp-back svg.icon { color: #102F28; }

/* Invoice prompt inside the form (below Receipt Storage Options), collapsible */
#expenseForm .rp-prompt { margin: 14px 0; }
.mtk main button.rp-toggle {
  flex: none; order: 2; width: 30px; height: 30px; min-height: 0; padding: 5px; margin: 0; border-radius: 50%;
  color: #6b4a00; border: 1px solid #b5841f; text-shadow: none; filter: none;
  background: linear-gradient(180deg, #fbe7ae 0%, #e3b341 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 2px 0 #b5841f;
}
.mtk main button.rp-toggle:hover:not(:disabled) { color: #6b4a00; transform: none; filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 2px 0 #b5841f; }
.mtk main button.rp-toggle:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
.rp-arrow { width: 18px; height: 18px; transform: rotate(180deg); transition: transform var(--speed); }
.rp-prompt.is-collapsed .rp-arrow { transform: none; }
.rp-prompt.is-collapsible .rp-prompt-text { order: 1; }
.rp-prompt.is-collapsible .rp-prompt-actions { order: 3; flex-basis: 100%; }
.rp-prompt.is-collapsible .rp-prompt-error { order: 4; }
.rp-prompt.is-collapsed .rp-prompt-actions, .rp-prompt.is-collapsed .rp-prompt-error { display: none; }
.rp-prompt.is-collapsed { padding-top: 6px; padding-bottom: 6px; }
@media (prefers-reduced-motion: reduce) { .rp-arrow { transition: none; } }

/* Additional Options (optional) above Save Expense (Expenses page): a recurring
   schedule and an invoice reminder, each revealed only when ticked */
.xo-options {
  margin: 14px 0 4px; padding: 10px 14px 12px; border-radius: 14px; min-width: 0;
  border: 1.5px solid #D77A68; background: linear-gradient(180deg, #fff7f4 0%, #FFF0EC 55%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 6px rgba(140,48,40,.08);
}
.xo-options[hidden] { display: none; }
.xo-options > legend { padding: 0 6px; margin-left: -6px; font-weight: 800; color: #8C3028; }
.xo-options > legend .optional { font-weight: 600; color: #a2554b; }
.mtk label.xo-check { color: #5a1f19; }

.xo-options .xo-hint { color: #6b4640; }
.mtk label.xo-check { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-weight: 700; cursor: pointer; }
.mtk label.xo-check[hidden] { display: none; }
.xo-check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: #b8463a; }
.xo-fields { margin: 8px 0 2px 30px; }
.xo-fields[hidden] { display: none; }
.xo-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.xo-row label { font-size: 15px; margin-bottom: 4px; }
.xo-hint { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-700); line-height: 1.45; }
.xo-linked { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: #f1f9f4; border: 1px solid #b9dcc8; color: #0b4a33; font-size: 14.5px; font-weight: 700; }
.xo-linked[hidden] { display: none; }
.xo-days { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; min-width: 0; }
.xo-days legend { width: 100%; padding: 0; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--ink-700); }
.mtk .xo-days label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; cursor: pointer; }
.xo-days input { accent-color: #b8463a; }
@media (max-width: 560px) {
  .xo-options { padding: 10px 12px 12px; }
  .xo-fields { margin-left: 0; }
  .xo-row { grid-template-columns: minmax(0, 1fr); }
}

/* The same gold bell on My Business Portal's heading panel (third column; top-right corner on phones) */
.mtk .module-head:has(.rb-bell) { position: relative; }
/* On tinted pages (My Business Portal) the page-colour button rule would repaint
   Upload Invoice: keep it gold, as on the dashboard */
.mtk main[class*="tone-"] .button.rb-gold:not(.secondary):not(.danger):not(.success) {
  color: #4a3200; text-shadow: 0 1px 0 rgba(255,255,255,.5); border-color: #b5841f;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 48%, rgba(255,255,255,0) 50%),
    linear-gradient(180deg, #ffe08a 0%, #f2bf3a 50%, #e0a51f 51%, #c98b0e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75), inset 0 -2px 0 rgba(120,80,0,.25), 0 4px 0 #9a6d10, 0 9px 18px rgba(154,109,16,.25);
}
.mtk main[class*="tone-"] .button.rb-gold:not(.secondary):not(.danger):not(.success):hover { color: #4a3200; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -2px 0 rgba(120,80,0,.25), 0 5px 0 #9a6d10, 0 12px 22px rgba(154,109,16,.3); }
.mtk main[class*="tone-"] .button.rb-gold:not(.secondary):not(.danger):not(.success):active { box-shadow: inset 0 2px 5px rgba(90,60,0,.35), 0 1px 0 #9a6d10; }

/* ---------- 36. Sidebar in ATO-inspired royal blue (#303FBF) ----------
   Only the sidebar's own surfaces change: page tones and the top header stay as they are. */
.mtk .app-sidebar {
  background:
    linear-gradient(180deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 40%),
    linear-gradient(170deg, #26339f 0%, #303fbf 55%, #3949c8 100%);
  box-shadow: 4px 0 24px rgba(28, 38, 128, .32);
}
.mtk .app-sidebar .nav-link:hover { background: rgba(255,255,255,.16); }
.mtk .app-sidebar .nav-link[aria-current="page"] { background: #fff; color: #1b2477; box-shadow: 0 4px 0 rgba(10,16,70,.28), 0 8px 16px rgba(10,16,70,.22); }
.mtk .app-sidebar .nav-link .nav-icon-art { background: linear-gradient(180deg, #ffffff 0%, #e8ebfa 100%); }
.mtk .app-sidebar button.nav-group-toggle { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }
.mtk .app-sidebar button.nav-group-toggle:hover { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.8); }
.mtk .app-sidebar button.sidebar-signout:hover:not(:disabled) { background: rgba(255,255,255,.16); }

/* ---------- 37. Dashboard: My Tax Assistant card with a link for each feature ----------
   The card is a <div>: a click anywhere outside a link opens My Tax Assistant
   (dashboard.html), "Open My Tax Assistant" is its keyboard link, and each feature
   pill opens its own page. */
.mtk .pa-module.pa-module-links { cursor: pointer; }
.mtk .pa-module-links .pa-stretch, .mtk .pa-module-links .pa-stretch:hover { text-decoration: none; color: #fff; }
.mtk .pa-module-links .pa-stretch:focus-visible { outline: 3px solid #ffc94a; outline-offset: 3px; }
.mtk .pa-module-links .pa-includes li { padding: 0; }
.mtk .pa-module-links .pa-includes a {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 32px;
  padding: 4px 10px; border-radius: 999px; color: inherit; text-decoration: none;
  transition: background var(--speed), box-shadow var(--speed);
}
.mtk .pa-module-links .pa-includes a:hover { background: #fff; text-decoration: underline; box-shadow: 0 2px 6px rgba(120,80,0,.15); }
.mtk .pa-module-links .pa-includes a:focus-visible { outline: 3px solid #ffc94a; outline-offset: 2px; }
/* Five features: the fifth pill sits centred on its own row */
.mtk .pa-includes-pairs li:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 3px); }

/* ---------- 38. My Tax Assistant page: five feature cards ----------
   One row on wide desktops; three, two or one column on smaller screens. */
.mtk .module-tiles.tax-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mtk .module-tiles.tax-tiles .tile .tile-go { min-height: 50px; line-height: 1.2; text-align: center; }
@media (max-width: 639px) { .mtk .module-tiles.tax-tiles { grid-template-columns: minmax(0, 1fr); } }
/* Two columns: the fifth card sits centred on its own row */
@media (min-width: 640px) and (max-width: 999px) { .mtk .module-tiles.tax-tiles .tile:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 8px); } }
@media (min-width: 1000px) { .mtk .module-tiles.tax-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1400px) {
  .mtk .module-tiles.tax-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
  .mtk .module-tiles.tax-tiles .tile { padding: 18px 14px; }
  .mtk .module-tiles.tax-tiles .tile h2 { font-size: 17.5px; }
  .mtk .module-tiles.tax-tiles .tile p { font-size: 14.5px; }
  .mtk .module-tiles.tax-tiles .tile-art { width: 76px; height: 76px; }
  .mtk .module-tiles.tax-tiles .tile .tile-go { padding: 8px 10px; font-size: 14.5px; }
}

/* ---------- 39. Account-switch guard (auth-client.js) ----------
   The signed-in email in the sidebar, and the cover shown while a page that
   belonged to another account is cleared and reloaded. */
.mtk .app-sidebar .sidebar-user { padding: 2px 8px 8px; font-size: 13px; line-height: 1.35; color: rgba(255,255,255,.85); overflow-wrap: anywhere; }
.mtk .app-sidebar .sidebar-user strong { display: block; color: #fff; font-size: 13.5px; }
@media (max-width: 999px) { .mtk .app-sidebar .sidebar-user { grid-column: 1 / -1; } }
.account-switch-cover { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: #f3eadb; }
.account-switch-box { max-width: 440px; padding: 22px 24px; border-radius: 18px; background: #fffdf7; border: 1.5px solid #dcbf7c; box-shadow: 0 10px 30px rgba(60,40,10,.18); text-align: center; font-family: inherit; }
.account-switch-box h2 { margin: 0 0 8px; font-size: 20px; color: #1b2477; }
.account-switch-box p { margin: 0; font-size: 15.5px; line-height: 1.5; color: #3a3a3a; }
