/*
 * Design system of the app. The brand colour comes from the tenant's branding as --brand (set on <html>);
 * everything else is neutral so any business colour works.
 */

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("/fonts/inter-latin-wght-normal-8e433c0592f77beb6dc527d7b90be120.woff2") format("woff2");
}

:root {
    --brand: #1F6B4A;
    --brand-soft: color-mix(in srgb, var(--brand) 9%, white);
    --brand-line: color-mix(in srgb, var(--brand) 25%, white);
    --brand-ink: color-mix(in srgb, var(--brand) 78%, black);
    --ink: #18201C;
    --muted: #5A6560;
    --faint: #8A948F;
    --line: #E2E6E3;
    --field: #CDD3CF;
    --ground: #F4F6F5;
    --surface: #FFFFFF;
    --hover: #FAFBFA;
    --amber-bg: #FDF1DE;
    --amber: #8A4B08;
    --blue-bg: #E6EEFB;
    --blue: #1E4FB8;
    --red-bg: #FDE8E7;
    --red: #A52A1F;
    --danger: #B42318;
    --gray-bg: #ECEFED;
    --gray: #47514C;
    --radius: 12px;
    --radius-sm: 8px;
    /* Motion: short and calm; only opacity, transform and colours move, never the layout */
    --dur-fast: 120ms;
    --dur-base: 180ms;
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-in: cubic-bezier(0.4, 0, 1, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--ground);
}

