:root {
  --bg: #fbf7ef;
  --surface: #fffdf9;
  --surface-2: #f6eadc;
  --ink: #20324f;
  --muted: #7b8496;
  --primary: #263f63;
  --primary-2: #35577f;
  --accent: #ad3a61;
  --accent-soft: #eac1d3;
  --danger: #b6423b;
  --success: #a66f12;
  --line: rgba(38,63,99,.14);
  --shadow: 0 18px 60px rgba(38, 63, 99, .12);
  --shadow-sm: 0 8px 24px rgba(38, 63, 99, .09);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1180px;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(204,85,77,.08), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(38,63,99,.08), transparent 28%),
    var(--bg);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}

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

button { color: inherit; }

button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(204,85,77,.55);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  inset-inline-start: 12px;
  top: -60px;
  z-index: 9999;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}
.skip-link:focus { top: 12px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.app-header {
  min-height: 76px;
  width: min(calc(100% - 28px), var(--max));
  margin: 14px auto 0;
  padding: 10px 14px;
  background: rgba(255,253,249,.86);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 20;
}

.brand { text-align: center; line-height: 1.25; }
.brand strong { display: block; font-size: 1.05rem; }
.brand-kicker { display: block; color: var(--muted); font-size: .75rem; margin-bottom: 3px; }

.header-actions {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: .2s ease;
  font-size: 1.1rem;
}
.icon-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.app-main {
  width: min(calc(100% - 28px), var(--max));
  margin: 22px auto;
  min-height: 620px;
}

.app-footer {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto 18px;
  color: var(--muted);
  font-size: .78rem;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  min-height: 48px;
  border: 0;
  border-radius: 15px;
  padding: 11px 20px;
  cursor: pointer;
  font-weight: 800;
  transition: .2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 26px rgba(38,63,99,.2);
}
.btn-primary:hover { background: var(--primary-2); }

.btn-secondary { background: var(--accent-soft); color: #7f352f; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }

.eyebrow {
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--accent);
}

.page-title {
  margin: 6px 0 8px;
  font-size: clamp(1.75rem, 4vw, 3rem);
  line-height: 1.25;
}

.page-subtitle {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.85);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.toast {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: #20324f;
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: .25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(32,50,79,.48);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal-backdrop.is-hidden { display: none; }
.modal-card {
  width: min(100%, 480px);
  background: var(--surface);
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
}
.modal-card h2 { margin-top: 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 2000;
  background: #fff;
  padding: 30px;
  border: 2px solid var(--danger);
  border-radius: 22px;
}
