:root {
  --bg: #f4f0e8;
  --bg-accent: #ebe2d1;
  --surface: rgba(255, 252, 246, 0.9);
  --surface-strong: #fffaf2;
  --line: rgba(88, 65, 36, 0.16);
  --text: #24190f;
  --muted: #6b5a4a;
  --accent: #0f766e;
  --accent-strong: #0b5b54;
  --danger: #8f1d1d;
  --shadow: 0 24px 80px rgba(54, 33, 10, 0.14);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  --font-sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.08), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, #f8f5ef 100%);
  color: var(--text);
  font-family: var(--font-sans);
}

button,
input,
a {
  font: inherit;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero,
.panel,
.auth-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
}

.hero h1,
.panel h2,
.category-head h3,
.auth-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  max-width: 12ch;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede,
.muted,
.file-meta,
.empty-state span,
.empty-substate {
  color: var(--muted);
}

.hero-actions,
.summary-actions,
.file-actions,
.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.layout {
  display: block;
}

.panel {
  padding: 24px;
}

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

.inline-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.field,
.inline-form input {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

input[type="text"],
input[type="password"],
input[type="file"] {
  width: 100%;
  border: 1px solid rgba(88, 65, 36, 0.22);
  border-radius: 999px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
}

input[type="file"] {
  border-radius: var(--radius-md);
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  transition: transform 120ms ease, background 120ms ease;
}

.button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.button-secondary {
  background: #e4eceb;
  color: #123e3a;
}

.button-secondary:hover {
  background: #d7e5e3;
}

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

.button-danger:hover {
  background: #751818;
}

.button-ghost {
  box-shadow: inset 0 0 0 1px rgba(143, 29, 29, 0.22);
}

.button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.people-list,
.category-list,
.file-list,
.caption-list {
  display: grid;
  gap: 14px;
}

.person-card,
.category-card,
.file-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-strong);
}

.person-details summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
}

.person-details summary::-webkit-details-marker {
  display: none;
}

.person-body {
  padding: 0 20px 20px;
}

.summary-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-card {
  padding: 18px;
}

.category-head,
.file-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.category-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  margin-top: 16px;
}

.upload-panel,
.file-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  background: rgba(255, 255, 255, 0.66);
}

.caption-field {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(244, 240, 232, 0.8);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-item {
  padding: 14px;
}

.file-item p {
  margin: 6px 0;
}

.status-banner,
.form-error,
.empty-state,
.empty-substate {
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.status-banner,
.empty-state,
.empty-substate {
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.form-error {
  background: rgba(143, 29, 29, 0.08);
  color: var(--danger);
  border: 1px solid rgba(143, 29, 29, 0.24);
}

.empty-state {
  text-align: center;
}

.auth-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.auth-dialog::backdrop {
  background: rgba(21, 16, 11, 0.58);
  backdrop-filter: blur(12px);
}

.auth-card {
  width: min(100vw - 32px, 460px);
  padding: 26px;
}

@media (max-width: 860px) {
  .hero,
  .panel-header,
  .category-head,
  .file-item {
    flex-direction: column;
    align-items: stretch;
  }

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

  .summary-actions,
  .file-actions,
  .hero-actions {
    width: 100%;
  }

  .summary-actions .button,
  .file-actions .button,
  .hero-actions .button,
  .inline-form .button {
    flex: 1 1 auto;
  }
}
