:root {
  --bg: #f4f0e8;
  --card: rgba(255, 255, 255, 0.85);
  --card-border: rgba(36, 92, 79, 0.14);
  --ink: #22302d;
  --muted: #5e6b68;
  --primary: #245c4f;
  --primary-strong: #193f36;
  --accent: #c28f2c;
  --danger: #b64132;
  --success: #2e7d32;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Hiragino Sans", "Noto Sans JP", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(194, 143, 44, 0.24), transparent 24%),
    radial-gradient(circle at bottom right, rgba(36, 92, 79, 0.18), transparent 20%),
    var(--bg);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

.hero,
.panel {
  background: var(--card);
  backdrop-filter: blur(18px);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(60, 50, 30, 0.08);
}

.hero {
  padding: 40px;
  margin-bottom: 28px;
}

.hero-meta {
  margin: 18px 0 0;
  color: var(--primary);
  font-size: 0.95rem;
  font-weight: 700;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1,
.panel h1 {
  margin: 10px 0 12px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.1;
}

.muted {
  color: var(--muted);
}

.site-footer {
  padding: 20px 8px 0;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

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

.row.wrap {
  flex-wrap: wrap;
}

.row.between {
  justify-content: space-between;
}

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

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.tab-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cards .empty-state {
  grid-column: 1 / -1;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(60, 50, 30, 0.06);
}

.newsletter-card {
  display: grid;
  grid-template-rows: auto auto auto auto minmax(0, 1fr) auto auto;
  gap: 16px;
  height: 410px;
}

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

.prompt-preview {
  min-height: 0;
  overflow-y: auto;
  padding-right: 8px;
}

.newsletter-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.newsletter-card-actions.request-only {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.newsletter-card-actions .button {
  width: 100%;
  min-width: 0;
  padding: 10px 8px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.delivery-log-card {
  display: grid;
  gap: 16px;
}

.delivery-log-card h2 {
  margin: 0;
}

.delivery-log-card p {
  margin: 0;
}

.delivery-body-preview {
  max-height: 260px;
  overflow: auto;
  padding: 16px;
  border-radius: 18px;
  background: rgba(36, 92, 79, 0.06);
  border: 1px solid rgba(36, 92, 79, 0.12);
  color: var(--ink);
  line-height: 1.7;
  white-space: pre-wrap;
}

.empty-state {
  padding: 28px;
  border-radius: 20px;
  background: rgba(36, 92, 79, 0.05);
  color: var(--muted);
  text-align: center;
}

.badge {
  display: inline-flex;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(36, 92, 79, 0.1);
  color: var(--primary);
}

.badge.off {
  background: rgba(94, 107, 104, 0.12);
  color: var(--muted);
}

.badge.request {
  background: rgba(194, 143, 44, 0.16);
  color: #8c6618;
}

.button {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

.button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(36, 92, 79, 0.25);
}

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

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tab-button {
  border: 1px solid rgba(36, 92, 79, 0.18);
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.tab-button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.input,
.textarea {
  width: 100%;
  border: 1px solid rgba(36, 92, 79, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
}

.textarea {
  min-height: 140px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.filter-panel-row {
  justify-content: flex-end;
}

.filter-select {
  align-items: center;
  min-width: min(100%, 280px);
}

.filter-label {
  margin: 0;
  white-space: nowrap;
}

.filter-actions {
  justify-content: flex-end;
}

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

.alert {
  border-radius: 18px;
  padding: 14px 16px;
  font-weight: 700;
}

.alert.error {
  background: rgba(182, 65, 50, 0.12);
  color: #6b1d16;
}

.alert.success {
  background: rgba(46, 125, 50, 0.12);
  color: #1d5c25;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(36, 92, 79, 0.12);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 0.92rem;
}

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

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(36, 92, 79, 0.08);
}

.pill-remove {
  border: 0;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: white;
  background: var(--danger);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 26, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  width: min(100%, 480px);
  background: white;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(20, 26, 24, 0.28);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 26, 24, 0.28);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: 180px;
  padding: 24px 28px;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 50px rgba(20, 26, 24, 0.18);
}

.loading-image {
  width: 72px;
  height: 72px;
  animation: loading-spin 1s linear infinite;
}

.loading-card p {
  margin: 0;
  font-weight: 700;
  color: var(--primary);
}

@keyframes loading-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 720px) {
  .page {
    padding: 20px 14px 56px;
  }

  .hero,
  .panel,
  .card {
    border-radius: 22px;
  }

  .row.mobile-column {
    flex-direction: column;
    align-items: stretch;
  }
}
