/* =====================================================================
   THEME: Nothing-inspired. Monochrome (black / white / greys) with one red accent,
   dot-matrix display numbers (Doto), Space Grotesk text and Space Mono labels.
   The --md-* block holds the colour roles (names kept from the Material system);
   the --hm-* tokens below point at them, and Finance maps onto those in
   src/finance/finance-shell.css. Red means: now, money out, errors.
   ===================================================================== */
:root {
  color-scheme: light;
  --md-primary: #ff6a13;              --md-on-primary: #000000;   /* CMF-style orange: a fill, with black on top (7.3:1) */
  --md-accent-text: #b03e00;          /* orange used as text on light surfaces (5.2:1+) */
  --md-primary-container: #e6e6e6;    --md-on-primary-container: #000000;
  --md-secondary-container: #000000;  --md-on-secondary-container: #ffffff;   /* selected = solid black */
  --md-tertiary: #000000;             --md-tertiary-container: #e6e6e6;  --md-on-tertiary-container: #000000;
  --md-error: #d71921;                --md-on-error: #ffffff;  --md-error-container: #fbe3e4;  --md-on-error-container: #6b0a0e;
  --md-warn: #000000;                 --md-warn-container: #e6e6e6;      --md-on-warn-container: #000000;
  --md-surface: #f0f0f0;              --md-on-surface: #000000;          --md-on-surface-variant: #666666;
  --md-surface-lowest: #ffffff;       --md-surface-low: #f6f6f6;         --md-surface-container: #e9e9e9;
  --md-surface-high: #dedede;         --md-surface-highest: #d4d4d4;
  --md-outline: #858585;              --md-outline-variant: #d9d9d9;
  --md-inverse-surface: #000000;      --md-inverse-on-surface: #ffffff;  --md-inverse-primary: #ff6a13;
  --md-red: #d71921;
  --md-scrim: rgba(0, 0, 0, .4);
  --md-shadow: rgba(0, 0, 0, .12);

  /* Finance tonal pairs: greys, so the screens stay monochrome */
  --md-ff-mint: #e6e6e6;      --md-ff-mint-ink: #000000;
  --md-ff-peach: #e6e6e6;     --md-ff-peach-ink: #000000;
  --md-ff-lavender: #e6e6e6;  --md-ff-lavender-ink: #000000;
  --md-ff-sky: #e6e6e6;       --md-ff-sky-ink: #000000;
  --md-ff-butter: #e6e6e6;    --md-ff-butter-ink: #000000;
}

/* Dark: true black, follows the device setting. */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --md-primary: #ff6a13;              --md-on-primary: #000000;
    --md-accent-text: #ff6a13;
    --md-primary-container: #262626;    --md-on-primary-container: #ffffff;
    --md-secondary-container: #ffffff;  --md-on-secondary-container: #000000;
    --md-tertiary: #ffffff;             --md-tertiary-container: #262626;  --md-on-tertiary-container: #ffffff;
    --md-error: #ff3b41;                --md-on-error: #000000;  --md-error-container: #3d0a0c;  --md-on-error-container: #ffb3b5;
    --md-warn: #ffffff;                 --md-warn-container: #262626;      --md-on-warn-container: #ffffff;
    --md-surface: #000000;              --md-on-surface: #ffffff;          --md-on-surface-variant: #9a9a9a;
    --md-surface-lowest: #141414;       --md-surface-low: #0a0a0a;         --md-surface-container: #1c1c1c;
    --md-surface-high: #262626;         --md-surface-highest: #303030;
    --md-outline: #6e6e6e;              --md-outline-variant: #2b2b2b;
    --md-inverse-surface: #ffffff;      --md-inverse-on-surface: #000000;  --md-inverse-primary: #b03e00;
    --md-red: #ff3b41;
    --md-scrim: rgba(0, 0, 0, .7);
    --md-shadow: rgba(0, 0, 0, .6);
    --md-ff-mint: #262626;      --md-ff-mint-ink: #ffffff;
    --md-ff-peach: #262626;     --md-ff-peach-ink: #ffffff;
    --md-ff-lavender: #262626;  --md-ff-lavender-ink: #ffffff;
    --md-ff-sky: #262626;       --md-ff-sky-ink: #ffffff;
    --md-ff-butter: #262626;    --md-ff-butter-ink: #ffffff;
  }
}

