:root {
  --bg: #f6f1e7;
  --panel: #fffdf9;
  --panel-strong: #ffffff;
  --ink: #1f231d;
  --muted: #6b6f63;
  --line: #d8d0c3;
  --accent: #185c4b;
  --accent-strong: #0f4538;
  --danger: #9c2f2f;
  --review: #9a6a15;
  --done: #245e86;
  --draft: #7a6d5d;
  --shadow: 0 14px 32px rgba(52, 44, 29, 0.08);
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(24, 92, 75, 0.12), transparent 28%),
    linear-gradient(180deg, #f7f2e8 0%, #efe8da 100%);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 0.5rem;
  flex: 1;
  flex-wrap: wrap;
}

.nav a,
.button {
  min-height: 46px;
  border-radius: 14px;
}

.nav a {
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.55);
}

.nav a.is-active {
  background: rgba(24, 92, 75, 0.16);
}

.page,
.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hero,
.card,
.assignment-card,
.list-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.hero,
.card {
  padding: 1.25rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.hero h1,
.section h2,
.card h2,
.assignment-card h3 {
  margin: 0 0 0.35rem;
}

.hero p,
.card p,
.list-item span,
.empty,
.meta-line,
small,
.muted,
.field-hint {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1rem;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button:hover {
  background: var(--accent-strong);
}

.button-ghost {
  background: var(--panel-strong);
  color: var(--ink);
  border: 1px solid var(--line);
}

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

.hero-actions,
.inline-actions,
.status-actions,
.card-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.align-end {
  align-items: end;
}

.section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.assignment-grid,
.list {
  display: grid;
  gap: 0.75rem;
}

.assignment-card {
  padding: 1rem;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
}

.list-item-stack {
  flex-direction: column;
}

.is-open-blocker {
  border-color: rgba(156, 47, 47, 0.35);
  background: #fff8f8;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
  background: #fff;
}

input[type="text"],
input[type="password"],
select {
  min-height: 48px;
}

textarea {
  min-height: 200px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.textarea-medium {
  min-height: 120px;
}

.textarea-large {
  min-height: 220px;
}

.filter-grid {
  display: grid;
  gap: 0.75rem;
}

.span-2 {
  grid-column: span 2;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.check-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 0.75rem;
  align-items: stretch;
}

.checkbox,
.check-label {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 54px;
}

.checkbox {
  font-size: 1.3rem;
  font-weight: 700;
}

.checkbox.is-checked,
.check-label.is-checked {
  background: rgba(24, 92, 75, 0.12);
}

.check-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 0.9rem 1rem;
}

.check-label.is-checked span {
  text-decoration: line-through;
}

.status-pill,
.progress-badge {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.95rem;
  text-transform: capitalize;
}

.progress-badge {
  background: rgba(24, 92, 75, 0.1);
}

.status-draft {
  background: rgba(122, 109, 93, 0.16);
}

.status-active {
  background: rgba(24, 92, 75, 0.16);
}

.status-blocked {
  background: rgba(156, 47, 47, 0.16);
}

.status-review {
  background: rgba(154, 106, 21, 0.16);
}

.status-done {
  background: rgba(36, 94, 134, 0.16);
}

.status-archived {
  background: rgba(88, 88, 88, 0.16);
}

.notice {
  margin: 0;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: #f7f4ed;
}

.notice-danger {
  background: #fff4f4;
  color: #7c2727;
}

.reference-block {
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fcfaf5;
}

.reference-block ul {
  margin: 0.6rem 0 0;
  padding-left: 1.1rem;
}

.checkbox-inline {
  flex-direction: row;
  align-items: center;
}

.checkbox-inline input {
  width: auto;
}

.upload-dropzone {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fcfaf5;
}

.upload-dropzone input[type="file"] {
  padding: 0;
  border: none;
  background: transparent;
}

.alert {
  padding: 1rem;
  border-radius: 16px;
  background: #fff4dc;
  border: 1px solid #ebcc87;
}

.auth-card {
  max-width: 420px;
  margin: 10vh auto 0;
}

.code-block {
  margin: 0;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #f7f4ed;
  overflow-x: auto;
  white-space: pre-wrap;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (min-width: 720px) {
  .shell {
    padding: 1.5rem;
  }

  .assignment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
}
