:root {
    --ink: #17211f;
    --muted: #64706c;
    --line: #dce3df;
    --paper: #ffffff;
    --surface: #fbfcfb;
    --surface-strong: #eef5f1;
    --bg: #eef4f0;
    --teal: #0f4c5c;
    --teal-strong: #0a3742;
    --coral: #d96846;
    --olive: #657a3a;
    --gold: #c79235;
    --danger: #a93a35;
    --success: #2f7c57;
    --shadow: 0 18px 48px rgba(23, 33, 31, 0.09);
    --shadow-soft: 0 10px 26px rgba(23, 33, 31, 0.07);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100%;
    background:
        linear-gradient(180deg, #f8faf7 0%, var(--bg) 420px),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

textarea {
    resize: vertical;
}

.topbar,
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    min-height: 70px;
    padding: 14px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid rgba(220, 227, 223, 0.9);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(23, 33, 31, 0.05);
}

.site-header {
    position: fixed;
    background: rgba(255, 255, 255, 0.76);
}

.mode-public .site-header {
    border-bottom-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.82);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 800;
    color: var(--ink);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--teal), var(--success));
    color: #fff;
    font-size: 13px;
    box-shadow: 0 10px 20px rgba(15, 76, 92, 0.18);
}

.main-nav,
.action-row,
.hero-actions,
.logout-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.main-nav a {
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--muted);
    font-weight: 650;
}

.main-nav a:hover {
    color: var(--teal);
    background: var(--surface-strong);
}

.shell {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto;
    padding: 34px 0 64px;
}

.public-shell {
    min-height: 100vh;
}

.landing-hero {
    min-height: 82svh;
    display: flex;
    align-items: center;
    padding: 112px clamp(24px, 7vw, 86px) 54px;
    background: #0f2f36;
    color: #fff;
}

.hero-copy {
    width: min(1120px, 100%);
    max-width: none;
}

.hero-copy h1 {
    max-width: 560px;
    margin: 10px 0 18px;
    font-size: clamp(44px, 5.8vw, 78px);
    line-height: 1;
    text-wrap: balance;
}

.hero-copy p {
    max-width: 560px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 19px;
}

.hero-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 640px;
}

.hero-trust span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 12px 18px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    font-weight: 820;
}

.hero-trust strong {
    color: #f2c98a;
    font-size: 12px;
}

.section-band {
    background: var(--paper);
    border-top: 1px solid var(--line);
}

.section-privacy {
    background:
        linear-gradient(180deg, #f7faf7 0%, #edf3ef 100%);
}

.section-inner {
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 58px 0;
}

.section-title {
    display: grid;
    gap: 8px;
    max-width: 760px;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.04;
}

.section-title p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.feature-grid,
.metrics-grid,
.detail-grid,
.history-grid,
.form-grid {
    display: grid;
    gap: 16px;
}

.feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature {
    min-height: 230px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.feature:hover {
    transform: translateY(-2px);
    border-color: #b9c6bf;
    box-shadow: var(--shadow);
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 30px;
    border-radius: var(--radius);
    background: var(--teal);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
}

.feature h2,
.feature h3,
.section-inner h2,
.panel h2,
.timeline-item h3,
.history-grid h3 {
    margin: 10px 0 8px;
    line-height: 1.18;
}

.section-title h2 {
    margin: 0;
    line-height: 1.04;
}

.feature p,
.privacy-list p,
.muted {
    color: var(--muted);
}

.split {
    display: grid;
    grid-template-columns: minmax(260px, 0.78fr) minmax(280px, 1.22fr);
    gap: clamp(28px, 6vw, 72px);
    align-items: start;
}

.split h2 {
    margin: 8px 0 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.06;
    text-wrap: balance;
}

.privacy-list {
    display: grid;
    gap: 12px;
}

.privacy-list p {
    margin: 0;
    padding: 14px 16px;
    border-left: 4px solid var(--teal);
    background: rgba(255, 255, 255, 0.72);
}

.signature-band {
    background: #f4f8f5;
    color: var(--ink);
}

.signature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 36px 0;
    border-inline: 0;
}

.signature-item {
    display: grid;
    gap: 10px;
    min-height: 140px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.signature-item strong {
    color: var(--coral);
    font-size: 15px;
    font-weight: 900;
}

.signature-item span {
    max-width: 330px;
    color: var(--teal-strong);
    font-size: 18px;
    font-weight: 780;
    line-height: 1.32;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.dashboard-hero {
    align-items: center;
    min-height: 132px;
    padding: 10px 0 18px;
    border-bottom: 1px solid rgba(220, 227, 223, 0.72);
}

.page-heading h1,
.panel-heading h1,
.empty-state h1 {
    margin: 4px 0 0;
    line-height: 1.08;
    font-size: clamp(30px, 4vw, 44px);
}

.hero-note {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--muted);
    font-weight: 650;
}

.eyebrow {
    margin: 0;
    color: var(--coral);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

.panel {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 3vw, 26px);
    margin-bottom: 18px;
}

.panel-heading {
    margin-bottom: 18px;
}

.inline-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.metrics-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 18px;
}

.metric {
    min-height: 116px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.metric::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--coral), var(--gold));
}

