/* 温かみのある白と生成り色の紙面に、主操作だけコーラル（Pietra のスタイルを参考） */
:root {
  --coral: #ff5c3c;
  --white: #ffffff;
  --cream: #f8f6f2;
  --cream-accent: #fffbe7;
  --ink: #000000;
  --charcoal: #141414;
  --slate: #333333;
  --mid: #6b6b6b;
  --silver: #c4c4c4;
  --ash: #e8e8ea;
  --sage: #57ad6a;
  --wash: linear-gradient(43deg, #f9dbdb 26.92%, #fdf1df 77.91%);
  --tag-sunrise: linear-gradient(43deg, #ff4a4a 26.92%, #e9aa4b 77.91%);
  --shadow-card: 5px 5px 24px 0 rgba(239, 227, 225, 0.6), 0 0 0 1px rgba(20, 20, 20, 0.04);
  --shadow-inset: inset 1px 1px 1px rgba(193, 194, 222, 0.2), inset -1px -1px 1px rgba(255, 255, 255, 0.8), 5px 5px 24px rgba(221, 223, 228, 0.5);
  --sans: 'Inter', 'Noto Sans JP', ui-sans-serif, system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --display: 'Noto Sans JP', 'Inter', ui-sans-serif, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--white); color: var(--ink); }
body { font-family: var(--sans); font-size: 16px; line-height: 1.6; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 600px; margin: 0 auto; padding: 0 20px; }

/* ナビ */
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(16px); border-bottom: 1px solid var(--ash); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.mono-label { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; color: var(--mid); margin: 0; }
.faint { color: var(--silver); }
.muted { color: var(--mid); }
.small { font-size: 14px; line-height: 1.57; }

/* ヒーロー：朝日のような淡いグラデーション */
.hero { margin: 0 -20px; padding: 40px 20px 32px; background: var(--wash); border-radius: 0 0 24px 24px; }
@media (min-width: 640px) { .hero { margin: 20px 0 0; border-radius: 24px; padding: 48px 32px 36px; } }
.tag { display: inline-block; padding: 4px 12px; border-radius: 9999px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: var(--white); background: var(--tag-sunrise); }
.h1 { font-family: var(--display); font-size: 32px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; margin: 14px 0 8px; }
@media (min-width: 640px) { .h1 { font-size: 40px; } }
.h2 { font-family: var(--display); font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 700; margin: 6px 0 4px; }
.hero .muted { color: var(--slate); }
section { margin-top: 40px; }

/* カード */
.card { background: var(--white); border-radius: 12px; box-shadow: var(--shadow-card); padding: 20px; }
.card + .card { margin-top: 12px; }
.card.inverted { background: var(--cream-accent); border-radius: 20px; padding: 24px; }
.card.inverted .mono-label { color: var(--mid); }
.slot-big { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin: 8px 0; }
.ok { display: inline-block; margin: 0; padding: 4px 12px; border-radius: 9999px; background: var(--sage); color: var(--white); font-size: 12px; font-weight: 700; }
.on-dark { color: var(--mid); margin: 12px 0 0; }

/* ボタン：主操作だけコーラル */
.btn { font: inherit; font-size: 16px; font-weight: 700; letter-spacing: -0.01em; border: 0; border-radius: 8px; min-height: 48px; padding: 0 20px; cursor: pointer; }
.btn.primary { background: var(--coral); color: var(--white); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.04); }
.btn.primary:hover { filter: brightness(0.96); }
.btn.primary:disabled { background: var(--silver); cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--charcoal); box-shadow: inset 0 0 0 1px var(--charcoal); }
.btn.ghost:hover { background: var(--cream); }
.btn.link { background: none; color: var(--slate); text-decoration: underline; text-underline-offset: 3px; font-weight: 500; padding: 0 8px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.actions .btn { flex: 1 1 auto; }

/* スライドする選択インジケーター（JSが --x --y --w --h を書き込む） */
:root { --glide-dur: 500ms; --glide-ease: cubic-bezier(.16, 1, .3, 1); }
.slide-ind {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  width: var(--w, 0px); height: var(--h, 0px);
  transform: translate3d(var(--x, 0px), var(--y, 0px), 0);
  transition: transform var(--glide-dur) var(--glide-ease), width var(--glide-dur) var(--glide-ease), height var(--glide-dur) var(--glide-ease);
  will-change: transform;
}
.slide-ind.no-anim { transition: none; }
/* 日付：カレンダー。選んだ日へ黒い枠が滑り込み、セル自体は少し遅れて黒く塗られる */
.days .slide-ind { border-radius: 10px; box-shadow: 0 0 0 2px var(--charcoal), 0 10px 24px -10px rgba(20, 20, 20, .45); }
@media (prefers-reduced-motion: reduce) { :root { --glide-dur: 0ms; } }
:root { --ok: #57ad6a; --few: #e9a23b; --full: #c4c4c4; --sun: #d2452b; --sat: #2f6fb0; }

.calcard { margin-top: 16px; padding: 16px 12px 14px; border-radius: 16px; }
@media (min-width: 520px) { .calcard { padding: 20px 20px 16px; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 10px; }
.cal-title { margin: 0; font-family: var(--display); font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.cal-nav { font: inherit; font-size: 22px; line-height: 1; width: 40px; height: 40px; border: 0; border-radius: 9999px; background: var(--cream); color: var(--charcoal); cursor: pointer; }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
@media (min-width: 520px) { .cal { gap: 6px; } }
.dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--mid); padding: 4px 0 6px; }
.dow.sun, .cell.off.sun { color: var(--sun); }
.dow.sat, .cell.off.sat { color: var(--sat); }
.cell { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; min-height: 58px; padding: 8px 0 6px; border-radius: 10px; font-variant-numeric: tabular-nums; }
@media (min-width: 520px) { .cell { min-height: 70px; padding-top: 10px; } }
.cell.off { color: var(--silver); font-size: 14px; }
.cell .n { font-size: 15px; font-weight: 700; line-height: 1.2; }
.cell .mark { width: 8px; height: 8px; border-radius: 9999px; background: var(--ok); }
.cell .rem { font-size: 10px; line-height: 1.2; color: var(--slate); font-weight: 500; white-space: nowrap; }
@media (min-width: 520px) { .cell .rem { font-size: 11px; } }
.cell.day { font: inherit; border: 0; cursor: pointer; background: #f1f8f2; color: var(--ink); transition: background-color .3s var(--glide-ease) .12s, color .3s var(--glide-ease) .12s, box-shadow .15s; }
.cell.day.sun .n { color: var(--sun); }
.cell.day.sat .n { color: var(--sat); }
.cell.day.lv-few { background: #fdf3e2; }
.cell.day.lv-few .mark { background: var(--few); }
.cell.day.lv-full { background: var(--cream); }
.cell.day.lv-full .mark { background: var(--full); }
.cell.day.lv-full .rem { color: var(--mid); }
.cell.day.lv-closed { background: transparent; cursor: not-allowed; }
.cell.day.lv-closed .n, .cell.day.lv-closed .rem { color: var(--silver); }
.cell.day.lv-closed .mark { background: transparent; }
.cell.day:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--charcoal); }
.cell.day[aria-pressed="true"] { background: var(--charcoal); color: var(--white); box-shadow: none; }
.cell.day[aria-pressed="true"] .n, .cell.day[aria-pressed="true"] .rem { color: var(--white); }
.cell.day.arriving[aria-pressed="true"] { background: #f1f8f2; }
.cell.day.arriving[aria-pressed="true"] .n { color: var(--ink); }
.cell.day.arriving[aria-pressed="true"] .rem { color: var(--slate); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 4px 0; font-size: 12px; color: var(--mid); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 9999px; }
.legend .lv-ok { background: var(--ok); } .legend .lv-few { background: var(--few); } .legend .lv-full { background: var(--full); }
.legend .faint { margin-left: auto; }

/* 時間：午前・午後・夕方のまとまりごとに並べる */
.tgroup { margin-top: 20px; }
.tg-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: 14px; }
.tg-head b { font-size: 15px; }
.times { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 520px) { .times { grid-template-columns: repeat(4, 1fr); } }
.time { position: relative; font: inherit; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: var(--white); border: 0; border-radius: 12px; box-shadow: var(--shadow-card); padding: 12px 14px; cursor: pointer; color: var(--ink); transition: box-shadow .15s, transform .15s; }
.time .t { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.time .t small { font-size: 12px; font-weight: 500; color: var(--mid); margin-left: 3px; }
.time .rem { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #2f6b3d; }
.time .rem::before { content: ''; width: 7px; height: 7px; border-radius: 9999px; background: var(--ok); }
.time.lv-few .rem { color: #9a5d06; }
.time.lv-few .rem::before { background: var(--few); }
.time:hover:not(:disabled) { box-shadow: var(--shadow-card), inset 0 0 0 1.5px var(--charcoal); transform: translateY(-1px); }
.time:disabled { background: var(--cream); box-shadow: none; cursor: not-allowed; }
.time:disabled .t, .time:disabled .t small, .time:disabled .rem { color: var(--silver); }
.time:disabled .rem::before { background: var(--full); }
.time.current { background: var(--cream-accent); box-shadow: inset 0 0 0 1.5px var(--charcoal); }
.time.current .t { color: var(--ink); }
.time.current .rem { color: var(--slate); }
.time.current .rem::before { background: var(--charcoal); }

/* お知らせ */
.notice { border-radius: 12px; padding: 14px 16px; margin-top: 20px; font-size: 15px; background: var(--cream); }
.notice.error { background: #fff1ee; color: var(--charcoal); box-shadow: inset 0 0 0 1px rgba(255, 92, 60, 0.35); }
.notice.success { background: #eef7f0; color: #2f6b3d; box-shadow: inset 0 0 0 1px rgba(87, 173, 106, 0.4); }
.divider { height: 1px; background: var(--ash); margin: 32px 0 24px; border: 0; }

/* 確認ダイアログ */
dialog.sheet { border: 0; border-radius: 20px; padding: 28px 24px 24px; width: min(480px, calc(100% - 32px)); box-shadow: 0 0 40px rgba(134, 137, 141, 0.25); background: var(--white); color: var(--ink); }
dialog.sheet::backdrop { background: rgba(20, 20, 20, 0.35); }
.footer { margin-top: 80px; padding: 24px 20px 40px; border-top: 1px solid var(--ash); }
:focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }
#times { scroll-margin-top: 76px; }
.brand { display: inline-flex; align-items: center; }
.logo { display: block; height: 32px; width: auto; }
@media (min-width: 520px) { .logo { height: 36px; } }
