:root {
  --bg: #f4ede4;
  --surface: #ffffff;
  --surface-soft: #fff8f2;
  --text: #18212f;
  --muted: #667085;
  --line: #eadacc;
  --primary: #7f1d1d;
  --primary-dark: #661717;
  --accent: #12343b;
  --success: #166534;
  --danger: #b42318;
  --shadow: 0 22px 44px rgba(66, 32, 18, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(191, 54, 54, 0.07), transparent 25%),
    linear-gradient(180deg, #f8f1e7 0%, #f2e8dc 100%);
}

button,
input,
textarea {
  font: inherit;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
}

.hidden {
  display: none !important;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  background: #201615;
  color: #fff7f1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.sidebar h1,
.section-heading h2,
.editor-header h2 {
  margin: 0;
}

.sidebar-copy,
#session-copy,
.section-heading p,
.helper-card li,
.flash-message {
  color: rgba(255, 247, 241, 0.8);
}

.status-card,
.site-switcher,
.sidebar-links,
.login-card,
.editor-card,
.helper-card {
  border-radius: 24px;
}

.status-card,
.site-switcher,
.sidebar-links {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
}

.status-label {
  margin: 0 0 6px;
  color: rgba(255, 247, 241, 0.65);
  font-size: 13px;
}

.site-switcher {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.site-tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #fff7f1;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s ease;
}

.site-tab.active,
.site-tab:hover {
  background: #fff7f1;
  color: #201615;
}

.sidebar-links {
  display: grid;
  gap: 10px;
}

.sidebar-links a {
  color: #fff7f1;
  text-decoration: none;
}

.main-panel {
  padding: 28px;
}

.login-card,
.editor-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-card {
  max-width: 540px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.editor-label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.login-form input,
#content-editor {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: #fffdfa;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  background: linear-gradient(135deg, var(--primary) 0%, #b91c1c 100%);
  color: white;
}

.primary-button:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, #991b1b 100%);
}

.secondary-button {
  background: var(--surface-soft);
  color: var(--accent);
  border: 1px solid var(--line);
}

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

.helper-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 18px;
}

.helper-card h3 {
  margin-top: 0;
}

.helper-card ul {
  margin: 0;
  padding-left: 18px;
}

.helper-card li,
.section-heading p,
.flash-message {
  color: var(--muted);
}

#content-editor {
  min-height: 560px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 10px;
}

.flash-message {
  min-height: 24px;
  margin: 14px 0 0;
  font-weight: 700;
}

.flash-message.success {
  color: var(--success);
}

.flash-message.error {
  color: var(--danger);
}

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

  .editor-header,
  .helper-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}
