:root {
  --black: #070706;
  --charcoal: #151513;
  --ivory: #f3eee5;
  --paper: #fbf7ef;
  --stone: #81786c;
  --taupe: #b5a695;
  --bronze: #8b7058;
  --line: #d8cec0;
  --line-soft: rgba(216, 206, 192, 0.68);
  --white: #fffdf8;
  --danger: #8b3027;
  --success: #4d6d50;
  --shadow: 0 20px 60px rgba(7, 7, 6, 0.10);
  --radius: 8px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.boot-screen,
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(7, 7, 6, 0.88), rgba(7, 7, 6, 0.97)),
    radial-gradient(circle at 50% 20%, rgba(181, 166, 149, 0.12), transparent 34%),
    var(--black);
  color: var(--paper);
  padding: 28px;
}

.boot-screen {
  text-align: center;
  overflow: hidden;
}

.boot-card {
  width: min(100%, 760px);
  border: 1px solid rgba(216, 206, 192, 0.18);
  background:
    linear-gradient(180deg, rgba(21, 21, 19, 0.72), rgba(21, 21, 19, 0.88)),
    rgba(21, 21, 19, 0.82);
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.34);
  padding: clamp(30px, 6vw, 56px);
}

.boot-screen h1,
.auth-card h1,
.page-title h1,
.panel-title,
.crm-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0;
}

.boot-screen h1 {
  font-size: clamp(2.4rem, 8vw, 5rem);
}

.boot-copy,
.boot-meta {
  margin: 0 auto;
  max-width: 560px;
}

.boot-copy {
  color: rgba(251, 247, 239, 0.82);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
}

.boot-meta {
  color: rgba(216, 206, 192, 0.7);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boot-loader {
  width: min(100%, 320px);
  height: 1px;
  margin: 28px auto 16px;
  background: rgba(216, 206, 192, 0.22);
  overflow: hidden;
}

.boot-loader span {
  display: block;
  width: 38%;
  height: 100%;
  background: linear-gradient(90deg, rgba(216, 206, 192, 0), rgba(251, 247, 239, 0.95), rgba(216, 206, 192, 0));
  animation: boot-glide 1.4s ease-in-out infinite;
}

@keyframes boot-glide {
  0% {
    transform: translateX(-130%);
  }

  100% {
    transform: translateX(360%);
  }
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--taupe);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.auth-card {
  width: min(100%, 520px);
  border: 1px solid rgba(216, 206, 192, 0.24);
  background: rgba(21, 21, 19, 0.82);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.32);
  padding: clamp(28px, 6vw, 54px);
}

.auth-card.wide {
  width: min(100%, 900px);
}

.auth-card h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 0.98;
}

.auth-card p {
  color: rgba(251, 247, 239, 0.74);
}

.auth-card label {
  color: rgba(251, 247, 239, 0.86);
}

.auth-card input,
.auth-card textarea,
.auth-card select {
  background: rgba(251, 247, 239, 0.08);
  border-color: rgba(216, 206, 192, 0.32);
  color: var(--paper);
}

.auth-card input::placeholder {
  color: rgba(251, 247, 239, 0.42);
}

.auth-card select option {
  color: var(--charcoal);
  background: var(--paper);
}

.auth-card .notice {
  color: var(--paper);
  background: rgba(251, 247, 239, 0.10);
  border-color: rgba(216, 206, 192, 0.32);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--paper);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: var(--black);
  color: var(--paper);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand-lockup {
  display: grid;
  gap: 4px;
}

.brand-lockup strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 400;
}

.brand-lockup span {
  color: var(--taupe);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav a,
.nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: rgba(251, 247, 239, 0.68);
  font-size: 0.92rem;
  background: transparent;
  cursor: pointer;
}

.nav a:hover,
.nav a:focus-visible,
.nav button:hover,
.nav button:focus-visible,
.nav a[aria-current="page"] {
  border-color: rgba(181, 166, 149, 0.32);
  background: rgba(251, 247, 239, 0.08);
  color: var(--paper);
  outline: none;
}

.sidebar-note {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(216, 206, 192, 0.18);
  color: rgba(251, 247, 239, 0.58);
  font-size: 0.82rem;
}

.main {
  min-width: 0;
  padding: 28px clamp(18px, 4vw, 54px) 54px;
}

.topbar {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
  padding-bottom: 18px;
}

.topbar .actions {
  flex: 1;
  justify-content: flex-end;
}

