/* HostPortal — the core stylesheet for the client portal, the admin panel and the sign-in pages.

   Calm, warm neutrals; cards set apart by tone rather than borders; hairlines between rows; one
   brand colour for the way forward and amber only where something waits for the person. Figures,
   references and accounts are set in mono so they can be read back over the phone. The bank slip
   (.slip) is the one decorated object: it is how most of our clients pay.

   THEMES: everything here is drawn from the design tokens below and nothing else. A theme or a
   company's brand settings change the tokens (app/Services/Theming/Tokens.php is the contract,
   docs/themes.md the guide); the rules live in the `core` layer, so a theme's own stylesheet wins
   over them without fighting selectors. Edit this file only as part of HostPortal itself. */

@import url("/fonts/fonts.local.css");

@layer core {

/* ---------- tokens (theme API 1) ---------- */
:root {
  --ground: #f5f5f2;
  --surface: #ffffff;           /* Branding::CORE_LIGHT_SURFACE */
  --surface-2: #efefeb;
  --raised: #ffffff;
  --fill: rgba(28, 28, 20, .055);
  --fill-2: rgba(28, 28, 20, .1);
  --sep: rgba(28, 28, 20, .09);
  --sep-strong: rgba(28, 28, 20, .17);
  --ink: #17191b;
  --ink-2: #5c6064;
  --ink-3: #85898c;
  --ink-4: #c4c6c7;

  --accent: #0b6378;            /* Branding::CORE_ACCENT */
  --accent-ink: #ffffff;
  --accent-text: #0b6378;
  --accent-tint: color-mix(in srgb, var(--accent) 11%, transparent);
  --lens: color-mix(in srgb, var(--accent) 13%, transparent);
  --focus: var(--accent-text);  /* the keyboard focus ring and a focused field's edge */

  --green: #1c7a43;
  --amber: #965a00;
  --red: #b8322a;
  --blue: #2f5fa8;
  --violet: #6a4fb0;
  --attention: #f0a12b;
  --attention-ink: #2b1a00;

  --nav-bg: var(--ground);
  --nav-ink: var(--ink);
  --nav-ink-2: var(--ink-2);
  --nav-active: var(--lens);
  --nav-active-ink: var(--accent-text);
  --nav-indicator: transparent;
  --nav-sep: var(--sep);
  --topbar-bg: color-mix(in srgb, var(--ground) 82%, transparent);

  --brand-panel: color-mix(in srgb, var(--accent) 36%, #0a0e11);
  --brand-panel-ink: #ffffff;

  --art-ink: var(--ink);        /* text set over a theme's illustration */
  --art-wash: color-mix(in srgb, var(--surface) 82%, transparent);  /* laid over its upper part so that text reads */

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;
  --font-display: var(--font-body);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --display-weight: 700;
  --display-tracking: -0.025em;

  --radius: 16px;
  --radius-control: 10px;
  --radius-sm: 6px;
  --control-h: 38px;
  --sidebar-w: 248px;
  --page-w: 1180px;
  --card-edge: none;
  --shadow-pop: 0 18px 48px rgba(16, 16, 10, .14), 0 3px 10px rgba(16, 16, 10, .06), 0 0 0 .5px rgba(16, 16, 10, .08);

  /* worked out from the tokens above; not part of the theme API */
  --tint: 12%;
  --green-tint: color-mix(in srgb, var(--green) var(--tint), transparent);
  --amber-tint: color-mix(in srgb, var(--amber) var(--tint), transparent);
  --red-tint: color-mix(in srgb, var(--red) var(--tint), transparent);
  --blue-tint: color-mix(in srgb, var(--blue) var(--tint), transparent);
  --violet-tint: color-mix(in srgb, var(--violet) var(--tint), transparent);
  --row-hover: color-mix(in srgb, var(--ink) 3.5%, transparent);
  --radius-field: min(var(--radius-control), 12px);
  --ease: cubic-bezier(.2, .9, .25, 1);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23898c8f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* Dark: the same tokens again. Set by the person's choice, or by the device while "system". */
:root[data-appearance="dark"] {
  --ground: #111112;            /* Branding::CORE_DARK_GROUND */
  --surface: #1c1c1e;           /* Branding::CORE_DARK_SURFACE */
  --surface-2: #232325;
  --raised: #2a2a2d;
  --fill: rgba(255, 255, 245, .07);
  --fill-2: rgba(255, 255, 245, .12);
  --sep: rgba(255, 255, 245, .09);
  --sep-strong: rgba(255, 255, 245, .17);
  --ink: #f2f2ee;
  --ink-2: #a8aaac;
  --ink-3: #808386;
  --ink-4: #4a4c4f;
  --accent: #3c8293;
  --accent-ink: #ffffff;
  --accent-text: #5492a1;
  --green: #45c97b;
  --amber: #f0b04a;
  --red: #f2675f;
  --blue: #7ea8f0;
  --violet: #b49ff2;
  --brand-panel: color-mix(in srgb, var(--accent) 22%, #050708);
  --shadow-pop: 0 18px 48px rgba(0, 0, 0, .5), 0 3px 10px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(255, 255, 255, .1);
  --tint: 17%;
  --row-hover: color-mix(in srgb, var(--ink) 4%, transparent);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) {
    --ground: #111112;
    --surface: #1c1c1e;
    --surface-2: #232325;
    --raised: #2a2a2d;
    --fill: rgba(255, 255, 245, .07);
    --fill-2: rgba(255, 255, 245, .12);
    --sep: rgba(255, 255, 245, .09);
    --sep-strong: rgba(255, 255, 245, .17);
    --ink: #f2f2ee;
    --ink-2: #a8aaac;
    --ink-3: #808386;
    --ink-4: #4a4c4f;
    --accent: #3c8293;
    --accent-ink: #ffffff;
    --accent-text: #5492a1;
    --green: #45c97b;
    --amber: #f0b04a;
    --red: #f2675f;
    --blue: #7ea8f0;
    --violet: #b49ff2;
    --brand-panel: color-mix(in srgb, var(--accent) 22%, #050708);
    --shadow-pop: 0 18px 48px rgba(0, 0, 0, .5), 0 3px 10px rgba(0, 0, 0, .35), 0 0 0 .5px rgba(255, 255, 255, .1);
    --tint: 17%;
    --row-hover: color-mix(in srgb, var(--ink) 4%, transparent);
    color-scheme: dark;
  }
}

/* A logo drawn for dark grounds replaces the light one there. */
.for-dark { display: none !important; }
:root[data-appearance="dark"] .for-light { display: none !important; }
:root[data-appearance="dark"] .for-dark { display: inline-block !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-appearance="light"]) .for-light { display: none !important; }
  :root:not([data-appearance="light"]) .for-dark { display: inline-block !important; }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font-body);
  overflow-wrap: break-word;
  color: var(--ink);
  background: var(--ground);
  font-feature-settings: "tnum" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
svg.icon { flex: none; }
hr { border: 0; border-top: 1px solid var(--sep); margin: 20px 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-radius: var(--radius-sm); }
::selection { background: var(--lens); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--raised); color: var(--ink); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 80; }
.skip:focus { left: 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- type ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--ink); }
h1 { font-size: 26px; line-height: 1.15; margin: 0; }
h1 + p { margin-top: 8px; }
h2 { font-size: 16px; line-height: 1.3; margin: 0 0 12px; font-weight: 650; letter-spacing: -.012em; }
h3 { font-size: 14px; line-height: 1.35; margin: 0 0 8px; font-family: var(--font-body); font-weight: 650; letter-spacing: -.005em; }
p { margin: 0 0 12px; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 650; }
.regular { font-weight: 400; }
.big { font-size: 17px; }
.nowrap { white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; } /* text kept as it was typed, line breaks and all */
.right { text-align: right; }
.center { text-align: center; }
.text-red { color: var(--red); }
.text-amber { color: var(--amber); }
.text-green { color: var(--green); }
/* widths for a form or a card that reads better narrower than the page */
.narrow { max-width: 640px; }
.measure { max-width: 780px; }
.measure-wide { max-width: 1000px; }
.centered { margin-left: auto; margin-right: auto; }
.figure { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; line-height: 1.1; letter-spacing: calc(var(--display-tracking) - .005em); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow + :is(.pre, dl, ol, ul) { margin-top: 6px; }

/* ---------- brand lockup ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 16px; letter-spacing: -.015em; color: var(--nav-ink); text-decoration: none; }
.brand:hover { color: var(--nav-ink); }
.brand .logo { display: inline-block; max-height: 30px; max-width: 176px; width: auto; height: auto; }
.brand .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { flex: none; width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 55%, #ffffff), var(--accent)); box-shadow: inset 0 -7px 0 rgba(0, 0, 0, .14); }
.brand .tag { font-family: var(--font-body); font-size: 11px; font-weight: 650; letter-spacing: .04em; color: var(--nav-ink-2); background: var(--fill); border-radius: 999px; padding: 1px 8px; }

/* ---------- the shell: sidebar + content (portal and admin) ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--nav-bg); color: var(--nav-ink); box-shadow: inset -1px 0 0 var(--nav-sep);
  scrollbar-width: thin;
}
.sb-brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 4px; min-height: 40px; }
/* The logo, the account switcher and the person's menu stay put; only the menu between them scrolls
   (public/js/nav-scroll.js keeps where it was from page to page). The scroll box spans the sidebar's
   full width so the active item's marker is not clipped; the shades say there is more above or below. */
.sb-brand, .sidebar > .switcher, .sb-foot { flex: none; }
.sb-nav {
  position: relative; display: flex; flex-direction: column; gap: 1px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  margin: 0 -11px 0 -12px; padding: 2px 11px 2px 12px; /* the right edge stops short of the sidebar's hairline */
  background:
    linear-gradient(var(--nav-bg) 30%, transparent) center top / 100% 32px no-repeat local,
    linear-gradient(transparent, var(--nav-bg) 70%) center bottom / 100% 32px no-repeat local,
    linear-gradient(color-mix(in srgb, var(--nav-ink) 5%, transparent), transparent) center top / 100% 8px no-repeat scroll,
    linear-gradient(transparent, color-mix(in srgb, var(--nav-ink) 5%, transparent)) center bottom / 100% 8px no-repeat scroll;
}
.sb-group { padding: 14px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--nav-ink-2); opacity: .85; }
.sb-item {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; min-height: 34px; border-radius: var(--radius-control);
  color: var(--nav-ink); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .15s var(--ease);
}
.sb-item .icon { color: var(--nav-ink-2); }
.sb-item:hover { color: var(--nav-ink); background: color-mix(in srgb, var(--nav-ink) 6%, transparent); }
.sb-item.on { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 620; }
.sb-item.on .icon { color: currentColor; }
.sb-item.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-indicator); }
.sb-item > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--attention); color: var(--attention-ink); font: 700 11.5px/20px var(--font-body); text-align: center; font-variant-numeric: tabular-nums; }
/* The foot sits flush on the menu's scroll box (no flex gap) and its line spans the box's width, so the
   menu's bottom shade runs into that one line instead of drawing a second edge above it. */
