:root {
    color-scheme: light;
    --ink: #183436;
    --muted: #607476;
    --line: #dbe5e4;
    --surface: #ffffff;
    --canvas: #f2f7f6;
    --primary: #176b65;
    --primary-dark: #10534e;
    --danger: #9c2e38;
    --danger-bg: #fff0f1;
    --success: #20643f;
    --success-bg: #edf9f1;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--canvas);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--primary); }

.shell { min-height: 100vh; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3rem);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: .75rem; font-weight: 750; }
.brand-mark {
    display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
    border-radius: .7rem; background: var(--primary); color: white; font-size: 1.3rem;
}

.page { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 3rem 0; }
.auth-page { width: min(460px, calc(100% - 2rem)); margin: 0 auto; padding: 8vh 0 3rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 1.1rem;
    padding: clamp(1.4rem, 4vw, 2.25rem);
    box-shadow: 0 16px 45px rgba(24, 52, 54, .07);
}

h1 { margin: 0 0 .55rem; font-size: clamp(1.75rem, 4vw, 2.45rem); letter-spacing: -.035em; }
h2 { margin-top: 0; }
p { line-height: 1.6; }
.muted { color: var(--muted); margin-top: 0; }

.field { margin-top: 1.15rem; }
label { display: block; margin-bottom: .4rem; font-weight: 650; }
input,textarea,select {
    width: 100%; padding: .85rem .95rem; border: 1px solid #b8c9c7;
    border-radius: .65rem; background: white; color: var(--ink); font: inherit;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus,textarea:focus,select:focus { outline: 3px solid rgba(23, 107, 101, .18); border-color: var(--primary); }

.button {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 2.75rem; padding: .7rem 1.05rem; border: 0; border-radius: .65rem;
    background: var(--primary); color: white; font: inherit; font-weight: 700; cursor: pointer;
}
.button:hover { background: var(--primary-dark); }
.button-secondary { background: #e7efee; color: var(--ink); }
.button-secondary:hover { background: #d8e5e3; }
.button-block { width: 100%; margin-top: 1.4rem; }

.notice { margin: 1rem 0; padding: .85rem 1rem; border-radius: .65rem; border: 1px solid; }
.notice-error { color: var(--danger); background: var(--danger-bg); border-color: #f0c7cb; }
.notice-success { color: var(--success); background: var(--success-bg); border-color: #c6e5d0; }
.notice-warning { color: #785313; background: #fff8e8; border-color: #efd79f; }

.toolbar { display: flex; align-items: center; gap: .65rem; }
.toolbar form { margin: 0; }
.welcome { margin-bottom: 2rem; }
.placeholder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.placeholder { min-height: 150px; box-shadow: none; }
.placeholder p { color: var(--muted); }

@media (max-width: 620px) {
    .topbar { align-items: flex-start; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .page { padding-top: 1.75rem; }
}

/* Authenticated application shell */
.app-frame { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0, 1fr); background: #f7f9f8; }
.app-sidebar { position: sticky; top: 0; height: 100vh; padding: 1.25rem .75rem; display: flex; flex-direction: column; color: #f5ffff; background: linear-gradient(175deg, #07565a 0%, #06494e 58%, #073f45 100%); }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: .25rem .8rem 1.6rem; font-size: 1.15rem; font-weight: 800; }
.sidebar-brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid rgba(255,255,255,.55); border-radius: .65rem; font-size: 1.35rem; }
.app-navigation { display: flex; flex-direction: column; gap: .35rem; }
.nav-entry { display: flex; align-items: center; gap: .8rem; min-height: 46px; padding: .65rem .8rem; border-radius: .65rem; color: #f5ffff; text-decoration: none; font-weight: 600; }
.nav-entry.is-preview { opacity: .83; cursor: not-allowed; }
.nav-entry.is-active { background: rgba(112,205,202,.23); box-shadow: inset 3px 0 #8bd8d3; }
.nav-symbol { width: 1.5rem; text-align: center; font-size: 1.35rem; line-height: 1; }
.sidebar-foot { margin-top: auto; padding: 1rem .8rem .25rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .8rem; color: #bad4d4; }
.preview-dot { display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; border-radius: 50%; background: #77d2b1; }

.app-stage { min-width: 0; }
.app-topbar { min-height: 64px; padding: .65rem 1.4rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: white; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.search-field { width: min(560px, 48vw); height: 42px; display: flex; align-items: center; gap: .7rem; padding: 0 .9rem; background: #f4f6f7; border-radius: .7rem; color: #597072; }
.search-field input { border: 0; padding: 0; background: transparent; box-shadow: none; }
.search-field input:disabled { opacity: 1; color: #687a7c; -webkit-text-fill-color: #687a7c; }
.account-area { display: flex; align-items: center; gap: .65rem; font-size: .86rem; white-space: nowrap; }
.account-area form { margin: 0; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: white; background: #0b5557; font-weight: 800; }
.preview-pill { padding: .35rem .6rem; border-radius: 999px; background: #e5f4f1; color: #176b65; font-size: .72rem; font-weight: 750; }
.role-pill { padding: .35rem .6rem; border-radius: 999px; background: #e5f4f1; color: #176b65; font-size: .72rem; font-weight: 750; }
.account-link { text-decoration: none; font-weight: 650; }
.logout-button { border: 0; background: transparent; color: #596e70; padding: .4rem; cursor: pointer; font: inherit; }

.workspace { width: min(1480px, calc(100% - 2.5rem)); margin: 0 auto; padding: 1.35rem 0 2.5rem; }
.workspace-notice { margin-top: 0; }
.demo-banner { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; padding: .65rem .8rem; border: 1px solid #cfe4e1; border-radius: .7rem; background: #f0faf8; color: #486668; font-size: .82rem; }
.demo-badge { padding: .25rem .48rem; border-radius: .4rem; background: #14716a; color: white; font-size: .69rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.patient-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin: .9rem 0 1.1rem; }
.patient-heading h1 { margin: 0 0 .35rem; font-size: clamp(1.65rem,2.6vw,2.25rem); }
.section-kicker { margin: 0 0 .3rem; color: var(--primary); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.patient-meta { display: flex; flex-wrap: wrap; gap: .45rem 1.25rem; color: #5c6e70; font-size: .86rem; }
.patient-meta span + span::before { content: "•"; margin-right: 1rem; color: #98a8aa; }

.planner-grid { display: grid; grid-template-columns: 270px minmax(420px,1fr) minmax(310px,390px); gap: .9rem; align-items: start; }
.planner-side-column { display: grid; gap: .9rem; }
.panel { background: white; border: 1px solid #dce4e4; border-radius: .85rem; box-shadow: 0 5px 16px rgba(25,57,59,.045); }
.panel-heading { min-height: 52px; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.panel-heading h2 { margin: 0; font-size: 1rem; letter-spacing: -.01em; }
.suggestions-heading > div { display: flex; gap: .45rem; }
.quiet-button,.wide-quiet-button { border: 1px solid #d2dcdb; background: white; color: #253f41; border-radius: .5rem; padding: .55rem .75rem; font: inherit; font-size: .8rem; }
button:disabled { cursor: not-allowed; opacity: 1; }
.wide-quiet-button { width: calc(100% - 2rem); margin: 0 1rem 1rem; }
.segmented { margin: 0 1rem; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.segmented button { padding: .45rem; border: 1px solid #d1dcdb; border-radius: .45rem; background: white; color: #465c5e; font-weight: 650; }
.segmented .is-selected { border-color: #0e6966; background: #0e6966; color: white; }
.body-map { height: 246px; padding: .4rem .8rem; }
.body-map svg { width: 100%; height: 100%; }
.body-outline { fill: #fbfcfc; stroke: #b7c4c4; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.body-highlight { fill: #ee8e73; opacity: .9; }
.region-summary { display: flex; gap: .65rem; align-items: flex-start; padding: 0 1.1rem 1rem; }
.region-dot { width: .75rem; height: .75rem; flex: 0 0 auto; margin-top: .28rem; border-radius: 50%; background: #ee8e73; }
.region-summary strong,.region-summary small { display: block; }
.region-summary small { margin-top: .25rem; color: #637577; line-height: 1.45; }
.progress-panel { padding-bottom: 1rem; }
.progress-content { display: flex; align-items: center; gap: 1rem; padding: .1rem 1rem .5rem; }
.progress-ring { width: 88px; height: 88px; display: grid; place-items: center; border-radius: 50%; background: conic-gradient(#2e9d73 0 60%,#e0ece9 60% 100%); position: relative; }
.progress-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: white; }
.progress-ring strong { position: relative; font-size: 1.35rem; }
.progress-content span,.progress-content small { display: block; margin-top: .3rem; color: #228265; }
.progress-content small { color: #718183; }

.suggestions-panel { padding-bottom: .8rem; }
.exercise-list { display: grid; gap: .55rem; padding: 0 .9rem; }
.exercise-card { min-height: 142px; display: grid; grid-template-columns: 145px minmax(0,1fr) 38px; gap: .8rem; padding: .55rem; border: 1px solid #dde5e4; border-radius: .7rem; }
.exercise-visual { display: grid; place-items: center; border-radius: .5rem; overflow: hidden; color: rgba(255,255,255,.92); font-size: 1.7rem; font-weight: 850; letter-spacing: -.05em; }
.exercise-visual span,.plan-thumb { text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.exercise-coral { background: linear-gradient(145deg,#365d5b,#e39979); }
.exercise-teal { background: linear-gradient(145deg,#153f42,#65a7a0); }
.exercise-sand { background: linear-gradient(145deg,#78908c,#e5bd91); }
.exercise-copy { min-width: 0; padding: .15rem 0; }
.exercise-copy h3 { margin: 0 0 .35rem; font-size: 1rem; }
.exercise-copy p { margin: .45rem 0; color: #526668; font-size: .78rem; line-height: 1.4; }
.tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.tags span { padding: .2rem .42rem; border-radius: .35rem; background: #dff1ed; color: #245b58; font-size: .67rem; }
.tags span:nth-child(even) { background: #e8eef5; color: #42576e; }
.exercise-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; color: #536567; font-size: .7rem; }
.add-button { width: 34px; height: 34px; border: 1px solid #d5dedd; border-radius: .5rem; background: white; color: #174f51; font-size: 1.55rem; }
.more-button { width: calc(100% - 1.8rem); margin: .55rem .9rem 0; padding: .5rem; border: 1px solid #e0e6e5; border-radius: .45rem; background: white; color: #405456; }
.finding-strip { margin: .8rem .9rem 0; padding: .75rem; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: .7rem; border-top: 1px solid #e3e9e8; }
.finding-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #e2f3ef; color: #116663; font-size: 1.3rem; }
.finding-strip strong,.finding-strip small { display: block; }
.finding-strip small { margin-top: .25rem; color: #586c6e; }

.plan-panel { padding: 0 .85rem .85rem; }
.plan-panel > .panel-heading { padding-left: 0; padding-right: 0; }
.compact-label { margin: 0 0 .35rem; font-size: .75rem; }
.plan-panel input,.plan-panel textarea { padding: .65rem .7rem; font-size: .8rem; background: white; }
.plan-panel input:disabled,.plan-panel textarea:disabled { opacity: 1; color: #33494b; -webkit-text-fill-color: #33494b; }
.plan-list { display: grid; gap: .55rem; margin: .75rem 0; }
.plan-item { display: grid; grid-template-columns: 16px 54px 1fr 27px; gap: .55rem; align-items: center; padding: .55rem; border: 1px solid #dfe6e5; border-radius: .65rem; }
.drag-mark { color: #6a7b7c; }
.plan-thumb { height: 52px; display: grid; place-items: center; border-radius: .4rem; color: white; font-size: .8rem; font-weight: 800; }
.plan-item strong,.plan-item small { display: block; }
.plan-item strong { font-size: .78rem; line-height: 1.3; }
.plan-item small { margin-top: .2rem; color: #647779; font-size: .67rem; }
.plan-item button { width: 27px; height: 27px; border: 1px solid #d5dedd; border-radius: .4rem; background: white; font-size: 1.1rem; }
.drop-zone { width: 100%; margin-bottom: .9rem; padding: .75rem; border: 1px dashed #bdc9c8; border-radius: .55rem; background: #fbfcfc; color: #778687; }
.field-hint { display: block; margin: .35rem 0 .8rem; color: #758586; font-size: .66rem; }
.save-plan-button { width: 100%; padding: .8rem; border: 0; border-radius: .55rem; background: #07585a; color: white; font: inherit; font-weight: 750; }

/* User administration */
.admin-workspace { max-width: 1240px; }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .5rem 0 1.25rem; }
.admin-heading h1 { margin-bottom: .2rem; }
.admin-heading p:not(.section-kicker) { margin: 0; color: var(--muted); }
.admin-heading .button,.admin-heading .quiet-button { text-decoration: none; white-space: nowrap; }
.heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: .6rem; }
.user-table-panel { overflow: hidden; }
.table-scroll { overflow-x: auto; }
.user-table { width: 100%; border-collapse: collapse; }
.user-table th,.user-table td { padding: .9rem 1rem; border-bottom: 1px solid #e4eae9; text-align: left; vertical-align: middle; font-size: .83rem; }
.user-table th { background: #f7f9f9; color: #647678; font-size: .72rem; text-transform: uppercase; letter-spacing: .045em; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.user-cell { display: flex; align-items: center; gap: .7rem; min-width: 190px; }
.user-cell strong,.user-cell small { display: block; }
.user-cell small { margin-top: .15rem; color: #6a7b7d; }
.table-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; background: #dfeeed; color: #105d5a; font-weight: 800; }
.role-badge,.status-badge { display: inline-flex; align-items: center; padding: .3rem .52rem; border-radius: 999px; font-size: .69rem; font-weight: 750; white-space: nowrap; }
.role-admin { background: #e8e5f8; color: #55448a; }
.role-therapist { background: #dff1ed; color: #155f59; }
.role-reception { background: #fff0d7; color: #875a16; }
.status-badge.is-active { background: #e3f4e9; color: #276a43; }
.status-badge.is-inactive { background: #f1f2f2; color: #6e7778; }
.password-state { display: block; margin-top: .3rem; color: #9a6414; font-size: .65rem; }
.table-action { text-align: right !important; }
.table-action .quiet-button { display: inline-flex; text-decoration: none; }
.table-action-buttons { display: flex; justify-content: flex-end; gap: .45rem; }
.role-overview { display: grid; grid-template-columns: repeat(3,1fr); gap: .8rem; margin-top: .9rem; }
.role-summary { padding: 1rem; }
.role-summary p { margin: .65rem 0 0; color: #607274; font-size: .78rem; line-height: 1.45; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.user-form-grid { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: .9rem; align-items: start; }
.admin-form-panel,.reset-panel { padding: 1.2rem; }
.form-grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.form-grid-three { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .9rem; }
.field small,.form-hint { display: block; margin-top: .35rem; color: #718183; font-size: .7rem; line-height: 1.45; }
.role-fieldset { margin: 1.4rem 0 0; padding: 0; border: 0; }
.role-fieldset legend { margin-bottom: .65rem; font-weight: 750; }
.role-options { display: grid; grid-template-columns: repeat(3,1fr); gap: .65rem; }
.role-option { margin: 0; position: relative; cursor: pointer; }
.role-option input { position: absolute; opacity: 0; pointer-events: none; }
.role-option > span { display: block; height: 100%; padding: .8rem; border: 1px solid #d7e0df; border-radius: .65rem; background: #fbfcfc; }
.role-option strong,.role-option small { display: block; }
.role-option small { margin-top: .3rem; color: #687a7c; font-size: .68rem; line-height: 1.4; }
.role-option input:checked + span { border-color: #19746e; box-shadow: 0 0 0 2px rgba(25,116,110,.13); background: #f0faf8; }
.role-fieldset:disabled .role-option { cursor: not-allowed; opacity: .72; }
.password-fields { margin-top: .35rem; }
.active-switch { display: flex; align-items: flex-start; gap: .65rem; margin-top: 1.3rem; padding: .85rem; border: 1px solid #d7e0df; border-radius: .65rem; }
.active-switch input { width: 1.1rem; height: 1.1rem; margin-top: .15rem; accent-color: var(--primary); }
.active-switch strong,.active-switch small { display: block; }
.active-switch small { margin-top: .25rem; color: #6c7d7f; font-size: .7rem; }
.form-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid #e1e8e7; }
.form-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.reset-panel h2 { font-size: 1rem; }
.reset-panel > p { color: #657779; font-size: .78rem; line-height: 1.5; }
.reception-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: .9rem; }
.reception-card { display: flex; align-items: flex-start; gap: .9rem; min-height: 155px; padding: 1.1rem; }
.reception-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto; border-radius: .7rem; background: #e2f3ef; color: #176b65; font-size: 1.4rem; }
.reception-card h2,.permission-note h2 { margin: 0 0 .35rem; font-size: 1rem; }
.reception-card p,.permission-note p { margin: 0; color: #627577; font-size: .78rem; line-height: 1.5; }
.preview-label { display: inline-flex; margin-top: .7rem; padding: .25rem .45rem; border-radius: .4rem; background: #f0f3f3; color: #68797b; font-size: .66rem; font-weight: 700; }
.permission-note { margin-top: .9rem; padding: 1.1rem; border-left: 4px solid #2c8a7f; }
.dashboard-focus-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .9rem; }
.dashboard-heading-side { display: grid; justify-items: end; gap: .65rem; }
.dashboard-clock { color: #49686a; font-size: .78rem; font-weight: 700; }
.dashboard-focus-card { min-height: 270px; padding: 1.15rem; }
.dashboard-focus-card.has-current-appointment { border-color: #75bcb1; box-shadow: inset 4px 0 #238276,0 5px 16px rgba(25,57,59,.06); }
.dashboard-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dashboard-card-heading h2,.dashboard-agenda-heading h2 { margin: .15rem 0 0; font-size: 1.08rem; }
.dashboard-eyebrow { color: #607779; font-size: .66rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.dashboard-live-badge,.dashboard-count { display: inline-flex; align-items: center; padding: .35rem .55rem; border-radius: 999px; background: #def3ed; color: #176b65; font-size: .68rem; font-weight: 800; }
.dashboard-live-badge::before { content: ""; width: .45rem; height: .45rem; margin-right: .35rem; border-radius: 50%; background: #28a077; }
.dashboard-patient { display: flex; align-items: center; gap: .7rem; margin-top: 1.25rem; }
.dashboard-patient strong,.dashboard-patient small,.dashboard-agenda-patient strong,.dashboard-agenda-patient small,.dashboard-agenda-plan strong,.dashboard-agenda-plan small { display: block; }
.dashboard-patient strong { font-size: 1.2rem; }
.dashboard-patient small,.dashboard-agenda-patient small,.dashboard-agenda-plan small { margin-top: .16rem; color: #687b7d; font-size: .68rem; }
.dashboard-patient-mark { width: .85rem; height: 2.7rem; flex: 0 0 auto; border-radius: 999px; background: var(--patient-color,#2B7A78); }
.dashboard-time { margin: 1rem 0 .2rem; color: #1c5554; font-size: .86rem; font-weight: 800; }
.dashboard-plan-name { margin: 0; color: #5c7072; font-size: .82rem; }
.dashboard-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; margin-top: 1.25rem; }
.dashboard-card-actions a { text-decoration: none; }
.dashboard-empty { min-height: 165px; display: flex; align-items: center; justify-content: center; gap: .8rem; color: #637779; }
.dashboard-empty > span { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 50%; background: #e6f3f0; color: #207269; font-size: 1.2rem; }
.dashboard-empty strong { color: #294b4d; }
.dashboard-empty p,.dashboard-agenda-empty p { margin: .2rem 0 0; color: #6a7c7e; font-size: .76rem; }
.dashboard-agenda-panel { margin-top: .9rem; overflow: hidden; }
.dashboard-agenda-heading { border-bottom: 1px solid #e1e8e7; }
.dashboard-agenda-heading > div { display: block; }
.dashboard-agenda-list { display: grid; }
.dashboard-agenda-row { display: grid; grid-template-columns: 74px 14px minmax(150px,1fr) minmax(190px,1.4fr) auto minmax(70px,auto); align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid #e6eceb; }
.dashboard-agenda-row:last-child { border-bottom: 0; }
.dashboard-agenda-row.is-current { background: #f0faf7; box-shadow: inset 4px 0 #278878; }
.dashboard-agenda-row.status-cancelled { opacity: .58; }
.dashboard-agenda-row.status-cancelled .dashboard-agenda-patient strong,.dashboard-agenda-row.status-cancelled .dashboard-agenda-plan strong { text-decoration: line-through; }
.dashboard-agenda-row time strong,.dashboard-agenda-row time span { display: block; }
.dashboard-agenda-row time strong { color: #214f51; font-size: .86rem; }
.dashboard-agenda-row time span { margin-top: .12rem; color: #758587; font-size: .62rem; }
.dashboard-agenda-row .dashboard-patient-mark { width: .55rem; height: 2.25rem; }
.dashboard-agenda-row .quiet-button { text-align: center; text-decoration: none; }
.dashboard-agenda-actions { display: flex; justify-content: flex-end; gap: .4rem; }
.dashboard-agenda-empty { padding: 2.2rem 1rem; text-align: center; }
.empty-state { padding: 3.5rem 1rem; text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto .8rem; border-radius: 50%; background: #e2f3ef; color: var(--primary); font-size: 1.6rem; }
.empty-state h2 { margin: 0 0 .3rem; font-size: 1.05rem; }
.empty-state p { margin: 0; color: var(--muted); }
.patient-number { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #36585a; font-weight: 700; }
.patient-form-panel { max-width: 900px; }
.patient-color-control { display: flex; align-items: center; gap: .75rem; }
.patient-color-control input[type="color"] { width: 64px; height: 46px; flex: 0 0 auto; padding: .2rem; cursor: pointer; }
.patient-color-control span { color: #607476; font-size: .74rem; line-height: 1.45; }
.patient-color-avatar { border: 2px solid var(--patient-color,#2B7A78); background: color-mix(in srgb,var(--patient-color,#2B7A78) 18%,white); color: #173f41; }
.patient-color-dot { display: inline-block; width: .72rem; height: .72rem; margin-right: .42rem; border-radius: 50%; background: var(--patient-color,#2B7A78); vertical-align: -.02rem; }
.form-section { margin: 0; padding: 0 0 1.25rem; border: 0; }
.form-section + .form-section { padding-top: 1.15rem; border-top: 1px solid #e1e8e7; }
.form-section legend { padding: 0; margin-bottom: .1rem; font-size: 1rem; font-weight: 800; }
.form-span-two { grid-column: 1 / -1; }
.encryption-note { display: flex; align-items: flex-start; gap: .65rem; padding: .8rem; border-radius: .65rem; background: #eef8f5; color: #255f58; }
.encryption-note > span { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; background: #2b8c72; color: white; font-weight: 800; }
.encryption-note strong,.encryption-note small { display: block; }
.encryption-note small { margin-top: .2rem; color: #55726f; font-size: .7rem; }
.danger-panel { max-width: 900px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 1.1rem 1.2rem; border-color: #edcaca; background: #fffafa; }
.danger-panel h2 { margin: 0 0 .25rem; color: #8b2929; font-size: 1rem; }
.danger-panel p { margin: 0; color: #765858; font-size: .76rem; line-height: 1.45; }
.danger-button { border: 1px solid #b64242; border-radius: .5rem; background: #a93434; color: white; padding: .62rem .8rem; font: inherit; font-size: .78rem; font-weight: 750; white-space: nowrap; }
.security-panel { max-width: 900px; padding: 1.25rem; }
.security-panel + .security-panel { margin-top: 1rem; }
.security-panel h2 { margin: .65rem 0 .35rem; font-size: 1.15rem; }
.security-panel > p { color: #5e7375; }
.security-status { display: inline-flex; padding: .3rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 800; }
.security-status.is-on { color: #24653f; background: #e3f4e9; }
.security-status.is-off { color: #815917; background: #fff0d7; }
.setup-steps { padding-left: 1.25rem; color: #526a6c; line-height: 1.55; }
.setup-steps li + li { margin-top: .55rem; }
.totp-secret { max-width: 620px; padding: .9rem; border: 1px dashed #9db9b6; border-radius: .65rem; background: #f3f8f7; overflow-wrap: anywhere; text-align: center; letter-spacing: .13em; font-size: 1rem; }
.totp-qr { width: fit-content; margin: .8rem 0 1rem; padding: .55rem; border: 1px solid #d4e0de; border-radius: .7rem; background: white; }
.totp-qr img { display: block; width: 252px; max-width: 100%; height: auto; image-rendering: pixelated; }
.authenticator-link { display: inline-flex; margin: .35rem 0 .5rem; text-decoration: none; }
.compact-code-field { max-width: 360px; }
.verification-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 1.15rem; letter-spacing: .12em; }
.recovery-panel { border-color: #e4c778; background: #fffbef; }
.recovery-codes { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; max-width: 500px; margin-top: 1rem; }
.recovery-codes code { padding: .55rem .7rem; border: 1px solid #ead9a8; border-radius: .4rem; background: white; text-align: center; letter-spacing: .08em; }
.security-danger-panel { align-items: flex-start; }
.security-danger-panel form { width: min(100%,360px); }
.security-danger-panel .danger-button { margin-top: 1rem; }
.auth-help { margin: 1rem 0 0; text-align: center; font-size: .8rem; }
.panel-divider { margin: 1.25rem 0; border: 0; border-top: 1px solid #e1e8e7; }
.exercise-form-panel,.region-form-panel { max-width: 980px; }
.exercise-filters { display: grid; grid-template-columns: minmax(220px,2fr) minmax(180px,1fr) minmax(140px,.7fr) auto auto; align-items: end; gap: .7rem; margin-bottom: .9rem; padding: .8rem; }
.exercise-filters .field { margin: 0; }
.exercise-filters .button,.exercise-filters .quiet-button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.exercise-name-cell { min-width: 230px; max-width: 380px; }
.exercise-name-cell strong,.exercise-name-cell small { display: block; }
.exercise-library-summary { display: flex; align-items: flex-start; gap: .65rem; margin-top: .45rem; }
.exercise-name-cell small { flex: 1; min-width: 0; margin: 0; color: #66797b; line-height: 1.4; }
.exercise-library-thumbnail { display: block; width: 104px; height: 68px; flex: 0 0 auto; border: 1px solid #d8e3e1; border-radius: .5rem; background: #eaf0ef; object-fit: contain; }
.region-list-text { display: block; min-width: 160px; max-width: 300px; line-height: 1.45; }
.difficulty-badge { display: inline-flex; padding: .3rem .52rem; border-radius: 999px; font-size: .69rem; font-weight: 750; }
.difficulty-easy { color: #276a43; background: #e3f4e9; }
.difficulty-medium { color: #795b1d; background: #fff2d8; }
.difficulty-hard { color: #8b3039; background: #fde8ea; }
.multi-select { position: relative; max-width: 680px; }
.multi-select summary { min-height: 48px; padding: .8rem 2.6rem .8rem .95rem; border: 1px solid #b8c9c7; border-radius: .65rem; background: white; cursor: pointer; list-style: none; line-height: 1.35; }
.multi-select summary::-webkit-details-marker { display: none; }
.multi-select summary::after { content: "⌄"; position: absolute; top: .75rem; right: 1rem; color: #587173; font-size: 1.2rem; }
.multi-select[open] summary { border-color: var(--primary); border-radius: .65rem .65rem 0 0; box-shadow: 0 0 0 3px rgba(23,107,101,.12); }
.multi-select-options { max-height: 290px; overflow-y: auto; border: 1px solid #b8c9c7; border-top: 0; border-radius: 0 0 .65rem .65rem; background: white; box-shadow: 0 10px 24px rgba(24,52,54,.1); }
.multi-select-options label { display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: .55rem; margin: 0; padding: .65rem .8rem; border-top: 1px solid #edf1f1; cursor: pointer; font-weight: 600; }
.multi-select-options label:first-child { border-top: 0; }
.multi-select-options label:hover { background: #f2f9f7; }
.multi-select-options input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--primary); }
.multi-select-options small { color: #748486; font-size: .68rem; font-weight: 400; }
.table-subline { display: block; margin-top: .2rem; color: #6b7d7f; font-size: .68rem; }
.plan-status { display: inline-flex; padding: .3rem .52rem; border-radius: 999px; font-size: .69rem; font-weight: 750; white-space: nowrap; }
.status-draft { color: #725b24; background: #fff1d2; }
.status-active { color: #24653f; background: #e3f4e9; }
.status-completed { color: #2d5e7b; background: #e5f1f8; }
.status-archived { color: #687476; background: #eef1f1; }
.plan-create-panel { max-width: 900px; }
.plan-settings-panel { margin-bottom: .9rem; }
.plan-settings-grid { display: grid; grid-template-columns: 1.2fr 1.4fr .8fr .8fr .75fr; align-items: end; gap: .7rem; }
.plan-settings-grid .field { margin-top: 0; }
.plan-notes-field { grid-column: 1 / -2; }
.plan-settings-save { align-self: end; margin-bottom: 0; }
.plan-editor-grid { display: grid; grid-template-columns: minmax(320px,.8fr) minmax(520px,1.4fr); gap: .9rem; align-items: start; }
.plan-library-panel,.plan-items-panel { min-width: 0; }
.plan-exercise-filters { display: grid; grid-template-columns: 1fr 1fr auto; gap: .45rem; padding: 0 .8rem .8rem; }
.plan-exercise-filters input,.plan-exercise-filters select,.plan-exercise-filters button { min-height: 42px; padding: .55rem .65rem; font-size: .75rem; }
.plan-suggestion-list { display: grid; gap: .55rem; padding: 0 .8rem .8rem; }
.plan-suggestion { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .6rem; padding: .8rem; border: 1px solid #dde6e5; border-radius: .65rem; }
.plan-suggestion h3 { margin: 0; font-size: .9rem; }
.plan-suggestion p { margin: .3rem 0; color: #5f7274; font-size: .74rem; line-height: 1.4; }
.plan-suggestion small { color: #65787a; font-size: .67rem; }
.compact-empty { margin: .5rem; color: #6b7c7e; font-size: .8rem; }
.item-count-badge { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 .45rem; border-radius: 999px; background: #e3f1ef; color: #176b65; font-size: .72rem; font-weight: 800; }
.training-item-list { display: grid; gap: .7rem; padding: 0 .8rem .8rem; }
.training-item { padding: .9rem; border: 1px solid #dce5e4; border-radius: .7rem; background: #fff; }
.plan-item-media { width: 190px; max-width: 42%; aspect-ratio: 16 / 9; float: left; margin: 0 .85rem .65rem 0; overflow: hidden; border-radius: .55rem; background: #eaf0ef; }
.plan-item-media img,.plan-item-media video { display: block; width: 100%; height: 100%; object-fit: contain; }
.training-item::after { content: ""; display: block; clear: both; }
.training-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.training-item-head > div:first-child { position: relative; padding-left: 2rem; }
.training-item h3 { margin: 0; font-size: .95rem; }
.training-item-head p { margin: .25rem 0 0; color: #637577; font-size: .72rem; line-height: 1.4; }
.position-number { position: absolute; left: 0; top: -.15rem; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #dff0ed; color: #176b65; font-size: .7rem; font-weight: 800; }
.item-actions { display: flex; gap: .25rem; }
.item-actions form { margin: 0; }
.icon-button { width: 30px; height: 30px; padding: 0; border: 1px solid #d6dfde; border-radius: .4rem; background: white; color: #385759; font: inherit; cursor: pointer; }
.icon-button.remove { color: #9b333b; }
.icon-button:disabled { opacity: .35; cursor: not-allowed; }
.snapshot-details { margin: .7rem 0; padding: .6rem .7rem; border-radius: .5rem; background: #f5f8f8; color: #53686a; font-size: .72rem; }
.snapshot-details summary { cursor: pointer; font-weight: 700; }
.snapshot-details p { margin: .55rem 0 0; line-height: 1.5; }
.precaution-text { color: #815044; }
.item-dose-form { padding-top: .65rem; border-top: 1px solid #e4eae9; }
.dose-grid { display: grid; grid-template-columns: 1.2fr repeat(4,.7fr); gap: .45rem; }
.dose-grid label { margin-bottom: .25rem; color: #66797b; font-size: .64rem; }
.dose-grid input,.dose-grid select { padding: .55rem .5rem; font-size: .75rem; }
.item-dose-form .field { margin-top: .65rem; }
.item-dose-form .field label { font-size: .7rem; }
.item-dose-form textarea { padding: .6rem; font-size: .75rem; }
.item-dose-form > .quiet-button { cursor: pointer; }
.compact-empty-state { padding: 2rem 1rem; }
.exercise-media-panel { max-width: 980px; margin-top: 1rem; padding: 1.2rem; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.exercise-media-panel h2 { margin: .1rem 0 0; font-size: 1.05rem; }
.media-intro { margin: .7rem 0 1rem; color: #617476; font-size: .77rem; line-height: 1.5; }
.media-empty { padding: 1.2rem; border: 1px dashed #c8d5d3; border-radius: .65rem; color: #6c7e80; text-align: center; }
.exercise-media-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.exercise-media-card { overflow: hidden; border: 1px solid #dce5e4; border-radius: .7rem; background: white; }
.exercise-media-card.is-inactive { opacity: .68; }
.media-preview { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: #eaf0ef; }
.media-preview img,.media-preview video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-card-body { padding: .8rem; }
.media-card-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.media-card-body p { margin: .45rem 0; color: #405c5e; font-size: .78rem; }
.media-card-body small { display: block; margin: .4rem 0 .7rem; color: #718183; font-size: .68rem; }
.media-card-body form { margin: 0; }
.media-card-body .quiet-button { width: 100%; }
.media-upload-form { display: grid; grid-template-columns: minmax(240px,1.3fr) minmax(200px,1fr) 110px auto; align-items: end; gap: .7rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #e1e8e7; }
.media-upload-form .field { margin: 0; }
.media-upload-form .button { min-height: 45px; white-space: nowrap; }
.media-file-field input { padding: .58rem; }
.appointment-form-panel { max-width: 960px; }
.week-calendar-panel { --calendar-slot-height: 18px; overflow: hidden; }
.week-calendar-scroll { overflow: auto; max-height: calc(100vh - 230px); scrollbar-gutter: stable; scrollbar-color: #93a5a3 #eef3f2; scrollbar-width: thin; }
.week-calendar { min-width: 1120px; }
.week-calendar-header,.week-calendar-body { display: grid; grid-template-columns: 82px repeat(5,minmax(185px,1fr)); }
.week-calendar-header { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid #b9cac8; background: #f4f8f7; box-shadow: 0 2px 5px rgba(23,63,65,.06); }
.week-calendar-body { padding-top: .5rem; }
.week-time-heading,.week-day-heading { padding: .6rem .35rem; border-right: 1px solid #dce5e4; text-align: center; }
.week-time-heading { color: #66797b; font-size: .68rem; font-weight: 800; }
.week-day-heading strong,.week-day-heading span { display: block; }
.week-day-heading strong { color: #214d4f; font-size: .76rem; }
.week-day-heading span { margin-top: .15rem; color: #657779; font-size: .67rem; }
.week-day-heading.is-today { background: #def3ed; }
.week-time-axis,.week-day-column { position: relative; min-height: calc(48 * var(--calendar-slot-height)); }
.week-time-axis { border-right: 1px solid #ccd9d7; background: #f8fafa; }
.week-time-slot,.calendar-time-slot { box-sizing: border-box; height: var(--calendar-slot-height); border-top: 1px solid transparent; }
.week-time-slot { position: relative; color: #4f686a; font-size: .64rem; font-weight: 650; }
.week-time-slot span { position: absolute; z-index: 1; top: .22rem; right: .55rem; line-height: 1; }
.week-time-slot.is-hour,.calendar-time-slot.is-hour { border-top-color: #9eb2af; }
.week-time-slot.is-half-hour,.calendar-time-slot.is-half-hour { border-top-color: #dce6e4; }
.week-time-end { position: absolute; right: .45rem; bottom: -.38rem; color: #627577; font-size: .6rem; }
.week-day-column { border-right: 1px solid #d2dfdd; background: #fff; }
.week-day-column.is-today { background: #fbfefd; }
.calendar-time-slot { position: relative; }
.calendar-time-slot:hover,.calendar-time-slot.is-drop-target { border-radius: .2rem; background: #d9f1eb; box-shadow: inset 0 0 0 1px #238276; }
.week-event-wrap { position: absolute; z-index: 5; top: calc(var(--appointment-start,0) * var(--calendar-slot-height) + 2px); left: calc(var(--appointment-left,0%) + 2px); width: calc(var(--appointment-width,100%) - 4px); height: max(25px,calc(var(--appointment-span,2) * var(--calendar-slot-height) - 3px)); }
.week-event-wrap .calendar-event { height: 100%; margin: 0; box-sizing: border-box; overflow: hidden; padding: .38rem .48rem; border-radius: .45rem; box-shadow: 0 2px 5px rgba(25,55,57,.18); }
.week-event-wrap .calendar-event strong { font-size: .66rem; }
.week-event-wrap .calendar-event span,.week-event-wrap .calendar-event small { font-size: .57rem; }
.calendar-today-button { margin-right: .25rem; }
.calendar-panel { overflow: hidden; }
.calendar-toolbar { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 1rem; border-bottom: 1px solid #dfe7e6; }
.calendar-toolbar h2 { min-width: 220px; margin: 0; color: #173f41; text-align: center; font-size: 1.1rem; }
.calendar-toolbar .quiet-button { min-width: 40px; padding: .45rem .65rem; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekdays { border-bottom: 1px solid #dfe7e6; background: #f5f8f8; }
.calendar-weekdays div { padding: .55rem; color: #5c7173; text-align: center; font-size: .7rem; font-weight: 800; }
.calendar-day { min-height: 138px; padding: .45rem; border-right: 1px solid #e3e9e8; border-bottom: 1px solid #e3e9e8; background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.is-outside { background: #f8fafa; color: #9aa7a8; }
.calendar-day.is-today { box-shadow: inset 0 0 0 2px #2b8c82; }
.calendar-day.is-drop-target { background: #def3ed; box-shadow: inset 0 0 0 2px #238276; }
.calendar-date { margin-bottom: .35rem; color: #607476; font-size: .72rem; font-weight: 800; }
.calendar-event { display: block; margin-top: .3rem; padding: .42rem .48rem; border-left: 4px solid rgba(0,0,0,.28); border-radius: .35rem; background: var(--patient-color,#2B7A78); color: var(--patient-color-text,#fff); line-height: 1.3; text-decoration: none; }
.calendar-event:hover { box-shadow: 0 2px 8px rgba(24,52,54,.13); }
.calendar-event.is-dragging { opacity: .42; }
.calendar-event[aria-disabled="true"] { cursor: default; }
.calendar-event.type-self_training { border-left-style: dashed; }
.calendar-event.status-cancelled { opacity: .55; text-decoration: line-through; }
.calendar-event strong,.calendar-event span,.calendar-event small { display: block; overflow: hidden; text-overflow: ellipsis; }
.calendar-event strong { font-size: .67rem; white-space: nowrap; }
.calendar-event span,.calendar-event small { margin-top: .15rem; font-size: .59rem; }
.weekday-fieldset { margin: 1rem 0 0; padding: 0; border: 0; }
.weekday-fieldset legend { margin-bottom: .55rem; font-weight: 750; }
.weekday-options { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .45rem; }
.weekday-options label { position: relative; margin: 0; cursor: pointer; }
.weekday-options input { position: absolute; opacity: 0; }
.weekday-options span { display: block; padding: .65rem .35rem; border: 1px solid #cbd8d6; border-radius: .55rem; background: #fff; text-align: center; font-size: .7rem; font-weight: 700; }
.weekday-options input:checked + span { border-color: #19746e; background: #e6f4f1; color: #176b65; box-shadow: 0 0 0 2px rgba(25,116,110,.1); }
.plan-status.status-planned { color: #725b24; background: #fff1d2; }
.plan-status.status-confirmed { color: #24653f; background: #e3f4e9; }
.plan-status.status-cancelled { color: #8b3039; background: #fde8ea; }
.appointment-actions-panel { max-width: 960px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; padding: 1.1rem 1.2rem; }
.appointment-actions-panel h2 { margin: 0 0 .25rem; font-size: 1rem; }
.appointment-actions-panel p { margin: 0; color: #657779; font-size: .76rem; }
.appointment-action-buttons { display: flex; align-items: center; gap: .6rem; }
.appointment-action-buttons form { margin: 0; }
.appointment-cancel-button { border-color: #d09a3f; color: #795515; cursor: pointer; }
.appointment-context-menu { position: fixed; z-index: 1000; min-width: 170px; overflow: hidden; border: 1px solid #cbd8d6; border-radius: .55rem; background: #fff; box-shadow: 0 12px 30px rgba(18,52,54,.22); }
.appointment-context-menu[hidden] { display: none; }
.appointment-context-menu a,.appointment-context-menu button { display: block; width: 100%; padding: .68rem .85rem; border: 0; background: #fff; color: #294e50; font: inherit; font-size: .76rem; text-align: left; text-decoration: none; cursor: pointer; }
.appointment-context-menu a:hover,.appointment-context-menu a:focus,.appointment-context-menu button:hover,.appointment-context-menu button:focus { outline: none; background: #edf7f5; }
.appointment-context-menu form { margin: 0; border-top: 1px solid #e4eae9; }
.appointment-context-menu button { color: #9b333b; }

/* Einheitliches Erscheinungsbild aller Aktionsschaltflächen */
button,
.button,
.quiet-button,
.wide-quiet-button,
.danger-button,
.add-button,
.icon-button,
.more-button,
.drop-zone,
.save-plan-button,
.logout-button,
.segmented button,
.plan-item button,
.appointment-context-menu button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: .48rem .78rem;
    border: 0;
    border-radius: .58rem;
    background: var(--primary);
    color: white;
    font: inherit;
    font-size: .78rem;
    font-weight: 400;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
}
button:hover,
.button:hover,
.quiet-button:hover,
.wide-quiet-button:hover,
.danger-button:hover,
.add-button:hover,
.icon-button:hover,
.more-button:hover,
.drop-zone:hover,
.save-plan-button:hover,
.logout-button:hover,
.segmented button:hover,
.plan-item button:hover,
.appointment-context-menu button:hover {
    background: var(--primary-dark);
    color: white;
}
button:focus-visible,
.button:focus-visible,
.quiet-button:focus-visible,
.wide-quiet-button:focus-visible,
.danger-button:focus-visible,
.add-button:focus-visible,
.icon-button:focus-visible,
.more-button:focus-visible,
.drop-zone:focus-visible,
.save-plan-button:focus-visible,
.logout-button:focus-visible {
    outline: 3px solid rgba(23,107,101,.22);
    outline-offset: 2px;
}
button:disabled,
.button[aria-disabled="true"] {
    background: #7c9996;
    color: white;
    opacity: .55;
    cursor: not-allowed;
}
.add-button,
.icon-button,
.plan-item button {
    width: 2rem;
    height: 2rem;
    min-height: 2rem;
    padding: 0;
    font-size: 1rem;
}
.icon-button.remove,
.appointment-cancel-button,
.appointment-context-menu button {
    color: white;
}
.exercise-filters .button,
.exercise-filters .quiet-button,
.media-upload-form .button {
    min-height: 2.25rem;
}

/* Befundimport und fachliche Prüfung */
.finding-editor-grid { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 1rem; align-items: start; }
.finding-side-column { display: grid; gap: 1rem; }
.finding-source-panel,.finding-confirm-panel { padding: 1.1rem; }
.finding-source-panel h2,.finding-confirm-panel h2 { margin: 0 0 .45rem; font-size: 1rem; }
.finding-confirm-panel p { margin: 0 0 .8rem; color: #617476; font-size: .76rem; line-height: 1.5; }
.finding-document-card { display: grid; gap: .55rem; padding: .8rem 0; border-top: 1px solid #e1e9e8; }
.finding-document-card:first-of-type { margin-top: .7rem; }
.finding-document-card small { color: #66797b; font-size: .7rem; }
.finding-document-card p { margin: 0; padding: .55rem .65rem; border-left: 3px solid #d69b45; background: #fff8e8; color: #725620; font-size: .7rem; line-height: 1.45; }
.finding-document-card form { margin: 0; }
.finding-document-card .button { display: inline-flex; justify-content: center; width: 100%; }
.ocr-capability { display: flex; gap: .65rem; align-items: center; margin-top: .9rem; padding: .75rem; border-radius: .6rem; background: #e8f5f2; }
.ocr-capability > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: #cdeae4; color: #126a64; }
.ocr-capability strong,.ocr-capability small { display: block; }
.ocr-capability strong { font-size: .76rem; }
.ocr-capability small { margin-top: .18rem; color: #5f7475; font-size: .68rem; line-height: 1.4; }
.ocr-capability.is-pending { background: #fff7e3; }
.ocr-capability.is-pending > span { background: #f4dfab; color: #78591e; }
.finding-state { display: inline-flex; padding: .3rem .52rem; border-radius: 999px; background: #edf1f1; color: #526668; font-size: .69rem; white-space: nowrap; }
.finding-state-ready { background: #e3f4e9; color: #24653f; }
.finding-state-ocr_required { background: #fff1d2; color: #725b24; }
.finding-state-failed { background: #fde8ea; color: #8b3039; }
.finding-form-panel textarea#content { min-height: 36rem; font-family: inherit; }
.plan-status.status-draft { color: #725b24; background: #fff1d2; }
.plan-status.status-confirmed { color: #24653f; background: #e3f4e9; }

.appointment-series-panel { overflow: hidden; }
.appointment-series-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid #dfe8e7; background: #f7faf9; }
.appointment-series-summary span,.appointment-series-summary strong { display: block; }
.appointment-series-summary span { margin-bottom: .2rem; color: #6a7d7f; font-size: .68rem; text-transform: uppercase; letter-spacing: .045em; }
.appointment-series-summary strong { color: #173f41; font-size: .82rem; }
.appointment-series-list { display: grid; }
.appointment-series-row { display: grid; grid-template-columns: 120px minmax(180px,1fr) auto auto; align-items: center; gap: .8rem; min-height: 70px; padding: .75rem 1rem; border-bottom: 1px solid #e3eae9; }
.appointment-series-row:last-child { border-bottom: 0; }
.appointment-series-row.is-past { background: #fafbfb; color: #657678; }
.appointment-series-row.is-selected { position: relative; background: #edf8f5; box-shadow: inset 4px 0 #18736c; }
.appointment-series-row.is-cancelled { opacity: .62; }
.appointment-series-date strong,.appointment-series-date span,.appointment-series-detail strong,.appointment-series-detail small { display: block; }
.appointment-series-date span,.appointment-series-detail small { margin-top: .14rem; color: #6d7e80; font-size: .67rem; }
.appointment-series-labels { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .4rem; }
.selected-appointment-badge { padding: .3rem .5rem; border-radius: 999px; background: #d8eee9; color: #145e59; font-size: .65rem; white-space: nowrap; }
.appointment-series-row.is-running .selected-appointment-badge { background: #176b65; color: #fff; }

@media (max-width: 1180px) {
    .planner-grid { grid-template-columns: 250px minmax(420px,1fr); }
    .plan-panel { grid-column: 1 / -1; }
    .plan-list { grid-template-columns: repeat(3,1fr); }
    .user-form-grid { grid-template-columns: 1fr; }
    .finding-editor-grid { grid-template-columns: minmax(0,1fr) 300px; }
}
@media (max-width: 860px) {
    .dashboard-focus-grid { grid-template-columns: 1fr; }
    .dashboard-agenda-row { grid-template-columns: 66px 12px minmax(130px,1fr) minmax(160px,1fr) auto; }
    .dashboard-agenda-row .quiet-button { display: none; }
    .app-frame { grid-template-columns: 72px minmax(0,1fr); }
    .sidebar-brand span:last-child,.nav-entry span:last-child,.sidebar-foot { display: none; }
    .sidebar-brand,.nav-entry { justify-content: center; padding-left: 0; padding-right: 0; }
    .account-name,.account-link,.preview-pill { display: none; }
    .planner-grid { grid-template-columns: 1fr; }
    .plan-panel { grid-column: auto; }
    .planner-side-column { grid-template-columns: 1fr 1fr; }
    .role-overview { grid-template-columns: 1fr; }
    .role-options { grid-template-columns: 1fr; }
    .form-grid-three { grid-template-columns: 1fr 1fr; }
    .exercise-filters { grid-template-columns: 1fr 1fr; }
    .plan-settings-grid { grid-template-columns: 1fr 1fr; }
    .plan-notes-field { grid-column: 1 / -1; }
    .plan-editor-grid { grid-template-columns: 1fr; }
    .media-upload-form { grid-template-columns: 1fr 1fr; }
    .calendar-day { min-height: 110px; }
    .weekday-options { grid-template-columns: repeat(4,1fr); }
    .reception-grid { grid-template-columns: 1fr; }
    .finding-editor-grid { grid-template-columns: 1fr; }
    .appointment-series-row { grid-template-columns: 105px minmax(140px,1fr) auto; }
    .appointment-series-labels { grid-column: 2; justify-content: flex-start; }
}
@media (max-width: 620px) {
    .dashboard-heading-side { width: 100%; justify-items: stretch; }
    .dashboard-clock { text-align: left; }
    .dashboard-agenda-row { grid-template-columns: 58px 10px 1fr auto; }
    .dashboard-agenda-plan { grid-column: 3 / -1; }
    .app-frame { display: block; }
    .app-sidebar { position: static; width: 100%; height: auto; padding: .65rem; }
    .sidebar-brand { justify-content: flex-start; padding: .1rem .25rem .6rem; }
    .sidebar-brand span:last-child { display: inline; }
    .app-navigation { flex-direction: row; overflow-x: auto; padding-bottom: .2rem; }
    .nav-entry { min-width: 48px; min-height: 42px; flex: 0 0 auto; }
    .app-topbar { position: static; padding: .65rem; }
    .search-field { display: none; }
    .account-area { width: 100%; justify-content: flex-end; }
    .account-name { display: inline; margin-right: auto; }
    .workspace { width: min(100% - 1rem,1480px); padding-top: .7rem; }
    .demo-banner { align-items: flex-start; }
    .patient-heading { align-items: flex-start; flex-direction: column; }
    .patient-meta span + span::before { display: none; }
    .planner-side-column,.plan-list { grid-template-columns: 1fr; }
    .exercise-card { grid-template-columns: 86px minmax(0,1fr) 32px; }
    .exercise-meta { display: none; }
    .finding-strip { grid-template-columns: 42px 1fr; }
    .finding-strip .quiet-button { grid-column: 1 / -1; }
    .admin-heading { align-items: stretch; flex-direction: column; }
    .admin-heading .button { width: 100%; }
    .form-grid-two { grid-template-columns: 1fr; gap: 0; }
    .form-span-two { grid-column: auto; }
    .form-grid-three { grid-template-columns: 1fr; gap: 0; }
    .heading-actions { align-items: stretch; flex-direction: column; }
    .exercise-filters { grid-template-columns: 1fr; }
    .plan-settings-grid,.plan-exercise-filters,.dose-grid { grid-template-columns: 1fr; }
    .danger-panel { align-items: stretch; flex-direction: column; }
    .appointment-actions-panel,.appointment-action-buttons { align-items: stretch; flex-direction: column; }
    .exercise-media-grid,.media-upload-form { grid-template-columns: 1fr; }
    .calendar-panel { overflow-x: auto; }
    .calendar-grid { min-width: 780px; }
    .weekday-options { grid-template-columns: 1fr 1fr; }
    .danger-button { width: 100%; }
    .recovery-codes { grid-template-columns: 1fr; }
    .appointment-series-summary { grid-template-columns: 1fr; }
    .appointment-series-row { grid-template-columns: 1fr 1fr; gap: .5rem; }
    .appointment-series-detail,.appointment-series-labels { grid-column: 1 / -1; }
}
