:root {
  color-scheme: dark;
  --ink: #f6efe7;
  --muted: #b9a89b;
  --soft: #8f7e72;
  --panel: rgba(42, 31, 27, 0.74);
  --panel-strong: rgba(54, 39, 33, 0.9);
  --line: rgba(246, 239, 231, 0.12);
  --gold: #d9b86e;
  --gold-soft: #f1d590;
  --rose: #d9a9a0;
  --mint: #b9d9c1;
  --aqua: #b7e3ea;
  --espresso: #1d1512;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --metal: linear-gradient(135deg, rgba(255, 239, 188, 0.28), rgba(198, 143, 72, 0.09) 42%, rgba(255, 255, 255, 0.05));
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(217, 184, 110, 0.16), transparent 32rem),
    radial-gradient(circle at 86% 20%, rgba(217, 169, 160, 0.16), transparent 34rem),
    linear-gradient(145deg, #211611 0%, #120d0b 48%, #2a1b17 100%);
  font-family: Aptos, "Segoe UI", sans-serif;
}

body.locked {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

body.public-page {
  min-height: 100vh;
  color: var(--ink);
}

body.public-page a {
  color: var(--gold-soft);
}

.public-shell {
  width: min(58rem, 100%);
  margin: 0 auto;
  padding: max(2rem, env(safe-area-inset-top)) 1.1rem max(2rem, env(safe-area-inset-bottom));
}

.public-card {
  padding: clamp(1.3rem, 5vw, 3.2rem);
  border: 1px solid rgba(217, 184, 110, 0.28);
  border-radius: clamp(1.5rem, 5vw, 2.6rem);
  background: rgba(42, 31, 27, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.public-card h1 {
  margin: 0.7rem 0 1rem;
  font-family: Constantia, Georgia, serif;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 0.95;
}

.public-lead {
  max-width: 48rem;
  margin: 0 0 2rem;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.8vw, 1.28rem);
  line-height: 1.55;
}

.public-section {
  margin-top: 1.1rem;
  padding: 1.1rem;
  border: 1px solid rgba(246, 239, 231, 0.1);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.04);
}

.public-section h2 {
  margin: 0 0 0.55rem;
  color: var(--gold-soft);
  font-size: 1.1rem;
}

.public-section p,
.public-section li {
  color: var(--muted);
  line-height: 1.62;
}

.public-section p {
  margin: 0.45rem 0 0;
}

.public-section ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.public-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.public-actions .button {
  min-width: min(100%, 13rem);
}

body.locked .shell {
  filter: blur(12px);
  pointer-events: none;
  user-select: none;
}

.admin-lock {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background:
    radial-gradient(circle at 28% 16%, rgba(217, 184, 110, 0.22), transparent 28rem),
    rgba(18, 13, 11, 0.76);
  backdrop-filter: blur(18px);
}

.admin-lock[hidden] {
  display: none;
}

.lock-card {
  width: min(32rem, 100%);
  padding: 2rem;
  border: 1px solid rgba(217, 184, 110, 0.26);
  border-radius: 2rem;
  background: rgba(42, 31, 27, 0.92);
  box-shadow: var(--shadow);
}

.lock-card .brand-mark {
  margin-bottom: 1rem;
}

.lock-card h1 {
  margin-top: 0.5rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.lock-card p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.5;
}

.lock-card input {
  margin: 0.5rem 0 0.8rem;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}

.lock-card .button {
  width: 100%;
  margin-top: 0.55rem;
}

.lock-notice {
  min-height: 1.4rem;
  margin: 0.9rem 0 0;
  color: #ffd2c3;
}

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

button,
.button,
.segmented button,
a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(217, 184, 110, 0.18);
}

input,
select,
textarea {
  font-size: 16px;
}

.ambient {
  position: fixed;
  z-index: 0;
  width: 28rem;
  height: 28rem;
  border-radius: 999px;
  filter: blur(32px);
  opacity: 0.28;
  pointer-events: none;
}

.ambient-one {
  top: -8rem;
  right: 10vw;
  background: #d9b86e;
}