.sb-foot { margin: -14px -11px 0 -12px; padding: 10px 11px 0 12px; box-shadow: inset 0 1px 0 var(--nav-sep); }

/* account switcher and the person's menu: <details> popovers */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.who-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; color: var(--nav-ink); min-width: 0; }
.menu > summary.who-row:hover, .menu[open] > summary.who-row { background: color-mix(in srgb, var(--nav-ink) 6%, transparent); }
.switcher > summary.who-row { background: color-mix(in srgb, var(--nav-ink) 5%, transparent); }
.who-row .txt { flex: 1; min-width: 0; line-height: 1.25; }
.who-row b { display: block; font-size: 13.5px; font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-row small { display: block; font-size: 12px; color: var(--nav-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-row .icon { color: var(--nav-ink-2); }
.avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--lens); color: var(--accent-text); font: 700 12px/1 var(--font-body); letter-spacing: .02em; text-transform: uppercase; }
.avatar.square { border-radius: 9px; background: var(--ink); color: var(--ground); }
.menu-pop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 220px;
  background: var(--raised); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-pop); padding: 6px;
  animation: pop-in .16s var(--ease);
}
.menu-pop.up { top: auto; bottom: calc(100% + 6px); }
.menu-pop.end { left: auto; right: 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-3px) scale(.985); } }
.menu-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--ink); font: 500 13.5px/1.3 var(--font-body); text-align: left; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--fill); color: var(--ink); }
.menu-item[aria-current="true"] { font-weight: 650; }
.menu-item .icon { color: var(--ink-3); }
.menu-item .tick { margin-left: auto; color: var(--accent-text); }
.menu-label { padding: 8px 10px 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.menu-sep { height: 1px; background: var(--sep); margin: 5px 4px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; padding: 6px 10px; font-size: 13px; color: var(--ink-2); }
.menu-pop form { margin: 0; }
.menu-label-inline { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 500; font-size: 13.5px; }
.menu-label-inline .icon { color: var(--ink-3); }

/* segmented control (appearance) */
.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-field); background: var(--fill); }
.segmented button { border: 0; background: none; color: var(--ink-2); font: 550 12.5px/1 var(--font-body); padding: 6px 10px; border-radius: calc(var(--radius-field) - 2px); cursor: pointer; }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px var(--sep); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  padding: calc(9px + env(safe-area-inset-top, 0px)) clamp(16px, 3vw, 36px) 9px;
  background: var(--topbar-bg); box-shadow: inset 0 -1px 0 var(--sep);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
}
.topbar .brand { color: var(--ink); }
.topbar.compact { display: none; }
.search { position: relative; flex: 1; max-width: 480px; margin: 0; }
.search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search input[type=search] { padding-left: 34px; padding-right: 46px; background: var(--fill); box-shadow: none; }
.search input[type=search]:focus { background: var(--surface); box-shadow: inset 0 0 0 1px var(--focus); }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
kbd { font: 600 11px/1 var(--font-mono); color: var(--ink-3); background: var(--surface); border-radius: 5px; padding: 3px 6px; box-shadow: 0 0 0 1px var(--sep); }
.page { --page-pad: clamp(16px, 3.2vw, 40px); width: 100%; max-width: calc(var(--page-w) + 2 * var(--page-pad)); margin: 0 auto; padding: 28px var(--page-pad) 64px; flex: 1; container: page / inline-size; }
.page.wide { max-width: 1480px; }
.page > form:not(.card) + * { margin-top: 24px; } /* a form of cards ends with its buttons: what follows (a delete card) starts clear of them */
.foot { padding: 18px clamp(16px, 3.2vw, 40px) calc(28px + env(safe-area-inset-bottom, 0px)); text-align: center; font-size: 12.5px; color: var(--ink-3); }
.foot a { color: var(--ink-2); }
.impersonation { background: var(--attention); color: var(--attention-ink); font-size: 13.5px; font-weight: 550; }
.impersonation .inner { padding: 8px clamp(16px, 3vw, 36px); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.impersonation .btn { background: rgba(255, 255, 255, .55); color: inherit; }
.iconbtn { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border: 0; border-radius: var(--radius-field); background: none; color: var(--ink-2); cursor: pointer; }
.iconbtn:hover { background: var(--fill); color: var(--ink); }
.navtoggle, .navclose { display: none; }
.scrim { display: none; }

/* ---------- the visitor's shell: top bar with the shop ---------- */
.site-top {
  position: sticky; top: 0; z-index: 30; background: var(--topbar-bg); box-shadow: inset 0 -1px 0 var(--sep);
  -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  padding-top: env(safe-area-inset-top, 0px);
}
.site-top .inner { max-width: calc(var(--page-w) + 2 * clamp(16px, 3.2vw, 40px)); margin: 0 auto; padding: 0 clamp(16px, 3.2vw, 40px); display: flex; align-items: center; gap: 26px; min-height: 60px; }
.site-top .brand { color: var(--ink); }
.mainnav { display: flex; gap: 2px; flex: 1; }
.mainnav a { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: var(--radius-control); font-weight: 550; font-size: 14px; white-space: nowrap; }
.mainnav a:hover { color: var(--ink); background: var(--fill); }
.mainnav a.on { color: var(--nav-active-ink); background: var(--nav-active); }
.mainnav .icon, .site-top .account .icon { width: 17px; height: 17px; }
.site-top .account { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.site-top .account > a:not(.btn) { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); text-decoration: none; padding: 7px 10px; border-radius: var(--radius-control); }
.site-top .account > a:not(.btn):hover { background: var(--fill); color: var(--ink); }

/* ---------- sign-in pages: brand panel + form ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth-brand {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: calc(36px + env(safe-area-inset-top, 0px)) clamp(28px, 4vw, 56px) 40px;
  background: var(--brand-panel); color: var(--brand-panel-ink);
}
.auth-brand .brand { color: var(--brand-panel-ink); font-size: 18px; }
.auth-brand .brand .tag { color: inherit; background: rgba(255, 255, 255, .14); }
.auth-brand .brand .logo { max-height: 34px; max-width: 200px; }
.auth-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.auth-brand.has-photo::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--brand-panel) 80%, transparent), color-mix(in srgb, var(--brand-panel) 20%, transparent) 45%, color-mix(in srgb, var(--brand-panel) 94%, transparent)); }
.auth-brand::before { content: ""; position: absolute; z-index: -1; width: 70vmin; height: 70vmin; right: -22vmin; bottom: -26vmin; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 55%, transparent), transparent 68%); opacity: .55; }
.auth-headline { font-family: var(--font-display); font-weight: var(--display-weight); font-size: clamp(34px, 4.2vw, 56px); line-height: 1.02; letter-spacing: -.04em; margin: 0 0 14px; color: inherit; max-width: 13ch; }
.auth-headline .dot { color: color-mix(in srgb, var(--accent) 60%, #ffffff); }
.auth-lead { font-size: 15px; line-height: 1.5; opacity: .78; max-width: 40ch; margin: 0; }
.auth-points { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 26px 0 0; padding: 18px 0 0; list-style: none; font-size: 13px; opacity: .82; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18); }
.auth-points li::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 60%, #ffffff); margin-right: 8px; vertical-align: 1px; }
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: calc(18px + env(safe-area-inset-top, 0px)) clamp(18px, 4vw, 48px) calc(18px + env(safe-area-inset-bottom, 0px)); }
.auth-top { display: flex; align-items: center; justify-content: flex-end; gap: 12px; min-height: 36px; }
.auth-body { flex: 1; display: grid; place-items: center; padding: 28px 0; }
.panel { width: 100%; max-width: 400px; }
.panel.wide { max-width: 640px; }
.panel h1 { font-size: 28px; margin-bottom: 6px; }
.lead { color: var(--ink-2); margin-bottom: 22px; font-size: 14.5px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--ink-3); }
.auth-foot a { color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12.5px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--sep); }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: var(--font-mono); font-size: 15px; background: var(--surface-2); border-radius: var(--radius-field); padding: 14px; }
/* error pages */
.standalone { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.standalone .card { width: 100%; max-width: 520px; }

/* ---------- page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head > div:first-of-type { min-width: 0; }
.page-head .crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.page-head .crumbs a { color: var(--ink-2); text-decoration: none; }
.page-head .crumbs a:hover { color: var(--ink); text-decoration: underline; }
.page-head .sub { color: var(--ink-2); margin-top: 5px; font-size: 14px; max-width: 72ch; }
/* a theme's scene behind the heading (Illustrations); without one the heading is drawn as above */
.page-head.has-art { position: relative; isolation: isolate; overflow: hidden; align-items: flex-start; align-content: flex-start; min-height: clamp(200px, 22vw, 280px); padding: clamp(20px, 3.2vw, 36px); border-radius: var(--radius); color: var(--art-ink); }
.page-head.has-art::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, var(--art-wash), transparent 75%); }
.page-art { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.page-head.has-art h1, .page-head.has-art .sub, .page-head.has-art .crumbs, .page-head.has-art .crumbs a { color: inherit; }
.page-head.has-art .btn:not(.primary) { background: var(--surface); color: var(--ink); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- views of one record (each its own page, linked like a segmented control) ---------- */
/* When the views do not fit the page, the strip scrolls sideways through the page's gutters to the window's edges,
   fading there, with the open view brought into sight (app.js): a view is never cut off inside the control. */
.views { --bleed: var(--page-pad, 0px); position: relative; display: flex; overflow-x: auto; margin: -4px calc(-1 * var(--bleed)) 22px; padding: 0 var(--bleed); scrollbar-width: none; overscroll-behavior-x: contain; -webkit-mask-image: linear-gradient(90deg, transparent, black var(--bleed), black calc(100% - var(--bleed)), transparent); mask-image: linear-gradient(90deg, transparent, black var(--bleed), black calc(100% - var(--bleed)), transparent); }
.views::-webkit-scrollbar { display: none; }
.views > .track { display: flex; flex: none; gap: 2px; padding: 3px; border-radius: calc(var(--radius-field) + 3px); background: var(--fill); }
.views a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--radius-field); color: var(--ink-2); text-decoration: none; font-weight: 550; font-size: 13.5px; white-space: nowrap; transition: background .15s var(--ease), color .15s; }
.views a:hover { color: var(--ink); }
.views a.on { color: var(--ink); background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 .5px var(--sep); }
.views .n { color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.views .icon { color: var(--ink-3); }
.views a.on .icon { color: var(--accent-text); }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-edge); padding: 20px; margin-bottom: 16px; }
.card > h2:first-child, .card > .card-head:first-child { margin-top: 0; }
/* Blocks that carry no margin of their own get 12px from whatever follows them, in a card and in the blocks that group
   content inside one (a form, a fieldset, a disclosure, a plain wrapper div), in a sign-in panel too... */
