:root {
  --bg: #f6f1e9;
  --bg-accent: #f1e7d7;
  --ink: #1d1a17;
  --muted: #6c5f53;
  --accent: #c84630;
  --accent-2: #2d6a4f;
  --paper: #fffdf9;
  --shadow: 0 16px 40px rgba(32, 25, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Literata", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 20%, rgba(200, 70, 48, 0.08), transparent 55%),
    radial-gradient(circle at 80% 10%, rgba(45, 106, 79, 0.08), transparent 50%),
    var(--bg);
  min-height: 100vh;
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 40px;
  display: grid;
  gap: 20px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.subtitle {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 6px 16px rgba(200, 70, 48, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(29, 26, 23, 0.2);
  box-shadow: none;
}

.btn.full {
  width: 100%;
}

.panel {
  background: var(--paper);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

#doc-title {
  border: none;
  font-size: 24px;
  font-weight: 600;
  font-family: "Literata", serif;
  width: 100%;
  outline: none;
  color: var(--ink);
  background: transparent;
}

.status {
  font-family: "Space Grotesk", sans-serif;
  font-size: 12px;
  padding: 6px 10px;
  background: var(--bg-accent);
  border-radius: 999px;
  color: var(--muted);
}

.footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 15, 12, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: var(--paper);
  border-radius: 16px;
  padding: 18px;
  width: min(720px, 95vw);
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 18px;
}

#export-area {
  width: 100%;
  height: 220px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(29, 26, 23, 0.2);
  padding: 12px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
}

@media (max-width: 720px) {
  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}