:root {
  /* colours used by the screens */
  --hm-bg: var(--md-surface);                  /* page */
  --hm-card: var(--md-surface-lowest);         /* cards: white on the blue-grey page */
  --hm-surface: var(--md-surface-lowest);      /* inputs, menus */
  --hm-surface-alt: var(--md-surface-low);     /* quiet fills */
  --hm-text: var(--md-on-surface);
  --hm-muted: var(--md-on-surface-variant);
  --hm-border: var(--md-outline-variant);      /* dividers */
  --hm-control-border: var(--md-outline);      /* outlines of fields, checkboxes, grips (3:1+) */
  --hm-accent: var(--md-primary);
  --hm-accent-ink: var(--md-on-primary);
  --hm-accent-soft: var(--md-primary-container);
  --hm-accent-soft-ink: var(--md-on-primary-container);
  --hm-selected: var(--md-secondary-container);  /* current nav item, selected chips */
  --hm-selected-ink: var(--md-on-secondary-container);
  --hm-danger: var(--md-error);
  --hm-danger-soft: var(--md-error-container);
  --hm-ok: var(--md-tertiary);
  --hm-ok-soft: var(--md-tertiary-container);
  --hm-warn: var(--md-warn);
  --hm-warn-soft: var(--md-warn-container);
  --hm-warn-border: var(--md-warn);
  --hm-accent-text: var(--md-accent-text);    /* orange for text and thin outlines */
  --hm-info: var(--md-accent-text);
  --hm-info-soft: var(--md-primary-container);
  --hm-focus: var(--md-accent-text);
  --hm-inverse: var(--md-inverse-surface);
  --hm-inverse-ink: var(--md-inverse-on-surface);
  --hm-kind-thought: var(--md-on-surface-variant);   /* inbox thought / idea stripes */
  --hm-kind-idea: var(--md-on-surface);
  --hm-neutral: #8a8a8a;                       /* fallback tone for pills and project icons */
  --hm-nav-bg: var(--md-surface);              /* rail / drawer / bottom bar */
  --hm-hover: color-mix(in srgb, var(--md-on-surface) 8%, transparent);   /* Material state layer */
  --hm-press: color-mix(in srgb, var(--md-on-surface) 12%, transparent);

  /* Finance names (kept so the Finance screens map onto Material) */
  --hm-ff-surface-soft: var(--md-surface-low);
  --hm-ff-surface-2: var(--md-surface-container);
  --hm-ff-ink-3: var(--md-on-surface-variant);
  --hm-ff-line-strong: var(--md-outline-variant);
  --hm-ff-mint: var(--md-ff-mint);         --hm-ff-mint-ink: var(--md-ff-mint-ink);
  --hm-ff-peach: var(--md-ff-peach);       --hm-ff-peach-ink: var(--md-ff-peach-ink);
  --hm-ff-lavender: var(--md-ff-lavender); --hm-ff-lavender-ink: var(--md-ff-lavender-ink);
  --hm-ff-sky: var(--md-ff-sky);           --hm-ff-sky-ink: var(--md-ff-sky-ink);
  --hm-ff-butter: var(--md-ff-butter);     --hm-ff-butter-ink: var(--md-ff-butter-ink);
  --hm-ff-income: var(--md-tertiary);      --hm-ff-income-soft: var(--md-tertiary-container);
  --hm-red: var(--md-red);
  --hm-ff-expense: var(--md-error);        --hm-ff-expense-soft: var(--md-error-container);
  --hm-ff-warn: var(--md-warn);            --hm-ff-warn-soft: var(--md-warn-container);

  /* type: Space Grotesk text, Space Mono labels, Doto numbers. Compact on large screens, roomier on phones (see the phone block). */
  --hm-font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hm-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --hm-dot: 'Doto', 'Space Mono', monospace;          /* dot-matrix: big numbers and the wordmark only */
  --hm-fs-xs: 12px;
  --hm-fs-sm: 13px;
  --hm-fs: 14px;
  --hm-fs-input: 14px;
  --hm-fs-h2: 16px;              /* title medium */
  --hm-fs-h1: 28px;              /* headline medium */

  /* sizes */
  --hm-nav-w: 80px;              /* rail; the drawer widens it on large screens */
  --hm-bar-h: 80px;              /* phone navigation bar (without safe area) */
  --hm-max: 1100px;
  --hm-max-wide: 1400px;
  --hm-sidebar-w: 300px;
  --hm-gutter: 16px;
  --hm-pad: 24px;
  --hm-gap: 12px;
  --hm-control-h: 40px;

  /* shape: rounder than stock Material */
  --hm-radius-card: 20px;
  --hm-radius-dialog: 24px;
  --hm-radius-input: 12px;
  --hm-radius-sm: 12px;
  --hm-radius-pill: 999px;

  /* motion */
  --hm-ease: 200ms cubic-bezier(.2, 0, 0, 1);
  --hm-shadow-1: 0 1px 2px var(--md-shadow), 0 1px 3px 1px color-mix(in srgb, var(--md-shadow) 60%, transparent);
  --hm-shadow-2: 0 1px 2px var(--md-shadow), 0 2px 6px 2px color-mix(in srgb, var(--md-shadow) 60%, transparent);
  --hm-shadow-3: 0 4px 8px 3px color-mix(in srgb, var(--md-shadow) 60%, transparent), 0 1px 3px var(--md-shadow);
}
@media (min-width: 1200px) { :root { --hm-nav-w: 256px; } }
@media (max-width: 640px) {
  :root { --hm-fs: 16px; --hm-fs-sm: 14px; --hm-fs-input: 16px; --hm-fs-h1: 26px; --hm-fs-h2: 18px; --hm-control-h: 48px; --hm-gap: 14px; }
}

