:root {
  --bg: #f4efe8;
  --bg-accent: radial-gradient(circle at top left, rgba(233, 180, 94, 0.22), transparent 35%), radial-gradient(circle at top right, rgba(86, 132, 161, 0.18), transparent 28%), linear-gradient(180deg, #fbf8f2 0%, #f4efe8 100%);
  --ink: #1d2429;
  --muted: #67727c;
  --card: rgba(255, 253, 249, 0.86);
  --stroke: rgba(29, 36, 41, 0.12);
  --accent: #c9702d;
  --accent-2: #3d6f87;
  --danger: #a43a2e;
  --good: #2f6c4f;
  --shadow: 0 18px 50px rgba(39, 33, 21, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg-accent);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
}

a {
  color: var(--accent-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topnav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: rgba(248, 242, 232, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--stroke);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-meta {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  color: var(--muted);
}

.navlinks {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.navlinks a {
  padding: 8px 10px;
  border-radius: 999px;
}

.navlinks a:hover {
  background: rgba(61, 111, 135, 0.08);
  text-decoration: none;
}

.topnav-pills {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(61, 111, 135, 0.08);
  text-decoration: none;
}

.toggle-link:hover {
  text-decoration: none;
  background: rgba(61, 111, 135, 0.12);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--stroke);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.lang-switch select {
  width: auto;
  min-width: 118px;
  padding: 8px 10px;
  border-radius: 999px;
}

.live-pill {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.live-pill.safe {
  background: rgba(61, 111, 135, 0.12);
  color: var(--accent-2);
}

.live-pill.live {
  background: rgba(164, 58, 46, 0.12);
  color: var(--danger);
}

.shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 26px;
}

.hero,
.panel,
.metric-card,
.compact-card {
  background: var(--card);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
}

.hero {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 20px;
  padding: 28px;
  margin-bottom: 22px;
}

.hero h1,
.panel h1,
.panel h2,
.panel h3 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
}

.lede {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.6;
}

.compact-card {
  padding: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.metric-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: 32px;
  line-height: 1;
}

.compact-grid {
  margin: 0 0 18px;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.columns.two-one {
  grid-template-columns: 1.25fr 0.75fr;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(201, 112, 45, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.badge.subtle {
  background: rgba(61, 111, 135, 0.12);
  color: var(--accent-2);
}

.badge.accent {
  background: rgba(47, 108, 79, 0.12);
  color: var(--good);
}

.badge.tone-green {
  background: rgba(47, 108, 79, 0.12);
  color: var(--good);
}

.badge.tone-red {
  background: rgba(164, 58, 46, 0.12);
  color: var(--danger);
}

.badge.tone-blue {
  background: rgba(61, 111, 135, 0.14);
  color: var(--accent-2);
}

.badge.tone-amber {
  background: rgba(201, 112, 45, 0.14);
  color: var(--accent);
}

.badge.tone-teal {
  background: rgba(43, 117, 112, 0.14);
  color: #2b7570;
}

.badge.tone-slate {
  background: rgba(103, 114, 124, 0.16);
  color: #5a6670;
}

.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(201, 112, 45, 0.16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  vertical-align: middle;
}

.summary-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

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

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary-grid strong {
  font-size: 15px;
}

.form-grid,
.filters {
  display: grid;
  gap: 14px;
}

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

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

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(29, 36, 41, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 13px;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent) 0%, #df9544 100%);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(1.03);
}

button.secondary {
  background: rgba(61, 111, 135, 0.12);
  color: var(--ink);
  border: 1px solid rgba(61, 111, 135, 0.18);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button-row button {
  width: auto;
}

.inline-form p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(29, 36, 41, 0.09);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
}

.table-subline,
.inline-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.table-subline + .table-subline {
  margin-top: 4px;
}

.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
}

.flash {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(61, 111, 135, 0.12);
  border: 1px solid rgba(61, 111, 135, 0.18);
}

.help-banner {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(201, 112, 45, 0.12);
  border: 1px solid rgba(201, 112, 45, 0.18);
  color: var(--ink);
}

.help-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(61, 111, 135, 0.14);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  outline: none;
}

.help-dot::after {
  content: attr(data-help);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(29, 36, 41, 0.96);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 120ms ease, visibility 120ms ease, transform 120ms ease;
  z-index: 40;
}

.help-dot:hover::after,
.help-dot:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

.mono {
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
}

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

.attachment-picker {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(250, 247, 242, 0.8);
  border: 1px solid rgba(29, 36, 41, 0.08);
}

.attachment-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
}

.attachment-option .muted {
  grid-column: 2;
  font-size: 12px;
}

.section-gap {
  margin-top: 18px;
}

.mini-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-bottom: 12px;
}

.message-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(244, 239, 232, 0.7);
  border: 1px solid rgba(29, 36, 41, 0.08);
}

.workflow-check {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(29, 36, 41, 0.08);
}

.decision-grid {
  display: grid;
  gap: 10px;
}

.workflow-decision {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(250, 247, 242, 0.86);
  border: 1px solid rgba(29, 36, 41, 0.08);
}

.workflow-decision input {
  width: auto;
}

.support-answer {
  white-space: pre-wrap;
  margin: 0;
  font: inherit;
  line-height: 1.55;
  color: var(--ink);
}

.auth-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
}

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

.message-card header,
.message-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero,
  .columns,
  .detail-grid,
  .columns.two-one {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }
  .topnav {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
  }
  .card-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.media-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 124px));
  justify-content: start;
  gap: 10px;
  margin: 12px 0 16px;
}

.media-card {
  display: grid;
  gap: 6px;
  text-decoration: none;
  color: var(--ink);
  padding: 8px;
  border-radius: 12px;
  max-width: 124px;
  background: rgba(250, 247, 242, 0.92);
  border: 1px solid rgba(29, 36, 41, 0.08);
  box-shadow: 0 8px 20px rgba(29, 36, 41, 0.05);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.media-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(29, 36, 41, 0.1);
  border-color: rgba(61, 111, 135, 0.18);
}

.media-card__frame {
  display: block;
  overflow: hidden;
  width: 96px;
  margin: 0 auto;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(29, 36, 41, 0.06) 0%, rgba(61, 111, 135, 0.08) 100%);
}

.media-card__frame img {
  width: 96px;
  height: 72px;
  object-fit: cover;
  display: block;
}

.media-card__body {
  display: grid;
  gap: 2px;
}

.media-card__body strong {
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}

.media-card__body span {
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  word-break: break-word;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 90;
}

.lightbox-overlay:target {
  display: flex;
}

.lightbox-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 21, 24, 0.82);
  backdrop-filter: blur(3px);
}

.lightbox-overlay__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1100px);
  max-height: calc(100vh - 48px);
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 252, 248, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
}

.lightbox-overlay__head,
.lightbox-overlay__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lightbox-overlay__head span,
.lightbox-overlay__foot {
  color: var(--muted);
  font-size: 13px;
}

.lightbox-overlay__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 24px;
  color: var(--ink);
  background: rgba(29, 36, 41, 0.08);
}

.lightbox-overlay__image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  max-height: calc(100vh - 220px);
  overflow: auto;
}

.lightbox-overlay__image-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 240px);
  border-radius: 16px;
  display: block;
}
