/*
 * EasyDive design system
 * Concept: dive slate / instrument readout. Calm water-tinted surfaces, deep-water ink,
 * condensed numerals for values, buoy orange for anything that needs attention.
 * --brand is injected from SystemSetting.primary_color in layout.erb.
 */

:root {
    --brand: #0d6efd;
    --brand-contrast: #ffffff;
    --ink: #12303f;
    --ink-soft: #3b5666;
    --muted: #587585;
    --water: #eef4f6;
    --surface: #ffffff;
    --line: #d3e0e5;
    --line-strong: #b7cad2;
    --buoy: #e8611a;
    --kelp: #1d7f64;
    --reef: #0f8aa6;
    --coral: #c8372d;

    --font-ui: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-readout: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;

    --radius-sm: 4px;
    --radius: 8px;

    /* Bootstrap hooks */
    --bs-body-font-family: var(--font-ui);
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--water);
}

/* ---------- Base ---------- */

body {
    font-family: var(--font-ui);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--water);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-readout);
    font-weight: 600;
    color: var(--ink);
    letter-spacing: 0;
}

h1, .h1 { font-size: 2rem; line-height: 1.15; }
h2, .h2 { font-size: 1.65rem; line-height: 1.2; }
h3, .h3 { font-size: 1.35rem; }
h4, .h4 { font-size: 1.15rem; }
h5, .h5 { font-size: 1.05rem; }
h6, .h6 { font-size: 0.95rem; }

/* Page title icons read as markers, not decoration */
h1 > .fas, h1 > .far, h2 > .fas, h2 > .far,
.h1 > .fas, .h2 > .fas {
    color: var(--brand);
    font-size: 0.8em;
    margin-right: 0.35rem;
    vertical-align: 0.05em;
}

a { color: var(--brand); }
a:hover { color: var(--ink); }

.text-muted { color: var(--muted) !important; }

.border-bottom { border-color: var(--line) !important; }

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

::selection {
    background: color-mix(in srgb, var(--brand) 25%, transparent);
}

/* Numbers should line up like an instrument display */
.table, .badge, .readout, .card h3, .card h4 {
    font-variant-numeric: tabular-nums;
}

/* ---------- Navigation ---------- */

.app-navbar {
    padding-top: 0;
    padding-bottom: 0;
    min-height: 60px;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.app-navbar .navbar-brand {
    font-family: var(--font-readout);
    font-weight: 600;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0;
    margin-right: 1.25rem;
}

.app-navbar .navbar-brand img {
    height: 36px;
    width: auto;
}

.app-navbar .navbar-brand i { margin-right: 0; }

.app-navbar .nav-link {
    font-weight: 500;
    white-space: nowrap;
    position: relative;
    padding: 1.15rem 0.55rem !important;
}

.app-navbar .nav-link > i:first-child {
    opacity: 0.8;
    margin-right: 0.2rem;
}

/* Current section: a waterline under the active item */
.app-navbar .nav-link.active::before {
    content: "";
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--menu-text-color, #fff);
}

.app-navbar .nav-user-name {
    display: inline-block;
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
}

.app-navbar .nav-icon-link {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
}

.app-navbar .nav-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.05rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--buoy);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.1rem;
    text-align: center;
}

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px -12px rgba(18, 48, 63, 0.35);
    padding: 0.4rem;
    font-size: 0.95rem;
}

.dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
    color: var(--ink);
}

.dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--muted);
    margin-right: 0.25rem;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--water);
    color: var(--ink);
}

.dropdown-item.active,
.dropdown-item:active {
    background: color-mix(in srgb, var(--brand) 12%, white);
    color: var(--ink);
    font-weight: 600;
}

.dropdown-item.active i { color: var(--brand); }

.dropdown-header {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    padding: 0.6rem 0.75rem 0.25rem;
}

/* Desktop: the main menu is text only; icons stay in the mobile menu */
@media (min-width: 1200px) {
    .app-navbar .navbar-nav.me-auto .nav-link > i:first-child { display: none; }
}

@media (max-width: 1199.98px) {
    .app-navbar .navbar-collapse {
        padding-bottom: 0.75rem;
    }
    .app-navbar .nav-link {
        padding: 0.6rem 0.25rem !important;
    }
    .app-navbar .nav-link.active::before {
        left: -0.75rem;
        right: auto;
        top: 0.5rem;
        bottom: 0.5rem;
        width: 3px;
        height: auto;
        border-radius: 0 3px 3px 0;
    }
    .app-navbar .dropdown-menu {
        box-shadow: none;
        margin-bottom: 0.5rem;
    }
    .app-navbar .nav-badge { top: 0.2rem; right: auto; left: 1.2rem; }
}

/* ---------- Notification bell ---------- */

.notification-bell-unread {
    color: #ffc107 !important;
    display: inline-block;
    transform-origin: 50% 0;
    animation: bell-shake 1.2s ease-in-out 1;
}

@keyframes bell-shake {
    0%, 100% { transform: rotate(0); }
    15%, 45% { transform: rotate(-14deg); }
    30%, 60% { transform: rotate(14deg); }
    75% { transform: rotate(0); }
}

/* ---------- Layout ---------- */

.app-main {
    padding-top: 1.75rem;
    padding-bottom: 2rem;
}

/* Page header pattern used by most views */
.app-main .border-bottom.mb-3,
.app-main .border-bottom.mb-4 {
    padding-bottom: 0.9rem !important;
}

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

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    background: var(--surface);
}

.card-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 1.1rem;
}

.card-header:first-child { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }

.card-header h5, .card-header h6, .card-header .card-title {
    font-size: 1.05rem;
    margin-bottom: 0;
}

.card-footer {
    background: #f7fafb;
    border-top: 1px solid var(--line);
}

/* Colored header bars become a thin indicator instead of a full color block */
.card-header.bg-primary, .card-header.bg-success, .card-header.bg-info,
.card-header.bg-warning, .card-header.bg-danger, .card-header.bg-secondary,
.card-header.bg-dark {
    background: var(--surface) !important;
    color: var(--ink) !important;
    box-shadow: inset 4px 0 0 var(--tone, var(--brand));
}

.card-header.bg-primary { --tone: var(--brand); }
.card-header.bg-success { --tone: var(--kelp); }
.card-header.bg-info { --tone: var(--reef); }
.card-header.bg-warning { --tone: var(--buoy); }
.card-header.bg-danger { --tone: var(--coral); }
.card-header.bg-secondary, .card-header.bg-dark { --tone: var(--muted); }

.card-header[class*="bg-"] h5, .card-header[class*="bg-"] h6,
.card-header[class*="bg-"] .card-title, .card-header[class*="bg-"] i {
    color: var(--ink) !important;
}

/*
 * Stat tiles (card.bg-*.text-white): rendered as instrument readouts.
 * Big condensed value, small label, a colored rule that tells the category.
 */
.card.text-white.bg-primary, .card.text-white.bg-success, .card.text-white.bg-info,
.card.text-white.bg-warning, .card.text-white.bg-danger, .card.text-white.bg-secondary,
.card.text-dark.bg-warning {
    background: var(--surface) !important;
    color: var(--ink) !important;
    border: 1px solid var(--line);
    border-top: 3px solid var(--tone);
}

.card.text-white.bg-primary { --tone: var(--brand); }
.card.text-white.bg-success { --tone: var(--kelp); }
.card.text-white.bg-info { --tone: var(--reef); }
.card.text-white.bg-warning, .card.text-dark.bg-warning { --tone: var(--buoy); }
.card.text-white.bg-danger { --tone: var(--coral); }
.card.text-white.bg-secondary { --tone: var(--muted); }

.card.text-white[class*="bg-"] .card-body,
.card.text-dark.bg-warning .card-body {
    padding: 1rem 1.15rem;
}

.card.text-white[class*="bg-"] h2,
.card.text-white[class*="bg-"] h3,
.card.text-white[class*="bg-"] h4,
.card.text-dark.bg-warning h3,
.card.text-dark.bg-warning h4 {
    font-family: var(--font-readout);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 0.35rem !important;
    color: var(--ink);
}

.card.text-white[class*="bg-"] p,
.card.text-white[class*="bg-"] small,
.card.text-white[class*="bg-"] .card-text,
.card.text-dark.bg-warning p {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.card.text-white[class*="bg-"] .fas,
.card.text-white[class*="bg-"] .far,
.card.text-dark.bg-warning .fas {
    color: var(--tone);
    font-size: 1.35rem;
    opacity: 0.9;
}

.card.text-white[class*="bg-"] a {
    color: var(--ink);
}

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

.btn {
    border-radius: 6px;
    font-weight: 500;
}

.btn-group-sm .btn, .btn-sm {
    border-radius: var(--radius-sm);
}

.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.btn-group > .btn:last-child,
.btn-group > .btn-group:last-child > .btn { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }

.btn-primary {
    --bs-btn-bg: var(--brand);
    background-color: var(--brand);
    border-color: var(--brand);
    color: var(--brand-contrast);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: color-mix(in srgb, var(--brand) 85%, black);
    border-color: color-mix(in srgb, var(--brand) 85%, black);
    color: var(--brand-contrast);
}

.btn-outline-primary {
    color: var(--brand);
    border-color: var(--brand);
    background-color: transparent;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    color: var(--brand-contrast);
    background-color: var(--brand);
    border-color: var(--brand);
}

.btn-outline-secondary {
    color: var(--ink-soft);
    border-color: var(--line-strong);
    background-color: var(--surface);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active,
.btn-outline-secondary.active,
.btn-check:checked + .btn-outline-secondary {
    color: var(--ink);
    background-color: var(--water);
    border-color: var(--muted);
}

.btn-outline-info {
    color: #0b6f86;
    border-color: var(--reef);
    background-color: transparent;
}

.btn-outline-info:hover,
.btn-outline-info:focus,
.btn-outline-info:active {
    color: #fff;
    background-color: var(--reef);
    border-color: var(--reef);
}

.btn-outline-warning { color: #b4480b; border-color: var(--buoy); background: transparent; }
.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active { color: #fff; background: var(--buoy); border-color: var(--buoy); }
.btn-outline-success { color: var(--kelp); border-color: var(--kelp); background: transparent; }
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active { color: #fff; background: var(--kelp); border-color: var(--kelp); }
.btn-outline-danger { color: var(--coral); border-color: var(--coral); background: transparent; }
.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active { color: #fff; background: var(--coral); border-color: var(--coral); }

/* Bootstrap's info/warning buttons have poor contrast with white text */
.btn-info { background-color: var(--reef); border-color: var(--reef); color: #fff; }
.btn-info:hover { background-color: #0c7189; border-color: #0c7189; color: #fff; }
.btn-warning { background-color: var(--buoy); border-color: var(--buoy); color: #fff; }
.btn-warning:hover { background-color: #c9520f; border-color: #c9520f; color: #fff; }
.btn-success { background-color: var(--kelp); border-color: var(--kelp); }
.btn-success:hover { background-color: #166650; border-color: #166650; }

.btn.dropdown-toggle.btn-outline-secondary { color: var(--ink-soft); }

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

.form-label {
    font-weight: 500;
    color: var(--ink-soft);
    font-size: 0.92rem;
    margin-bottom: 0.3rem;
}

.form-control,
.form-select {
    border-color: var(--line-strong);
    border-radius: 6px;
    color: var(--ink);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand) 20%, transparent);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-text { color: var(--muted); }

/* ---------- Tables & lists ---------- */

.table {
    --bs-table-hover-bg: #f3f8fa;
    color: var(--ink);
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 0.7rem 0.75rem;
    border-bottom-color: var(--line);
}

.table > :not(:first-child) {
    border-top: 1px solid var(--line);
}

.table th,
.table thead th {
    border-top: none;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--muted);
    background-color: #f7fafb;
    white-space: nowrap;
}

.table-dark th, .table thead.table-dark th, .table thead.table-light th {
    background-color: #f7fafb;
    color: var(--muted);
    border-color: var(--line);
}

.list-group-item {
    border-left: none;
    border-right: none;
    border-color: var(--line);
    color: var(--ink);
}

.list-group-item:first-child { border-top: none; }
.list-group-item:last-child { border-bottom: none; }

.list-group-item-action:hover { background: var(--water); }

.list-group-item.active {
    background: var(--brand);
    border-color: var(--brand);
}

/* ---------- Badges, alerts, misc ---------- */

.badge {
    font-size: 0.75em;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.35em 0.55em;
}

.badge.bg-primary { background-color: var(--brand) !important; }
.badge.bg-success { background-color: var(--kelp) !important; }
.badge.bg-info { background-color: var(--reef) !important; color: #fff !important; }
.badge.bg-warning { background-color: #fde3d3 !important; color: #8a3505 !important; }
.badge.bg-danger { background-color: var(--coral) !important; }
.badge.bg-secondary { background-color: #6b8592 !important; }
.badge.bg-light { background-color: var(--water) !important; color: var(--ink-soft) !important; border: 1px solid var(--line); }

.alert {
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: var(--radius);
}

.alert-success { background: #e7f4ef; border-color: #b9ddd0; border-left-color: var(--kelp); color: #11503f; }
.alert-danger { background: #fbeae8; border-color: #f0c3bf; border-left-color: var(--coral); color: #7d1f18; }
.alert-warning { background: #fdf0e7; border-color: #f6cfb5; border-left-color: var(--buoy); color: #7a3207; }
.alert-info { background: #e6f3f7; border-color: #b8dce6; border-left-color: var(--reef); color: #0b4f60; }

.text-warning { color: #c9520f !important; }
.text-success { color: var(--kelp) !important; }
.text-info { color: var(--reef) !important; }
.text-danger { color: var(--coral) !important; }

.progress {
    border-radius: 999px;
    background: #dfe9ed;
}

.progress-bar { border-radius: 999px; background-color: var(--brand); }

.nav-tabs { border-bottom-color: var(--line); }
.nav-tabs .nav-link { color: var(--ink-soft); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--ink); border-color: var(--line) var(--line) var(--surface); }
.nav-pills .nav-link.active { background: var(--brand); }

.page-link { color: var(--brand); border-color: var(--line); }
.page-item.active .page-link { background: var(--brand); border-color: var(--brand); }

.breadcrumb { font-size: 0.9rem; }
.breadcrumb-item a { text-decoration: none; }

.modal-content { border: none; border-radius: var(--radius); }
.modal-header, .modal-footer { border-color: var(--line); }

/* Empty states */
.text-center.py-5 > .fa-3x,
.text-center.py-4 > .fa-3x,
.text-center > .fa-3x.text-muted {
    color: var(--line-strong) !important;
}

/* ---------- Footer ---------- */

.app-footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
}

.app-footer a { color: var(--muted); text-decoration: none; }
.app-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Auth pages (no navbar) ---------- */

body.auth-page {
    /* Water column: light at the surface, deeper toward the bottom */
    background: linear-gradient(180deg, #e8f2f5 0%, #cfe3ea 55%, #9cc3d1 100%) fixed;
}

body.auth-page .app-main {
    padding-top: 8vh;
}

body.auth-page .card {
    border: none;
    box-shadow: 0 24px 60px -24px rgba(18, 48, 63, 0.45);
}

body.auth-page .card-body {
    padding: 2rem;
}

body.auth-page .app-footer {
    background: transparent;
    border-top: none;
}

/* Legacy login container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Domain helpers ---------- */

.dashboard-stat-card .card-body { padding: 1.5rem; }

.dashboard-stat-card h4 {
    font-family: var(--font-readout);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.ttu-progress-item {
    border-left: 4px solid var(--brand);
    padding-left: 1rem;
}

.ttu-progress-item.overdue { border-left-color: var(--coral); }

.cert-status-active { color: var(--kelp); }
.cert-status-expired { color: var(--coral); }
.cert-status-expiring { color: var(--buoy); }

.readout {
    font-family: var(--font-readout);
    font-weight: 600;
    line-height: 1;
}

/* ---------- Training records ---------- */

/* Values written on the form show in the same pen blue they get in the PDF */
:root { --pen: #0f3a8c; }

.record-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px dotted var(--line-strong);
}

.record-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 14rem;
}

.record-progress .progress { flex: 1; height: 6px; }

.record-sheet {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.sheet-col { display: flex; flex-direction: column; gap: 1.5rem; }

.sheet-h {
    font-size: 1.15rem;
    margin: 0 0 0.6rem;
}

.slots { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }

.slot {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
}

.slot-title b { font-weight: 600; }
.slot-title small { display: block; color: var(--muted); }

.slot-cells {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 0.6rem 0 0;
}

.slot-cells div { display: flex; flex-direction: column-reverse; }

.slot-cells dd {
    margin: 0;
    min-height: 1.7rem;
    border-bottom: 2px solid var(--line-strong);
    text-align: center;
    font-family: var(--font-readout);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--pen);
}

.slot.is-signed .slot-cells dd { border-bottom-color: var(--pen); }

.slot-cells dt {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    margin-top: 0.15rem;
}

.slot-actions, .slot-sign { margin-top: 0.6rem; }
.slot-sign summary { list-style: none; }
.slot-sign summary::-webkit-details-marker { display: none; }
.slot-sign[open] summary { display: none; }
.slot-form { padding-top: 0.25rem; }

.skills-date { display: flex; align-items: center; gap: 0.6rem; margin: 0; }
.skills-date span { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.skills-date input { max-width: 11rem; }

.skills {
    list-style: none;
    padding: 0;
    margin: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.skill-row, .skill-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0.9rem;
    border-bottom: 1px solid var(--line);
}

.skills li:last-child { border-bottom: 0; }
.skill-note { color: var(--muted); font-style: italic; font-size: 0.92rem; }

.skill { display: flex; align-items: center; gap: 0.7rem; margin: 0; cursor: pointer; }

.skill input {
    width: 1.3rem;
    height: 1.3rem;
    flex: none;
    accent-color: var(--pen);
    cursor: pointer;
}

.skill.is-done .skill-label { color: var(--ink); }
.skill-by { color: var(--pen); font-family: var(--font-readout); font-weight: 500; white-space: nowrap; }

.exam-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }

.exam-choice label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.1rem 0.6rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    cursor: pointer;
}

.exam-choice label.is-on { border-color: var(--pen); box-shadow: inset 0 0 0 1px var(--pen); }
.exam-choice input { grid-row: span 2; margin-top: 0.3rem; accent-color: var(--pen); }
.exam-choice small { color: var(--muted); }

.cert {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.cert.is-done { border-color: var(--kelp); }
.cert-statement { color: var(--ink-soft); max-width: 75ch; }
.cert-open { color: var(--ink-soft); }

.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.cert-party[hidden] { display: none; }

.cert-sigs { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; }
.cert-sig, .pad-signed, .cert-stored { margin: 0; }

.cert-sig img, .pad-signed img, .cert-stored img {
    display: block;
    max-width: 240px;
    max-height: 80px;
    border-bottom: 2px solid var(--pen);
    padding-bottom: 0.25rem;
}

.cert-sig figcaption, .pad-signed figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.3rem; }

.cert-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-top: 1.25rem; }

.sign[hidden] { display: none; }
.sign-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.3rem; font-size: 0.92rem; }
.sign.is-empty [data-clear] { visibility: hidden; }

.sign canvas {
    display: block;
    width: 100%;
    height: 140px;
    background: #fbfdfe repeating-linear-gradient(transparent 0 109px, var(--line-strong) 109px 110px, transparent 110px 140px);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-sm);
    touch-action: none;
    cursor: crosshair;
}

.pad-wait { color: var(--buoy); font-size: 0.92rem; margin: 0.4rem 0; }
.pad-send { margin-top: 0.4rem; }

.record-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 991.98px) {
    .record-sheet { grid-template-columns: 1fr; }
}

@media (max-width: 575.98px) {
    .exam-choice { grid-template-columns: 1fr; }
    .slot-cells dd { font-size: 1rem; }
}

/* ---------- Presenter ---------- */

.presenter-area {
    color: var(--ink);
}

.presenter-area .fas {
    color: var(--brand);
}

.presenter-area:hover,
.presenter-area:focus-visible {
    border-color: var(--brand);
    color: var(--ink);
}

/* School slide preview: the presenter's own rendering, at display proportions */
.slide-preview {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: #04263f;
    border: 1px solid var(--line);
}

.slide-preview iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.coupling {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.coupling-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 75vh;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.coupling-item {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: none;
    text-align: left;
    font-size: 0.9rem;
}

.coupling-item b { font-weight: 500; }
.coupling-item span { color: var(--muted); font-variant-numeric: tabular-nums; }
.coupling-item.is-linked span { color: var(--pen); font-weight: 600; }
.coupling-item.is-current { background: color-mix(in srgb, var(--brand) 12%, white); }
.coupling-item:hover { background: var(--water); }

.coupling-pane {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.75rem;
}

.coupling-pane canvas { display: block; border: 1px solid var(--line); }

.coupling-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.6rem;
}

@media (max-width: 991.98px) {
    .coupling { grid-template-columns: 1fr; }
    .coupling-list { max-height: 30vh; }
}

/* ---------- Dive statistics ---------- */

.stat-readouts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.stat-readouts > div {
    padding: 1.1rem 1.25rem;
    border-right: 1px solid var(--line);
}

.stat-readouts > div:last-child { border-right: none; }

.stat-readouts .readout,
.list-unstyled .readout {
    line-height: 1.5;
}

.stat-readouts .readout {
    font-size: 2.5rem;
    display: block;
}

.stat-readouts .readout small {
    font-size: 1rem;
    color: var(--muted);
    margin-left: 0.15rem;
    font-weight: 500;
}

.stat-readouts .label {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Monthly profile: bars hang from the waterline like a dive profile */
.dive-profile {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    align-items: start;
    border-top: 2px solid var(--reef);
    padding-top: 0;
    height: 220px;
}

.dive-profile .month {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.dive-profile .bar {
    width: 100%;
    max-width: 40px;
    min-height: 2px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--reef) 55%, white), var(--brand));
    border-radius: 0 0 6px 6px;
    position: relative;
}

.dive-profile .bar.empty { background: var(--line); }

.dive-profile .count {
    font-family: var(--font-readout);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.25rem;
    color: var(--ink);
}

.dive-profile .name {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: auto;
}

.depth-bands .band {
    display: grid;
    grid-template-columns: 6.5rem 1fr 2.5rem;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
}

.depth-bands .track {
    height: 10px;
    background: var(--water);
    border-radius: 999px;
    overflow: hidden;
}

.depth-bands .fill {
    height: 100%;
    border-radius: 999px;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
    .app-main { padding-top: 1.1rem; }

    h1, .h1 { font-size: 1.6rem; }
    h2, .h2 { font-size: 1.4rem; }

    .btn-toolbar {
        justify-content: flex-start;
        margin-bottom: 1rem;
    }

    .table-responsive { border: none; }

    .card.text-white[class*="bg-"] { margin-bottom: 0.75rem; }

    .stat-readouts > div { border-right: none; border-bottom: 1px solid var(--line); }
    .stat-readouts > div:last-child { border-bottom: none; }

    .dive-profile { gap: 3px; height: 180px; }
    .dive-profile .name { font-size: 0.65rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---------- Print ---------- */

@media print {
    .navbar,
    .btn,
    .alert,
    .app-footer {
        display: none;
    }

    body { background: #fff; }

    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
}

/* A menu with many pages: its groups in two columns on wide screens */
.nav-mega ul { list-style: none; margin: 0; padding: 0; }
.nav-mega-group + .nav-mega-group { margin-top: .4rem; }
@media (min-width: 1200px) {
    .nav-mega.show { display: grid; grid-template-columns: repeat(2, max-content); column-gap: 1.5rem; }
    .nav-mega-group + .nav-mega-group { margin-top: 0; }
    .nav-mega-group { padding-bottom: .4rem; }
}

/* What waits for one: customer conversations (kelp, as in the app), mail (reef), notifications */
.app-navbar .nav-badge.is-kelp { background: var(--kelp); }
.app-navbar .nav-badge.is-reef { background: var(--reef); }
.app-navbar .nav-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .55); }
.nav-user-head { display: grid; padding: .35rem .75rem .25rem; line-height: 1.25; }
.nav-user-head small { color: var(--muted); }
@media (min-width: 1200px) {
    /* in the bar the avatar is enough; the name stands at the top of its menu */
    .app-navbar .nav-user-name { display: none; }
    .app-navbar .nav-inbox { gap: 2px; }
}

/* Gear menu (dive centre settings): an icon in the bar, a labelled entry in the mobile menu */
.app-navbar .nav-icon-label { margin-left: 0.35rem; }

@media (min-width: 1200px) {
    .app-navbar .nav-icon-label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .app-navbar .nav-icon-menu .dropdown-toggle::after { display: none; }
}

/* ---------- Profile photos ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.avatar-initials {
    background: color-mix(in srgb, var(--brand) 14%, white);
    color: var(--ink);
    font-family: var(--font-readout);
    font-weight: 600;
}

/* the profile link centres its picture on the bar like the icons (inline it sat on the text's baseline) */
.app-navbar .nav-link:has(.nav-avatar) { display: flex; align-items: center; gap: 0.15rem; height: 100%; }
.app-navbar .nav-avatar {
    margin: -4px 0;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--menu-text-color, #fff) 60%, transparent);
}

/* Search for a person (welcome slide instructors) */
.person-picker { position: relative; }
.person-picked {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 38px;
}
.person-picked .btn-link { padding: 0; font-size: 0.875rem; }
.person-results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    box-shadow: 0 12px 32px -12px rgba(18, 48, 63, 0.35);
}
.person-results .list-group-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* ---------- My profile ---------- */

/* The person first: photo, name and role, like the card in a dive logbook */
.profile-id {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 1.25rem 1.5rem;
    padding: 0.5rem 0 1.5rem;
}

.profile-photo { position: relative; margin: 0; }

.profile-photo .avatar {
    width: 96px;
    height: 96px;
    box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line);
    font-size: 2.2rem !important;
}

.profile-photo-edit {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-contrast);
    box-shadow: 0 0 0 3px var(--water);
    cursor: pointer;
}

.profile-photo-edit:hover { filter: brightness(1.1); }

.profile-photo-edit:focus-within {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.profile-id h1 {
    margin: 0 0 0.25rem;
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    line-height: 1.1;
}

.profile-id-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 1rem;
    margin: 0 0 0.35rem;
    color: var(--muted);
}

.profile-role {
    padding: 0.1rem 0.55rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--brand) 12%, white);
    color: var(--ink);
    font-weight: 600;
    font-size: 0.9rem;
}

.profile-id-hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
}

.profile-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Sections: underlined like the menu's waterline */
.profile-tabs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}

.profile-tabs a {
    flex: none;
    position: relative;
    padding: 0.6rem 0;
    color: var(--muted);
    font-weight: 500;
    text-decoration: none;
}

.profile-tabs a:hover { color: var(--ink); }

.profile-tabs a.active { color: var(--ink); font-weight: 600; }

.profile-tabs a.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--brand);
}

.profile-panel[hidden] { display: none; }

/* Personal data: what a group is for on the left, its fields on the right */
.profile-group {
    display: grid;
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
    gap: 1rem 2.5rem;
    padding: 1.5rem 1.5rem;
    border-bottom: 1px solid var(--line);
}

.profile-group-intro h2 {
    margin: 0 0 0.3rem;
    font-size: 1.1rem;
}

.profile-group-intro p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
}

/* the mobile number: country code and number as one field, and how it is read */
.phone-field-input { display: flex; }
.phone-field-input .form-select {
    flex: 0 0 auto; width: auto; max-width: 13.5rem; border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-right: 0; background-color: var(--water); font-family: var(--font-readout);
}
.phone-field-input .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
.phone-field-input .form-select:focus { position: relative; z-index: 1; }
.phone-field-read { margin: 6px 0 0; font-size: .86rem; color: var(--muted); }
.phone-field-read output { font: 600 1.02rem var(--font-readout); color: var(--kelp); letter-spacing: .02em; }
.phone-field-read.is-warn { color: #a8460f; }
@media (max-width: 480px) { .phone-field-input .form-select { max-width: 9.5rem; } }
.profile-form input[readonly] {
    background: var(--water);
    color: var(--muted);
}

.profile-form-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem;
    background: color-mix(in srgb, var(--water) 50%, white);
    border-radius: 0 0 var(--radius) var(--radius);
}

@media (max-width: 991.98px) {
    .profile-id { grid-template-columns: auto minmax(0, 1fr); }
    .profile-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .profile-group { grid-template-columns: 1fr; padding: 1.25rem; }
}

@media (max-width: 575.98px) {
    .profile-id { grid-template-columns: 1fr; justify-items: start; }
    .profile-photo .avatar { width: 80px; height: 80px; }
}

/* ---------- Mailbox ---------- */

/* Three columns like a mail program: mailboxes, list, open mail. On phones the list
   or the open mail fills the screen. */
.mailbox {
    display: grid;
    grid-template-columns: 14rem minmax(19rem, 26rem) minmax(0, 1fr);
    height: calc(100dvh - 60px - 3rem);
    min-height: 34rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
}

.mail-rail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: var(--water);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.mail-account h2 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-folder {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    text-decoration: none;
}

.mail-folder i { width: 1rem; text-align: center; color: var(--muted); }
.mail-folder:hover { background: color-mix(in srgb, var(--brand) 6%, white); color: var(--ink); }

.mail-folder.active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--brand);
}

.mail-count {
    margin-left: auto;
    min-width: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--buoy);
    color: #fff;
    font-family: var(--font-readout);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.mail-sync {
    margin: 0.3rem 0.6rem 0;
    font-size: 0.8rem;
    color: var(--muted);
}

.mail-sync.is-error { color: var(--coral); }
.mail-sync.is-error a { display: block; color: var(--coral); }

.mail-manage {
    margin-top: auto;
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
}

.mail-manage:hover { color: var(--ink); }

/* list */
.mail-list {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--line);
}

.mail-list-head {
    padding: 0.9rem 1rem 0.6rem;
    border-bottom: 1px solid var(--line);
}

.mail-list-title {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.mail-list-title h1 { margin: 0; font-size: 1.35rem; }

.mail-list-title > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.85rem;
    color: var(--muted);
}

[data-sync].is-busy i { animation: mail-spin 0.8s linear infinite; }

@keyframes mail-spin { to { transform: rotate(360deg); } }

.mail-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.8rem;
}

.mail-search input[type="search"] { flex: 1 1 12rem; }

.mail-filter {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.mail-bulk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    font-size: 0.875rem;
}

.mail-bulk[hidden] { display: none; }
.mail-bulk [data-bulk-count] { margin-right: auto; color: var(--muted); }

.mail-items {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-y: auto;
}

.mail-item {
    position: relative;
    display: flex;
    border-bottom: 1px solid var(--line);
}

.mail-item > a {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.1rem 0.6rem;
    padding: 0.7rem 1rem 0.7rem 0.2rem;
    color: var(--ink-soft);
    text-decoration: none;
}

.mail-item:hover { background: color-mix(in srgb, var(--water) 60%, white); }
.mail-item.is-open { background: color-mix(in srgb, var(--brand) 9%, white); }

.mail-check {
    flex: none;
    display: grid;
    place-items: start center;
    width: 2.2rem;
    padding-top: 0.85rem;
    cursor: pointer;
}

/* checkboxes appear on hover, focus and while selecting, so the list stays calm */
.mail-item .mail-check input { opacity: 0; }
.mail-item:hover .mail-check input,
.mail-item .mail-check input:focus-visible,
.mail-item .mail-check input:checked,
.is-selecting .mail-item .mail-check input { opacity: 1; }

@media (hover: none) {
    .mail-item .mail-check input { opacity: 1; }
}

.mail-who,
.mail-subject,
.mail-preview {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mail-who { color: var(--ink); }

.mail-item time {
    font-family: var(--font-readout);
    font-size: 0.82rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.mail-subject { grid-column: 1 / -1; color: var(--ink); }
.mail-subject i { margin-right: 0.25rem; color: var(--muted); font-size: 0.8em; }

.mail-preview {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: var(--muted);
}

/* unread: bold, with the buoy-orange dot where the checkbox rests */
.mail-item.is-unread .mail-who,
.mail-item.is-unread .mail-subject { font-weight: 600; }

.mail-item.is-unread::before {
    content: "";
    position: absolute;
    left: 0.8rem;
    top: 1.15rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--buoy);
    pointer-events: none;
}

.mail-item.is-unread:hover::before,
.is-selecting .mail-item.is-unread::before { display: none; }

.mail-list-empty {
    margin: 0;
    padding: 2rem 1.25rem;
    color: var(--muted);
}

.mail-pages {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--muted);
}

/* reading pane */
.mail-pane {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
}

.mail-pane[aria-busy="true"] { opacity: 0.5; }

.mail-pane-empty {
    display: grid;
    place-items: center;
    height: 100%;
    margin: 0;
    color: var(--muted);
}

.mail-read {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1rem 1.5rem 1.5rem;
}

.mail-read-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.mail-back { display: none; text-decoration: none; }

.mail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.mail-read-subject {
    margin: 0 0 1rem;
    font-size: clamp(1.35rem, 2vw, 1.75rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.mail-read-meta {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.mail-read-meta .avatar { width: 40px; height: 40px; font-size: 15px; }
.mail-read-meta p { margin: 0; overflow-wrap: anywhere; }
.mail-from span, .mail-to { font-size: 0.875rem; color: var(--muted); }

.mail-read-meta time {
    font-family: var(--font-readout);
    font-size: 0.9rem;
    color: var(--muted);
    white-space: nowrap;
}

.mail-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.mail-files a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    max-width: 18rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--water);
    color: var(--ink);
    text-decoration: none;
    font-size: 0.875rem;
}

.mail-files a:hover { border-color: var(--line-strong); }
.mail-files small { color: var(--muted); white-space: nowrap; }

.mail-images-note {
    margin: 1rem 0 0;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--buoy) 10%, white);
    font-size: 0.85rem;
    color: var(--ink-soft);
}

.mail-html {
    flex: 1;
    width: 100%;
    min-height: 28rem;
    margin-top: 1rem;
    border: 0;
    background: #fff;
}

.mail-text {
    margin-top: 1rem;
    max-width: 72ch;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.6;
}

.mail-toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    max-width: 24rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 12px 32px -12px rgba(18, 48, 63, 0.5);
}

.mail-toast.is-error { background: var(--coral); }

.mail-empty-start { max-width: 40rem; padding: 2rem 0; }
.mail-empty-start p { color: var(--muted); }

@media (max-width: 1199.98px) {
    .mailbox { grid-template-columns: 12rem minmax(17rem, 22rem) minmax(0, 1fr); }
}

@media (max-width: 991.98px) {
    .mailbox {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        border: 0;
        background: none;
        overflow: visible;
    }
    .mail-rail { gap: 0.75rem; border: 0; padding: 0 0 1rem; background: none; overflow: visible; }
    .mail-rail > .btn { margin: 0 !important; }
    .mail-account { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
    .mail-account h2 { flex-basis: 100%; }
    .mail-account .mail-folder.active { box-shadow: inset 0 -2px 0 var(--brand); }
    .mail-sync:not(.is-error) { display: none; }
    .mail-manage { margin: 0; }
    .mail-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
    .mail-items { overflow: visible; }
    .mail-pane { display: none; overflow: visible; }
    .mailbox.has-mail .mail-rail,
    .mailbox.has-mail .mail-list { display: none; }
    .mailbox.has-mail .mail-pane { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
    .mail-back { display: inline-flex; align-items: center; gap: 0.35rem; }
    .mail-read { padding: 1rem; }
    .mail-html { min-height: 70vh; }
}

/* ---------- Compose ---------- */

.compose {
    display: flex;
    flex-direction: column;
    max-width: 60rem;
    margin: 0 auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.compose-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.compose-head h1 { margin: 0 auto 0 0; font-size: 1.35rem; }

.compose-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.9rem;
    margin: 0;
    padding: 0 1.25rem;
    border-bottom: 1px solid var(--line);
}

.compose-label {
    flex: none;
    width: 5.5rem;
    font-size: 0.875rem;
    color: var(--muted);
}

.compose-row input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0;
    border: 0;
    background: none;
    color: var(--ink);
}

.compose-row input:focus { outline: none; }
.compose-row:focus-within { box-shadow: inset 3px 0 0 var(--brand); }

.compose-editor .ql-toolbar.ql-snow {
    border: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.4rem 1rem;
}

.compose-editor .ql-container.ql-snow {
    border: 0;
    font-family: var(--font-ui);
    font-size: 1rem;
}

.compose-editor .ql-editor { min-height: 18rem; padding: 1rem 1.25rem; line-height: 1.6; }

.compose-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.25rem;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--water) 50%, white);
    border-radius: 0 0 var(--radius) var(--radius);
}

.compose-foot .mail-files { margin: 0; }

.compose-file {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.4rem 0.25rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.875rem;
}

.compose-file small { color: var(--muted); }

.compose-status { flex-basis: 100%; margin: 0; font-size: 0.9rem; color: var(--muted); }
.compose-status:empty { display: none; }
.compose-status.is-error { color: var(--coral); font-weight: 500; }

@media (max-width: 575.98px) {
    .compose { border-left: 0; border-right: 0; border-radius: 0; margin: 0 -12px; }
    .compose-label { width: 4.5rem; }
}

/* ---------- My slides (profile) ---------- */

/* Settings ordered like the display shows them: the header line of every slide,
   the four slides of a course day in their order, the footer of welcome and
   goodbye. The preview stays in view and follows the part being edited. */
.ms-intro { max-width: 70ch; color: var(--muted); }

.ms-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 0.85fr);
    gap: 1.5rem;
    align-items: start;
}

.ms-sections { display: flex; flex-direction: column; gap: 1rem; }

.ms-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 1rem 1.25rem 1.1rem;
}

.ms-section > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ms-section h2 { margin: 0; font-size: 1.1rem; }
.ms-body { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.ms-hint { margin: 0.15rem 0 0; font-size: 0.875rem; color: var(--muted); }

.ms-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 1.25rem; }
.ms-row > .ms-field { flex: 1 1 16rem; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.75rem; }

.ms-field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; }
.ms-field > span, .ms-label { font-size: 0.85rem; color: var(--muted); }
.ms-switch { margin: 0; }
.ms-note { color: var(--muted); }
.ms-logo-img { max-height: 44px; max-width: 160px; object-fit: contain; }

/* the course day: four slides in their order, joined by a line */
.ms-day {
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ms-step { position: relative; padding-left: 3.4rem; }

.ms-step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 1rem;
    top: 1rem;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-contrast);
    font-family: var(--font-readout);
    font-weight: 600;
    font-size: 0.9rem;
}

.ms-step:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 1.8rem;
    top: 2.9rem;
    bottom: -1.05rem;
    width: 2px;
    background: color-mix(in srgb, var(--brand) 25%, transparent);
}

.ms-step.is-off::before { background: var(--line-strong); }
.ms-step.is-off .ms-body, .ms-step.is-off .ms-hint { opacity: 0.45; }

.ms-sub { padding-top: 0.75rem; border-top: 1px solid var(--line); }
.ms-sub-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.ms-sub h3 { margin: 0; font-size: 1rem; }
.ms-person { display: flex; flex-direction: column; gap: 0.4rem; }
.ms-place { display: flex; flex-direction: column; gap: 0.25rem; }
.ms-place-search, .ms-place-results { max-width: 26rem; }
.ms-place-search { margin-top: 0.35rem; }
.ms-switches { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-top: 0.6rem; }

/* preview: in view while scrolling */
.ms-preview { position: sticky; top: 1rem; }