/* =====================================================================
   Fonts (self-hosted)
   ===================================================================== */
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-display: swap; font-weight: 300 700;
  src: url('/fonts/space-grotesk-latin-wght.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono'; font-style: normal; font-display: swap; font-weight: 400;
  src: url('/fonts/space-mono-latin-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Doto'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url('/fonts/doto-latin-wght.woff2') format('woff2');
}
/* Finance asks for these family names. */
@font-face {
  font-family: 'JetBrains Mono'; font-style: normal; font-display: swap; font-weight: 400;
  src: url('/fonts/space-mono-latin-400.woff2') format('woff2');
}
/* Material Symbols Rounded, subset to the icons the app uses (see scripts/icons/). block: never show the ligature words. */
@font-face {
  font-family: 'Material Symbols Rounded'; font-style: normal; font-weight: 400; font-display: block;
  src: url('/fonts/material-symbols-rounded.woff2') format('woff2');
}
.hm-icon {
  font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; font-size: 24px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr;
  display: inline-block; flex: none; width: 1em; height: 1em; overflow: hidden; user-select: none;
  font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
/* The ligature comes from data-icon, so icons add no words to the page text. */
.hm-icon::before { content: attr(data-icon); }
.hm-icon--16 { font-size: 16px; } .hm-icon--18 { font-size: 18px; } .hm-icon--20 { font-size: 20px; } .hm-icon--28 { font-size: 28px; }
.hm-icon.is-filled { font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.hm-body {
  margin: 0; min-height: 100vh; background: var(--hm-bg); color: var(--hm-text);
  font: 400 var(--hm-fs)/1.45 var(--hm-font);
  -webkit-font-smoothing: antialiased;
}
/* Zero specificity, so any component class (.hm-btn, .hm-nav__fab ...) can set its own link colour. */
:where(.hm-body) a { color: inherit; }
.hm-h1 { font-size: var(--hm-fs-h1); line-height: 1.25; margin: 0 0 6px; font-weight: 400; letter-spacing: 0; }
.hm-h2 { font-size: var(--hm-fs-h2); line-height: 1.4; margin: 0 0 12px; font-weight: 500; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
.hm-h2 .hm-icon { color: var(--hm-accent); font-size: 20px; }
.hm-muted { color: var(--hm-muted); margin: 0; }
.hm-small { font-size: var(--hm-fs-sm); }
.hm-mono { font-family: var(--hm-mono); }
:focus-visible { outline: 2px solid var(--hm-focus); outline-offset: 2px; }
::selection { background: var(--md-primary-container); color: var(--md-on-primary-container); }

/* =====================================================================
   Navigation: one markup, three layouts.
   Phones: bottom bar (three sections + More).  641-1199px: rail.  1200px+: drawer.
   ===================================================================== */
.hm-nav { position: fixed; z-index: 20; background: var(--hm-nav-bg); color: var(--hm-muted); display: flex; }
.hm-nav__list { list-style: none; margin: 0; padding: 0; display: flex; }
.hm-nav__list li { display: flex; }
.hm-nav__out { margin: 0; }
.hm-nav__item {
  position: relative; display: flex; align-items: center; color: var(--hm-muted); text-decoration: none;
  background: none; border: 0; padding: 0; font: 500 12px/1.2 var(--hm-font); letter-spacing: .03em; cursor: pointer; list-style: none;
}
.hm-nav__item::-webkit-details-marker { display: none; }
.hm-nav__ind {
  display: grid; place-items: center; width: 56px; height: 32px; border-radius: 16px; flex: none;
  transition: background var(--hm-ease), color var(--hm-ease);
}
.hm-nav__item:hover .hm-nav__ind { background: var(--hm-hover); color: var(--hm-text); }
.hm-nav__item.is-current { color: var(--hm-text); }
.hm-nav__item.is-current .hm-nav__ind { background: var(--hm-selected); color: var(--hm-selected-ink); }
.hm-nav__item.is-current .hm-icon { font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.hm-nav__brand { display: none; align-items: center; gap: 12px; text-decoration: none; color: var(--hm-text); font-size: 20px; }
.hm-nav__logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--hm-accent); color: var(--hm-accent-ink); flex: none; }
.hm-nav__logo .hm-icon { font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.hm-nav__fab {
  display: none; align-items: center; justify-content: center; gap: 12px; height: 56px; min-width: 56px; padding: 0 16px;
  border-radius: 16px; background: var(--md-primary-container); color: var(--md-on-primary-container);
  text-decoration: none; font: 500 14px/1 var(--hm-font); letter-spacing: .01em; box-shadow: var(--hm-shadow-1);
  transition: box-shadow var(--hm-ease);
}
.hm-nav__fab:hover { box-shadow: var(--hm-shadow-2); }
.hm-nav__divider { height: 1px; background: var(--hm-border); margin: 8px 16px; list-style: none; }
.hm-nav__more { display: none; }

/* Rail and drawer share the left edge */
@media (min-width: 641px) {
  .hm-nav { top: 0; left: 0; bottom: 0; width: var(--hm-nav-w); flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; overflow-y: auto; }
  .hm-nav__brand { display: flex; margin-bottom: 8px; }
  .hm-nav__brandname { display: none; }
  .hm-nav__fab { display: flex; margin-bottom: 12px; }
  .hm-nav__fab span:not(.hm-icon) { display: none; }
  .hm-nav__list { flex-direction: column; gap: 4px; align-items: center; }
  .hm-nav__item { flex-direction: column; gap: 4px; width: 80px; padding: 2px 0 6px; text-align: center; }
  .hm-nav__divider { width: 40px; margin: 6px auto; }
  .hm-nav__out { margin-top: auto; }
  .hm-main { margin-left: var(--hm-nav-w); }
}
/* Drawer: labelled rows, like Gmail */
@media (min-width: 1200px) {
  .hm-nav { align-items: stretch; padding: 12px 12px 16px; gap: 2px; }
  .hm-nav__brand { padding: 4px 12px 12px; }
  .hm-nav__brandname { display: inline; }
  .hm-nav__fab { align-self: flex-start; padding: 0 20px 0 16px; }
  .hm-nav__fab span:not(.hm-icon) { display: inline; }
  .hm-nav__list { align-items: stretch; gap: 2px; }
  .hm-nav__item { flex-direction: row; width: 100%; gap: 12px; height: 40px; padding: 0 16px 0 0; border-radius: 20px; font-size: 14px; letter-spacing: .01em; text-align: left; }
  .hm-nav__item .hm-nav__ind { width: 48px; height: 40px; border-radius: 20px; background: none !important; }
  .hm-nav__item:hover { background: var(--hm-hover); color: var(--hm-text); }
  .hm-nav__item.is-current { background: var(--hm-selected); color: var(--hm-selected-ink); }
  .hm-nav__item.is-current .hm-nav__ind { color: inherit; }
  .hm-nav__divider { width: auto; margin: 8px 16px; }
}
/* Phone: bottom bar with three sections and a More sheet */
@media (max-width: 640px) {
  .hm-nav {
    left: 0; right: 0; bottom: 0; height: calc(var(--hm-bar-h) + env(safe-area-inset-bottom));
    padding: 12px 8px calc(16px + env(safe-area-inset-bottom)); background: var(--md-surface-container);
  }
  .hm-nav__list { flex: 3; }
  .hm-nav__list li, .hm-nav__divider { display: none; }
  .hm-nav__list li.hm-nav__li--bar { display: flex; flex: 1; }
  .hm-nav__out { display: none; }
  .hm-nav__item { flex-direction: column; justify-content: center; gap: 4px; width: 100%; }
  .hm-nav__ind { width: 64px; }
  .hm-nav__more { display: flex; flex: 1; position: static; }
  .hm-nav__more > summary { flex: 1; }
  .hm-sheet {
    /* sits just above the bar, so More stays visible and closes the sheet again */
    position: fixed; left: 0; right: 0; bottom: calc(var(--hm-bar-h) + env(safe-area-inset-bottom)); z-index: 30;
    max-height: calc(80vh - var(--hm-bar-h)); overflow-y: auto;
    background: var(--md-surface-low); color: var(--hm-text); border-radius: var(--hm-radius-dialog) var(--hm-radius-dialog) 0 0;
    padding: 8px 16px 16px; box-shadow: var(--hm-shadow-3);
  }
  .hm-sheet::before { content: ''; display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--hm-control-border); margin: 8px auto 12px; opacity: .6; }
  .hm-sheet ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .hm-sheet a, .hm-sheet button {
    display: flex; align-items: center; gap: 16px; width: 100%; height: 56px; padding: 0 16px; border-radius: 28px; border: 0; background: none;
    color: var(--hm-text); text-decoration: none; font: 500 16px/1 var(--hm-font); cursor: pointer;
  }
  .hm-sheet a.is-current { background: var(--hm-selected); color: var(--hm-selected-ink); }
  .hm-sheet a:hover, .hm-sheet button:hover { background: var(--hm-hover); }
  .hm-sheet form { margin: 8px 0 0; border-top: 1px solid var(--hm-border); padding-top: 8px; }
  .hm-nav__more[open] > summary .hm-nav__ind { background: var(--hm-selected); color: var(--hm-selected-ink); }
}
/* Installed as an app: keep the navigation, clear the notch */
@media (display-mode: standalone) {
  .hm-main { padding-top: calc(var(--hm-pad) + env(safe-area-inset-top)); }
}

/* =====================================================================
   Content area
   ===================================================================== */
.hm-main { max-width: calc(var(--hm-max) + 2 * var(--hm-pad)); padding: var(--hm-pad); }
@media (min-width: 641px) {
  .hm-main { margin-right: auto; }
  .hm-main { margin-left: max(var(--hm-nav-w), calc(var(--hm-nav-w) + (100vw - var(--hm-nav-w) - (var(--hm-max) + 2 * var(--hm-pad))) / 2)); }
}
@media (min-width: 1024px) {
  .hm-main--wide { max-width: calc(var(--hm-max-wide) + 2 * var(--hm-pad)); }
  .hm-main--wide { margin-left: max(var(--hm-nav-w), calc(var(--hm-nav-w) + (100vw - var(--hm-nav-w) - (var(--hm-max-wide) + 2 * var(--hm-pad))) / 2)); }
}
@media (max-width: 640px) {
  .hm-main { padding: var(--hm-gutter) var(--hm-gutter) calc(var(--hm-bar-h) + env(safe-area-inset-bottom) + 24px); }
  .hm-desktop-only { display: none !important; }
}

.hm-layout { display: grid; gap: var(--hm-gap); }
.hm-layout__side { display: grid; gap: var(--hm-gap); align-content: start; }
@media (min-width: 1024px) {
  .hm-layout { grid-template-columns: minmax(0, 1fr) var(--hm-sidebar-w); align-items: start; }
  .hm-layout__side { position: sticky; top: var(--hm-pad); }
}
@media (max-width: 640px) { .hm-layout__side--phone-hide { display: none; } }

.hm-pagehead { margin: 4px 0 16px; }
.hm-stack { display: grid; gap: var(--hm-gap); margin-bottom: var(--hm-gap); }

/* Cards: white on the page, no outline (tone does the separating) */
.hm-card {
  background: var(--hm-card); border: 0; border-radius: var(--hm-radius-card);
  padding: 20px; margin: 0 0 var(--hm-gap);
}
@media (max-width: 640px) { .hm-card { padding: 18px 16px; border-radius: 20px; } }
.hm-card--narrow { max-width: 480px; }
.hm-empty { text-align: center; padding: 40px 20px; }
.hm-empty__icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--md-surface-container); color: var(--hm-muted); margin-bottom: 12px; }

/* Home: one card per section */
.hm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--hm-gap); }
.hm-tile { display: grid; gap: 6px; text-decoration: none; margin: 0; transition: box-shadow var(--hm-ease), background var(--hm-ease); }
.hm-tile:hover { box-shadow: var(--hm-shadow-1); }
.hm-tile__icon { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--hm-accent-soft); color: var(--hm-accent-soft-ink); }
.hm-tile__name { font-weight: 500; font-size: 16px; }
.hm-tile__blurb { color: var(--hm-muted); font-size: var(--hm-fs-sm); }
@media (max-width: 640px) { .hm-grid { grid-template-columns: 1fr 1fr; } .hm-tile__blurb { display: none; } }

