:root {
  color-scheme: light;
  --bg: #f5f8fb;
  --panel: #ffffff;
  --panel-2: #f7fafc;
  --line: rgba(42, 73, 101, .12);
  --muted: #70869a;
  --text: #15293b;
  --gold: #d99028;
  --cyan: #087eab;
  --violet: #7465ba;
  --red: #d55f63;
  --blue: #3f79bd;
  font-family: Inter, "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 84% -8%, rgba(180,220,240,.55) 0, transparent 34%), linear-gradient(180deg, #fbfdff 0, var(--bg) 58%); }
button, input, select { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 clamp(18px, 4vw, 64px); display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; box-shadow: 0 8px 30px rgba(41,70,94,.04); }
.brand { display: flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 21px; letter-spacing: .12em; }
.brand small { color: var(--muted); font-size: 9px; letter-spacing: .18em; margin-top: 5px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #ffcf73, #ff9d4c); box-shadow: 0 0 28px rgba(255,180,81,.24); position: relative; overflow: hidden; }
.brand-mark span { width: 31px; height: 31px; border-radius: 50%; background: #f7fbfe; transform: translate(8px,-6px); }
.location-pill { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(244,249,252,.9); }
.location-pill > span:nth-child(2) { display: grid; }
.location-pill small { font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.location-pill strong { font-size: 13px; }
.pin { color: var(--cyan); font-size: 10px; box-shadow: 0 0 12px var(--cyan); border-radius: 50%; }
.icon-button { width: 39px; height: 39px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; box-shadow: 0 5px 16px rgba(42,73,101,.08); }
.icon-button:hover { background: #eef7fb; }
main { width: min(1460px, calc(100% - 36px)); margin: 0 auto; padding: 42px 0 38px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { color: var(--cyan); font-size: 10px; letter-spacing: .28em; font-weight: 700; margin: 0 0 9px; }
.hero h1 { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-size: clamp(34px,4vw,58px); letter-spacing: .05em; margin: 0; font-weight: 500; }
.hero p:last-child { color: var(--muted); margin: 9px 0 0; font-size: 12px; }
.month-nav { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 4px; background: rgba(255,255,255,.9); box-shadow: 0 7px 24px rgba(41,70,94,.06); }
.month-nav button { height: 34px; min-width: 38px; border: 0; background: transparent; cursor: pointer; border-radius: 8px; }
.month-nav button:hover { background: #edf6fa; }
#todayButton { padding: 0 15px; color: var(--cyan); font-size: 12px; }
.summary { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 15px; background: var(--line); overflow: hidden; margin-bottom: 18px; }
.summary > div { min-height: 84px; background: rgba(255,255,255,.96); padding: 16px 20px; }
.summary-intro { display: flex; flex-direction: column; justify-content: center; }
.summary-intro strong { font-size: 17px; }
.summary-intro span:last-child, .summary-date { color: var(--muted); font-size: 11px; }
.summary-item { display: flex; align-items: center; gap: 14px; }
.summary-item > span { font-size: 24px; color: var(--gold); }
.summary-item.moon > span { color: var(--violet); }
.moonset-icon { position: relative; display: inline-block; width: 29px; height: 28px; flex: 0 0 29px; }
.moonset-icon::before { content: "☾"; position: absolute; left: 0; top: -4px; font-size: 25px; line-height: 1; }
.moonset-icon::after { content: "↓"; position: absolute; right: 0; bottom: -2px; padding: 0 1px; border-radius: 5px; background: #fff; font-size: 15px; font-weight: 800; line-height: 1; }
.summary-item div { display: grid; }
.summary-item small { color: var(--muted); font-size: 10px; }
.summary-item strong { font-variant-numeric: tabular-nums; font-size: 19px; margin-top: 2px; }
.summary.full-moon-summary { box-shadow: 0 0 0 1px rgba(226,167,53,.5), 0 12px 35px rgba(226,167,53,.12); }
.summary.new-moon-summary { box-shadow: 0 0 0 1px rgba(67,94,134,.5), 0 12px 35px rgba(67,94,134,.10); }
.calendar-card { border: 1px solid var(--line); border-radius: 17px; overflow: hidden; box-shadow: 0 24px 70px rgba(49,79,103,.10); background: #fff; }
.weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); }
.weekdays { background: #f5f9fc; border-bottom: 1px solid var(--line); }
.weekdays span { padding: 12px; text-align: center; color: var(--muted); font-size: 10px; letter-spacing: .14em; }
.weekdays span:first-child { color: var(--red); }
.weekdays span:last-child { color: var(--blue); }
.day-cell { position: relative; min-height: 193px; padding: 12px 12px 10px; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.98); text-align: left; cursor: pointer; overflow: hidden; transition: background .18s, transform .18s; }
.day-cell:nth-child(7n) { border-right: 0; }
.day-cell:hover { background: #f0f8fc; z-index: 1; }
.day-cell.outside { opacity: .36; }
.day-cell.today { background: linear-gradient(150deg, rgba(197,232,246,.72), #fafdff); box-shadow: inset 0 0 0 1px rgba(8,126,171,.45); }
.day-cell.major-moon { opacity: 1; box-shadow: inset 0 0 0 1.5px var(--major-color); }
.day-cell.outside.major-moon { opacity: .55; }
.day-cell.full-moon { --major-color: #e2a735; background: radial-gradient(circle at 78% 18%, rgba(255,218,124,.38), transparent 31%), linear-gradient(145deg,#fffdf5,#fff); }
.day-cell.new-moon { --major-color: #435e86; background: radial-gradient(circle at 78% 18%, rgba(73,98,139,.20), transparent 31%), linear-gradient(145deg,#f1f5fa,#fff); }
.day-cell.major-moon::after { content: "注目"; position: absolute; right: 8px; bottom: 7px; padding: 2px 6px; border-radius: 999px; background: var(--major-color); color: #fff; font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.day-cell.major-moon .phase-label { color: var(--major-color); font-weight: 800; font-size: 9px; }
.day-cell.full-moon .moon-disc { box-shadow: 0 0 0 2px rgba(226,167,53,.20), 0 0 18px rgba(226,167,53,.45); }
.day-cell.new-moon .moon-disc { background: #25384e; box-shadow: 0 0 0 2px rgba(67,94,134,.22), 0 0 16px rgba(67,94,134,.24); }
.day-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.day-number { font-size: 15px; font-weight: 650; }
.mobile-weekday { display: none; font-size: 9px; color: var(--muted); }
.sunday .day-number, .holiday .day-number { color: var(--red); }
.saturday .day-number { color: var(--blue); }
.holiday-name { font-size: 8px; color: var(--red); margin-left: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.moon-visual { display: flex; align-items: center; gap: 5px; }
.moon-disc { --light: 50%; width: 25px; height: 25px; border-radius: 50%; background: #e9e3c9; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 0 12px rgba(219,211,177,.14); overflow: hidden; position: relative; flex: 0 0 auto; }
.moon-disc::after { content: ""; position: absolute; inset: 0; background: #b8c8d3; transform: translateX(var(--shadow-x, 0%)); border-radius: 50%; }
.moon-disc.waning { transform: scaleX(-1); }
.moon-disc.disc-full::after { transform: translateX(-110%); }
.moon-disc.disc-new { background: #25384e; }
.moon-disc.disc-new::after { background: #25384e; transform: none; }
.phase-label { color: #c6bcff; font-size: 8px; max-width: 45px; line-height: 1.2; }
.astro-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 8px; }
.astro-item { display: flex; gap: 5px; align-items: baseline; min-width: 0; }
.astro-item .symbol { font-size: 10px; color: var(--gold); width: 11px; }
.astro-item.moon-time .symbol { color: var(--violet); }
.astro-item:has(.moonset-mini) .symbol { width: 16px; }
.moonset-mini { position: relative; display: inline-block; width: 16px; height: 14px; vertical-align: middle; overflow: visible; }
.moonset-mini::before { content: "☾"; position: absolute; left: -1px; top: -2px; font-size: 12px; line-height: 1; }
.moonset-mini::after { content: "↓"; position: absolute; right: -1px; bottom: -1px; padding-left: 1px; background: #fff; font-size: 8px; font-weight: 900; line-height: 1; }
.astro-item div { display: grid; min-width: 0; }
.astro-item small { color: var(--muted); font-size: 7px; line-height: 1.1; }
.astro-item strong { font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.rainbow-window { display: flex; align-items: center; gap: 5px; margin-top: 9px; padding-top: 7px; border-top: 1px dashed rgba(79,119,148,.18); }
.rainbow-window > span:first-child { font-size: 11px; }
.rainbow-window > span:last-child { min-width: 0; display: grid; }
.rainbow-window small { color: var(--muted); font-size: 7px; }
.rainbow-window strong { color: #527f9c; font-size: 8px; line-height: 1.35; font-variant-numeric: tabular-nums; white-space: nowrap; }
.disclaimer { color: var(--muted); font-size: 10px; line-height: 1.7; text-align: center; margin: 17px auto 0; }
.dialog { width: min(500px, calc(100% - 30px)); color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 30px; box-shadow: 0 30px 120px rgba(30,57,78,.30); }
.dialog::backdrop { background: rgba(37,60,78,.32); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #edf3f7; cursor: pointer; font-size: 20px; }
.dialog h2 { font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; font-weight: 500; font-size: 28px; margin: 0; }
.dialog-lead { color: var(--muted); font-size: 12px; }
.settings-dialog form { display: grid; gap: 15px; margin-top: 24px; }
.settings-dialog label { display: grid; gap: 7px; font-size: 11px; color: var(--muted); }
.settings-dialog input, .settings-dialog select { width: 100%; color: var(--text); background: #f8fafc; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; outline: none; }
.settings-dialog input:focus { border-color: var(--cyan); }
.form-row, .preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.primary-button, .secondary-button { min-height: 42px; border-radius: 10px; cursor: pointer; }
.primary-button { border: 0; background: var(--cyan); color: #052033; font-weight: 700; }
.secondary-button { border: 1px solid var(--line); background: #f7fafc; font-size: 11px; }
.form-message { min-height: 16px; color: var(--cyan); font-size: 11px; margin: -4px 0; }
.detail-hero { display: flex; align-items: center; gap: 18px; margin: 8px 0 24px; }
.detail-moon .moon-disc { width: 72px; height: 72px; }
.detail-title h2 { margin: 2px 0 5px; }
.detail-title p { color: var(--muted); margin: 0; font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.detail-row { padding: 13px; background: #f7fafc; border: 1px solid var(--line); border-radius: 11px; display: flex; justify-content: space-between; }
.mobile-scroll-hint { display: none; }
.detail-row span { color: var(--muted); font-size: 11px; }
.detail-row strong { font-variant-numeric: tabular-nums; }
.rainbow-detail { display: flex; gap: 12px; margin-top: 12px; padding: 14px; border-radius: 12px; background: linear-gradient(120deg,rgba(255,221,129,.18),rgba(157,211,235,.22)); border: 1px solid rgba(79,119,148,.12); }
.rainbow-detail > span { font-size: 24px; }
.rainbow-detail div { display: grid; }
.rainbow-detail small { color: var(--muted); font-size: 10px; }
.rainbow-detail strong { margin-top: 2px; font-size: 15px; font-variant-numeric: tabular-nums; }
.rainbow-detail p { color: var(--muted); font-size: 9px; line-height: 1.55; margin: 6px 0 0; }
.detail-note { color: var(--muted); font-size: 10px; line-height: 1.6; margin: 16px 0 0; }
@media (max-width: 900px) {
  main { width: min(100% - 20px, 760px); padding-top: 25px; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary-intro { grid-column: 1 / -1; }
  .mobile-scroll-hint { display: block; margin: 10px 4px 0; color: var(--muted); text-align: center; font-size: 10px; }
}
@media (max-width: 560px) {
  .topbar { height: 66px; padding: 0 14px; }
  .brand small, .location-pill small { display: none; }
  .location-pill { padding: 7px 10px; }
  .hero { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
  .hero p:last-child { max-width: 170px; line-height: 1.5; }
  .summary > div { min-height: 72px; padding: 12px 14px; }
  .summary-item strong { font-size: 16px; }
  .form-row, .preset-row { grid-template-columns: 1fr; }
  .hero { margin-bottom: 18px; }
  .hero h1 { font-size: 34px; }
  .month-nav button { min-width: 34px; }
  .calendar-card { overflow: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
  .weekdays { display: none; }
  .calendar-grid { min-width: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; background: transparent; }
  .day-cell, .day-cell:nth-child(7n) { min-width: 0; min-height: 199px; padding: 11px 10px 9px; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 7px 22px rgba(49,79,103,.06); }
  .day-cell.outside { display: none; }
  .day-cell.major-moon { box-shadow: inset 0 0 0 1.5px var(--major-color), 0 8px 24px rgba(49,79,103,.08); }
  .day-head { margin-bottom: 9px; }
  .mobile-weekday { display: inline; }
  .holiday-name { display: block; margin: 2px 0 0; max-width: 80px; }
  .moon-visual { gap: 3px; }
  .moon-disc { width: 23px; height: 23px; }
  .phase-label { max-width: 35px; font-size: 7px; }
  .astro-list { gap: 7px 4px; }
  .astro-item { gap: 3px; }
  .astro-item .symbol { width: 9px; font-size: 9px; }
  .astro-item:has(.moonset-mini) .symbol { width: 16px; }
  .astro-item strong { font-size: 10px; letter-spacing: 0; }
  .rainbow-window { align-items: flex-start; margin-top: 8px; padding-top: 7px; }
  .rainbow-window strong { font-size: 8px; white-space: normal; }
  .day-cell.major-moon::after { bottom: 6px; }
}
@media (max-width: 350px) {
  .topbar { gap: 8px; }
  .brand strong { font-size: 18px; }
  .location-pill { padding: 7px 8px; }
  .hero h1 { font-size: 29px; white-space: nowrap; }
  .hero p:last-child { max-width: 135px; font-size: 10px; }
  .calendar-grid { gap: 6px; }
  .day-cell, .day-cell:nth-child(7n) { padding-left: 8px; padding-right: 8px; }
}