.ms-preview-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.ms-preview-tabs button {
    padding: 0.25rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 0.875rem;
}

.ms-preview-tabs button.active { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.ms-preview-state { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--muted); }

.ms-save {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(6px);
    box-shadow: 0 -8px 24px -18px rgba(18, 48, 63, 0.45);
}

.ms-save [data-dirty] { color: var(--buoy); font-weight: 500; }

@media (max-width: 991.98px) {
    .ms-layout { grid-template-columns: 1fr; }
    /* on small screens the preview comes first and scrolls away */
    .ms-preview { position: static; order: -1; }
}

/* mail folders: own folders nest under their parent */
.mail-folder { padding-left: calc(0.6rem + var(--depth, 0) * 0.9rem); }
.mail-folder > span:not(.mail-count) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-count.is-quiet { background: var(--line-strong); color: var(--ink); }
.mail-move { width: auto; max-width: 12rem; }
.mail-actions .mail-move { height: calc(1.5em + 0.5rem + 2px); }

/* ---------- Mailbox rail: account switch, folder groups, drag and drop ---------- */

.mail-rail { gap: 0.9rem; padding: 0.9rem 0.75rem; }

.mail-switch summary,
.mail-switch.is-single,
.mail-switch li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.mail-switch summary {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    list-style: none;
}

.mail-switch summary::-webkit-details-marker { display: none; }
.mail-switch summary > i { margin-left: auto; color: var(--muted); font-size: 0.75rem; transition: transform 0.15s; }
.mail-switch[open] summary > i { transform: rotate(180deg); }
.mail-switch.is-single { padding: 0 0.6rem; }

.mail-switch span:first-child { display: flex; flex-direction: column; min-width: 0; }
.mail-switch b, .mail-switch small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-switch b { font-family: var(--font-readout); font-weight: 600; color: var(--ink); }
.mail-switch small { font-size: 0.78rem; color: var(--muted); }

.mail-switch ul {
    margin: 0.35rem 0 0;
    padding: 0.3rem;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 28px -16px rgba(18, 48, 63, 0.45);
}

.mail-switch li a { padding: 0.4rem 0.5rem; border-radius: var(--radius-sm); text-decoration: none; }
.mail-switch li a:hover { background: var(--water); }
.mail-switch li a[aria-current] { background: color-mix(in srgb, var(--brand) 9%, white); }

.mail-folders { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -0.25rem; padding: 0 0.25rem; }

.mail-folder-group { margin: 0; padding: 0; list-style: none; }
.mail-folder-group + .mail-group-title,
.mail-folder-group + .mail-folder-group { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--line); }

.mail-group-title {
    margin: 0 0 0.25rem;
    padding: 0 0.6rem;
    font-family: var(--font-ui);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.mail-subfolders { margin: 0; padding: 0; list-style: none; }
.mail-folder-item { position: relative; }
.mail-folder-item.is-folded > .mail-subfolders { display: none; }

.mail-twisty {
    position: absolute;
    left: calc(0.15rem + var(--depth, 0) * 1rem);
    top: 0.45rem;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: none;
    color: var(--muted);
    font-size: 0.65rem;
}

.mail-twisty:hover { background: var(--line); color: var(--ink); }
.mail-twisty[aria-expanded="false"] i { transform: rotate(-90deg); }

.mail-folder { padding-left: calc(1.2rem + var(--depth, 0) * 1rem); }
.mail-folder i { flex: none; }

/* a folder a dragged mail can go into */
.is-dragging .mail-folder:not(.active) { outline: 1px dashed transparent; }
.is-dragging .mail-folder:not(.active):hover,
.mail-folder.is-drop {
    background: color-mix(in srgb, var(--brand) 14%, white);
    color: var(--ink);
    box-shadow: inset 0 0 0 2px var(--brand);
}
.mail-folder.is-drop[data-drop-folder] i { color: var(--brand); }

.mail-item[draggable="true"] { cursor: grab; }
.mail-item.is-dragged { opacity: 0.45; }

.mail-drag-tag {
    position: fixed;
    top: -200px;
    left: -200px;
    max-width: 16rem;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-sm);
    background: var(--ink);
    color: #fff;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.mail-rail-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.6rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.8rem;
    color: var(--muted);
}

.mail-rail-foot a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.mail-rail-foot a:hover { color: var(--ink); }

@media (max-width: 991.98px) {
    .mail-folders { overflow: visible; }
    .mail-folder-group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
    .mail-folder-group + .mail-group-title,
    .mail-folder-group + .mail-folder-group { border-top: 0; padding-top: 0; margin-top: 0.4rem; }
    .mail-subfolders { display: contents; }
    .mail-twisty { display: none; }
    .mail-folder { padding-left: 0.6rem; border: 1px solid var(--line); background: var(--surface); }
    .mail-rail-foot { border-top: 0; padding-top: 0; }
}
.mail-rail-foot span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Mail toolbar: reply group and tidy-up group ---------- */

.mail-read { container-type: inline-size; }
.mail-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-left: auto; }

.mail-seg {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
}

.mail-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    height: 2.1rem;
    padding: 0 0.7rem;
    border: 0;
    background: none;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.mail-seg > * + *,
.mail-seg > .mail-move-menu + .mail-tool { border-left: 1px solid var(--line); }
.mail-seg > :first-child, .mail-seg > :first-child > .mail-tool { border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); }
.mail-seg > :last-child { border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; }

.mail-tool:hover, .mail-move-menu[open] > .mail-tool { background: var(--water); color: var(--ink); }
.mail-tool:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mail-tool i { font-size: 0.9em; }

/* the one thing most people do next */
.mail-tool.is-primary { color: var(--brand); font-weight: 600; }
.mail-tool.is-primary:hover { background: color-mix(in srgb, var(--brand) 8%, white); color: var(--brand); }

.mail-tool.is-danger:hover { background: color-mix(in srgb, var(--coral) 10%, white); color: var(--coral); }

.mail-tool-caret { font-size: 0.65em !important; color: var(--muted); }

/* folder menu */
.mail-move-menu { position: relative; }
.mail-move-menu > summary { list-style: none; height: 100%; }
.mail-move-menu > summary::-webkit-details-marker { display: none; }

.mail-move-menu ul {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 30;
    min-width: 13rem;
    max-height: 22rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 14px 32px -14px rgba(18, 48, 63, 0.45);
}

.mail-move-menu li button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.4rem 0.6rem 0.4rem calc(0.6rem + var(--depth, 0) * 0.9rem);
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--ink);
    font-size: 0.9rem;
    text-align: left;
}

.mail-move-menu li button i { width: 1rem; text-align: center; color: var(--muted); }
.mail-move-menu li button:hover, .mail-move-menu li button:focus-visible { background: var(--water); outline: none; }

/* bulk bar: the menu opens to the right of its button */
.mail-bulk .mail-move-menu ul { right: auto; left: 0; }
.mail-bulk .mail-seg { margin-left: auto; }

/* a narrow reading pane keeps the icons, drops the words */
@container (max-width: 34rem) {
    .mail-read .mail-tool-text { display: none; }
}
/* the selection bar is narrow: icons, with their names as tooltips */
.mail-bulk .mail-tool-text { display: none; }
.mail-bulk [data-bulk-count] { white-space: nowrap; }

/* ---------- Data protection ---------- */
.dp-rules td { vertical-align: top; }
.dp-rules td:nth-child(2) { max-width: 22rem; }
.dp-period { min-width: 11rem; }
.dp-period .input-group { max-width: 10rem; }
.dp-off td > *:not(.form-check) { opacity: 0.5; }
.dp-notes dt { font-weight: 600; }
.dp-notes dd { margin-bottom: 0.5rem; max-width: 80ch; }

/* ---------- Legal texts (Impressum, Datenschutz, AGB) ---------- */

/* One frame for all three: switcher, title with version date, contents that stay
   in view and mark the section being read, the text at a readable width */
.legal { max-width: 68rem; margin: 0 auto; }

.legal-switch {
    display: inline-flex;
    margin-bottom: 1.5rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
}

.legal-switch a {
    padding: 0.4rem 1rem;
    color: var(--ink-soft);
    font-weight: 500;
    text-decoration: none;
}

.legal-switch a + a { border-left: 1px solid var(--line); }
.legal-switch a:hover { background: var(--water); color: var(--ink); }
.legal-switch a.active { background: var(--brand); color: var(--brand-contrast); }
.legal-switch a:first-child { border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px); }
.legal-switch a:last-child { border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0; }

.legal-head { padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.legal-head h1 { margin: 0 0 0.25rem; font-size: clamp(1.7rem, 3vw, 2.3rem); max-width: 30ch; }
.legal-head p { margin: 0; color: var(--muted); }

.legal-layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
}

/* contents */
.legal-toc { position: sticky; top: 1.25rem; }
.legal-toc summary { list-style: none; font-weight: 600; color: var(--ink); margin-bottom: 0.5rem; cursor: default; }
.legal-toc summary::-webkit-details-marker { display: none; }
.legal-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }

.legal-toc a {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr);
    gap: 0.25rem;
    margin-left: -1px;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.35;
    text-decoration: none;
}

.legal-toc a span:only-child { grid-column: 1 / -1; }
.legal-toc a:hover { color: var(--ink); }
.legal-toc a.active { border-left-color: var(--brand); color: var(--ink); font-weight: 500; }
.legal-toc-n { font-family: var(--font-readout); font-variant-numeric: tabular-nums; color: var(--muted); }

/* the text */
.legal-text { max-width: 72ch; line-height: 1.65; }
.legal-text h2 { margin: 2.25rem 0 0.6rem; font-size: 1.3rem; scroll-margin-top: 1.25rem; }
.legal-text h2:first-child { margin-top: 0; }
.legal-text h3 { margin: 1.5rem 0 0.4rem; font-size: 1.05rem; }
.legal-text h4 { margin: 0 0 0.4rem; font-size: 1rem; }
.legal-text ul, .legal-text ol { padding-left: 1.2rem; }
.legal-text li { margin-bottom: 0.25rem; }
.legal-text address { margin: 0.5rem 0 1rem; padding-left: 1rem; border-left: 3px solid var(--line); }

/* notices inside a text: one quiet style instead of coloured alert boxes */
.legal-text .alert {
    margin: 1rem 0;
    padding: 1rem 1.25rem;
    border: 0;
    border-left: 3px solid var(--brand);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--surface);
    color: var(--ink);
}
.legal-text .alert-warning { border-left-color: var(--buoy); }
.legal-text .alert i { display: none; }
.legal-text .alert > :last-child { margin-bottom: 0; }

@media (max-width: 991.98px) {
    .legal-layout { grid-template-columns: 1fr; gap: 1rem; }
    .legal-toc { position: static; padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
    .legal-toc summary { margin: 0; cursor: pointer; }
    .legal-toc details[open] summary { margin-bottom: 0.5rem; }
}

/* ---------- Wer sieht wen? (access grants) ---------- */
.wsw-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.wsw-head h1 { margin-right: auto; }
.wsw-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.wsw-switch a { padding: 0.4rem 0.9rem; color: var(--ink-soft); text-decoration: none; font-weight: 500; }
.wsw-switch a + a { border-left: 1px solid var(--line); }
.wsw-switch a.active { background: var(--brand); color: var(--brand-contrast); }
.wsw-search { width: min(18rem, 100%); }
.wsw-intro { color: var(--muted); max-width: 80ch; margin-bottom: 1.25rem; }

/* one instructor: who, how many, the rules as sentences */
.wsw-person { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1rem; }
.wsw-person > header { display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); }
.wsw-name { margin-right: auto; }
.wsw-name h2 { font-size: 1.1rem; margin: 0; }
.wsw-name small { color: var(--muted); }
.wsw-count { text-align: right; line-height: 1.05; }
.wsw-count strong { display: block; font-family: var(--font-readout); font-size: 1.9rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.wsw-count span { font-size: 0.75rem; color: var(--muted); }

.wsw-rules { list-style: none; margin: 0; padding: 0.25rem 0; }
.wsw-rule { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto auto; align-items: center; column-gap: 0.5rem; padding: 0.45rem 1rem; }
.wsw-rule > i { color: var(--reef); text-align: center; }
.wsw-rule .wsw-sentence { font-weight: 500; }
.wsw-rule > small { grid-column: 2; color: var(--muted); }
.wsw-rule > small:empty { display: none; }
.wsw-rule .wsw-actions { grid-column: 4; grid-row: 1; display: flex; align-items: center; }
.wsw-n { grid-column: 3; grid-row: 1; min-width: 2rem; padding: 0.05rem 0.45rem; border-radius: 1rem; background: var(--water); font-family: var(--font-readout); font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.wsw-rule.is-auto > i { color: var(--muted); }
.wsw-rule.is-auto .wsw-sentence { font-weight: 400; color: var(--ink-soft); }
.wsw-rule.is-expired { opacity: 0.55; }
.wsw-rule.is-expired .wsw-sentence { text-decoration: line-through; }
.wsw-rule.is-empty { display: block; color: var(--muted); font-style: italic; }

/* small popovers for editing and sharing */
.wsw-pop { position: relative; }
.wsw-pop summary { list-style: none; }
.wsw-pop summary::-webkit-details-marker { display: none; }
.wsw-pop[open] .wsw-pop-body {
    position: absolute; right: 0; top: calc(100% + 4px); z-index: 10; display: grid; gap: 0.5rem; width: 17rem; padding: 0.75rem;
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 48, 63, 0.14);
}

/* adding a grant: what kind, then whom */
.wsw-add { border-top: 1px dashed var(--line-strong); }
.wsw-add > summary { list-style: none; cursor: pointer; padding: 0.6rem 1rem; color: var(--brand); font-weight: 500; }
.wsw-add > summary::-webkit-details-marker { display: none; }
.wsw-add[open] > summary { color: var(--ink-soft); }
.wsw-add form { padding: 0 1rem 1rem; display: grid; gap: 0.75rem; }
.wsw-kind { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wsw-kind label { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.35rem 0.75rem; border: 1px solid var(--line-strong); border-radius: 2rem; cursor: pointer; }
.wsw-kind input { position: absolute; opacity: 0; pointer-events: none; }
.wsw-kind label:has(input:checked) { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); }
.wsw-kind label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.wsw-panel { display: none; }
.wsw-add form:has(input[value=student]:checked) .wsw-panel[data-kind=student],
.wsw-add form:has(input[value=course]:checked) .wsw-panel[data-kind=course],
.wsw-add form:has(input[value=active_courses]:checked) .wsw-panel[data-kind=active_courses] { display: block; }
.wsw-checks { max-height: 14rem; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 0.15rem 1rem; padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--water); }
.wsw-checks label { display: flex; gap: 0.4rem; align-items: baseline; }
.wsw-meta { display: grid; grid-template-columns: minmax(0, 1fr) 10rem auto; gap: 0.5rem; }

.wsw-aside { position: sticky; top: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.wsw-aside h2 { font-size: 1.05rem; }
.wsw-plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.4rem; }

/* by student: each person with who sees them */
.wsw-students { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.wsw-student { display: grid; grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr) auto; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; }
.wsw-student + .wsw-student { border-top: 1px solid var(--line); }
.wsw-who { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.wsw-watchers { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wsw-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.25rem 0.15rem 0.2rem; border: 1px solid var(--line); border-radius: 2rem; background: var(--water); font-size: 0.9rem; }
.wsw-chip small { color: var(--muted); max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsw-chip form { display: inline; }
.wsw-chip button { border: 0; background: none; color: var(--muted); padding: 0 0.3rem; }
.wsw-chip button:hover { color: var(--coral); }

@media (max-width: 767.98px) {
    .wsw-student { grid-template-columns: 1fr; }
    .wsw-meta { grid-template-columns: 1fr; }
    .wsw-pop[open] .wsw-pop-body { left: 0; right: auto; }
}

/* ---------- Kundenkommunikation ----------
 * Two panes: conversations left, the open one right. WhatsApp reads as a chat
 * (bubbles), e-mail as letters (full-width cards with subject). The channel is
 * the avatar's badge colour: kelp for WhatsApp, reef for e-mail. */
.cc {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    height: calc(100vh - 120px);
    min-height: 480px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.cc-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.cc-list-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; }
.cc-list-head h1 { font-size: 1.35rem; margin: 0; }
.cc-icon { color: var(--muted); padding: 6px 8px; border-radius: var(--radius-sm); }
.cc-list-head { gap: 6px; }
.cc-list-head h1 { margin-right: auto; }
.cc-new { white-space: nowrap; }

.cc-start { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.cc-start .cc-thread-head h2 { font-size: 1.15rem; margin: 0; }
.cc-start-body { flex: 1; overflow-y: auto; padding: 18px 22px; display: grid; gap: 14px; align-content: start; max-width: 720px; }
.cc-start-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.cc-channel-pick { display: flex; gap: 8px; }
.cc-channel-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cc-channel-pick span {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line-strong); color: var(--ink-soft); font-weight: 500;
}
.cc-channel-pick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.cc-channel-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-channel-pick .is-off span { opacity: .45; cursor: not-allowed; }
.cc-start-note { margin: -6px 0 0; color: var(--muted); font-size: .88rem; }
.cc-field { display: grid; gap: 4px; position: relative; }
.cc-field > label { font-weight: 500; margin: 0; }
.cc-field > label small { color: var(--muted); font-weight: 400; }
.cc-to-chosen { color: var(--kelp); font-weight: 500; }
.cc-suggest {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin: 4px 0 0; padding: 4px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 48, 63, .14);
}
.cc-suggest button {
    width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 0; background: none;
    border-radius: var(--radius-sm); text-align: left;
}
.cc-suggest button:hover, .cc-suggest button:focus-visible { background: var(--water); }
.cc-suggest span { color: var(--muted); font-family: var(--font-readout); }
.cc-icon:hover { background: var(--water); color: var(--ink); }

.cc-filter { display: flex; gap: 2px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.cc-filter a { padding: 8px 10px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-weight: 500; }
.cc-filter a.active { color: var(--ink); border-bottom-color: var(--brand); }
.cc-filter .cc-mine { margin-left: auto; }
.cc-filter a span { font-family: var(--font-readout); font-weight: 600; margin-left: 2px; }

.cc-tools { padding: 10px 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.cc-channels { display: flex; gap: 4px; }
.cc-channels a {
    flex: 1; text-align: center; padding: 4px 6px; font-size: .85rem; color: var(--ink-soft);
    text-decoration: none; border: 1px solid var(--line); border-radius: 999px;
}
.cc-channels a.active { background: var(--ink); border-color: var(--ink); color: #fff; }

.cc-items { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.cc-empty { padding: 28px 18px; color: var(--muted); text-align: center; }
.cc-item {
    display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px;
    color: inherit; text-decoration: none; border-bottom: 1px solid var(--water);
}
.cc-item:hover { background: var(--water); }
.cc-item.is-open { background: color-mix(in srgb, var(--brand) 9%, white); }
.cc-item:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cc-item-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.cc-item-top { display: flex; justify-content: space-between; gap: 8px; }
.cc-item-top strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item-top time { color: var(--muted); font-size: .8rem; font-family: var(--font-readout); flex-shrink: 0; }
.cc-item-preview { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item-meta { color: var(--ink-soft); font-size: .78rem; }
.cc-item.is-unread .cc-item-top strong { font-weight: 700; }
.cc-item.is-unread .cc-item-preview { color: var(--ink); }
.cc-unread {
    align-self: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--kelp); color: #fff; font: 600 .78rem/22px var(--font-readout); text-align: center;
}

.cc-avatar {
    position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
    display: grid; place-items: center; background: var(--water); color: var(--ink-soft);
    font: 600 .9rem var(--font-readout);
}
.cc-avatar i {
    position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%;
    display: grid; place-items: center; font-size: 10px; color: #fff; border: 2px solid var(--surface);
}
.cc-avatar.cc-whatsapp i { background: var(--kelp); }
.cc-avatar.cc-email i { background: var(--reef); }

.cc-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.cc-thread-head {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.cc-thread-head:has(+ .cc-record) { border-bottom-style: dashed; }
.cc-who { flex: 1; min-width: 160px; }
.cc-who h2 { font-size: 1.15rem; margin: 0; }
.cc-who small { color: var(--muted); }
.cc-who small { display: block; }
/* Below the header (cc-record): whom this person is in our records, and for mail the case number */
.cc-record {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 6px 16px; font-size: .86rem;
    background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink-soft);
}
.cc-account { display: flex; align-items: center; gap: 8px; position: relative; flex: 1; min-width: 0; flex-wrap: wrap; }
.cc-account.is-linked { color: var(--ink); }
.cc-record-icon { color: var(--reef); width: 1.1em; text-align: center; }
.cc-account.is-missing .cc-record-icon { color: var(--muted); }
.cc-record-name { font-weight: 600; margin-left: 4px; }
a.cc-record-name { color: var(--reef); text-decoration: none; }
a.cc-record-name:hover { text-decoration: underline; }
.cc-record-action {
    border: 0; background: none; padding: 0; margin-left: 6px; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer;
}
.cc-account.is-linked .cc-record-action { color: var(--muted); font-weight: 400; }
.cc-record-action:hover, .cc-account.is-linked .cc-record-action:hover { text-decoration: underline; color: var(--brand); }
.cc-account.is-linked .cc-record-action:hover { color: var(--coral); }
.cc-record-action:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 2px; }
.cc-account-pick > summary { list-style: none; display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; cursor: pointer; }
.cc-account-pick > summary::-webkit-details-marker { display: none; }
.cc-account-pick[open] .cc-record-action { text-decoration: underline; }
.cc-ref { margin-left: auto; font-family: var(--font-readout); color: var(--muted); white-space: nowrap; }
.cc-account-menu {
    position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: 320px; padding: 12px; display: grid; gap: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 48, 63, .14);
}
.cc-account-title { margin: 0 0 6px; font-weight: 600; }
.cc-account-link { display: grid; gap: 6px; }
.cc-account-link .cc-people li { align-items: flex-start; }
.cc-account-link .cc-people li > span:last-child { display: grid; }
.cc-account-link .cc-people small { color: var(--muted); font-family: var(--font-readout); }
.cc-account-save { display: flex; gap: 8px; align-items: center; font-size: .85rem; margin: 0; }
.cc-account-go { justify-self: start; }
.cc-account-new { border-top: 1px solid var(--line); padding-top: 8px; }
.cc-account-new > summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.cc-account-form { display: grid; gap: 6px; margin-top: 8px; }
.cc-account-row { display: flex; gap: 6px; }
.cc-present { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; }
.cc-present:empty { display: none; }
.cc-faces { display: flex; }
.cc-face {
    width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; margin-left: -6px;
    background: var(--reef); color: #fff; font: 600 .7rem var(--font-readout); border: 2px solid var(--surface);
}
.cc-face:first-child { margin-left: 0; }
.cc-face.is-typing { background: var(--kelp); }
.cc-typing { display: flex; align-items: center; gap: 8px; margin: 0; padding: 4px 20px 6px; background: var(--water); color: var(--ink-soft); font-size: .85rem; }
.cc-dots { display: inline-flex; gap: 3px; padding: 6px 9px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.cc-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: cc-dot 1.2s infinite ease-in-out; }
.cc-dots i:nth-child(2) { animation-delay: .15s; }
.cc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes cc-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-3px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cc-dots i { animation: none; } }
.cc-assign { position: relative; }
.cc-assign > summary { list-style: none; }
.cc-assign > summary::-webkit-details-marker { display: none; }
.cc-assign-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 280px; padding: 12px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 48, 63, .14);
    display: grid; gap: 6px;
}
.cc-assign-menu { width: 300px; gap: 10px; }
.cc-assign-title { margin: 0; font-weight: 600; }
.cc-assign-hint { margin: 0; font-size: .8rem; color: var(--muted); }
.cc-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chips:empty { display: none; }
.cc-chip-person {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 2px 2px 3px; border-radius: 999px;
    background: color-mix(in srgb, var(--kelp) 12%, white); border: 1px solid color-mix(in srgb, var(--kelp) 30%, white); font-size: .86rem;
}
.cc-chip-person button { border: 0; background: none; width: 22px; height: 22px; border-radius: 50%; color: var(--ink-soft); line-height: 1; }
.cc-chip-person button:hover, .cc-chip-person button:focus-visible { background: color-mix(in srgb, var(--kelp) 25%, white); color: var(--ink); }
.cc-mini {
    width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0;
    background: var(--water); color: var(--ink-soft); font: 600 .68rem var(--font-readout);
}
.cc-chip-person .cc-mini { background: var(--kelp); color: #fff; }
.cc-combo { position: relative; }
.cc-people {
    list-style: none; margin: 4px 0 0; padding: 4px; max-height: 220px; overflow-y: auto;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
}
.cc-people li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.cc-people li.is-active, .cc-people li:hover { background: var(--water); }
.cc-people .cc-none-found { color: var(--muted); cursor: default; font-size: .85rem; }
.cc-take { justify-self: start; }
.cc-back { display: none; color: var(--ink); }

.cc-messages { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; background: var(--water); }
.cc-day { text-align: center; margin: 8px 0; }
.cc-day span { font-size: .78rem; color: var(--muted); background: var(--surface); padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }

.cc-msg { max-width: min(560px, 80%); padding: 8px 12px 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.cc-msg.is-out { align-self: flex-end; background: color-mix(in srgb, var(--kelp) 12%, white); border-color: color-mix(in srgb, var(--kelp) 25%, white); }
.cc-msg.is-in { border-bottom-left-radius: 4px; }
.cc-whatsapp .cc-msg.is-out { border-bottom-right-radius: 4px; }
.cc-msg footer { display: flex; justify-content: flex-end; gap: 6px; font-size: .75rem; color: var(--muted); margin-top: 2px; }
.cc-msg footer a { color: var(--muted); }
.cc-body { white-space: normal; overflow-wrap: anywhere; }
.cc-state { white-space: nowrap; }
.cc-state b { font-weight: 700; }
.cc-msg[data-status="sending"] { opacity: .72; }
.cc-msg[data-status="sent"] .cc-state { color: var(--kelp); }
.cc-msg[data-status="failed"] { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 6%, white); }
.cc-msg[data-status="failed"] .cc-state { color: var(--coral); }
.cc-error { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--coral) 40%, white); font-size: .82rem; color: var(--coral); }
.cc-retry {
    margin-left: 4px; padding: 1px 10px; border-radius: 999px; border: 1px solid var(--coral);
    background: var(--surface); color: var(--coral); font-weight: 600; font-size: .8rem;
}
.cc-retry:hover { background: var(--coral); color: #fff; }
.cc-retry:disabled { opacity: .5; }

/* e-mail: letters, not bubbles */
.cc-email .cc-msg { max-width: 760px; width: 100%; border-radius: var(--radius); padding: 12px 16px 8px; }
.cc-email .cc-msg.is-out { background: color-mix(in srgb, var(--reef) 8%, white); border-color: color-mix(in srgb, var(--reef) 22%, white); }
.cc-quote { margin-top: 6px; }
.cc-quote summary {
    display: inline-block; cursor: pointer; list-style: none; font-size: .78rem; color: var(--muted);
    padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.cc-quote summary::-webkit-details-marker { display: none; }
.cc-quote summary::before { content: '···  '; letter-spacing: 1px; }
.cc-quote[open] summary::before { content: '▴  '; }
.cc-quote summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-quote > div {
    margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--line-strong);
    color: var(--muted); font-size: .88rem; overflow-wrap: anywhere;
}
.cc-subject { font-weight: 600; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

/* internal notes: in the stream but clearly not sent; a group's writer above the text */
.cc-msg.is-note {
    align-self: center; width: min(620px, 92%); max-width: none; border-radius: 8px;
    background: color-mix(in srgb, var(--buoy) 8%, white); border: 1px dashed color-mix(in srgb, var(--buoy) 55%, white);
}
.cc-note-head { margin: 0 0 4px; font-size: .75rem; font-weight: 600; color: color-mix(in srgb, var(--buoy) 75%, black); }
.cc-note-head i { margin-right: 3px; }
.cc-mention { padding: 0 3px; border-radius: 4px; background: color-mix(in srgb, var(--buoy) 22%, white); color: inherit; font-weight: 600; }
.cc-writer { margin: 0 0 2px; font-size: .8rem; font-weight: 600; color: var(--reef); }
.cc-group-icon { font-size: 1rem; }
.cc-account.is-group { color: var(--muted); }

.cc-mode { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.cc-mode label { margin: 0; cursor: pointer; }
.cc-mode input { position: absolute; opacity: 0; pointer-events: none; }
.cc-mode span { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: .82rem; color: var(--ink-soft); }
.cc-mode input:checked + span { background: var(--water); border-color: var(--line-strong); color: var(--ink); font-weight: 600; }
.cc-mode input[value="note"]:checked + span { background: color-mix(in srgb, var(--buoy) 14%, white); border-color: var(--buoy); color: color-mix(in srgb, var(--buoy) 75%, black); }
.cc-mode input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-mode-hint { color: var(--muted); }
.cc-compose.is-note { background: color-mix(in srgb, var(--buoy) 5%, white); }
.cc-compose.is-note .cc-attach, .cc-compose.is-note .cc-mic, .cc-compose.is-note .cc-fmt-btn, .cc-compose.is-note .cc-fmt, .cc-compose.is-note .cc-picked { display: none !important; }
.cc-compose.is-note .cc-send { display: grid; background: var(--buoy); }
.cc-compose { position: relative; }
.cc-mention-list { position: absolute; left: 60px; bottom: calc(100% - 4px); z-index: 20; min-width: 220px; max-width: 320px; }

.cc-compose { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: end; padding: 10px 14px; border-top: 1px solid var(--line); }
.cc-mic {
    width: 42px; height: 42px; border-radius: 50%; border: 0; display: none; place-items: center;
    background: var(--kelp); color: #fff;
}
.cc-mic:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cc-compose.is-empty .cc-mic { display: grid; }
.cc-compose.is-empty .cc-send { display: none; }
.cc-rec { display: none; grid-column: 1 / -1; align-items: center; gap: 10px; min-height: 42px; padding: 0 4px; }
.cc-rec time { font-family: var(--font-readout); font-weight: 600; min-width: 3ch; margin-right: auto; }
.cc-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); animation: cc-rec 1.2s ease-in-out infinite; }
@keyframes cc-rec { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .cc-rec-dot { animation: none; } }
.cc-compose.is-recording .cc-rec { display: flex; }
.cc-compose.is-recording > :not(.cc-rec):not(.cc-compose-error) { display: none !important; }
.cc-attach {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; margin: 0;
    color: var(--ink-soft); border: 1px solid var(--line-strong); background: var(--surface);
}
.cc-attach:hover { background: var(--water); color: var(--ink); }
.cc-attach:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-picked { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.cc-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 10px; border-radius: 999px;
    background: var(--water); border: 1px solid var(--line); font-size: .85rem; max-width: 100%;
}
.cc-chip small { color: var(--muted); font-family: var(--font-readout); }
.cc-chip button { border: 0; background: none; width: 24px; height: 24px; border-radius: 50%; color: var(--muted); line-height: 1; }
.cc-chip button:hover { background: var(--line); color: var(--ink); }

.cc-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.cc-photo { display: block; border-radius: 10px; overflow: hidden; line-height: 0; }
.cc-photo img { max-width: min(280px, 100%); max-height: 320px; object-fit: cover; background: var(--water); }
.cc-video { max-width: min(320px, 100%); border-radius: 10px; background: #000; }
.cc-audio { display: flex; align-items: center; gap: 8px; }
.cc-audio > i { color: var(--kelp); }
.cc-audio audio { height: 36px; max-width: 260px; }
.cc-file {
    display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
    color: var(--ink); text-decoration: none; max-width: 100%;
}
.cc-file > i { font-size: 1.3rem; color: var(--reef); }
.cc-file span { display: grid; min-width: 0; }
.cc-file strong { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-file small { color: var(--muted); font-family: var(--font-readout); }
a.cc-file:hover { border-color: var(--line-strong); }
.cc-file.is-wait { color: var(--muted); font-size: .88rem; }
.cc-compose p { grid-column: 1 / -1; }
.cc-compose textarea { resize: none; min-height: 42px; max-height: 220px; border-radius: 21px; padding: 9px 16px; line-height: 1.35; }
.cc-send {
    width: 42px; height: 42px; border-radius: 50%; border: 0; flex-shrink: 0;
    background: var(--kelp); color: #fff; display: grid; place-items: center;
}
.cc-email + .cc-compose .cc-send, .cc-messages.cc-email ~ .cc-compose .cc-send { background: var(--reef); }
.cc-send:hover { filter: brightness(1.08); }
.cc-send:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.cc-none { margin: auto; text-align: center; color: var(--muted); max-width: 380px; padding: 24px; }
.cc-none > i { font-size: 2.4rem; color: var(--line-strong); margin-bottom: 10px; }
.cc-qr { display: flex; gap: 16px; align-items: center; margin-top: 16px; padding: 12px; background: var(--water); border-radius: var(--radius); }
.cc-qr img { background: #fff; padding: 8px; border-radius: var(--radius-sm); }
.mail-tool.is-handed { color: var(--kelp); }

@media (max-width: 860px) {
    .cc { grid-template-columns: 1fr; height: calc(100vh - 100px); }
    .cc.has-open .cc-list { display: none; }
    .cc:not(.has-open) .cc-thread { display: none; }
    .cc-back { display: inline-block; }
    .cc-msg { max-width: 88%; }
    .cc-qr { flex-direction: column; text-align: center; }
}

/* ---------- Systemeinstellungen ----------
 * The list of parts on the left is the status board: a dot per part (kelp = runs,
 * buoy = half done, line = not used) and one line of what is set. One part is open
 * on the right; its settings are rows of "what it is" and the field. */
.ss { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 8px; }
.ss-rail { position: sticky; top: 16px; }
.ss-rail h1 { font-size: 1.5rem; margin: 0 0 14px; }
.ss-group { margin: 16px 0 4px; padding-left: 12px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.ss-rail ul { list-style: none; margin: 0; padding: 0; }
.ss-link {
    display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border-radius: var(--radius);
    color: var(--ink); text-decoration: none; border-left: 3px solid transparent;
}
.ss-link:hover { background: var(--surface); }
.ss-link[aria-current] { background: var(--surface); border-left-color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.ss-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ss-link-text { display: grid; min-width: 0; }
.ss-link-text strong { font-weight: 600; line-height: 1.25; }
.ss-link-text small {
    color: var(--muted); font-family: var(--font-readout); font-size: .86rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ss-dot { flex-shrink: 0; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--line-strong); }
.ss-dot.is-ok { background: var(--kelp); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kelp) 18%, transparent); }
.ss-dot.is-warn { background: var(--buoy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--buoy) 18%, transparent); }

.ss-pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px 18px; }
.ss-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ss-head h2 { font-size: 1.45rem; margin: 0; }
.ss-back { display: none; color: var(--ink); }
.ss-state {
    font-family: var(--font-readout); font-size: .9rem; padding: 1px 10px; border-radius: 999px;
    background: var(--water); color: var(--ink-soft);
}
.ss-state.is-ok { background: color-mix(in srgb, var(--kelp) 12%, white); color: var(--kelp); }
.ss-state.is-warn { background: color-mix(in srgb, var(--buoy) 13%, white); color: #a8460f; }
.ss-intro { color: var(--ink-soft); max-width: 64ch; margin: 6px 0 14px; }
.ss-note { color: var(--ink-soft); font-size: .92rem; }
.ss-sub { font-size: 1.1rem; margin: 26px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }

.ss-row {
    display: grid; grid-template-columns: minmax(180px, 250px) minmax(0, 1fr); gap: 8px 24px;
    align-items: center; padding: 12px 0; border-top: 1px solid var(--water);
}
.ss-row > label, .ss-row > .ss-row-label { margin: 0; font-weight: 500; }
.ss-row > label small, .ss-row > .ss-row-label small { display: block; color: var(--muted); font-weight: 400; font-size: .84rem; line-height: 1.35; margin-top: 2px; }
.ss-row .form-check { margin: 0; }
.ss-row .form-switch .form-check-input { width: 2.6em; height: 1.4em; cursor: pointer; }
/* the wider switch needs its room, or a label beside it touches it */
.ss-row .form-switch { padding-left: 0; display: flex; align-items: center; gap: .6em; }
.ss-row .form-switch .form-check-input { float: none; margin: 0; }
.ss-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ss-inline > .form-control { flex: 1 1 160px; }
.ss-inline > .ss-port { flex: 0 0 96px; }
.ss-short { max-width: 240px; }
.ss-mid { max-width: 420px; }
/* a section heading with its own state, e.g. Apple and Android under App-Push */
.ss-sub-chip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ss-sub-chip .ss-state { font-size: .8rem; font-weight: 500; }
.ss-color { display: flex; gap: 8px; max-width: 260px; }
.ss-color input[type=color] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }

.ss-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--water); }
.ss-actions-start { justify-content: flex-start; border-top: 0; }
.ss-result { margin: 8px 0 0; text-align: right; font-size: .9rem; color: var(--ink-soft); }
.ss-result.is-ok { color: var(--kelp); }
.ss-result.is-error { color: var(--coral); }

.ss-logos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.ss-logo { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 8px; align-content: start; }
.ss-logo.is-active { border-color: var(--kelp); box-shadow: inset 0 0 0 1px var(--kelp); }
.ss-logo img { height: 56px; width: 100%; object-fit: contain; background: var(--water); border-radius: var(--radius-sm); padding: 6px; }
.ss-logo figcaption { display: grid; }
.ss-logo figcaption small { color: var(--muted); }
.ss-logo.is-active figcaption small { color: var(--kelp); font-weight: 600; }
.ss-logo-tools { display: flex; gap: 6px; }
.ss-logo-new { border-style: dashed; background: var(--water); }
.ss-logo-new label { font-weight: 500; }
.ss-logo-new label small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }

.ss-connect { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.ss-steps { margin: 0; padding-left: 1.2em; max-width: 52ch; color: var(--ink-soft); }
.ss-steps li { margin-bottom: 4px; }
.ss-qr-box { display: grid; place-items: center; min-width: 236px; min-height: 236px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.ss-qr-wait { margin: 0; padding: 16px; color: var(--muted); text-align: center; max-width: 220px; }
.ss-qr { background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); }

.ss-readout { font: 600 1.35rem var(--font-readout); letter-spacing: .02em; color: var(--ink); }

/* a part that cannot be used yet: what is missing and where to get it */
.ss-empty { display: grid; justify-items: start; gap: 10px; margin-top: 4px; padding: 18px 20px; background: var(--water); border-radius: var(--radius); }
.ss-empty > i { font-size: 1.6rem; color: var(--muted); }
.ss-empty p { margin: 0; max-width: 56ch; color: var(--ink-soft); }

@media (max-width: 860px) {
    .ss { grid-template-columns: 1fr; }
    .ss-rail { position: static; }
    .ss.is-reading .ss-rail { display: none; }
    .ss:not(.is-reading) .ss-panes { display: none; }
    .ss:not(.is-reading) .ss-link[aria-current] { background: none; box-shadow: none; border-left-color: transparent; }
    .ss-back { display: inline-block; }
    .ss-pane { padding: 16px; }
    .ss-row { grid-template-columns: 1fr; }
    .ss-actions { justify-content: stretch; }
    .ss-actions .btn { flex: 1; }
}

/* ---------- Course catalogue (admin): filters, groups per association, pages ---------- */
.ck-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0 14px; }
.ck-head h1 { margin: 0; font-size: 1.75rem; }
.ck-sub { margin: 2px 0 0; color: var(--muted); }
.ck-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ck-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ck-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.ck-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ck-search .form-control { padding-left: 36px; }
.ck-tools .form-select { width: auto; min-width: 11rem; }
.ck-toggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.ck-toggle:has(input:checked) { border-color: var(--buoy); color: var(--buoy); }
.ck-toggle input { accent-color: var(--buoy); }

