:root {
  --wine-950: #3d0011;
  --wine-900: #4f071a;
  --wine-800: #671027;
  --wine-700: #861a36;
  --wine-600: #a32a47;
  --rose-500: #cf536d;
  --rose-300: #ee9eaa;
  --rose-200: #f6c1c8;
  --rose-100: #fbe4e5;
  --rose-050: #fff3f2;
  --cream: #fffaf6;
  --paper: #fffdfb;
  --ink: #2d171a;
  --muted: #806b6e;
  --line: #eadbd7;
  --shadow: 0 18px 50px rgba(67, 9, 25, 0.08);
  --shadow-soft: 0 8px 24px rgba(67, 9, 25, 0.06);
  --radius-xl: 20px;
  --radius-lg: 15px;
  --radius-md: 11px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 82% 10%, rgba(251, 228, 229, 0.45), transparent 27rem),
    linear-gradient(180deg, #fffdfb 0%, #fffaf7 100%);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.45;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(163, 42, 71, 0.28);
  outline-offset: 3px;
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 70px;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 28px;
  padding: 0 42px;
  color: #fff7ef;
  background: linear-gradient(90deg, #4b0014 0%, #3d0011 44%, #470014 100%);
  box-shadow: 0 10px 30px rgba(50, 0, 15, 0.16);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  width: max-content;
}

.brand-mark {
  color: #d3ab71;
  font-family: var(--serif);
  font-size: 28px;
  font-style: italic;
  letter-spacing: -6px;
  padding-right: 5px;
}

.brand-name {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.02em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 48px;
  font-family: var(--serif);
}

.main-nav a,
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
}

.main-nav a:hover,
.nav-button:hover { color: #f6c1c8; }

.account-button {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: var(--serif);
}

.page-shell {
  width: min(1600px, calc(100% - 64px));
  margin: 28px auto 60px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 38px;
}

.panel {
  border: 1px solid rgba(103, 16, 39, 0.10);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 251, 0.92);
  box-shadow: var(--shadow-soft);
}

.section-kicker {
  color: var(--wine-800);
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.text-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--wine-700);
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 700;
}

.text-link:hover { color: var(--wine-900); }

.primary-action,
.secondary-action {
  min-height: 48px;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--serif);
  font-size: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-action:hover,
.secondary-action:hover { transform: translateY(-1px); }

.primary-action {
  border: 1px solid var(--wine-700);
  background: linear-gradient(180deg, #a8193f 0%, #8d1233 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(134, 26, 54, 0.18);
}

.secondary-action {
  border: 1px solid var(--rose-300);
  background: rgba(255, 253, 251, 0.9);
  color: var(--wine-700);
}

.avatar {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(145deg, #e8b6a4, #8a334f);
  color: white;
  font-family: var(--serif);
  font-weight: 700;
}

.avatar-small { width: 38px; height: 38px; font-size: 12px; }
.avatar-dark { background: linear-gradient(145deg, #6e4b3f, #151316); }

.modal {
  width: min(620px, calc(100% - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.modal::backdrop {
  background: rgba(52, 1, 16, 0.52);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  margin: 0;
  padding: 34px;
  border: 1px solid rgba(103, 16, 39, 0.14);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.modal-card h2 { margin: 8px 0 18px; font-size: 30px; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.search-label { display: block; margin: 18px 0 8px; font-weight: 700; }
.search-label + input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  background: white;
  color: var(--ink);
}

.modal-hint { margin: 14px 0 0; color: var(--muted); }

.rail-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}