a { color: var(--brand); }
a:hover { color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

h1 { font-size: 28px; line-height: 1.2; margin: 0; letter-spacing: -0.015em; }
h2 { font-size: 16px; line-height: 1.3; margin: 0; }
p { margin: 0; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 18px; height: 18px; flex: none; }

/* ---------- App shell ---------- */

.app { display: flex; flex-wrap: wrap; min-height: 100vh; }

.side {
    flex: 1 1 248px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-name { font-weight: 700; line-height: 1.25; }
.logo {
    width: 40px; height: 40px; border-radius: 10px; flex: none;
    background: var(--brand); color: #fff; font-weight: 700;
    display: grid; place-items: center;
}
.logo img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 0 12px; min-height: 44px; border-radius: var(--radius-sm);
    color: var(--ink); text-decoration: none; font-weight: 500;
}
.nav a:hover { background: var(--ground); color: var(--ink); }
.nav a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.count {
    margin-left: auto; background: var(--brand); color: #fff;
    border-radius: 999px; font-size: 12px; font-weight: 600; padding: 1px 8px;
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.user { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.user form { margin: 0; }

.main {
    flex: 999 1 560px;
    min-width: 0;
    padding: 32px 40px 64px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head .sub { margin-top: 4px; color: var(--muted); }

.crumbs { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.crumbs a { text-decoration: none; }

/* Wide screen: the menu is always open, the button is not needed */
.side-menu { display: contents; }
.menu-toggle { display: none; }

@media (max-width: 860px) {
    /* Phone: a slim bar on top; the menu button unfolds navigation and account below it */
    .side {
        flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0;
        position: sticky; top: 0; z-index: 20; padding: 8px 16px;
        border-right: 0; border-bottom: 1px solid var(--line);
    }
    .brand .logo { width: 36px; height: 36px; }
    .brand .muted { display: none; }
    .menu-toggle {
        display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
        min-width: 44px; min-height: 44px; padding: 0 10px; border: 0; border-radius: var(--radius-sm);
        background: transparent; color: var(--ink); cursor: pointer;
    }
    .menu-toggle .count { margin-left: 0; }
    .side-menu { display: none; flex: 1 1 100%; flex-direction: column; gap: 12px; padding: 12px 0 8px; }
    .side.open .side-menu { display: flex; animation: enter var(--dur-base) var(--ease-out); }
    .side-foot { margin-top: 0; }
    .main { padding: 20px 16px 48px; }
    h1 { font-size: 24px; }
}

/* ---------- Avatars ---------- */

.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    background: var(--ground); color: var(--muted);
    font-weight: 600; font-size: 14px;
    display: grid; place-items: center;
}
.avatar-sm { width: 36px; height: 36px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-brand { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Cards ---------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card-head {
    padding: 16px 20px; border-bottom: 1px solid var(--line);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
}
.card-body { padding: 20px; }
.card-foot { padding: 16px 20px; border-top: 1px solid var(--line); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 20px; }
.layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.layout-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.layout-aside { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------- KPIs ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { color: var(--muted); font-size: 14px; font-weight: 500; }
.kpi-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kpi-note { color: var(--muted); font-size: 13px; }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    border: 1px solid var(--field); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: #AEB7B2; color: var(--ink); }
.btn-sm { min-height: 44px; padding: 0 14px; }
.btn-icon { padding: 0 12px; }
.btn-block { width: 100%; }
.btn-dashed { border-style: dashed; font-weight: 500; justify-content: flex-start; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #912018; border-color: #912018; color: #fff; }
.btn .icon, .btn .icon-sm { width: 18px; height: 18px; }
.btn.active { border-color: var(--brand); color: var(--brand-ink); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.icon-btn {
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: var(--radius-sm); border: 0; background: transparent;
    color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--ground); color: var(--red); }

.link-btn {
    border: 0; background: none; padding: 0; font: inherit; font-weight: 500;
    color: var(--brand); cursor: pointer; text-decoration: underline;
}

/* ---------- Badges, chips, tags ---------- */

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; padding: 3px 10px;
    border-radius: 999px; white-space: nowrap;
}
/* Badge colours mean the same everywhere: owner has to act (amber), running or waiting for others (blue), done
   (green), neutral (grey), late or a problem (red), new (solid) */
.b-owner { background: var(--amber-bg); color: var(--amber); }
.b-customer { background: var(--blue-bg); color: var(--blue); }
.b-done { background: var(--brand-soft); color: var(--brand-ink); }
.b-neutral { background: var(--gray-bg); color: var(--gray); }
.b-late { background: var(--red-bg); color: var(--red); }
.b-new { background: var(--brand); color: #fff; }

.tag { font-size: 13px; color: var(--muted); background: var(--ground); border-radius: 6px; padding: 2px 8px; }
.chip-miss {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--amber-bg); color: var(--amber);
    font-size: 13px; font-weight: 600; border-radius: 6px; padding: 2px 8px;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    min-height: 40px; padding: 0 14px; border-radius: 999px;
    border: 1px solid var(--field); background: var(--surface);
    font: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
    text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.chip:hover { color: var(--ink); border-color: #AEB7B2; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip span { font-size: 12px; opacity: 0.75; }

/* ---------- Forms ---------- */

label { font-weight: 500; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
input, select, textarea {
    font: inherit; color: var(--ink);
    border: 1px solid var(--field); border-radius: var(--radius-sm);
    padding: 9px 12px; background: var(--surface); min-height: 44px; width: 100%;
}
textarea { line-height: 1.55; resize: vertical; }
input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand); }

.inline-input { border-color: transparent; background: transparent; font-weight: 600; padding-left: 6px; }
.inline-input:hover { border-color: var(--field); }

.search { position: relative; flex: 0 1 340px; min-width: 220px; }
.search input { padding-left: 40px; }
.search .icon-sm { position: absolute; left: 12px; top: 13px; color: var(--muted); }

.form-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }

/* ---------- Alerts ---------- */

.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-info { background: var(--blue-bg); color: var(--blue); }
.alert-success { background: var(--brand-soft); color: var(--brand-ink); }
.alert-warn { background: var(--amber-bg); color: var(--amber); }

/* A list without bullets, e.g. the people on a job */
.plain-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }

.notice {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 20px;
    border-radius: var(--radius); background: var(--brand-soft); border: 1px solid var(--brand-line);
}
.notice-icon {
    width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff;
    display: grid; place-items: center; flex: none;
}

/* ---------- Lists and tables ---------- */

.row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
    text-decoration: none; color: var(--ink);
}
.row:last-child { border-bottom: 0; }
a.row:hover { background: var(--hover); color: var(--ink); }
.row-main { flex: 1 1 280px; min-width: 0; }
.row-tags { display: flex; flex-wrap: wrap; gap: 6px; flex: 0 1 220px; }
.row-status { flex: 0 0 170px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }

.empty { padding: 40px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty .icon { width: 32px; height: 32px; color: var(--faint); }

.toolbar {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left; font-size: 13px; font-weight: 600; color: var(--muted);
    padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--hover); white-space: nowrap;
}
td { padding: 14px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--hover); }
th.num, td.num { text-align: right; }

.lines { min-width: 760px; }
.lines th, .lines td { padding-left: 10px; padding-right: 10px; }
.lines th:first-child, .lines td:first-child { padding-left: 20px; }
.lines td { padding-top: 8px; padding-bottom: 8px; }
.lines tbody tr:hover td { background: none; }

.totals {
    margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px;
    font-variant-numeric: tabular-nums; flex: 0 1 320px;
}
.totals dd { margin: 0; text-align: right; }
.totals .grand { font-weight: 700; font-size: 18px; padding-top: 8px; border-top: 1px solid var(--line); }

/* ---------- Offer lines ---------- */

.line-grid {
    display: grid;
    grid-template-columns: 40px minmax(180px, 1fr) 110px 64px 130px 120px 44px;
    gap: 10px; align-items: center; margin: 0;
    padding: 8px 20px; border-bottom: 1px solid var(--line);
}
.line-grid input[name="title"] { width: 100%; }
.line-head {
    font-size: 13px; font-weight: 600; color: var(--muted); background: var(--hover);
    padding-top: 10px; padding-bottom: 10px;
}
@media (max-width: 860px) {
    .line-head { display: none; }
    .line-grid { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 44px; }
    .line-grid > :nth-child(2) { grid-column: 2 / -1; }
}
/* The offer lines sit in a column: switch to the compact layout by the width of their card, not of the window */
.card:has(#offer-lines) { container-type: inline-size; }
@container (max-width: 800px) {
    .line-head { display: none; }
    .line-grid { grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 44px; }
    .line-grid > :nth-child(2) { grid-column: 2 / -1; }
}

/* ---------- Facts (definition lists) ---------- */

.facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; overflow-wrap: anywhere; }
.facts-compact { grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; }
.facts-compact dt, .facts-compact dd { padding: 0; border: 0; }
.facts-compact dd { font-weight: 400; }

.meter { display: inline-block; height: 6px; width: 80px; border-radius: 999px; background: var(--ground); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); }

/* ---------- Mails ---------- */

.mail { display: flex; flex-direction: column; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); }
.mail:last-child { border-bottom: 0; }
.mail-out { background: var(--hover); }
.mail-head { display: flex; gap: 12px; align-items: center; }
.mail-body { white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; margin: 0; font: inherit; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.attachment {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; text-decoration: none;
}
.dir { font-size: 12px; font-weight: 600; border-radius: 4px; padding: 2px 8px; flex: none; }
.dir-in { background: var(--gray-bg); color: var(--gray); }
.dir-out { background: var(--brand-soft); color: var(--brand-ink); }

details.mail-item { border-bottom: 1px solid var(--line); }
details.mail-item:last-child { border-bottom: 0; }
details.mail-item > summary {
    list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 20px;
}
details.mail-item > summary::-webkit-details-marker { display: none; }
details.mail-item > summary:hover { background: var(--hover); }
details.mail-item[open] > summary { background: var(--hover); }
.mail-item-body { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.snippet { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; position: relative; padding-bottom: 22px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.tl-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid currentColor; }

/* Earlier steps of a timeline, folded under the current one; the chevron turns when open */
details.history { margin-top: 12px; }
details.history > summary, details.mail-history > summary {
    cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
    color: var(--muted); font-size: 14px; font-weight: 500;
}
details.history > summary::-webkit-details-marker { display: none; }
details.history > summary:hover, details.mail-history > summary:hover { color: var(--ink); }
details > summary > .icon { width: 18px; height: 18px; transition: transform 0.15s ease; }
details[open] > summary > .icon { transform: rotate(90deg); }
details.history[open] > summary { margin-bottom: 8px; }
.actor { font-size: 12px; font-weight: 600; border-radius: 4px; padding: 1px 6px; }
.actor-SYSTEM { background: var(--gray-bg); color: var(--gray); }
.actor-AI { background: var(--blue-bg); color: var(--blue); }
.actor-USER { background: var(--brand-soft); color: var(--brand-ink); }
.actor-CUSTOMER { background: var(--amber-bg); color: var(--amber); }

/* ---------- Tabs ---------- */

.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--ground); border-radius: 10px; margin-bottom: 20px; }
.tab {
    flex: 1 1 160px; min-height: 44px; border: 0; border-radius: 7px; background: transparent;
    font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.tab-panel[hidden] { display: none; }

/* ---------- Disclosure ---------- */

details.disclosure > summary { cursor: pointer; color: var(--brand); font-weight: 500; font-size: 14px; list-style: none; min-height: 44px; display: inline-flex; align-items: center; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure[open] > summary { margin-bottom: 12px; }

/* Earlier mails of a conversation, folded under the newest one */
details.mail-history { border-top: 1px solid var(--line); }
details.mail-history > summary { padding: 0 20px; }
details.mail-history[open] > summary { margin-bottom: 0; }
details.mail-history .mail { gap: 10px; }

/* ---------- Login and plain pages ---------- */

.auth { display: flex; flex-wrap: wrap; min-height: 100vh; }
.auth-panel {
    flex: 1 1 420px; background: var(--brand); color: #fff; padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.auth-panel .logo { width: 48px; height: 48px; border-radius: 12px; background: #fff; color: var(--brand); font-size: 18px; }
.auth-panel h1 { font-size: 40px; line-height: 1.15; letter-spacing: -0.02em; margin-bottom: 16px; }
.auth-panel p { font-size: 17px; opacity: 0.9; }
.auth-form-side { flex: 1 1 480px; display: flex; align-items: center; justify-content: center; padding: 48px 16px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-form h2 { font-size: 26px; letter-spacing: -0.01em; margin-bottom: 4px; }
.auth-form .btn { min-height: 48px; }
@media (max-width: 860px) {
    .auth-panel { padding: 32px 24px; gap: 24px; }
    .auth-panel h1 { font-size: 28px; }
    .auth-panel svg { display: none; }
}

.plain { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.plain .card { max-width: 480px; width: 100%; }

/* ---------- HTMX ---------- */

.htmx-indicator { opacity: 0; transition: opacity 150ms; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.saving { font-size: 13px; color: var(--muted); }

/* ---------- Customers ---------- */

.person { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.person:hover { color: var(--brand-ink); }

.form-card { max-width: 820px; }
.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 12px; }
.form-grid .span-1 { grid-column: span 1; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-3 { grid-column: span 3; }
.form-grid .span-4 { grid-column: span 4; }
.form-grid .span-6 { grid-column: span 6; }
@media (max-width: 640px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid > * { grid-column: span 1 !important; }
}

.choice { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; min-height: 32px; }
.choice input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
.compare td { vertical-align: top; }

.match-box { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.match-box .row-main { flex: 1 1 240px; }
.suggestion { border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.picker-results { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.picker-results .row { padding: 12px 14px; }

/* ---------- Small helpers instead of inline styles ---------- */

.block { display: block; }
.grow { flex: 1 1 240px; min-width: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
h3 { font-size: 15px; line-height: 1.3; margin: 8px 0 0; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand); }

/* ---------- Motion ---------- */

/* Controls answer at once, but softly */
.btn, .chip, .tab, .row, .nav a, .icon-btn, a.person {
    transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out),
                opacity var(--dur-fast) var(--ease-out);
}
.btn:active:not(:disabled) { transform: translateY(1px); }

/* Things that appear: messages, opened disclosures, tab panels */
@keyframes enter {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}
.notice, .alert, .tab-panel:not([hidden]), details[open] > :not(summary) {
    animation: enter var(--dur-base) var(--ease-out);
}
details > summary > .icon { transition-duration: var(--dur-fast); }

/* HTMX swaps that replace a whole area fade out and in (opt-in with .swap-fade on the target) */
.swap-fade.htmx-swapping { opacity: 0; transition: opacity var(--dur-fast) var(--ease-in); }
.swap-fade.htmx-added, .swap-fade > .htmx-added { animation: enter var(--dur-base) var(--ease-out); }

/* Waiting: the button of a form that is being sent cannot be pressed twice and shows a spinner after a moment
   (htmx marks the form with htmx-request, app.js marks plain forms with is-submitting) */
@keyframes spin { to { transform: rotate(360deg); } }
form.htmx-request [type="submit"], form.is-submitting [type="submit"] {
    pointer-events: none; opacity: 0.7; cursor: progress;
}
form.htmx-request [type="submit"]::after, form.is-submitting [type="submit"]::after {
    content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none;
    border: 2px solid currentColor; border-right-color: transparent;
    opacity: 0; animation: spin 700ms linear infinite, show 1ms linear 150ms forwards;
}
@keyframes show { to { opacity: 1; } }
/* Search fields: the magnifier fades while results load */
.search.htmx-request .icon-sm { opacity: 0.4; transition: opacity var(--dur-fast) var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important; transition-delay: 0ms !important;
    }
    form.htmx-request [type="submit"]::after, form.is-submitting [type="submit"]::after {
        content: "…"; border: 0; width: auto; height: auto; animation: none;
    }
}

/* ---------- Tables on a phone ---------- */

/* Lists become stacked cards instead of a table that scrolls sideways; the first column is the title */
@media (max-width: 640px) {
    table.cards-on-phone { min-width: 0 !important; }
    table.cards-on-phone thead { display: none; }
    table.cards-on-phone, table.cards-on-phone tbody, table.cards-on-phone tr, table.cards-on-phone td {
        display: block; width: 100%;
    }
    table.cards-on-phone tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
    table.cards-on-phone td { border: 0; padding: 2px 0; text-align: left; }
    table.cards-on-phone td:first-child { font-weight: 600; padding-bottom: 4px; }
    table.cards-on-phone td:empty { display: none; }
}

/* One line of figures, separated by dots, e.g. under the greeting of the task list */
.summary-line { display: flex; flex-wrap: wrap; gap: 4px 0; }
.summary-line > * + *::before { content: "·"; margin: 0 8px; color: var(--faint); }
.late-text { color: var(--red); }
.pre-line { white-space: pre-line; }

/* A card that is still loading keeps its place, so the page does not jump */
@keyframes pulse { 50% { opacity: 0.55; } }
.skeleton { min-height: 220px; background: var(--hover); animation: pulse 1.4s ease-in-out infinite; }

/* =====================================================================================================================
   Design system v2: calm surfaces with depth, a sidebar in the colour of the business, refined controls.
   Everything is derived from --brand, so every business gets its own look.
   ===================================================================================================================== */

:root {
    --ink: #121815;
    --muted: #5E6A65;
    --faint: #94A09A;
    --line: #E8EBE8;
    --line-soft: #F0F2F0;
    --field: #D6DBD8;
    --ground: #F5F6F4;
    --hover: #F9FAF9;
    --radius: 16px;
    --radius-sm: 10px;
    --brand-soft: color-mix(in srgb, var(--brand) 8%, white);
    --brand-line: color-mix(in srgb, var(--brand) 22%, white);
    --brand-ink: color-mix(in srgb, var(--brand) 80%, black);
    --brand-glow: color-mix(in srgb, var(--brand) 20%, transparent);
    --side: color-mix(in srgb, var(--brand) 26%, #0B110E);
    --shadow-xs: 0 1px 2px rgba(18, 24, 21, 0.05);
    --shadow-sm: 0 1px 2px rgba(18, 24, 21, 0.04), 0 4px 12px -4px rgba(18, 24, 21, 0.08);
    --shadow-md: 0 2px 4px rgba(18, 24, 21, 0.04), 0 16px 40px -12px rgba(18, 24, 21, 0.16);
    --ring: 0 0 0 4px var(--brand-glow);
}

body {
    background: var(--ground);
    font-feature-settings: "cv11", "ss01";
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1 { font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.num, .kpi-value, .totals, td.num { font-variant-numeric: tabular-nums; }

/* ---------- Shell: dark sidebar in the colour of the business ---------- */

.side {
    background: var(--side);
    background-image: radial-gradient(120% 60% at 0% 0%, rgba(255, 255, 255, 0.07), transparent 60%);
    border-right: 0; color: rgba(255, 255, 255, 0.78); padding: 22px 14px;
}
.side .brand, .side .brand:hover { color: #fff; }
.side .brand .muted { color: rgba(255, 255, 255, 0.55); }
.logo {
    background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 70%, white), var(--brand));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px -2px rgba(0, 0, 0, 0.35);
    border-radius: 12px; letter-spacing: -0.02em;
}
.nav { gap: 4px; }
.nav a { color: rgba(255, 255, 255, 0.72); border-radius: 10px; position: relative; font-weight: 500; }
.nav a .icon, .nav a .icon-sm { opacity: 0.8; }
.nav a:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, 0.11); color: #fff; font-weight: 600; }
.nav a.active::before {
    content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px;
    border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--brand) 55%, white);
}
.count { background: #fff; color: var(--brand-ink); }
.side .btn-dashed { background: transparent; color: rgba(255, 255, 255, 0.75); border-color: rgba(255, 255, 255, 0.22); box-shadow: none; }
.side .btn-dashed:hover { color: #fff; border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.04); }
.user { border-top-color: rgba(255, 255, 255, 0.1); }
.user .muted { color: rgba(255, 255, 255, 0.55); }
.user .strong { color: #fff; }
.user .avatar { background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; }
.user .btn { background: transparent; border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.8); box-shadow: none; }
.user .btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.menu-toggle { color: #fff; }

.main { padding: 36px 48px 72px; gap: 24px; }
.main > * { width: 100%; max-width: 1240px; margin-inline: auto; }
@media (max-width: 860px) { .main { padding: 20px 16px 48px; } }

.crumbs { color: var(--muted); }
.crumbs a { color: var(--muted); font-weight: 500; }
.crumbs a:hover { color: var(--ink); }
.page-head .sub { font-size: 15px; max-width: 70ch; }

/* ---------- Cards ---------- */

.card { border: 1px solid rgba(18, 24, 21, 0.06); box-shadow: var(--shadow-sm); border-radius: var(--radius); }
.card-head { padding: 18px 22px; border-bottom-color: var(--line-soft); min-height: 60px; }
.card-body { padding: 22px; }
.card-foot { padding: 16px 22px; border-top-color: var(--line-soft); background: var(--hover); border-radius: 0 0 var(--radius) var(--radius); }

/* ---------- Buttons ---------- */

.btn {
    min-height: 42px; border-radius: var(--radius-sm); font-weight: 600; letter-spacing: -0.005em;
    border-color: var(--field); box-shadow: var(--shadow-xs);
}
.btn:hover { background: var(--hover); border-color: #C2C9C5; }
.btn-primary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand) 86%, white), var(--brand));
    border-color: var(--brand-ink);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(18, 24, 21, 0.12),
                0 4px 12px -4px color-mix(in srgb, var(--brand) 60%, transparent);
}
.btn-primary:hover {
    background: linear-gradient(180deg, var(--brand), var(--brand-ink)); border-color: var(--brand-ink); color: #fff;
}
.btn-danger { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), var(--shadow-xs); }
.btn:focus-visible { box-shadow: var(--ring); }

/* ---------- Fields ---------- */

label { font-weight: 550; color: var(--ink); }
input, select, textarea { border-color: var(--field); border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); }
input:hover, select:hover, textarea:hover { border-color: #C2C9C5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--faint); }
.inline-input { box-shadow: none; }
input[type="checkbox"], input[type="radio"] { box-shadow: none; }

/* ---------- Badges, tags, chips ---------- */

.badge { font-size: 12.5px; padding: 3px 10px 3px 8px; letter-spacing: 0; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.b-new { background: var(--brand); box-shadow: 0 2px 8px -2px color-mix(in srgb, var(--brand) 70%, transparent); }
.b-new::before { background: #fff; }
.tag { background: var(--hover); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; }
.chip { min-height: 38px; border-color: var(--line); box-shadow: var(--shadow-xs); }
.chip.on { background: var(--ink); border-color: var(--ink); box-shadow: 0 2px 8px -2px rgba(18, 24, 21, 0.4); }

/* ---------- Tabs: a segmented control ---------- */

.tabs { background: #EDF0ED; padding: 5px; border-radius: 12px; }
.tabs [role="tab"] {
    flex: 1 1 160px; min-height: 42px; border: 0; border-radius: 9px; background: transparent;
    font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.tabs [role="tab"]:hover { color: var(--ink); }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Lists and tables ---------- */

.row { padding: 16px 22px; border-bottom-color: var(--line-soft); }
a.row:hover { background: var(--hover); }
a.row:hover .row-main strong { color: var(--brand-ink); }
.toolbar { padding: 14px 22px; border-bottom-color: var(--line-soft); }
th {
    background: transparent; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--faint); padding: 12px 22px; border-bottom-color: var(--line);
}
td { padding: 15px 22px; border-bottom-color: var(--line-soft); }
tbody tr:hover td { background: var(--hover); }
.empty { padding: 56px 24px; gap: 8px; }
.empty .icon {
    width: 52px; height: 52px; padding: 14px; border-radius: 16px; color: var(--brand);
    background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand-line);
}

/* ---------- Avatars ---------- */

.avatar {
    background: linear-gradient(140deg, #F1F3F1, #E4E8E5); color: #4A5550; font-weight: 650;
    box-shadow: inset 0 0 0 1px rgba(18, 24, 21, 0.05);
}
.avatar-brand {
    background: linear-gradient(140deg, var(--brand-soft), color-mix(in srgb, var(--brand) 18%, white));
    color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--brand-line);
}

/* ---------- Messages ---------- */

.notice { background: var(--surface); border: 1px solid rgba(18, 24, 21, 0.06); box-shadow: var(--shadow-sm); }
.notice-icon {
    background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 75%, white), var(--brand));
    box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--brand) 70%, transparent);
}
.alert { border-radius: 12px; border: 1px solid transparent; }
.alert-error { border-color: color-mix(in srgb, var(--red) 18%, transparent); }
.alert-info { border-color: color-mix(in srgb, var(--blue) 16%, transparent); }
.alert-warn { border-color: color-mix(in srgb, var(--amber) 18%, transparent); }
.alert-success { border-color: var(--brand-line); }

/* ---------- Facts ---------- */

.facts-compact { gap: 10px 14px; }
.facts-compact dt { color: var(--muted); }
.facts-compact dd { font-weight: 500; }
.totals .grand { font-size: 20px; letter-spacing: -0.02em; }

/* ---------- Welcome band on the start page ---------- */

.hero {
    position: relative; overflow: hidden; border-radius: 20px; padding: 32px 36px; color: #fff;
    background:
        radial-gradient(80% 120% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
        radial-gradient(60% 90% at 0% 100%, rgba(0, 0, 0, 0.18), transparent 60%),
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 85%, white), var(--brand) 45%, var(--brand-ink));
    box-shadow: var(--shadow-md);
}
.hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%;
    border: 40px solid rgba(255, 255, 255, 0.06); pointer-events: none;
}
.hero h1 { color: #fff; font-size: 32px; }
.hero-date { color: rgba(255, 255, 255, 0.75); font-size: 14px; font-weight: 500; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 24px; }
.hero-stat {
    background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px;
    padding: 14px 16px; backdrop-filter: blur(6px);
}
.hero-stat-value { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.hero-stat-label { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.78); margin-top: 2px; }
.hero-stat.alert-stat { background: rgba(255, 255, 255, 0.95); color: var(--red); border-color: transparent; }
.hero-stat.alert-stat .hero-stat-label { color: var(--red); }
@media (max-width: 640px) { .hero { padding: 24px 20px; } .hero h1 { font-size: 26px; } }

/* ---------- Details of the design pass ---------- */

.hero-date { margin-bottom: 6px; }
.match-box { flex-wrap: nowrap; align-items: center; gap: 14px; }
.match-box .row-main { flex: 1 1 auto; min-width: 0; }
.match-box > .btn, .match-box > form { flex: none; }
@container (max-width: 380px) { .match-box { flex-wrap: wrap; } }
.layout-aside .card { container-type: inline-size; }
.totals { column-gap: 0; }
.totals dd { padding-left: 24px; }
.totals .grand { margin-top: 4px; }
.mail-body { color: #26302B; }
input, select, textarea { font-weight: 400; }
.inline-input { font-weight: 600; }
@media (max-width: 860px) { .side { padding: 8px 16px; background-image: none; } .nav a.active::before { display: none; } }
@media (max-width: 640px) {
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-stat-value { font-size: 22px; }
    .row-main { flex-basis: 200px; }
}

/* ---------- Login: the brand side with light, the form on a card ---------- */

.auth-panel {
    position: relative; overflow: hidden;
    background:
        radial-gradient(90% 70% at 100% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
        radial-gradient(70% 60% at 0% 100%, rgba(0, 0, 0, 0.22), transparent 65%),
        linear-gradient(150deg, color-mix(in srgb, var(--brand) 85%, white), var(--brand) 40%, var(--brand-ink));
}
.auth-panel::after {
    content: ""; position: absolute; right: -120px; top: 30%; width: 420px; height: 420px; border-radius: 50%;
    border: 60px solid rgba(255, 255, 255, 0.05); pointer-events: none;
}
.auth-panel .logo { box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.4); background: #fff; }
.auth-panel h1 { font-size: 44px; letter-spacing: -0.03em; }
.auth-form-side { background: var(--ground); }
.auth-form {
    background: var(--surface); padding: 40px 36px; border-radius: 20px;
    border: 1px solid rgba(18, 24, 21, 0.06); box-shadow: var(--shadow-md);
}

/* ---------- Settings: one page per area, navigation on the left ---------- */

.settings-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.settings-content { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.settings-content .form-card { max-width: none; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 24px; }
.settings-nav a {
    display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-radius: 12px;
    color: var(--ink); text-decoration: none; border: 1px solid transparent;
    transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.settings-nav a:hover { background: rgba(18, 24, 21, 0.03); color: var(--ink); }
.settings-nav a.active { background: var(--surface); border-color: rgba(18, 24, 21, 0.06); box-shadow: var(--shadow-sm); }
.settings-nav a.active .strong { color: var(--brand-ink); }
.settings-nav-sub { font-size: 13px; color: var(--muted); }
/* Which build is running, under the settings menu */
.settings-version {
    display: flex; flex-direction: column; gap: 2px; margin: 12px 14px 0;
    font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.settings-version code { font-size: 12px; color: var(--ink); }
@media (max-width: 960px) {
    .settings-version { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; gap: 4px 12px; margin: 4px 2px 0; }
}
@media (max-width: 960px) {
    .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .settings-nav a { padding: 8px 14px; border-radius: 999px; border-color: var(--line); background: var(--surface); min-height: 44px; justify-content: center; }
    .settings-nav-sub { display: none; }
}

/* A save bar that stays at the bottom of the window while a long form scrolls */
.save-bar {
    position: sticky; bottom: 16px; z-index: 5;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 14px 12px 22px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(10px);
    border: 1px solid rgba(18, 24, 21, 0.08); box-shadow: var(--shadow-md);
}

/* ---------- Capacity: working week, working time, holidays, load of the weeks ---------- */

/* Seven small fields for the hours per weekday */
.week-inputs { display: grid; grid-template-columns: repeat(7, minmax(52px, 1fr)); gap: 8px; }
.week-inputs label { font-size: 13px; font-weight: 600; color: var(--muted); gap: 4px; }
.week-inputs input { padding-inline: 8px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .week-inputs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Working time of a person: only the fields of the chosen kind are shown */
.working-time .wt-like, .working-time .wt-hours, .working-time .wt-own { display: none; }
.working-time:has(input[value="LIKE_BUSINESS"]:checked) .wt-like,
.working-time:has(input[value="HOURS_PER_WEEK"]:checked) .wt-hours,
.working-time:has(input[value="OWN_WEEK"]:checked) .wt-own { display: flex; flex-direction: column; gap: 6px; }
.working-time .plain-fieldset { gap: 6px; }
.working-time .plain-fieldset label { font-weight: 500; }
.working-time .wt-own .week-inputs { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.holiday-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 24px; font-size: 14px; }
.holiday-list li { display: flex; gap: 12px; }
.holiday-list .muted { min-width: 84px; font-variant-numeric: tabular-nums; }

/* Load of the coming weeks: one bar per week, booked hours and (lighter) the new offer */
.load-weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(34px, 1fr)); gap: 6px; align-items: end; }
.load-week { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.load-bar {
    position: relative; width: 100%; height: 56px; border-radius: 6px; overflow: hidden;
    background: var(--line-soft, #F0F2F0); display: flex; flex-direction: column-reverse;
}
.load-bar > span { display: block; width: 100%; flex: none; }
.load-bar .booked { background: color-mix(in srgb, var(--brand) 70%, white); }
.load-bar .proposed { background: repeating-linear-gradient(135deg, var(--amber), var(--amber) 3px, color-mix(in srgb, var(--amber) 55%, white) 3px, color-mix(in srgb, var(--amber) 55%, white) 6px); }
.load-week.full .load-bar .booked { background: var(--red); }
.load-week.closed .load-bar { background: repeating-linear-gradient(135deg, var(--line), var(--line) 2px, transparent 2px, transparent 6px); }
.load-label { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.load-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--muted); }
.load-legend span::before {
    content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px;
    vertical-align: -1px; background: color-mix(in srgb, var(--brand) 70%, white);
}
.load-legend .legend-proposed::before { background: var(--amber); }
.capacity-start { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.capacity-box { border-top: 1px solid var(--line-soft, #F0F2F0); }
.start-week-field { max-width: 360px; }
/* The clause for a binding start only matters when "Verbindlich zusagen" is chosen */
.start-week-mode .start-week-clause { display: none; }
.start-week-mode:has(input[value="BINDING"]:checked) .start-week-clause { display: flex; }
.check-chips label:has(input[type="radio"]:checked) { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
a.hero-stat-link { color: #fff; text-decoration: none; }
a.hero-stat-link:hover { color: #fff; background: rgba(255, 255, 255, 0.18); }
.capacity-box .alert { flex-wrap: wrap; align-items: center; }

/* A checkbox label: box and text side by side */
label.row-wrap { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; }
label.row-wrap input[type="checkbox"] { width: 18px; height: 18px; flex: none; }

/* ---------- Editable lists in the settings ---------- */

.option-list { list-style: none; margin: 0; padding: 0; }
.option-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 22px; border-bottom: 1px solid var(--line-soft);
}
.option-row:last-child { border-bottom: 0; }
.option-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 0; }
.option-edit > input[name="label"] { flex: 1 1 220px; }
.option-interval { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.option-interval input { width: 80px; }
.option-move { display: flex; }
.option-move .icon-btn { font-size: 17px; color: var(--muted); }
.option-move .icon-btn:hover { color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }
form.card-foot.option-edit { flex-wrap: wrap; }

/* Choice chips: several of a list at once, e.g. the qualifications of a person */
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chips label {
    flex-direction: row; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 10px;
    border: 1px solid var(--line); border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-xs);
    font-weight: 500; cursor: pointer;
    transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.check-chips label:hover { border-color: #C2C9C5; }
.check-chips label:has(input:checked) { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.check-chips input[type="checkbox"] { width: 16px; height: 16px; }

/* A group of fields without the default frame, e.g. choice chips */
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.plain-fieldset legend { font-weight: 550; font-size: 14px; padding: 0; margin-bottom: 8px; }

/* Calm rows: the entries read like text; the frame and "Speichern" only show while editing */
.option-row { padding: 4px 14px 4px 22px; }
.option-row .option-edit > input[name="label"] {
    border-color: transparent; box-shadow: none; background: transparent; padding-left: 10px; margin-left: -10px;
}
.option-row:hover .option-edit > input[name="label"] { border-color: var(--line); }
.option-row .option-edit > input[name="label"]:focus { border-color: var(--brand); box-shadow: var(--ring); background: var(--surface); }
.option-row .option-interval input { border-color: transparent; box-shadow: none; background: transparent; }
.option-row:hover .option-interval input, .option-row .option-interval input:focus { border-color: var(--line); background: var(--surface); }
.option-row .option-edit .btn { visibility: hidden; }
.option-row:focus-within .option-edit .btn { visibility: visible; }
.option-move .icon-btn, .option-row .icon-btn { width: 36px; height: 40px; }
.option-row .icon-btn { opacity: 0.55; }
.option-row:hover .icon-btn:not(:disabled), .option-row:focus-within .icon-btn:not(:disabled) { opacity: 1; }

/* =====================================================================================================================
   Motion v2: the feel of a native app. Springs instead of linear fades, pages that glide into each other, controls
   that give way under the finger. Still only opacity, transform, colours and shadows move; reduced motion stops it.
   ===================================================================================================================== */

:root {
    --dur-fast: 160ms;
    --dur-base: 280ms;
    --dur-slow: 520ms;
    /* The calm deceleration of iOS sheets and macOS windows */
    --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
    /* A spring with a hint of overshoot, for things that settle into place */
    --ease-spring: cubic-bezier(0.34, 1.36, 0.64, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
    :root {
        --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017 19.4%,
                              1.077 22.4%, 1.101 25.6%, 1.104 28.2%, 1.088 31.8%, 1.032 39.5%, 1.005 45.1%,
                              0.993 52.2%, 0.998 66.4%, 1);
    }
}

/* ---------- From page to page: the menu stays put, the content cross-fades (Chrome, Edge, Safari 18.2+) ---------- */

@media (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
}
.side { view-transition-name: side; }
.main { view-transition-name: main; }
::view-transition-group(side) { animation: none; }
::view-transition-old(main) { animation: page-out 140ms var(--ease-in) both; }
::view-transition-new(main) { animation: page-in 200ms var(--ease-out) both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
@keyframes page-out { to { opacity: 0; transform: scale(0.992); } }
@keyframes page-in { from { opacity: 0; } }

/* ---------- A page arrives: its parts rise one after another ---------- */

@keyframes rise {
    from { opacity: 0; transform: translateY(12px) scale(0.99); }
    to { opacity: 1; transform: none; }
}
.main > *, .auth-form, .settings-content > * { animation: rise var(--dur-slow) var(--ease-out) backwards; }
.main > :nth-child(2), .settings-content > :nth-child(2) { animation-delay: 50ms; }
.main > :nth-child(3), .settings-content > :nth-child(3) { animation-delay: 100ms; }
.main > :nth-child(4), .settings-content > :nth-child(4) { animation-delay: 150ms; }
.main > :nth-child(n+5), .settings-content > :nth-child(n+5) { animation-delay: 200ms; }
/* The sticky save bar stays where it is */
.settings-content > .save-bar { animation: none; }

/* The figures of the welcome band pop in after the band itself */
@keyframes pop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: none; }
}
.hero-stat { animation: pop var(--dur-slow) var(--ease-spring) backwards; }
.hero-stat:nth-child(1) { animation-delay: 160ms; }
.hero-stat:nth-child(2) { animation-delay: 220ms; }
.hero-stat:nth-child(3) { animation-delay: 280ms; }
.hero-stat:nth-child(n+4) { animation-delay: 340ms; }

/* ---------- Controls give way under the finger and spring back ---------- */

.btn, .chip, .icon-btn, .check-chips label, .tabs [role="tab"], .menu-toggle, .nav a, .settings-nav a {
    transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
                opacity var(--dur-fast) var(--ease-out), transform var(--dur-base) var(--ease-spring);
}
.btn:active:not(:disabled), .chip:active, .icon-btn:active:not(:disabled), .check-chips label:active,
.menu-toggle:active {
    transform: scale(0.96); transition-duration: 80ms;
}
.nav a:active, .settings-nav a:active, .tabs [role="tab"]:active { transform: scale(0.98); transition-duration: 80ms; }
.btn-primary:hover:not(:disabled) {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(18, 24, 21, 0.12),
                0 8px 20px -6px color-mix(in srgb, var(--brand) 70%, transparent);
}

/* Fields: the focus ring grows in instead of snapping */
input, select, textarea {
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
                background-color var(--dur-fast) var(--ease-out);
}

/* ---------- Surfaces ---------- */

.card { transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hero-stat { transition: transform var(--dur-base) var(--ease-spring), background-color var(--dur-fast) var(--ease-out); }
.hero-stat:hover { transform: translateY(-2px); }

/* ---------- Things that appear settle with a spring ---------- */

@keyframes settle {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.notice, .alert { animation: settle var(--dur-slow) var(--ease-spring) backwards; }
details > summary > .icon { transition: transform var(--dur-base) var(--ease-spring); }

/* Disclosures open and close smoothly where the browser can animate to auto height */
@supports (interpolate-size: allow-keywords) {
    :root { interpolate-size: allow-keywords; }
    details::details-content {
        height: 0; overflow: clip; opacity: 0;
        transition: height var(--dur-base) var(--ease-out), opacity var(--dur-base) var(--ease-out),
                    content-visibility var(--dur-base) allow-discrete;
    }
    details[open]::details-content { height: auto; opacity: 1; }
    details[open] > :not(summary) { animation: none; }
}

/* Phone menu: unfolds from the top bar, its entries one after another */
@keyframes unfold {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
}
@media (max-width: 860px) {
    .side.open .side-menu { animation: unfold var(--dur-base) var(--ease-out); }
    .side.open .side-menu .nav a { animation: unfold var(--dur-base) var(--ease-out) backwards; }
    .side.open .side-menu .nav a:nth-child(2) { animation-delay: 30ms; }
    .side.open .side-menu .nav a:nth-child(3) { animation-delay: 60ms; }
    .side.open .side-menu .nav a:nth-child(4) { animation-delay: 90ms; }
    .side.open .side-menu .nav a:nth-child(n+5) { animation-delay: 120ms; }
}

/* ---------- Segmented control: the white pill slides to the chosen tab (app.js measures it) ---------- */

.tabs.has-pill { position: relative; isolation: isolate; }
.tabs.has-pill::before {
    content: ""; position: absolute; z-index: -1; left: 0; top: 0;
    width: var(--pill-w, 0); height: var(--pill-h, 0);
    transform: translate(var(--pill-x, 0), var(--pill-y, 0));
    background: var(--surface); border-radius: 9px; box-shadow: var(--shadow-sm);
}
.tabs.has-pill.pill-ready::before {
    transition: transform var(--dur-slow) var(--ease-spring), width var(--dur-slow) var(--ease-spring),
                height var(--dur-base) var(--ease-out);
}
.tabs.has-pill [role="tab"][aria-selected="true"] { background: transparent; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-delay: 0ms !important; }
    .tabs.has-pill.pill-ready::before { transition: none; }
    .btn:active:not(:disabled), .chip:active, .icon-btn:active:not(:disabled), .check-chips label:active,
    .menu-toggle:active, .nav a:active, .settings-nav a:active, .tabs [role="tab"]:active { transform: none; }
}

/* ---------- Planning board: people or machines as rows, working days as columns ---------- */
:root {
    --job1: #DCEFE4; --job1-ink: #17583B;
    --job2: #E1EAFB; --job2-ink: #1E4396;
    --job3: #FBEBD3; --job3-ink: #7A4207;
    --job4: #ECE4FA; --job4-ink: #553393;
    --job5: #D9F0F0; --job5-ink: #155E5E;
    --plan-name: 200px;
    --plan-day: 92px;
}
.c1 { --job: var(--job1); --job-ink: var(--job1-ink); }
.c2 { --job: var(--job2); --job-ink: var(--job2-ink); }
.c3 { --job: var(--job3); --job-ink: var(--job3-ink); }
.c4 { --job: var(--job4); --job-ink: var(--job4-ink); }
.c5 { --job: var(--job5); --job-ink: var(--job5-ink); }
.b-wait { background: var(--amber-bg); color: var(--amber); }
.tag-warn { background: var(--red-bg); color: var(--red); }
.avatar-xs { width: 30px; height: 30px; font-size: 11px; }
.avatar-thing { background: var(--ground); color: var(--muted); border-radius: 9px; }

.plan { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.plan-tray-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.plan-tray-empty { padding: 16px; margin: 0; }
.plan-job { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out); }
.plan-job:hover { border-color: var(--brand-line); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.plan-job.current { border-color: var(--brand); box-shadow: var(--ring); }
.plan-job-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.plan-job-cta { font-size: 13px; font-weight: 600; color: var(--brand); }
.plan-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--job-ink); }

.plan-board-card { min-width: 0; }
.plan-board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.plan-board-head .btn-sm { min-height: 36px; padding: 0 12px; }
.plan-weeks { font-size: 15px; margin: 0 6px; min-width: 9em; text-align: center; font-variant-numeric: tabular-nums; }
.plan-scroll { overflow-x: auto; }
.plan-grid { display: grid; grid-template-columns: var(--plan-name) minmax(0, 1fr);
    min-width: calc(var(--plan-name) + var(--days) * var(--plan-day)); }
.plan-days, .plan-lane { display: grid; grid-template-columns: repeat(var(--days), minmax(var(--plan-day), 1fr)); }
.plan-corner { padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line);
    position: sticky; left: 0; background: var(--surface); z-index: 3; display: flex; align-items: flex-end; }
.plan-day { padding: 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px;
    font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.plan-day-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.plan-day.today .plan-day-name, .plan-day.today .plan-day-note { color: var(--brand); }
.plan-day-note { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-day.closed .plan-day-note { color: var(--amber); }
.week-start { border-left: 1px solid var(--line); }
.plan-who { display: flex; align-items: center; gap: 10px; padding: 10px 12px; min-width: 0;
    border-bottom: 1px solid var(--line-soft); position: sticky; left: 0; background: var(--surface); z-index: 2; }
.plan-who-text { display: flex; flex-direction: column; min-width: 0; }
.plan-who-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-who-detail { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-who-detail.warn { color: var(--red); }
.plan-lane { border-bottom: 1px solid var(--line-soft); min-height: 60px; }
.plan-cell { grid-row: 1; }
.plan-cell.past { background: var(--hover); }
.plan-cell.today { background: color-mix(in srgb, var(--brand) 5%, transparent); }
.plan-cell.off { background: repeating-linear-gradient(135deg, var(--line-soft) 0 6px, transparent 6px 12px); }
.plan-bar { grid-row: 1; z-index: 1; min-width: 0; margin: 7px 4px; padding: 6px 9px; border-radius: 9px;
    display: flex; flex-direction: column; justify-content: center; font-size: 12px; line-height: 1.25;
    background: var(--job); color: var(--job-ink); text-decoration: none; border: 1px solid transparent;
    transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out); }
a.plan-bar:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--job-ink); }
.plan-bar.cut-start { border-top-left-radius: 2px; border-bottom-left-radius: 2px; margin-left: 0; }
.plan-bar.cut-end { border-top-right-radius: 2px; border-bottom-right-radius: 2px; margin-right: 0; }
.plan-bar-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-bar-sub { opacity: 0.8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-absent { background: repeating-linear-gradient(135deg, #F3EEE6 0 7px, #FBF8F3 7px 14px);
    color: var(--amber); border-color: #EBDDC6; }
.plan-ghost { background: repeating-linear-gradient(135deg, var(--brand-soft) 0 7px, var(--surface) 7px 14px);
    border: 1.5px dashed var(--brand); color: var(--brand-ink); z-index: 2; }
.plan-load-who, .plan-load { background: var(--ground); }
.plan-load { min-height: 0; }
.plan-load-cell { padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 5px; font-variant-numeric: tabular-nums; }
.plan-meter { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.plan-meter i { display: block; height: 100%; border-radius: 3px; background: var(--brand);
    transition: width var(--dur-slow) var(--ease-out); }
.plan-meter i.full { background: var(--amber); }
.plan-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 16px 14px; font-size: 12px; color: var(--muted); }
.plan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plan-swatch { width: 18px; height: 10px; border-radius: 3px; display: inline-block; background: var(--job); }
.plan-swatch-absent { background: repeating-linear-gradient(135deg, #F3EEE6 0 4px, #FBF8F3 4px 8px); }
.plan-swatch-off { background: repeating-linear-gradient(135deg, var(--line-soft) 0 3px, transparent 3px 6px);
    border: 1px solid var(--line); }

@media (max-width: 1100px) {
    .plan { grid-template-columns: minmax(0, 1fr); }
    .plan-tray-list { flex-direction: row; overflow-x: auto; }
    .plan-job { width: 250px; flex: none; }
}
@media (max-width: 640px) {
    :root { --plan-name: 130px; --plan-day: 84px; }
    .plan-who-detail { display: none; }
}

/* ---------- Planning panel: a sheet from the right ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(16, 36, 26, 0.18); animation: fade-in var(--dur-base) var(--ease-out); }
.sheet { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(460px, 100vw); overflow-y: auto;
    background: var(--surface); box-shadow: var(--shadow-md); animation: sheet-in var(--dur-slow) var(--ease-out);
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@keyframes sheet-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sheet-form { display: flex; flex-direction: column; min-height: 100%; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px;
    border-bottom: 1px solid var(--line-soft); }
.sheet-title { font-size: 19px; margin: 0; letter-spacing: -0.01em; }
.sheet-close { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ground); color: var(--muted); }
.sheet-close:hover { color: var(--ink); }
.sheet-body { flex: 1; display: flex; flex-direction: column; gap: 20px; padding: 16px 20px; }
.sheet-foot { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 10px; padding: 14px 20px;
    background: var(--surface); border-top: 1px solid var(--line-soft); }
.sheet-foot .alert { padding: 9px 12px; font-size: 13px; }
.plan-step { border: 0; margin: 0; padding: 0; min-width: 0; }
.plan-step legend { padding: 0; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--muted); }
.plan-start-days { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 6px; }
.plan-start { flex: none; min-width: 54px; display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; color: var(--muted);
    cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out); }
.plan-start b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-start .tiny { display: none; }
.plan-start input { position: absolute; opacity: 0; pointer-events: none; }
.plan-start:hover { border-color: var(--brand-line); }
.plan-start:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.plan-start:has(input:checked) b { color: #fff; }
.plan-start:has(input:focus-visible) { box-shadow: var(--ring); }
.plan-choices { display: flex; flex-direction: column; gap: 6px; }
.plan-choice { border: 1px solid var(--line); border-radius: 12px; transition: border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out); }
.plan-choice:hover { border-color: var(--brand-line); }
.plan-choice.chosen { border-color: var(--brand); background: var(--brand-soft); }
.plan-choice.blocked { background: var(--hover); }
.plan-choice.blocked .strong { color: var(--muted); }
.plan-choice-main { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
    padding: 9px 10px; cursor: pointer; }
.plan-choice-main input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.plan-choice-text { display: flex; flex-direction: column; min-width: 0; }
.plan-choice-text > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-choice .badge { max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.plan-own-days { display: flex; gap: 6px; padding: 0 10px 10px 38px; }
.plan-own-days select { flex: 1 1 0; min-width: 0; min-height: 36px; padding: 4px 8px; font-size: 13px; }
.tone-ok { background: var(--brand-soft); color: var(--brand-ink); }
.tone-info { background: var(--blue-bg); color: var(--blue); }
.tone-warn { background: var(--amber-bg); color: var(--amber); }
.tone-bad { background: var(--red-bg); color: var(--red); }
.plan-choice.chosen .tone-ok { background: var(--surface); }
.plan-result { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--ground); }
.plan-result-days { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.plan-strip { display: flex; gap: 3px; margin-top: 6px; }
.plan-strip-day { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 10px; color: var(--muted); }
.plan-strip-bar { position: relative; width: 100%; height: 22px; border-radius: 4px; background: var(--line); overflow: hidden; }
.plan-strip-bar i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--brand); }
.plan-swatch-ghost { background: var(--brand-soft); border: 1.5px dashed var(--brand); }
@media (max-width: 640px) {
    .plan-choice .badge { max-width: 120px; }
    .plan-own-days { padding-left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .sheet, .scrim { animation: none; }
}

/* Job page: the planned days with the people on them */
.plan-period { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 10px;
    background: var(--brand-soft); color: var(--brand-ink); }
.plan-period .muted { color: var(--brand-ink); opacity: 0.8; }
.job-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.job-day { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; }
.job-day b { color: var(--ink); }
.job-day-faces { display: flex; flex-wrap: wrap; }
.avatar-face { width: 24px; height: 24px; font-size: 10px; margin-right: -6px; border: 2px solid var(--surface); }

/* Workflows: the list of running workflows with a small map of the way, and one workflow as a diagram. */
:root {
    --fl-edge: #C9CFCB;
    --team-bg: #ECE4FA;
    --team: #553393;
}
.fl-who { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px;
    padding: 2px 9px 2px 7px; white-space: nowrap; background: var(--gray-bg); color: var(--gray); }
.fl-who::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.fl-who.you { background: var(--amber-bg); color: var(--amber); }
.fl-who.cust { background: var(--blue-bg); color: var(--blue); }
.fl-who.team { background: var(--team-bg); color: var(--team); }
.fl-who.late { background: var(--red-bg); color: var(--red); }
.fl-who.done { background: var(--brand-soft); color: var(--brand-ink); }

.fl-name { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.fl-name i { width: 8px; height: 8px; border-radius: 2px; background: var(--brand); display: inline-block; }
.fl-name i.job { background: var(--team); }
.fl-name i.check { background: var(--amber); }

.fl-runs { list-style: none; margin: 0; padding: 0; }
.fl-runs li { border-bottom: 1px solid var(--line-soft, var(--line)); }
.fl-runs li:last-child { border-bottom: 0; }
.fl-run { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(220px, 1.4fr) minmax(190px, 1.2fr) auto;
    gap: 16px; align-items: center; padding: 13px 22px; color: inherit; text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out); }
.fl-run:hover { background: var(--hover); color: inherit; }
.fl-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fl-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fl-lbl { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fl-side { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.fl-chev { color: var(--faint); font-size: 18px; }
.fl-mini { display: block; width: 100%; max-width: 260px; height: 16px; }
.fl-mini-line { stroke: var(--fl-edge); stroke-width: 2; }
.fl-mini-line.fl-done, .fl-mini-line.fl-now { stroke: var(--brand); }
.fl-mini-dot { fill: var(--surface); stroke: var(--fl-edge); stroke-width: 1.5; }
.fl-mini-dot.fl-done { fill: var(--brand-soft); stroke: var(--brand); }
.fl-mini-dot.fl-now { fill: var(--brand); stroke: var(--brand); }
@media (max-width: 1000px) {
    .fl-run { grid-template-columns: minmax(0, 1fr) auto; padding: 13px 16px; }
    .fl-c-map, .fl-c-next { display: none; }
}

.fl-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fl-scroll { overflow-x: auto; padding: 8px 8px 4px; }
.fl-diagram { display: block; width: 100%; height: auto; }
.fl-diagram text { font-family: inherit; }
.fl-band { fill: transparent; }
.fl-band-alt { fill: var(--hover); }
.fl-band-label { font-size: 11px; font-weight: 600; fill: var(--faint); letter-spacing: .08em; }
.fl-arrow { fill: var(--fl-edge); }
.fl-arrow-on { fill: var(--brand); }
.fl-edge { fill: none; stroke: var(--fl-edge); stroke-width: 1.5; stroke-dasharray: 5 5; }
.fl-edge.fl-done { stroke: var(--brand); stroke-width: 2.5; stroke-dasharray: none; }
.fl-edge.fl-skipped { opacity: .5; }
.fl-edge-label { font-size: 11px; font-weight: 500; fill: var(--muted); }
.fl-edge-label.fl-on { fill: var(--brand-ink); font-weight: 600; }

.fl-shape { stroke-width: 1.5; }
.fl-done .fl-shape { fill: var(--brand-soft); stroke: var(--brand); }
.fl-now .fl-shape { fill: var(--brand); stroke: var(--brand); }
.fl-future .fl-shape { fill: var(--surface); stroke: var(--faint); stroke-dasharray: 5 4; }
.fl-skipped .fl-shape { fill: var(--line-soft, var(--ground)); stroke: var(--line); }
.fl-shape.fl-end { stroke-width: 3; }
.fl-pulse { fill: none; stroke: var(--brand); stroke-width: 6; animation: fl-pulse 2.2s var(--ease-out) infinite; }
@keyframes fl-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 0; } }

.fl-label { font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.fl-now .fl-label { fill: #fff; }
.fl-skipped .fl-label { fill: var(--faint); }
.fl-who-dot { fill: var(--gray); }
.fl-who-dot.who-you { fill: var(--amber); }
.fl-who-dot.who-cust { fill: var(--blue); }
.fl-who-dot.who-team { fill: var(--team); }
.fl-now .fl-who-dot { fill: #fff; }
.fl-skipped .fl-who-dot { opacity: .4; }
text.fl-who { font-size: 10px; font-weight: 600; fill: var(--gray); }
text.fl-who.who-you { fill: var(--amber); }
text.fl-who.who-cust { fill: var(--blue); }
text.fl-who.who-team { fill: var(--team); }
.fl-now text.fl-who { fill: rgba(255, 255, 255, .85); }
.fl-skipped text.fl-who { fill: var(--faint); }
.fl-check-bg { fill: var(--brand); }
.fl-check { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }
.fl-gate-label { font-size: 11px; fill: var(--muted); }
.fl-end-label { font-size: 11px; font-weight: 600; fill: var(--ink); }
.fl-skipped .fl-end-label { fill: var(--faint); }
.fl-clock { fill: var(--surface); stroke: var(--amber); stroke-width: 1.6; }
.fl-clock-hand { fill: none; stroke: var(--amber); stroke-width: 1.6; stroke-linecap: round; }
.fl-deadline { font-size: 10.5px; fill: var(--muted); }
.fl-deadline.fl-own { fill: var(--amber); font-weight: 600; }
.fl-node { cursor: default; }

.fl-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 4px 22px 16px; font-size: 12px; color: var(--muted);
    align-items: center; }
.fl-legend > span { display: inline-flex; gap: 6px; align-items: center; }
.fl-sw { width: 22px; height: 12px; border-radius: 4px; display: inline-block; }
.fl-sw.done { background: var(--brand-soft); border: 1.5px solid var(--brand); }
.fl-sw.now { background: var(--brand); }
.fl-sw.future { background: var(--surface); border: 1.5px dashed var(--faint); }
.fl-sw.skipped { background: var(--ground); border: 1px solid var(--line); }

.fl-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .fl-two { grid-template-columns: minmax(0, 1fr); } }
.fl-pad { padding: 14px 22px 0; margin: 0; }
.fl-current { margin: 14px 22px 0; border: 1px solid var(--brand-line); background: var(--brand-soft); border-radius: 12px;
    padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.fl-meter { height: 6px; border-radius: 3px; background: var(--brand-line); overflow: hidden; }
.fl-meter i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.fl-meter.late i { background: var(--red); }
.fl-events { list-style: none; margin: 0; padding: 8px 22px 14px; }
.fl-events li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 9px 0;
    border-bottom: 1px solid var(--line-soft, var(--line)); }
.fl-events li:last-child { border-bottom: 0; }
.fl-when { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
.fl-what { font-weight: 600; font-size: 13px; margin-right: 4px; }
.fl-note { font-size: 12px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .fl-pulse { animation: none; opacity: .3; } }