/* association switch: the abbreviation in the readout face, with how many match */
.ck-orgs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 6px; }
.ck-orgs a {
    display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 12px; border-radius: 999px; text-decoration: none;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--font-readout); font-weight: 600; letter-spacing: .02em;
}
.ck-orgs a span { color: var(--muted); font-weight: 500; }
.ck-orgs a:hover { border-color: var(--line-strong); }
.ck-orgs a.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.ck-orgs a.is-on span { color: rgba(255, 255, 255, .7); }
.ck-orgs a.is-empty:not(.is-on) { color: var(--muted); }
.ck-orgs a:focus-visible, .ck-pager a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.ck-count { color: var(--muted); font-size: .9rem; margin: 8px 0 10px; }

/* one association: its abbreviation large on the left edge, the courses beside it */
.ck-group { display: grid; grid-template-columns: 5.5rem 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.ck-group-head { display: contents; }
.ck-abbr {
    grid-row: 1 / span 3; padding: 14px 10px; border-right: 1px solid var(--line); background: var(--water);
    font-family: var(--font-readout); font-weight: 700; font-size: 1.5rem; line-height: 1; color: var(--reef); letter-spacing: .02em; overflow-wrap: anywhere;
}
.ck-group-head h2, .ck-group-n { grid-column: 2; }
.ck-group-head h2 small { color: var(--muted); font-weight: 400; }
.ck-group-head h2 { font-size: 1rem; margin: 0; padding: 12px 16px 0; }
.ck-group-n { padding: 0 16px 10px; color: var(--muted); font-size: .85rem; border-bottom: 1px solid var(--line); }
.ck-rows { grid-column: 2; list-style: none; margin: 0; padding: 0; }

.ck-row {
    display: grid; grid-template-columns: minmax(0, 1fr) 7.5rem 9rem 8.5rem 5.5rem; gap: 12px; align-items: center;
    padding: 10px 16px; border-top: 1px solid var(--line);
}
.ck-row:first-child { border-top: 0; }
.ck-row:hover { background: #f6fafb; }
.ck-row.is-inactive .ck-name, .ck-row.is-inactive .ck-price { color: var(--muted); }
.ck-main { min-width: 0; display: grid; }
.ck-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-name:hover { color: var(--brand); text-decoration: underline; }
.ck-main small { color: var(--muted); }
.ck-price { font-family: var(--font-readout); text-align: right; font-size: 1.05rem; white-space: nowrap; }
.ck-price s { color: var(--muted); font-size: .85rem; }
.ck-price strong { font-weight: 600; }
.ck-price .is-ask { font-family: var(--font-ui); font-weight: 400; font-size: .85rem; color: var(--muted); }
.ck-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; white-space: nowrap; }
.ck-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ck-tag.is-online { color: var(--kelp); }
.ck-tag.is-hidden { color: var(--muted); }
.ck-tag.is-restricted { color: var(--reef); }
.ck-tag.is-inactive { color: var(--coral); }
.ck-requests { display: grid; font-size: .88rem; }
.ck-requests small { color: var(--muted); }
.ck-waiting { color: var(--buoy); font-weight: 600; text-decoration: none; }
.ck-waiting:hover { text-decoration: underline; }
.ck-none { color: var(--muted); }
.ck-actions { display: flex; gap: 4px; justify-content: flex-end; }
.ck-actions .ck-del { color: var(--muted); }
.ck-actions .ck-del:hover, .ck-actions .ck-del:focus-visible { color: #fff; background: var(--coral); border-color: var(--coral); }

.ck-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 32px; text-align: center; margin-top: 10px; }
.ck-empty p { margin-bottom: 12px; color: var(--ink-soft); }

.ck-pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0 8px; flex-wrap: wrap; }
.ck-pager ol { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ck-pager a { display: inline-flex; align-items: center; gap: 6px; min-width: 2.25rem; justify-content: center; padding: 6px 10px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); font-family: var(--font-readout); font-weight: 600; }
.ck-pager a:hover { background: var(--surface); }
.ck-pager a.is-on { background: var(--ink); color: #fff; }
.ck-pager a.is-off { color: var(--line-strong); pointer-events: none; }
.ck-gap { color: var(--muted); padding: 6px 4px; }

@media (max-width: 860px) {
    .ck-group { grid-template-columns: 1fr; }
    .ck-abbr { grid-row: auto; border-right: 0; background: none; padding: 12px 16px 0; font-size: 1.2rem; }
    .ck-group-head h2 { padding-top: 2px; }
    .ck-group-head h2, .ck-group-n, .ck-rows { grid-column: 1; }
    .ck-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main price" "state actions" "req actions"; row-gap: 4px; }
    .ck-main { grid-area: main; } .ck-price { grid-area: price; } .ck-state { grid-area: state; }
    .ck-requests { grid-area: req; } .ck-actions { grid-area: actions; align-self: center; }
    .ck-name { white-space: normal; }
    .ck-tools .form-select { flex: 1 1 10rem; }
}

/* ---------- Course run: participants with training record and exam results ---------- */
.tr-summary { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 0 0 12px; color: var(--ink-soft); }
.tr-summary p { margin: 0; }
.tr-summary strong { font-family: var(--font-readout); font-size: 1.35rem; color: var(--ink); margin-right: 2px; }
.tr-summary .is-open strong { color: var(--buoy); }

.tr-people { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tr-person {
    display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1.1fr) minmax(14rem, 1.4fr); gap: 16px;
    padding: 14px 16px; border-top: 1px solid var(--line); align-items: start;
}
.tr-person:first-child { border-top: 0; }
.tr-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tr-who a { font-weight: 600; color: var(--ink); text-decoration: none; }
.tr-who a:hover { color: var(--brand); text-decoration: underline; }
.tr-avatar { flex: none; }
/* the column names only show where the columns stack */
.tr-col-h { display: none; font-size: .8rem; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.tr-none { margin: 0; color: var(--muted); font-size: .9rem; padding-top: 6px; }

.tr-record { display: grid; gap: 3px; padding: 4px 0; text-decoration: none; color: var(--ink); }
.tr-record > span:first-child { font-weight: 500; }
.tr-record:hover > span:first-child { color: var(--brand); text-decoration: underline; }
.tr-record small { color: var(--muted); }
.tr-done { color: var(--kelp) !important; }
.tr-gauge { display: block; height: 6px; border-radius: 3px; background: var(--water); overflow: hidden; max-width: 14rem; }
.tr-gauge > span { display: block; height: 100%; background: var(--reef); }

.tr-exams ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tr-exam { display: inline-flex; align-items: center; position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.tr-exam > a { padding: 4px 8px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.tr-exam > a i { color: var(--coral); }
.tr-exam > a:hover { color: var(--brand); }
.tr-exam-edit > summary { list-style: none; cursor: pointer; padding: 4px 8px; color: var(--muted); border-left: 1px solid var(--line); }
.tr-exam-edit > summary::-webkit-details-marker { display: none; }
.tr-exam-edit > summary:hover, .tr-exam-edit[open] > summary { color: var(--brand); }
.tr-pop {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; padding: 12px; display: grid; gap: 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(18, 48, 63, .14);
}
.tr-pop .form-label { font-size: .85rem; margin-bottom: 4px; }
.tr-delete { border: 0; background: none; padding: 0; color: var(--coral); font-size: .88rem; justify-self: start; }
.tr-delete:hover { text-decoration: underline; }
.tr-upload { margin: 0; }
.tr-add {
    display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; cursor: pointer; font-size: .9rem;
    border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--brand);
}
.tr-add:hover { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, white); }
.tr-add:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.tr-add.is-busy { color: var(--muted); pointer-events: none; }
.tr-add.is-busy i::before { content: "\f110"; }
.tr-hint { color: var(--muted); font-size: .88rem; margin: 10px 0 0; max-width: 75ch; }

@media (max-width: 860px) {
    .tr-person { grid-template-columns: 1fr; gap: 10px; }
    .tr-col-h { display: block; }
    .tr-pop { right: auto; left: 0; width: min(300px, 80vw); }
}

/* exam results from before the course runs */
.tr-loose { margin-top: 28px; }
.tr-loose-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tr-loose-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 10px 16px; border-top: 1px solid var(--line); }
.tr-loose-list li:first-child { border-top: 0; }
.tr-loose-title { font-weight: 500; text-decoration: none; color: var(--ink); }
.tr-loose-title i { color: var(--coral); }
.tr-loose-who { color: var(--muted); flex: 1; }
.tr-loose-assign { display: flex; gap: 6px; }
.tr-loose-assign .form-select { width: auto; max-width: 16rem; }

/* ---------- A student's own training, one block per course ---------- */
.my-courses { display: grid; gap: 16px; max-width: 760px; }
.my-course { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--reef); border-radius: var(--radius); padding: 16px 18px; }
.my-course.is-done { border-left-color: var(--kelp); }
.my-course header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.my-course h2 { font-size: 1.2rem; margin: 0; }
.my-course header p { margin: 0; color: var(--muted); font-family: var(--font-readout); }
.my-record { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.my-record > div { flex: 1; min-width: 0; }
.my-done { margin: 2px 0 0; color: var(--kelp); font-size: .9rem; }
.my-progress { display: grid; gap: 4px; margin-top: 6px; }
.my-progress small { color: var(--muted); }
.my-exams { border-top: 1px solid var(--line); padding-top: 10px; }
.my-exams h3 { font-size: .9rem; font-weight: 600; color: var(--ink-soft); margin: 0 0 6px; }
.my-exams ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.my-exams li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.my-exams a { text-decoration: none; }
.my-exams a i { color: var(--coral); }
.my-exams small { color: var(--muted); }

/* ---------- Permissions: matrix of rights per role, a person's own rights, roles, history ---------- */
.pm-head { padding: 12px 0 10px; }
.pm-head h1 { margin: 0; font-size: 1.75rem; }
.pm-head p { margin: 2px 0 0; color: var(--muted); max-width: 70ch; }
.pm-person-head { display: flex; align-items: center; gap: 14px; }
.pm-tabs { display: flex; gap: 4px; margin-bottom: 16px; box-shadow: inset 0 -1px 0 var(--line); overflow-x: auto; scrollbar-width: none; }
.pm-tabs::-webkit-scrollbar { display: none; }
.pm-tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink-soft); white-space: nowrap; font-weight: 500; }
.pm-tabs a:hover { color: var(--ink); }
.pm-tabs a.is-on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brand); }
.pm-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pm-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pm-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.pm-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pm-search .form-control { padding-left: 36px; }
.pm-legend { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.pm-status { min-height: 1.4em; margin: 0 0 6px; font-size: .88rem; color: var(--kelp); }
.pm-status.is-bad { color: var(--coral); }
.pm-note { color: var(--ink-soft); max-width: 70ch; }
.pm-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 24px; color: var(--ink-soft); }
.pm-h2 { font-size: 1.05rem; margin: 16px 0 8px; }
.pm-foot { color: var(--muted); font-size: .88rem; margin-top: 10px; }