.metric span {
    display: block;
    min-height: 42px;
    color: var(--muted);
    font-weight: 650;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 27px;
    line-height: 1.12;
    color: var(--teal);
    overflow-wrap: anywhere;
}

.metric-alert strong {
    color: var(--danger);
}

.metric-feature {
    background: linear-gradient(135deg, var(--teal) 0%, #20756f 100%);
    border-color: rgba(15, 76, 92, 0.2);
}

.metric-feature::before {
    background: rgba(255, 255, 255, 0.55);
}

.metric-feature span,
.metric-feature strong {
    color: #fff;
}

.chart-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr) minmax(260px, 0.85fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.chart-card {
    display: grid;
    align-content: start;
    min-height: 340px;
}

.chart-card-wide {
    min-height: 340px;
}

.chart-canvas {
    display: block;
    width: 100%;
    height: 260px;
}

.chart-donut {
    height: 270px;
}

.chart-pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--teal-strong);
    font-size: 12px;
    font-weight: 850;
}

.client-overview-grid {
    grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
}

.client-next-card {
    min-height: 340px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(23, 33, 31, 0.04);
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
    white-space: normal;
    text-align: center;
}

.button:hover {
    transform: translateY(-1px);
    border-color: #b9c6bf;
    box-shadow: 0 10px 20px rgba(23, 33, 31, 0.08);
}

.button-primary {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
}

.button-secondary {
    background: #f5efe5;
    border-color: #e4d4be;
    color: #5e4620;
}

.button-light {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.48);
    color: #fff;
}

.button-quiet {
    background: transparent;
    color: var(--muted);
}

.button-danger {
    background: #fff4f2;
    color: var(--danger);
    border-color: #efcbc7;
}

.button-whatsapp {
    background: #e7f7ee;
    border-color: #a8dfbf;
    color: #17633a;
}

.button-small {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 14px;
}

.button-full {
    width: 100%;
}

.install-button[hidden] {
    display: none;
}

.alert {
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-success {
    background: #e8f5ee;
    color: var(--success);
}

.alert-danger {
    background: #fff0ed;
    color: var(--danger);
}

.alert-warning {
    background: #fff7e6;
    color: #835900;
}

.login-wrap {
    min-height: calc(100vh - 120px);
    display: grid;
    place-items: center;
    padding: 90px 16px 32px;
}

.login-panel {
    width: min(430px, 100%);
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-panel {
    display: grid;
    gap: 16px;
}

.form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

label span,
dt {
    color: var(--muted);
    font-size: 13px;
    font-weight: 780;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd8d3;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    padding: 11px 12px;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 76, 92, 0.14);
}

.toggle-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfb;
}

.check-label input {
    width: 18px;
    height: 18px;
}

.sticky-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 8px 0;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(170px, 220px) auto;
    gap: 12px;
    align-items: end;
    margin-bottom: 18px;
}

.patients-index .filter-bar {
    grid-template-columns: minmax(220px, 1fr) auto;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
}

.table-actions {
    text-align: right;
    white-space: nowrap;
}

.detail-grid {
    grid-template-columns: minmax(260px, 0.95fr) minmax(280px, 1.05fr);
}

.data-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.data-list div {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--line);
}

dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.history-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-grid > div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
    background: #fbfcfb;
}

.history-grid h3 {
    margin-top: 0;
    color: var(--teal-strong);
}

.preline {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--olive);
    border-radius: var(--radius);
    padding: 16px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 33, 31, 0.04);
}

.task-completed {
    border-left-color: var(--success);
    background: #fbfffc;
}

.timeline-item time {
    color: var(--muted);
    font-weight: 750;
    font-size: 13px;
}

.task-done-form {
    display: flex;
    justify-content: flex-end;
}

.done-note {
    margin: 0;
    color: var(--success);
    font-size: 13px;
    font-weight: 850;
}

.compact {
    justify-content: flex-start;
}

.danger-zone {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 28px;
}

.status {
    display: inline-flex;
    min-width: 82px;
    justify-content: center;
    border-radius: var(--radius);
    padding: 4px 8px;
    font-size: 13px;
    font-weight: 800;
}