/* Buttons: filled (default), tonal, outlined (ghost), text */
.hm-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--hm-control-h); padding: 0 24px; border-radius: var(--hm-radius-pill);
  background: var(--hm-accent); color: var(--hm-accent-ink); border: 1px solid transparent;
  font: 500 14px/1 var(--hm-font); letter-spacing: .01em; text-decoration: none; cursor: pointer;
  transition: box-shadow var(--hm-ease), background var(--hm-ease);
}
.hm-btn .hm-icon { font-size: 18px; margin-left: -6px; }
.hm-btn:hover { box-shadow: var(--hm-shadow-1); background-image: linear-gradient(color-mix(in srgb, var(--hm-accent-ink) 8%, transparent), color-mix(in srgb, var(--hm-accent-ink) 8%, transparent)); }
.hm-btn--tonal { background: var(--hm-selected); color: var(--hm-selected-ink); }
.hm-btn--ghost { background: transparent; color: var(--hm-accent-text); border-color: var(--hm-control-border); }
.hm-btn--ghost:hover, .hm-btn--text:hover { background: color-mix(in srgb, var(--hm-accent) 8%, transparent); box-shadow: none; background-image: none; }
.hm-btn--text { background: transparent; color: var(--hm-accent-text); padding: 0 12px; }
.hm-btn--sm { min-height: 32px; padding: 0 14px; font-size: 13px; }
.hm-btn--block { width: 100%; }
.hm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hm-actions form { margin: 0; }
.hm-actions--secondary { margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--hm-border); }

