:root {
  color-scheme: light;
  --paper: #fff8ea;
  --paper-deep: #f1dfbd;
  --ink: #251b14;
  --muted: #735d4d;
  --tomato: #d63b2f;
  --tomato-dark: #a82922;
  --leaf: #2f7b57;
  --leaf-soft: #d8e8d2;
  --line: rgba(83, 52, 35, 0.18);
  --shadow: 0 18px 46px rgba(72, 38, 24, 0.16);
  font-family:
    "Pretendard",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 16% 8%, rgba(214, 59, 47, 0.14), transparent 28rem),
    linear-gradient(135deg, #fffaf0 0%, #f7ebd1 48%, #e8f0dc 100%);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.cover {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 14px;
  align-items: center;
  min-height: 204px;
  padding: 22px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 248, 234, 0.88), rgba(255, 248, 234, 0.88)),
    repeating-linear-gradient(0deg, transparent 0, transparent 23px, rgba(116, 80, 45, 0.04) 24px);
  box-shadow: var(--shadow);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px dashed rgba(166, 72, 48, 0.28);
  border-radius: 6px;
}

.cover-copy,
.emblem {
  position: relative;
  z-index: 1;
}

.volume {
  margin: 0 0 10px;
  color: var(--leaf);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
}

h1 {
  max-width: 9em;
  margin: 0;
  color: var(--tomato-dark);
  font-size: clamp(2.1rem, 12vw, 3.5rem);
  font-weight: 900;
  line-height: 0.96;
  word-break: keep-all;
  overflow-wrap: normal;
}

.intro {
  max-width: 15rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.55;
}

.emblem {
  width: 112px;
  height: 112px;
  object-fit: cover;
  border: 1px solid rgba(166, 72, 48, 0.24);
  border-radius: 50%;
  background: #fff4d8;
  box-shadow: 0 12px 28px rgba(118, 50, 31, 0.2);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 10px;
  padding: 0 2px;
}

.section-label,
.count {
  margin: 0;
}

.section-label {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 900;
}

.count {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.toggle-all {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(166, 72, 48, 0.32);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--tomato-dark);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(72, 38, 24, 0.08);
}

.entries {
  display: grid;
  gap: 10px;
}

.loading {
  margin: 12px 0 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.72);
  font-size: 0.92rem;
  font-weight: 800;
  text-align: center;
}

.error-text {
  color: var(--tomato-dark) !important;
}

.entry {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 10px 24px rgba(72, 38, 24, 0.08);
}

.entry-trigger {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 15px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.entry-trigger strong,
.entry-trigger em {
  display: block;
}

.entry-trigger strong {
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.25;
}

.entry-trigger em {
  margin-top: 4px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}

.entry-trigger svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--tomato);
  transition: transform 180ms ease;
}

.entry-trigger path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.entry.is-open .entry-trigger {
  background: linear-gradient(90deg, rgba(216, 232, 210, 0.7), rgba(255, 253, 247, 0));
}

.entry.is-open .entry-trigger svg {
  transform: rotate(180deg);
}

.entry-panel {
  padding: 0 15px 15px;
}

.entry-panel p {
  margin: 0;
  padding-top: 3px;
  color: #3b2b20;
  font-size: 0.95rem;
  font-weight: 620;
  line-height: 1.65;
}

.entry-panel dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}

.entry-panel dl div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(47, 123, 87, 0.2);
  border-radius: 8px;
  background: rgba(216, 232, 210, 0.48);
}

.entry-panel dt,
.entry-panel dd {
  margin: 0;
}

.entry-panel dt {
  color: var(--leaf);
  font-size: 0.72rem;
  font-weight: 900;
}

.entry-panel dd {
  margin-top: 3px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1.3;
}

.note {
  margin: 18px 0 0;
  padding: 14px 10px 0;
  border-top: 1px dashed rgba(83, 52, 35, 0.22);
  color: var(--muted);
  text-align: center;
}

.note p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.5;
}

.admin-shell {
  padding-bottom: 42px;
}

.admin-cover {
  min-height: 188px;
}

.admin-cover h1 {
  font-size: clamp(2.1rem, 11vw, 3.1rem);
}

.admin-card {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  box-shadow: 0 10px 24px rgba(72, 38, 24, 0.08);
}

.admin-card h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.3;
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-card-head h2,
.admin-card-head p {
  margin: 0;
}

.admin-card-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.stack {
  display: grid;
  gap: 12px;
}

.stack label,
.fact-grid label {
  display: grid;
  gap: 6px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 900;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(83, 52, 35, 0.24);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  font: inherit;
  font-size: 0.96rem;
  font-weight: 680;
}

input {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input:focus,
textarea:focus {
  outline: 3px solid rgba(47, 123, 87, 0.26);
  border-color: rgba(47, 123, 87, 0.72);
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.primary-action,
.ghost-action {
  min-height: 46px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 900;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--tomato-dark);
  background: var(--tomato);
  color: #fffdf7;
  box-shadow: 0 10px 22px rgba(166, 41, 34, 0.2);
}

.ghost-action {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(166, 72, 48, 0.3);
  background: transparent;
  color: var(--tomato-dark);
}

.compact-list {
  display: grid;
  gap: 8px;
}

.compact-entry {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border: 1px solid rgba(47, 123, 87, 0.18);
  border-radius: 8px;
  background: rgba(216, 232, 210, 0.34);
}

.compact-entry strong {
  font-size: 0.94rem;
  font-weight: 900;
}

.compact-entry span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.admin-message {
  min-height: 1.4em;
  margin: 14px 0 0;
  color: var(--leaf);
  font-size: 0.86rem;
  font-weight: 850;
  text-align: center;
}

.is-hidden {
  display: none !important;
}

.entry-trigger:focus-visible,
.toggle-all:focus-visible,
.primary-action:focus-visible,
.ghost-action:focus-visible {
  outline: 3px solid rgba(47, 123, 87, 0.34);
  outline-offset: 3px;
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 38px;
  }

  .cover {
    grid-template-columns: 1fr 138px;
    min-height: 232px;
    padding: 28px 24px;
  }

  .emblem {
    width: 138px;
    height: 138px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