/* what a right lets one do: the CRUD part, as a coloured word */
.pm-kind { display: inline-block; min-width: 5.2rem; padding: 1px 0; font-size: .75rem; font-weight: 600; font-family: var(--font-readout); letter-spacing: .02em; }
.pm-legend .pm-kind { min-width: 0; padding: 1px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pm-kind.is-see { color: var(--reef); }
.pm-kind.is-create { color: var(--kelp); }
.pm-kind.is-edit { color: #8a6a00; }
.pm-kind.is-delete { color: var(--coral); }
.pm-kind.is-manage { color: #6b4fa3; }

/* the matrix: rights down, roles across; header row and right names stay in view */
.pm-matrix-wrap { overflow: auto; max-height: calc(100vh - 220px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pm-matrix { border-collapse: separate; border-spacing: 0; width: 100%; }
.pm-matrix th, .pm-matrix td { padding: 0; border-bottom: 1px solid var(--line); }
.pm-matrix thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); border-bottom: 2px solid var(--line-strong); }
.pm-right-h { text-align: left; padding: 10px 16px !important; color: var(--muted); font-weight: 500; left: 0; z-index: 4 !important; }
.pm-role-h { min-width: 7.5rem; padding: 10px 8px !important; text-align: center; vertical-align: bottom; }
.pm-role-h span { display: block; font-weight: 600; }
.pm-role-h small { color: var(--muted); font-weight: 400; }
.pm-role-h.is-admin span { color: var(--muted); }
.pm-matrix tbody th { position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left; font-weight: 400; padding: 7px 16px; min-width: 20rem; max-width: 34rem; }
.pm-matrix td { text-align: center; }
.pm-area-row th, .pm-area-row td { background: var(--water) !important; padding-top: 12px !important; padding-bottom: 6px !important; }
.pm-area-row th { font-weight: 700 !important; color: var(--ink); }
.pm-desc { color: var(--ink); }
.pm-label { display: flex; align-items: baseline; gap: 8px; }
.pm-label .pm-kind { flex: none; }
.pm-matrix tbody tr.pm-right:hover th, .pm-matrix tbody tr.pm-right:hover td { background: #f6fafb; }
.pm-cell {
    width: 30px; height: 30px; margin: 4px auto; display: grid; place-items: center; border-radius: 8px;
    border: 1.5px solid var(--line-strong); background: var(--surface); color: transparent; padding: 0;
}
.pm-cell[aria-pressed="true"] { background: var(--kelp); border-color: var(--kelp); color: #fff; }
.pm-cell:not(:disabled):hover { border-color: var(--kelp); }
.pm-cell[aria-pressed="false"]:not(:disabled):hover { color: color-mix(in srgb, var(--kelp) 45%, white); }
.pm-cell:focus-visible, .pm-area-toggle:focus-visible, .pm-seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pm-cell:disabled { opacity: .45; cursor: not-allowed; }
.pm-cell.is-busy { opacity: .6; }
.pm-cell.is-locked { border-color: transparent; background: none; color: var(--line-strong); }
.pm-all { color: var(--muted); font-size: .82rem; }
.pm-area-toggle { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 10px; font-family: var(--font-readout); font-size: .85rem; color: var(--ink-soft); }
.pm-area-toggle:hover { border-color: var(--kelp); color: var(--kelp); }

/* people */
.pm-people { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }
.pm-people li + li { border-top: 1px solid var(--line); }
/* one row per person in fixed columns: person, role, rights, last sign-in */
.pm-people a, .pm-people-head {
    display: grid; grid-template-columns: 32px minmax(0, 1fr) 8rem 11rem 9rem; align-items: center; column-gap: 12px;
    padding: 7px 16px; text-decoration: none; color: var(--ink);
}
.pm-people-head {
    grid-template-columns: minmax(0, 1fr) 8rem 11rem 9rem; padding-left: 60px; font-size: .8rem; color: var(--muted);
    background: var(--water); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
}
.pm-people-head span:nth-child(3), .pm-people-head span:nth-child(4) { text-align: right; }
.pm-person { min-width: 0; }
.pm-person strong, .pm-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-person-seen { text-align: right; color: var(--muted); font-size: .85rem; font-family: var(--font-readout); }
.pm-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .88rem; }
.pm-sort .form-select { width: auto; }
@media (max-width: 760px) {
    .pm-people-head { display: none; }
    .pm-people { border-radius: var(--radius); }
    .pm-people a { grid-template-columns: 32px minmax(0, 1fr) auto; row-gap: 2px; }
    .pm-people a .pm-person-role { grid-column: 2; font-size: .85rem; }
    .pm-people a .pm-person-own { grid-column: 3; grid-row: 1; }
    .pm-people a .pm-person-seen { grid-column: 3; grid-row: 2; }
}
.pm-people a:hover { background: #f6fafb; }
.pm-person small { color: var(--muted); }
.pm-person-role { color: var(--ink-soft); }
.pm-person-own { color: var(--muted); font-size: .88rem; text-align: right; }
.pm-person-own.has-own { color: var(--buoy); font-weight: 600; }
.pm-person strong .pm-you { display: inline; color: var(--muted); font-weight: 400; }
.pm-people a.is-inactive { opacity: .6; }

.pm-person-area { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.pm-person-area h2 { font-size: .95rem; margin: 0; padding: 10px 16px; background: var(--water); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.pm-person-area ul { list-style: none; margin: 0; padding: 0; }
.pm-person-right { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pm-person-right:first-child { border-top: 0; }
.pm-person-right .pm-desc { flex: 1; min-width: 14rem; }
.pm-person-right.is-allow { box-shadow: inset 3px 0 0 var(--kelp); }
.pm-person-right.is-deny { box-shadow: inset 3px 0 0 var(--coral); }
.pm-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.pm-seg button { border: 0; background: var(--surface); padding: 4px 10px; font-size: .82rem; color: var(--ink-soft); }
.pm-seg button + button { border-left: 1px solid var(--line-strong); }
.pm-seg button[aria-checked="true"][data-state-btn="role"] { background: var(--water); color: var(--ink); font-weight: 600; }
.pm-seg button[aria-checked="true"][data-state-btn="allow"] { background: var(--kelp); color: #fff; font-weight: 600; }
.pm-seg button[aria-checked="true"][data-state-btn="deny"] { background: var(--coral); color: #fff; font-weight: 600; }
.pm-seg button:disabled { cursor: not-allowed; opacity: .6; }

/* roles */
.pm-roles { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.pm-role-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 8px; }
.pm-role-top { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pm-role-top h2 { font-size: 1.05rem; margin: 0; }
.pm-role-top span { color: var(--muted); font-size: .88rem; }
.pm-role-form { display: flex; gap: 8px; max-width: 640px; }
.pm-delete { border: 0; background: none; padding: 0; color: var(--coral); font-size: .88rem; }
.pm-delete:disabled { color: var(--muted); cursor: not-allowed; }
.pm-new-role { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 14px 16px; }
.pm-new-role .pm-h2 { margin-top: 0; }
.pm-new-role p { color: var(--muted); font-size: .9rem; }
.pm-new-role-fields { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-new-role-fields .form-control { flex: 1 1 12rem; }

/* history */
.pm-log { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pm-log li { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pm-log li:first-child { border-top: 0; }
.pm-log time { font-family: var(--font-readout); color: var(--muted); min-width: 8.5rem; }
.pm-change { font-style: normal; font-weight: 600; margin-left: 4px; }
.pm-change.is-on { color: var(--kelp); }
.pm-change.is-off { color: var(--coral); }
.pm-change.is-role { color: var(--ink-soft); }

@media (max-width: 760px) {
    .pm-matrix tbody th { min-width: 12rem; }
    .pm-kind { display: block; min-width: 0; }
    .pm-role-h { min-width: 5.5rem; }
}

/* ---------- Dive profile from a dive computer (dive log page) ---------- */
.dl-profile-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dl-profile-head span { color: var(--muted); font-size: .88rem; }
.dl-profile-figure { margin: 0; }
.dl-profile-figure svg { width: 100%; height: auto; display: block; touch-action: pan-y; cursor: crosshair; }
.dl-grid { stroke: var(--line); stroke-width: 1; }
.dl-axis { fill: var(--muted); font-family: var(--font-readout); font-size: 12px; }
.dl-area { fill: color-mix(in srgb, var(--reef) 14%, transparent); }
.dl-line { fill: none; stroke: var(--reef); stroke-width: 2.2; stroke-linejoin: round; }
.dl-cursor { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; }
.dl-dot { fill: var(--surface); stroke: var(--reef); stroke-width: 2.5; }
.dl-readout { margin-top: 6px; color: var(--ink-soft); font-family: var(--font-readout); font-size: .95rem; min-height: 1.4em; }

/* ---------- Student area (sa-): overview, courses, brevets, TTU, invitation ----------
 * The overview opens with a pre-dive check: three readouts a diver looks at before
 * getting in the water (fitness, brevet, training). Everything else stays quiet.
 * tone: ok = kelp, warn = buoy, bad = coral, off = not there yet. */

.sa { --sa-ok: var(--kelp); --sa-warn: var(--buoy); --sa-bad: var(--coral); --sa-off: var(--muted); max-width: 1120px; margin: 0 auto; padding: 8px 0 40px; }
.sa .is-ok { --tone: var(--sa-ok); }
.sa .is-warn { --tone: var(--sa-warn); }
.sa .is-bad { --tone: var(--sa-bad); }
.sa .is-off { --tone: var(--sa-off); }
.sa h1 { font-size: 2.1rem; margin: 0; }
.sa h2 { font-size: 1.3rem; margin: 0 0 12px; }
.sa-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 22px; }
.sa-lead { margin: 4px 0 0; color: var(--ink-soft); max-width: 62ch; }
.sa-note { color: var(--ink-soft); font-size: .92rem; max-width: 70ch; }
.sa-quiet { color: var(--muted); }
.btn-link.sa-quiet { text-decoration: none; }
.sa-meta { color: var(--muted); font-size: .9rem; margin: 2px 0 0; }
.sa-org { font: 600 .82rem var(--font-readout); color: var(--reef); letter-spacing: .02em; }
.sa-readout { font-family: var(--font-readout); font-weight: 600; letter-spacing: .01em; }
.sa-back { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-soft); text-decoration: none; font-size: .92rem; margin: 4px 0 6px; }
.sa-back:hover { color: var(--ink); }
.sa-section { margin-top: 34px; }
.sa-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sa-section-head a { font-size: .92rem; }
.sa-empty { background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 22px 24px; }
.sa-empty p { margin: 0 0 12px; max-width: 64ch; color: var(--ink-soft); }
.sa-empty p:last-child { margin-bottom: 0; }

/* the pre-dive check */
.sa-check { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sa-check-item { display: flex; gap: 14px; padding: 20px 22px; color: var(--ink); text-decoration: none; border-left: 1px solid var(--line); position: relative; }
.sa-check-item:first-child { border-left: 0; }
.sa-check-item::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--tone); opacity: .85; }
.sa-check-item.is-off::after { opacity: .25; }
.sa-check-item:hover { background: color-mix(in srgb, var(--water) 70%, white); color: var(--ink); }
.sa-check-item:focus-visible { outline: 3px solid var(--reef); outline-offset: -3px; }
.sa-check-mark { flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--tone); color: #fff; font-size: .95rem; margin-top: 2px; }
.sa-check-item.is-warn .sa-check-mark { background: transparent; color: var(--tone); box-shadow: inset 0 0 0 2px var(--tone); }
.sa-check-item.is-off .sa-check-mark { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 2px var(--line-strong); }
.sa-check-body { display: grid; gap: 1px; min-width: 0; }
.sa-check-label { font-size: .86rem; color: var(--muted); }
.sa-check-word { font: 600 1.35rem/1.2 var(--font-readout); overflow-wrap: anywhere; }
.sa-check-detail { color: var(--ink-soft); font-size: .92rem; }
.sa-check-link { margin-top: 8px; font-size: .88rem; color: var(--brand); font-weight: 500; }

/* what to do next */
.sa-todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sa-todo-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--tone, var(--reef)); border-radius: var(--radius); }
.sa-todo-item.is-interest { --tone: var(--reef); background: color-mix(in srgb, var(--reef) 5%, white); }
.sa-todo-icon { width: 40px; height: 40px; border-radius: var(--radius); display: grid; place-items: center; background: color-mix(in srgb, var(--tone, var(--reef)) 12%, white); color: var(--tone, var(--reef)); }
.sa-todo-text p { margin: 0; }
.sa-todo-text p + p { margin-top: 4px; }
.sa-todo-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sa-todo-actions form { margin: 0; }
.sa-code { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.sa-code code { font: 600 1.05rem var(--font-readout); letter-spacing: .06em; color: var(--ink); background: var(--water); padding: 3px 10px; border-radius: var(--radius-sm); }

/* bookings with their steps */
.sa-bookings { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.sa-booking { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1.3fr) auto; gap: 8px 24px; align-items: center; padding: 16px 20px; border-top: 1px solid var(--line); }
.sa-booking:first-child { border-top: 0; }
.sa-booking-title { font: 600 1.12rem var(--font-readout); color: var(--ink); text-decoration: none; margin-right: 6px; }
.sa-booking-title:hover { color: var(--brand); }
.sa-booking-sentence { margin: 2px 0 0; color: var(--ink-soft); font-size: .92rem; }
.sa-booking.is-rejected .sa-booking-sentence { color: var(--coral); }
.sa-booking-side { display: grid; justify-items: end; gap: 4px; }
.sa-price { font: 600 1.15rem var(--font-readout); }
.sa-docs { display: flex; gap: 12px; font-size: .88rem; }
.sa-docs a { text-decoration: none; }
.sa-booking-code { grid-column: 1 / -1; margin: 0; font-size: .92rem; color: var(--ink-soft); }

.sa-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: none; }
.sa-steps li { position: relative; padding-top: 18px; font-size: .8rem; color: var(--muted); text-align: center; }
.sa-steps li::before { content: ""; position: absolute; top: 5px; left: -50%; right: 50%; height: 2px; background: var(--line); }
.sa-steps li:first-child::before { display: none; }
.sa-steps li::after { content: ""; position: absolute; top: 0; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 2px var(--line-strong); }
.sa-steps li.is-done { color: var(--ink-soft); }
.sa-steps li.is-done::before, .sa-steps li.is-now::before { background: var(--kelp); }
.sa-steps li.is-done::after { background: var(--kelp); box-shadow: none; }
.sa-steps li.is-now { color: var(--ink); font-weight: 600; }
.sa-steps li.is-now::after { box-shadow: inset 0 0 0 3px var(--brand); }
.sa-steps.is-vertical { grid-template-columns: 1fr; gap: 0; margin: 14px 0 4px; }
.sa-steps.is-vertical li { text-align: left; padding: 0 0 14px 24px; font-size: .92rem; display: flex; justify-content: space-between; gap: 8px; }
.sa-steps.is-vertical li::before { top: -9px; bottom: auto; left: 5px; right: auto; width: 2px; height: 14px; }
.sa-steps.is-vertical li::after { top: 4px; left: 0; }
.sa-steps.is-vertical li small { color: var(--muted); font-weight: 400; }

.sa-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.sa-mini { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.sa-mini li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.sa-mini li:first-child { border-top: 0; }
.sa-mini li span { color: var(--tone); font-size: .9rem; white-space: nowrap; }
.sa-figures { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); }
.sa-figures strong { font: 600 1.25rem var(--font-readout); color: var(--ink); margin-right: 4px; }

/* course list */
.sa-search { position: relative; width: min(280px, 100%); }
.sa-search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .85rem; }
.sa-search input { padding-left: 32px; }
.sa-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.sa-chip { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); border-radius: 999px; padding: 3px 14px; font: 600 .88rem var(--font-readout); }
.sa-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.sa-org-group { margin-bottom: 22px; }
.sa-org-group h3 { font-size: 1rem; color: var(--ink-soft); margin: 0 0 8px; }
.sa-offers { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.sa-offer { border-top: 1px solid var(--line); }
.sa-offer:first-child { border-top: 0; }
.sa-offer a { display: flex; justify-content: space-between; gap: 20px; padding: 14px 18px; color: var(--ink); text-decoration: none; }
.sa-offer a:hover { background: color-mix(in srgb, var(--water) 60%, white); }
.sa-offer a:focus-visible { outline: 3px solid var(--reef); outline-offset: -3px; }
.sa-offer.is-noted { box-shadow: inset 4px 0 0 var(--reef); }
.sa-offer-main { display: grid; gap: 2px; min-width: 0; }
.sa-offer-main strong { font: 600 1.08rem var(--font-readout); }
.sa-offer-text { color: var(--ink-soft); font-size: .92rem; max-width: 70ch; }
.sa-offer-price { text-align: right; display: grid; align-content: start; white-space: nowrap; }
.sa-offer-price strong { font: 600 1.2rem var(--font-readout); }
.sa-offer-price s { color: var(--muted); font-size: .85rem; }
.is-offer { color: var(--buoy); }
.sa-flag { display: inline-flex; gap: 6px; align-items: center; color: var(--reef); font-size: .86rem; font-weight: 600; }

/* one course */
.sa-course-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.sa-course-head { margin-bottom: 20px; }
.sa-course-part { padding: 18px 0; border-top: 1px solid var(--line); max-width: 68ch; }
.sa-course-part h2 { font-size: 1.1rem; margin-bottom: 8px; }
.sa-course-part p { margin: 0 0 8px; color: var(--ink-soft); }
.sa-course-part ul { margin: 0; padding-left: 1.2em; color: var(--ink-soft); }
.sa-course-part li { margin-bottom: 4px; }
.sa-course-side { position: sticky; top: 84px; }
.sa-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.sa-panel-price { display: grid; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sa-panel-price strong { font: 600 2rem/1.1 var(--font-readout); }
.sa-panel-price span { color: var(--muted); font-size: .9rem; }
.sa-panel-sentence { margin: 12px 0 0; color: var(--ink-soft); }
.sa-panel-sentence.is-bad { color: var(--coral); }
.sa-panel-note { margin-top: 12px; padding: 10px 12px; background: var(--water); border-radius: var(--radius-sm); font-size: .92rem; color: var(--ink-soft); }
.sa-panel-note > span { display: block; font-weight: 600; color: var(--ink); font-size: .86rem; margin-bottom: 2px; }
.sa-panel-note.is-warn { background: color-mix(in srgb, var(--buoy) 9%, white); }
.sa-panel-code { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 6px; justify-items: start; }
.sa-panel-code span { font-size: .86rem; color: var(--muted); }
.sa-panel-code code { font: 600 1.3rem var(--font-readout); letter-spacing: .08em; color: var(--ink); }
.sa-panel-docs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.sa-panel-docs a { text-decoration: none; }
.sa-request { display: grid; gap: 10px; margin-top: 14px; }
.sa-request .sa-note { margin: 0; font-size: .86rem; }
.sa-panel .sa-flag { margin: 12px 0 0; }

/* brevet cards, shaped like the plastic card */
.sa-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.sa-card { aspect-ratio: 85.6 / 54; min-height: 190px; display: flex; flex-direction: column; padding: 16px 18px; border-radius: 14px; background: linear-gradient(160deg, var(--surface) 55%, color-mix(in srgb, var(--reef) 9%, white)); border: 1px solid var(--line); }
.sa-card.is-bad { background: var(--surface); border-style: dashed; }
.sa-card.is-bad .sa-card-name, .sa-card.is-bad .sa-card-org { color: var(--muted); }
.sa-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sa-card-org { font: 700 1.1rem var(--font-readout); color: var(--ink); letter-spacing: .03em; }
.sa-card-level { font-size: .78rem; color: var(--ink-soft); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 8px; }
.sa .sa-card-name { font-size: 1.25rem; margin: 6px 0 10px; line-height: 1.2; }
.sa-card-facts { display: flex; gap: 18px; flex-wrap: wrap; margin: 0; }
.sa-card-facts dt { font-weight: 400; font-size: .76rem; color: var(--muted); }
.sa-card-facts dd { margin: 0; font-size: .95rem; }
.sa-card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 10px; }
.sa-card-state { font-size: .86rem; font-weight: 600; color: var(--tone); }
.sa-card-actions { display: flex; align-items: center; }
.sa-viewer { min-height: 60vh; display: grid; place-items: center; background: var(--water); }
.sa-viewer img { max-width: 100%; max-height: 75vh; object-fit: contain; }
.sa-viewer iframe { width: 100%; height: 75vh; border: 0; }

/* TTU */
.sa-ttu { display: grid; grid-template-columns: 220px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.sa-ttu-readout { display: grid; align-content: center; justify-items: center; padding: 22px; background: color-mix(in srgb, var(--tone) 9%, white); border-right: 1px solid var(--line); text-align: center; }
.sa-ttu-days { font: 700 4.2rem/1 var(--font-readout); color: var(--tone); }
.sa-ttu-unit { color: var(--ink-soft); margin-top: 4px; }
.sa-ttu-word { font: 600 1.7rem/1.1 var(--font-readout); color: var(--tone); }
.sa-ttu-body { padding: 20px 24px; }
.sa-ttu-state { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 0 0 12px; }
.sa-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); flex: 0 0 auto; }
.sa-ttu-bar { height: 6px; border-radius: 3px; background: var(--water); overflow: hidden; }
.sa-ttu-bar span { display: block; height: 100%; background: var(--tone); border-radius: 3px; }
.sa-ttu-span { display: flex; justify-content: space-between; color: var(--muted); font: 500 .85rem var(--font-readout); margin: 4px 0 14px; }
.sa-facts { display: grid; gap: 8px; margin: 0; }
.sa-facts > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; }
.sa-facts dt { font-weight: 400; color: var(--muted); }
.sa-facts dd { margin: 0; overflow-wrap: anywhere; }
.sa-ttu-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.sa-history { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.sa-history li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); }
.sa-history li:first-child { border-top: 0; }
.sa-history-state { color: var(--tone); font-size: .9rem; }

/* uploading */
.sa-narrow { max-width: 720px; }
.sa-form { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.sa-drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line-strong); border-radius: 10px; background: var(--water); text-align: center; cursor: pointer; }
.sa-drop i { font-size: 1.8rem; color: var(--reef); }
.sa-drop-title { font-weight: 600; overflow-wrap: anywhere; }
.sa-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sa-drop:focus-within { outline: 3px solid var(--reef); outline-offset: 2px; }
.sa-drop.is-over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, white); }
.sa-drop.has-file { border-style: solid; border-color: var(--kelp); background: color-mix(in srgb, var(--kelp) 6%, white); }
.sa-drop.has-file i { color: var(--kelp); }
.sa-drop.is-bad { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 6%, white); }
.sa-more summary { cursor: pointer; font-weight: 500; color: var(--ink-soft); margin-bottom: 12px; }
.sa-form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sa-aside { margin-top: 22px; color: var(--ink-soft); font-size: .92rem; }
.sa-aside h2 { font-size: 1rem; margin: 14px 0 4px; color: var(--ink); }
.sa-aside p { margin: 0; max-width: 64ch; }

/* registering from an invitation: the invitation itself is the deep-water panel */
.sa-invite { max-width: 1060px; }
.sa-invite-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 12px; }
.sa-invite-card { position: sticky; top: 84px; background: var(--ink); color: #e7f0f3; border-radius: 14px; padding: 28px; }
.sa-invite-card h1, .sa-invite-card h2 { color: #fff; }
.sa-invite-card h1 { font-size: 2rem; margin: 4px 0 10px; }
.sa-invite-card h2 { font-size: 1.05rem; margin: 22px 0 10px; }
.sa-invite-card p { color: #c9dbe1; }
.sa-invite-school { font: 600 .95rem var(--font-readout); color: #8fd3e2 !important; margin: 0; }
.sa-invite-note { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid #8fd3e2; background: rgba(255, 255, 255, .06); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: #fff; }
.sa-invite-note footer { margin-top: 6px; color: #9fbac3; font-size: .88rem; }
.sa-invite-courses { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sa-invite-courses label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .07); cursor: pointer; }
.sa-invite-courses label:hover { background: rgba(255, 255, 255, .12); }
.sa-invite-courses input { width: 18px; height: 18px; margin-top: 3px; accent-color: #8fd3e2; flex: 0 0 auto; }
.sa-invite-courses strong { display: block; font: 600 1.08rem var(--font-readout); color: #fff; }
.sa-invite-courses .sa-meta { color: #9fbac3; }
.sa-invite-card .sa-note { color: #9fbac3; font-size: .86rem; margin: 10px 0 0; }
.sa-invite-form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; display: grid; gap: 18px; }
.sa-invite-form fieldset { margin: 0; }
.sa-invite-form legend { font: 600 1.05rem var(--font-readout); margin-bottom: 10px; }
.sa-invite-form legend .sa-quiet { font: 400 .88rem var(--font-ui); }
.sa-invite-email { display: grid; padding: 12px 14px; background: var(--water); border-radius: var(--radius); }
.sa-invite-email span { font-size: .86rem; color: var(--muted); }
.sa-invite-email strong { font-size: 1.05rem; overflow-wrap: anywhere; }
.sa-invite-email small { color: var(--ink-soft); }
.sa-consent .form-check { margin-bottom: 6px; }
.sa-invite-gone { max-width: 560px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }
.sa-invite-gone h1 { font-size: 1.6rem; margin-bottom: 10px; }
.sa-invite-gone-actions { display: flex; gap: 8px; margin: 16px 0 0; }

@media (max-width: 900px) {
    .sa-check { grid-template-columns: 1fr; }
    .sa-check-item { border-left: 0; border-top: 1px solid var(--line); }
    .sa-check-item:first-child { border-top: 0; }
    .sa-booking { grid-template-columns: minmax(0, 1fr) auto; }
    .sa-booking .sa-steps { grid-column: 1 / -1; grid-row: 2; }
    .sa-split, .sa-course-grid, .sa-invite-grid { grid-template-columns: 1fr; }
    .sa-course-side, .sa-invite-card { position: static; }
    .sa-ttu { grid-template-columns: 1fr; }
    .sa-ttu-readout { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
}
@media (max-width: 560px) {
    .sa h1 { font-size: 1.7rem; }
    .sa-todo-item { grid-template-columns: 32px minmax(0, 1fr); }
    .sa-todo-icon { width: 32px; height: 32px; }
    .sa-todo-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .sa-offer a { flex-direction: column; gap: 6px; }
    .sa-offer-price { text-align: left; display: flex; gap: 8px; align-items: baseline; }
    .sa-steps li span { font-size: .72rem; }
    .sa-facts > div { grid-template-columns: 1fr; gap: 0; }
    .sa-history li { grid-template-columns: minmax(0, 1fr) auto; }
    .sa-invite-card, .sa-invite-form { padding: 18px; }
}

/* ---------- Inviting people (iv-) ---------- */
.iv { max-width: 1240px; margin: 0 auto; padding: 8px 0 40px; }
.iv-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 0 20px; }
.iv-head h1 { margin: 0; }
.iv-lead { margin: 4px 0 0; color: var(--ink-soft); max-width: 70ch; }
.iv-quiet { color: var(--muted); font-weight: 400; }
.iv-grid { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 28px; align-items: start; }
.iv-form { display: grid; gap: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; position: sticky; top: 84px; }
.iv-email .form-label { font-weight: 600; }
.iv-hint { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--reef) 9%, white); color: var(--ink); font-size: .9rem; }
.iv-more summary { cursor: pointer; font-weight: 500; margin-bottom: 10px; }
.iv-courses { margin: 0; }
.iv-courses legend { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.iv-course-search { margin-bottom: 8px; }
.iv-course-list { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 10px; }
.iv-course-org { font: 600 .82rem var(--font-readout); color: var(--reef); margin: 8px 0 2px; }
.iv-course { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 4px; border-radius: var(--radius-sm); cursor: pointer; }
.iv-course:hover { background: var(--water); }
.iv-course small { color: var(--muted); font-family: var(--font-readout); }
.iv-picked { margin: 6px 0 0; font-size: .88rem; color: var(--ink-soft); min-height: 1.2em; }
.iv-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.iv-list-head h2 { margin: 0; font-size: 1.3rem; }
.iv-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.iv-tabs a { padding: 4px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-soft); font: 600 .9rem var(--font-readout); }
.iv-tabs a span { color: var(--muted); font-weight: 500; }
.iv-tabs a[aria-current] { background: var(--ink); color: #fff; }
.iv-tabs a[aria-current] span { color: #b9ccd3; }
.iv-rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.iv-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 150px auto; gap: 8px 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.iv-row:first-child { border-top: 0; }
.iv-row-who { display: grid; min-width: 0; }
.iv-row-who span { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.iv-row-courses { display: flex; gap: 4px; flex-wrap: wrap; }
.iv-tag { font-size: .8rem; padding: 1px 8px; border-radius: 999px; background: var(--water); color: var(--ink-soft); }
.iv-row-state { display: grid; }
.iv-row-state small { color: var(--muted); }
.iv-state { font-weight: 600; font-size: .92rem; }
.iv-row.is-sent .iv-state { color: var(--reef); }
.iv-row.is-accepted .iv-state { color: var(--kelp); }
.iv-row.is-expired .iv-state { color: var(--buoy); }
.iv-row-actions { display: flex; gap: 4px; justify-content: flex-end; }
.iv-row-actions form { margin: 0; }
.iv-empty { padding: 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-soft); margin: 0; }
.iv-pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin-top: 12px; color: var(--muted); }
@media (max-width: 1000px) {
    .iv-grid { grid-template-columns: 1fr; }
    .iv-form { position: static; }
    .iv-row { grid-template-columns: minmax(0, 1fr) auto; }
    .iv-row-courses { grid-column: 1 / -1; grid-row: 2; }
    .iv-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Text snippets: picker in the composer (cc-snips) and their page (sn-) ---------- */
.cc-compose { position: relative; grid-template-columns: auto auto 1fr auto; }
.cc-snip-btn {
    width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin: 0;
    color: var(--ink-soft); border: 1px solid var(--line-strong); background: var(--surface);
}
.cc-snip-btn:hover, .cc-snip-btn[aria-expanded="true"] { background: var(--water); color: var(--reef); }
.cc-snip-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cc-snip-btn.is-text { width: auto; height: auto; border: 0; border-radius: var(--radius-sm); background: none; display: inline-flex; gap: 6px; padding: 2px 6px; color: var(--brand); }
.cc-field-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cc-field-head label { font-weight: 500; margin: 0; }
.cc-compose.is-recording .cc-snips { display: none; }

.cc-snips {
    position: absolute; left: 14px; right: 14px; bottom: calc(100% + 6px); z-index: 30; max-width: 560px;
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(380px, 60vh);
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(18, 48, 63, .18); overflow: hidden;
}
.cc-snips[hidden] { display: none; }
.cc-snips.is-below { left: 0; right: 0; top: calc(100% + 4px); bottom: auto; }
.cc-snips-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--reef); }
.cc-snips-list { list-style: none; margin: 0; padding: 4px 0; overflow: auto; }
.cc-snips-list li[role="option"] { display: grid; gap: 1px; padding: 7px 12px; cursor: pointer; border-left: 3px solid transparent; }
.cc-snips-list li[role="option"] strong { font: 600 .98rem var(--font-readout); }
.cc-snips-list li[role="option"] span { color: var(--ink-soft); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-snips-list li[role="option"] small { color: var(--buoy); font-size: .78rem; }
.cc-snips-list li.is-active { background: color-mix(in srgb, var(--reef) 8%, white); border-left-color: var(--reef); }
.cc-snips-group { padding: 8px 12px 2px; font: 600 .78rem var(--font-readout); color: var(--muted); }
.cc-snips-none { padding: 12px; color: var(--muted); font-size: .9rem; }
.cc-snips-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 12px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); background: var(--water); }
.cc-snips-foot kbd { font: 600 .72rem var(--font-readout); color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 4px; margin-right: 2px; box-shadow: none; }
@media (max-width: 560px) { .cc-snips-foot span { display: none; } .cc-snips { left: 8px; right: 8px; } }

.sn { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 160px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 12px 0 32px; }
.sn-list { border-right: 1px solid var(--line); padding: 14px 0; overflow: auto; background: color-mix(in srgb, var(--water) 45%, white); }
.sn-list-head { display: flex; align-items: center; gap: 10px; padding: 0 14px 10px; }
.sn-list-head h1 { font-size: 1.35rem; margin: 0 auto 0 0; }
.sn-back { color: var(--ink-soft); }
.sn-search { margin: 0 14px 10px; width: calc(100% - 28px); }
.sn-empty { padding: 0 14px; color: var(--ink-soft); font-size: .92rem; }
.sn-group-name { font: 600 .82rem var(--font-readout); color: var(--muted); margin: 10px 14px 4px; }
.sn-group ul { list-style: none; margin: 0; padding: 0; }
.sn-group a { display: grid; gap: 1px; padding: 8px 14px; color: var(--ink); text-decoration: none; border-left: 3px solid transparent; }
.sn-group a:hover { background: var(--water); }
.sn-group a[aria-current] { background: var(--surface); border-left-color: var(--reef); }
.sn-item-title { font: 600 1rem var(--font-readout); display: flex; gap: 6px; align-items: center; }
.sn-item-title i { color: var(--muted); font-size: .8rem; }
.sn-item-text { color: var(--ink-soft); font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-item-uses { color: var(--muted); font-size: .76rem; }
.sn-main { padding: 22px 26px; min-width: 0; }
.sn-intro { max-width: 58ch; margin-top: 30px; }
.sn-intro h2 { font-size: 1.45rem; }
.sn-intro p { color: var(--ink-soft); }
.sn-intro kbd, .sn-intro code { font-family: var(--font-readout); background: var(--water); color: var(--ink); border-radius: 3px; padding: 0 5px; }
.sn-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 8px 28px; align-items: start; }
.sn-editor-head, .sn-actions { grid-column: 1 / -1; }
.sn-editor-head h2 { margin: 0; font-size: 1.45rem; }
.sn-meta { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.sn-fields { display: grid; gap: 14px; }
.sn-row .form-label small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.sn-row-split { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; }
.sn-row-split fieldset { margin: 0; }
.sn-channel { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.sn-channel label { margin: 0; }
.sn-channel input { position: absolute; opacity: 0; }
.sn-channel span { display: block; padding: 6px 12px; font-size: .9rem; cursor: pointer; color: var(--ink-soft); border-left: 1px solid var(--line); }
.sn-channel label:first-child span { border-left: 0; }
.sn-channel input:checked + span { background: var(--ink); color: #fff; }
.sn-channel input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: -2px; }
.sn-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.sn-chip { border: 1px dashed var(--reef); background: color-mix(in srgb, var(--reef) 6%, white); color: var(--reef); border-radius: 999px; padding: 1px 9px; font: 600 .8rem var(--font-readout); }
.sn-chip:hover { background: color-mix(in srgb, var(--reef) 14%, white); }
.sn-body { font-size: .98rem; line-height: 1.5; }
/* the preview is the message as the customer reads it */
.sn-preview { position: sticky; top: 84px; background: #e9efe9; border-radius: 10px; padding: 16px 14px 14px; margin-top: 28px;
    background-image: radial-gradient(color-mix(in srgb, var(--kelp) 10%, transparent) 1px, transparent 1px); background-size: 14px 14px; }
.sn-preview-who { margin: 0 0 10px; font-size: .84rem; color: var(--ink-soft); }
.sn-bubble { position: relative; background: #dcf6c6; color: #10291c; border-radius: 10px 10px 2px 10px; padding: 9px 12px; margin-left: 18px; font-size: .95rem; line-height: 1.45; box-shadow: 0 1px 1px rgba(16, 41, 28, .12); overflow-wrap: anywhere; }
.sn-bubble-subject { font-weight: 600; margin: 0 0 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(16, 41, 28, .15); }
.sn-filled { background: rgba(29, 127, 100, .14); border-radius: 3px; padding: 0 2px; }
.sn-bubble mark, .sn-preview-note mark { background: color-mix(in srgb, var(--buoy) 22%, white); color: #7a2f06; padding: 0 2px; border-radius: 3px; }
.sn-preview-note { margin: 10px 0 0; font-size: .8rem; color: var(--ink-soft); }
.sn-quiet { color: var(--muted); }
.sn-actions { display: flex; gap: 8px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); margin-top: 6px; }
@media (max-width: 1100px) { .sn-editor { grid-template-columns: 1fr; } .sn-preview { position: static; margin-top: 0; } }
@media (max-width: 760px) {
    .sn { grid-template-columns: 1fr; border-radius: 0; border-left: 0; border-right: 0; }
    .sn-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
    .sn-main { padding: 16px; }
    .sn-row-split { grid-template-columns: 1fr; }
}

/* a WhatsApp chat known only by its hidden id: give it its number */
.cc-number { flex: 0 1 auto; }
.cc-number-menu { width: 340px; }
.cc-number-hint { margin: 0; font-size: .82rem; color: var(--muted); }
.cc-number-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
@media (max-width: 560px) { .cc-number-menu { width: min(340px, calc(100vw - 32px)); left: auto; right: 0; } }

/* WhatsApp details of a conversation: a sheet from the right */
.cc-details {
    margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(760px, 100vw); max-width: 100vw; padding: 0; border: 0;
    border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); box-shadow: -12px 0 32px rgba(18, 48, 63, .18);
}
.cc-details::backdrop { background: rgba(18, 48, 63, .35); }
.cc-details[open] { display: flex; flex-direction: column; }
.cc-details-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cc-details-head h2 { font-size: 1.2rem; margin: 0 auto 0 0; }
.cc-details-body { overflow: auto; padding: 4px 18px 28px; }
.cc-details-part { padding: 14px 0; border-bottom: 1px solid var(--water); }
.cc-details-part h3 { font-size: 1rem; margin: 0; display: flex; gap: 8px; align-items: center; }
.cc-details-hint { margin: 2px 0 8px; font-size: .82rem; color: var(--muted); }
.cc-details-flag { font: 600 .74rem var(--font-ui); color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, white); border-radius: 999px; padding: 1px 8px; }
.cc-details-facts { display: grid; grid-template-columns: minmax(140px, max-content) minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: .88rem; }
.cc-details-facts dt { font-weight: 400; color: var(--muted); }
.cc-details-facts dd { margin: 0; overflow-wrap: anywhere; }
.cc-details code, .cc-details pre, .cc-details-table td { font-family: var(--font-readout); font-size: .82rem; }
.cc-details code { color: var(--ink); background: var(--water); border-radius: 3px; padding: 0 4px; }
.cc-details-scroll { overflow-x: auto; }
.cc-details-table { border-collapse: collapse; min-width: 100%; }
.cc-details-table th { font-size: .76rem; color: var(--muted); font-weight: 600; text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cc-details-table td { padding: 4px 8px; border-bottom: 1px solid var(--water); white-space: nowrap; }
.cc-details-raw { margin-top: 8px; }
.cc-details-raw summary { cursor: pointer; font-size: .82rem; color: var(--brand); }
.cc-details-raw pre { margin: 6px 0 0; padding: 10px; background: var(--water); border-radius: var(--radius-sm); max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.cc-details-none { color: var(--muted); font-size: .88rem; margin: 0; }
.cc-details-error { color: var(--coral); font-size: .88rem; margin: 0; }
@media (max-width: 560px) { .cc-details-facts { grid-template-columns: 1fr; gap: 0; } .cc-details-facts dd { margin-bottom: 6px; } }

/* ---------- E-mail templates (et-): list in the system settings, editor page ---------- */
.et-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.et-list li + li { border-top: 1px solid var(--line); }
.et-list a { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 10px 14px; color: var(--ink); text-decoration: none; }
.et-list a:hover { background: var(--water); }
.et-list-main { display: grid; min-width: 0; }
.et-list-main small { color: var(--muted); font-size: .84rem; }
.et-list-state { font-size: .84rem; color: var(--muted); white-space: nowrap; }
.et-list-state.is-changed { color: var(--kelp); font-weight: 600; }
.et-kinds { margin-top: 22px; }
.et-kinds > summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.et-kinds > summary small { font-weight: 400; color: var(--muted); margin-left: 8px; }

.et { max-width: 1280px; margin: 0 auto; padding: 8px 0 40px; }
.et-back { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-soft); text-decoration: none; font-size: .92rem; margin: 4px 0 6px; }
.et-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.et-head h1 { margin: 0; font-size: 1.9rem; }
.et-lead { margin: 4px 0 0; color: var(--ink-soft); max-width: 70ch; }
.et-state { margin: 0; font-size: .88rem; color: var(--muted); }
.et-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.et-main { display: grid; gap: 14px; min-width: 0; }
.et-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.et-tabs [role="tab"] { border: 0; background: none; padding: 8px 14px; font: 600 .95rem var(--font-readout); color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.et-tabs [role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); }
.et-tabs [role="tab"]:disabled { color: var(--line-strong); }
.et-tabs-note { font-size: .82rem; color: var(--muted); margin-left: 8px; }
.et-field .form-label small { color: var(--muted); font-weight: 400; margin-left: 4px; }
.et-panel { display: grid; gap: 10px; }
.et-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; background: var(--water); }
.et-toolbar button { border: 0; background: none; min-width: 34px; height: 32px; border-radius: var(--radius-sm); color: var(--ink-soft); padding: 0 8px; }
.et-toolbar button:hover { background: var(--surface); color: var(--ink); }
.et-toolbar button:focus-visible { outline: 2px solid var(--reef); }
.et-sep { width: 1px; background: var(--line-strong); margin: 4px 4px; }
.et-toolbar + .et-canvas { border-top-left-radius: 0; border-top-right-radius: 0; }
.et-canvas {
    min-height: 320px; padding: 22px 26px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff;
    font-family: Arial, Helvetica, sans-serif; color: #12303f; line-height: 1.5; overflow-wrap: anywhere;
}
.et-canvas:focus { outline: 2px solid var(--reef); outline-offset: -1px; }
.et-canvas h2 { font-family: Arial, Helvetica, sans-serif; font-size: 1.4rem; }
.et-code { font: .86rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.et-preview { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.et-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--water); }
.et-preview-head h2 { font-size: 1rem; margin: 0; }
.et-preview-switch { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.et-preview-switch button { border: 0; background: var(--surface); padding: 3px 12px; font-size: .84rem; color: var(--ink-soft); }
.et-preview-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.et-preview-subject { margin: 0; padding: 8px 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.et-frame { width: 100%; height: 620px; border: 0; display: block; background: #eef4f6; }
.et-text-preview { margin: 0; padding: 14px; white-space: pre-wrap; font-size: .86rem; max-height: 620px; overflow: auto; }
.et-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.et-test-result { font-size: .88rem; color: var(--ink-soft); }
.et-test-result.is-ok { color: var(--kelp); }
.et-test-result.is-error { color: var(--coral); }
.et-docs { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.et-docs h2 { font-size: 1.05rem; margin: 0 0 6px; }
.et-docs h2 + .et-docs-lead { margin-top: 0; }
.et-docs-lead { font-size: .84rem; color: var(--muted); }
.et-holders { margin: 0 0 18px; display: grid; gap: 8px; }
.et-holders dt { margin: 0; }
.et-holders dd { margin: 2px 0 0; font-size: .84rem; color: var(--ink-soft); }
.et-holders dd span { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.et-holder { border: 1px dashed var(--reef); background: color-mix(in srgb, var(--reef) 6%, white); color: var(--reef); border-radius: 999px; padding: 1px 10px; font: 600 .84rem var(--font-readout); }
.et-holder:hover:not(:disabled) { background: color-mix(in srgb, var(--reef) 14%, white); }
.et-holder:disabled { opacity: .8; cursor: default; }
.et-rules { margin: 0; font-size: .84rem; }
.et-rules dt { margin-top: 10px; font-weight: 600; }
.et-rules dd { margin: 2px 0 0; color: var(--ink-soft); }
.et-rules code { font-family: var(--font-readout); color: var(--ink); background: var(--water); border-radius: 3px; padding: 0 4px; }
@media (max-width: 1000px) { .et-grid { grid-template-columns: minmax(0, 1fr); } .et-docs { position: static; max-height: none; } }
@media (max-width: 560px) { .et-canvas { padding: 16px; } .et-frame { height: 520px; } }

/* inviting: e-mail or link, and the link to pass on */
.iv-mode { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.iv-mode label { margin: 0; }
.iv-mode input { position: absolute; opacity: 0; }
.iv-mode span { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; color: var(--ink-soft); font-weight: 600; }
.iv-mode label + label span { border-left: 1px solid var(--line-strong); }
.iv-mode input:checked + span { background: var(--ink); color: #fff; }
.iv-mode input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: -3px; }
.iv-share { display: grid; gap: 8px; padding: 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--kelp) 8%, white); border: 1px solid color-mix(in srgb, var(--kelp) 30%, white); }
.iv-share[hidden] { display: none; }
.iv-share-title { margin: 0; font-weight: 600; color: var(--kelp); }
.iv-share-row { display: flex; gap: 8px; flex-wrap: wrap; }
.iv-share-row .form-control { flex: 1 1 220px; font-family: var(--font-readout); }
.iv-share-note { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.iv-kind { color: var(--muted); font-size: .8em; margin-right: 2px; }
.sa-invite-by { margin: 12px 0 0; font-size: .9rem; color: #9fbac3 !important; }

/* inbox head: the title with its two tools in one line; "Neue Nachricht" next to the search */
.cc-list-head { padding: 16px 14px 8px 16px; }
.cc-list-head h1 { font-size: 1.3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cc-head-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.cc-head-tools .cc-icon { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; }
.cc-tools { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.cc-tools > form { grid-column: 1; }
.cc-tools > .cc-new { grid-column: 2; }
.cc-tools > .cc-channels { grid-column: 1 / -1; }
.cc-tools:not(:has(.cc-new)) > form { grid-column: 1 / -1; }
.cc-snips-list li[role="option"] small.is-link { color: var(--reef); }
.sa-friends { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: -8px; padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-soft); }
.sa-friends i { color: var(--reef); font-size: 1.2rem; }
.sa-friends p { margin: 0; flex: 1 1 280px; }

/* the invitation behind a snippet with {Einladungslink}, in the snippet popover */
.cc-snips.is-invite { max-height: min(600px, 78vh); grid-template-rows: 1fr; }
.cc-invite { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.cc-invite[hidden] { display: none; }
.cc-invite-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.cc-invite-head strong { font: 600 1rem var(--font-readout); }
.cc-invite-back { border: 0; background: none; color: var(--ink-soft); width: 28px; height: 28px; border-radius: var(--radius-sm); }
.cc-invite-back:hover { background: var(--water); }
.cc-invite-body { overflow: auto; padding: 10px 12px; display: grid; gap: 10px; }
.cc-invite-note { margin: 0; font-size: .84rem; color: var(--ink-soft); }
.cc-invite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cc-invite-field { display: grid; gap: 2px; margin: 0; font-size: .8rem; color: var(--muted); }
.cc-invite-more summary { cursor: pointer; font-size: .86rem; color: var(--brand); margin-bottom: 6px; }
.cc-invite-courses { display: grid; gap: 6px; }
.cc-invite-courses > span { font-weight: 600; font-size: .9rem; }
.cc-invite-courses > span small { font-weight: 400; color: var(--muted); }
.cc-invite-list { max-height: 170px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px 6px; }
.cc-invite-list label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 2px; margin: 0; font-size: .88rem; cursor: pointer; }
.cc-invite-list label small { color: var(--muted); }
.cc-invite-list label[hidden] { display: none; }
.cc-invite-foot { display: flex; gap: 6px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--water); }
@media (max-width: 560px) { .cc-invite-grid { grid-template-columns: 1fr; } }

/* course form: what a course needs medically */
.cf-medical { display: grid; gap: 6px; }
.cf-medical legend small { font-weight: 400; margin-left: 6px; }
.cf-medical-option { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.cf-medical-option:has(input:checked) { border-color: var(--reef); background: color-mix(in srgb, var(--reef) 6%, white); }
.cf-medical-option input { margin-top: 4px; }
.cf-medical-option span { display: grid; }
.cf-medical-option small { color: var(--muted); }

/* ---------- Medical questionnaire (mc-) ---------- */
.mc { max-width: 900px; padding-bottom: 110px; }
/* Association documents (views/admin/association_document.erb) */
.ad-form { display: grid; gap: 16px; }
.ad-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.ad-card h2 { font-size: 1.1rem; margin: 0 0 4px; }
.ad-fields th { font-size: .8rem; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.ad-fields td { vertical-align: top; }
.ad-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.ad-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.ad-mode:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, var(--surface)); }
.ad-mode input { margin-top: 4px; accent-color: var(--brand); }
.ad-mode span { display: grid; gap: 2px; }
.ad-mode small { color: var(--ink-soft); }
.ad-editor .ql-container { min-height: 220px; font-size: 1rem; font-family: inherit; }
.ad-editor .ql-toolbar, .ad-editor .ql-container { border-color: var(--line); }
.ad-editor .ql-toolbar { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.ad-editor .ql-container { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.ad-actions { display: flex; gap: 12px; align-items: center; }
.ad-delete { margin-top: 28px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.ad-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ad-docs li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ad-docs small { color: var(--ink-soft); display: block; }
/* Privacy statements to confirm (views/consents/confirm.erb) and their state in profiles */
.cs .sa-head { margin-bottom: 18px; }
.cs-form { max-width: 720px; display: grid; gap: 16px; }
.cs-doc { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; display: grid; gap: 10px; }
.cs-doc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.cs-doc h2 { font-size: 1.1rem; margin: 0; }
.cs-version { color: var(--ink-soft); font-size: .88rem; font-variant-numeric: tabular-nums; }
.cs-doc p { margin: 0; color: var(--ink-soft); max-width: 64ch; }
.cs-read { justify-self: start; text-decoration: none; font-weight: 500; }
.cs-guardian { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; max-width: 420px; }
.cs-guardian .form-label { margin: 0; }
.cs-guardian small { color: var(--ink-soft); }
.cs-tick { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--brand, #0d6efd) 6%, var(--surface)); cursor: pointer; font-weight: 500; }
.cs-tick input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--brand, #0d6efd); }
.cs-actions { display: flex; gap: 12px; align-items: center; }
.sa-request-docs { display: grid; gap: 10px; margin: 4px 0 12px; }
.sa-request-docs .cs-doc { border-radius: 8px; }
.cs-text { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px 28px; max-width: 78ch; line-height: 1.6; }
.cs-text h2, .cs-text h3, .cs-text h4 { font-size: 1.1rem; margin: 1.4em 0 .4em; }
.cs-text h2:first-child, .cs-text h3:first-child, .cs-text p:first-child { margin-top: 0; }
.cs-text ul, .cs-text ol { padding-left: 1.4em; }
.cs-text blockquote { border-left: 3px solid var(--line); margin: 0; padding-left: 1em; color: var(--ink-soft); }
.cs-doc-inline { padding: 14px 16px; }
.cs-doc h3 { font-size: 1rem; margin: 0; }
.cs-inline-consent { display: grid !important; gap: 10px; }
.cs-inline-consent .btn { justify-self: start; }
.cs-state { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cs-state li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.cs-state li > i { margin-top: 3px; color: var(--kelp); }
.cs-state li.is-missing > i { color: var(--buoy); }
.cs-state li.is-withdrawn > i { color: var(--coral); }
.cs-state strong { font-weight: 600; }
.cs-state li > small { grid-column: 2; color: var(--ink-soft); }
.cs-state form { grid-column: 2; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mc-hint { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); border-left: 3px solid var(--tone, var(--kelp)); color: var(--ink); text-decoration: none; background: color-mix(in srgb, var(--tone, var(--kelp)) 6%, var(--surface, white)); }
.mc-hint.is-waiting { --tone: var(--buoy); }
.mc-hint > .fa-notes-medical { color: var(--tone, var(--kelp)); font-size: 1.1rem; }
.mc-hint > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mc-hint small { color: var(--ink-soft); }
.mc-hint > .fa-chevron-right { color: var(--ink-soft); font-size: .8rem; }
.mc-hint:hover { color: var(--ink); border-color: var(--tone, var(--kelp)); }
.mc-hint:focus-visible { outline: 2px solid var(--tone, var(--kelp)); outline-offset: 2px; }
.mc-current { display: flex; gap: 8px; align-items: center; color: var(--kelp); font-weight: 500; margin: 0 0 8px; }
.mc-note { color: var(--ink-soft); font-size: .92rem; padding: 10px 14px; border-left: 3px solid var(--buoy); background: color-mix(in srgb, var(--buoy) 7%, white); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.mc-questions { list-style: none; margin: 18px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.mc-q { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.mc-q:first-child { border-top: 0; }
.mc-num { font: 700 1.5rem/1 var(--font-readout); color: var(--line-strong); text-align: center; }
.mc-q.is-yes .mc-num { color: var(--buoy); }
.mc-text { margin: 0; max-width: 64ch; }
.mc-yn { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; flex: 0 0 auto; }
.mc-yn label { margin: 0; position: relative; }
.mc-yn input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.mc-yn span { display: block; min-width: 64px; padding: 6px 14px; text-align: center; cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.mc-yn label + label span { border-left: 1px solid var(--line-strong); }
.mc-yn input:checked + span { color: #fff; }
.mc-yn label:first-child input:checked + span { background: var(--buoy); }
.mc-yn label:last-child input:checked + span { background: var(--kelp); }
.mc-yn input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: -3px; }
.mc-yn.is-small span { min-width: 52px; padding: 3px 10px; font-size: .88rem; }
.mc-flag { grid-column: 2 / -1; margin: 0; color: var(--buoy); font-size: .88rem; font-weight: 500; }
.mc-box { grid-column: 2 / -1; margin: 4px 0 0; padding: 10px 14px; border-radius: var(--radius); background: var(--water); border: 0; }
.mc-box legend { float: none; width: auto; font: 600 .95rem var(--font-readout); margin-bottom: 4px; }
.mc-sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mc-sub:first-of-type { border-top: 0; }
.mc-sub p { margin: 0; font-size: .92rem; }
.mc-sub.is-yes p { color: #a8460f; }
.mc-sign { margin-top: 22px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 14px; }
.mc-sign h2 { margin: 0; font-size: 1.25rem; }
.mc-statement { margin: 0; padding: 12px 16px; border-left: 3px solid var(--reef); background: var(--water); color: var(--ink-soft); }
.mc-physician { padding: 12px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--buoy) 9%, white); }
.mc-physician p { margin: 0 0 6px; }
.mc-physician p:last-child { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.mc-stored { display: flex; gap: 10px; align-items: center; margin: 0; }
.mc-stored img { max-height: 36px; max-width: 160px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 2px; }
.sign.is-missing canvas { outline: 2px solid var(--coral); }
.mc-sign .btn-lg { justify-self: start; }
/* the result travels with the page: what the answers mean so far */
.mc-outcome {
    position: sticky; bottom: 12px; z-index: 20; display: flex; gap: 14px; align-items: center; margin-top: 18px;
    padding: 12px 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong);
    box-shadow: 0 8px 24px rgba(18, 48, 63, .14);
}
.mc-outcome i { font-size: 1.4rem; color: var(--muted); }
.mc-outcome div { display: grid; }
.mc-outcome strong { font: 600 1.1rem var(--font-readout); }
.mc-outcome span { color: var(--ink-soft); font-size: .9rem; }
.mc-outcome.is-ok { border-color: var(--kelp); background: color-mix(in srgb, var(--kelp) 7%, white); }
.mc-outcome.is-ok i, .mc-outcome.is-ok strong { color: var(--kelp); }
.mc-outcome.is-doctor { border-color: var(--buoy); background: color-mix(in srgb, var(--buoy) 8%, white); }
.mc-outcome.is-doctor i, .mc-outcome.is-doctor strong { color: #a8460f; }
.mc-head-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-yes-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.mc-yes-list li { padding: 10px 14px; border-top: 1px solid var(--line); }
.mc-yes-list li:first-child { border-top: 0; }
.mc-yes-list span { display: block; font: 600 .82rem var(--font-readout); color: #a8460f; }
.mc-all { margin-top: 24px; }
.mc-all summary { cursor: pointer; font-weight: 600; }
.mc-answers { margin: 10px 0 0; padding-left: 1.4em; display: grid; gap: 8px; font-size: .92rem; }
.mc-answers ul { list-style: none; padding: 6px 0 0 0; margin: 0; display: grid; gap: 4px; }
.mc-a { display: inline-block; min-width: 44px; margin-right: 8px; font: 600 .8rem var(--font-readout); color: var(--kelp); }
.mc-a.is-yes { color: #a8460f; }
.mc-signature img { max-height: 70px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px; margin-top: 10px; }
.mc-verify { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.mc-verify-form { display: grid; gap: 8px; }
.mc-verify-actions { display: flex; gap: 8px; }
.mc-delete { margin-top: 18px; }
.mc-tabs { margin-bottom: 14px; }
.mc-list li { grid-template-columns: minmax(0, 1fr) auto auto auto; }
.mc-list a { text-decoration: none; }
@media (max-width: 640px) {
    .mc-q { grid-template-columns: 30px minmax(0, 1fr); }
    .mc-q .mc-yn { grid-column: 2; justify-self: start; }
    .mc-num { font-size: 1.2rem; }
    .mc-sub { grid-template-columns: 1fr; gap: 4px; }
    .mc-list li { grid-template-columns: minmax(0, 1fr) auto; }
}
.mc-cta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 16px 18px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 10px; }
.mc-cta i { font-size: 1.5rem; color: var(--reef); }
.mc-cta p { margin: 0; flex: 1 1 320px; color: var(--ink-soft); }
.mc-row-actions { display: flex; gap: 4px; }
/* what a course needs medically, and where the person stands */
.sa-req { margin-top: 14px; padding: 12px; border-radius: var(--radius); border: 1px solid var(--line); display: grid; gap: 4px; }
.sa-req > span:first-child { font-size: .84rem; color: var(--muted); }
.sa-req strong { color: var(--tone); }
.sa-req p { margin: 4px 0 0; font-size: .88rem; color: var(--ink-soft); }
.sa-req-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.sa-req.is-ok { background: color-mix(in srgb, var(--kelp) 6%, white); }
.sa-req.is-warn { background: color-mix(in srgb, var(--buoy) 7%, white); }
.sa-req.is-bad { background: color-mix(in srgb, var(--coral) 6%, white); }
.tr-medical { display: block; font-size: .8rem; font-weight: 500; }
.tr-medical.is-warn { color: #a8460f; }
.tr-medical.is-bad { color: var(--coral); }
.mc-verify-sig { max-height: 54px; max-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 3px; }

/* data protection: leftovers of accounts deleted the old way */
.dp-orphans { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; max-width: 80ch; margin-bottom: 24px; padding: 16px 18px; border: 1px solid var(--coral); border-left-width: 4px; border-radius: var(--radius); background: color-mix(in srgb, var(--coral) 5%, white); }
.dp-orphans > div { flex: 1 1 360px; }
.dp-orphans h2 { font-size: 1.1rem; margin: 0 0 6px; }
.dp-orphans p { margin: 0 0 8px; }
.dp-orphans ul { margin: 0 0 8px; padding-left: 1.2em; }
.dp-orphans-note { font-size: .88rem; color: var(--ink-soft); }

/* deleting a person: what goes now, what stays until its period ends */
.de { max-width: 900px; }
.de-block { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--buoy) 9%, white); font-weight: 500; }
.de-split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 18px 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.de-col { padding: 16px 18px; }
.de-col + .de-col { border-left: 1px solid var(--line); }
.de-col h2 { font-size: 1.05rem; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.de-col h2::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--tone); }
.de-col.is-gone { --tone: var(--coral); }
.de-col.is-kept { --tone: var(--kelp); background: var(--water); }
.de-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.de-col li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; }
.de-col li:not(:has(.de-n)) { grid-template-columns: 1fr; }
.de-col li small { grid-column: 1 / -1; color: var(--muted); font-size: .82rem; }
.de-n { font: 700 1rem var(--font-readout); color: var(--coral); min-width: 2ch; text-align: right; }
.de-note { font-size: .88rem; color: var(--ink-soft); max-width: 75ch; }
.de-confirm { display: grid; gap: 8px; max-width: 560px; padding: 16px 18px; border: 1px solid var(--coral); border-radius: 10px; background: var(--surface); }
.de-actions { display: flex; gap: 8px; align-items: center; }
@media (max-width: 720px) {
  .de-split { grid-template-columns: 1fr; }
  .de-col + .de-col { border-left: 0; border-top: 1px solid var(--line); }
}
.sa-booking-req { grid-column: 1 / -1; }
.sa-booking-req .sa-req { margin-top: 2px; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; }
.sa-booking-req .sa-req > span:first-child { grid-column: 1 / -1; }
.sa-booking-req .sa-req p, .sa-booking-req .sa-req-actions { grid-column: 1 / -1; }

/* system settings: when the medical requirement has to be met, drawn as the booking's path */
.ss-gate { display: grid; gap: 10px; }
.ss-gate-option { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); }
.ss-gate-option:has(input:checked) { border-color: var(--reef); box-shadow: inset 3px 0 0 var(--reef); }
.ss-gate-option input { margin-top: 5px; }
.ss-gate-body { display: grid; gap: 4px; flex: 1; }
.ss-gate-body > span { color: var(--ink-soft); font-size: .92rem; max-width: 62ch; }
.ss-gate-line { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); margin: 10px 0 2px; padding: 0; position: relative; }
.ss-gate-line::before { content: ''; position: absolute; left: 6px; right: calc(33% - 6px); top: 6px; height: 2px; background: var(--line-strong); }
.ss-gate-line li { position: relative; padding-top: 20px; font-size: .84rem; color: var(--muted); }
.ss-gate-line li::before { content: ''; position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); }
.ss-gate-line li.is-gate::before { border-color: var(--buoy); background: color-mix(in srgb, var(--buoy) 25%, white); }
.ss-gate-line li.is-hard::before { border-color: var(--reef); background: var(--reef); }
.ss-gate-line li span { display: block; font-weight: 600; color: var(--ink); }
.ss-gate-line em { font-style: normal; display: block; }
.ss-gate-line li.is-hard em { color: var(--reef); font-weight: 600; }

/* All mailboxes (views/admin/email_accounts.erb) */
.ea-table td { vertical-align: middle; }
.ea-delete summary { list-style: none; }
.ea-delete summary::-webkit-details-marker { display: none; }
.ea-delete[open] .ea-delete-form { position: absolute; right: 16px; z-index: 5; width: 300px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.ea-delete-form p { font-size: .85rem; color: var(--ink-soft); }

/* Courses for a person by the team (views/admin/course_interests.erb, _person_courses.erb) */
.ci-add { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; margin-bottom: 18px; }
.ci-add .form-label { margin: 0; }
@media (max-width: 768px) { .ci-add { grid-template-columns: 1fr; } }
.pc h6 { font-weight: 600; font-size: .95rem; }
.pc-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.pc-list li { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.pc-list small { color: var(--ink-soft); margin-left: 4px; }
.pc-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pc-form .form-select, .pc-form .form-control { flex: 1 1 160px; width: auto; }

/* Customer communication: archive / delete menu (views/communication/index.erb) */
.cc-more { position: relative; }
.cc-more summary { list-style: none; }
.cc-more summary::-webkit-details-marker { display: none; }
.cc-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 180px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cc-more-menu .btn-link { display: block; width: 100%; text-align: left; text-decoration: none; }

/* Kinds of notifications for everyone (views/admin/notification_types.erb) */
.nt-group { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 16px; }
.nt-group h2 { font-size: 1.05rem; margin: 0 0 8px; }
.nt-group th:not(:first-child) { width: 130px; }
.nt-off td:first-child { opacity: .55; }
.nt-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--water); }

/* The school's starting slides (views/presenter/defaults.erb) */
.pd-form { display: grid; gap: 16px; max-width: 900px; }
.pd-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; }
.pd-card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.pd-switches { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; }
.pd-results { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }
.pd-actions { display: flex; gap: 12px; }

/* Merge a duplicate dive site (views/dive_sites/admin/index.erb) */
.ds-merge { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; max-width: 460px; width: 92vw; }
.ds-merge::backdrop { background: rgba(0, 0, 0, .35); }

/* ---------- 404: a dive profile that leaves the chart (views/not_found.erb) ---------- */
.nf { max-width: 880px; margin: 32px 0 72px; }
.nf-profile { display: block; width: 100%; height: auto; overflow: visible; }
.nf-surface { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 5; }
.nf-line { fill: none; stroke: var(--reef); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: nf-draw 1.6s cubic-bezier(.45, 0, .2, 1) .15s forwards; }
.nf-end { fill: var(--buoy); stroke: color-mix(in srgb, var(--buoy) 25%, transparent); stroke-width: 8; paint-order: stroke;
  opacity: 0; animation: nf-show .3s ease 1.7s forwards; }
/* the depth sits under the end of the line (584 of 640 = 91%), the words beside it */
.nf-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "words depth"; align-items: start; gap: 8px 32px; }
.nf-depth { grid-area: depth; justify-self: end; margin-right: calc(9% - 1.1em); display: flex; align-items: baseline; gap: .12em;
  font-family: var(--font-readout); font-weight: 700; color: var(--ink); line-height: .85; font-variant-numeric: tabular-nums; }
.nf-number { font-size: clamp(4.5rem, 13vw, 8.5rem); letter-spacing: -.02em; }
.nf-unit { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 600; color: var(--ink-soft); }
.nf-words { grid-area: words; padding-top: 18px; }
.nf h1 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin: 0 0 10px; }
.nf-text { color: var(--ink-soft); max-width: 52ch; margin: 0 0 22px; }
.nf-text code { color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 1px 6px; word-break: break-all; }
.nf-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
@media (max-width: 640px) {
  .nf-body { grid-template-columns: 1fr; grid-template-areas: "depth" "words"; }
  .nf-words { padding-top: 4px; }
}
@keyframes nf-draw { to { stroke-dashoffset: 0; } }
@keyframes nf-show { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .nf-line { animation: none; stroke-dashoffset: 0; }
  .nf-end { animation: none; opacity: 1; }
}


/* ---------- Geburtstage (views/birthdays.erb, views/birthdays/_glance.erb) ---------- */
.bd-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin: 8px 0 14px; }
.bd-head h1 { margin: 0 0 4px; }
.bd-lede { color: var(--ink-soft); margin: 0; max-width: 62ch; }
.bd-lede a { margin-left: 4px; white-space: nowrap; }
.bd-search { flex: 0 1 300px; }
.bd-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 24px; }
.bd-filter a { padding: 6px 14px; color: var(--ink-soft); text-decoration: none; font-weight: 500; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface); }
.bd-filter a.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.bd-filter a:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.bd-filter-note { color: var(--muted); font-size: .9rem; }

.bd-count { font-family: var(--font-readout); font-size: .9rem; font-weight: 600; color: var(--muted); }
.bd-none { color: var(--muted); margin: 0 0 8px; }
.bd-more { display: inline-block; margin-top: 8px; font-weight: 500; }
.bd-summary { color: var(--ink-soft); margin: -4px 0 10px; font-size: .92rem; }
.bd-today h2, .bd-week h2, .bd-months h2, .bd-detail h2 { display: flex; align-items: baseline; gap: 10px; font-size: 1.25rem; margin: 0 0 10px; }

/* today: the people themselves, large */
.bd-today { margin: 0 0 30px; }
.bd-today ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.bd-today li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 14px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--buoy); border-radius: var(--radius); }
.bd-today-who { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.bd-today-who strong { font-size: 1.05rem; }
.bd-today-who > span { color: var(--muted); font-size: .88rem; }
.bd-today-who .bd-greet { margin-top: 4px; }
.bd-age { font-family: var(--font-readout); color: var(--ink-soft); text-align: right; line-height: 1; font-size: .85rem; }
.bd-age b { display: block; font-size: 2.1rem; color: var(--ink); font-weight: 700; }

/* the next days: a bar per day (how many), then the people of each day */
.bd-week { margin: 0 0 30px; }
.bd-bars { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.bd-bars a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; text-decoration: none; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bd-bars a:hover { border-color: var(--reef); }
.bd-bars a:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.bd-bar { display: flex; align-items: flex-end; width: 22px; height: 54px; background: var(--water); border-radius: 4px; overflow: hidden; }
.bd-bar i { display: block; width: 100%; height: calc(max(var(--n), .04) * 100%); background: var(--reef); }
.bd-bars b { font-family: var(--font-readout); font-size: 1.3rem; color: var(--ink); line-height: 1.1; }
.bd-bars span:last-child { font-family: var(--font-readout); font-size: .85rem; }
.bd-bars li.is-empty a { opacity: .55; }
.bd-day-block { margin: 0 0 16px; }
.bd-day-block h3 { display: flex; align-items: baseline; gap: 8px; font-size: 1rem; margin: 0 0 6px; }

/* lists */
.bd-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.bd-list li { display: grid; grid-template-columns: 44px auto minmax(0, 1fr) auto; align-items: center; gap: 4px 14px; padding: 10px 16px; }
.bd-list li.no-date { grid-template-columns: auto minmax(0, 1fr) auto; }
.bd-list li + li { border-top: 1px solid var(--line); }
.bd-list li.is-soon .bd-day b { color: var(--buoy); }
.bd-day { display: flex; flex-direction: column; align-items: center; font-family: var(--font-readout); line-height: 1; }
.bd-day b { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.bd-day span { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.bd-who { display: flex; flex-direction: column; min-width: 0; }
.bd-who a, .bd-today-who a { color: inherit; text-decoration: none; }
.bd-who a:hover, .bd-today-who a:hover { text-decoration: underline; }
.bd-who small { color: var(--muted); }
.bd-when { display: flex; flex-direction: column; align-items: flex-end; font-family: var(--font-readout); }
.bd-turns { color: var(--ink-soft); }
.bd-turns b { color: var(--ink); font-size: 1.1rem; }
.bd-when small { color: var(--muted); }
.bd-list .bd-greet { grid-column: 3 / -1; justify-self: start; }
.bd-list li.no-date .bd-greet { grid-column: 2 / -1; }

/* months ahead: how many, each opens on its own */
.bd-months { margin: 0 0 30px; }
.bd-months ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.bd-months a { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 14px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.bd-months a:hover { border-color: var(--reef); }
.bd-months a b { font-family: var(--font-readout); font-size: 1.15rem; color: var(--reef); }
.bd-months a.is-empty { color: var(--muted); }
.bd-months a.is-empty b { color: var(--muted); }

.bd-detail { margin: 0 0 30px; }
.bd-back { display: inline-block; margin-bottom: 10px; }
.bd-pages { display: flex; align-items: center; gap: 16px; margin-top: 14px; color: var(--muted); }

.bd-greet { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; padding: 2px 10px; border-radius: 999px; border: 1px solid transparent; }
.bd-greet::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bd-greet.is-sent { color: var(--kelp); border-color: color-mix(in srgb, var(--kelp) 35%, transparent); }
.bd-greet.is-due { color: var(--reef); border-color: color-mix(in srgb, var(--reef) 35%, transparent); }
.bd-greet.is-failed { color: var(--coral); border-color: color-mix(in srgb, var(--coral) 35%, transparent); }
.bd-greet.is-none { color: var(--muted); border-color: var(--line); }

/* dashboards: today and the next days at a glance */
.bd-glance { margin: 0 0 24px; padding: 0; }
.bd-glance-head { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.bd-glance-head h2 { font-size: 1.1rem; margin: 0; }
.bd-glance-head h2 i { color: var(--buoy); margin-right: 6px; }
.bd-glance-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
.bd-glance-today, .bd-glance-week { padding: 14px 18px; }
.bd-glance-week { border-left: 1px solid var(--line); }
.bd-glance h3 { display: flex; align-items: baseline; gap: 8px; font-size: .95rem; margin: 0 0 10px; }
.bd-glance-today ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bd-glance-today li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.bd-glance-today li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-glance-today li b { font-family: var(--font-readout); font-weight: 600; color: var(--ink-soft); }
.bd-glance-none { color: var(--muted); margin: 0; }
.bd-glance-more { display: inline-block; margin-top: 8px; font-size: .9rem; }
.bd-glance-week ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bd-glance-week ol a { display: grid; grid-template-columns: 74px 60px minmax(0, 1fr); align-items: center; gap: 10px; padding: 4px 6px;
  border-radius: var(--radius-sm); text-decoration: none; color: var(--ink); }
.bd-glance-week ol a:hover { background: var(--water); }
.bd-glance-day { font-family: var(--font-readout); font-weight: 600; }
.bd-glance-bar { height: 8px; background: var(--water); border-radius: 4px; overflow: hidden; }
.bd-glance-bar i { display: block; height: 100%; width: calc(var(--n) * 100%); background: var(--reef); }
.bd-glance-names { color: var(--ink-soft); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-glance-week li.is-empty a { color: var(--muted); }
.bd-glance-week li.is-empty .bd-glance-names { color: var(--muted); }

@media (max-width: 767px) {
  .bd-glance-body { grid-template-columns: 1fr; }
  .bd-glance-week { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 575px) {
  .bd-search { flex-basis: 100%; }
  .bd-bars { gap: 4px; }
  .bd-bars a { padding: 8px 2px 6px; }
  .bd-bar { width: 16px; height: 40px; }
  .bd-list li { grid-template-columns: 38px minmax(0, 1fr) auto; padding: 10px 12px; }
  .bd-list li.no-date { grid-template-columns: minmax(0, 1fr) auto; }
  .bd-list li > .avatar { display: none; }
  .bd-list .bd-greet, .bd-list li.no-date .bd-greet { grid-column: 1 / -1; }
  .bd-glance-week ol a { grid-template-columns: 66px 40px minmax(0, 1fr); }
}

/* profile: what is still missing, and the e-mails one agreed to */
.profile-missing { margin: 6px 0 0; color: var(--ink-soft); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.profile-missing a { color: var(--buoy); font-weight: 600; text-decoration: none; border-bottom: 1px dashed currentColor; }
.profile-missing a:hover { border-bottom-style: solid; }
.profile-optins { display: grid; gap: 14px; }
.profile-optins .form-check { padding-left: 3.2em; margin: 0; }
.profile-optins .form-check-input { margin-left: -3.2em; width: 2.4em; height: 1.3em; }
.profile-optins .form-check-label { font-weight: 500; }
.profile-optins small { display: block; color: var(--muted); font-weight: 400; }
.bd-glance-head { gap: 12px; }
.bd-glance-head h2 small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: 2px; }
.bd-glance-head a { white-space: nowrap; }

/* association documents to sign (views/consents/_documents.erb) */
.cs-sign { display: grid; gap: 14px; margin: 14px 0 6px; }
.cs-sign-note { margin: 0; color: var(--ink-soft); font-size: .92rem; }
.cs-sign .sign-missing { display: none; color: var(--coral); }
.cs-sign .sign.is-missing .sign-missing { display: block; }

/* uploaded documents of a person (views/documents/_list.erb) */
.pd-empty { color: var(--muted); margin: 0 0 10px; }
.pd-list { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pd-list > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 14px; align-items: start; padding: 12px 14px; }
.pd-list > li + li { border-top: 1px solid var(--line); }
.pd-icon { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; font-size: 1.05rem; }
.pd-icon.is-pdf { background: color-mix(in srgb, var(--coral) 12%, transparent); color: var(--coral); }
.pd-icon.is-image { background: color-mix(in srgb, var(--reef) 12%, transparent); color: var(--reef); }
.pd-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.pd-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.pd-title:hover { text-decoration: underline; }
.pd-meta, .pd-by { color: var(--ink-soft); font-size: .88rem; }
.pd-by { color: var(--muted); }
.pd-note { font-size: .9rem; white-space: pre-line; }
.pd-consent { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; font-size: .78rem; color: var(--kelp);
  border: 1px solid color-mix(in srgb, var(--kelp) 35%, transparent); }
.pd-edit { position: relative; }
.pd-edit summary { list-style: none; cursor: pointer; padding: 4px 10px; border-radius: var(--radius-sm); color: var(--ink-soft); }
.pd-edit summary::-webkit-details-marker { display: none; }
.pd-edit summary:hover, .pd-edit[open] summary { background: var(--water); }
.pd-edit[open] { grid-column: 1 / -1; }
.pd-edit[open] summary { display: inline-block; }
.pd-edit-body { display: grid; gap: 10px; padding: 10px 0 2px; }
.pd-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: end; }
.pd-form label { display: grid; gap: 4px; font-weight: 500; font-size: .92rem; margin: 0; }
.pd-form label small { font-weight: 400; color: var(--muted); }
.pd-form .pd-wide { grid-column: 1 / -1; }
.pd-form > button { justify-self: start; }
.pd-kinds { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.pd-kinds legend { font-size: .92rem; font-weight: 500; margin-bottom: 4px; }
.pd-kinds label { display: block; font-weight: 400; }
.pd-kinds label small { display: block; margin-left: 1.5rem; }
.pd-assoc { margin-left: 1.5rem; max-width: 26rem; }
.pd-upload { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 10px 14px; background: var(--surface); }
.pd-upload summary { cursor: pointer; font-weight: 600; color: var(--reef); }
.pd-upload[open] summary { margin-bottom: 12px; }
@media (max-width: 575px) { .pd-form { grid-template-columns: 1fr; } }
.profile-doc-head { font-size: 1.1rem; margin: 0 0 6px; }
.profile-doc-head ~ .profile-doc-head { margin-top: 26px; }

/* ---------- a person's file (views/admin/user_detail.erb) ---------- */
.ud-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 20px; align-items: center; margin: 12px 0 18px; }
.ud-head .ud-photo { grid-row: span 1; }
.ud-id h1 { margin: 0 0 4px; font-size: 1.9rem; }
.ud-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 0 0 4px; color: var(--ink-soft); font-size: .92rem; }
.ud-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; font-size: .92rem; }
.ud-contact a { color: var(--ink-soft); text-decoration: none; }
.ud-contact a:hover { color: var(--reef); text-decoration: underline; }
.ud-contact i { color: var(--muted); margin-right: 4px; }
.ud-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-self: start; }
.ud-actions .dropdown-item form, .ud-actions li > form { margin: 0; }
.ud-pill { display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; border: 1px solid transparent; }
.ud-pill.is-kelp { color: var(--kelp); background: color-mix(in srgb, var(--kelp) 10%, transparent); }
.ud-pill.is-reef { color: var(--reef); background: color-mix(in srgb, var(--reef) 10%, transparent); }
.ud-pill.is-coral { color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, transparent); }
.ud-pill.is-buoy { color: var(--buoy); background: color-mix(in srgb, var(--buoy) 12%, transparent); }
.ud-pill.is-muted { color: var(--muted); background: var(--water); }

/* ready to dive: the checks as knots on a descent line */
.ud-ready { margin: 0 0 22px; padding: 16px 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ud-ready h2 { display: flex; align-items: baseline; gap: 12px; font-size: 1.05rem; margin: 0 0 14px; }
.ud-ready h2 span { font-family: var(--font-readout); font-weight: 600; font-size: .95rem; color: var(--muted); }
.ud-line { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); position: relative; }
.ud-line::before { content: ""; position: absolute; left: 9px; right: 9px; top: 8px; height: 2px; background: var(--line-strong); }
.ud-line li { position: relative; min-width: 0; }
.ud-line a { display: flex; flex-direction: column; gap: 2px; padding: 0 10px 0 0; color: var(--ink); text-decoration: none; }
.ud-line a:hover strong { text-decoration: underline; }
.ud-line a:focus-visible { outline: 2px solid var(--reef); outline-offset: 4px; border-radius: 4px; }
.ud-knot { position: relative; z-index: 1; width: 18px; height: 18px; border-radius: 50%; margin-bottom: 8px; background: var(--surface); border: 3px solid var(--line-strong); }
.ud-line li.is-ok .ud-knot { background: var(--kelp); border-color: var(--kelp); }
.ud-line li.is-open .ud-knot { border-color: var(--buoy); }
.ud-line li.is-missing .ud-knot { background: var(--coral); border-color: var(--coral); }
.ud-line strong { font-size: .95rem; }
.ud-knot-text { font-size: .85rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.ud-line li.is-open .ud-knot-text { color: var(--buoy); }
.ud-line li.is-missing .ud-knot-text { color: var(--coral); }
.ud-line li.is-off { opacity: .6; }

.ud-tabs { margin-bottom: 18px; }
.ud-panel { display: grid; gap: 16px; margin-bottom: 30px; }
.ud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ud-wide { grid-column: 1 / -1; }
.ud-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; min-width: 0; }
.ud-card > h2, .ud-card-head h2 { font-size: 1.05rem; margin: 0 0 12px; }
.ud-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ud-card.is-wanting { border-left: 4px solid var(--buoy); }
.ud-hint { color: var(--ink-soft); font-size: .92rem; max-width: 75ch; margin: -4px 0 12px; }
.ud-facts { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.ud-facts dt { font-weight: 500; color: var(--muted); }
.ud-facts dd { margin: 0; overflow-wrap: anywhere; }
.ud-facts dd .ud-pill { margin-left: 6px; }
.ud-none { color: var(--muted); }
.ud-certs, .ud-ttus, .ud-devices { list-style: none; margin: 0; padding: 0; }
.ud-certs li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 8px 0; }
.ud-certs li + li, .ud-devices li + li { border-top: 1px solid var(--line); }
.ud-cert-org { font-family: var(--font-readout); font-weight: 700; color: var(--reef); }
.ud-cert-name { display: flex; flex-direction: column; min-width: 0; }
.ud-cert-name small, .ud-cert-date { color: var(--muted); font-size: .88rem; }
.ud-ttus { display: grid; gap: 10px; }
.ud-ttus li { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); }
.ud-ttus li.is-ok { border-left-color: var(--kelp); }
.ud-ttus li.is-warn { border-left-color: var(--buoy); }
.ud-ttus li.is-bad { border-left-color: var(--coral); }
.ud-ttu-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.ud-ttu-detail { color: var(--ink-soft); font-size: .9rem; }
.ud-ttu-warn { color: var(--buoy); font-size: .9rem; font-weight: 500; }
.ud-devices li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.ud-devices li span { display: flex; flex-direction: column; }
.ud-devices small { color: var(--muted); }
.ud-dp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ud-hold label { display: block; font-size: .88rem; color: var(--muted); margin-bottom: 4px; }
.ud-hold-row { display: flex; gap: 8px; max-width: 40rem; }

@media (max-width: 767px) {
  .ud-head { grid-template-columns: auto minmax(0, 1fr); }
  .ud-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .ud-grid { grid-template-columns: 1fr; }
  /* the line runs down on a phone */
  .ud-line { grid-template-columns: 1fr; gap: 12px; }
  .ud-line::before { left: 8px; right: auto; top: 9px; bottom: 9px; width: 2px; height: auto; }
  .ud-line a { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 12px; padding: 0; }
  .ud-knot { margin: 0; grid-row: span 2; }
  .ud-certs li { grid-template-columns: 40px minmax(0, 1fr); }
  .ud-certs li .ud-cert-date, .ud-certs li .ud-pill { grid-column: 2; justify-self: start; }
  .ud-facts { grid-template-columns: 1fr; gap: 2px; }
  .ud-facts dd { margin-bottom: 8px; }
}
.pd-edit-inline { margin-top: 6px; }
.pd-edit-inline summary { cursor: pointer; color: var(--reef); font-size: .9rem; }

/* ---------- customer communication: receipts and message details ---------- */
.cc-state.is-read b { color: #34b7f1; } /* read on the customer's phone, as WhatsApp shows it */
.cc-info { border: 0; background: none; padding: 0 2px; margin-left: 4px; color: inherit; opacity: .45; font-size: .8rem; cursor: pointer; }
.cc-msg:hover .cc-info, .cc-info:focus-visible { opacity: .9; }
.cc-info:focus-visible { outline: 2px solid var(--reef); border-radius: 4px; }
.cd { width: min(420px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 12px; padding: 0; color: var(--ink); }
.cd::backdrop { background: rgba(18, 48, 63, .35); }
.cd-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 0; }
.cd-head h2 { font-size: 1.05rem; margin: 0; }
.cd-close { border: 0; background: none; font-size: 1.1rem; color: var(--muted); padding: 4px 6px; border-radius: 6px; }
.cd-close:hover { background: var(--water); }
.cd-excerpt { margin: 10px 18px 4px; padding: 8px 12px; border-left: 3px solid var(--line-strong); color: var(--ink-soft); font-size: .92rem; white-space: pre-line; }
.cd-body { padding: 8px 18px 18px; }
.cd-wait, .cd-note { color: var(--muted); font-size: .9rem; margin: 6px 0; }
/* the way of the message: a line with a knot per step */
.cd-line { list-style: none; margin: 8px 0 4px; padding: 0; position: relative; }
.cd-line::before { content: ""; position: absolute; left: 7px; top: 10px; bottom: 10px; width: 2px; background: var(--line-strong); }
.cd-line li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 7px 0; }
.cd-knot { position: relative; z-index: 1; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-strong); align-self: center; }
.cd-line li.is-done .cd-knot { background: var(--reef); border-color: var(--reef); }
.cd-line li.is-failed .cd-knot { background: var(--coral); border-color: var(--coral); }
.cd-line li:last-child.is-done .cd-knot { background: var(--kelp); border-color: var(--kelp); }
.cd-step { font-weight: 500; }
.cd-step small { display: block; font-weight: 400; color: var(--coral); }
.cd-line time { font-family: var(--font-readout); color: var(--ink-soft); font-size: .9rem; white-space: nowrap; }
.cd-line li.is-pending .cd-step, .cd-line li.is-pending time { color: var(--muted); }
.cd-team { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.cd-team h3 { font-size: .95rem; margin: 0 0 6px; }
.cd-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cd-people li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.cd-face { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  background: color-mix(in srgb, var(--reef) 14%, transparent); color: var(--reef); }
.cd-people time { font-family: var(--font-readout); color: var(--ink-soft); font-size: .9rem; }
.cd-answered { margin: 10px 0 0; color: var(--kelp); font-size: .92rem; }
.cd-waiting { margin: 8px 0 0; color: var(--buoy); font-size: .92rem; }

/* ---------- the gear room (views/inventory/index.erb) ---------- */
.iv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin: 10px 0 16px; }
.iv-head h1 { margin: 0 0 4px; }
.iv-lede { margin: 0; color: var(--ink-soft); }
.iv-lede a { margin-left: 6px; }
.iv-actions { display: flex; gap: 8px; flex-wrap: wrap; }
/* a shelf per category: name, how many free, a bar of free / out / maintenance / retired */
.iv-shelves { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 0 0 18px; }
.iv-shelf { display: grid; gap: 6px; padding: 12px 14px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; }
.iv-shelf:hover { border-color: var(--reef); }
.iv-shelf:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.iv-shelf.is-active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.iv-shelf-name { font-weight: 600; }
.iv-shelf-free { color: var(--ink-soft); font-size: .88rem; }
.iv-shelf-free b { font-family: var(--font-readout); font-size: 1.35rem; color: var(--kelp); margin-right: 2px; }
.iv-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--water); }
.iv-bar i { display: block; min-width: 4px; }
.iv-bar .is-available { background: var(--kelp); }
.iv-bar .is-assigned { background: var(--reef); }
.iv-bar .is-maintenance { background: var(--buoy); }
.iv-bar .is-retired { background: var(--line-strong); }

.iv-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; margin: 0 0 20px; }
.iv-search { position: relative; margin: 0; }
.iv-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.iv-search input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.iv-search input:focus { outline: 2px solid var(--reef); outline-offset: 1px; }
.iv-status { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-status a { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: .92rem; }
.iv-status a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.iv-more { grid-column: 1 / -1; }
.iv-more summary { cursor: pointer; color: var(--reef); font-weight: 500; width: max-content; }
.iv-more-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; margin-top: 10px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.iv-more-grid label { display: grid; gap: 4px; font-size: .88rem; color: var(--ink-soft); margin: 0; }
.iv-more-actions { display: flex; align-items: end; gap: 6px; }

.iv-empty, .iv-none { padding: 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--ink-soft); }
.iv-empty p { margin: 0 0 4px; color: var(--ink); font-weight: 500; }
.iv-group { margin: 0 0 22px; }
.iv-group h2 { display: flex; align-items: baseline; gap: 8px; font-size: 1.1rem; margin: 0 0 8px; }
.iv-group h2 span { font-family: var(--font-readout); font-weight: 600; font-size: .9rem; color: var(--muted); }
.iv-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.iv-list li { display: grid; grid-template-columns: 96px minmax(0, 1.6fr) 56px minmax(0, 1.4fr) 108px; gap: 4px 14px; align-items: center; padding: 10px 14px; }
.iv-list li + li { border-top: 1px solid var(--line); }
.iv-asset { font-family: var(--font-readout); font-weight: 600; color: var(--ink-soft); font-size: .95rem; }
.iv-name { display: flex; flex-direction: column; min-width: 0; color: var(--ink); text-decoration: none; }
.iv-name:hover strong { text-decoration: underline; }
.iv-name small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.iv-size { font-family: var(--font-readout); font-weight: 600; text-align: center; }
.iv-where { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .92rem; color: var(--ink-soft); min-width: 0; }
.iv-where a { color: inherit; }
.iv-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); flex: none; }
.iv-list li.is-available .iv-dot { background: var(--kelp); }
.iv-list li.is-available .iv-where > span:not(.iv-cond) { color: var(--kelp); font-weight: 600; }
.iv-list li.is-assigned .iv-dot { background: var(--reef); }
.iv-list li.is-maintenance .iv-dot { background: var(--buoy); }
.iv-list li.is-overdue .iv-dot { background: var(--coral); }
.iv-list li.is-overdue .iv-where > span:not(.iv-cond) { color: var(--coral); font-weight: 500; }
.iv-list li.is-retired { opacity: .6; }
.iv-cond { padding: 0 8px; border-radius: 999px; font-size: .78rem; border: 1px solid currentColor; color: var(--buoy); }
.iv-cond.is-damaged, .iv-cond.is-repair_needed { color: var(--coral); }
.iv-row-actions { display: flex; gap: 4px; justify-content: flex-end; }
@media (max-width: 767px) {
  .iv-filter { grid-template-columns: 1fr; }
  .iv-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .iv-asset { grid-column: 1 / -1; font-size: .85rem; }
  .iv-name { grid-column: 1; }
  .iv-size { grid-column: 2; grid-row: 2; }
  .iv-where { grid-column: 1 / -1; }
  .iv-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* WhatsApp picture in the avatar circle; the contact card */
.cc-avatar { overflow: visible; }
.cc-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.cc-avatar-btn { border: 0; padding: 0; cursor: pointer; position: relative; }
.cc-avatar-btn:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.cc-avatar-btn:hover { box-shadow: 0 0 0 3px color-mix(in srgb, var(--kelp) 25%, transparent); }
.ck { width: min(380px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 14px; padding: 28px 22px 16px; text-align: center; color: var(--ink); position: relative; }
.ck::backdrop { background: rgba(18, 48, 63, .35); }
.ck-close { position: absolute; top: 10px; right: 10px; }
.ck-pic { width: 112px; height: 112px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: color-mix(in srgb, var(--kelp) 14%, transparent); color: var(--kelp); font-size: 2.2rem; font-weight: 700;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--line); }
.ck-pic.is-online { box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--kelp); } /* online: a green ring, as in a chat app */
.ck-pic img { width: 100%; height: 100%; object-fit: cover; }
.ck h2 { font-size: 1.35rem; margin: 0; }
.ck-also, .ck-phone { margin: 2px 0 0; color: var(--ink-soft); font-size: .92rem; }
.ck-phone { font-family: var(--font-readout); font-size: 1rem; }
.ck-tags { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; min-height: 4px; }
.ck-business { display: inline-flex; gap: 6px; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600;
  color: var(--reef); background: color-mix(in srgb, var(--reef) 12%, transparent); }
.ck-presence { padding: 2px 10px; border-radius: 999px; font-size: .82rem; color: var(--ink-soft); background: var(--water); }
.ck-presence.is-on { color: var(--kelp); background: color-mix(in srgb, var(--kelp) 12%, transparent); font-weight: 600; }
.ck-status { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--water); font-style: italic; text-align: left; overflow-wrap: anywhere; }
.ck-status small { display: block; font-style: normal; color: var(--muted); margin-top: 4px; }
.ck-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 12px; text-align: left; margin: 14px 0 0; font-size: .92rem; }
.ck-facts dt { color: var(--muted); font-weight: 500; }
.ck-facts dd { margin: 0; overflow-wrap: anywhere; }
.ck-customer { display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; font-weight: 500; }
.ck-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line);
  text-align: left; font-size: .8rem; color: var(--muted); }

/* WhatsApp formatting (public/js/wa-format.js): in the bubbles, the toolbar, the preview */
.cc-body strong, .sn-bubble strong { font-weight: 700; }
.cc-body code, .sn-bubble code { font-family: var(--font-readout); font-size: .92em; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, var(--ink) 7%, transparent); color: inherit; }
.cc-body code.wa-pre, .sn-bubble code.wa-pre { display: block; white-space: pre-wrap; padding: 6px 8px; margin: 2px 0; }
.wa-list { margin: 2px 0; padding-left: 1.3em; }
.wa-list li { margin: 0; }
.wa-list li::marker { color: var(--kelp); }
.wa-quote { margin: 2px 0; padding: 2px 0 2px 10px; border-left: 3px solid var(--kelp); color: var(--ink-soft); }
.cc-compose.has-format { grid-template-columns: auto auto auto 1fr auto; }
.cc-fmt-btn span { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 1rem; letter-spacing: -.02em; }
.cc-fmt-btn.is-on { color: #fff; background: var(--kelp); border-color: var(--kelp); }
.cc-fmt { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; }
.wa-bar { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.wa-tool { width: 34px; height: 30px; border: 0; border-radius: 7px; background: transparent; color: var(--ink-soft); display: grid; place-items: center; }
.wa-tool:hover { background: var(--water); color: var(--ink); }
.wa-tool:focus-visible { outline: 2px solid var(--reef); outline-offset: 1px; }
.wa-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.cc-fmt-preview { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-fmt-preview > span { font-size: .75rem; color: var(--muted); }
.cc-fmt-preview .cc-body { max-height: 140px; overflow: auto; padding: 6px 10px; border-radius: 8px 8px 8px 2px;
  background: color-mix(in srgb, var(--kelp) 10%, var(--surface)); font-size: .92rem; overflow-wrap: anywhere; }
.cc-compose.is-recording .cc-fmt { display: none; }
@media (max-width: 575px) { .wa-tool { width: 32px; } }
.sn-format { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 8px; }
.sn-format small { color: var(--muted); }
.ss-journal { margin: 4px 0 12px; }
.ss-journal summary { cursor: pointer; font-weight: 500; }
.ss-journal ol { list-style: none; padding: 0; margin: 6px 0 0; font-size: .86rem; }
.ss-journal li { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.ss-journal time { color: var(--muted); }
.ss-journal small { flex-basis: 100%; color: var(--muted); font-family: var(--font-readout); overflow-wrap: anywhere; }
.ss-journal .is-ok { color: var(--kelp); }
.ss-journal .is-warn { color: var(--buoy); }

/* Edited and deleted messages (services/comm_changes.rb) */
.cc-edited { font-style: italic; color: var(--muted); }
.cc-deleted { margin: 0 0 2px; font-style: italic; color: var(--muted); font-size: .9rem; }
.cc-deleted i { margin-right: 4px; }
.cc-msg.is-deleted { border-style: dashed; }
.cc-msg.is-deleted .cc-body { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 70%, transparent); color: var(--ink-soft); }
.cc-msg.is-deleted .cc-files { opacity: .55; }
.cd-history { margin-top: 14px; }
.cd-history h3, .cd-actions h3 { font-size: .95rem; margin: 0 0 6px; }
.cd-history ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.cd-history li { position: relative; padding: 0 0 12px 10px; }
.cd-history li::before { content: ''; position: absolute; left: -21px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--reef); }
.cd-history li.is-deleted::before { border-color: var(--coral, #c8372d); }
.cd-hist-head { margin: 0; font-size: .88rem; font-weight: 500; }
.cd-hist-head i { color: var(--muted); margin-right: 4px; }
.cd-hist-head time { color: var(--muted); font-weight: 400; margin-left: 4px; }
.cd-hist-label { margin: 4px 0 2px; font-size: .75rem; color: var(--muted); }
.cd-hist-text { padding: 6px 10px; border-radius: 8px; background: var(--water); font-size: .9rem; overflow-wrap: anywhere; }
.cd-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cd-actions .cd-note, .cd-actions .cd-error, .cd-actions label, .cd-actions textarea, .cd-actions .wa-bar { flex-basis: 100%; }
.cd-actions .wa-bar { flex-basis: auto; }
.cd-error { color: var(--coral, #c8372d); font-size: .88rem; margin: 0; }
.cd-edit-buttons { display: flex; gap: 6px; }
.cc-deleted button, button.cc-edited { border: 0; padding: 0; background: none; font: inherit; font-style: italic; color: var(--muted); cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 2px; }
.cc-deleted button:hover, button.cc-edited:hover { color: var(--ink); }
.cc-deleted button:focus-visible, button.cc-edited:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; border-radius: 3px; }

/* Reactions (services/comm_reactions.rb): chips hanging at the bubble's lower edge */
.cc-msg { position: relative; }
.cc-msg.has-reactions { margin-bottom: 18px; }
.cc-reactions { position: absolute; bottom: -14px; display: flex; gap: 4px; }
.cc-msg.is-in .cc-reactions { left: 10px; }
.cc-msg.is-out .cc-reactions { right: 10px; }
.cc-reaction { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px 1px 5px; border-radius: 999px; font-size: .95rem; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(18, 48, 63, .12); }
.cc-reaction small { font-size: .68rem; color: var(--muted); }
.cc-react { border: 0; background: none; padding: 0 2px; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .12s; }
.cc-msg:hover .cc-react, .cc-react:focus-visible { opacity: 1; }
@media (hover: none) { .cc-react { opacity: 1; } }
.cc-react-bar { position: absolute; top: -40px; z-index: 3; display: flex; align-items: center; gap: 2px; padding: 4px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(18, 48, 63, .18); }
.cc-msg.is-in .cc-react-bar { left: 0; }
.cc-msg.is-out .cc-react-bar { right: 0; }
.cc-react-bar button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; font-size: 1.3rem; line-height: 1; cursor: pointer; transition: transform .1s; }
.cc-react-bar button:hover { transform: scale(1.18); background: var(--water); }
.cc-react-bar button.is-mine { background: color-mix(in srgb, var(--kelp) 18%, transparent); }
.cc-react-bar button:focus-visible { outline: 2px solid var(--reef); }
.cc-react-error { font-size: .78rem; color: var(--coral, #c8372d); padding: 0 6px; }
@media (prefers-reduced-motion: reduce) { .cc-react-bar button, .cc-react { transition: none; } }

/* Sprache und Anrede (services/language.rb): Sie/du switches with a live sample */
.lg-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--water); border: 1px solid var(--line); }
.lg-switch label { margin: 0; cursor: pointer; }
.lg-switch input { position: absolute; opacity: 0; pointer-events: none; }
.lg-switch span { display: block; min-width: 64px; padding: 5px 16px; border-radius: 999px; text-align: center; font-weight: 600; color: var(--ink-soft); }
.lg-switch input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(18, 48, 63, .18); }
.lg-switch input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 2px; }
fieldset.ss-row { border: 0; margin: 0; min-width: 0; }
fieldset.ss-row > legend { float: none; width: auto; padding: 0; margin: 0; font-size: inherit; font-weight: 500; }
fieldset.ss-row > legend small { display: block; color: var(--muted); font-weight: 400; font-size: .84rem; line-height: 1.35; margin-top: 2px; }
.lg-switch { justify-self: start; align-self: center; }
.lg-sample { margin: 18px 0 6px; padding: 16px; border-radius: 12px; background: var(--water); display: grid; gap: 12px; }
.lg-sample figcaption { font-size: .82rem; color: var(--muted); }
.lg-bubble { max-width: 520px; padding: 10px 14px 12px; border-radius: 14px 14px 14px 4px; background: var(--surface); border: 1px solid var(--line); }
.lg-bubble.is-team { justify-self: end; border-radius: 14px 14px 4px 14px; background: color-mix(in srgb, var(--kelp) 10%, var(--surface)); }
.lg-who { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 2px; }
.lg-bubble p { margin: 0; line-height: 1.45; }
/* the sentence that just changed: a short flash of the words, nothing more */
.lg-bubble.is-changed p { animation: lg-flash .5s ease-out; }
@keyframes lg-flash { from { color: var(--kelp); } to { color: inherit; } }
@media (prefers-reduced-motion: reduce) { .lg-bubble.is-changed p { animation: none; } }

/* profile: one's own form of address */
.pa-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pa-choice { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.pa-choice input { position: absolute; opacity: 0; }
.pa-choice-label { font-weight: 600; }
.pa-choice-sample { color: var(--ink-soft); font-size: .9rem; }
.pa-choice:has(input:checked) { border-color: var(--kelp); box-shadow: 0 0 0 1px var(--kelp); background: color-mix(in srgb, var(--kelp) 6%, transparent); }
.pa-choice:has(input:focus-visible) { outline: 2px solid var(--reef); outline-offset: 2px; }
.et-variants { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; margin: 0 0 16px; }
.et-variants a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.et-variants a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.et-variants a:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.et-variant-mark { font-size: .7rem; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--kelp) 18%, transparent); color: var(--kelp); }
.et-variants a.is-active .et-variant-mark { background: rgba(255, 255, 255, .2); color: #fff; }
.et-variants-note { margin-left: 8px; font-size: .85rem; color: var(--muted); }

/* Text snippets in several wordings (Sie / du, later languages) */
.sn-variants { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.sn-variant { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-weight: 600; }
.sn-variant small { font-weight: 400; font-size: .75rem; color: var(--muted); }
.sn-variant.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.sn-variant.is-active small { color: rgba(255, 255, 255, .75); }
.sn-variant:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
/* Anrede und Sprache on the person page and in the chat */
.ud-speech-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; }
.ud-speech-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ud-speech-form legend { font-size: .85rem; color: var(--muted); margin-bottom: 4px; float: none; width: auto; padding: 0; }
.ud-speech-lang { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.lg-switch-3 span { min-width: 0; padding: 5px 14px; }
.ud-card-hint { margin: -4px 0 10px; color: var(--ink-soft); font-size: .9rem; }
.cc-speech { position: relative; display: inline-block; margin-left: 8px; font-size: .82rem; }
.cc-speech summary { list-style: none; cursor: pointer; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); }
.cc-speech summary::-webkit-details-marker { display: none; }
.cc-speech summary b { color: var(--ink); }
.cc-speech summary:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.cc-speech-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(340px, 80vw); padding: 12px; display: grid; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(18, 48, 63, .18); }
.cc-speech-pop p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.4; }
.cc-speech-pop .lg-switch { justify-self: start; }
/* waits for an answer / no answer needed, above the composer */
.cc-reply { display: flex; align-items: center; gap: 6px; padding: 4px 14px; font-size: .85rem; color: var(--buoy); background: color-mix(in srgb, var(--buoy) 8%, transparent); border-top: 1px solid var(--line); }
.cc-reply.is-waived { color: var(--muted); background: none; }
.cc-reply .btn-link { padding: 0 4px; font-size: .85rem; }