/* Forms: outlined text fields, rounded */
.hm-form { display: grid; gap: 16px; margin: 0; }
.hm-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.hm-field { display: grid; gap: 6px; }
.hm-field__label { font-size: var(--hm-fs-sm); font-weight: 500; color: var(--hm-muted); letter-spacing: .01em; }
.hm-input {
  width: 100%; min-height: var(--hm-control-h); padding: 8px 14px; border-radius: var(--hm-radius-input);
  border: 1px solid var(--hm-control-border); background: var(--hm-surface); color: var(--hm-text);
  font: 400 var(--hm-fs-input)/1.4 var(--hm-font); transition: border-color var(--hm-ease);
}
.hm-input:hover { border-color: var(--hm-text); }
.hm-input:focus { border-color: var(--hm-focus); outline: none; box-shadow: inset 0 0 0 1px var(--hm-focus); }
.hm-input::placeholder { color: var(--hm-muted); opacity: 1; }
.hm-input:disabled { background: var(--md-surface-low); color: var(--hm-muted); border-color: var(--hm-border); }
.hm-fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.hm-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.hm-check { display: inline-flex; align-items: center; gap: 10px; font-size: var(--hm-fs); }
.hm-check input { width: 18px; height: 18px; accent-color: var(--hm-accent); }