.status-pending {
    background: #fff7e6;
    color: #7b5600;
}

.status-requested {
    background: #fff7e6;
    color: #7b5600;
}

.status-confirmed {
    background: #e6f0f3;
    color: var(--teal);
}

.status-paid {
    background: #e8f5ee;
    color: var(--success);
}

.status-completed {
    background: #e8f5ee;
    color: var(--success);
}

.status-overdue {
    background: #fff0ed;
    color: var(--danger);
}

.status-cancelled {
    background: #eceff1;
    color: #59646a;
}

.status-declined {
    background: #fff0ed;
    color: var(--danger);
}

.status-planning,
.status-scheduled {
    background: #e6f0f3;
    color: var(--teal);
}

.status-in_progress,
.status-waiting_professional {
    background: #fff7e6;
    color: #7b5600;
}

.status-waiting_client,
.status-paused {
    background: #f5efe5;
    color: #5e4620;
}

.text-link {
    color: var(--teal);
    font-weight: 850;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.case-panel,
.client-case-view {
    display: grid;
    gap: 16px;
}

.case-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.case-header h2 {
    margin: 4px 0 0;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.progress-wrap,
.progress-native {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e7ece9;
}

.progress-native {
    display: block;
    border: 0;
    appearance: none;
}

.progress-native::-webkit-progress-bar {
    border-radius: 999px;
    background: #e7ece9;
}

.progress-native::-webkit-progress-value {
    border-radius: 999px;
    background: var(--teal);
}

.progress-native::-moz-progress-bar {
    border-radius: 999px;
    background: var(--teal);
}

.progress-bar {
    min-width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--teal);
}

.case-summary-grid,
.client-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.case-summary-grid > div,
.stacked-section {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 16px;
}

.case-summary-grid h3,
.subsection-heading h3 {
    margin: 0 0 10px;
    color: var(--teal-strong);
}

.subsection-heading {
    margin-bottom: 12px;
}

.quick-form,
.portal-item-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
}

.portal-item-form {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.item-stack {
    display: grid;
    gap: 10px;
}

.span-all {
    grid-column: 1 / -1;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.case-archive-form {
    display: flex;
    justify-content: flex-end;
}

.psychologist-hero {
    min-height: 82svh;
    background:
        linear-gradient(90deg, rgba(8, 27, 31, 0.92) 0%, rgba(8, 27, 31, 0.72) 42%, rgba(8, 27, 31, 0.22) 72%, rgba(8, 27, 31, 0.06) 100%),
        linear-gradient(180deg, rgba(8, 27, 31, 0.04) 0%, rgba(8, 27, 31, 0.32) 100%),
        url("/assets/images/hero-andreia-psicologa.png") center right / cover no-repeat;
}

.intro-band {
    background: #ffffff;
}

.lead-text {
    display: grid;
    gap: 14px;
    color: var(--muted);
    font-size: 18px;
    padding-top: 4px;
}

.lead-text p {
    margin: 0;
}

.care-grid {
    margin-top: 28px;
}

.care-grid .feature {
    display: grid;
    align-content: start;
}

.scheduling-band {
    background:
        linear-gradient(180deg, #f8faf8 0%, #eaf2ed 100%);
}

.appointment-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.86fr) minmax(320px, 1.14fr);
    gap: clamp(22px, 5vw, 58px);
    align-items: start;
}

.appointment-copy {
    position: sticky;
    top: 92px;
}

.appointment-copy h2 {
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    text-wrap: balance;
}

.appointment-copy p {
    color: var(--muted);
    font-size: 18px;
}

.contact-strip {
    display: grid;
    gap: 10px;
    margin-top: 24px;
}

.contact-strip span,
.contact-strip a {
    display: block;
    padding: 12px 14px;
    border-left: 4px solid var(--coral);
    background: rgba(255, 255, 255, 0.78);
    color: var(--teal-strong);
    font-weight: 800;
}

.contact-strip a {
    border-left-color: #25d366;
    background: #e7f7ee;
    color: #17633a;
}

.appointment-form {
    margin: 0;
    border-color: rgba(15, 76, 92, 0.22);
}

.privacy-check {
    align-items: start;
    grid-template-columns: 20px 1fr;
    color: var(--muted);
}

.appointment-list {
    display: grid;
    gap: 14px;
}

.appointment-item {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 33, 31, 0.04);
}