/* Filling station and checks (views/fills, views/inventory/_checks.erb)
   The station is used standing at the compressor: big targets, numbers as readouts,
   gases in the colours their cylinders carry. */
.fs-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; margin: 10px 0 18px; }
.fs-head h1 { margin: 0; }
.fs-lede { margin: 2px 0 0; color: var(--ink-soft); max-width: 62ch; }
.fs-kpis { display: flex; gap: 10px; }
.fs-kpi { display: grid; grid-template-columns: auto; padding: 8px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; min-width: 96px; }
.fs-kpi span { color: var(--muted); font-size: .8rem; }
.fs-kpi strong { font-family: var(--font-readout); font-size: 1.6rem; line-height: 1.1; }
.fs-kpi small { font-size: .78rem; color: var(--reef); }
.fs-kpi.is-money strong { color: var(--buoy); }
.fs-kpi.is-money:hover, .fs-kpi.is-active { border-color: var(--buoy); }
.fs-kpi:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }

/* the form: three steps side by side on wide screens, stacked on phones */
.fs-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
.fs-form.is-editing { border-color: var(--reef); box-shadow: 0 0 0 3px color-mix(in srgb, var(--reef) 18%, transparent); }
.fs-editbar { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 12px; padding: 8px 18px; background: color-mix(in srgb, var(--reef) 10%, var(--surface)); color: var(--ink); font-weight: 600; font-size: .9rem; }
.fs-step { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fs-step + .fs-step { border-left: 1px solid var(--water); }
.fs-step h2 { font-size: 1rem; margin: 0; color: var(--ink); }
.fs-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--water); background: color-mix(in srgb, var(--water) 45%, var(--surface)); }
@media (max-width: 1100px) {
  .fs-form { grid-template-columns: 1fr 1fr; }
  .fs-step:nth-of-type(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--water); }
}
@media (max-width: 720px) {
  .fs-form { grid-template-columns: 1fr; }
  .fs-step + .fs-step { border-left: 0; border-top: 1px solid var(--water); }
  .fs-actions { position: sticky; bottom: 0; z-index: 5; }
  .fs-actions .btn-lg { flex: 1; }
}
.fs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.fs-mixes:not(:has(label:not([hidden]))) { display: none; }
.fs-field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin: 0; }
.fs-field small, .fs-gauge label small { color: var(--muted); font-weight: 400; }
.fs-who { gap: 6px; }
.fs-billing { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (min-width: 721px) and (max-width: 1100px) { .fs-billing { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }

/* own cylinder / a customer's: a segmented switch */
.fs-switch { display: inline-grid; grid-auto-flow: column; padding: 3px; border-radius: 999px; background: var(--water); justify-self: start; align-self: flex-start; }
.fs-switch label { margin: 0; cursor: pointer; }
.fs-switch input, .fs-gases input { position: absolute; opacity: 0; pointer-events: none; }
.fs-switch span { display: block; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--ink-soft); }
.fs-switch input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(18, 48, 63, .18); }
.fs-switch input:focus-visible + span, .fs-gases input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 2px; }