/* Notices and badges: tonal containers */
.hm-notice { border-radius: 16px; padding: 12px 16px; margin: 0 0 var(--hm-gap); background: var(--hm-ok-soft); color: var(--md-on-tertiary-container); }
.hm-notice--error { background: var(--hm-danger-soft); color: var(--md-on-error-container); }
.hm-notice--secret { background: var(--hm-warn-soft); color: var(--md-on-warn-container); }
.hm-notice p { margin: 0 0 6px; }
.hm-secret { font: 500 20px/1.3 var(--hm-mono); letter-spacing: .04em; user-select: all; overflow-wrap: anywhere; }
.hm-badge { font-size: var(--hm-fs-xs); font-weight: 500; padding: 3px 10px; border-radius: var(--hm-radius-pill); background: var(--md-surface-container); color: var(--hm-muted); }
.hm-badge--off { background: var(--hm-danger-soft); color: var(--md-on-error-container); }
.hm-badge--warn { background: var(--hm-warn-soft); color: var(--md-on-warn-container); }

/* Admin */
.hm-person__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hm-person__head .hm-h2 { margin: 0; }
.hm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; }
.hm-dl dt { color: var(--hm-muted); }
.hm-dl dd { margin: 0; }

/* Tabs and filter chips */
.hm-tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 var(--hm-gap); scrollbar-width: none; }
.hm-tabs::-webkit-scrollbar { display: none; }
.hm-tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: var(--hm-radius-pill);
  border: 1px solid var(--hm-control-border); background: transparent; color: var(--hm-muted); text-decoration: none;
  font: 500 13px/1 var(--hm-font); letter-spacing: .01em; cursor: pointer; transition: background var(--hm-ease);
}
.hm-tab:hover { background: var(--hm-hover); }
.hm-tab[aria-selected="true"], .hm-tab.is-current { background: var(--hm-selected); color: var(--hm-selected-ink); border-color: transparent; }