.language-switch {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.language-switch .button {
  min-width: 46px;
  padding-inline: 12px;
}

.mobile-brand {
  display: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  border: 1px solid var(--line);
  padding: 0 12px;
  color: var(--stone);
  background: rgba(255, 253, 248, 0.62);
}

.page-title {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.page-title h1 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.03;
  max-width: 980px;
}

.page-title p {
  max-width: 720px;
  margin: 0;
  color: var(--stone);
  font-size: 1rem;
}

.toolbar,
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  padding: 8px;
  border: 1px solid var(--line);
  background: rgba(251, 247, 239, 0.94);
  backdrop-filter: blur(12px);
  overflow-x: auto;
  scrollbar-width: thin;
}

.section-tabs a {
  flex: 0 0 auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  padding: 0 12px;
  color: var(--stone);
  font-weight: 700;
  white-space: nowrap;
}

.section-tabs a:hover,
.section-tabs a:focus-visible {
  border-color: var(--line);
  background: var(--white);
  color: var(--charcoal);
  outline: none;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.55fr);
  align-items: start;
}

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

.stack-offset {
  margin-top: 18px;
}

.metric-strip {
  margin: 20px 0;
}

.request-context,
.time-context {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.time-context {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  padding: 14px;
  display: grid;
  gap: 7px;
}

.metric-card span {
  color: var(--stone);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.metric-card strong {
  min-width: 0;
  color: var(--charcoal);
  font-size: clamp(0.86rem, 1vw, 0.98rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.metric-card small {
  color: var(--stone);
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.spacer-sm {
  height: 14px;
}

.spacer-md {
  height: 16px;
}

.spacer-lg {
  height: 18px;
}

.panel,
.stat,
.timeline-item,
.request-row,
.profile-section {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.panel.dark {
  background: var(--charcoal);
  color: var(--paper);
  border-color: var(--charcoal);
}

.panel.soft {
  background: rgba(255, 253, 248, 0.84);
}

.panel-title {
  margin-bottom: 18px;
  font-size: 1.55rem;
}

.section-panel {
  scroll-margin-top: 92px;
}

.section-panel + .section-panel {
  margin-top: 22px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

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

.dashboard-layout.single-column {
  grid-template-columns: 1fr;
}

@media (max-width: 1400px) {
  .request-context,
  .time-context,
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.summary-item {
  min-width: 0;
  border: 1px solid var(--line-soft);
  background: rgba(255, 253, 248, 0.56);
  padding: 13px;
}

.summary-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--stone);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.summary-item strong {
  display: block;
  min-width: 0;
  color: var(--charcoal);
  font-size: 0.93rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.access-panel {
  margin: 16px 0;
}

.access-panel.active {
  border-color: rgba(77, 109, 80, 0.24);
  background: rgba(77, 109, 80, 0.06);
}

.access-panel.watch,
.access-panel.near-close {
  border-color: rgba(139, 112, 88, 0.24);
  background: rgba(139, 112, 88, 0.08);
}

.access-panel.closed {
  border-color: rgba(139, 48, 39, 0.24);
  background: rgba(139, 48, 39, 0.06);
}

.access-panel strong {
  display: block;
  margin-bottom: 4px;
}

.access-panel p {
  margin: 0;
}

.stat {
  min-height: 118px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.stat span {
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 400;
}

.request-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.request-row h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  font-weight: 650;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--stone);
  font-size: 0.84rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  padding: 0 9px;
  background: rgba(243, 238, 229, 0.68);
  color: var(--bronze);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.urgent {
  border-color: rgba(139, 48, 39, 0.32);
  color: var(--danger);
}

.badge.success {
  border-color: rgba(77, 109, 80, 0.28);
  color: var(--success);
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--charcoal);
  padding: 0 16px;
  background: transparent;
  color: var(--charcoal);
  cursor: pointer;
  font-weight: 650;
  text-align: center;
}

.button.primary {
  background: var(--charcoal);
  color: var(--paper);
}

.button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--paper);
}

.button.light {
  border-color: rgba(216, 206, 192, 0.48);
  color: var(--paper);
}

.button.subtle {
  border-color: var(--line);
  color: var(--stone);
  background: rgba(255, 253, 248, 0.46);
}

.button.is-enabled {
  border-color: rgba(77, 109, 80, 0.34);
  background: rgba(77, 109, 80, 0.1);
  color: var(--success);
}

.button.is-blocked {
  border-color: rgba(139, 48, 39, 0.28);
  color: var(--danger);
}

.button:hover,
.button:focus-visible {
  background: var(--black);
  border-color: var(--black);
  color: var(--paper);
  outline: none;
}

.button:disabled,
.button.is-busy {
  cursor: wait;
  opacity: 0.68;
}

.button.light:hover,
.button.light:focus-visible {
  background: var(--paper);
  color: var(--black);
}

.button.danger:hover,
.button.danger:focus-visible {
  background: #6f241d;
  border-color: #6f241d;
  color: var(--paper);
}

.button.is-enabled:hover,
.button.is-enabled:focus-visible {
  border-color: rgba(77, 109, 80, 0.42);
  background: rgba(77, 109, 80, 0.14);
  color: var(--success);
}

.button.is-blocked:hover,
.button.is-blocked:focus-visible {
  border-color: rgba(139, 48, 39, 0.32);
  background: rgba(139, 48, 39, 0.08);
  color: var(--danger);
}

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

.field,
.field.full {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--white);
  color: var(--charcoal);
  padding: 12px 12px;
  min-height: 45px;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(139, 112, 88, 0.12);
}

.help {
  margin: 0;
  color: var(--stone);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.notice {
  border: 1px solid var(--line);
  background: rgba(243, 238, 229, 0.8);
  color: var(--stone);
  padding: 14px 16px;
}

.notice.error {
  border-color: rgba(139, 48, 39, 0.24);
  color: var(--danger);
  background: rgba(139, 48, 39, 0.06);
}

.notice.success {
  border-color: rgba(77, 109, 80, 0.24);
  color: var(--success);
  background: rgba(77, 109, 80, 0.06);
}

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

.timeline-item {
  padding: 14px;
}

.timeline-item p {
  margin: 4px 0 0;
  color: var(--stone);
}

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

.message {
  display: grid;
  gap: 8px;
}

.message-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--stone);
  font-size: 0.78rem;
}

.message-head strong {
  color: var(--charcoal);
  font-size: 0.86rem;
}

.message-bubble {
  max-width: min(720px, 100%);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.78);
  padding: 14px;
}

.message.admin .message-bubble {
  border-color: rgba(21, 21, 19, 0.14);
  background: rgba(21, 21, 19, 0.04);
}

.message-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.chat-main,
.chat-aside {
  min-width: 0;
}

.chat-main {
  display: grid;
  gap: 16px;
}

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

.chat-thread {
  display: grid;
  gap: 12px;
  min-height: 320px;
  max-height: 620px;
  overflow: auto;
  padding: 8px 2px 8px 0;
}

.chat-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line);
  color: var(--stone);
  background: rgba(255, 253, 248, 0.5);
  padding: 20px;
  text-align: center;
}

