/*
 * Green Shift Group portal theme. Colours and type from greenshiftgroup.com (as in the reporting demo):
 * green #51A728 / #3F851E / #2C5F14, lime #92D050, Poppins. Mobile first.
 */

@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("assets/fonts/Poppins-Regular.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("assets/fonts/Poppins-Medium.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("assets/fonts/Poppins-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("assets/fonts/Poppins-Bold.ttf") format("truetype"); }

:root {
  --green: #51a728;
  --green-dark: #3f851e;
  --green-darker: #2c5f14;
  --lime: #92d050;
  --tint: #f1f7ec;
  --ink: #1b1f1d;
  --muted: #5f6360;
  --line: #e2e2e2;
  --page: #f5f6f4;
  --card: #ffffff;
  --amber: #b26a00;
  --amber-tint: #fff4e0;
  --red: #b42318;
  --red-tint: #fdecea;
  --focus: #ffd23f;
  --radius: 14px;
  --header-h: 64px;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Theme tokens: everything below that differs between light and dark. */
  --accent-text: var(--green-dark);
  --header-bg: rgb(255 255 255 / 96%);
  --input-bg: #ffffff;
  --line-strong: #b9bdb8;
  --shadow: rgb(0 0 0 / 8%);
  --planned-bg: #eef3fb;
  --planned-fg: #2c4d8f;
  --done-bg: #f0f0f0;
  --soon-accent: #cfe8b5;
  color-scheme: light;

}

/* Dark: chosen in the header (data-theme="dark"), or by the system when no choice was made. */
:root[data-theme="dark"] {
  --tint: #1e2a19; --ink: #e6eae4; --muted: #a2aaa3; --line: #2f3530; --line-strong: #4a524b;
  --page: #111412; --card: #1a1e1b; --amber-tint: #33270f; --amber: #f0b45a; --red: #f2786b; --red-tint: #3a1c19;
  --accent-text: #8fd46a; --header-bg: rgb(26 30 27 / 96%); --input-bg: #141815; --shadow: rgb(0 0 0 / 40%);
  --planned-bg: #1c2638; --planned-fg: #9db8ec; --done-bg: #262a27; --soon-accent: #4f6b3a;
  --qf-primary-hover: #4f9a2a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tint: #1e2a19; --ink: #e6eae4; --muted: #a2aaa3; --line: #2f3530; --line-strong: #4a524b;
    --page: #111412; --card: #1a1e1b; --amber-tint: #33270f; --amber: #f0b45a; --red: #f2786b; --red-tint: #3a1c19;
    --accent-text: #8fd46a; --header-bg: rgb(26 30 27 / 96%); --input-bg: #141815; --shadow: rgb(0 0 0 / 40%);
    --planned-bg: #1c2638; --planned-fg: #9db8ec; --done-bg: #262a27; --soon-accent: #4f6b3a;
    --qf-primary-hover: #4f9a2a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
}

a { color: var(--accent-text); }
h1, h2, h3 { line-height: 1.25; font-weight: 600; }
h1 { font-size: 1.6rem; margin: 0 0 0.35rem; }
h1, h2, h3 { color: var(--ink); }
h2 { font-size: 1.1rem; margin: 0 0 0.75rem; }
code { font-size: 0.85em; background: var(--tint); padding: 0.05em 0.35em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus { outline: none; } /* Blazor moves focus to the h1 on navigation, for screen readers. */

.skip-link { position: absolute; left: -999px; top: 0.5rem; z-index: 100; padding: 0.5rem 1rem; background: var(--focus); color: var(--ink); }
.skip-link:focus { left: 0.5rem; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
}
.site-header__inner { display: flex; align-items: center; gap: 1rem; height: var(--header-h); padding: 0 1rem; max-width: 90rem; margin: 0 auto; }
.brand img { display: block; height: 30px; width: auto; }
.site-header__product { display: none; padding-left: 1rem; border-left: 1px solid var(--line); color: var(--muted); font-size: 0.875rem; font-weight: 500; }
.site-header__tools { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
@media (min-width: 48rem) { .site-header__product { display: block; } }

.language { display: flex; padding: 3px; border-radius: 999px; background: var(--page); border: 1px solid var(--line); }
.language button { min-width: 2.5rem; min-height: 2rem; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 0.75rem/1 var(--font); letter-spacing: 0.06em; cursor: pointer; }
.language button[aria-pressed="true"] { background: var(--green-dark); color: #fff; }

.who { display: none; align-items: center; gap: 0.5rem; font-size: 0.875rem; font-weight: 500; }
.avatar { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--tint); color: var(--accent-text); font-size: 0.75rem; font-weight: 600; }
@media (min-width: 40rem) { .who { display: flex; } }
.sign-out { margin: 0; }
.sign-out .btn { white-space: nowrap; }
@media (max-width: 30rem) {
  .site-header__inner { gap: 0.5rem; padding: 0 0.75rem; }
  .site-header__tools { gap: 0.4rem; }
  .brand img { height: 24px; }
  .sign-out .btn { padding-inline: 0.6rem; }
}

/* ---- shell ---- */
.shell { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 90rem; margin: 0 auto; }
/* Narrow screens: the menu is a panel under the header, opened by the burger (menu.js). */
.sidenav { display: none; position: fixed; z-index: 15; left: 0; right: 0; flex-direction: column; gap: 0.15rem;
  max-height: calc(100dvh - var(--header-h)); overflow-y: auto; padding: 0.5rem 0.75rem 1rem;
  border-bottom: 1px solid var(--line); background: var(--card); box-shadow: 0 12px 24px rgb(0 0 0 / 0.18); }
.sidenav[data-open] { display: flex; }
.sidenav[data-open] .sidenav__section { display: block; }
.sidenav a { min-height: 2.75rem; }
.menu-toggle { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; margin-left: -0.5rem; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.menu-toggle:hover { background: var(--tint); }
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.15s, opacity 0.15s; }
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }
.sidenav a { padding: 0.45rem 0.8rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; white-space: nowrap; }
.sidenav a:hover { background: var(--tint); }
.sidenav a.active { background: var(--tint); color: var(--accent-text); box-shadow: inset 3px 0 0 var(--green); }
.sidenav__section { display: none; margin: 1rem 0.8rem 0.25rem; color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.content { flex: 1; min-width: 0; padding: 1.25rem 1rem 3rem; }
@media (min-width: 60rem) {
  .shell { flex-direction: row; }
  .sidenav, .sidenav[data-open] { display: flex; position: static; flex-direction: column; width: 15rem; flex-shrink: 0; max-height: none; border-bottom: 0; border-right: 1px solid var(--line); padding: 1.25rem 0.75rem; overflow: visible; box-shadow: none; }
  .sidenav a { min-height: 0; }
  .menu-toggle { display: none; }
  .sidenav__section { display: block; }
  .content { padding: 2rem 2.5rem 4rem; }
}

.footer { padding: 1rem; color: var(--muted); font-size: 0.8rem; text-align: center; border-top: 1px solid var(--line); background: var(--card); }
.footer p { margin: 0; }

/* ---- building blocks ---- */
.page-head { margin-bottom: 1.5rem; }
.page-head p { margin: 0; color: var(--muted); max-width: 48rem; }
.crumbs { font-size: 0.85rem; margin: 0 0 0.25rem !important; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.8125rem; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.5rem; padding: 0.45rem 1.1rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  font: 500 0.875rem/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--green); }
.btn--primary { background: var(--green-dark); border-color: var(--green-dark); color: #fff; }
.btn--primary:hover { background: var(--green-darker); }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--danger { background: #b42318; border-color: #b42318; color: #fff; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--muted); }

.badge { display: inline-block; margin: 0 0.25rem 0.25rem 0; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--tint); color: var(--accent-text); font-size: 0.75rem; font-weight: 500; }
.badge--amber { background: var(--amber-tint); color: var(--amber); }
.badge--red { background: var(--red-tint); color: var(--red); }

.notice { border-left: 4px solid var(--green); background: var(--tint); }
.notice--error { border-left-color: var(--red); background: var(--red-tint); color: var(--red); padding: 0.75rem 1rem; border-radius: 8px; }

/* ---- forms ---- */
input, select, textarea { font: inherit; color: var(--ink); min-height: 2.5rem; padding: 0.4rem 0.7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--input-bg); }
/* Native selects (macOS above all) ignore height and padding: draw our own, the same size as text fields. */
select {
  appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238a8f87' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
}
select[multiple] { background-image: none; padding-right: 0.7rem; }
input:focus, select:focus { border-color: var(--green); outline: 2px solid var(--focus); }
label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.filters, .inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.75rem; }
.inline-form { margin-top: 1rem; }
.check { flex-direction: row; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0; color: var(--ink); font-weight: 400; }
.check input { min-height: auto; }
.perm-group { border: 0; padding: 0; margin: 0 0 1rem; }
.perm-group legend { color: var(--ink); font-weight: 600; text-transform: capitalize; margin-bottom: 0.25rem; }
.perm-list { columns: 2 14rem; margin: 0; padding-left: 1.1rem; }

/* ---- tables ---- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 0.875rem; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--page); }
.table th, .table td { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.table .is-disabled td { color: var(--muted); }
.card .table { border: 0; }
.change .before { text-decoration: line-through; color: var(--muted); }
@media (max-width: 40rem) { .table { display: block; overflow-x: auto; } }

/* ---- pages ---- */
.tiles, .role-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.tile { position: relative; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.tile h2 { margin-bottom: 0.35rem; }
.tile p { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.875rem; }
.tile--soon { border-top-color: var(--lime); }
.role-card { display: block; color: inherit; text-decoration: none; }
.role-card:hover { border-color: var(--green); }
.role-card p { margin: 0 0 0.5rem; }

.sign-in { max-width: 28rem; margin: 3rem auto; text-align: center; }
.sign-in .btn--primary { margin: 1rem 0; }
.dev-users { list-style: none; padding: 0; display: grid; gap: 0.5rem; }
.dev-users form { margin: 0; }
.dev-users .btn { width: 100%; justify-content: space-between; }

#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; z-index: 1000; padding: 0.75rem 1rem; background: var(--amber-tint); color: var(--ink); box-shadow: 0 -1px 4px rgb(0 0 0 / 15%); }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ---- registers ---- */
.page-head--actions { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.form-grid { display: grid; gap: 0.9rem 1rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid textarea { font: inherit; min-height: 5rem; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: 10px; }
.form-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1rem; }
.field-error { color: var(--red); font-size: 0.75rem; font-weight: 500; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.25rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.8125rem; }
.facts dd { margin: 0; }
.columns { display: grid; gap: 1rem; }
@media (min-width: 70rem) { .columns { grid-template-columns: 2fr 1fr; align-items: start; } }
.status { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status--planned { background: var(--planned-bg); color: var(--planned-fg); }
.status--active { background: var(--tint); color: var(--accent-text); }
.status--completed { background: var(--done-bg); color: var(--muted); }
.status--cancelled { background: var(--red-tint); color: var(--red); }
.toggle { flex-direction: row; align-items: center; gap: 0.4rem; color: var(--ink); }
.toggle input { min-height: auto; }
.pager { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; color: var(--muted); font-size: 0.875rem; }

.typeahead { position: relative; }
.typeahead input { width: 100%; padding-right: 2rem; }
.typeahead__clear { position: absolute; right: 0.4rem; top: 0.45rem; border: 0; background: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; }
.typeahead__list { position: absolute; z-index: 30; left: 0; right: 0; margin: 0.25rem 0 0; padding: 0.25rem; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px var(--shadow); max-height: 18rem; overflow: auto; }
.typeahead__list li { padding: 0.45rem 0.6rem; border-radius: 6px; cursor: pointer; font-size: 0.875rem; }
.typeahead__list li.is-active, .typeahead__list li:hover { background: var(--tint); }

.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history__head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; }
.team { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.team li { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.team li .btn { margin-left: auto; min-height: 2rem; }
fieldset.form-grid { border: 0; padding: 0; margin: 0; min-width: 0; }
.tile h2 a { color: inherit; text-decoration: none; }
/* The whole box is the link: the title's link stretches over the tile. */
.tile h2 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tile:has(h2 a):hover { border-color: var(--green); box-shadow: 0 2px 10px var(--shadow); }
.tile:has(h2 a):hover h2 a { color: var(--accent-text); text-decoration: underline; }
.tile h2 a:focus-visible { outline: none; }
.tile h2 a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- demo banner (Demo environment only) ---- */
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.25rem 0.75rem;
  padding: 0.45rem 1rem; background: repeating-linear-gradient(-45deg, #ffd23f, #ffd23f 14px, #ffdc66 14px, #ffdc66 28px);
  color: #1b1f1d; font-size: 0.8125rem; text-align: center; border-bottom: 1px solid #c9a200;
}
.demo-banner strong { padding: 0.05rem 0.55rem; border-radius: 4px; background: #1b1f1d; color: #ffd23f; letter-spacing: 0.12em; }

/* ---- dot icons (GSG logo style) ---- */
.dot-icon { flex-shrink: 0; }
.dot-icon__dot { fill: var(--green); }
.dot-icon__accent { fill: var(--lime); }
.sidenav a { display: flex; align-items: center; gap: 0.6rem; }
.sidenav a .dot-icon { opacity: 0.85; }
.sidenav a.active .dot-icon__dot { fill: var(--accent-text); }
.tile__icon { display: block; margin-bottom: 0.6rem; }
.tile--soon .tile__icon .dot-icon__dot { fill: var(--lime); }
.tile--soon .tile__icon .dot-icon__accent { fill: var(--soon-accent); }

/* ---- theme switch ---- */
.theme { margin: 0; }
.theme button { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--line); border-radius: 999px; background: var(--page); color: var(--muted); cursor: pointer; }
.theme button:hover { color: var(--accent-text); border-color: var(--green); }
.theme svg { width: 16px; height: 16px; }
/* quillflow's forms in the portal's look and theme. quillflow.css sets these on qf-form; this file loads after it. */
qf-form {
  color: var(--ink);
  --qf-font: var(--font);
  --qf-text: var(--ink);
  --qf-muted: var(--muted);
  --qf-border: var(--line-strong);
  --qf-background: var(--input-bg);
  --qf-secondary: var(--tint);
  --qf-primary: var(--green-dark);
  --qf-primary-hover: var(--green-darker);
  --qf-error: var(--red);
  --qf-focus: var(--focus);
  --qf-radius: 10px;
}
:root[data-theme="dark"] qf-form { --qf-primary-hover: #4f9a2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) qf-form { --qf-primary-hover: #4f9a2a; } }

/* ---- time ---- */
.week-nav { display: flex; align-items: center; gap: 0.75rem; text-align: center; }
.week-nav .btn { min-width: 2.5rem; justify-content: center; }
.time-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 0.6rem; }
.time-day--empty { opacity: 0.7; }
.time-day h3 { display: flex; justify-content: space-between; margin: 0; font-size: 0.875rem; }
.time-day h3 > span:first-child { text-transform: capitalize; }
/* On a phone the timer and the add form come first; the week follows. */
@media (max-width: 70rem) { .time-layout > :last-child { order: -1; } }
.time-entry { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0 0.2rem; border-top: 1px solid var(--line); margin-top: 0.5rem; }
.time-entry__hours { min-width: 3rem; font-size: 1.15rem; font-weight: 600; color: var(--accent-text); text-align: right; }
.time-entry__what { flex: 1; min-width: 0; }
.time-entry--running .time-entry__hours { color: var(--amber); }
.timer--running { border-color: var(--green); }
.timer__clock { font-size: 2.4rem; font-weight: 600; margin: 0 0 0.25rem; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.link-button { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.link-button:hover { color: var(--accent-text); text-decoration: underline; }
@media (max-width: 40rem) { .time-entry__hours { min-width: 2.5rem; font-size: 1rem; } }

/* ---- expenses ---- */
.segmented { display: inline-flex; padding: 3px; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 999px; background: var(--page); }
.segmented button { border: 0; border-radius: 999px; padding: 0.45rem 1rem; background: transparent; color: var(--muted); font: 600 0.8125rem/1 var(--font); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--green-dark); color: #fff; }
.expense { display: grid; gap: 0.4rem; }
.expense__head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.expense__amount { font-size: 1.15rem; font-weight: 600; white-space: nowrap; color: var(--accent-text); }
.expense__receipt { max-width: 100%; max-height: 220px; border-radius: 8px; border: 1px solid var(--line); }
.expense__foot { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.expense__comment { flex: 1; min-width: 12rem; }
.expense-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); }
input[type="file"] { padding: 0.4rem; }

/* ---- bookkeeping ---- */
.export-request summary { cursor: pointer; font-variant-numeric: tabular-nums; color: var(--accent-text); font-weight: 600; }
.nowrap { white-space: nowrap; }
.export-request pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 30rem; max-height: 20rem; overflow: auto; margin: 0.5rem 0 0; padding: 0.75rem; border-radius: 8px; background: var(--page); font-size: 0.75rem; }

/* ---- AI connections ---- */
.mcp-address { display: inline-block; padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--page); border: 1px solid var(--line); font-size: 0.95rem; user-select: all; overflow-wrap: anywhere; }

/* ---- help ---- */
.help-link { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1px solid var(--line); background: var(--page); color: var(--accent-text); font-weight: 700; text-decoration: none; }
.help-link:hover { background: var(--tint); }

/* The help index: a header band with the search, then the pages as tiles. */
.help-hero { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1.75rem; padding: 1.5rem; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--tint), var(--card) 70%); border: 1px solid var(--line); }
.help-hero h1 { margin: 0 0 0.25rem; }
.help-hero p { margin: 0; color: var(--muted); max-width: 44rem; }
.help-hero__icon { margin-top: 0.2rem; }
.help-search { display: grid; gap: 0.3rem; max-width: 30rem; margin-top: 1rem; font-size: 0.8125rem; font-weight: 600; }
.help-search input { width: 100%; font-size: 1rem; padding: 0.65rem 0.9rem; border-radius: 999px; }
.help-section-title { font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0 0 0.75rem; }
.help-admin { margin-top: 2rem; }
.help-admin .help-section-title { margin-bottom: 0.15rem; }
.help-admin > p { margin: 0 0 0.75rem; }

.help-tiles, .help-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.help-results { grid-template-columns: 1fr; max-width: 48rem; }
.help-tile { position: relative; display: flex; gap: 0.85rem; align-items: flex-start; padding: 1rem 1.1rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.help-tile p { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.875rem; line-height: 1.5; }
.help-tile__icon { margin-top: 0.1rem; }
.help-tile__title { font-weight: 600; color: var(--ink); text-decoration: none; }
/* The whole tile is the link. */
.help-tile__title::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.help-tile:hover { border-color: var(--green); box-shadow: 0 4px 14px var(--shadow); transform: translateY(-1px); }
.help-tile:hover .help-tile__title { color: var(--accent-text); }
.help-tile__title:focus-visible { outline: none; }
.help-tile__title:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.help-tile--lead { grid-column: 1 / -1; padding: 1.25rem 1.4rem; border-left: 5px solid var(--green); background: linear-gradient(90deg, var(--tint), var(--card) 60%); }
.help-tile--lead .help-tile__title { font-size: 1.15rem; }
.help-tiles--compact { gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.help-tiles--compact .help-tile { padding: 0.65rem 0.85rem; align-items: center; }
.help-tiles--compact .help-tile__title { font-size: 0.9375rem; }
.help-results mark { background: color-mix(in srgb, var(--lime) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 0.1em; }

/* A manual page. */
.help-crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.9rem; color: var(--muted); }
.help-crumbs a { color: var(--accent-text); }
.help-page { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 64rem) { .help-page--toc { grid-template-columns: minmax(0, 46rem) 15rem; } }
.help-article { max-width: 46rem; padding: 1.75rem 2rem 2rem; line-height: 1.7; font-size: 0.975rem; }
.help-article__icon { display: block; margin-bottom: 0.75rem; }
.help-article h1 { margin: 0 0 0.75rem; font-size: 1.75rem; line-height: 1.25; }
/* The opening paragraph says what the page is about. */
.help-article h1 + p { font-size: 1.075rem; color: var(--ink); margin-bottom: 1.25rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.help-article h2 { margin: 2rem 0 0.6rem; font-size: 1.2rem; display: flex; align-items: center; gap: 0.55rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.help-article h2::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--green); box-shadow: 0.75rem 0 0 var(--lime); margin-right: 0.75rem; flex-shrink: 0; }
.help-article h3 { margin: 1.5rem 0 0.4rem; font-size: 1rem; color: var(--accent-text); }
.help-article p { margin: 0 0 0.9rem; }
/* Paragraphs that open in bold ("Connect:", "Returned?") are the page's topics, with anchors for "On this page". */
.help-article .help-topic { padding: 0.15rem 0 0.15rem 1rem; border-left: 3px solid var(--soon-accent); scroll-margin-top: calc(var(--header-h) + 1rem); transition: background 0.3s; }
.help-article .help-topic > strong:first-child { color: var(--accent-text); }
.help-article .help-topic:target { background: var(--tint); border-left-color: var(--green); border-radius: 0 8px 8px 0; }
.help-article a { color: var(--accent-text); text-underline-offset: 0.18em; }
.help-article ul, .help-article ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.help-article ul { list-style: none; padding-left: 1.2rem; }
.help-article ul > li { position: relative; }
.help-article ul > li::before { content: ""; position: absolute; left: -1rem; top: 0.68em; width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--green); }
.help-article ul ul > li::before { background: var(--lime); }
.help-article ol > li::marker { color: var(--accent-text); font-weight: 600; }
.help-article li + li { margin-top: 0.35rem; }
.help-article blockquote { margin: 1.25rem 0; padding: 0.8rem 1rem 0.8rem 1.1rem; border-left: 4px solid var(--green); border-radius: 0 10px 10px 0; background: var(--tint); }
.help-article blockquote p:last-child { margin-bottom: 0; }
.help-article hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.help-article code { padding: 0.1rem 0.4rem; border-radius: 6px; background: var(--page); border: 1px solid var(--line); font-size: 0.85em; }
.help-article pre { padding: 0.9rem 1rem; border-radius: 10px; background: var(--page); border: 1px solid var(--line); overflow-x: auto; line-height: 1.5; }
.help-article pre code { padding: 0; background: none; border: 0; }
.help-article table { border-collapse: separate; border-spacing: 0; margin: 1.25rem 0; display: block; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; font-size: 0.9rem; }
.help-article th, .help-article td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.help-article th { background: var(--tint); font-weight: 600; }
.help-article tr:last-child td { border-bottom: 0; }
.help-article tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--page) 60%, transparent); }

.help-toc { position: sticky; top: calc(var(--header-h) + 1rem); padding: 1rem 1.1rem; border-left: 3px solid var(--line); font-size: 0.875rem; }
.help-toc__title { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.help-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.help-toc a { color: var(--ink); text-decoration: none; }
.help-toc a:hover { color: var(--accent-text); text-decoration: underline; }
@media (max-width: 63.99rem) { .help-toc { position: static; border-left: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); order: -1; } }

.help-pager { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.85rem; max-width: 46rem; margin-top: 1.25rem; }
.help-pager__link { display: grid; gap: 0.15rem; padding: 0.85rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; }
.help-pager__link:hover { border-color: var(--green); color: var(--accent-text); }
.help-pager__link--next { text-align: right; grid-column: -2; }
@media (max-width: 40rem) {
  .help-hero { flex-direction: column; padding: 1.1rem; }
  .help-article { padding: 1.25rem 1.1rem 1.5rem; }
  .help-article h1 { font-size: 1.45rem; }
  .help-pager__link--next { grid-column: auto; }
}
@media (max-width: 30rem) { .help-link { width: 2rem; height: 2rem; } }

/* ---- orders ---- */
.status--draft { background: var(--done-bg); color: var(--muted); }
.status--sent { background: var(--planned-bg); color: var(--planned-fg); }
.status--expired, .status--declined { background: var(--amber-tint); color: var(--amber); }
.status--accepted { background: var(--tint); color: var(--accent-text); }
.status--invoiced { background: var(--green-dark); color: #fff; }
.table .right, .table th.right { text-align: right; }
.table-wrap { overflow-x: auto; }
.order-lines input { width: 100%; }
.order-lines .is-editing td { background: var(--tint); }
.order-lines tfoot td { border-bottom: 0; color: var(--muted); }
.table tfoot .total td, .order-lines tfoot .total td { color: var(--ink); font-weight: 600; border-top: 2px solid var(--green); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { padding-inline: 0.5rem; }
.num-input { width: 7rem; text-align: right; }
.small-input { width: 6rem; }
.inline-form .grow { flex: 1 1 16rem; }
.order-add { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.order-add details, .new-job, .new-invoice { margin-top: 1rem; }
details > summary { cursor: pointer; font-weight: 600; color: var(--accent-text); }
.order-dialog { border-left: 4px solid var(--green); }
.line-picks { border: 0; padding: 0; margin: 1rem 0 0; display: grid; gap: 0.35rem; }
.line-picks legend { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.35rem; }
.sums { display: grid; grid-template-columns: max-content auto; gap: 0.25rem 1.5rem; margin: 0 0 1rem; }
.sums dt { color: var(--muted); }
.sums dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.versions .is-selected { padding-left: 0.6rem; border-left: 3px solid var(--green); }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-align: left; }
button.link:hover { text-decoration: underline; }
.pre { white-space: pre-line; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- demo mailbox ---- */
.mail__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.mail__body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 0.875rem; }