/* =====================================================================
   Sign-in page (no navigation): a centred card on a quiet surface, like a Google sign-in.
   ===================================================================== */
body.hm-bare { background: var(--md-surface-container); }
.hm-bare__wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--hm-gutter); }
.hm-signin-card {
  width: 100%; max-width: 420px; background: var(--hm-card); border-radius: 32px; padding: 32px 28px;
}
.hm-signin-card .hm-form { margin: 20px 0 16px; }
.hm-signin-card .hm-input { min-height: 56px; padding: 14px 16px; border-radius: 16px; font-size: 16px; }
.hm-signin-card .hm-btn { min-height: 48px; }
.hm-brand { display: flex; align-items: center; gap: 12px; font-weight: 400; font-size: 22px; color: var(--hm-text); margin-bottom: 20px; }
.hm-brand .hm-icon {
  box-sizing: content-box; padding: 8px; border-radius: 14px; background: var(--hm-accent); color: var(--hm-accent-ink);
  font-variation-settings: 'FILL' 1, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}
@media (max-width: 640px) {
  body.hm-bare { background: var(--hm-card); }
  .hm-signin-card { padding: 24px 8px; }
}

/* =====================================================================
   Reduced motion
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =====================================================================
   Claude connector: connections lists, activity table, consent page
   ===================================================================== */