.appointment-main {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.appointment-main time {
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
}

.appointment-main h2 {
    margin: 4px 0 2px;
    font-size: 23px;
}

.appointment-main p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.appointment-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.appointment-meta span {
    padding: 5px 9px;
    border-radius: var(--radius);
    background: #eef5f1;
    color: var(--teal-strong);
    font-size: 13px;
    font-weight: 800;
}

.appointment-message {
    margin: 0;
    padding: 14px;
    border-radius: var(--radius);
    background: #fbfcfb;
    color: var(--ink);
}

.reminder-panel {
    border-color: #f0d6aa;
    background: #fffaf0;
}

.compact-list {
    gap: 10px;
}

.reminder-item {
    background: #fff;
    border-left: 4px solid var(--gold);
}

.meta-alert {
    background: #fff3d6 !important;
    color: #835900 !important;
}

.empty-state {
    width: min(720px, calc(100% - 32px));
    margin: 130px auto;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.public-confirmation {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 110px 16px 40px;
    background: #edf3ef;
}

.confirmation-panel {
    width: min(560px, 100%);
    margin: 0;
}

.confirmation-note {
    color: var(--muted);
    font-weight: 650;
}

.confirmation-actions {
    display: grid;
    gap: 10px;
}

@media (max-width: 980px) {
    .metrics-grid,
    .feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chart-grid,
    .client-overview-grid,
    .form-grid,
    .form-grid.two,
    .detail-grid,
    .history-grid,
    .split,
    .signature-grid,
    .appointment-layout,
    .case-summary-grid,
    .client-admin-grid,
    .quick-form,
    .portal-item-form,
    .inline-form {
        grid-template-columns: 1fr;
    }

    .chart-card,
    .chart-card-wide,
    .client-next-card {
        min-height: auto;
    }

    .appointment-copy {
        position: static;
    }

    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 680px) {
    .topbar,
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        min-height: auto;
    }

    .site-header {
        position: absolute;
    }

    .site-header .main-nav {
        width: 100%;
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .site-header .main-nav a {
        flex: 0 0 auto;
        padding: 6px 8px;
        font-size: 13px;
        white-space: nowrap;
    }

    .topbar {
        gap: 10px;
        padding-inline: 14px;
    }

    .topbar .brand {
        width: 100%;
    }

    .topbar .main-nav {
        width: 100%;
        flex-wrap: nowrap;
        gap: 4px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .topbar .main-nav a {
        flex: 0 0 auto;
        padding: 6px 5px;
        font-size: 13px;
        white-space: nowrap;
    }

    .topbar .logout-form,
    .topbar .install-button {
        width: 100%;
    }

    .topbar .logout-form .button,
    .topbar .install-button {
        width: 100%;
    }

    .landing-hero {
        min-height: 84svh;
        align-items: flex-end;
        padding: 132px 16px 34px;
    }

    .psychologist-hero {
        background:
            linear-gradient(180deg, rgba(9, 28, 30, 0.12) 0%, rgba(9, 28, 30, 0.9) 58%),
            url("/assets/images/hero-andreia-psicologa.png") center / cover no-repeat;
    }

    .hero-copy h1 {
        font-size: clamp(42px, 14vw, 58px);
    }

    .hero-copy p {
        font-size: 17px;
    }

    .hero-trust {
        gap: 8px;
        margin-top: 16px;
    }

    .hero-trust span {
        min-height: 30px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .section-inner {
        padding: 38px 0;
    }

    .section-title h2,
    .split h2 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .section-title p,
    .lead-text,
    .appointment-copy p {
        font-size: 16px;
    }

    .signature-item {
        min-height: auto;
        padding: 22px 18px;
    }

    .signature-item span {
        font-size: 16px;
    }

    .feature {
        min-height: auto;
    }

    .page-heading,
    .inline-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero {
        min-height: auto;
        padding-top: 2px;
    }

    .metrics-grid,
    .feature-grid,
    .filter-bar {
        grid-template-columns: 1fr;
    }

    .metric {
        min-height: 96px;
    }

    .chart-canvas {
        height: 240px;
    }

    .chart-donut {
        height: 300px;
    }

    .data-list div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .sticky-actions,
    .danger-zone {
        justify-content: stretch;
        flex-direction: column;
    }

    .public-shell .button,
    .shell .button {
        width: 100%;
    }

    .topbar .main-nav .button,
    .topbar .main-nav a {
        width: auto;
    }

    .main-nav,
    .action-row,
    .hero-actions {
        width: 100%;
    }

    .appointment-main {
        flex-direction: column;
    }

    .case-header {
        flex-direction: column;
    }

    .case-archive-form {
        justify-content: stretch;
    }
}

@media (display-mode: standalone) {
    .topbar {
        padding-top: calc(14px + env(safe-area-inset-top));
    }

    .shell {
        padding-bottom: calc(64px + env(safe-area-inset-bottom));
    }
}