/* the cylinder search and the picked cylinder */
.fs-search { position: relative; }
.fs-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.fs-search .form-control { padding-left: 36px; min-height: 44px; }
.fs-results { display: grid; gap: 2px; margin-top: 6px; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 4px; background: var(--surface); }
.fs-result { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); }
.fs-result:hover, .fs-result:focus-visible { background: var(--water); outline: none; }
.fs-result strong, .fs-picked strong { display: block; font-weight: 600; }
.fs-result small, .fs-picked small { display: block; color: var(--muted); font-size: .82rem; }
.fs-none { margin: 0; padding: 8px 10px; color: var(--muted); }
.fs-picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: color-mix(in srgb, var(--water) 50%, var(--surface)); }
.fs-picked > div { flex: 1; min-width: 0; }
.fs-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
[data-state=ok] .fs-dot { background: var(--kelp); }
[data-state=soon] .fs-dot { background: #f2c230; }
[data-state=never] .fs-dot { background: var(--buoy); }
[data-state=overdue] .fs-dot { background: var(--coral); }
.fs-picked[data-state=overdue] { border-color: var(--coral); background: color-mix(in srgb, var(--coral) 7%, var(--surface)); }
.fs-picked[data-state=overdue] small, .fs-result[data-state=overdue] small { color: var(--coral); }

/* gases in the colours cylinders carry: air plain, nitrox green and yellow, oxygen white with blue, trimix brown */
.fs-gases { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.fs-gases label { margin: 0; cursor: pointer; }
.fs-gases span { display: block; text-align: center; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-soft); font-weight: 600; font-size: .9rem; background: var(--surface); }
.fs-gases input:checked + span { color: #fff; border-color: transparent; }

/* numbers as readouts, with quick values */
.fs-gauge { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fs-gauge > label { font-size: .85rem; color: var(--muted); margin: 0; }
.fs-readout { display: flex; align-items: baseline; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.fs-readout:focus-within { border-color: var(--reef); box-shadow: 0 0 0 3px color-mix(in srgb, var(--reef) 18%, transparent); }
.fs-readout input { flex: 1; min-width: 0; width: 100%; border: 0; outline: none; background: none; font-family: var(--font-readout); font-size: 1.9rem; font-weight: 600; color: var(--ink); padding: 0; }
.fs-readout input::placeholder { color: var(--line); }
.fs-readout span { font-family: var(--font-readout); color: var(--muted); font-size: 1.05rem; }
.fs-price .fs-readout input { color: var(--buoy); }
.fs-help { color: var(--muted); font-size: .78rem; }
.fs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-chips button { padding: 5px 11px; min-height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font-family: var(--font-readout); font-size: .95rem; }
.fs-chips button:hover { border-color: var(--reef); }
.fs-chips button.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* the log */
.fs-logbox { margin-bottom: 30px; }
.fs-logbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 16px; margin-bottom: 10px; }
.fs-logbar h2 { font-size: 1.15rem; margin: 0; }
.fs-logbar h2 small { font-family: var(--font-readout); color: var(--muted); font-weight: 500; margin-left: 4px; }
.fs-filter { display: flex; gap: 6px; flex: 1 1 260px; max-width: 440px; }
.fs-empty { color: var(--ink-soft); padding: 18px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }
.fs-log { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.fs-log li { display: grid; grid-template-columns: 28px 110px minmax(0, 2fr) minmax(0, 1fr) 110px 28px; gap: 6px 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--water); }
.fs-log li:first-child { border-top: 0; }
.fs-log li.is-open { box-shadow: inset 3px 0 0 var(--buoy); }
.fs-log li.is-current { background: color-mix(in srgb, var(--reef) 8%, var(--surface)); }
.fs-log small { display: block; color: var(--muted); font-size: .8rem; }
.fs-when { font-family: var(--font-readout); font-size: 1rem; }
.fs-what small { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-num { text-align: right; white-space: nowrap; font-family: var(--font-readout); font-size: 1.05rem; }
.fs-row-actions a { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.fs-row-actions a:hover { background: var(--water); color: var(--ink); }
small.is-due { color: var(--buoy); font-weight: 600; }
small.is-paid { color: var(--kelp); }
.fs-log:not(:has(.fs-pick)) li { grid-template-columns: 110px minmax(0, 2fr) minmax(0, 1fr) 110px 28px; }
@media (max-width: 760px) {
  .fs-log li, .fs-log:not(:has(.fs-pick)) li { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "pick what num" "pick when num" "pick for act"; row-gap: 2px; }
  .fs-pick { grid-area: pick; align-self: start; padding-top: 2px; }
  .fs-what { grid-area: what; } .fs-when { grid-area: when; font-size: .85rem; color: var(--muted); }
  .fs-when small { display: inline; margin-left: 6px; }
  .fs-for { grid-area: for; font-size: .9rem; } .fs-num { grid-area: num; align-self: start; } .fs-row-actions { grid-area: act; justify-self: end; }
}
.fs-bulk { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 14px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 6px 20px rgba(18, 48, 63, .25); }
.fs-bulk span { margin-right: auto; font-weight: 600; }
.fs-pages { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.fs-pages a { min-width: 34px; text-align: center; padding: 4px 9px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; }
.fs-pages a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.fs-gas-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .84rem; border: 1px solid var(--line); background: var(--water); white-space: nowrap; color: var(--ink); }
.fs-gas-tag.is-any { background: var(--surface); }

/* own fills (profile) and a person's fills (Personenseite) */
.fs-mine { list-style: none; margin: 0 0 10px; padding: 0; }
.fs-mine li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--water); }
.fs-mine li > span:first-of-type { font-family: var(--font-readout); color: var(--muted); min-width: 84px; }
.fs-mine li .fs-num { margin-left: auto; }
.fs-mine small { display: block; text-align: right; }

/* empty states */
.fs-blank { display: grid; justify-items: center; gap: 10px; padding: 40px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 16px; color: var(--ink-soft); }
.fs-blank i { font-size: 2rem; color: var(--muted); }
.fs-blank.is-fine i { color: var(--kelp); }
.fs-blank p { margin: 0; max-width: 48ch; }

/* checks: grouped by how urgent */
.insp-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.insp-summary a { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.insp-summary strong { font-family: var(--font-readout); font-size: 1.2rem; }
.insp-summary .is-overdue strong { color: var(--coral); }
.insp-summary .is-never strong { color: var(--buoy); }
.insp-summary .is-soon strong { color: #8a6a00; }
.insp-group { margin-bottom: 22px; scroll-margin-top: 80px; }
.insp-group h2 { font-size: 1.05rem; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.insp-group h2 small { font-family: var(--font-readout); color: var(--muted); }
.insp-group.is-overdue h2 { color: var(--coral); }
.insp-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.insp-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 6px 16px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--water); }
.insp-list li:first-child { border-top: 0; }
.insp-group.is-overdue .insp-list li { box-shadow: inset 3px 0 0 var(--coral); }
.insp-group.is-never .insp-list li { box-shadow: inset 3px 0 0 var(--buoy); }
.insp-group.is-soon .insp-list li { box-shadow: inset 3px 0 0 #f2c230; }
.insp-item { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); min-width: 0; }
.insp-item strong { font-weight: 600; }
.insp-item small, .insp-due { color: var(--muted); font-size: .86rem; }
.insp-due em { display: block; color: var(--coral); font-style: normal; font-weight: 600; }
@media (max-width: 760px) {
  .insp-list li { grid-template-columns: minmax(0, 1fr) auto; }
  .insp-type, .insp-due { grid-column: 1; }
  .insp-list li > .btn { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

/* checks on an item's page */
.insp-item-box { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); scroll-margin-top: 80px; }
.insp-item-box header { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 12px; }
.insp-item-box h2 { font-size: 1.05rem; margin: 0; margin-right: auto; }
.insp-item-box header a { font-size: .9rem; }
.insp-pill { padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--water); color: var(--ink-soft); font-family: var(--font-readout); }
.insp-status { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.insp-status li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; background: var(--surface); }
.insp-status li.is-ok { border-left-color: var(--kelp); }
.insp-status li.is-soon { border-left-color: #f2c230; }
.insp-status li.is-never { border-left-color: var(--buoy); }
.insp-status li.is-overdue { border-left-color: var(--coral); background: color-mix(in srgb, var(--coral) 5%, var(--surface)); }
.insp-status small { color: var(--muted); }
.insp-state { font-size: .8rem; font-weight: 600; }
.is-overdue .insp-state { color: var(--coral); }
.is-never .insp-state { color: var(--buoy); }
.is-soon .insp-state { color: #8a6a00; }
.is-ok .insp-state { color: var(--kelp); }
.insp-history { width: 100%; font-size: .9rem; margin-bottom: 12px; }
.insp-history th { font-size: .78rem; font-weight: 500; color: var(--muted); padding: 4px 6px; }
.insp-history td { padding: 6px; border-top: 1px solid var(--water); vertical-align: top; }
.insp-history td small { display: block; color: var(--muted); }
.insp-history .is-failed { color: var(--coral); font-weight: 600; }
@media (max-width: 640px) {
  .insp-history thead { display: none; }
  .insp-history, .insp-history tbody, .insp-history tr, .insp-history td { display: block; }
  .insp-history tr { padding: 8px 0; border-top: 1px solid var(--water); }
  .insp-history td { border: 0; padding: 1px 0; }
}
.insp-new { border-top: 1px solid var(--water); padding-top: 10px; scroll-margin-top: 80px; }
.insp-new summary { cursor: pointer; font-weight: 600; color: var(--reef); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.insp-new summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--reef); color: #fff; font-weight: 700; }
.insp-new[open] summary::before { content: "–"; }
.insp-new summary::-webkit-details-marker { display: none; }
.insp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 14px; margin-top: 12px; }
.insp-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.insp-wide { grid-column: 1 / -1; }
.insp-fills { list-style: none; padding: 0; margin: 0; }
.insp-fills li { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 6px 0; border-top: 1px solid var(--water); font-size: .9rem; }
.insp-when { font-family: var(--font-readout); color: var(--muted); }
.iv-readout { font-family: var(--font-readout); font-size: 1.05rem; }

/* settings: one line per entry, opened to change it */
.st-list { list-style: none; margin: 0; padding: 0; }
.st-list li { border-top: 1px solid var(--water); }
.st-list li.is-off summary { opacity: .55; }
.st-list summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 4px; cursor: pointer; list-style: none; align-items: center; }
.st-list summary::-webkit-details-marker { display: none; }
.st-list summary:hover { background: color-mix(in srgb, var(--water) 50%, transparent); }
.st-list summary strong { grid-column: 1; }
.st-list summary > span:not(.st-add) { grid-column: 1; color: var(--ink-soft); font-size: .9rem; }
.st-list summary small { grid-column: 1; color: var(--muted); }
.st-price { grid-column: 2; grid-row: 1 / span 2; font-family: var(--font-readout); font-size: 1.25rem; color: var(--ink); }
.st-add { color: var(--reef); font-weight: 600; }
.st-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 4px 4px 14px; }
.st-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); margin: 0; }
.st-form label small { font-weight: 400; }
.st-wide { grid-column: 1 / -1; }
.st-cats { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.st-cats legend { font-size: .82rem; color: var(--muted); float: none; width: 100%; padding: 0; margin: 0 0 2px; }
.st-chip { flex-direction: row !important; margin: 0; cursor: pointer; }
.st-chip input { position: absolute; opacity: 0; pointer-events: none; }
.st-chip span { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft); font-size: .88rem; }
.st-chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.st-chip input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 2px; }
.st-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.st-actions .form-switch { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-size: .9rem; margin: 0 8px 0 0; }
.st-form label > small { font-size: .78rem; }
.st-switch { display: flex; flex-direction: row !important; align-items: flex-start; gap: 10px; padding-left: 2.6em; }
.st-switch span { display: flex; flex-direction: column; color: var(--ink); }
.st-switch small { color: var(--muted); }
.st-note { display: flex; gap: 8px; font-size: .85rem; color: var(--ink-soft); padding: 8px 10px; border-radius: 10px; background: var(--water); margin: 0 0 10px; }
.st-note i { margin-top: 3px; color: var(--muted); }
.fs-readout.is-fixed { background: var(--water); border-style: dashed; }
.fs-readout.is-fixed input { cursor: default; }


/* Briefings (views/instructions): a matrix of people and kinds of briefing */
.insp-summary a.is-on { border-color: var(--ink); }
.insp-summary .is-expired strong, .insp-summary .is-missing strong { color: var(--coral); }
.insp-summary .is-unconfirmed strong { color: var(--buoy); }
.in-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.in-matrix { width: 100%; border-collapse: collapse; min-width: 520px; }
.in-matrix th, .in-matrix td { padding: 9px 12px; border-top: 1px solid var(--water); text-align: left; vertical-align: middle; }
.in-matrix thead th { border-top: 0; font-weight: 600; font-size: .92rem; vertical-align: bottom; }
.in-matrix thead th small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.in-matrix .in-person { position: sticky; left: 0; background: var(--surface); font-weight: 600; white-space: nowrap; }
.in-matrix .in-person a { color: var(--ink); text-decoration: none; }
.in-matrix .in-pick { width: 36px; }
.in-cell { display: inline-flex; flex-direction: column; padding: 3px 10px; border-radius: 8px; border: 1px solid transparent; line-height: 1.25; min-width: 92px; }
.in-cell strong { font-size: .84rem; }
.in-cell small { font-family: var(--font-readout); font-size: .8rem; color: inherit; opacity: .85; }
.in-cell.is-valid { background: color-mix(in srgb, var(--kelp) 12%, var(--surface)); color: var(--kelp); }
.in-cell.is-soon { background: color-mix(in srgb, #f2c230 22%, var(--surface)); color: #7a5c00; }
.in-cell.is-unconfirmed { background: color-mix(in srgb, var(--buoy) 12%, var(--surface)); color: #9a3d0b; }
.in-cell.is-expired { background: color-mix(in srgb, var(--coral) 12%, var(--surface)); color: var(--coral); }
.in-cell.is-missing { border: 1px dashed var(--line); color: var(--muted); }
.in-more { margin: 8px 2px 0; font-size: .88rem; }
.in-brief { position: sticky; bottom: 12px; z-index: 6; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 6px 20px rgba(18, 48, 63, .25); }
.in-brief > strong { align-self: center; margin-right: auto; }
.in-brief label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: rgba(255, 255, 255, .75); margin: 0; }
.in-brief .form-select, .in-brief .form-control { min-width: 160px; }
.in-mine { list-style: none; padding: 0; margin: 0; }
.in-mine li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--water); }
.in-mine li:first-child { border-top: 0; }
.in-mine li > div { flex: 1; min-width: 0; }
.in-mine li small { display: block; color: var(--muted); }
.in-mine li p { margin: 4px 0 0; font-size: .88rem; color: var(--ink-soft); }
.in-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.in-quick .form-select { flex: 1 1 180px; }
.in-quick .form-control { flex: 0 1 150px; }

/* the station locked: a briefing is missing */
.fs-locked { display: flex; gap: 14px; padding: 16px 18px; margin-bottom: 22px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--coral) 40%, var(--line));
  background: color-mix(in srgb, var(--coral) 6%, var(--surface)); }
.fs-locked > i { font-size: 1.6rem; color: var(--coral); margin-top: 2px; }
.fs-locked strong { display: block; font-size: 1.05rem; }
.fs-locked ul { margin: 6px 0; padding-left: 18px; }
.fs-locked p { margin: 0 0 8px; color: var(--ink-soft); }

/* the fill book: a dense table that prints */
.bk-actions { display: flex; gap: 8px; }
.bk-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-bottom: 14px; }
.bk-filter label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--muted); margin: 0; }
.bk-filter .bk-q { flex: 1 1 220px; max-width: 360px; }
.bk-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.bk-table { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 760px; }
.bk-table th, .bk-table td { padding: 7px 10px; text-align: left; vertical-align: top; border-top: 1px solid var(--water); }
.bk-table thead th { border-top: 0; font-size: .78rem; font-weight: 500; color: var(--muted); }
.bk-table td small { display: block; color: var(--muted); font-size: .78rem; }
.bk-day th { background: color-mix(in srgb, var(--water) 60%, var(--surface)); font-size: .88rem; }
.bk-day small { font-family: var(--font-readout); color: var(--muted); margin-left: 6px; }
.bk-time { font-family: var(--font-readout); white-space: nowrap; }
.bk-foot { margin: 10px 2px; color: var(--muted); font-size: .8rem; }
@media print {
  .no-print, nav.navbar, header.navbar, footer, .fs-logbar .btn { display: none !important; }
  body { background: #fff !important; }
  .bk-wrap { border: 0; overflow: visible; }
  .bk-table { min-width: 0; font-size: 9pt; }
  .bk-day { break-after: avoid; }
  .bk-table tr { break-inside: avoid; }
  .fs-gas-tag { border: 0; background: none; padding: 0; }
}

.in-search { margin-bottom: 12px; }
.fs-logbar > .btn-link { margin-right: auto; padding-left: 0; }
/* Füllstation einrichten: parts like the system settings (.ss-*) */
.ss-pane .st-list { margin-top: 4px; }
.ss-sub.st-first { margin-top: 4px; padding-top: 0; border-top: 0; }
.ss-pane .ss-sub + .ss-note, .ss-pane .st-tools + .ss-sub { margin-top: 18px; }
.st-rail-links { display: grid; gap: 6px; margin: 18px 0 0; padding: 12px 0 0 12px; border-top: 1px solid var(--line); font-size: .9rem; }
.st-rail-links a { color: var(--ink-soft); text-decoration: none; }
.st-rail-links a:hover { color: var(--ink); }
.st-equipment li a { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--ink); text-decoration: none; }
.st-equipment li a:hover { background: color-mix(in srgb, var(--water) 50%, transparent); }
.st-equipment li a > i { width: 18px; text-align: center; color: var(--muted); }
.st-equipment li a > span:not(.in-cell) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-equipment small { color: var(--muted); }
.st-empty { padding: 10px 4px; color: var(--muted); }
.st-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.st-rights-wrap { overflow-x: auto; }
.st-rights { width: 100%; border-collapse: collapse; font-size: .92rem; }
.st-rights th, .st-rights td { padding: 8px 10px; border-top: 1px solid var(--water); text-align: center; }
.st-rights thead th { border-top: 0; font-size: .82rem; color: var(--muted); font-weight: 600; }
.st-rights tbody th, .st-rights thead th:first-child { text-align: left; font-weight: 500; }
.st-rights .fa-check { color: var(--kelp); }
.st-no { color: var(--line-strong, var(--muted)); }

