/* FourSMILE shared interface system. Brand colors are fixed; darker action
   shades provide readable text contrast. Keep print documents unaltered. */
:root {
  --navy: #0a1a2f;
  --blue: #147bff;
  --cyan: #00c6d5;
  --teal: #33e0b3;
  --ink: #0a1a2f;
  --muted: #5d6e82;
  --line: #dfe7ef;
  --canvas: #f4f7fb;
  --surface: #ffffff;
  --action: #0864d1;
  --action-hover: #0755b3;
  --soft-blue: #eaf3ff;
  --soft-teal: #e9faf6;
  --radius: 16px;
  --shadow-card: 0 3px 16px #0a1a2f05;
  --shadow-floating: 0 16px 56px #0a1a2f1a;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  font-family: Montserrat, 'Segoe UI', sans-serif;
  color-scheme: light;
}
body {
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select,
textarea {
  font-family: inherit;
}
h1,
h2,
h3,
h4 {
  text-wrap: balance;
}
button,
a,
input,
select,
textarea,
summary {
  scroll-margin-block: 100px;
}
:is(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--action);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
/* The same navigation frame serves both operational portals. */
@media screen {
  body:not(.patient-view) .sidebar {
    width: 264px;
    padding: 26px 18px 20px;
    background: var(--navy);
    color: #becbdc;
    border-right: 1px solid #ffffff0d;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #39516b transparent;
  }
  body:not(.patient-view) .workspace {
    margin-left: 264px;
  }
  body:not(.patient-view) main {
    width: 100%;
    max-width: 1760px;
    padding: 36px clamp(24px, 3vw, 48px) 32px;
    margin-inline: auto;
    min-width: 0;
  }
  .sidebar .brand {
    padding: 0 10px 26px;
  }
  .sidebar .brand .real-logo {
    width: 198px;
    max-width: 100%;
    height: 54px;
  }
  .sidebar .practice-card {
    border: 1px solid #ffffff17;
    border-radius: 12px;
    background: #ffffff06;
    padding: 14px 12px;
    margin-bottom: 24px;
  }
  .sidebar .practice-card strong {
    font-size: 13px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }
  .sidebar .practice-card small,
  .sidebar .sidebar-user small {
    color: #aabbd0;
    font-size: 11px;
  }
  .sidebar .practice-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    background: #00c6d517;
    color: var(--cyan);
  }
  .sidebar .nav-label {
    color: #92a9c3;
    font-size: 10px;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
  }
  .sidebar .nav {
    gap: 4px;
  }
  .sidebar .nav a {
    position: relative;
    min-height: 44px;
    padding: 10px 13px;
    font-size: 12px;
    font-weight: 500;
    color: #becbdc;
    border: 1px solid transparent;
    border-radius: 9px;
    gap: 12px;
  }
  .sidebar .nav a:hover {
    background: #ffffff09;
    color: #ffffff;
  }
  .sidebar .nav a.active {
    color: #ffffff;
    background: #147bff25;
    border-color: #147bff35;
    box-shadow: none;
  }
  .sidebar .nav a.active::before {
    content: '';
    position: absolute;
    inset: 12px auto 12px 0;
    width: 3px;
    border-radius: 4px;
    background: var(--cyan);
  }
  .sidebar .nav a.active svg {
    color: #70b7ff;
  }
  .sidebar .nav svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
  }
  .sidebar :focus-visible {
    outline-color: var(--cyan);
  }
  .sidebar-bottom {
    padding-top: 24px;
  }
  .sidebar-user {
    padding: 18px 8px 2px;
    border-top-color: #ffffff17;
  }
  .sidebar-user strong {
    font-size: 12px;
  }
  .sidebar .org-switch {
    color: #becbdc;
    margin-bottom: 20px;
  }
  .sidebar .org-switch select {
    background: #142b43;
    border-color: #38516a;
    color: #ffffff;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    min-height: 76px;
    height: auto;
    padding: 14px clamp(24px, 3vw, 48px);
    background: #ffffff;
    border-bottom: 1px solid var(--line);
  }
  .breadcrumb {
    font-size: 12px;
    gap: 12px;
  }
  .breadcrumb strong {
    font-weight: 650;
    color: var(--ink);
  }
  .topbar-right {
    gap: 12px;
    min-width: 0;
  }
  .topbar .location-select select {
    min-height: 42px;
    border-radius: 9px;
    background-color: #f8fafc;
    font-size: 12px;
    max-width: 210px;
  }
  .header-signout,
  .notification-bell,
  .icon-button {
    min-width: 44px;
    min-height: 44px;
    border-radius: 11px;
    color: #53677f;
  }
  .header-signout:hover,
  .notification-bell:hover {
    color: var(--action);
    background: var(--soft-blue);
    border-color: #bfd9ff;
  }
  .page-heading {
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-start;
  }
  .page-heading h1 {
    font-size: clamp(26px, 2.2vw, 34px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -1.1px;
    margin-block: 7px 10px;
  }
  .eyebrow {
    color: #4f6987;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.6px;
    line-height: 1.6;
  }
  .subtitle,
  p.subtitle {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.7;
    max-width: 760px;
  }
  .page-heading .actions {
    padding-top: 20px;
    flex-shrink: 0;
  }
  .button {
    min-height: 44px;
    padding: 11px 17px;
    border-radius: 10px;
    border: 1px solid #d6e1ed;
    color: #29425e;
    background: #ffffff;
    font-size: 12px;
    line-height: 1.5;
    font-weight: 650;
    gap: 8px;
    box-shadow: 0 1px 2px #0a1a2f04;
    transition:
      background-color 150ms,
      border-color 150ms,
      box-shadow 150ms;
  }
  .button:hover {
    background: #f4f8fd;
    border-color: #b8cadf;
    box-shadow: 0 3px 8px #0a1a2f07;
  }
  .button.primary,
  .public-header .button.primary {
    color: #ffffff;
    background: var(--action);
    border-color: var(--action);
    box-shadow: 0 3px 8px #0864d11a;
  }
  .button.primary:hover {
    background: var(--action-hover);
    border-color: var(--action-hover);
  }
  .button:active {
    box-shadow: inset 0 1px 3px #0a1a2f18;
  }
  .button:disabled {
    opacity: 0.55;
    box-shadow: none;
  }
  .button.danger {
    color: #a72f35;
    background: #fff4f4;
    border-color: #f0cdd0;
  }
  .button.subtle {
    padding: 10px 16px;
    min-height: 40px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--action);
    box-shadow: none;
    background: var(--soft-blue);
    border-color: transparent;
  }
  .actions,
  .form-actions,
  .card-actions,
  .row-actions {
    gap: 12px;
    flex-wrap: wrap;
  }
  .panel,
  .doctor-card,
  .visit-card,
  .practice-public-card,
  .family-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    min-width: 0;
  }
  .panel-header {
    padding: 23px 24px 19px;
    gap: 16px;
    flex-wrap: wrap;
  }
  .panel-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.25px;
  }
  .panel-body {
    padding: 4px 24px 24px;
  }
  .panel-body > :first-child {
    margin-top: 0;
  }
  .panel-body p {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.75;
  }
  .stats {
    gap: 18px;
    margin-bottom: 28px;
  }
  .stat,
  .platform-view .stat {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-card);
  }
  .stat-top {
    color: #52677f;
    font-size: 12px;
    font-weight: 600;
    gap: 10px;
  }
  .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--action);
    background: var(--soft-blue);
    flex-shrink: 0;
  }
  .stat-value {
    margin-block: 15px 8px;
  }
  .stat-value strong {
    font-size: clamp(26px, 2.4vw, 36px);
    line-height: 1.15;
    letter-spacing: -1.3px;
    font-variant-numeric: tabular-nums;
  }
  .stat-foot {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
  }
  .table-wrap {
    overflow-x: auto;
    max-width: 100%;
    overscroll-behavior-inline: contain;
  }
  th {
    color: #52677d;
    background: #f7f9fc;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    padding: 14px 24px;
    border-block: 1px solid #e8edf4;
    text-transform: uppercase;
  }
  td {
    color: #344960;
    font-size: 13px;
    line-height: 1.65;
    padding: 17px 24px;
    border-bottom: 1px solid #edf1f6;
    font-variant-numeric: tabular-nums;
  }
  tbody tr:hover {
    background: #f7faff;
  }
  tbody tr:last-child td {
    border-bottom: 0;
  }
  td .button {
    min-height: 40px;
    padding: 8px 12px;
    font-size: 11px;
  }
  .badge {
    padding: 5px 10px;
    border-radius: 7px;
    font-size: 11px;
    line-height: 1.45;
    font-weight: 600;
    white-space: normal;
    max-width: 100%;
  }
  .badge.green,
  .badge.mint {
    color: #176951;
    background: #e6f7ef;
  }
  .badge.blue {
    color: #0b5db6;
    background: #eaf3ff;
  }
  .badge.orange,
  .badge.amber {
    color: #895013;
    background: #fff3dd;
  }
  .badge.red {
    color: #a12b3b;
    background: #fff0f1;
  }
  .person strong {
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
  }
  .person small {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
  }
  .avatar {
    border-radius: 12px;
    font-weight: 650;
  }
  .avatar.mint {
    background: var(--soft-teal);
    color: #15735f;
  }
  .avatar.owner {
    color: #0e5b9d;
    background: #e3f1ff;
  }
  body :is(input:not([type='checkbox']):not([type='radio']):not([type='file']), select, textarea) {
    min-height: 46px;
    border-color: #cbd8e5;
    border-radius: 10px;
    color: var(--ink);
    font-size: 14px;
    background-color: #ffffff;
    padding-block: 11px;
  }
  body textarea {
    min-height: 112px;
    line-height: 1.65;
    resize: vertical;
  }
  input::placeholder,
  textarea::placeholder {
    color: #738298;
    opacity: 1;
  }
  input:read-only:not([type='checkbox']):not([type='radio']) {
    background-color: #f5f8fb;
  }
  input[type='checkbox'],
  input[type='radio'] {
    accent-color: var(--action);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  form label,
  .profile-fields label,
  .consumer-filters label {
    color: #405670;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.55;
    gap: 8px;
  }
  .form-grid,
  .profile-fields {
    gap: 20px;
  }
  .form-error:not(:empty) {
    color: #a42d3f;
    padding: 12px 14px;
    border: 1px solid #f1cbd2;
    border-radius: 10px;
    background: #fff5f6;
    font-size: 13px;
    line-height: 1.65;
  }
  .upload-field {
    border: 1px dashed #a6c3e6;
    background: #f7fbff;
    border-radius: 12px;
    min-height: 64px;
    padding: 16px;
    color: var(--action);
  }
  dialog {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow-floating);
    max-width: min(760px, calc(100vw - 32px));
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  dialog::backdrop {
    background: #061b3380;
  }
  dialog h2 {
    font-size: 23px;
    letter-spacing: -0.6px;
  }
  dialog .form-actions {
    padding-top: 20px;
    border-top: 1px solid var(--line);
    margin-top: 26px;
  }
  .empty-state {
    padding: 44px 24px;
    color: var(--muted);
  }
  .empty-state > svg {
    width: 40px;
    height: 40px;
    padding: 8px;
    box-sizing: content-box;
    color: #5c8dc4;
    background: #f0f6fd;
    border-radius: 16px;
    margin-bottom: 12px;
  }
  .empty-state h2 {
    font-size: 17px;
    color: var(--ink);
    letter-spacing: -0.3px;
  }
  .empty-state p {
    font-size: 13px;
    line-height: 1.75;
    max-width: 430px;
    margin-inline: auto;
  }
  .list-toolbar,
  .filters,
  .consumer-filters,
  .area-form {
    gap: 14px;
    border-color: var(--line);
  }
  .task-item,
  .admin-task,
  .quick-action {
    border-color: var(--line);
    border-radius: 12px;
  }
  .quick-action {
    min-height: 68px;
    background: #f8fbff;
    padding: 16px;
  }
  .quick-action:hover {
    background: var(--soft-blue);
    border-color: #bdd7f5;
  }
  .admin-chart-grid,
  .dashboard-grid,
  .report-grid,
  .lower-grid {
    gap: 24px;
  }
  .admin-view-switch,
  .subscription-cycle {
    background: #edf2f8;
    border-color: #dce5ef;
    border-radius: 12px;
  }
  .admin-view-switch .button.active,
  .admin-view-switch .button[aria-pressed='true'] {
    background: #ffffff;
    color: var(--action);
    box-shadow: 0 1px 5px #0a1a2f12;
  }
  .admin-task-board {
    gap: 20px;
  }
  .admin-task {
    background: #ffffff;
    padding: 18px;
    box-shadow: var(--shadow-card);
  }
  .ticket-thread article {
    border-radius: 14px;
    padding: 20px;
  }
  .ticket-thread article.team {
    background: #eef6ff;
    border-color: #cfe3fa;
  }
  .counter-product-grid {
    gap: 16px;
  }
  .counter-product-grid article {
    border-radius: 14px;
    border-color: var(--line);
    padding: 20px;
  }
  .counter-total {
    background: #eef8f7;
    border-radius: 12px;
    padding: 18px;
  }
  .subscription-card {
    border-radius: 20px;
    box-shadow: var(--shadow-card);
  }
  .subscription-plus {
    border-color: #72acef;
    background: #f4f9ff;
  }
  .text-link {
    color: var(--action);
    text-underline-offset: 3px;
  }
  .text-link:hover {
    text-decoration: underline;
  }
  footer {
    font-size: 11px;
    color: var(--muted);
    padding: 24px clamp(24px, 3vw, 48px);
    gap: 12px 24px;
    border-top: 1px solid var(--line);
    background: #ffffff;
    flex-wrap: wrap;
  }
  /* Patient portal: calmer reading measure and generous care cards. */
  .patient-view main {
    width: 100%;
    max-width: 1360px;
    padding: 26px 40px 56px;
  }
  .portal-toolbar {
    gap: 24px;
    min-height: 82px;
    margin-bottom: 36px;
    padding-block: 10px 22px;
    border-bottom: 1px solid var(--line);
  }
  .portal-brand .real-logo {
    width: 212px;
    height: 56px;
  }
  .portal-toolbar nav {
    gap: 12px;
  }
  .portal-toolbar nav a:not(.button) {
    font-size: 13px;
    font-weight: 550;
    min-height: 44px;
    padding: 11px 14px;
    border-radius: 10px;
    color: #425973;
  }
  .consumer-header nav a[aria-current] {
    color: var(--action);
    background: var(--soft-blue);
    border-bottom: 0;
    font-weight: 650;
  }
  .portal-toolbar nav a:hover {
    background: #edf4fc;
    color: var(--action);
  }
  .portal-toolbar nav .button.primary:hover {
    color: #ffffff;
    background: var(--action-hover);
  }
  .discovery-hero {
    border-radius: 24px;
    padding: 64px 56px;
    background: var(--navy);
    min-height: 420px;
  }
  .discovery-hero .eyebrow {
    color: #67e7e9;
  }
  .discovery-hero h1 {
    font-size: clamp(34px, 4vw, 54px);
    letter-spacing: -1.7px;
    line-height: 1.15;
  }
  .discovery-hero p {
    color: #c4d5e8;
    font-size: 16px;
    line-height: 1.8;
  }
  .discovery-hero .button:not(.primary) {
    background: #ffffff0a;
    color: #ffffff;
    border-color: #ffffff4d;
  }
  .discovery-hero .button:not(.primary):hover {
    background: #ffffff17;
  }
  .doctor-grid,
  .practice-grid,
  .visit-grid,
  .family-grid {
    gap: 24px;
  }
  .doctor-card,
  .practice-public-card,
  .visit-card,
  .family-card {
    padding: 26px;
  }
  .doctor-card h3,
  .practice-public-card h3,
  .visit-card h3,
  .family-card h3 {
    font-size: 18px;
    letter-spacing: -0.5px;
    line-height: 1.4;
  }
  .doctor-card p,
  .practice-public-card p,
  .visit-card p,
  .family-card p {
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
  }
  .doctor-portrait {
    border: 1px solid #e2ebf4;
    border-radius: 18px;
    object-fit: cover;
  }
  .area-form,
  .consumer-filters {
    padding: 24px;
    border-radius: 16px;
    background: var(--surface);
  }
  .consumer-tabs a,
  .consumer-tabs button {
    min-height: 46px;
    color: #52677e;
    font-size: 13px;
  }
  .consumer-tabs [aria-current],
  .consumer-tabs [aria-selected='true'] {
    color: var(--action);
    border-bottom-color: var(--action);
  }
  .dental-auth {
    border-color: #d2e1ee;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 16px 56px #0a1a2f0c;
  }
  .dental-auth-content {
    background: #ffffff;
  }
  .dental-auth-content h2 {
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -1px;
  }
  .dental-auth-content p {
    line-height: 1.75;
  }
  #toast {
    border-radius: 12px;
    background: var(--navy);
    color: #ffffff;
    padding: 16px 22px;
    box-shadow: var(--shadow-floating);
    font-size: 13px;
  }
}
@media screen and (max-width: 1200px) {
  body:not(.patient-view) .sidebar {
    width: 232px;
    padding-inline: 14px;
  }
  body:not(.patient-view) .workspace {
    margin-left: 232px;
  }
  body:not(.patient-view) main {
    padding: 28px 24px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .patient-view .portal-toolbar {
    flex-wrap: wrap;
  }
  .patient-view .consumer-header nav {
    flex-wrap: wrap;
    gap: 6px;
  }
}
@media screen and (max-width: 1000px) {
  .dashboard-grid,
  .admin-chart-grid,
  .counter-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .topbar .preview-switch {
    display: none;
  }
  .patient-view main {
    padding-inline: 24px;
  }
  .page-heading .actions {
    flex-shrink: 1;
  }
}
@media screen and (max-width: 760px) {
  body:not(.patient-view) .sidebar {
    width: min(280px, calc(100vw - 52px));
    padding: 22px 18px;
    z-index: 50;
  }
  body:not(.patient-view) .workspace {
    margin-left: 0;
  }
  body:not(.patient-view) main,
  .patient-view main {
    padding: 26px 16px 32px;
  }
  .topbar {
    min-height: 70px;
    padding: 12px 16px;
    gap: 8px;
  }
  .topbar-right {
    gap: 6px;
  }
  .breadcrumb {
    font-size: 11px;
    gap: 6px;
    min-width: 0;
  }
  .topbar .location-select select {
    max-width: 120px;
    font-size: 11px;
    padding-inline: 8px;
  }
  .topbar .avatar,
  .topbar-divider {
    display: none;
  }
  .mobile-menu {
    display: inline-grid;
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }
  .page-heading {
    margin-bottom: 24px;
    gap: 16px;
  }
  .page-heading .actions {
    padding-top: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .page-heading h1 {
    font-size: 28px;
    letter-spacing: -0.9px;
  }
  .stats {
    gap: 12px;
  }
  .stat,
  .platform-view .stat {
    padding: 18px 16px;
  }
  .stat-icon {
    display: none;
  }
  .stat-value strong {
    font-size: 28px;
  }
  .panel-header {
    padding: 20px 18px 16px;
  }
  .panel-body {
    padding: 4px 18px 22px;
  }
  th,
  td {
    padding-inline: 18px;
  }
  .profile-fields,
  .form-row,
  .report-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  body :is(input:not([type='checkbox']):not([type='radio']):not([type='file']), select, textarea) {
    font-size: 16px;
  }
  .portal-toolbar {
    gap: 18px;
    margin-bottom: 28px;
  }
  .public-header nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }
  .public-header nav .practice-entry-link {
    border-left: 0;
    padding-left: 10px;
  }
  .portal-brand .real-logo {
    width: 190px;
    height: 50px;
  }
  .discovery-hero {
    padding: 36px 26px;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }
  .discovery-hero h1 {
    font-size: 36px;
  }
  .hero-emblem {
    display: none;
  }
  .discovery-hero .landing-actions {
    flex-wrap: wrap;
  }
  .patient-view .doctor-grid,
  .patient-view .practice-grid,
  .patient-view .visit-grid,
  .patient-view .family-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .doctor-card,
  .practice-public-card,
  .visit-card,
  .family-card {
    padding: 22px;
  }
  .patient-view .consumer-header nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    width: 100%;
  }
  .consumer-header nav a {
    white-space: nowrap;
  }
  .dental-auth {
    border-radius: 18px;
    margin-block: 16px 32px;
  }
  dialog {
    padding: 22px 18px;
    border-radius: 18px;
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
  }
  footer {
    padding: 24px 18px;
    line-height: 1.75;
  }
  #toast {
    left: 50%;
    bottom: 24px;
  }
}
@media screen and (max-width: 600px) {
  .patient-view .consumer-header nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }
  .patient-view .consumer-header nav a {
    flex-direction: column;
    gap: 6px;
    padding: 8px 2px;
    font-size: 10px;
    line-height: 1.3;
    min-height: 60px;
    white-space: normal;
    border-radius: 12px;
  }
  .patient-view .consumer-header nav a[aria-current] {
    background: #eaf3ff;
  }
  .patient-view:has(.consumer-header) #toast {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
  .topbar .breadcrumb {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
  }
  .topbar {
    flex-wrap: wrap;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-end;
  }
  .topbar .location-select {
    display: block;
    margin-right: auto;
  }
  .topbar .breadcrumb strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .area-form {
    flex-direction: column;
    align-items: stretch;
  }
  .area-form label {
    max-width: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keep public entry actions visible while compact navigation moves into a menu. */
.public-header .public-mobile-menu {
  display: none;
}
.public-header .public-desktop-links {
  margin-left: auto;
  width: auto;
}
.public-entry-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.public-entry-actions .practice-entry-link {
  font-size: 13px;
  font-weight: 600;
  padding: 12px;
}
@media (max-width: 800px) {
  .portal-toolbar.public-header {
    position: relative;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }
  .public-header .public-desktop-links {
    display: none;
  }
  .public-header .public-mobile-menu {
    display: block;
    flex: 0 0 44px;
    order: 3;
  }
  .public-mobile-menu summary {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    cursor: pointer;
    border: 1px solid #d7e2ef;
    border-radius: 10px;
    color: #0a1a2f;
    background: white;
  }
  .public-mobile-menu summary::-webkit-details-marker {
    display: none;
  }
  .public-mobile-menu summary svg {
    width: 21px;
    height: 21px;
  }
  .public-mobile-menu summary:focus-visible {
    outline: 3px solid #147bff;
    outline-offset: 3px;
  }
  .public-header .public-mobile-menu nav {
    position: absolute;
    z-index: 30;
    top: calc(100% - 12px);
    right: 0;
    display: flex;
    flex-direction: column;
    width: min(240px, 100%);
    padding: 10px;
    gap: 6px;
    border: 1px solid #d7e2ef;
    border-radius: 14px;
    background: white;
    box-shadow: 0 12px 32px #0a1a2f1a;
    box-sizing: border-box;
  }
  .public-mobile-menu:not([open]) nav {
    display: none;
  }
  .public-header .public-mobile-menu nav a {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 16px;
  }
  .public-header .portal-brand {
    min-width: 0;
    flex-shrink: 1;
    order: 0;
    margin-right: auto;
  }
  .public-header .portal-brand .real-logo {
    width: clamp(66px, 19vw, 150px);
    height: auto;
  }
  .public-entry-actions {
    display: contents;
    gap: 8px;
  }
  .public-header .public-entry-actions .practice-entry-link {
    order: 1;
  }
  .public-header .public-entry-actions .button.primary {
    order: 2;
  }
  .public-entry-actions .practice-entry-link,
  .public-entry-actions .button.primary {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    white-space: nowrap;
    font-size: 11px;
    box-sizing: border-box;
  }
  .public-header .public-entry-actions .practice-entry-link {
    border-left: 0;
  }
}
@media (max-width: 380px) {
  .portal-toolbar.public-header {
    gap: 5px;
  }
  .public-header .portal-brand .real-logo {
    width: 56px;
  }
  .public-entry-actions {
    gap: 4px;
  }
  .public-entry-actions .practice-entry-link,
  .public-entry-actions .button.primary {
    padding-inline: 6px;
    font-size: 10px;
  }
}
.error-page {
  max-width: 700px;
  margin: 50px auto;
  padding: clamp(28px, 6vw, 60px);
  text-align: center;
  border: 1px solid #d7e2ef;
  border-radius: 24px;
  background: white;
}
.error-page h1 {
  color: #0a1a2f;
  font-size: clamp(26px, 5vw, 38px);
  line-height: 1.3;
  margin-top: 24px;
}
.error-page p {
  line-height: 1.8;
  color: #40516a;
}
.error-page .form-actions {
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