.chat-message {
  display: flex;
}

.chat-message.self {
  justify-content: flex-end;
}

.chat-bubble {
  width: min(100%, 560px);
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.84);
  padding: 14px 15px;
}

.chat-message.admin.self .chat-bubble,
.chat-message.client.self .chat-bubble {
  border-color: rgba(21, 21, 19, 0.2);
  background: rgba(21, 21, 19, 0.06);
}

.chat-bubble-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.chat-bubble-head strong {
  color: var(--charcoal);
  font-size: 0.92rem;
}

.chat-bubble-head span,
.chat-bubble small {
  color: var(--stone);
  font-size: 0.77rem;
}

.chat-bubble p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-bubble small {
  display: block;
  margin-top: 8px;
}

.chat-composer {
  display: grid;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.chat-composer label {
  color: var(--stone);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-composer textarea {
  min-height: 120px;
  resize: vertical;
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-composer-actions [data-form-status] {
  flex: 1;
  margin: 0;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.hub-card {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.hub-card strong {
  font-size: 0.98rem;
}

.hub-card p {
  margin: 0;
  color: var(--stone);
  font-size: 0.9rem;
}

.hub-card span {
  color: var(--charcoal);
  font-weight: 650;
}

.benefit-list {
  margin: 16px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--stone);
}

.benefit-list li {
  padding-left: 2px;
}

.proposal-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.72);
  padding: 16px;
}

.proposal-card strong {
  display: block;
  margin-bottom: 4px;
}

.edit-box {
  margin: 22px 0;
  border: 1px solid var(--line);
  background: rgba(243, 238, 229, 0.45);
  padding: 14px;
}

.edit-box summary {
  cursor: pointer;
  color: var(--bronze);
  font-weight: 700;
}

.edit-box form {
  margin-top: 16px;
}

.toast-zone {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  border: 1px solid var(--line);
  background: var(--charcoal);
  color: var(--paper);
  padding: 13px 15px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
  border-color: var(--danger);
}

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 6, 0.44);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-card {
  width: min(100%, 520px);
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.modal-card .panel-title {
  font-size: 2rem;
  margin-bottom: 0;
}

.modal-actions {
  justify-content: flex-end;
}

.activity-link {
  display: block;
  transition: background 160ms ease, border-color 160ms ease;
}

.activity-link:hover,
.activity-link:focus-visible {
  border-color: var(--bronze);
  background: rgba(255, 253, 248, 0.96);
  outline: none;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.action-grid .button {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--white);
}

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

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

th {
  color: var(--stone);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.row-actions .button {
  min-height: 34px;
  padding: 0 10px;
}

.inline-edit {
  min-width: 360px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) minmax(120px, 0.8fr) auto;
  gap: 8px;
  align-items: end;
}

.inline-edit .field {
  gap: 4px;
}

.inline-edit label {
  font-size: 0.62rem;
}

.inline-edit input,
.inline-edit select {
  min-height: 38px;
  padding: 8px 9px;
}

.inline-edit .help {
  grid-column: 1 / -1;
}

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

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 3px;
}

.segmented button {
  border: 0;
  background: transparent;
  color: var(--stone);
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
}

.segmented button.is-active {
  background: var(--charcoal);
  color: var(--paper);
}

.profile-section {
  padding: 18px;
}

.profile-section.full {
  grid-column: 1 / -1;
}

.profile-section h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.empty {
  border: 1px dashed var(--line);
  padding: 28px;
  color: var(--stone);
  background: rgba(255, 253, 248, 0.46);
  text-align: center;
}

.cf-turnstile {
  min-height: 65px;
}

.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: rgba(251, 247, 239, 0.84);
  font-size: 0.96rem;
  letter-spacing: 0;
  text-transform: none;
}