:is(.card, .card > div:not([class]), form, .panel, .fieldset, details) > :is(dl, table, .table-wrap, .pre, .slip, .actions, .form-actions, .row, .stack, .radio-cards, .grid, details, form, ul, ol, .meter, div:has(> .meter)) + :not(.meter, .hint, .error),
:is(.card, .card > div:not([class]), form, .panel, .fieldset, details) > .summary-line + :not(.summary-line, .meter, .hint, .error) { margin-top: 12px; }
/* ...a new section within a card starts further down than a paragraph does... */
.card > * + :is(h2, .card-head), .card > form > * + h2, .fieldset > * + h2 { margin-top: 22px; }
.card > * + h3, .card > form > * + h3 { margin-top: 16px; }
/* ...and nothing adds to the card's own padding at its end. */
.card > :last-child { margin-bottom: 0; }
/* In a flush card (a table to its edges), what sits under the table keeps the card's padding. */
.card.flush > :is(p, dl, .actions, .form-actions, form, .row, details, .hint, .pagination) { margin: 12px 20px 16px; }
.card.flush > table.totals { margin: 12px 20px 16px auto; }
.card-art { display: block; width: calc(100% + 40px); max-width: none; aspect-ratio: 3 / 1; margin: -20px -20px 20px; object-fit: cover; object-position: center 62%; border-radius: var(--radius) var(--radius) 0 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.attention { outline: 1.5px solid var(--amber); outline-offset: -1.5px; } /* something shown once, or that needs acting on now */
.card.flush > .card-head { padding: 16px 20px 6px; margin-bottom: 4px; }
.card.flush > .empty { padding-top: 26px; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.grid > :is(.card, .tile) { margin-bottom: 0; }
.grid > * { container-type: inline-size; } /* see dl.kv: a grid column can be narrower than a phone */
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.tight { gap: 6px; }
.row > .check { margin: 0; }
.row > .mono { min-width: 0; overflow-wrap: anywhere; } /* a token or address beside its Copy button breaks rather than spill */
/* a filter bar's form: a select as wide as its choice, a search box a comfortable width */
:is(.row, .filters) > select { width: auto; max-width: min(100%, 360px); }
.card-head > form { flex: 0 1 360px; }
:is(.row, .filters) > input[type=search] { width: 260px; max-width: 100%; }
.row:has(> details) { align-items: flex-start; } /* disclosures side by side: one opening pushes nothing down beside it */
/* labelled fields side by side with their button: the controls line up, the labels sit above them */
:is(.row, .filters, .form-actions, .actions):has(> .field) { align-items: flex-end; }
.row:has(> .field):not(:last-child) { margin-bottom: 16px; }
:is(.row, .filters, .form-actions, .actions) > .field { margin-bottom: 0; }
.row:has(> .field) > a { line-height: var(--control-h); }
/* a button beside a field is as tall as the field, whatever its size */
:is(.row, .filters, .form-actions, .actions, .input-group):has(> :is(input, select, .field)) > .btn { min-height: var(--control-h); }
.spacer { flex: 1; }

/* tiles: a number that matters, with what it is */
.tile { margin-bottom: 16px; position: relative; display: block; background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-edge); padding: 16px 18px 17px; text-decoration: none; color: inherit; transition: background .15s var(--ease); }
a.tile:hover { color: inherit; background-image: linear-gradient(var(--row-hover), var(--row-hover)); }
.tile .label { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.tile .figure { margin-top: 8px; }
.figure.sm { font-size: 20px; }
.tile .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.tile .meter, td > .meter { margin-top: 10px; }
.tile .label .icon { color: var(--ink-3); }
.tile .label.title { color: var(--ink); font-weight: 650; }
.tile.attention .label .icon { color: var(--amber); }
.tile.alert .label .icon { color: var(--red); }
.tile.attention .label:not(:has(.icon))::before, .tile.alert .label:not(:has(.icon))::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--attention); box-shadow: 0 0 0 3px color-mix(in srgb, var(--attention) 22%, transparent); }
.tile.alert .label:not(:has(.icon))::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.tile.attention .hint { color: var(--amber); }
.tile.alert .hint { color: var(--red); }

