:root {
  color-scheme: light;
  --bg: #f6efe4;
  --bg-deep: #dcc7a6;
  --surface: #fffaf2;
  --surface-2: #fff5e3;
  --ink: #1f2a32;
  --muted: #5f6b73;
  --accent: #d97706;
  --accent-2: #0f766e;
  --danger: #b42318;
  --outline: rgba(31, 42, 50, 0.14);
  --shadow: 0 16px 40px rgba(31, 42, 50, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: -20vmax;
  background:
    radial-gradient(circle at 10% 20%, rgba(15, 118, 110, 0.18), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(217, 119, 6, 0.2), transparent 45%),
    radial-gradient(circle at 60% 90%, rgba(15, 118, 110, 0.15), transparent 40%),
    linear-gradient(120deg, rgba(220, 199, 166, 0.2), rgba(246, 239, 228, 0.9));
  z-index: -1;
}

main {
  display: block;
}

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

a:hover {
  color: var(--accent-2);
}

.frame {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 0;
}

.brand {
  font-family: "Shippori Mincho", serif;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 0 2px var(--surface);
}

.nav {
  display: flex;
  gap: 16px;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.8);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.nav a.active {
  border-color: var(--accent-2);
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.nav a:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
  background: #fff;
}

.user-chip {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid rgba(31, 42, 50, 0.1);
}

.hero {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.hero h1 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 720px;
}

.card {
  margin-top: 24px;
  padding: 24px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: var(--shadow);
  animation: rise 0.6s ease both;
}

.card h2 {
  margin: 0 0 12px;
  font-family: "Shippori Mincho", serif;
  font-size: 1.6rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

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

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.banner {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(180, 35, 24, 0.3);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
  font-weight: 600;
}

.banner.hidden {
  display: none;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid rgba(31, 42, 50, 0.08);
}

.toggle-row h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.toggle-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 58px;
  height: 32px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(31, 42, 50, 0.2);
  border-radius: 999px;
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 6px 12px rgba(31, 42, 50, 0.25);
}

.switch input:checked + .slider {
  background: linear-gradient(120deg, var(--accent-2), var(--accent));
}

.switch input:checked + .slider::before {
  transform: translateX(26px);
}

.status {
  margin-top: 16px;
  font-size: 0.95rem;
  color: var(--muted);
}

.status strong {
  color: var(--ink);
}

.status.success {
  color: var(--accent-2);
  font-weight: 600;
}

.status.danger {
  color: var(--danger);
  font-weight: 600;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

button,
.button {
  appearance: none;
  border: none;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.25);
}

button.secondary,
.button.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid rgba(31, 42, 50, 0.2);
  box-shadow: none;
}

button.ghost,
.button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px dashed rgba(31, 42, 50, 0.2);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(120deg, #d14343, #b42318);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

form {
  display: grid;
  gap: 12px;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
}

input[type="number"],
input[type="text"],
input[type="date"] {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(31, 42, 50, 0.2);
  background: #fff;
  font-size: 0.95rem;
}

input:focus {
  outline: 2px solid rgba(15, 118, 110, 0.3);
  border-color: rgba(15, 118, 110, 0.6);
}

.helper {
  font-size: 0.85rem;
  color: var(--muted);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(31, 42, 50, 0.1);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table td code {
  font-size: 0.82rem;
  background: rgba(31, 42, 50, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-block;
}

.tags {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-2);
}

.tag.danger {
  background: rgba(180, 35, 24, 0.12);
  color: var(--danger);
}

.card.muted {
  background: rgba(255, 250, 242, 0.7);
  border-style: dashed;
  box-shadow: none;
}

.notice {
  padding: 16px;
  border-radius: 12px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-2);
  font-weight: 600;
}

.reveal {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.2);
}

.reveal code {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    flex-wrap: wrap;
  }

  .card {
    padding: 18px;
  }

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

  .table th {
    display: none;
  }

  .table tr {
    display: grid;
    gap: 8px;
    padding: 14px 0;
  }

  .table td {
    border: none;
    padding: 0;
  }
}

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