:root {
  --ink: #2f2a2d;
  --muted: #6f676e;
  --line: #ded8dd;
  --soft: #f8f6f4;
  --panel: #ffffff;
  --accent: #7d4cab;
  --accent-dark: #63358f;
  --mint: #d9f1e4;
  --mint-text: #1f6745;
  --amber: #f7e7c5;
  --danger: #b84d5a;
  --ok: #5d8a3d;
  --shadow: 0 12px 28px rgba(56, 47, 60, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-size: 16px;
  line-height: 1.65;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.topbar small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  line-height: 1.2;
}

.container {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.narrow {
  width: min(720px, 100%);
}

.band {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

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

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

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
}

.menu-card {
  position: relative;
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  text-align: left;
}

.menu-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(125, 76, 171, 0.12);
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 2px 9px;
  border-radius: 4px;
  background: var(--mint);
  color: var(--mint-text);
  font-weight: 700;
  font-size: 0.86rem;
}

.menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.duration {
  color: var(--muted);
  font-weight: 900;
}

.menu-copy {
  display: grid;
  gap: 6px;
}

.menu-card h2,
.section-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.45;
  letter-spacing: 0;
}

.menu-card p,
.muted {
  color: var(--muted);
}

.menu-card p {
  margin: 0;
}

.price {
  margin-top: auto;
  font-size: 1.12rem;
  color: var(--accent-dark);
  font-weight: 800;
  line-height: 1.45;
}

.price-note {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.button {
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.button.secondary {
  color: var(--accent-dark);
  background: #fff;
  border: 1px solid var(--line);
}

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

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

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

.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e7d7ab;
  background: var(--amber);
  color: #554421;
  font-weight: 700;
}

.price-change-notice {
  margin: 14px 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid #e2c46f;
  background: #fff8df;
  color: #4f3b16;
  display: grid;
  gap: 10px;
}

.price-change-notice h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.4;
}

.price-change-notice p {
  margin: 0;
  font-weight: 700;
}

.notice-marker {
  background: linear-gradient(transparent 58%, #ffe58a 58%);
  font-weight: 900;
}

.notice-underline {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-decoration-color: #d59b2d;
  text-underline-offset: 3px;
  font-weight: 900;
}

.trial-price {
  display: block;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid #ecd58d;
  color: var(--accent-dark);
  font-weight: 900;
}

.notice-important {
  padding: 10px;
  border-radius: 6px;
  background: #ffffff;
  border-left: 5px solid var(--accent);
}

.steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.step {
  padding: 12px 10px;
  text-align: center;
  color: var(--muted);
  font-weight: 800;
  border-right: 1px solid var(--line);
}

.step:last-child {
  border-right: 0;
}

.step.current {
  color: var(--accent-dark);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.week-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.slot-board {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.slot-grid {
  min-width: 760px;
  display: grid;
  grid-template-columns: 82px repeat(7, minmax(86px, 1fr));
}

.slot-head,
.slot-time,
.slot-cell {
  min-height: 56px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.slot-head {
  font-weight: 900;
  background: #fff;
  flex-direction: column;
  line-height: 1.25;
}

.slot-head small {
  color: var(--muted);
  font-weight: 700;
}

.slot-head.sunday small {
  color: var(--danger);
}

.slot-time {
  font-weight: 800;
  color: var(--ink);
  background: #fbfaf9;
}

.slot-cell {
  background: #fff;
}

.slot-cell.closed {
  background: #efeeee;
  color: var(--muted);
  font-weight: 800;
}

.slot-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;
}

.slot-button.limited {
  color: #ac7832;
}

.slot-button.unavailable {
  color: #8b8988;
}

.slot-button.selected {
  background: var(--accent);
  color: #fff;
}

.form {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-weight: 900;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 48px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

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

.summary {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.summary-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.summary-row span:first-child {
  color: var(--muted);
  font-weight: 800;
}

.complete {
  padding: 28px 18px;
  text-align: center;
}

.complete h2 {
  margin: 0 0 10px;
  font-size: 1.45rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
}

.admin-nav {
  position: sticky;
  top: 80px;
  align-self: start;
  display: grid;
  gap: 8px;
}

.admin-nav a {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
}

.admin-nav a.active {
  border-color: var(--accent);
  color: var(--accent-dark);
}

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

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #fbfaf9;
  font-size: 0.88rem;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  background: #eee8f3;
  color: var(--accent-dark);
}

.status.confirmed {
  background: #ddedd5;
  color: #416b26;
}

.status.rejected,
.status.cancelled {
  background: #f1d8dc;
  color: #91404b;
}

.status.pending {
  background: #f6e6bb;
  color: #7d5b1f;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.log {
  white-space: pre-wrap;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-panel {
  width: min(420px, 100%);
  padding: 22px;
}

.error {
  color: var(--danger);
  font-weight: 800;
}

.success {
  color: var(--ok);
  font-weight: 800;
}

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

.checkbox-row input {
  width: 20px;
  height: 20px;
}

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

@media (max-width: 820px) {
  .container {
    padding: 14px;
  }

  .grid.two,
  .grid.three,
  .admin-layout,
  .detail-grid,
  .split {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .summary-row {
    grid-template-columns: 1fr;
  }

  .table,
  .table thead,
  .table tbody,
  .table th,
  .table td,
  .table tr {
    display: block;
  }

  .table thead {
    display: none;
  }

  .table tr {
    border-bottom: 1px solid var(--line);
  }

  .table td {
    border: 0;
    padding: 8px 12px;
  }
}