/* ---------- key/value ---------- */
dl.kv { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 9px 20px; margin: 0; }
dl.kv dt { color: var(--ink-2); font-size: 13.5px; }
dl.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
dl.kv + dl.kv { margin-top: 12px; }
/* In a side column too narrow for label and value side by side, they stack, as on a phone. */
@container (max-width: 340px) {
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
}

/* Data shown inside a value (a feed's answer, a logged body): short keys, so label and value stay side by side at
   every width, compact, instead of stacking as a page's own fields do on a phone. */
:is(dd, td, li) dl.kv.data { grid-template-columns: minmax(min-content, max-content) minmax(0, 1fr); gap: 3px 14px; font-size: 13px; }
:is(dd, td, li) dl.kv.data > dd { margin-bottom: 0; }
ol.data-items { margin: 0; padding-left: 18px; }
ol.data-items > li + li { margin-top: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th { text-align: left; font-weight: 600; font-size: 12px; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--sep); white-space: nowrap; }
table.data td { padding: 11px 12px; vertical-align: top; }
table.data tbody tr + tr > td { border-top: 1px solid var(--sep); }
@media (hover: hover) { table.data tbody tr:hover > td { background: var(--row-hover); } }
table.data td.num, table.data th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* A cell of a wide table of raw values (the WHMCS archive): one line, cut at the edge; the whole value is in the row's own view. */
table.data td.clip { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data td.act { text-align: right; white-space: nowrap; }
table.data a.rowlink { color: var(--ink); font-weight: 600; text-decoration: none; }
table.data a.rowlink:hover { color: var(--accent-text); text-decoration: underline; }
.card.flush table.data th:first-child, .card.flush table.data td:first-child { padding-left: 20px; }
.card.flush table.data th:last-child, .card.flush table.data td:last-child { padding-right: 20px; }
/* The state rail: a record's status, as a thin bar on its row. */
table.data tr[data-rail] > td:first-child { box-shadow: inset 3px 0 0 var(--rail, transparent); }
tr[data-rail="green"] { --rail: var(--green); }
tr[data-rail="orange"] { --rail: var(--attention); }
tr[data-rail="red"] { --rail: var(--red); }
tr[data-rail="blue"] { --rail: var(--blue); }
tr[data-rail="violet"] { --rail: var(--violet); }
tr[data-rail="grey"] { --rail: var(--ink-4); }
table.lines td { border-bottom: 1px solid var(--sep); }
table.totals { margin-left: auto; min-width: 280px; font-size: 14px; border-collapse: collapse; }
table.totals td { padding: 5px 0 5px 24px; }
table.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.totals tr.grand td { border-top: 2px solid var(--ink); font-weight: 700; padding-top: 9px; font-size: 16px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; white-space: nowrap; background: var(--fill); color: var(--ink-2); vertical-align: 1px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.green { background: var(--green-tint); color: var(--green); }
.badge.orange { background: var(--amber-tint); color: var(--amber); }
.badge.red { background: var(--red-tint); color: var(--red); }
.badge.blue { background: var(--blue-tint); color: var(--blue); }
.badge.violet { background: var(--violet-tint); color: var(--violet); }
.badge.plain::before { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 13.5px/1 var(--font-body); padding: 0 15px; min-height: var(--control-h);
  border: 0; border-radius: var(--radius-control); background: var(--fill); color: var(--ink);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s var(--ease), transform .12s var(--ease), box-shadow .15s;
}
.btn:hover { background: var(--fill-2); color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--accent-ink)); color: var(--accent-ink); }
.btn.danger { color: var(--red); background: var(--red-tint); }
.btn.danger:hover { background: color-mix(in srgb, var(--red) 20%, transparent); }
.btn.danger.solid { background: var(--red); color: #ffffff; }
.btn.danger.solid:hover { background: color-mix(in srgb, var(--red) 86%, #000000); }
.btn.ghost { background: transparent; color: var(--accent-text); padding-left: 9px; padding-right: 9px; }
.btn.ghost:hover { background: var(--accent-tint); }
.btn.sm { padding: 0 11px; min-height: 30px; font-size: 12.5px; }
.btn.lg { padding: 0 22px; min-height: 46px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn .icon { width: 1.15em; height: 1.15em; margin-left: -3px; }
.btn.ghost .icon, .btn:not(.primary):not(.danger) .icon { opacity: .85; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
form.inline { display: inline; }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.field .error, .error { color: var(--red); font-size: 13px; margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input[type=date], input[type=datetime-local], input[type=time], input[type=file], select, textarea {
  width: 100%; font: 14px/1.4 var(--font-body); color: var(--ink); background: var(--surface);
  border: 0; border-radius: var(--radius-field); box-shadow: inset 0 0 0 1px var(--sep-strong);
  padding: 8px 11px; min-height: var(--control-h); transition: box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; background-image: var(--chevron); background-repeat: no-repeat; background-position: right 11px center; }
input[type=file] { padding: 6px; }
input[type=file]::file-selector-button { font: 600 12.5px/1 var(--font-body); border: 0; border-radius: calc(var(--radius-field) - 3px); background: var(--fill); color: var(--ink); padding: 7px 11px; margin-right: 10px; cursor: pointer; }
input[type=color] { width: 46px; height: var(--control-h); padding: 3px; border: 0; border-radius: var(--radius-field); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep-strong); cursor: pointer; }
textarea { min-height: 110px; resize: vertical; }
textarea.code, input.code { font-family: var(--font-mono); font-size: 13px; }
input.amount { max-width: 9rem; text-align: right; font-variant-numeric: tabular-nums; }
/* A focused field shows it in its edge; checkboxes and radios take the keyboard ring like a button. */
input:where(:not([type=checkbox], [type=radio])):focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--focus); }
input[aria-invalid=true], select[aria-invalid=true], textarea[aria-invalid=true] { box-shadow: inset 0 0 0 1px var(--red); }
input[readonly] { background: var(--surface-2); }
.check, .field > label.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; font-weight: 400; margin-bottom: 10px; cursor: pointer; }
.check input { margin-top: 2px; width: 16px; height: 16px; flex: none; }
td.center > .check { justify-content: center; margin: 0; }
td > * + :is(.row, .actions, form:not(.inline)) { margin-top: 8px; }
a.radio-card { color: inherit; text-decoration: none; }
input[type=radio], input[type=checkbox] { accent-color: var(--accent); }
.radio-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-bottom: 16px; }
.field > .radio-cards { margin-bottom: 0; }
.field > :is(.radio-cards, .composer-box) ~ .hint { margin-top: 8px; }
.radio-cards.one { grid-template-columns: minmax(0, 1fr); }
.radio-card { position: relative; border-radius: calc(var(--radius) - 4px); padding: 12px 14px; cursor: pointer; background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep-strong); transition: box-shadow .15s, background .15s; }
.radio-card input { position: absolute; opacity: 0; }
.radio-card:hover { background-image: linear-gradient(var(--row-hover), var(--row-hover)); }
.radio-card:has(input:checked), a.radio-card.on { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.radio-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.radio-card .t { display: block; font-weight: 650; }
.radio-card .d { display: block; font-size: 12.5px; color: var(--ink-2); }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fieldset { border: 0; border-radius: calc(var(--radius) - 4px); box-shadow: inset 0 0 0 1px var(--sep); padding: 14px 16px 2px; margin: 0 0 18px; min-width: 0; }
.fieldset > legend { font-weight: 650; padding: 0 6px; font-size: 13.5px; }
.removed-note { font-size: 12.5px; color: var(--ink-3); background: var(--fill); border-radius: var(--radius-sm); padding: 7px 11px; margin: 0 0 16px; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.input-group { display: flex; }
.input-group input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-group .btn, .input-group select { border-top-left-radius: 0; border-bottom-left-radius: 0; width: auto; }
.input-group > .prefix { display: inline-flex; align-items: center; flex: none; padding: 0 10px; min-height: var(--control-h); font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-2); background: var(--fill); border-radius: var(--radius-field) 0 0 var(--radius-field); } /* fixed text the server puts in front of a name */
.input-group > .prefix + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > .prefix + input:last-child { border-top-right-radius: var(--radius-field); border-bottom-right-radius: var(--radius-field); }
.input-group > .suffix { display: inline-flex; align-items: center; flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; padding: 0 10px; min-height: var(--control-h); font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-2); background: var(--fill); border-radius: 0 var(--radius-field) var(--radius-field) 0; } /* fixed text after a name, such as @example.com */
.colour-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; } /* a group's colour beside its name */
.swatches { display: inline-flex; gap: 4px; vertical-align: -4px; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .16); }
.preview-logo { display: inline-flex; align-items: center; justify-content: center; min-width: 120px; min-height: 56px; padding: 10px 16px; border-radius: var(--radius-field); background: var(--surface-2); }
.preview-logo.dark { background: #16181a; }
.preview-logo img { max-height: 40px; max-width: 200px; }

/* ---------- messages ---------- */
.flash { position: relative; border-radius: 14px; padding: 12px 16px 12px 42px; margin-bottom: 18px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; color: var(--ink); background: color-mix(in srgb, var(--flash, var(--blue)) 11%, var(--surface)); }
.flash::before { content: ""; position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; background: var(--flash, var(--blue)); -webkit-mask: var(--flash-icon) center / contain no-repeat; mask: var(--flash-icon) center / contain no-repeat; }
.flash.ok { --flash: var(--green); --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7.5'/%3E%3Cpath d='m6.8 10.3 2.2 2.2 4.3-4.6'/%3E%3C/svg%3E"); }
.flash.error { --flash: var(--red); --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7.5'/%3E%3Cpath d='M10 6v4.6M10 13.6h.01'/%3E%3C/svg%3E"); }
.flash.info { --flash: var(--blue); --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='10' r='7.5'/%3E%3Cpath d='M10 9.2v4.6M10 6.4h.01'/%3E%3C/svg%3E"); }
.flash.warn { --flash: var(--amber); --flash-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 3 2.5 16h15z'/%3E%3Cpath d='M10 8.2v3.6M10 14.1h.01'/%3E%3C/svg%3E"); }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.flash.row { flex-wrap: wrap; }
.flash.stack { display: block; }
.flash.stack > * + * { margin-top: 8px; }
.empty { text-align: center; padding: 34px 20px; color: var(--ink-2); }
.empty::before { content: ""; display: block; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--fill) center / 20px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23898c8f' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11l2-7h10l2 7v5H3z'/%3E%3Cpath d='M3 11h4l1 2h4l1-2h4'/%3E%3C/svg%3E"); }
.empty.has-icon::before { display: none; }
.empty-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; background: var(--fill); color: var(--ink-3); }
.empty-art { display: block; width: 96px; height: 96px; margin: 0 auto 10px; object-fit: contain; }
.empty h3 { font-family: var(--font-display); font-size: 16px; color: var(--ink); margin-bottom: 4px; }
.empty p { max-width: 46ch; margin-left: auto; margin-right: auto; }
.empty .btn { margin-top: 8px; }

/* ---------- the bank slip (maksekorraldus) ---------- */
.slip { container-type: inline-size; position: relative; background: color-mix(in srgb, var(--accent) 4%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); border-radius: var(--radius); padding: 18px 20px 16px 32px; }
.slip::before { content: ""; position: absolute; left: 13px; top: 12px; bottom: 12px; border-left: 2px dashed color-mix(in srgb, var(--accent) 32%, transparent); }
.slip .slip-title { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -.012em; font-size: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; gap: 10px; }
.slip .slip-rows { display: grid; grid-template-columns: max-content 1fr; gap: 9px 16px; align-items: baseline; }
.slip .k { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.slip .v { font-family: var(--font-mono); font-size: 15px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; overflow-wrap: anywhere; }
.slip .v.amount { font-family: var(--font-display); font-size: 22px; font-weight: var(--display-weight); letter-spacing: -.015em; }
.slip .v.ref { font-size: 17px; font-weight: 600; color: var(--accent-text); }
@container (max-width: 440px) {
  .slip .slip-rows { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .slip .v { margin-bottom: 8px; }
}
.copy { font: 600 11.5px/1 var(--font-body); background: var(--accent-tint); color: var(--accent-text); border: 0; border-radius: var(--radius-sm); padding: 4px 8px; cursor: pointer; }
.copy:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.copy.done { background: var(--green-tint); color: var(--green); }

/* a part of a page that is not a card (a group of plans): set apart like one */
.section { margin-bottom: 28px; }
.preview-frame { display: block; width: 100%; height: 620px; border: 0; border-radius: var(--radius-sm); box-shadow: inset 0 0 0 1px var(--sep); background: #ffffff; }
.cf-turnstile { margin: 10px 0; }

/* ---------- order flow ---------- */
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; font-size: 13.5px; flex-wrap: wrap; }
.steps li { color: var(--ink-3); }
.steps li + li::before { content: "›"; margin-right: 6px; color: var(--ink-4); }
.steps li.on { color: var(--ink); font-weight: 650; }
ol.howto { margin: 0; padding-left: 22px; } /* instructions to follow, one step each */
ol.howto li { padding-left: 4px; line-height: 1.55; }
ol.howto li + li { margin-top: 10px; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 16px; }
.plan { background: var(--surface); border-radius: var(--radius); box-shadow: var(--card-edge); padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.plan h3 { font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: -.02em; font-size: 19px; margin: 0; }
.plan .price { font-family: var(--font-display); font-size: 28px; font-weight: var(--display-weight); letter-spacing: -.03em; }
.plan .price small { font-family: var(--font-body); font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.plan .desc { color: var(--ink-2); font-size: 14px; flex: 1; }
.desc ul { padding-left: 18px; margin: 6px 0; }
.desc p { margin: 0 0 6px; }
.domain-results { list-style: none; padding: 0; margin: 0; }
.domain-results li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; }
.domain-results li + li { border-top: 1px solid var(--sep); }
.domain-results .name { font-family: var(--font-mono); font-weight: 600; }
.summary-line { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; font-size: 14px; }
.summary-line + .summary-line { border-top: 1px solid var(--sep); }
.summary-line .what { min-width: 0; }
.summary-line .amt { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* the price beside the staff order form (admin.orders._price), redrawn as the form is filled in */
.order-price { align-self: start; position: sticky; top: calc(72px + env(safe-area-inset-top, 0px)); }
.order-price [data-price-panel] { transition: opacity .15s var(--ease); }
.order-price [data-price-panel][aria-busy="true"] { opacity: .55; }
.order-price .price-item + .price-item, .order-price .price-promo, .order-price table.totals { margin-top: 12px; }
.order-price .price-then { margin: 2px 0 0; }
.order-price .price-promo { display: flex; align-items: flex-start; gap: 6px; color: var(--green); }
.order-price .price-promo .icon { flex: none; margin-top: 1px; }
.order-price .price-problems { list-style: none; padding: 0; margin: 0; }
.order-price table.totals { min-width: 0; width: 100%; }
.order-price table.totals td:first-child { padding-left: 0; }
.order-price .form-actions { margin-top: 16px; }
table.totals.changed tr.grand td { animation: price-settle .5s var(--ease); }
@keyframes price-settle { from { color: var(--accent-text); opacity: .35; } }

/* ---------- tickets ---------- */
.thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.msg { border-radius: var(--radius); background: var(--surface); box-shadow: var(--card-edge); overflow: hidden; }
.msg .msg-head { display: flex; justify-content: space-between; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--sep); font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.msg .msg-head strong { color: var(--ink); }
.msg .msg-body { padding: 14px 18px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.msg.staff { box-shadow: var(--card-edge), inset 3px 0 0 var(--accent); }
.msg.note { background: color-mix(in srgb, var(--attention) 10%, var(--surface)); }
.msg .files { padding: 0 18px 12px; display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; }

/* a message in the limited HTML (App\Services\Support\SafeHtml) and the composer that writes it */
.msg .msg-body.rich, .composer-editor { white-space: normal; }
.rich > :first-child, .composer-editor > :first-child { margin-top: 0; }
.rich > :last-child, .composer-editor > :last-child { margin-bottom: 0; }
.rich p, .rich ul, .rich ol, .rich pre, .rich blockquote, .rich table,
.composer-editor p, .composer-editor ul, .composer-editor ol, .composer-editor pre, .composer-editor blockquote { margin: 0 0 10px; }
.rich ul, .rich ol, .composer-editor ul, .composer-editor ol { padding-left: 22px; }
.rich blockquote, .composer-editor blockquote { padding: 2px 0 2px 12px; box-shadow: inset 2px 0 0 var(--sep-strong); color: var(--ink-2); }
.rich code, .composer-editor code { font-family: var(--font-mono); font-size: .92em; background: var(--fill); border-radius: var(--radius-sm); padding: 1px 4px; }
.rich pre, .composer-editor pre { font-family: var(--font-mono); font-size: 13px; white-space: pre-wrap; background: var(--fill); border-radius: var(--radius-sm); padding: 8px 10px; }
.rich hr { border: 0; height: 1px; background: var(--sep); margin: 12px 0; }
.rich table { border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%; }
.rich td, .rich th { padding: 4px 8px; box-shadow: inset 0 0 0 .5px var(--sep); text-align: left; vertical-align: top; }
.rich a, .composer-editor a { color: var(--accent-text); overflow-wrap: anywhere; }
.composer [hidden] { display: none; }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; margin-bottom: 6px; }
.composer-head > label { font-weight: 600; font-size: 13.5px; }
.segmented label { display: inline-flex; align-items: center; color: var(--ink-2); font: 550 12.5px/1 var(--font-body); padding: 6px 10px; border-radius: calc(var(--radius-field) - 2px); cursor: pointer; }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:hover { color: var(--ink); }
.segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 0 .5px var(--sep); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.composer-box { border-radius: var(--radius-field); background: var(--surface); box-shadow: inset 0 0 0 1px var(--sep-strong); transition: box-shadow .15s; }
.composer-box:focus-within { box-shadow: inset 0 0 0 1px var(--focus); }
.composer-box[aria-invalid=true] { box-shadow: inset 0 0 0 1px var(--red); }
.composer-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--sep); }
.composer-tools .iconbtn { width: 32px; height: 32px; }
.composer-tools .iconbtn:hover, .composer-tools .iconbtn[aria-pressed="true"] { background: var(--fill); color: var(--ink); }
.composer-tools .sep { width: 1px; margin: 6px 3px; background: var(--sep); }
.composer-link { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-bottom: 1px solid var(--sep); }
.composer-link input { flex: 1 1 220px; min-height: 32px; }
.composer-editor { min-height: 180px; max-height: 60vh; overflow-y: auto; padding: 10px 12px; font: 14px/1.5 var(--font-body); color: var(--ink); outline: none; overflow-wrap: anywhere; }

/* suggestions under a field (public/js/suggest.js) */
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; z-index: 60; margin: 4px 0 0; padding: 6px; list-style: none; max-height: 290px; overflow-y: auto; background: var(--raised); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-pop); }
.suggest-list li { display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.suggest-list li small { color: var(--ink-3); font-size: 12px; }
.suggest-list li[aria-selected="true"], .suggest-list li:hover { background: var(--fill); }
.suggest-list li.none { color: var(--ink-3); cursor: default; background: none; }

/* ---------- misc ---------- */
.pagination { display: flex; gap: 4px; justify-content: center; align-items: center; margin: 16px 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 34px; padding: 7px 11px; border-radius: var(--radius-field); background: var(--fill); text-decoration: none; color: var(--ink); font-size: 13.5px; text-align: center; }
.pagination a:hover { background: var(--fill-2); }
.pagination .on { background: var(--ink); color: var(--ground); }
.pagination .off { color: var(--ink-3); background: transparent; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters a { padding: 5px 12px; border-radius: 999px; background: var(--fill); text-decoration: none; color: var(--ink-2); font-size: 13px; font-weight: 550; }
.filters a:hover { color: var(--ink); background: var(--fill-2); }
.filters a.on { background: var(--nav-active); color: var(--nav-active-ink); font-weight: 650; }
.filters form { margin-left: auto; }
.meter { height: 7px; border-radius: 4px; background: var(--fill); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.high > span { background: var(--attention); }
/* calm loading skeletons for server-backed lists */
.skeleton-list { padding: 8px 20px 18px; }
.skeleton-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }
.skeleton-row + .skeleton-row { border-top: 1px solid var(--sep); }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.skeleton-bar { display: block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--fill) 25%, var(--fill-2) 50%, var(--fill) 75%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skeleton-bar.w60 { width: 60%; max-width: 240px; }
.skeleton-bar.w40 { width: 40%; max-width: 170px; height: 10px; }
.skeleton-bar.w20 { width: 78px; height: 28px; border-radius: var(--radius-control); flex: none; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.qr { background: #ffffff; padding: 10px; border-radius: var(--radius-field); display: inline-block; box-shadow: inset 0 0 0 1px var(--sep); }
.qr svg { display: block; width: 180px; height: 180px; }
.pre.prose { font: 14.5px/1.5 var(--font-body); max-height: none; }
.pre { font-family: var(--font-mono); font-size: 12.5px; background: var(--surface-2); border-radius: var(--radius-field); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
details.more > summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 13.5px; list-style: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more[open] > summary { margin-bottom: 12px; }
:is(dd, td, p) > * + details.more, :is(dd, td, p) > * + details.more > summary { display: inline; }
:is(dd, td, p) > * + details.more > summary { margin-left: 8px; }
:is(dd, td, p) > * + details.more > :not(summary) { margin-top: 12px; }
.lang { display: inline-flex; gap: 2px; }
.lang a { color: inherit; text-decoration: none; padding: 2px 6px; border-radius: 5px; opacity: .7; font-weight: 550; }
.lang a:hover { opacity: 1; background: var(--fill); }
.lang a.on { opacity: 1; font-weight: 700; }
.footer-note { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 30px 20px 40px; }
.footer-note a { color: var(--ink-2); }

/* confirm dialog */
dialog.confirm { border: 0; border-radius: 20px; background: var(--raised); box-shadow: var(--shadow-pop); padding: 22px; max-width: 440px; width: calc(100% - 32px); color: var(--ink); }
dialog.confirm[open] { animation: pop-in .18s var(--ease); }
dialog.confirm::backdrop { background: rgba(10, 10, 11, .36); -webkit-backdrop-filter: blur(6px) saturate(150%); backdrop-filter: blur(6px) saturate(150%); }
dialog.confirm h2 { margin-bottom: 8px; font-size: 17px; }
dialog.confirm .form-actions { justify-content: flex-end; margin-top: 18px; }

/* ---------- narrow content: grids answer to the page's width (a menu beside it takes part of the window) ---------- */
@container page (max-width: 820px) {
  .grid.three, .grid.side { grid-template-columns: minmax(0, 1fr); }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-price { position: static; }
}
@container page (max-width: 600px) {
  .grid.two, .grid.four, .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  /* a page's actions under its heading: each row of buttons fills the width, a picker (the account) takes a row */
  .page-head > .actions { flex: 1 1 100%; }
  .page-head > .actions > :is(.btn, form.inline) { flex: 1 1 auto; }
  .page-head > .actions > form.inline > .btn { width: 100%; }
  .page-head > .actions > form:has(> select) { flex: 1 1 100%; flex-wrap: nowrap; }
  .page-head > .actions > form:has(> select) > select { flex: 1; max-width: none; }
  /* A table fits a phone: a column the page can do without (th/td.when-wide) goes rather than squeezing the others or
     hiding them sideways, cells sit closer, and a row's delete button is its icon (its words stay its accessible name). */
  table.data :is(th, td).when-wide { display: none; }
  table.data :is(th, td) { padding-left: 8px; padding-right: 8px; }
  .card.flush table.data :is(th, td):first-child { padding-left: 16px; }
  .card.flush table.data :is(th, td):is(:last-child, :not(.when-wide):not(:has(~ :not(.when-wide)))) { padding-right: 16px; }
  table.data td.act .btn:has(> .icon[data-icon="delete"]) { font-size: 0; gap: 0; padding: 0 9px; }
  table.data td.act .btn:has(> .icon[data-icon="delete"]) > .icon { width: 17px; height: 17px; margin: 0; }
}

/* ---------- small screens ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 70; transform: translateX(-104%); transition: transform .28s var(--ease); box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 8px 0 40px rgba(0, 0, 0, .28); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(0, 0, 0, .38); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar.open ~ .scrim { opacity: 1; pointer-events: auto; }
  .navtoggle, .navclose { display: inline-grid; }
  .topbar.compact { display: flex; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three, .grid.side { grid-template-columns: minmax(0, 1fr); }
  .order-price { position: static; }
  .search kbd { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { gap: 18px; padding: calc(22px + env(safe-area-inset-top, 0px)) 20px 24px; }
  .auth-headline { font-size: 30px; max-width: none; margin-bottom: 6px; }
  .auth-points { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input[type=date], input[type=datetime-local], input[type=time], select, textarea { min-height: 44px; }
  .btn { min-height: 44px; }
  .btn.sm { min-height: 34px; }
  :is(.row, .filters, .form-actions, .actions, .input-group):has(> :is(input, select, .field)) > .btn { min-height: 44px; }
  .site-top .inner { flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; padding-bottom: 6px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .page { padding-top: 20px; padding-bottom: 50px; }
  .grid.two, .grid.four, .form-row, .form-row.three { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 23px; }
  .panel h1 { font-size: 24px; }
  .card { padding: 16px; }
  .card-art { width: calc(100% + 32px); margin: -16px -16px 16px; aspect-ratio: 2 / 1; }
  .card.flush > .card-head { padding: 14px 16px 4px; }
  .card.flush > :is(p, dl, .actions, .form-actions, form, .row, details, .hint, .pagination) { margin-left: 16px; margin-right: 16px; }
  .card.flush > table.totals { margin-right: 16px; }
  .card.flush table.data th:first-child, .card.flush table.data td:first-child { padding-left: 16px; }
  .card.flush table.data th:last-child, .card.flush table.data td:last-child { padding-right: 16px; }
  dl.kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  dl.kv dd { margin-bottom: 8px; }
  .slip .slip-rows { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .slip .v { margin-bottom: 8px; }
  .figure { font-size: 24px; }
}
/* iOS zooms the page when a focused field's text is under 16px; touch screens of any width get 16px. */
@media (pointer: coarse) {
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=url], input[type=tel], input[type=date], input[type=datetime-local], input[type=time], select, textarea,
  textarea.code, input.code { font-size: 16px; }
}

/* A page printed to keep (a new mailbox's details): the page itself, without the menu and buttons. */
@media print {
  .shell { display: block; }
  .sidebar, .scrim, .topbar, .flash, .page-head .actions, .copy, .foot, .no-print { display: none !important; }
  .page { padding: 0; }
}

} /* @layer core */