.hm-h3 { font-size: var(--hm-fs); font-weight: 500; margin: 16px 0 8px; }
.hm-list { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 4px; }
.hm-conns { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hm-conn { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid var(--hm-border); border-radius: 16px; }
.hm-tablewrap { overflow-x: auto; }
.hm-table { width: 100%; border-collapse: collapse; font-size: var(--hm-fs-sm); }
.hm-table th, .hm-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--hm-border); vertical-align: top; }
.hm-table th { font-weight: 500; color: var(--hm-muted); }
.hm-table code { overflow-wrap: anywhere; }
.hm-nowrap { white-space: nowrap; }

/* =====================================================================
   Nothing details: mono labels, dot-matrix wordmark, underlined fields,
   solid black selection, a red dot for "current".
   ===================================================================== */
.hm-label, .hm-field__label, .hm-h2, .hm-badge, .hm-table th, .hm-tab, .hm-btn {
  font-family: var(--hm-mono); font-weight: 400; text-transform: uppercase; letter-spacing: .08em;
}
.hm-field__label { font-size: 11px; }
.hm-h2 { font-size: 12px; color: var(--hm-muted); margin-bottom: 14px; }
.hm-h2 .hm-icon { color: inherit; font-size: 16px; }
.hm-btn, .hm-tab { font-size: 12px; }
.hm-badge, .hm-table th { font-size: 11px; }
.hm-dot { font-family: var(--hm-dot); font-weight: 700; letter-spacing: .02em; }

/* Fields: a single underline, like writing on a line (boxes only for multi-line text) */
.hm-input { border: 0; border-bottom: 1.5px solid var(--hm-control-border); border-radius: 0; background: transparent; padding-left: 2px; padding-right: 2px; }
.hm-input:hover { border-color: var(--hm-text); }
.hm-input:focus { border-color: var(--hm-text); box-shadow: inset 0 -1px 0 var(--hm-text); }
textarea.hm-input { border: 1px solid var(--hm-control-border); border-radius: var(--hm-radius-input); padding: 10px 12px; background: var(--hm-surface); }
textarea.hm-input:focus { box-shadow: inset 0 0 0 1px var(--hm-text); }

/* Navigation */
.hm-nav__brandname { font-family: var(--hm-dot); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: .04em; }
.hm-nav__brandname::after, .hm-brand span::after { content: '.'; color: var(--hm-accent); }
.hm-nav__fab { background: var(--hm-accent); color: var(--hm-accent-ink); box-shadow: none; border: 0; font-family: var(--hm-mono); font-weight: 400; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.hm-nav__fab:hover { box-shadow: none; filter: brightness(1.06); }
.hm-nav__item.is-current .hm-icon { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
@media (min-width: 641px) and (max-width: 1199px) {
  .hm-nav__label { font-family: var(--hm-mono); font-weight: 400; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
}
@media (min-width: 1200px) {
  .hm-nav__logo { display: none; }
}
@media (max-width: 640px) {
  .hm-nav { background: var(--hm-nav-bg); border-top: 1px solid var(--hm-border); }
  .hm-nav__label { font-family: var(--hm-mono); font-weight: 400; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
  .hm-nav__item.is-current .hm-nav__ind, .hm-nav__more[open] > summary .hm-nav__ind { background: none; color: var(--hm-text); }
  .hm-nav__item.is-current .hm-nav__label::after { content: ''; display: block; width: 4px; height: 4px; border-radius: 2px; background: var(--hm-accent); margin: 4px auto 0; }
}

/* Sign-in: wordmark on a dot grid */
body.hm-bare { background: var(--md-surface) radial-gradient(var(--md-outline-variant) 1px, transparent 1.2px) 0 0 / 18px 18px; }
.hm-brand { font-family: var(--hm-dot); font-weight: 800; font-size: 40px; line-height: 1; text-transform: uppercase; letter-spacing: .04em; }
.hm-brand .hm-icon { display: none; }
.hm-signin-card .hm-h1 { font-family: var(--hm-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--hm-muted); margin-bottom: 8px; }
.hm-signin-card .hm-input { border-radius: 0; padding-left: 2px; }
@media (max-width: 640px) { body.hm-bare { background: var(--md-surface); } }