.consent-check.full {
  grid-column: 1 / -1;
}

.consent-check input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px;
    border-right: 0;
    border-bottom: 1px solid rgba(216, 206, 192, 0.18);
  }

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

  .nav a {
    justify-content: center;
    text-align: center;
  }

  .nav button {
    justify-content: center;
    text-align: center;
  }

  .sidebar-note {
    display: none;
  }

  .grid.two,
  .grid.three,
  .membership-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  body {
    font-size: 14px;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 18px 14px 98px;
  }

  .mobile-brand {
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: -18px -14px 24px;
    padding: 12px 14px;
    background: rgba(251, 247, 239, 0.96);
    backdrop-filter: blur(12px);
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topbar .actions {
    flex-direction: row;
    justify-content: stretch;
  }

  .language-switch {
    width: 100%;
  }

  .nav {
    grid-template-columns: 1fr 1fr;
  }

  .mobile-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(88px, 1fr);
    gap: 4px;
    border-top: 1px solid var(--line);
    background: var(--paper);
    position: fixed;
    z-index: 5;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 7px;
    overflow-x: auto;
  }

  .mobile-nav a {
    min-height: 42px;
    display: grid;
    place-items: center;
    color: var(--stone);
    font-size: 0.78rem;
  }

  .mobile-nav button {
    min-height: 42px;
    display: grid;
    place-items: center;
    color: var(--stone);
    font-size: 0.78rem;
    border: 0;
    background: transparent;
  }

  .mobile-nav a[aria-current="page"] {
    background: var(--charcoal);
    color: var(--paper);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .request-row {
    grid-template-columns: 1fr;
  }

  .request-context,
  .time-context,
  .summary-grid,
  .action-grid,
  .chat-shell {
    grid-template-columns: 1fr;
  }

  .section-tabs {
    top: 0;
    margin-left: -2px;
    margin-right: -2px;
  }

  .inline-edit {
    min-width: 0;
    grid-template-columns: 1fr;
  }

  table {
    min-width: 680px;
  }

  .actions,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .message-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .chat-header,
  .chat-composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-bubble {
    width: 100%;
  }

  .button,
  .user-chip,
  .segmented {
    width: 100%;
  }

  .topbar .button,
  .topbar .user-chip {
    width: auto;
    flex: 1 1 auto;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 721px) {
  .mobile-nav {
    display: none;
  }
}