.ambient-two {
  bottom: -12rem;
  left: 6vw;
  background: #b7e3ea;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  height: 100vh;
  padding: 2rem 1.4rem;
  border-right: 1px solid var(--line);
  background: rgba(20, 14, 12, 0.72);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid rgba(217, 184, 110, 0.5);
  border-radius: 1.1rem;
  color: #241915;
  background: linear-gradient(135deg, #f5e5be, #c99c50);
  font-family: Constantia, Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.08em;
}

.brand p,
.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  margin-top: 0.15rem;
  font-family: Constantia, Georgia, serif;
  font-size: 1.3rem;
  line-height: 1;
}

.nav-list {
  display: grid;
  gap: 0.45rem;
}

.nav-list a {
  padding: 0.85rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: 180ms ease;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.side-card {
  margin-top: auto;
  padding: 1rem;
  border: 1px solid rgba(217, 184, 110, 0.22);
  border-radius: 1.3rem;
  background: rgba(217, 184, 110, 0.08);
}

.side-card p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(217, 184, 110, 0.4);
  animation: pulse 2.6s infinite;
}

.content {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 2.4rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

h1,
h2 {
  margin: 0;
  font-family: Constantia, Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 780px;
  margin-top: 0.35rem;
  font-size: clamp(2.4rem, 5vw, 5.6rem);
  line-height: 0.92;
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  line-height: 1;
}

.subline {
  max-width: 620px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.top-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.status-pill,
.button {
  display: inline-flex;
  min-height: 2.8rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.78rem 1.05rem;
  white-space: nowrap;
}

.status-pill {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.status-pill.connected {
  color: #1e1713;
  border-color: rgba(185, 217, 193, 0.5);
  background: var(--mint);
}

.button {
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(217, 184, 110, 0.45);
}

.button.primary {
  color: #201612;
  border-color: transparent;
  background: linear-gradient(135deg, #f3dfad, #cfa45a);
  font-weight: 800;
}

.button.subtle {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(245, 221, 158, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(217, 184, 110, 0.1);
}

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

.button.danger {
  color: #ffd0c8;
  border-color: rgba(255, 132, 112, 0.35);
  background: rgba(120, 34, 28, 0.18);
}

.button.tiny {
  min-height: 2.15rem;
  padding: 0.48rem 0.82rem;
  font-size: 0.86rem;
  font-weight: 800;
}

.customer-password-button {
  margin-top: 0.45rem;
  color: #1e1713;
  border-color: rgba(217, 184, 110, 0.55);
  background: linear-gradient(135deg, #f3dfad, #cfa45a);
  box-shadow: 0 8px 24px rgba(217, 184, 110, 0.16);
}

.panel,
.kpi-card {
  border: 1px solid var(--line);
  border-radius: 1.7rem;
  background:
    radial-gradient(circle at 95% 0%, rgba(217, 184, 110, 0.1), transparent 16rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 34%),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel {
  padding: 1.35rem;
}

.setup-panel {
  display: grid;
  grid-template-columns: minmax(16rem, 0.72fr) 1.28fr;
  gap: 1.3rem;
  margin-bottom: 1rem;
}

.setup-panel p:not(.eyebrow) {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

label.wide,
.form-actions.wide {
  grid-column: 1 / -1;
}

input {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  outline: none;
  padding: 0 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

input:focus {
  border-color: rgba(217, 184, 110, 0.68);
  box-shadow: 0 0 0 4px rgba(217, 184, 110, 0.12);
}

.notice {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(217, 169, 160, 0.38);
  border-radius: 1.1rem;
  color: #ffe9df;
  background: rgba(217, 169, 160, 0.12);
}

.notice.success {
  border-color: rgba(185, 217, 193, 0.38);
  color: #efffed;
  background: rgba(185, 217, 193, 0.12);
}

.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
}

.filter-panel p:not(.eyebrow) {
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.segmented {
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.segmented button {
  min-height: 2.4rem;
  border: 0;
  border-radius: 999px;
  padding: 0 0.95rem;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: 160ms ease;
}

.segmented button:hover,
.segmented button.active {
  color: #211612;
  background: var(--gold);
}

.kpi-grid,
.dashboard-grid {
  display: grid;
  gap: 1rem;
}

.kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(9.6rem, 1fr));
  margin: 1rem 0;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  margin-top: 1rem;
}

.wide-panel {
  grid-column: 1 / -1;
}

.kpi-card {
  min-height: 10.5rem;
  padding: 1.15rem;
  overflow: hidden;
}

.kpi-card.highlight {
  background:
    linear-gradient(135deg, rgba(217, 184, 110, 0.24), transparent),
    var(--panel-strong);
}

.kpi-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.kpi-card strong {
  display: block;
  margin-top: 1.2rem;
  font-family: Constantia, Georgia, serif;
  font-size: clamp(2.8rem, 5vw, 4.5rem);
  font-weight: 600;
  line-height: 0.85;
}

.kpi-card span {
  display: block;
  margin-top: 0.85rem;
  color: var(--soft);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.muted {
  color: var(--soft);
  font-size: 0.9rem;
}

.funnel {
  display: grid;
  gap: 0.85rem;
}

.funnel-row {
  display: grid;
  grid-template-columns: 9rem 1fr 4rem;
  align-items: center;
  gap: 0.9rem;
}

.funnel-row small {
  display: block;
  color: var(--soft);
  font-size: 0.75rem;
}

.bar {
  height: 0.95rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  width: var(--width, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--rose));
  transition: width 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.treatment-list {
  display: grid;
  gap: 0.75rem;
  max-height: 28rem;
  overflow-y: auto;
  padding-right: 0.35rem;
  overscroll-behavior: contain;
}

.treatment-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  padding: 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
}

.treatment-item strong {
  display: block;
  margin-bottom: 0.35rem;
}

.treatment-item > div span {
  color: var(--muted);
  font-size: 0.92rem;
}

.treatment-item .count-badge,
.count-badge {
  display: inline-flex;
  min-width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #17100c !important;
  background: linear-gradient(135deg, #f8e3a8, #d2a149);
  font-weight: 900;
  font-size: 0.95rem;
  line-height: 1;
  text-shadow: none;
}

.count-badge.compact {
  min-width: 2rem;
  height: 2rem;
  font-size: 0.85rem;
}

.push-panel {
  margin: 1rem 0;
}

.studio-briefing {
  grid-template-columns: minmax(0, 1.05fr) minmax(20rem, 0.95fr);
  align-items: stretch;
  margin: 1rem 0;
}

.today-panel,
.backup-panel {
  overflow: hidden;
}

.today-briefing,
.backup-status {
  display: grid;
  gap: 0.75rem;
}

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

.today-card,
.backup-status-card {
  min-height: 7.2rem;
  padding: 0.95rem;
  border: 1px solid rgba(217, 184, 110, 0.28);
  border-radius: 1.25rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(217, 184, 110, 0.055)),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.today-card > div,
.backup-status-card > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.today-card span,
.backup-status-card span {
  display: block;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.today-card strong,
.backup-status-card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
}

.today-card p,
.backup-status-card p {
  margin: 0.75rem 0 0;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.today-card.tone-gold,
.backup-status-card.tone-ok {
  border-color: rgba(217, 184, 110, 0.48);
  background:
    linear-gradient(135deg, rgba(217, 184, 110, 0.22), rgba(255, 255, 255, 0.06)),
    rgba(255, 255, 255, 0.055);
}

.today-card.tone-ok strong,
.backup-status-card.tone-ok strong {
  color: var(--sage);
}

.today-card.tone-attention,
.backup-status-card.tone-attention {
  border-color: rgba(217, 184, 110, 0.58);
  background:
    linear-gradient(135deg, rgba(217, 184, 110, 0.18), rgba(255, 230, 180, 0.04)),
    rgba(255, 255, 255, 0.045);
}

.today-card.tone-risk,
.backup-status-card.tone-risk {
  border-color: rgba(255, 129, 93, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 129, 93, 0.13), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.04);
}

.today-card.tone-risk strong,
.backup-status-card.tone-risk strong {
  color: #ffb59d;
}

.backup-actions {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.push-form {
  display: grid;
  grid-template-columns: minmax(14rem, 0.55fr) minmax(18rem, 1fr);
  gap: 1rem;
}

.push-template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.9rem 0 1rem;
}

.push-template-chip {
  min-height: 2.6rem;
  border: 1px solid rgba(217, 184, 110, 0.36);
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(217, 184, 110, 0.16), rgba(255, 255, 255, 0.055)),
    rgba(255, 255, 255, 0.055);
  font-weight: 850;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.push-template-chip:hover,
.push-template-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(248, 227, 168, 0.72);
  background:
    linear-gradient(135deg, rgba(248, 227, 168, 0.25), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.07);
}

.push-audience {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(217, 184, 110, 0.22);
  border-radius: 1.2rem;
  background: rgba(217, 184, 110, 0.08);
}

.push-audience span {
  color: var(--muted);
  font-size: 0.9rem;
}

.push-campaigns {
  display: grid;
  gap: 0.75rem;
  max-height: 25rem;
  overflow-y: auto;
  padding-right: 0.3rem;
  overscroll-behavior: contain;
  scrollbar-color: rgba(217, 184, 110, 0.55) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.push-campaigns::-webkit-scrollbar {
  width: 0.45rem;
}

.push-campaigns::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.push-campaigns::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, #f8e3a8, #9d7431);
}

.push-campaign {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.045);
}

.push-campaign.has-error {
  border-color: rgba(255, 180, 168, 0.55);
  background:
    linear-gradient(135deg, rgba(255, 180, 168, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(255, 255, 255, 0.045);
}

.push-campaign p {
  margin: 0.35rem 0;
  color: var(--muted);
  line-height: 1.4;
}

.push-campaign small {
  color: var(--soft);
}

.push-campaign .push-error {
  display: block;
  margin-top: 0.45rem;
  color: #ffb4a8;
  font-weight: 750;
  line-height: 1.35;
}

.table-wrap {
  max-height: 34rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, rgba(246, 239, 231, 0.035), rgba(0, 0, 0, 0.08)),
    rgba(20, 13, 11, 0.18);
  overscroll-behavior: contain;
}

.activity-wrap {
  max-height: 28rem;
}

.dashboard-grid .panel {
  min-height: 0;
}

.panel-copy {
  margin: -0.5rem 0 1rem;
  color: var(--muted);
  line-height: 1.45;
}

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

.activity-table {
  min-width: 860px;
  table-layout: fixed;
}

.activity-table th:nth-child(1) {
  width: 15%;
}

.activity-table th:nth-child(2) {
  width: 22%;
}

.activity-table th:nth-child(3) {
  width: 21%;
}

.activity-table th:nth-child(4) {
  width: 21%;
}

.activity-table th:nth-child(5) {
  width: 21%;
}

.lead-table {
  min-width: 980px;
}

.feedback-table {
  min-width: 900px;
  table-layout: fixed;
}

.feedback-table th:nth-child(1) {
  width: 14%;
}

.feedback-table th:nth-child(2) {
  width: 24%;
}

.feedback-table th:nth-child(3) {
  width: 20%;
}

.feedback-table th:nth-child(4) {
  width: 42%;
}

.feedback-message {
  line-height: 1.45;
  color: var(--ink);
  white-space: pre-wrap;
}

.crash-table {
  min-width: 980px;
}

.customer-table {
  min-width: 1680px;
}

.appointment-cell {
  display: grid;
  gap: 0.3rem;
  min-width: 12rem;
}

.appointment-cell small {
  color: var(--muted);
}

.appointment-status {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(224, 190, 109, 0.35);
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  color: var(--gold);
  background: rgba(224, 190, 109, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.customer-table-wrap {
  max-height: 36rem;
}

.customer-tools {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 1rem;
}

.customer-search {
  width: min(34rem, 100%);
}

.customer-search span {
  display: block;
  margin: 0 0 0.42rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.customer-search input {
  width: 100%;
  min-height: 3.15rem;
  border: 1px solid rgba(217, 184, 110, 0.2);
  border-radius: 999px;
  padding: 0 1.15rem;
  outline: none;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(217, 184, 110, 0.055)),
    rgba(255, 255, 255, 0.045);
}

.customer-search input:focus {
  border-color: rgba(217, 184, 110, 0.68);
  box-shadow: 0 0 0 4px rgba(217, 184, 110, 0.12);
}

.customer-name {
  display: inline-block;
  margin-bottom: 0.22rem;
}

.customer-meta-list {
  display: grid;
  gap: 0.22rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}

.customer-meta-list b {
  color: var(--ink);
  font-weight: 800;
}

.contact-lines a {
  color: var(--cyan);
}

.customer-push-button,
.customer-edit-button,
.customer-timeline-button,
.customer-password-button,
.customer-login-test-button {
  display: block;
  width: max-content;
  margin-top: 0.48rem;
}

.customer-push-button:disabled,
.customer-edit-button:disabled,
.customer-timeline-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

.loyalty-cell {
  display: grid;
  gap: 0.55rem;
  min-width: 12rem;
}

.loyalty-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.loyalty-head strong {
  display: inline-grid;
  place-items: center;
  min-width: 2.45rem;
  min-height: 2.45rem;
  padding: 0.2rem 0.52rem;
  border-radius: 999px;
  color: #1e1713;
  background: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.loyalty-head span,
.loyalty-cell small {
  color: var(--muted);
  line-height: 1.25;
}

.stamp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.stamp-dot {
  width: 0.76rem;
  height: 0.76rem;
  border: 1px solid rgba(217, 184, 110, 0.44);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.stamp-dot.filled {
  border-color: rgba(239, 211, 125, 0.98);
  background: linear-gradient(135deg, #efd37d, #b89454);
  box-shadow: 0 0 0 3px rgba(217, 184, 110, 0.12);
}

.loyalty-cell .button {
  width: max-content;
  min-height: 2.25rem;
  padding: 0.55rem 0.86rem;
}

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

th {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background:
    linear-gradient(90deg, rgba(217, 184, 110, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
}

td {
  color: var(--ink);
}

tr:last-child td {
  border-bottom: 0;
}

.activity-row td {
  padding-block: 0.72rem;
}

.activity-time {
  color: rgba(246, 239, 231, 0.92);
  font-variant-numeric: tabular-nums;
}

.activity-name,
.activity-treatment {
  display: block;
  color: var(--ink);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.activity-row small {
  display: block;
  margin-top: 0.18rem;
  color: var(--soft);
  font-size: 0.78rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.activity-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 2.05rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(246, 239, 231, 0.09);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.activity-focus {
  display: block;
  color: var(--muted);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.tone-analysis,
.tone-profile,
.tone-anamnesis {
  background:
    var(--metal),
    rgba(217, 184, 110, 0.08);
}

.tone-booking,
.tone-whatsapp,
.tone-lead {
  color: #1e1713;
  background: linear-gradient(135deg, #cce6cf, #efd37d);
}

.tone-risk {
  background: rgba(217, 169, 160, 0.18);
}

.empty-row {
  color: var(--soft);
  text-align: center;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

select:focus,
textarea:focus {
  border-color: rgba(217, 184, 110, 0.68);
  box-shadow: 0 0 0 4px rgba(217, 184, 110, 0.12);
}

select {
  min-width: 10rem;
  min-height: 2.55rem;
  padding: 0 0.75rem;
}

textarea {
  min-width: 15rem;
  min-height: 5.3rem;
  resize: vertical;
  padding: 0.75rem;
  line-height: 1.35;
}

.note-cell {
  display: grid;
  gap: 0.55rem;
}

.note-cell .button {
  min-height: 2.25rem;
  padding: 0.55rem 0.85rem;
}

.protected-data-note {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 2.1rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid rgba(185, 217, 193, 0.32);
  border-radius: 999px;
  color: #d9f1df;
  background: rgba(185, 217, 193, 0.1);
  font-size: 0.82rem;
  font-weight: 800;
}

.anamnesis-cell {
  display: grid;
  gap: 0.7rem;
  min-width: 12rem;
}

.anamnesis-cell strong {
  display: block;
  margin-bottom: 0.2rem;
}

.anamnesis-cell small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.anamnesis-cell .button {
  width: max-content;
}

details {
  color: var(--muted);
}

summary {
  cursor: pointer;
  color: var(--ink);
}

.anamnesis-details {
  max-width: 18rem;
}

.anamnesis-details summary {
  list-style: none;
}

.anamnesis-details summary::-webkit-details-marker {
  display: none;
}

.anamnesis-content {
  max-height: 15rem;
  overflow: auto;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.05);
}

.anamnesis-content p {
  margin: 0 0 0.8rem;
  color: var(--ink);
}

.anamnesis-content p:last-child {
  margin-bottom: 0;
}

.anamnesis-content span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.4rem;
  background:
    radial-gradient(circle at 72% 16%, rgba(217, 184, 110, 0.18), transparent 26rem),
    rgba(14, 9, 8, 0.78);
  backdrop-filter: blur(18px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(68rem, 100%);
  max-height: min(86vh, 58rem);
  overflow: auto;
  border: 1px solid rgba(217, 184, 110, 0.24);
  border-radius: 2rem;
  background:
    linear-gradient(135deg, rgba(217, 184, 110, 0.08), transparent 28rem),
    rgba(39, 28, 24, 0.96);
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.52);
}

.anamnesis-modal-card {
  padding: 1.5rem;
}

.personal-push-modal-card {
  width: min(40rem, 100%);
  padding: 1.45rem;
}

.timeline-modal-card {
  width: min(54rem, 100%);
  padding: 1.45rem;
}

.timeline-list {
  display: grid;
  gap: 0.85rem;
  max-height: min(58vh, 36rem);
  overflow: auto;
  padding: 0.15rem 0.2rem 0.2rem;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid rgba(217, 184, 110, 0.14);
  border-radius: 1.1rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(217, 184, 110, 0.035)),
    rgba(255, 255, 255, 0.035);
}

.timeline-dot {
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.34rem;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(217, 184, 110, 0.12);
}

.timeline-item h3 {
  margin: 0.14rem 0 0.28rem;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.18;
}

.timeline-meta {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.timeline-detail {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.timeline-item.tone-booking .timeline-dot,
.timeline-item.tone-whatsapp .timeline-dot {
  background: #bfe4c8;
  box-shadow: 0 0 0 5px rgba(191, 228, 200, 0.11);
}

.timeline-item.tone-crash .timeline-dot {
  background: #ff8d7b;
  box-shadow: 0 0 0 5px rgba(255, 141, 123, 0.11);
}

.personal-push-form {
  display: grid;
  gap: 1rem;
  padding-top: 0.2rem;
}

.personal-template-row {
  margin: 0 0 0.2rem;
}

.personal-push-form label {
  display: grid;
  gap: 0.45rem;
  color: var(--muted);
  font-weight: 800;
}

.personal-push-form input,
.personal-push-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 1.05rem;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.personal-push-form input {
  min-height: 3.1rem;
  padding: 0 1rem;
}

.personal-push-form textarea {
  min-height: 8rem;
}

.personal-push-form input:focus,
.personal-push-form textarea:focus {
  border-color: rgba(217, 184, 110, 0.68);
  box-shadow: 0 0 0 4px rgba(217, 184, 110, 0.12);
}

.push-personal-notice {
  min-height: 1.35rem;
  margin: 0;
  color: #ffd2c3;
  line-height: 1.4;
}

.modal-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.55rem;
  line-height: 1;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 0.4rem 3.4rem 1rem 0.2rem;
}

.modal-head h2 {
  margin-top: 0.35rem;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.96;
}

.modal-subtitle {
  max-width: 46rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.modal-meta {
  min-width: 11rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(217, 184, 110, 0.25);
  border-radius: 1.2rem;
  background: rgba(217, 184, 110, 0.1);
}

.modal-meta span {
  display: block;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.modal-meta strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink);
}

.modal-side {
  display: grid;
  gap: 0.75rem;
  justify-items: end;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.modal-actions .button {
  min-height: 2.45rem;
  padding: 0.62rem 0.95rem;
  border-radius: 999px;
}

.anamnesis-warning-box {
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid rgba(217, 169, 160, 0.38);
  border-radius: 1.2rem;
  background: rgba(217, 169, 160, 0.12);
}

.anamnesis-warning-box strong {
  color: #ffe1d6;
}

.anamnesis-warning-box ul {
  margin: 0.55rem 0 0;
  padding-left: 1.2rem;
  color: var(--ink);
  line-height: 1.5;
}

.anamnesis-modal-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.anamnesis-group {
  min-height: 10rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.045);
}

.anamnesis-group h3 {
  margin: 0 0 0.95rem;
  color: var(--gold);
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.anamnesis-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.78rem;
}

.anamnesis-field {
  min-width: 0;
  padding: 0.74rem 0.78rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  background: rgba(0, 0, 0, 0.13);
}

.anamnesis-field span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.anamnesis-field strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.anamnesis-edit-field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.anamnesis-edit-field span {
  color: var(--soft);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.anamnesis-edit-field input,
.anamnesis-edit-field select,
.anamnesis-edit-field textarea {
  width: 100%;
  min-height: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.14);
}

.anamnesis-edit-field textarea {
  min-height: 6rem;
  resize: vertical;
}

.wide-edit {
  grid-column: 1 / -1;
}

pre {
  max-width: 28rem;
  max-height: 14rem;
  overflow: auto;
  margin: 0.7rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: #f6efe7;
  background: rgba(0, 0, 0, 0.22);
  white-space: pre-wrap;
  word-break: break-word;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 184, 110, 0.42);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(217, 184, 110, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 184, 110, 0);
  }
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 1.1rem;
  }

  .nav-list {
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  }

  .side-card {
    display: none;
  }

  .content {
    padding: 1rem;
  }

  .topbar,
  .setup-panel,
  .push-form,
  .filter-panel,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .filter-panel {
    display: grid;
  }

  .modal-head,
  .anamnesis-modal-body,
  .anamnesis-field-grid {
    grid-template-columns: 1fr;
  }

  .modal-head {
    display: grid;
    padding-right: 3rem;
  }

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

@media (max-width: 620px) {
  .nav-list,
  .kpi-grid,
  .config-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 1.2rem;
  }

  .push-audience,
  .push-campaign {
    display: grid;
    grid-template-columns: 1fr;
  }

  .today-briefing {
    grid-template-columns: 1fr;
  }

  .today-card,
  .backup-status-card {
    min-height: auto;
  }

  h1 {
    font-size: 2.65rem;
  }

  .funnel-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

@media (max-width: 760px) {
  .ambient {
    width: 18rem;
    height: 18rem;
    opacity: 0.2;
  }

  .admin-lock {
    align-items: end;
    padding:
      calc(env(safe-area-inset-top) + 0.9rem)
      max(0.85rem, env(safe-area-inset-right))
      calc(env(safe-area-inset-bottom) + 0.85rem)
      max(0.85rem, env(safe-area-inset-left));
  }

  .lock-card {
    padding: 1.25rem;
    border-radius: 1.45rem;
  }

  .lock-card h1 {
    font-size: clamp(2.05rem, 13vw, 3rem);
    line-height: 0.95;
  }

  .shell {
    min-height: 100dvh;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 12;
    gap: 0.75rem;
    padding:
      calc(env(safe-area-inset-top) + 0.7rem)
      max(0.8rem, env(safe-area-inset-right))
      0.75rem
      max(0.8rem, env(safe-area-inset-left));
    border-right: 0;
    border-bottom: 1px solid rgba(217, 184, 110, 0.16);
    background:
      linear-gradient(180deg, rgba(24, 16, 13, 0.96), rgba(24, 16, 13, 0.82)),
      rgba(20, 14, 12, 0.9);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.24);
  }

  .brand {
    gap: 0.65rem;
  }

  .brand-mark {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.86rem;
    font-size: 0.95rem;
  }

  .brand p {
    font-size: 0.58rem;
    letter-spacing: 0.16em;
  }

  .brand strong {
    font-size: 1rem;
  }

  .nav-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 0.15rem;
    scroll-padding-inline: 0.8rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-list a {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 2.55rem;
    align-items: center;
    justify-content: center;
    padding: 0.66rem 0.9rem;
    border-color: rgba(246, 239, 231, 0.09);
    background: rgba(255, 255, 255, 0.045);
    font-size: 0.92rem;
    font-weight: 850;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .nav-list a.active {
    border-color: rgba(217, 184, 110, 0.48);
    background:
      linear-gradient(135deg, rgba(217, 184, 110, 0.22), rgba(255, 255, 255, 0.04)),
      rgba(217, 184, 110, 0.1);
  }

  .content {
    padding:
      0.95rem
      max(0.82rem, env(safe-area-inset-right))
      calc(2rem + env(safe-area-inset-bottom))
      max(0.82rem, env(safe-area-inset-left));
  }

  .topbar {
    gap: 0.95rem;
    margin-bottom: 1rem;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.25rem, 12vw, 3.45rem);
    line-height: 0.94;
  }

  h2 {
    font-size: clamp(1.34rem, 7vw, 1.9rem);
  }

  .subline {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .top-actions,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.6rem;
  }

  .top-actions .status-pill {
    grid-column: 1 / -1;
  }

  .button,
  .status-pill {
    min-height: 3rem;
    padding: 0.8rem 0.9rem;
    font-size: 0.95rem;
  }

  .button.tiny {
    min-height: 2.65rem;
  }

  .panel,
  .kpi-card {
    border-radius: 1.25rem;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.26);
  }

  .panel {
    padding: 1rem;
  }

  .setup-panel,
  .filter-panel,
  .push-panel {
    margin-inline: -0.05rem;
  }

  .kpi-grid {
    gap: 0.72rem;
  }

  .kpi-card {
    min-height: 8.5rem;
    padding: 0.95rem;
  }

  .kpi-card strong {
    font-size: clamp(2.35rem, 13vw, 3.4rem);
  }

  .segmented {
    width: 100%;
    overflow-x: auto;
    display: flex;
    border-radius: 999px;
    -webkit-overflow-scrolling: touch;
  }

  .segmented button {
    flex: 1 0 auto;
    min-width: max-content;
    min-height: 2.55rem;
    padding-inline: 0.9rem;
    font-weight: 850;
  }

  .customer-tools,
  .panel-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .customer-search,
  .customer-tools .button,
  .panel-head .status-pill {
    width: 100%;
  }

  .table-wrap {
    max-height: 68dvh;
    margin-inline: -0.15rem;
    border-radius: 1rem;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap::after {
    content: "";
    position: sticky;
    right: 0;
    display: block;
    width: 2.4rem;
    height: 0;
    pointer-events: none;
    box-shadow: -18px 0 24px rgba(18, 13, 11, 0.36);
  }

  table {
    min-width: 720px;
  }

  .activity-table,
  .feedback-table {
    min-width: 760px;
  }

  .lead-table,
  .crash-table {
    min-width: 820px;
  }

  .customer-table {
    min-width: 1180px;
  }

  th,
  td {
    padding: 0.72rem 0.78rem;
    font-size: 0.9rem;
  }

  th {
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(12px);
  }

  .customer-meta-list,
  .anamnesis-cell small,
  .activity-row small {
    font-size: 0.84rem;
  }

  .loyalty-head strong,
  .count-badge {
    min-width: 2.25rem;
    min-height: 2.25rem;
  }

  select,
  textarea,
  input,
  .personal-push-form input,
  .personal-push-form textarea,
  .anamnesis-edit-field input,
  .anamnesis-edit-field select,
  .anamnesis-edit-field textarea {
    min-height: 3.15rem;
    border-radius: 1rem;
  }

  .modal-backdrop {
    align-items: end;
    justify-items: stretch;
    padding:
      calc(env(safe-area-inset-top) + 0.75rem)
      max(0.55rem, env(safe-area-inset-right))
      max(0.55rem, env(safe-area-inset-bottom))
      max(0.55rem, env(safe-area-inset-left));
  }

  .modal-card,
  .personal-push-modal-card,
  .timeline-modal-card {
    width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1.2rem);
    border-radius: 1.45rem 1.45rem 0.9rem 0.9rem;
  }

  .anamnesis-modal-card,
  .personal-push-modal-card,
  .timeline-modal-card {
    padding: 1rem;
  }

  .modal-close {
    width: 2.85rem;
    height: 2.85rem;
  }

  .modal-head {
    gap: 0.7rem;
    padding: 0.25rem 3.05rem 0.9rem 0;
  }

  .modal-head h2 {
    font-size: clamp(2rem, 11vw, 3rem);
    line-height: 0.96;
  }

  .modal-side,
  .modal-actions {
    justify-items: stretch;
    justify-content: stretch;
    width: 100%;
  }

  .modal-actions .button {
    flex: 1 1 100%;
    min-height: 2.85rem;
  }

  .anamnesis-group {
    padding: 0.9rem;
    border-radius: 1.1rem;
  }

  .anamnesis-field {
    padding: 0.68rem 0.72rem;
  }

  .timeline-list {
    max-height: 64dvh;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }
}

@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;
  }
}