.insp-new.is-editing { border-top-color: var(--reef); }
.insp-new.is-editing summary::before { content: "✎"; }
.insp-actions { display: flex; gap: 8px; align-items: center; }
a.in-cell { text-decoration: none; }
a.in-cell:hover { filter: brightness(.96); }
.in-mine li { position: relative; flex-wrap: wrap; }
.in-edit { margin-left: auto; }
.in-edit summary { list-style: none; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.in-edit summary::-webkit-details-marker { display: none; }
.in-edit summary:hover { background: var(--water); color: var(--ink); }
.in-edit[open] { flex-basis: 100%; margin-left: 0; }
.in-edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-top: 8px; padding: 10px; border-radius: 10px; background: var(--water); }
.in-edit-form label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); margin: 0; }
.in-wide { grid-column: 1 / -1; }
.in-edit-actions { display: flex; gap: 8px; }
/* gases in their own colour (gas_types.color, set as --gas) */
.fs-gases { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.fs-gases input:checked + span { background: var(--gas, var(--ink)); border-color: var(--gas, var(--ink)); }
.fs-gases span { border-left: 4px solid var(--gas, var(--line)); }
.fs-gas-tag { border-color: color-mix(in srgb, var(--gas, var(--line)) 70%, var(--surface)); background: color-mix(in srgb, var(--gas, var(--water)) 12%, var(--surface)); }
.st-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; background: var(--gas); vertical-align: baseline; }
.st-mixes { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.st-mixes legend { font-size: .82rem; color: var(--muted); float: none; width: 100%; padding: 0; margin: 0 0 2px; }
.st-chip input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.st-form .form-control-color { width: 64px; height: 38px; padding: 3px; }
/* the price's receipt: what went into the cylinder, priced line by line (services/fill_pricing.rb) */
.fs-receipt, .st-receipt { display: grid; gap: 3px; padding: 10px 12px 8px; border-top: 2px dashed var(--line); background: color-mix(in srgb, var(--water) 55%, var(--surface));
  border-radius: 0 0 10px 10px; font-family: var(--font-readout); font-size: .92rem; color: var(--ink-soft); }
.fs-receipt > div, .st-receipt > div { display: flex; align-items: baseline; gap: 6px; }
.fs-receipt > div > span:first-child, .st-receipt > div > span:first-child { flex: 1; min-width: 0; display: flex; gap: 6px; overflow: hidden; white-space: nowrap; }
.fs-receipt > div > span:first-child::after, .st-receipt > div > span:first-child::after { content: ""; flex: 1; border-bottom: 1px dotted var(--line-strong, var(--muted)); transform: translateY(-4px); }
.fs-receipt > div > span:last-child, .st-receipt > div > span:last-child { white-space: nowrap; color: var(--ink); }
.st-receipt .is-total { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 1.05rem; color: var(--ink); }
.st-receipt .is-total strong { font-size: 1.3rem; color: var(--buoy); }
.fs-price .fs-readout:has(+ .fs-receipt:not([hidden])) { border-radius: 10px 10px 0 0; }
.fs-start { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 0; font-size: .82rem; color: var(--muted); }
.fs-start small { display: block; font-size: .74rem; }
.fs-start-in { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--font-readout); color: var(--muted); }
.fs-start-in input { width: 64px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; font-family: var(--font-readout); font-size: 1.05rem; text-align: right; background: var(--surface); color: var(--ink); }
.fs-start-in input:focus { outline: none; border-color: var(--reef); box-shadow: 0 0 0 3px color-mix(in srgb, var(--reef) 18%, transparent); }
.st-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st-rates { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.st-mode-hint { margin: -2px 0 0; font-size: .85rem; color: var(--ink-soft); }
.st-formula { grid-column: 1; font-family: var(--font-readout); color: var(--ink-soft) !important; }
.st-try { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.st-try-head { margin: 0; padding: 8px 12px 0; font-size: .82rem; font-weight: 600; color: var(--ink); }
.st-try-in { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 6px 12px 10px; }
.st-try-in label { font-size: .74rem; }
.st-try-in .form-control { padding: 4px 8px; font-family: var(--font-readout); font-size: 1rem; }
@media (max-width: 560px) { .st-try-in { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.st-receipt { border-radius: 0; }
.bk-how { display: block; max-width: 260px; margin-left: auto; font-family: var(--font-readout); white-space: normal; }
/* Sammelfüllung: several cylinders for one person, entered and shown together */
.fs-qty { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: .85rem; color: var(--muted); }
.fs-qty small { display: block; font-size: .74rem; }
.fs-stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.fs-stepper button { width: 40px; border: 0; background: var(--water); color: var(--ink); font-size: 1.2rem; }
.fs-stepper button:hover { background: color-mix(in srgb, var(--reef) 14%, var(--water)); }
.fs-stepper input { width: 52px; border: 0; text-align: center; font-family: var(--font-readout); font-size: 1.3rem; font-weight: 600; color: var(--ink); background: none; }
.fs-stepper input:focus { outline: 2px solid var(--reef); outline-offset: -2px; }
.fs-batch { grid-column: 1 / -1; margin: 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--reef); border-radius: 12px; background: color-mix(in srgb, var(--reef) 5%, var(--surface)); }
.fs-batch h3 { font-size: .95rem; margin: 0 0 6px; }
.fs-batch ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.fs-batch li { display: flex; align-items: center; gap: 10px; }
.fs-batch li > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fs-batch li small { color: var(--muted); }
.fs-batch-drop { border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.fs-batch-drop:hover { background: var(--water); color: var(--coral); }
.fs-batch-sum { display: flex; justify-content: space-between; align-items: baseline; margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); font-weight: 600; }
.fs-batch-sum strong { font-family: var(--font-readout); font-size: 1.35rem; color: var(--buoy); }
.fs-actions [data-add-line] { order: 0; }
.fs-log li.is-batch { box-shadow: inset 3px 0 0 var(--reef); background: color-mix(in srgb, var(--reef) 3%, var(--surface)); }
.fs-log li.is-batch.is-open { box-shadow: inset 3px 0 0 var(--reef), inset 6px 0 0 var(--buoy); }
.fs-log li.fs-batch-row { grid-template-columns: 28px minmax(0, 1fr) 110px 28px; border-top: 1px dashed color-mix(in srgb, var(--reef) 40%, var(--line)); box-shadow: inset 3px 0 0 var(--reef);
  background: color-mix(in srgb, var(--reef) 7%, var(--surface)); font-weight: 600; }
.fs-log:not(:has(.fs-pick)) li.fs-batch-row { grid-template-columns: minmax(0, 1fr) 110px; }
.fs-batch-label { grid-column: span 1; }
@media (max-width: 760px) { .fs-log li.fs-batch-row { grid-template-areas: none; grid-template-columns: auto minmax(0, 1fr) auto; } }
/* fill slips (Füllzettel): the slip tabs of the station's form, a slip's own page */
.fs-slip-tag { display: inline-block; margin-left: 8px; padding: 0 7px; border-radius: 6px; background: var(--ink); color: #fff; font-family: var(--font-readout); font-size: .85rem; text-decoration: none; }
.sl-back { font-size: .88rem; color: var(--muted); text-decoration: none; }
.sl-no { font-family: var(--font-readout); color: var(--muted); }
.sl-state { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; margin-right: 6px; }
.sl-state.is-open { background: color-mix(in srgb, var(--buoy) 14%, var(--surface)); color: #9a3d0b; }
.sl-state.is-closed { background: color-mix(in srgb, var(--kelp) 12%, var(--surface)); color: var(--kelp); }
.sl-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; margin-bottom: 30px; }
@media (max-width: 900px) { .sl-grid { grid-template-columns: 1fr; } }
.sl-fills .fs-log li { grid-template-columns: 70px minmax(0, 2fr) 0 110px 28px; }
/* the bon as paper: monospaced, torn edges, the sum large */
.sl-paper { position: relative; padding: 18px 18px 22px; background: #fffef9; color: #111; font: 13px/1.45 "Courier New", ui-monospace, monospace; box-shadow: 0 2px 12px rgba(18, 48, 63, .14);
  -webkit-mask: radial-gradient(6px at 50% 0, #0000 98%, #000) 50% / 12px 51% repeat-x top, radial-gradient(6px at 50% 100%, #0000 98%, #000) 50% / 12px 51% repeat-x bottom;
          mask: radial-gradient(6px at 50% 0, #0000 98%, #000) 50% / 12px 51% repeat-x top, radial-gradient(6px at 50% 100%, #0000 98%, #000) 50% / 12px 51% repeat-x bottom; }
.sl-paper p { margin: 0; text-align: center; }
.sl-school { font-weight: 700; }
.sl-kind { letter-spacing: .04em; }
.sl-big { font-size: 2.2rem; font-weight: 700; margin: 4px 0 !important; }
.sl-paper ul { list-style: none; margin: 10px 0; padding: 8px 0; border-top: 1px dashed #555; border-bottom: 1px dashed #555; }
.sl-paper li { display: flex; justify-content: space-between; gap: 10px; }
.sl-total { display: flex; justify-content: space-between; font-size: 1.05rem; font-weight: 700; }
.sl-total strong { font-size: 1.25rem; }
.sl-code { margin-top: 10px !important; letter-spacing: .06em; }
.sl-note { margin-top: 6px !important; font-weight: 700; font-size: .82rem; }
.sl-actions { display: grid; gap: 8px; margin-top: 16px; }
.sl-actions form { margin: 0; display: grid; }
/* the bon printer's settings */
.pr-status { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.pr-status > div { flex: 1; }
.pr-status small { display: block; color: var(--muted); }
.pr-status form { margin: 0; }
.pr-status.is-ok .fs-dot { background: var(--kelp); }
.pr-status.is-warn .fs-dot { background: var(--buoy); }
.pr-token { margin: 12px 0; padding: 12px; border-radius: 12px; background: color-mix(in srgb, var(--buoy) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--buoy) 40%, var(--line)); }
.pr-token p { margin: 0 0 6px; }
.pr-token code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface); font-size: .95rem; word-break: break-all; user-select: all; }
.pr-steps { margin: 14px 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-soft); }
.pr-cmd { margin: 6px 0; padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #e8f3f6; font-size: .85rem; white-space: pre-wrap; }

.sl-paid { margin: 0; text-align: center; color: var(--kelp); font-weight: 600; }
/* the slip tabs: who is filled for, as tabs on top of the form; the chosen one runs into it */
.fs-form > .fs-tabs { grid-column: 1 / -1; }
.fs-tabs { display: flex; gap: 4px; padding: 10px 10px 0; overflow-x: auto; background: color-mix(in srgb, var(--water) 70%, var(--surface)); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.fs-tab { margin: 0 0 -1px; cursor: pointer; flex: 0 0 auto; }
.fs-tab input { position: absolute; opacity: 0; pointer-events: none; }
.fs-tab > span { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "no who" "no meta"; column-gap: 10px; align-items: center; min-width: 150px; max-width: 240px;
  padding: 9px 14px 10px; border: 1px solid transparent; border-bottom: 0; border-radius: 12px 12px 0 0; color: var(--ink-soft); }
.fs-tab b { grid-area: no; font-family: var(--font-readout); font-size: 1.7rem; font-weight: 600; line-height: 1; color: var(--muted); }
.fs-tab strong { grid-area: who; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
.fs-tab small { grid-area: meta; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fs-tab:hover > span { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.fs-tab input:checked + span { background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: inset 0 3px 0 var(--ink); }
.fs-tab input:checked + span b { color: var(--ink); }
.fs-tab.is-new input:checked + span { box-shadow: inset 0 3px 0 var(--reef); }
.fs-tab.is-new b { color: var(--reef); }
.fs-tab input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: -2px; }
.fs-form.is-on-slip { border-color: var(--ink); }
/* a slip's running bon in the billing column */
.fs-runbon { display: grid; gap: 8px; }
.fs-runbon-paper { padding: 12px 14px 14px; background: #fffef9; color: #111; font: 13px/1.45 "Courier New", ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 1px 6px rgba(18, 48, 63, .08); }
.fs-runbon-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; }
.fs-runbon-head span { font-size: 1.4rem; font-weight: 700; }
.fs-runbon-paper ul { list-style: none; margin: 0; padding: 6px 0; border-top: 1px dashed #777; border-bottom: 1px dashed #777; display: grid; gap: 2px; max-height: 180px; overflow-y: auto; }
.fs-runbon-paper li { display: flex; justify-content: space-between; gap: 8px; }
.fs-runbon-paper li.is-live { color: #0f6f86; font-weight: 700; border-top: 1px dotted #aaa; padding-top: 2px; }
.fs-runbon-sum { display: flex; justify-content: space-between; margin: 6px 0 0; font-weight: 700; }
.fs-runbon-sum strong { font-size: 1.15rem; }
.fs-runbon-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .9rem; }

@media (max-width: 720px) {
  .fs-actions { flex-wrap: wrap; }
  .fs-actions > .btn { flex: 1 1 100%; }
  .fs-tab > span { min-width: 128px; padding: 8px 10px; }
}

/* the menu's quick search button */
.nav-search { background: none; border: 0; }

/* the quick search (Strg/⌘ + K) */
.qs { position: fixed; inset: 0; z-index: 2000; }
.qs-backdrop { position: absolute; inset: 0; background: rgba(18, 48, 63, .38); backdrop-filter: blur(2px); }
.qs-panel { position: relative; width: min(640px, calc(100% - 32px)); margin: 12vh auto 0; background: var(--surface); border-radius: 16px; box-shadow: 0 18px 50px rgba(18, 48, 63, .3); overflow: hidden; }
.qs-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.qs-input i { color: var(--muted); }
.qs-input input { flex: 1; border: 0; outline: none; font-size: 1.15rem; background: none; color: var(--ink); }
.qs kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--water); color: var(--ink-soft); font-size: .75rem; font-family: inherit; box-shadow: none; }
.qs-results { max-height: 52vh; overflow-y: auto; padding: 6px 8px 8px; }
.qs-group { margin: 8px 10px 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.qs-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.qs-item i { color: var(--muted); text-align: center; }
.qs-item small { color: var(--muted); white-space: nowrap; }
.qs-item.is-on { background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.qs-item.is-on i { color: var(--brand); }
.qs-none { margin: 16px 10px; color: var(--ink-soft); }
.qs-foot { margin: 0; padding: 8px 16px; border-top: 1px solid var(--water); font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: 6px; }
@media (prefers-reduced-motion: no-preference) { .qs:not([hidden]) .qs-panel { animation: qs-in .14s ease-out; } }
@keyframes qs-in { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Calmer menus (menu, 3) ----------
 * More air, quieter icons, group heads as small captions over a hairline, the wide menu in
 * fixed columns. One block: removing it brings back the menus as they were. */
.dropdown-menu { padding: .55rem; min-width: 250px; }
.dropdown-item { display: flex; align-items: center; gap: .55rem; padding: .5rem .8rem; line-height: 1.3; white-space: normal; }
.dropdown-item i { flex: none; width: 1.1rem; margin-right: 0; font-size: .9em; color: var(--muted); opacity: .75; }
.dropdown-item:hover i, .dropdown-item:focus i { opacity: 1; }
.dropdown-item .nav-item-label { flex: 1; min-width: 0; }
.dropdown-header { padding: .75rem .8rem .3rem; font-size: .76rem; letter-spacing: .01em; }
.dropdown-menu > li:first-child > .dropdown-header, .nav-mega .dropdown-header { padding-top: .35rem; }
.dropdown-divider { margin: .45rem .8rem; border-top-color: var(--water); opacity: 1; }
@media (min-width: 1200px) {
  .nav-mega.show { grid-template-columns: repeat(2, 270px); column-gap: .6rem; padding: .6rem; }
  .nav-mega-group { padding-bottom: .5rem; }
  .nav-mega-group:nth-child(n + 3) { border-top: 1px solid var(--water); padding-top: .35rem; }
}

/* what waits: a number at the entry, a dot at the menu */
.nav-count { flex: none; min-width: 1.45rem; padding: 0 .4rem; border-radius: 999px; font-size: .74rem; font-weight: 600; line-height: 1.35rem; text-align: center; color: #fff;
  font-family: var(--font-readout); }
.nav-count.is-buoy { background: var(--buoy); }
.nav-count.is-coral { background: var(--coral); }
.nav-count.is-reef { background: var(--reef); }
.nav-count.is-kelp { background: var(--kelp); }
.nav-link .nav-count { margin-left: .35rem; }
.nav-dot { display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--buoy); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 70%, transparent);
  vertical-align: super; }

/* Compressor runs: a running compressor is a dark band with a live clock; stopping opens below */
.run-board { display: grid; gap: 8px; margin-bottom: 16px; }
.run-band { border-radius: 14px; background: var(--ink); color: #e8f3f6; overflow: hidden; }
.run-band > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px; padding: 12px 16px; cursor: pointer; list-style: none; }
.run-band > summary::-webkit-details-marker { display: none; }
.run-band > summary:focus-visible { outline: 2px solid #6fd3ea; outline-offset: -2px; }
.run-dot { width: 12px; height: 12px; border-radius: 50%; background: #3ddc97; box-shadow: 0 0 0 0 rgba(61, 220, 151, .6); }
@media (prefers-reduced-motion: no-preference) { .run-dot { animation: run-pulse 2s ease-out infinite; } }
@keyframes run-pulse { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.run-what { display: flex; flex-direction: column; min-width: 0; }
.run-what strong { font-size: 1.05rem; }
.run-what small { color: #9fc3cf; }
.run-clock { font-family: var(--font-readout); font-size: 1.8rem; font-weight: 600; line-height: 1; letter-spacing: .02em; }
.run-count { color: #b9d6df; font-size: .9rem; white-space: nowrap; }
.run-stop-btn { pointer-events: none; }
.run-band[open] .run-stop-btn { opacity: .6; }
.run-band.is-stale { background: #5c3d07; }
.run-band.is-stale .run-dot { background: #f2c230; animation: none; }
.run-stop { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px 18px; align-items: end; padding: 14px 16px 16px; background: var(--surface); color: var(--ink); border: 1px solid var(--ink); border-top: 0; border-radius: 0 0 14px 14px; }
.run-sum ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-family: var(--font-readout); font-size: 1.05rem; }
.run-sum li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dotted var(--line); }
.run-sum p { margin: 0; color: var(--ink-soft); }
.run-sum .run-warn { margin-top: 8px; color: #9a3d0b; font-weight: 600; }
.run-hours { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin: 0; }
.run-hours small { display: block; }
.run-notes { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); margin: 0; }
.run-stop > .btn { grid-column: 1 / -1; justify-self: start; }
.run-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface); }
.run-start .form-select { width: auto; min-width: 220px; }
.run-start.is-first { padding: 16px; border: 1px solid var(--line); }
.run-start p { flex-basis: 100%; margin: 0 0 4px; }
.run-start p small { color: var(--muted); margin-left: 6px; }
.run-locked { padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--ink-soft); text-align: center; margin-bottom: 22px; }
.fs-in-run { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--ink) 7%, var(--surface)); color: var(--ink); font-size: .9rem; }
.fs-in-run i { color: var(--kelp); margin-right: 4px; }
.fs-run-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fs-run-pick legend { font-size: .85rem; color: var(--muted); float: none; width: 100%; padding: 0; margin: 0 0 2px; }
@media (max-width: 720px) {
  .run-band > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
  .run-count { grid-column: 2 / -1; }
  .run-stop-btn { grid-column: 1 / -1; justify-self: start; }
  .run-stop { grid-template-columns: 1fr; }
}

/* where the gas comes from: compressor or a storage cylinder */
.fs-source { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.fs-src { margin: 0; cursor: pointer; }
.fs-src input { position: absolute; opacity: 0; pointer-events: none; }
.fs-src > span { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i name" "i meta"; column-gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fs-src i { grid-area: i; color: var(--muted); font-size: 1.1rem; }
.fs-src strong { grid-area: name; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-src small { grid-area: meta; color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-src input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: color-mix(in srgb, var(--ink) 5%, var(--surface)); }
.fs-src input:checked + span i { color: var(--ink); }
.fs-src input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 2px; }
.fs-src.is-off { cursor: not-allowed; opacity: .55; }
/* the fill book's compressor runs; a slip's person */
.bk-runs { margin: 22px 0; }
.bk-runs h2 { font-size: 1.1rem; margin: 0 0 8px; }
.bk-runs h2 small { font-family: var(--font-readout); color: var(--muted); }
.bk-runs ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.bk-runs li + li { border-top: 1px solid var(--water); }
.bk-runs summary { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: baseline; padding: 9px 14px; cursor: pointer; list-style: none; }
.bk-runs summary::-webkit-details-marker { display: none; }
.bk-runs summary small { grid-column: 2 / -1; color: var(--muted); }
.bk-hours { font-family: var(--font-readout); color: var(--ink-soft); }
.bk-run-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 4px 14px 14px; }
.bk-run-form label { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; color: var(--muted); margin: 0; }
.bk-wide { grid-column: 1 / -1; }
.bk-run-actions { display: flex; gap: 8px; }
@media (max-width: 640px) { .bk-runs summary { grid-template-columns: 1fr auto; } }
.sl-person { margin: 4px 0 2px; }
.sl-person summary { cursor: pointer; color: var(--reef); font-size: .9rem; list-style: none; }
.sl-person summary::-webkit-details-marker { display: none; }
.sl-person-form { display: grid; gap: 8px; max-width: 420px; margin-top: 8px; }
.sl-person-form .btn { justify-self: start; }

/* ---------- Füllstation, calmer (views/fills/station.erb) ----------
 * The title with two figures beside it; the form as a sequence: 1 cylinder and 2 fill on the
 * left, 3 billing on the right staying in view; a quieter log. */
.fs-head { align-items: baseline; margin: 6px 0 14px; }
.fs-figures { display: flex; align-items: baseline; gap: 22px; }
.fs-fig { color: var(--ink-soft); font-size: .92rem; text-decoration: none; }
.fs-fig strong { font-family: var(--font-readout); font-size: 1.7rem; font-weight: 600; color: var(--ink); margin-right: 2px; }
.fs-fig.is-money strong { color: var(--buoy); }
a.fs-fig:hover, a.fs-fig.is-active { color: var(--ink); text-decoration: underline; text-decoration-color: var(--buoy); text-underline-offset: 4px; }
.fs-form { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); grid-template-areas: "tabs tabs" "edit edit" "cyl bill" "fill bill" "batch batch" "actions actions"; }
.fs-form > .fs-tabs { grid-area: tabs; }
.fs-form > .fs-editbar { grid-area: edit; }
.fs-form > .fs-step.is-cyl { grid-area: cyl; border-left: 0; }
.fs-form > .fs-step.is-fill { grid-area: fill; border-left: 0; border-top: 1px solid var(--water); }
.fs-form > .fs-step.is-bill { grid-area: bill; border-left: 1px solid var(--water); background: color-mix(in srgb, var(--water) 35%, var(--surface)); }
.fs-form > .fs-batch { grid-area: batch; }
.fs-form > .fs-actions { grid-area: actions; }
.fs-step.is-bill > * { position: relative; }
@media (min-width: 1101px) { .fs-step.is-bill { align-self: stretch; } .fs-step.is-bill .fs-billing, .fs-step.is-bill .fs-runbon { position: sticky; top: 12px; } }
.fs-step h2 { display: flex; align-items: center; gap: 10px; }
.fs-step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-family: var(--font-readout); font-size: .9rem; font-weight: 600; }
.fs-step.is-cyl { gap: 10px; }
.fs-step.is-cyl .fs-switch { margin-bottom: 2px; }
.fs-gases { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.fs-gases span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) {
  .fs-form { grid-template-columns: 1fr; grid-template-areas: "tabs" "edit" "cyl" "fill" "bill" "batch" "actions"; }
  .fs-form > .fs-step.is-bill { border-left: 0; border-top: 1px solid var(--water); }
}
/* the log: open fills carry their state in the price; who filled as initials (when not oneself) */
.fs-log li.is-open { box-shadow: none; }
.fs-log li { padding: 9px 14px; }
.fs-when { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.fs-who-tag { display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--water); color: var(--ink-soft); font-family: var(--font-readout); font-size: .74rem; text-decoration: none; cursor: help; }
.fs-what small { color: var(--muted); }
.fs-log li:hover { background: color-mix(in srgb, var(--water) 45%, var(--surface)); }

/* starting a run: one slim line, not a box */
.run-start, .run-start.is-first { flex-wrap: wrap; padding: 8px 10px 8px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.run-start p, .run-start.is-first p { flex-basis: auto; margin: 0 auto 0 0; display: flex; align-items: baseline; gap: 8px; }
.run-start p::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong, #b9c9d0); align-self: center; }
@media (max-width: 720px) { .run-start p, .run-start.is-first p { flex-basis: 100%; margin: 0 0 6px; } .run-start .form-select { flex: 1; min-width: 0; } }
@media (max-width: 760px) {
  /* a log row in two lines: what and the price; when, for whom and edit */
  .fs-log li, .fs-log:not(:has(.fs-pick)) li { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "pick what what num" "pick when for act"; row-gap: 4px; column-gap: 10px; }
  .fs-when { font-size: .82rem; }
  .fs-for { font-size: .85rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fs-row-actions { align-self: center; }
  .run-start p { flex-direction: column; gap: 0; }
  .run-start p::before { display: none; }
}
/* fills booked on a training */
.fs-tab.is-training b { color: var(--kelp); font-size: 1.3rem; }
.fs-tab.is-training input:checked + span { box-shadow: inset 0 3px 0 var(--kelp); }
.fs-training { display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--kelp) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--kelp) 30%, var(--line)); }
.fs-training .fs-help { margin: 0; color: var(--ink-soft); }
.fs-training .fs-help i { color: var(--kelp); margin-right: 4px; }
.fs-training-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 0 7px; border-radius: 6px; background: color-mix(in srgb, var(--kelp) 14%, var(--surface)); color: var(--kelp); font-size: .82rem; text-decoration: none; }
small.is-training { color: var(--kelp); }
.tr-fills { margin: 26px 0; }
.tr-fills h2 { font-size: 1.1rem; display: flex; align-items: baseline; gap: 8px; }
.tr-fills h2 small { font-family: var(--font-readout); color: var(--muted); }


/* course runs: running and the archive (views/training/index.erb) */
.tr-runs-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tr-runs-tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--water); }
.tr-runs-tabs a { padding: 5px 14px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: .9rem; }
.tr-runs-tabs a small { font-family: var(--font-readout); color: var(--muted); margin-left: 2px; }
.tr-runs-tabs a.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(18, 48, 63, .15); }
.tr-runs-tabs a:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.tr-cert { display: flex; align-items: center; gap: 8px; }
.tr-cert-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--water); overflow: hidden; }
.tr-cert-bar span { display: block; height: 100%; background: var(--kelp); }
.tr-cert small { color: var(--ink-soft); white-space: nowrap; }
.tr-run-card.is-archived { background: color-mix(in srgb, var(--water) 40%, var(--surface)); }
.tr-run-card.is-archived h3 { color: var(--ink-soft); }
.tr-archived { color: var(--muted); margin-top: 8px; }
.tr-run-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tr-run-state form { margin: 0; }
.tr-cert-pill, .tr-archived-pill { padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; }
.tr-cert-pill { background: color-mix(in srgb, var(--kelp) 12%, var(--surface)); color: var(--kelp); }
.tr-archived-pill { background: var(--water); color: var(--ink-soft); }
/* a compressor's buffer under it */
.st-buffer { list-style: none; margin: -4px 0 8px 32px; padding: 0 0 0 12px; border-left: 2px solid var(--water); }
.st-buffer li a { display: flex; align-items: center; gap: 10px; padding: 6px 4px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.st-buffer li a > span:not(.in-cell) { flex: 1; display: flex; flex-direction: column; }
.st-buffer small { color: var(--muted); }
.st-buffer i { color: var(--muted); }
.st-buffer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 4px; font-size: .85rem; color: var(--ink-soft); }
.st-buffer-foot a { display: inline-flex !important; padding: 0 !important; color: var(--reef) !important; font-size: .85rem; }


/* one check for several items (views/fills/check_batch.erb): the shared report on the left,
   the items with a result each on the right, the running tally at the bottom */
.fs-head-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.cb-back { margin: 0 0 4px; font-size: .9rem; }
.cb-back a { color: var(--ink-soft); text-decoration: none; }
.cb { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 18px 22px; align-items: start; }
.cb-sheet { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cb-sheet h2, .cb-tools h2 { font-size: 1rem; margin: 0; }
.cb-sheet label { display: flex; flex-direction: column; gap: 4px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.cb-sheet label small { font-weight: 400; color: var(--muted); }
.cb-proto { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .86rem; }
.cb-proto > span { font-weight: 600; color: var(--ink-soft); }
.cb-proto small { color: var(--muted); }
.cb-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.cb-tools h2 { margin-right: auto; }
.cb-tools input[type=search] { width: 200px; }
.cb-quick .btn { padding: 2px 6px; }
.cb-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.cb-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--water); }
.cb-row:first-child { border-top: 0; }
.cb-row.is-on { background: color-mix(in srgb, var(--reef) 5%, var(--surface)); box-shadow: inset 3px 0 0 var(--reef); }
.cb-pick { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; margin: 0; }
.cb-pick input { width: 20px; height: 20px; flex: none; accent-color: var(--reef); }
.cb-name { display: flex; flex-direction: column; min-width: 0; }
.cb-name strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-name small { color: var(--muted); font-size: .84rem; }
.cb-was { justify-self: end; font-size: .8rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--water); color: var(--ink-soft); white-space: nowrap; }
.cb-was.is-overdue { background: color-mix(in srgb, var(--coral) 14%, var(--surface)); color: var(--coral); }
.cb-was.is-never { background: color-mix(in srgb, var(--buoy) 16%, var(--surface)); color: #9a4a00; }
.cb-was.is-soon { background: #fff3c4; color: #7a5d00; }
/* the result only matters for a picked item */
.cb-result { grid-column: 1 / -1; display: none; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-left: 32px; }
.cb-row.is-on .cb-result { display: flex; }
.cb-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--water); }
.cb-seg label { margin: 0; cursor: pointer; }
.cb-seg input { position: absolute; opacity: 0; pointer-events: none; }
.cb-seg span { display: block; padding: 4px 12px; border-radius: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.cb-seg input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 1px; }
.cb-seg .is-passed input:checked + span { background: var(--kelp); color: #fff; }
.cb-seg .is-failed input:checked + span { background: var(--coral); color: #fff; }
.cb-seg .is-note input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(18, 48, 63, .15); }
.cb-hours { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .84rem; color: var(--ink-soft); }
.cb-hours input { width: 90px; }
.cb-note { flex: 1; min-width: 180px; }
.cb-empty, .cb-nomatch { padding: 18px; color: var(--muted); }
.cb-bar { grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(6px); box-shadow: 0 -4px 16px rgba(18, 48, 63, .08); }
.cb-tally { margin: 0 auto 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--muted); }
.cb-tally strong { color: var(--ink); font-family: var(--font-readout); }
.cb-tally span { font-family: var(--font-readout); font-weight: 600; }
.cb-tally .is-passed { color: var(--kelp); }
.cb-tally .is-failed { color: var(--coral); }
.cb-tally .is-note { color: var(--ink-soft); }
.cb-delete { margin-top: 18px; text-align: right; }
@media (max-width: 860px) {
  .cb { grid-template-columns: 1fr; }
  .cb-sheet { position: static; }
  .cb-result { padding-left: 0; }
  .cb-tools input[type=search] { width: 100%; order: 3; }
}
/* the overview: due together, and checks for several items */
.insp-together { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px 8px 0; font-size: .88rem; font-weight: 600; color: var(--reef); text-decoration: none; }
.insp-batches { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.insp-batches li { border-top: 1px solid var(--water); }
.insp-batches li:first-child { border-top: 0; }
.insp-batches a { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: 4px 14px; align-items: center; padding: 10px 14px; color: var(--ink); text-decoration: none; }
.insp-batches .insp-when { font-family: var(--font-readout); color: var(--ink-soft); }
.insp-batches .insp-what { display: flex; flex-direction: column; min-width: 0; }
.insp-batches .insp-what small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-batches .insp-count { font-size: .88rem; color: var(--ink-soft); text-align: right; }
.insp-batches .insp-count em { display: block; font-style: normal; color: var(--coral); font-weight: 600; }
.insp-batches i { color: var(--muted); }
.insp-batch-tag { display: block; font-size: .8rem; color: var(--reef); text-decoration: none; }
@media (max-width: 640px) { .insp-batches a { grid-template-columns: minmax(0, 1fr) auto; } .insp-batches .insp-when { grid-column: 1 / -1; } }

/* inventory: a page at a time (views/inventory/index.erb) */
.iv-results { scroll-margin-top: 80px; transition: opacity .15s; }
.iv-results[aria-busy="true"] { opacity: .55; }
.iv-range { margin: 0 0 10px; font-size: .88rem; color: var(--muted); font-family: var(--font-readout); }
.iv-pager { margin: 18px 0 6px; }
.iv-pager .page-link { min-width: 40px; text-align: center; }
@media (prefers-reduced-motion: reduce) { .iv-results { transition: none; } }

/* training: SSI records in (views/training/index.erb) – a drop zone that turns into the stack
   of chosen files with the course run and the button in one line */
.tr-drop { margin-bottom: 26px; }
.tr-drop-zone { position: relative; display: flex; align-items: center; gap: 16px; margin: 0; padding: 18px 22px; border: 2px dashed color-mix(in srgb, var(--reef) 35%, var(--line)); border-radius: 14px; background: color-mix(in srgb, var(--water) 45%, var(--surface)); cursor: pointer; transition: border-color .15s, background .15s; }
.tr-drop-zone:hover, .tr-drop-zone.is-over { border-color: var(--reef); background: color-mix(in srgb, var(--reef) 7%, var(--surface)); }
.tr-drop-zone:focus-within { outline: 2px solid var(--reef); outline-offset: 2px; }
.tr-drop-zone > i { font-size: 1.9rem; color: var(--reef); flex: none; }
.tr-drop-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tr-drop-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tr-drop-text strong { font-size: 1.02rem; color: var(--ink); }
.tr-drop-text > span { color: var(--ink-soft); }
.tr-drop-text small { color: var(--muted); font-size: .84rem; max-width: 70ch; }
.tr-drop-chosen { padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.tr-drop-files { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tr-drop-files li { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 5px 11px; border-radius: 8px; background: var(--water); font-size: .88rem; }
.tr-drop-files li i { color: #c0392b; }
.tr-drop-files li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-drop-files li small { color: var(--muted); font-family: var(--font-readout); }
.tr-drop-go { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.tr-drop-run { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; margin: 0; font-size: .86rem; font-weight: 600; color: var(--ink-soft); }
.tr-drop-go .btn-primary { margin-left: auto; }
@media (prefers-reduced-motion: reduce) { .tr-drop-zone { transition: none; } }
@media (max-width: 575px) { .tr-drop-zone { align-items: flex-start; padding: 16px; } .tr-drop-go .btn-primary { width: 100%; } }
/* records without a course run: one line per person, their programs as chips */
.trn-list { list-style: none; margin: 0 0 26px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.trn-list > li { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 8px 16px; align-items: start; padding: 12px 16px; border-top: 1px solid var(--water); }
.trn-list > li:first-child { border-top: 0; }
.trn-name { font-weight: 600; padding-top: 3px; }
.trn-programs { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-program { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .9rem; }
.tr-program small { color: var(--muted); font-family: var(--font-readout); }
.tr-program.is-done { border-color: color-mix(in srgb, var(--kelp) 35%, var(--surface)); background: color-mix(in srgb, var(--kelp) 9%, var(--surface)); color: var(--kelp); }
.tr-program:hover { border-color: var(--reef); }
.tr-program:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
@media (max-width: 640px) { .trn-list > li { grid-template-columns: 1fr; } }

/* the cart in the menu appears when something is added (views/layout.erb EasyDiveCart) */
[data-cart-nav].is-bump .nav-badge { animation: cart-bump .45s ease-out; }
@keyframes cart-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { [data-cart-nav].is-bump .nav-badge { animation: none; } }
[data-cart-nav][hidden] { display: none !important; }

/* the slip tabs wrap instead of scrolling: no scrollbar (the -1px overlap with the border made
   the strip scroll even when everything fit), every open slip stays in sight */
.fs-tabs { flex-wrap: wrap; row-gap: 4px; overflow: visible; }
.fs-tab { margin-bottom: 0; }
.fs-tabs { padding-bottom: 0; }
.fs-tab:last-child, .fs-tab { align-self: flex-end; }
@media (max-width: 640px) {
  .fs-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 8px; }
  .fs-tab > span { min-width: 0; max-width: none; padding: 7px 9px; border-radius: 10px; }
  .fs-tab b { font-size: 1.25rem; }
  .fs-tab input:checked + span { box-shadow: inset 0 3px 0 var(--ink), 0 0 0 1px var(--line); }
}
.nfc-cell { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; } .nfc-on { color: var(--kelp); font-weight: 600; } .nfc-uid { color: var(--muted); font-family: var(--font-readout); }

/* Inventory stacks: alike pieces as one entry (views/inventory/index.erb). The count sits on
   a little pile, a dot per piece shows where each is; opening it lists the pieces. */
.iv-list li.iv-stack { display: block; padding: 0; }
.iv-stack summary { display: grid; grid-template-columns: 96px minmax(0, 1.6fr) 56px minmax(0, 1.4fr) 108px; gap: 4px 14px; align-items: center; padding: 10px 14px; cursor: pointer; list-style: none; }
.iv-stack summary::-webkit-details-marker { display: none; }
.iv-stack summary:hover .iv-name strong { text-decoration: underline; }
.iv-stack summary:focus-visible { outline: 2px solid var(--reef); outline-offset: -2px; border-radius: var(--radius); }
.iv-count { justify-self: start; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--ink);
  box-shadow: 3px -3px 0 -1px var(--surface), 3px -3px 0 0 var(--line-strong), 6px -6px 0 -1px var(--surface), 6px -6px 0 0 var(--line-strong); margin-top: 6px; }
.iv-pips { display: flex; flex-wrap: wrap; gap: 3px; max-width: 168px; }
.iv-pips i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.iv-pips i.is-available { background: var(--kelp); }
.iv-pips i.is-assigned { background: var(--reef); }
.iv-pips i.is-maintenance { background: var(--buoy); }
.iv-pips i.is-overdue { background: var(--coral); }
.iv-pips i.is-retired { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.iv-tally { color: var(--ink-soft); }
.iv-open { display: inline-flex; width: 31px; height: 31px; align-items: center; justify-content: center; color: var(--muted); }
.iv-open i { transition: transform .15s ease; }
.iv-stack details[open] .iv-open i { transform: rotate(180deg); }
.iv-stack details[open] summary { background: color-mix(in srgb, var(--reef) 6%, var(--surface)); }
.iv-list.iv-pieces { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: color-mix(in srgb, var(--reef) 3%, var(--surface)); }
.iv-list.iv-pieces li { padding-left: 30px; }
.iv-stack:last-child .iv-pieces { border-radius: 0 0 var(--radius) var(--radius); }
@media (prefers-reduced-motion: reduce) { .iv-open i { transition: none; } }
@media (max-width: 767px) {
  .iv-stack summary { grid-template-columns: minmax(0, 1fr) auto; }
  .iv-stack summary .iv-name { grid-column: 1; }
  .iv-list.iv-pieces li { padding-left: 14px; }
}
.iv-pieces .iv-name strong { font-weight: 500; color: var(--ink-soft); }

/* Fill prices (views/fills/_price_*.erb): the way of pricing as two cards; the list as a board
   per gas in the gas's colour (size, pressure, price in columns); prices per litre as a sheet. */
.fp-model fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 18px; }
.fp-model legend { font-size: .82rem; color: var(--muted); margin-bottom: 6px; float: none; }
.fp-way { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 2px 10px; align-items: baseline; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; margin: 0; }
.fp-way input { grid-row: 1 / span 2; align-self: start; margin-top: 4px; accent-color: var(--reef); }
.fp-way-name { font-weight: 600; color: var(--ink); }
.fp-way-text { grid-column: 2 / -1; font-size: .86rem; color: var(--ink-soft); }
.fp-way-state { grid-column: 3; grid-row: 1; font-size: .78rem; color: var(--muted); }
.fp-way.is-on { border-color: var(--reef); box-shadow: inset 0 0 0 1px var(--reef); background: color-mix(in srgb, var(--reef) 5%, var(--surface)); }
.fp-way.is-on .fp-way-state { color: var(--reef); font-weight: 600; }
.fp-way:not(.is-on):hover { border-color: var(--line-strong); }
.fp-way:has(input:focus-visible) { outline: 2px solid var(--reef); outline-offset: 2px; }
.fp-rule { font-size: .85rem; color: var(--ink-soft); margin: 0 0 12px; max-width: 70ch; }

.fp-board { --gas: var(--line-strong); margin: 0 0 14px; border: 1px solid var(--line); border-left: 5px solid var(--gas); border-radius: 10px; background: var(--surface); }
.fp-board.is-any { border-left-style: dashed; }
.fp-board-head { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px 4px; }
.fp-board-head h3 { margin: 0; font-size: 1.05rem; }
.fp-board-head small { color: var(--muted); font-size: .82rem; }
.fp-board.is-empty .fp-board-head { padding-bottom: 0; }
.fp-cols, .fp-lines summary { display: grid; grid-template-columns: minmax(0, 1.3fr) 110px 120px minmax(120px, 1fr); gap: 4px 14px; align-items: center; }
.fp-cols { padding: 2px 14px 4px; font-size: .76rem; color: var(--muted); }
.fp-cols span:last-child { text-align: right; }
.fp-lines { padding: 0 10px 4px; }
.fp-lines li:first-child { border-top: 0; }
.fp-lines summary { padding: 9px 4px; }
.fp-lines summary > span { grid-column: auto !important; }
.fp-lines li.is-new summary { display: block; }
.fp-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.fp-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-name small { color: var(--muted); }
.fp-size, .fp-bar { font-family: var(--font-readout); color: var(--ink-soft); font-size: .92rem; }
.fp-bar.is-any { color: var(--muted); }
.fp-amount { text-align: right; }
.fp-amount b { font-family: var(--font-readout); font-size: 1.15rem; color: var(--ink); }
.fp-amount small { display: block; font-family: var(--font-readout); color: var(--ink-soft); font-size: .8rem; line-height: 1.35; }
.fp-unit input::placeholder { color: var(--muted); opacity: .6; }
.fp-bar-range small { grid-column: 1 / -1; color: var(--muted); font-size: .78rem; }

.fp-other { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 10px; }
.fp-other > summary { cursor: pointer; color: var(--reef); font-weight: 600; padding: 4px 0; }
.fp-other > .fp-panel { margin-top: 12px; }

.fp-litre fieldset { margin: 0 0 18px; }
.fp-litre legend { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 4px; float: none; }
.fp-rate-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
.fp-rate { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: .82rem; color: var(--muted); }
.fp-rate > span:first-child { font-weight: 600; color: var(--ink); font-size: .9rem; }
.fp-unit { display: flex; align-items: stretch; }
.fp-unit input { font-family: var(--font-readout); text-align: right; border-top-right-radius: 0; border-bottom-right-radius: 0; min-width: 0; }
.fp-unit em { display: flex; align-items: center; padding: 0 10px; font-style: normal; font-size: .82rem; color: var(--muted); white-space: nowrap;
  border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--bs-border-radius, 6px) var(--bs-border-radius, 6px) 0; background: var(--water); }
.fp-unit[hidden] { display: none; }
.fp-gas-cols { grid-template-columns: 140px minmax(0, 1fr) 150px; padding: 0 0 4px 12px; }
.fp-gas-cols span:last-child { text-align: left; }
.fp-gas { --gas: var(--line-strong); display: grid; grid-template-columns: 140px minmax(0, 1fr) 150px; gap: 8px 14px; align-items: center;
  padding: 8px 0 8px 12px; border-left: 5px solid var(--gas); border-top: 1px solid var(--water); }
.fp-gas-name { font-size: .95rem; }
.fp-gas-by { display: flex; gap: 8px; min-width: 0; }
.fp-gas-by select { flex: 1 1 auto; min-width: 0; }
.fp-gas-by .fp-unit { flex: 0 1 170px; }
.fp-litre-end { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 10px 12px; margin-bottom: 16px; }
.fp-litre-end label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); margin: 0; }
.fp-try { margin-bottom: 14px; }
.fp-try-in { grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr)); }
.fp-try-in label[hidden] { display: none; }

@media (max-width: 767px) {
  .fp-model fieldset { grid-template-columns: 1fr; }
  .fp-cols { display: none; }
  .fp-lines summary { grid-template-columns: minmax(0, 1fr) auto; }
  .fp-lines .fp-name { grid-column: 1 !important; }
  .fp-lines .fp-amount { grid-column: 2 !important; grid-row: 1 / span 2; }
  .fp-lines .fp-size, .fp-lines .fp-bar { grid-column: 1 !important; font-size: .84rem; }
  .fp-lines .fp-amount:has(small) { grid-column: 1 / -1 !important; grid-row: auto; text-align: left; }
  .fp-rate-row { grid-template-columns: 1fr; }
  .fp-gas-cols { display: none; }
  .fp-gas { grid-template-columns: 1fr; }
  .fp-gas-by { flex-wrap: wrap; }
  .fp-litre-end { grid-template-columns: 1fr 1fr; }
  .fp-try-in { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* A run's participant: each course with its exam results beside it (views/training/run.erb) */
.tr-person { grid-template-columns: minmax(12rem, 1fr) minmax(0, 2.5fr); }
.tr-courses { display: grid; min-width: 0; }
.tr-course { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 1.3fr); gap: 6px 16px; align-items: start; padding: 6px 0; }
.tr-course + .tr-course { border-top: 1px solid var(--water); }
.tr-exams { list-style: none; margin: 0; padding: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tr-exams .tr-none { padding: 0; }
.tr-course.is-loose { grid-template-columns: 1fr; }
.tr-loose { margin: 0; font-size: .9rem; font-weight: 500; color: var(--ink-soft); }
.tr-loose small { display: block; font-weight: 400; color: var(--muted); }
.tr-course.is-loose .tr-exam { border-style: dashed; }
.tr-pop-form { display: grid; gap: 6px; }
.tr-pop-form .btn { justify-self: start; }
@media (max-width: 860px) {
  .tr-person { grid-template-columns: 1fr; }
  .tr-course { grid-template-columns: 1fr; }
}

/* A participant's way to the brevet, under their name (views/training/run.erb): a segment per
   course, its state in the segment itself (through: solid; record done, exam missing: hatched;
   under way: filled as far as signed off; not begun: outline), the count beside it, the brevet
   last, and below what is still open, each a link to its course. */
.tr-who { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 4px; align-items: center; }
.tr-who > .tr-medical, .tr-who > .tr-track { grid-column: 2; }
.tr-track { display: grid; grid-template-columns: minmax(0, 16rem) auto; align-items: center; column-gap: 8px; row-gap: 5px; margin-top: 2px; justify-content: start; }
.tr-track-bar { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; min-width: 0; }
.tr-track-bar > li { position: relative; flex: 1 1 0; min-width: 6px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--water); }
.tr-track-bar > li.is-new { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.tr-track-bar > li.is-through { background: var(--kelp); }
.tr-track-bar > li.is-no-exam { background: repeating-linear-gradient(-45deg, var(--kelp) 0 3px, color-mix(in srgb, var(--kelp) 35%, var(--surface)) 3px 5px); }
.tr-track-fill { position: absolute; inset: 0 auto 0 0; background: var(--reef); }
.tr-track-bar > li:not(.is-going) .tr-track-fill { display: none; }
.tr-track-brevet { flex: none !important; width: 18px; height: 18px !important; min-width: 0 !important; overflow: visible !important; border-radius: 50% !important; margin-left: 4px;
  display: grid; place-items: center; background: var(--surface) !important; box-shadow: inset 0 0 0 1.5px var(--line-strong) !important; color: var(--muted); font-size: .6rem; }
.tr-track-brevet.is-held { box-shadow: none !important; background: var(--kelp) !important; color: #fff; }
.tr-track-count { font-family: var(--font-readout); font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.tr-track.is-through .tr-track-count { color: var(--kelp); }
.tr-track-text { grid-column: 1 / -1; margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.tr-track-text a { color: var(--ink); font-weight: 500; }
.tr-track-what { color: var(--muted); }
.tr-track.is-through .tr-track-text { color: var(--kelp); }
.tr-course:target { background: color-mix(in srgb, var(--reef) 7%, transparent); border-radius: 8px; }

/* The API's documentation and keys (views/api_docs/*.erb): groups on the left, endpoints as rows
   with their method as a coloured mark and the path in the code face, opening to the details. */
.ad-lede { margin: 4px 0 0; color: var(--ink-soft); max-width: 70ch; }
.ad-downloads { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-note { margin-bottom: 14px; }
.ad-intro { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; max-width: 90ch; font-size: .93rem; color: var(--ink-soft); }
.ad-intro p { margin: 0 0 8px; }
.ad-intro p:last-child { margin: 0; }
.ad-intro code, .ad-rights code, .ad-tree code, .ad-table code, .ad-base code { font-size: .85em; background: var(--water); border-radius: 4px; padding: 1px 5px; color: var(--ink); }
.ad-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.ad-nav { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.ad-switch { display: grid; gap: 2px; margin-bottom: 12px; }
.ad-switch a { padding: 6px 10px; border-radius: var(--radius); color: var(--ink-soft); text-decoration: none; font-size: .88rem; }
.ad-switch a.is-on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 3px 0 0 var(--reef); }
.ad-nav ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.ad-nav li a { display: flex; justify-content: space-between; gap: 8px; padding: 4px 10px; font-size: .88rem; color: var(--ink); text-decoration: none; border-radius: 6px; }
.ad-nav li a:hover { background: var(--surface); }
.ad-nav small { font-family: var(--font-readout); color: var(--muted); }
.ad-search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 12px; }
.ad-search input { border: 0; outline: 0; flex: 1; padding: 9px 0; background: transparent; }
.ad-search:focus-within { border-color: var(--reef); box-shadow: 0 0 0 3px color-mix(in srgb, var(--reef) 18%, transparent); }
.ad-count { margin: 8px 0 4px; font-size: .82rem; color: var(--muted); font-family: var(--font-readout); }
.ad-group { margin-top: 22px; scroll-margin-top: 80px; }
.ad-group h2 { font-size: 1.15rem; margin: 0 0 2px; }
.ad-group-text { margin: 0 0 8px; font-size: .88rem; color: var(--muted); }
.ad-op { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 6px; scroll-margin-top: 80px; }
.ad-op > summary { display: grid; grid-template-columns: 62px minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; }
.ad-op > summary::-webkit-details-marker { display: none; }
.ad-op > summary:focus-visible { outline: 2px solid var(--reef); outline-offset: -2px; border-radius: var(--radius); }
.ad-op[open] > summary { border-bottom: 1px solid var(--line); }
.ad-op.is-locked > summary { color: var(--muted); }
.ad-verb { font-family: var(--font-readout); font-weight: 700; font-size: .78rem; text-align: center; padding: 2px 0; border-radius: 4px; color: #fff; }
.ad-verb.is-get { background: var(--reef); }
.ad-verb.is-post { background: var(--kelp); }
.ad-verb.is-put, .ad-verb.is-patch { background: var(--buoy); }
.ad-verb.is-delete { background: var(--coral); }
.ad-op.is-locked .ad-verb { opacity: .55; }
.ad-path { font-size: .84rem; color: var(--ink); background: none; overflow-wrap: anywhere; }
.ad-sum { font-size: .9rem; }
.ad-state { font-size: .74rem; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.ad-state.is-ok { color: var(--kelp); background: color-mix(in srgb, var(--kelp) 10%, var(--surface)); }
.ad-state.is-no { color: var(--muted); border: 1px solid var(--line); }
.ad-body { padding: 10px 14px 14px; font-size: .9rem; }
.ad-body h3 { font-size: .82rem; font-weight: 600; color: var(--muted); margin: 12px 0 4px; }
.ad-rights p { margin: 0 0 4px; }
.ad-table { width: 100%; border-collapse: collapse; }
.ad-table td { padding: 4px 8px 4px 0; border-top: 1px solid var(--water); vertical-align: top; }
.ad-table td:first-child { width: 30%; }
.ad-table td:nth-child(2) { width: 15%; color: var(--muted); font-size: .82rem; }
.ad-code { background: #0e2430; color: #d9ecf2; border-radius: var(--radius); padding: 10px 12px; font-size: .8rem; margin: 0; overflow: auto; }
.ad-tree { list-style: none; margin: 0; padding-left: 14px; border-left: 1px solid var(--line); font-size: .85rem; }
.ad-body > .ad-tree { padding-left: 0; border-left: 0; }
.ad-tree span { color: var(--muted); font-size: .78rem; }
.ad-res { margin: 0 0 4px; }
.ad-code-chip { display: inline-block; min-width: 34px; text-align: center; font-family: var(--font-readout); font-weight: 600; font-size: .78rem; border-radius: 4px; padding: 0 4px; background: var(--water); color: var(--ink-soft); }
.ad-code-chip.is-ok { background: color-mix(in srgb, var(--kelp) 14%, var(--surface)); color: var(--kelp); }
.ad-errors { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.ad-muted { color: var(--muted); font-size: .88rem; }
.ad-none { color: var(--muted); }
.ad-generated { margin-top: 24px; font-size: .78rem; color: var(--muted); }

.ak-new { background: color-mix(in srgb, var(--kelp) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--kelp) 40%, var(--line)); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.ak-new h2 { font-size: 1.05rem; margin: 0 0 4px; }
.ak-new p { margin: 0 0 8px; font-size: .9rem; }
.ak-copy { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ak-copy code { flex: 1 1 320px; font-size: .9rem; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: 6px; padding: 8px 10px; overflow-wrap: anywhere; color: var(--ink); }
.ak-use { margin-top: 8px !important; color: var(--ink-soft); }
.ak-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ak-list, .ak-make { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.ak-list h2, .ak-make h2 { font-size: 1.05rem; margin: 0 0 10px; }
.ak-list ul { list-style: none; margin: 0; padding: 0; }
.ak-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--water); }
.ak-list li:first-child { border-top: 0; }
.ak-list small { display: block; color: var(--muted); }
.ak-list li.is-expired strong { color: var(--muted); text-decoration: line-through; }
.ak-make { display: grid; gap: 10px; }
.ak-make label { display: grid; gap: 4px; font-size: .85rem; color: var(--muted); margin: 0; }
.ak-make .btn { justify-self: start; }
a.ak-profile { text-decoration: none; color: var(--ink); }
a.ak-profile:hover { border-color: var(--reef); }

@media (max-width: 860px) {
  .ad-layout, .ak-layout { grid-template-columns: 1fr; }
  .ad-nav { position: static; max-height: none; }
  .ad-nav ul { display: flex; flex-wrap: wrap; gap: 4px; }
  .ad-op > summary { grid-template-columns: 56px minmax(0, 1fr); }
  .ad-sum, .ad-state { grid-column: 2; }
  .ad-state { justify-self: start; }
}

/* The SSI logbook (views/ssi/*.erb): the profile's connection card and a dive's state badge */
/* Profile → Verbände (views/associations/_panel.erb): a monogram per association, its state as
   a dot; connected ones as cards, the others to connect as <details> that open into the login */
.as-panel { display: grid; gap: 12px; max-width: 720px; }
.as-intro { margin: 0; color: var(--ink-soft); }
.as-heading { font-size: .95rem; font-weight: 600; margin: 12px 0 0; color: var(--ink); }
.as-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; }
.as-card.is-ok { border-left: 3px solid var(--kelp); }
.as-card.is-expired { border-left: 3px solid var(--coral); }
.as-card-head { display: flex; align-items: center; gap: 14px; }
.as-mono { flex: none; width: 48px; height: 48px; border-radius: var(--radius-sm); display: grid; place-items: center;
  background: var(--water); color: var(--reef); font-weight: 700; font-size: .85rem; letter-spacing: .04em; }
.as-title { flex: 1; min-width: 0; }
.as-title h3 { font-size: 1.05rem; margin: 0; }
.as-title p { margin: 0; color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.as-state { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; white-space: nowrap; }
.as-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.is-ok .as-state { color: var(--kelp); }
.is-ok .as-dot { background: var(--kelp); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kelp) 18%, transparent); }
.is-expired .as-state { color: var(--coral); }
.is-expired .as-dot { background: var(--coral); }
.as-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 16px; margin: 0;
  padding: 10px 12px; background: var(--water); border-radius: var(--radius-sm); }
.as-facts dt { font-size: .78rem; font-weight: 500; color: var(--muted); }
.as-facts dd { margin: 0; }
.as-about { margin: 0; font-size: .88rem; color: var(--ink-soft); }
.as-error { margin: 0; color: var(--coral); font-size: .9rem; }
.as-relogin { display: grid; gap: 4px; }
.as-relogin p { margin: 0; }
.as-login { display: grid; gap: 4px; max-width: 420px; }
.as-login .form-label { margin: 6px 0 0; }
.as-login .form-text { margin: 0; }
.as-login .btn { justify-self: start; margin-top: 8px; }
.as-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.as-actions form { margin: 0; }
.as-disconnect { color: var(--coral); }
.as-offer > summary { list-style: none; cursor: pointer; }
.as-offer > summary::-webkit-details-marker { display: none; }
.as-offer > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: var(--radius-sm); }
.as-offer[open] .as-open { display: none; }
.as-offer-body { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 480px) {
  .as-card-head { flex-wrap: wrap; }
  .as-state, .as-open { margin-left: 62px; }
}
.ssi-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 500; vertical-align: middle; }
.ssi-badge.is-synced { color: var(--kelp); background: color-mix(in srgb, var(--kelp) 10%, var(--surface)); }
.ssi-badge.is-pending { color: var(--muted); background: var(--water); }
.ssi-badge.is-error { color: var(--coral); background: color-mix(in srgb, var(--coral) 10%, var(--surface)); }

/* an item's NFC stickers (views/inventory/show.erb) */
.nfc-list { list-style: none; margin: 0 0 4px; padding: 0; display: grid; gap: 8px; }
.nfc-list li { display: grid; gap: 2px; }
.nfc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.nfc-rename { display: flex; gap: 6px; }
.nfc-rename input { width: 12rem; max-width: 100%; }
.nfc-cell .nfc-list { flex-basis: 100%; }

/* stickers to tick at handing out and taking back (views/inventory/_parts_check.erb) */
.parts-check { margin: 0 0 1rem; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.parts-check legend { float: none; width: auto; font-size: 1rem; font-weight: 600; margin: 0 0 2px; padding: 0 4px; }
.nfc-required { flex-basis: 100%; margin-top: 6px; }

/* the return basket (views/inventory/return_cart.erb) */
.rc { max-width: 760px; }
.rc-head h1 { font-size: 1.5rem; margin: 0; }
.rc-head p { color: var(--muted); }
.rc-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: 10px; }
.rc-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rc-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.rc-item-head small { display: block; color: var(--muted); }
.rc-condition { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.rc-condition select { width: auto; }
.rc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 1rem; }
.rc-form .sign { margin-top: 1rem; }
.rc-fab { position: fixed; right: 20px; bottom: 20px; z-index: 30; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.rc-signature { max-width: 280px; max-height: 110px; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }

/* note mode: paper clip, formatting and mic step aside, so the row is bolt, text, save. Its own
   columns (after .has-format), or the text slides into a narrow one */
.cc-compose.is-note,
.cc-compose.is-note.has-format { grid-template-columns: auto 1fr auto; }
.cc-compose.is-note .cc-send,
.cc-messages ~ .cc-compose.is-note .cc-send { background: var(--buoy); }
.cc-compose.is-note textarea { border: 1px solid color-mix(in srgb, var(--buoy) 70%, white); background: var(--surface); }
.cc-compose.is-note textarea:focus { border-color: var(--buoy); box-shadow: 0 0 0 3px color-mix(in srgb, var(--buoy) 22%, transparent); }
/* a note goes nowhere: warnings about the channel do not apply */
.cc-compose.is-note > p.text-danger:not(.cc-compose-error) { display: none; }
.cc-compose .cc-mention-list { box-shadow: 0 6px 20px rgba(18, 48, 63, .16); }

/* ---------- Ressourcenplaner (views/resources) ---------- */
.rp-head-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-back { margin: 6px 0 0; font-size: .9rem; }
.rp-back a { color: var(--ink-soft); text-decoration: none; }
.rp-back a:hover { color: var(--reef); }
.rp-cat { display: inline-block; font-size: .75rem; color: var(--muted); }
.rp-off { font-size: .75rem; color: var(--coral); font-weight: 600; }

/* waiting for an answer: the strip that asks to follow up */
.rp-waiting { margin-bottom: 18px; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--buoy) 60%, white); border-radius: 14px; background: color-mix(in srgb, var(--buoy) 5%, var(--surface)); }
.rp-waiting h2 { font-size: 1rem; margin: 0 0 8px; color: var(--ink); }
.rp-waiting h2 i { color: var(--buoy); }
.rp-waiting h2 small { font-family: var(--font-readout); color: var(--muted); margin-left: 4px; }
.rp-waiting ul { display: flex; gap: 8px; overflow-x: auto; margin: 0; padding: 0 0 4px; list-style: none; }
.rp-waiting a { display: grid; gap: 1px; min-width: 190px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); border-left: 4px solid var(--rp-color); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .85rem; }
.rp-waiting a:hover, .rp-waiting a:focus-visible { border-color: var(--buoy); border-left-color: var(--rp-color); }
.rp-waiting em { font-style: normal; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-waiting small { color: var(--muted); }

.rp-weeknav { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.rp-weeknav strong { font-family: var(--font-readout); font-size: 1.15rem; min-width: 15rem; text-align: center; }
.rp-today { font-size: .9rem; }

/* the week: resources down, days across */
.rp-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rp-board { min-width: 920px; }
.rp-row { display: grid; grid-template-columns: 13.5rem repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--water); }
.rp-row:first-child { border-top: 0; }
.rp-days { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--line); }
.rp-day { padding: 8px 10px; font-size: .85rem; color: var(--ink-soft); border-left: 1px solid var(--water); }
.rp-day strong { font-family: var(--font-readout); color: var(--ink); }
.rp-day.is-today { color: var(--reef); box-shadow: inset 0 -3px 0 var(--reef); }
.rp-day.is-today strong { color: var(--reef); }
.rp-day.is-past { opacity: .6; }
.rp-res { display: grid; align-content: start; gap: 2px; padding: 10px 12px; border-left: 5px solid var(--rp-color); }
.rp-res strong { line-height: 1.2; }
.rp-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .75rem; color: var(--muted); }
.rp-cell { position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 74px; padding: 6px 6px 26px; border-left: 1px solid var(--water); }
.rp-cell.is-today { background: color-mix(in srgb, var(--reef) 4%, var(--surface)); }
.rp-cell.is-past { background: color-mix(in srgb, var(--water) 50%, var(--surface)); }
.rp-cell.is-closed { background: repeating-linear-gradient(-45deg, var(--surface) 0 7px, var(--water) 7px 9px); }
.rp-closed { font-size: .75rem; color: var(--muted); align-self: center; margin-top: 18px; }
.rp-window { font-size: .72rem; color: var(--kelp); font-family: var(--font-readout); }
.rp-chip { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 4px; padding: 4px 7px; border-radius: 7px; text-decoration: none; font-size: .78rem; line-height: 1.25; color: var(--ink); }
.rp-chip-time { grid-column: 1; font-family: var(--font-readout); font-weight: 600; }
.rp-chip-title { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.rp-chip i { grid-column: 2; grid-row: 1 / span 2; color: var(--buoy); font-size: .75rem; }
.rp-chip.is-confirmed { background: color-mix(in srgb, var(--rp-color, var(--kelp)) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--rp-color, var(--kelp)) 45%, white); }
.rp-chip.is-requested { background: var(--surface); border: 1px dashed var(--buoy); }
.rp-chip:hover, .rp-chip:focus-visible { outline: 2px solid var(--reef); outline-offset: 1px; }
.rp-add { position: absolute; right: 6px; bottom: 4px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .12s; }
.rp-cell:hover .rp-add, .rp-add:focus-visible { opacity: 1; }
.rp-add:hover { background: var(--water); color: var(--reef); }
@media (hover: none) { .rp-add { opacity: .7; } }
.rp-legend { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 24px; font-size: .8rem; color: var(--muted); }
.rp-legend .rp-chip { display: inline-flex; gap: 6px; --rp-color: var(--kelp); }
.rp-closed-sample { padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line); background: repeating-linear-gradient(-45deg, var(--surface) 0 7px, var(--water) 7px 9px); }

/* reserving */
.rp-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 30px; }
.rp-form-main { display: grid; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.rp-when { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; }
.rp-days summary { font-size: .85rem; color: var(--reef); cursor: pointer; }
.rp-days[open] summary { margin-bottom: 6px; }
.rp-qty { max-width: 8rem; }
.rp-checks { display: grid; gap: 6px; }
.rp-force { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--buoy) 10%, var(--surface)); }
.rp-form-actions { display: flex; gap: 10px; }
.rp-info { position: sticky; top: 80px; padding: 16px 18px; border-radius: 16px; background: color-mix(in srgb, var(--reef) 6%, var(--surface)); border: 1px solid color-mix(in srgb, var(--reef) 25%, white); font-size: .9rem; }
.rp-info h2 { font-size: 1rem; margin: 0 0 8px; }
.rp-info h3 { font-size: .85rem; margin: 10px 0 4px; color: var(--muted); }
.rp-info p { margin: 0 0 6px; }
.rp-info-how { font-weight: 600; }
.rp-info-how i { color: var(--reef); }
.rp-info-outcome, .rp-info-lead { color: var(--ink-soft); }
.rp-info-lead { color: var(--buoy); font-weight: 600; }
.rp-info-times { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.rp-info-times li { display: grid; grid-template-columns: 6.5rem 1fr; padding: 2px 6px; border-radius: 6px; }
.rp-info-times li.is-closed { color: var(--muted); }
.rp-info-times li.is-closed strong { font-weight: 400; }
.rp-info-contact { margin-top: 10px !important; }
.rp-info-times li.is-picked { background: var(--surface); box-shadow: inset 3px 0 0 var(--reef); }
.rp-info-text { white-space: pre-line; color: var(--ink-soft); }
@media (max-width: 860px) {
  .rp-form { grid-template-columns: 1fr; }
  .rp-info { position: static; order: -1; }
}
@media (max-width: 520px) { .rp-when { grid-template-columns: 1fr 1fr; } .rp-when label:first-child { grid-column: 1 / -1; } }

/* one reservation */
.rp-detail-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 10px 0 18px; padding-left: 14px; border-left: 6px solid var(--rp-color); }
.rp-detail-head h1 { margin: 0; font-size: 1.7rem; }
.rp-detail-res { margin: 0; color: var(--ink-soft); font-weight: 600; }
.rp-detail-title { margin: 2px 0 0; color: var(--ink-soft); }
.rp-status { padding: 4px 14px; border-radius: 999px; font-weight: 700; font-family: var(--font-readout); font-size: 1rem; border: 1px solid; }
.rp-status.is-requested { color: var(--buoy); border-color: var(--buoy); border-style: dashed; }
.rp-status.is-confirmed { color: #fff; background: var(--kelp); border-color: var(--kelp); }
.rp-status.is-declined { color: var(--coral); border-color: var(--coral); }
.rp-status.is-cancelled { color: var(--muted); border-color: var(--line-strong); text-decoration: line-through; }
.rp-detail { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 30px; }
@media (max-width: 900px) { .rp-detail { grid-template-columns: 1fr; } .rp-side { order: -1; } }
.rp-history h2, .rp-card h2 { font-size: 1.05rem; margin: 0 0 10px; }
.rp-timeline { margin: 0 0 14px; padding: 0; list-style: none; }
.rp-timeline li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.rp-timeline li:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; border-left: 2px solid var(--line); }
.rp-tl-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); font-size: .85rem; }
.rp-timeline .is-reply .rp-tl-icon { background: var(--reef); border-color: var(--reef); color: #fff; }
.rp-timeline .is-decision .rp-tl-icon { background: var(--kelp); border-color: var(--kelp); color: #fff; }
.rp-timeline .is-note .rp-tl-icon { color: var(--buoy); border-color: color-mix(in srgb, var(--buoy) 60%, white); }
.rp-tl-body { min-width: 0; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rp-timeline .is-reply .rp-tl-body { border-color: color-mix(in srgb, var(--reef) 45%, white); }
.rp-timeline .is-note .rp-tl-body { background: color-mix(in srgb, var(--buoy) 5%, var(--surface)); border-style: dashed; border-color: color-mix(in srgb, var(--buoy) 50%, white); }
.rp-tl-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; margin: 0; font-size: .85rem; }
.rp-tl-head span { color: var(--ink-soft); }
.rp-tl-head time { margin-left: auto; color: var(--muted); font-size: .78rem; }
.rp-tl-subject { margin: 2px 0 0; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.rp-tl-body details summary { margin-top: 4px; font-size: .85rem; color: var(--ink-soft); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-tl-text { margin-top: 6px; font-size: .9rem; overflow-wrap: anywhere; }
.rp-tl-link { display: inline-block; margin-top: 6px; font-size: .82rem; }
.rp-note { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
@media (max-width: 520px) { .rp-note { grid-template-columns: 1fr; } }
.rp-side { display: grid; gap: 14px; }
.rp-card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rp-card p { margin: 0 0 6px; }
.rp-card-note { font-size: .82rem; color: var(--muted); }
.rp-actions { display: grid; gap: 14px; }
.rp-decide { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--water); }
.rp-decide h2 { margin: 0; }
.rp-decide-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-cancel summary { color: var(--coral); cursor: pointer; font-size: .9rem; }
.rp-cancel form { display: grid; gap: 8px; margin-top: 8px; }
.rp-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .9rem; }
.rp-facts dt { color: var(--muted); font-weight: 500; }
.rp-facts dd { margin: 0; }
.rp-notes { margin-top: 10px !important; padding: 8px 10px; border-radius: 8px; background: var(--water); font-size: .88rem; white-space: pre-line; }
.rp-notes i { color: var(--muted); }
.rp-contact a { text-decoration: none; }
.rp-delete { text-align: right; }

/* setting up */
.rp-manage { display: grid; gap: 8px; margin: 0 0 30px; padding: 0; list-style: none; }
.rp-manage li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-left: 5px solid var(--rp-color); border-radius: 12px; background: var(--surface); }
.rp-manage li.is-off { opacity: .65; }
.rp-manage-main { flex: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; color: var(--ink); text-decoration: none; min-width: 0; }
.rp-manage-main:hover strong { color: var(--reef); }
.rp-manage-facts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .85rem; color: var(--ink-soft); }
.rp-manage-facts i { color: var(--muted); width: 1em; }
.rp-manage-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px 10px 0; }
.rp-manage-tools form { margin: 0; }
@media (max-width: 640px) { .rp-manage li { flex-wrap: wrap; } .rp-manage-tools { padding: 0 12px 12px; } }
/* what kind of resource: who sees it, free to book, price, made for a meetup */
.rp-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.rp-tag { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--water); color: var(--ink-soft); white-space: nowrap; }
.rp-tag.is-private { background: color-mix(in srgb, var(--ink) 8%, var(--surface)); }
.rp-tag.is-customers { background: color-mix(in srgb, var(--reef) 12%, var(--surface)); color: var(--reef); }
.rp-tag.is-free { background: color-mix(in srgb, var(--kelp) 12%, var(--surface)); color: var(--kelp); }
.rp-tag.is-temp { background: color-mix(in srgb, var(--buoy) 12%, var(--surface)); color: #a8460f; }
/* a row of tabs that filter a list, each with its count */
.rp-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 14px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.rp-tabs a { padding: 6px 14px; border-radius: 9px; color: var(--ink-soft); font-weight: 600; font-size: .9rem; text-decoration: none; }
.rp-tabs a span { font-family: var(--font-readout); color: var(--muted); font-weight: 500; margin-left: 2px; }
.rp-tabs a[aria-current] { background: var(--water); color: var(--ink); }
.rp-tabs a:focus-visible { outline: 2px solid var(--reef); outline-offset: 1px; }
.rp-setup { display: grid; gap: 16px; max-width: 920px; margin-bottom: 30px; }
.rp-section { padding: 18px 24px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rp-section > h2 { margin: 0 0 10px; font-size: 1.25rem; }
.rp-section[hidden] { display: none; }
.rp-section > .ss-row:last-child { padding-bottom: 8px; }
.rp-num { width: 6.5rem; flex: 0 0 auto; }
.rp-inline-label { margin: 0 0 0 10px; color: var(--ink-soft); font-size: .92rem; }
.rp-name .rp-swatch { flex: 0 0 auto; width: 42px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.rp-site { flex: 0 1 15rem; }
.rp-template-link { margin: 4px 0 10px; }
/* saving stays in reach on the long form */
.rp-setup .rp-form-actions {
    position: sticky; bottom: 0; z-index: 5; justify-content: flex-end; padding: 12px 0;
    background: linear-gradient(to top, var(--water) 70%, transparent);
}
.rp-grid { clear: both; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.rp-grid[hidden] { display: none; }
.rp-wide { grid-column: 1 / -1; }
@media (max-width: 640px) { .rp-grid { grid-template-columns: 1fr; } }
.rp-segment { clear: both; display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 12px; background: var(--water); }
.rp-segment label { margin: 0; cursor: pointer; }
.ss-row > .rp-segment { margin: 0; justify-self: start; }
.rp-self-note { margin: -4px 0 0; padding: 10px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--kelp) 10%, var(--surface)); color: var(--kelp); font-size: .92rem; }
.rp-self-note[hidden] { display: none; }
.rp-segment input { position: absolute; opacity: 0; pointer-events: none; }
.rp-segment span { display: block; padding: 6px 14px; border-radius: 9px; color: var(--ink-soft); font-weight: 600; font-size: .9rem; }
.rp-segment input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(18, 48, 63, .15); }
.rp-segment input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 1px; }
.rp-windows[hidden] { display: none; }
.rp-windows { display: grid; gap: 6px; justify-items: start; margin-bottom: 14px; }
.rp-windows [data-rp-window-list] { display: grid; gap: 6px; width: 100%; }
/* one grid for the heads and every row, so the columns line up */
.rp-window-head, .rp-window-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) minmax(0, 1.5fr) 2.4rem; gap: 8px; align-items: center; width: 100%; }
.rp-window-head { padding: 0 2px; font-size: .8rem; color: var(--muted); }
.rp-span { display: flex; align-items: center; gap: 4px; min-width: 0; }
.rp-span .form-control { min-width: 0; }
.rp-span > span { color: var(--muted); }
@media (max-width: 760px) {
    .rp-window-head { display: none; }
    .rp-window-row { grid-template-columns: minmax(0, 1fr) 2.4rem; padding: 8px 0; border-top: 1px solid var(--water); }
    .rp-window-row > select, .rp-window-row > .rp-span { grid-column: 1; }
    .rp-window-row > button { grid-column: 2; grid-row: 1; }
}

/* the page behind the answer link */
.rp-answer { max-width: 520px; margin: 40px auto; padding: 28px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.rp-answer-school { margin: 0; color: var(--reef); font-weight: 700; }
.rp-answer h1 { margin: 2px 0 18px; }
.rp-answer-facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 20px; padding: 14px 16px; border-radius: 12px; background: var(--water); }
.rp-answer-facts dt { color: var(--muted); font-weight: 500; }
.rp-answer-facts dd { margin: 0; font-weight: 600; }
.rp-answer-form { display: grid; gap: 12px; }
.rp-answer-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rp-answer-buttons.picked-decline .btn-success { order: 2; }
.rp-answer-state { padding: 14px 16px; border-radius: 12px; background: var(--water); font-weight: 600; }
.rp-answer-state.is-confirmed { background: color-mix(in srgb, var(--kelp) 12%, var(--surface)); color: var(--kelp); }
.rp-answer-state.is-declined { background: color-mix(in srgb, var(--coral) 10%, var(--surface)); color: var(--coral); }
/* reservation rules: checked top down */
.rp-default-help { clear: both; margin: -4px 0 14px; }
.rp-rules { display: grid; gap: 8px; justify-items: start; margin: 4px 0 14px; padding-top: 12px; border-top: 1px solid var(--water); }
.rp-rules h3, .rp-sub { font-size: 1rem; margin: 0; font-family: var(--font-readout); }
.rp-rules > .fs-help { margin: -4px 0 2px; max-width: 70ch; }
.rp-sub { margin: 4px 0 10px; }
.rp-rules [data-rp-rule-list] { display: grid; gap: 8px; width: 100%; counter-reset: rule; }
.rp-rule { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: start; padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); counter-increment: rule; }
.rp-rule-order { display: grid; justify-items: center; }
.rp-rule-order::before { content: counter(rule); font-family: var(--font-readout); font-weight: 700; color: var(--reef); }
.rp-rule-order .btn { padding: 0 6px; color: var(--muted); }
.rp-rule:first-child [data-rp-rule-up], .rp-rule:last-child [data-rp-rule-down] { visibility: hidden; }
.rp-rule-fields { display: grid; gap: 8px; min-width: 0; }
/* a rule reads as a sentence: Vorlauf ab 0 bis unter 48 Std., ab 1 Plätzen, dann … */
.rp-rule-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--ink-soft); font-size: .92rem; }
.rp-rule-line .rp-num { width: 4.2rem; }
.rp-chunk { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.ss-inline > .rp-num { flex: 0 0 6.5rem; }
.rp-rule-term { color: var(--ink); font-weight: 500; }
.rp-rule-then { display: flex; align-items: center; gap: 8px; margin: 0 0 0 auto; }
.rp-rule-then .form-select { width: auto; min-width: 11rem; }
.rp-rule-days { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 0; }
.rp-rule-days legend { float: left; width: auto; margin: 0 8px 0 0; font-size: .85rem; color: var(--muted); }
.rp-rule-days legend small { font-size: .75rem; }
.rp-rule-days label { margin: 0; cursor: pointer; }
.rp-rule-days input { position: absolute; opacity: 0; pointer-events: none; }
.rp-rule-days span { display: inline-block; min-width: 2.2rem; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); text-align: center; font-size: .85rem; color: var(--ink-soft); }
.rp-rule-days input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.rp-rule-days input:focus-visible + span { outline: 2px solid var(--reef); outline-offset: 1px; }
.rp-rule-note { flex: 1 1 14rem; margin: 0; }
.rp-rule-dead { margin: 0; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--buoy) 12%, var(--surface)); color: #8a3a0c; font-size: .85rem; }
.rp-rule-dead[hidden] { display: none; }
@media (max-width: 760px) { .rp-rule-then { margin-left: 0; } }
.rp-way { padding: 10px 12px; border-radius: 10px; background: var(--surface); border-left: 4px solid var(--reef); }
.rp-way.is-blocked { border-left-color: var(--coral); color: var(--coral); }
.rp-way strong { display: block; }
.rp-rule-list { margin: 0 0 6px; padding-left: 1.2rem; }
.rp-rule-list li { margin-bottom: 2px; }
.rp-rule-list li.is-hit { font-weight: 600; }

/* the lead-time ruler (public/js/resource-ruler.js): one colour per way of reserving */
:root {
  --way-none: var(--kelp);
  --way-email: var(--reef);
  --way-phone: #2f5d9e;
  --way-website: #8a6d1a;
  --way-other: #5f6f78;
  --way-blocked: var(--coral);
}
.rp-ruler { position: relative; padding-top: 2px; }
.rp-ruler.has-mark { padding-top: 30px; }
.rp-ruler-bar { position: relative; height: 46px; border-radius: 10px; overflow: hidden; background: var(--water); }
.rp-seg { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 0 8px;
  border-right: 2px solid var(--surface); color: #fff; overflow: hidden; white-space: nowrap; --c: var(--way-other); background: var(--c); }
.rp-seg:last-child { border-right: 0; }
.rp-seg strong { font-family: var(--font-readout); font-size: .92rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; }
.rp-seg span { font-size: .72rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; }
.rp-seg span:empty { display: none; }
.rp-seg.is-none { --c: var(--way-none); }
.rp-seg.is-email { --c: var(--way-email); }
.rp-seg.is-phone { --c: var(--way-phone); }
.rp-seg.is-website { --c: var(--way-website); }
.rp-seg.is-other { --c: var(--way-other); }
.rp-seg.is-blocked { background: repeating-linear-gradient(-45deg, var(--way-blocked) 0 6px, color-mix(in srgb, var(--way-blocked) 78%, black) 6px 12px); }
.rp-ruler-scale { position: relative; height: 20px; margin-top: 4px; font-family: var(--font-readout); font-size: .78rem; color: var(--muted); }
.rp-ruler-scale span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.rp-ruler-scale span:first-child { transform: none; }
.rp-ruler-scale span.is-end { right: 0; transform: none; }
.rp-ruler-mark { position: absolute; top: 0; bottom: 22px; width: 0; border-left: 2px solid var(--ink); z-index: 1; }
.rp-ruler-mark span { position: absolute; top: 0; left: 0; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: var(--ink);
  color: #fff; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.rp-ruler-mark.is-start span { transform: none; }
.rp-ruler-mark.is-end span { transform: translateX(-100%); }
.rp-ruler-special { display: grid; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; font-size: .82rem; color: var(--ink-soft); }
.rp-ruler-special li { display: flex; align-items: center; gap: 6px; }
.rp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--way-other); flex: none; }
.rp-dot.is-none { background: var(--way-none); } .rp-dot.is-email { background: var(--way-email); } .rp-dot.is-phone { background: var(--way-phone); }
.rp-dot.is-website { background: var(--way-website); } .rp-dot.is-blocked { background: var(--way-blocked); }
.rp-ruler-box { margin: 0 0 14px; padding: 12px 14px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.rp-ruler-box h3 { margin: 0 0 8px; font-size: .9rem; font-family: var(--font-readout); color: var(--ink); }
/* setting up: the ruler is the head of its section, no box of its own */
.rp-setup .rp-ruler-box { margin: 0 0 6px; padding: 0; border: 0; }
.rp-mini .rp-ruler-bar { height: 22px; border-radius: 6px; }
.rp-mini .rp-seg { padding: 0 5px; }
.rp-mini .rp-seg strong { font-size: .72rem; }
.rp-mini .rp-seg span, .rp-mini .rp-ruler-scale, .rp-mini .rp-ruler-special { display: none; }
@media (prefers-reduced-motion: no-preference) { .rp-seg { transition: left .25s ease, width .25s ease; } }
.rp-wide-box { width: 100%; }
.rp-rule { border-left: 4px solid var(--way-other); }
.rp-rule.is-none { border-left-color: var(--way-none); } .rp-rule.is-email { border-left-color: var(--way-email); }
.rp-rule.is-phone { border-left-color: var(--way-phone); } .rp-rule.is-website { border-left-color: var(--way-website); }
.rp-rule.is-blocked { border-left-color: var(--way-blocked); }
/* the next step on a reservation: what to do now, by way and state */
.rp-next { display: grid; gap: 10px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--way-other); }
.rp-next.is-email_send, .rp-next.is-email_waiting { border-top-color: var(--way-email); }
.rp-next.is-phone { border-top-color: var(--way-phone); }
.rp-next.is-website { border-top-color: var(--way-website); }
.rp-next.is-confirmed { border-top-color: var(--kelp); background: color-mix(in srgb, var(--kelp) 6%, var(--surface)); }
.rp-next.is-declined { border-top-color: var(--coral); }
.rp-next-kicker { margin: 0; font-size: .8rem; color: var(--muted); }
.rp-next h2 { margin: -6px 0 0; font-size: 1.35rem; }
.rp-next-text { margin: 0; color: var(--ink-soft); }
.rp-next-hint { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--water); font-size: .9rem; }
.rp-next-hint i { color: var(--reef); }
.rp-next .rp-decide { padding-top: 10px; border-top: 1px solid var(--water); }
.rp-decide-q { margin: 0; font-weight: 600; }
.rp-next-more { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 6px; padding-top: 6px; border-top: 1px solid var(--water); }
.rp-next-more .btn-link { padding-left: 0; text-decoration: none; }
.rp-next-more .rp-cancel { flex: 1 1 100%; }
.rp-next-more .rp-cancel:not([open]) { flex: 0 1 auto; align-self: center; }
.rp-manage .rp-mini { flex-basis: 100%; margin-top: 4px; }
/* the day strip in a planner cell: open time light, taken time in the resource's colour */
.rp-strip { position: relative; display: block; height: 6px; margin: 2px 0 4px; border-radius: 3px; background: color-mix(in srgb, var(--line) 55%, var(--surface)); overflow: hidden; }
.rp-strip i { position: absolute; top: 0; bottom: 0; }
.rp-strip .is-open { background: color-mix(in srgb, var(--kelp) 22%, var(--surface)); }
.rp-strip .is-confirmed { background: var(--rp-color, var(--kelp)); }
.rp-strip .is-requested { background: repeating-linear-gradient(-45deg, var(--buoy) 0 3px, color-mix(in srgb, var(--buoy) 40%, white) 3px 6px); }
.rp-res .rp-mini { margin-top: 6px; }
.rp-res .rp-mini .rp-seg strong { font-size: .66rem; }

/* Impressum and Datenschutz editor (views/admin/legal_text.erb): the canvas and the preview read
   like the public page, not like an e-mail */
.lt .lt-canvas { max-width: none; font-family: inherit; color: var(--ink); line-height: 1.65; }
.lt .lt-canvas h2, .lt .lt-preview h2 { font-family: inherit; }
.lt .lt-canvas h2:first-child { margin-top: 0; }
.lt .lt-preview { max-width: none; max-height: 560px; overflow: auto; padding: 18px 22px; }
.lt .et-preview-head a { font-size: .88rem; }
.lt .et-preview > .et-docs-lead { margin: 0; padding: 8px 12px 0; }
.lt-note { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--reef); background: var(--water); border-radius: 0 var(--radius) var(--radius) 0; }
.lt-note i { color: var(--reef); margin-right: 4px; }
.lt-small-icon { font-size: .75em; }
.lt .legal-text h2, .lt .legal-text h3 { overflow-wrap: anywhere; hyphens: auto; }

/* ---------- Meetups (Verabredungen; views/meetups): the times as columns, everyone's answer as rows ---------- */
.mt-head { align-items: flex-start; }
.mt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 6px 0 0; color: var(--ink-soft); font-size: .92rem; }
.mt-meta i { color: var(--muted); }
.mt-state { display: inline-block; padding: 1px 10px; border-radius: 999px; font-family: var(--font-readout); font-size: .9rem; background: var(--water); color: var(--ink-soft); white-space: nowrap; }
.mt-state.is-open { background: color-mix(in srgb, var(--buoy) 13%, white); color: #a8460f; }
.mt-state.is-fixed { background: color-mix(in srgb, var(--kelp) 12%, white); color: var(--kelp); }
.mt-state.is-cancelled { background: color-mix(in srgb, var(--coral) 10%, white); color: var(--coral); }
.mt-about { max-width: 70ch; color: var(--ink-soft); white-space: pre-line; }

.mt-board { margin: 6px 0 22px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.mt-board-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; margin-bottom: 10px; }
.mt-board-head h2 { margin: 0; font-size: 1.25rem; }
.mt-board-head p { margin: 0; color: var(--muted); font-family: var(--font-readout); }
.mt-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.mt-table { border-collapse: separate; border-spacing: 6px 4px; min-width: 100%; }
.mt-table th, .mt-table td { text-align: center; vertical-align: middle; }
/* the column of names stays in view while the times scroll */
.mt-table tr > :first-child { position: sticky; left: 0; z-index: 1; width: 1%; white-space: nowrap; background: var(--surface); text-align: left; min-width: 9rem; padding-right: 14px; font-weight: 500; }
.mt-table tr > :first-child small { color: var(--muted); font-weight: 400; }
.mt-table thead th:not(:first-child) { position: relative; min-width: 7.5rem; padding: 8px 10px; border-radius: 10px 10px 0 0; background: var(--water); }
.mt-day { display: block; font-family: var(--font-readout); font-weight: 600; color: var(--ink); }
.mt-time { display: block; font-family: var(--font-readout); color: var(--ink-soft); font-size: .9rem; }
.mt-by { display: block; font-size: .72rem; color: var(--reef); }
.mt-remove { position: absolute; top: 0; right: 0; margin: 0; }
.mt-remove .btn { padding: 0 6px; color: var(--muted); }
.mt-table td { height: 2.6rem; border-radius: 8px; background: color-mix(in srgb, var(--water) 45%, var(--surface)); }
.mt-table td.is-yes { background: color-mix(in srgb, var(--kelp) 14%, var(--surface)); color: var(--kelp); }
.mt-table td.is-no { background: color-mix(in srgb, var(--coral) 9%, var(--surface)); color: var(--coral); }
.mt-table tr.is-me th { color: var(--reef); }
.mt-mark { font-size: 1rem; color: inherit; }
td .mt-mark:only-child { opacity: .9; }
/* the most yes: the column stands out until a time is fixed */
.mt-table .is-best { box-shadow: inset 0 0 0 2px var(--kelp); }
.mt-table thead th.is-best { background: color-mix(in srgb, var(--kelp) 16%, var(--surface)); }
.mt-table .is-fixed { box-shadow: inset 0 0 0 2px var(--reef); }
.mt-table thead th.is-fixed { background: color-mix(in srgb, var(--reef) 16%, var(--surface)); }
.mt-table tfoot td { height: auto; padding: 8px 6px; border-radius: 0 0 10px 10px; background: var(--water); }
.mt-table tfoot td strong { display: block; font-family: var(--font-readout); font-size: 1.05rem; margin-bottom: 4px; }
.mt-table tfoot form { margin: 0; }
.mt-fixed-label { font-size: .8rem; color: var(--reef); font-weight: 600; }
.mt-vote { display: inline-flex; gap: 4px; }
.mt-vote form { margin: 0; }
.mt-vote-btn { width: 2.1rem; height: 2.1rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.mt-vote-btn:hover { border-color: var(--ink-soft); color: var(--ink); }
.mt-vote-btn.is-yes[aria-pressed=true] { background: var(--kelp); border-color: var(--kelp); color: #fff; }
.mt-vote-btn.is-no[aria-pressed=true] { background: var(--coral); border-color: var(--coral); color: #fff; }
.mt-vote-btn:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { .mt-vote-btn { transition: background-color .12s, border-color .12s; } }
.mt-propose { margin-top: 12px; }
.mt-propose summary { display: inline-block; cursor: pointer; color: var(--reef); font-weight: 600; }
.mt-propose-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 10px; }

.mt-res { margin-bottom: 22px; }
.mt-res h2 { font-size: 1.1rem; }
.mt-res ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.mt-res li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; border: 1px solid var(--line); border-left: 5px solid var(--rp-color); border-radius: 10px; background: var(--surface); }
.mt-res li small { flex-basis: 100%; color: var(--muted); }
.mt-foot { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); margin-bottom: 30px; }
.mt-foot form { margin: 0; }
.mt-cancel summary { list-style: none; }
.mt-cancel form { display: flex; align-items: flex-end; gap: 8px; margin-top: 6px; }

.mt-list { display: grid; gap: 8px; margin: 0 0 30px; padding: 0; list-style: none; }
.mt-list a { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; }
.mt-list a:hover, .mt-list a:focus-visible { border-color: var(--reef); }
.mt-list .is-cancelled a { opacity: .6; }
.mt-list-when { display: grid; justify-items: center; padding: 6px 0; border-radius: 10px; background: var(--water); line-height: 1.1; }
.mt-list-when strong { font-family: var(--font-readout); font-size: 1.25rem; }
.mt-list-when small { font-size: .72rem; color: var(--muted); }
.mt-list-main { display: grid; min-width: 0; }
.mt-list-main > span { color: var(--ink-soft); font-size: .88rem; }
@media (max-width: 560px) { .mt-list a { grid-template-columns: 3.6rem minmax(0, 1fr); } .mt-list a > .mt-state { grid-column: 2; justify-self: start; } }

/* the form: rows of times, resources, temporary resources */
.mt-rows { display: grid; gap: 6px; margin-bottom: 8px; }
.mt-option-row { display: grid; grid-template-columns: 11rem minmax(0, 16rem) 2.4rem; gap: 8px; align-items: center; }
.mt-res-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 2.4rem; gap: 8px; align-items: center; }
.mt-temp-row { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto 2.4rem; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--water); }
.mt-temp-row .mt-temp-note { grid-column: 1 / 4; }
.mt-temp-price { display: flex; align-items: center; gap: 6px; }
.mt-temp-price .form-select { width: auto; }
.mt-sub-gap { margin-top: 16px; }
.mt-people { display: grid; gap: 6px; }
.mt-people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 2px 12px; max-height: 15rem; overflow-y: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.mt-people-list label { margin: 0; font-size: .92rem; cursor: pointer; }
.mt-people-list label[hidden] { display: none; }
.mt-people-list small { color: var(--muted); }
@media (max-width: 640px) {
    .mt-option-row { grid-template-columns: minmax(0, 1fr) 2.4rem; }
    .mt-option-row > .rp-span { grid-column: 1; }
    .mt-option-row > button { grid-row: 1; grid-column: 2; }
    .mt-temp-row { grid-template-columns: minmax(0, 1fr) auto; }
    .mt-temp-row .mt-temp-note, .mt-temp-row .mt-temp-price { grid-column: 1 / -1; }
}

/* ---------- Booking free resources oneself (views/resources/book.erb) ---------- */
.bk { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 24px; }
.bk-list { display: grid; gap: 6px; }
.bk-item { display: grid; gap: 1px; padding: 10px 12px; border: 1px solid var(--line); border-left: 5px solid var(--rp-color); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .88rem; }
.bk-item strong { font-size: 1rem; }
.bk-item span { color: var(--ink-soft); }
.bk-item[aria-current] { border-color: var(--rp-color); box-shadow: inset 0 0 0 1px var(--rp-color); }
.bk-price { font-family: var(--font-readout); }
.bk-form { border-top: 5px solid var(--rp-color); display: grid; gap: 12px; }
.bk-form h2 { margin: 0; }
.bk-about { margin: -6px 0 0; color: var(--ink-soft); }
.bk-when { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: 10px; }
.bk-cost { margin: 0; font-family: var(--font-readout); font-size: 1.05rem; }
.bk-form .rp-form-actions { position: static; background: none; padding: 4px 0 8px; }
.bk-mine h2 { font-size: 1.2rem; }
.bk-bookings { display: grid; gap: 6px; margin: 0 0 30px; padding: 0; list-style: none; }
.bk-bookings li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 14px; border: 1px solid var(--line); border-left: 5px solid var(--rp-color); border-radius: 10px; background: var(--surface); }
.bk-bookings li > div { flex: 1 1 16rem; display: grid; }
.bk-bookings li > div span { color: var(--ink-soft); font-size: .9rem; }
.bk-bookings li.is-past { opacity: .6; }
.bk-bookings form { margin: 0; }
.bk-amount { font-family: var(--font-readout); font-weight: 600; }
.bk-amount small { font-weight: 400; color: var(--muted); }
.bk-amount.is-paid small { color: var(--kelp); }
@media (max-width: 760px) { .bk { grid-template-columns: 1fr; } }

/* ---------- Amounts for priced resources (views/resources/charges.erb) ---------- */
.ch-total { margin: 0; text-align: right; display: grid; }
.ch-total small { color: var(--muted); }
.ch-total strong { font-family: var(--font-readout); font-size: 1.6rem; }
.ch-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ch-table td:first-child { border-left: 5px solid var(--rp-color); }
.ch-table td small { color: var(--muted); }
.ch-amount { font-family: var(--font-readout); font-size: 1.05rem; white-space: nowrap; }
.ch-tools { white-space: nowrap; text-align: right; }
.ch-tools form { display: inline-block; margin: 0 0 0 4px; }

/* ---------- Abrechnung (views/billing): the charges of every area ---------- */
.bl-sums { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 8px; margin: 0 0 14px; }
.bl-sum { display: grid; gap: 1px; padding: 10px 14px; border: 1px solid var(--line); border-top: 4px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; }
.bl-sum small { color: var(--muted); }
.bl-sum strong { font-family: var(--font-readout); font-size: 1.35rem; line-height: 1.2; }
.bl-sum span { font-size: .8rem; color: var(--ink-soft); }
.bl-sum.is-open { border-top-color: var(--buoy); }
.bl-sum.is-paid { border-top-color: var(--kelp); }
.bl-sum.is-waived { border-top-color: var(--muted); }
.bl-sum.is-cancelled { border-top-color: var(--coral); }
.bl-sum[aria-current] { box-shadow: inset 0 0 0 2px var(--reef); }
.bl-sum:focus-visible { outline: 2px solid var(--reef); outline-offset: 2px; }
.bl-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 0 0 14px; }
.bl-filter .bl-q { flex: 1 1 14rem; }
.bl-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.bl-table { margin: 0; }
.bl-table th { font-size: .85rem; color: var(--muted); font-weight: 500; white-space: nowrap; }
.bl-table td { vertical-align: middle; }
.bl-table tr.is-cancelled td { color: var(--muted); }
.bl-check { width: 2.2rem; }
.bl-date { white-space: nowrap; font-family: var(--font-readout); }
.bl-area { display: block; color: var(--muted); }
.bl-amount { font-family: var(--font-readout); font-size: 1.05rem; white-space: nowrap; }
.bl-when { display: block; color: var(--muted); font-size: .78rem; }
.bl-state { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; background: var(--water); color: var(--ink-soft); white-space: nowrap; }
.bl-state.is-open { background: color-mix(in srgb, var(--buoy) 13%, white); color: #a8460f; }
.bl-state.is-paid { background: color-mix(in srgb, var(--kelp) 12%, white); color: var(--kelp); }
.bl-state.is-cancelled { background: color-mix(in srgb, var(--coral) 10%, white); color: var(--coral); }
/* the chosen ones: how many, how much, what to do */
.bl-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 14px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.bl-bar[hidden] { display: none; }
.bl-bar > span { margin-right: auto; }
.bl-bar .form-select { width: auto; }
.bl-bar .btn-outline-secondary { color: #fff; border-color: rgba(255, 255, 255, .5); }
.bl-detail { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.bl-big { margin: 0 0 8px; font-family: var(--font-readout); font-size: 2rem; font-weight: 600; }
.bl-settle { display: grid; gap: 10px; align-content: start; }
.bl-settle h2 { margin: 0; font-size: 1.1rem; }
@media (max-width: 760px) { .bl-detail { grid-template-columns: 1fr; } }
/* one's own charges (views/billing/mine.erb) */
.bl-mine { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.bl-mine li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto auto; align-items: center; gap: 4px 14px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.bl-mine li > i { color: var(--muted); }
.bl-mine li > div { display: grid; min-width: 0; }
.bl-mine li > div span { color: var(--ink-soft); font-size: .88rem; }
.bl-mine li.is-open { border-left: 4px solid var(--buoy); }
.bl-mine li.is-cancelled, .bl-mine li.is-waived { opacity: .65; }
.bl-mine-amount { text-align: right; }
.bl-mine-amount strong { font-family: var(--font-readout); font-size: 1.1rem; }
.bl-mine-amount small { display: block; color: var(--muted); font-size: .75rem; }
@media (max-width: 560px) { .bl-mine li { grid-template-columns: 1.4rem minmax(0, 1fr) auto; } .bl-mine li > .bl-state { grid-column: 2; justify-self: start; } }

/* ---------- DiveNest, the software (services/brand.rb): one quiet line at the foot ---------- */
.dn-credit { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.dn-credit img { height: 22px; width: auto; filter: grayscale(1); opacity: .55; }
.dn-credit:hover img, .dn-credit:focus-within img { filter: none; opacity: 1; }
@media (prefers-reduced-motion: no-preference) { .dn-credit img { transition: filter .25s ease, opacity .25s ease; } }
.dn-claim::before { content: ''; display: inline-block; width: 1px; height: .9em; margin-right: 10px; vertical-align: -1px; background: var(--line-strong); }
/* under the sign-in: the mark and the name */
.dn-signin { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; color: var(--muted); font-size: .8rem; }
.dn-signin img { width: 22px; height: 22px; }
