:root {
  color-scheme: light;
  --bg: #eef7fc;
  --surface: #ffffff;
  --surface-raised: #f4f9fc;
  --surface-soft: #e6f2f8;
  --line: #c4d9e6;
  --line-strong: #91b4cb;
  --text: #173047;
  --text-muted: #60798d;
  --accent: #118fbe;
  --accent-soft: rgba(17, 143, 190, 0.13);
  --danger: #c43d49;
  --shadow: 0 18px 50px rgba(61, 103, 128, 0.14);
  --body-glow: rgba(54, 170, 226, 0.16);
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-line: rgba(94, 144, 175, 0.28);
  --card-bg: rgba(255, 255, 255, 0.94);
  --section-soft-bg: rgba(226, 241, 249, 0.56);
  --cell-bg: rgba(255, 255, 255, 0.62);
  --other-month-bg: rgba(230, 240, 246, 0.72);
  --other-month-text: #879aaa;
  --band-base: #ffffff;
  --band-text: #173047;
  --focus-contrast: #173047;
  --event-card-bg: rgba(255, 255, 255, 0.7);
  --predicted-card-a: rgba(215, 236, 247, 0.7);
  --predicted-card-b: rgba(255, 255, 255, 0.7);
  --error-text: #ffffff;
  --error-bg: #8f2833;
  --radius: 18px;
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111d;
  --surface: #0d1b2a;
  --surface-raised: #122438;
  --surface-soft: #172b40;
  --line: #284057;
  --line-strong: #3b5872;
  --text: #edf7ff;
  --text-muted: #8fa6b9;
  --accent: #58c7f3;
  --accent-soft: rgba(88, 199, 243, 0.14);
  --danger: #ff757d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  --body-glow: rgba(54, 170, 226, 0.18);
  --header-bg: rgba(7, 17, 29, 0.86);
  --header-line: rgba(92, 137, 170, 0.25);
  --card-bg: rgba(13, 27, 42, 0.94);
  --section-soft-bg: rgba(7, 17, 29, 0.3);
  --cell-bg: rgba(13, 27, 42, 0.52);
  --other-month-bg: rgba(7, 17, 29, 0.58);
  --other-month-text: #5c7184;
  --band-base: #0d1b2a;
  --band-text: #f6fbff;
  --focus-contrast: #ffffff;
  --event-card-bg: rgba(7, 17, 29, 0.48);
  --predicted-card-a: rgba(20, 48, 68, 0.48);
  --predicted-card-b: rgba(7, 17, 29, 0.48);
  --error-text: #ffffff;
  --error-bg: #5a222a;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 88% -10%, var(--body-glow), transparent 34rem),
    var(--bg);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.site-header {
  border-bottom: 1px solid var(--header-line);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
}

.header-inner,
.app-shell,
.site-footer {
  width: min(1440px, calc(100% - 32px));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  gap: 24px;
}

.section-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: 0.02em;
}

.forecast-intro {
  margin-bottom: 0;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.theme-toggle {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  background: var(--surface-raised);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.made-by-link,
.site-title-link {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.made-by-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--accent);
  background: var(--surface-raised);
  box-shadow: 0 3px 10px rgba(61, 103, 128, 0.12);
  font-size: 0.78rem;
  white-space: nowrap;
}

.made-by-link:hover,
.made-by-link:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  text-decoration: none;
  transform: translateY(-1px);
}

.site-title-link:hover,
.site-title-link:focus-visible {
  text-decoration: underline;
}

.site-title-link {
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.02em;
}

.update-status {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #66d59a;
  box-shadow: 0 0 0 5px rgba(102, 213, 154, 0.12);
}

.app-shell {
  padding-block: 28px 56px;
}

.calendar-card,
.upcoming-section,
.next-event-section,
.rerun-section,
.forecast-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.calendar-card {
  overflow: hidden;
}

.calendar-toolbar,
.filter-area,
.calendar-layout,
.upcoming-section,
.next-event-section,
.rerun-section,
.forecast-section {
  padding: 22px;
}

.calendar-toolbar,
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.month-title,
.upcoming-section h2,
.next-event-section h2,
.rerun-section h2,
.forecast-section h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
}

.toolbar-actions,
.month-actions {
  display: flex;
  align-items: center;
}

.toolbar-actions {
  justify-content: flex-end;
  gap: 12px;
}

.month-actions {
  gap: 8px;
}

.view-switch {
  display: flex;
  gap: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 3px;
  background: var(--surface-raised);
}

.view-button {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding-inline: 13px;
  color: var(--text-muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.view-button[aria-pressed="true"] {
  color: var(--band-text);
  background: var(--accent);
}

.view-button:hover,
.view-button:focus-visible {
  color: var(--text);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.view-button[aria-pressed="true"]:hover,
.view-button[aria-pressed="true"]:focus-visible {
  color: var(--band-text);
}

.icon-button,
.text-button {
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface-raised);
  cursor: pointer;
}

.icon-button {
  width: 42px;
  font-size: 1.7rem;
  line-height: 1;
}

.text-button {
  padding-inline: 18px;
  font-weight: 700;
}

.icon-button:hover,
.text-button:hover,
.icon-button:focus-visible,
.text-button:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.filter-area {
  border-block: 1px solid var(--line);
  background: var(--section-soft-bg);
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.link-button {
  border: 0;
  padding: 4px;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
}

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

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}

.filter-chip::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--category-color, var(--accent));
  content: "";
}

.filter-chip[aria-pressed="true"] {
  border-color: var(--category-color, var(--accent));
  color: var(--text);
  background: color-mix(in srgb, var(--category-color, var(--accent)) 13%, transparent);
}

.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.status-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-solid,
.legend-predicted {
  width: 22px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.legend-predicted {
  border: 1px dashed var(--accent);
  background: repeating-linear-gradient(135deg, rgba(88, 199, 243, 0.22) 0 3px, transparent 3px 6px);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
}

.calendar-region {
  min-width: 0;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekday-row {
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background: var(--surface-raised);
}

.weekday-row span {
  padding: 10px 4px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-align: center;
}

.weekday-row .sunday,
.day-cell.sunday .day-number {
  color: #ff828a;
}

.weekday-row .saturday,
.day-cell.saturday .day-number {
  color: #68b7ff;
}

.calendar-grid {
  border-top: 1px solid var(--line);
}

.calendar-week {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 38px repeat(var(--band-rows), 25px) 18px;
  border-left: 1px solid var(--line);
}

.day-cell {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px 7px;
  color: var(--text);
  background: var(--cell-bg);
  text-align: left;
  cursor: pointer;
}

.day-cell:hover,
.day-cell:focus-visible {
  z-index: 3;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  background: var(--surface-raised);
}

.day-cell.other-month {
  color: var(--other-month-text);
  background: var(--other-month-bg);
}

.day-cell.selected {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(88, 199, 243, 0.55);
}

.day-number {
  display: inline-grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
}

.day-cell.today .day-number {
  color: var(--band-text);
  background: var(--accent);
}

.week-band,
.timeline-band {
  z-index: 4;
  align-self: center;
  min-width: 0;
  height: 21px;
  margin: 1px 3px;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--category-color, var(--accent));
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--band-text);
  background: color-mix(in srgb, var(--category-color, var(--accent)) 33%, var(--band-base));
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  text-align: left;
  cursor: pointer;
}

.week-band span,
.timeline-band span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-band:hover,
.week-band:focus-visible,
.timeline-band:hover,
.timeline-band:focus-visible {
  outline: 2px solid var(--focus-contrast);
  outline-offset: -2px;
  filter: brightness(1.15);
}

.week-band.predicted,
.timeline-band.predicted {
  border: 1px dashed var(--category-color, var(--accent));
  border-left-width: 3px;
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--category-color, var(--accent)) 20%, var(--band-base)) 0 5px, var(--band-base) 5px 10px);
}

.week-band.continues-before,
.timeline-band.continues-before {
  margin-left: 0;
  border-left-width: 0;
  border-radius: 0 5px 5px 0;
  padding-left: 5px;
}

.week-band.continues-after,
.timeline-band.continues-after {
  margin-right: 0;
  border-radius: 5px 0 0 5px;
  padding-right: 5px;
}

.week-band.continues-before.continues-after,
.timeline-band.continues-before.continues-after {
  border-radius: 0;
}

.continues-before span::before {
  content: "‹ ";
  opacity: 0.7;
}

.continues-after span::after {
  content: " ›";
  opacity: 0.7;
}

.day-overflow {
  z-index: 2;
  align-self: center;
  min-width: 0;
  overflow: hidden;
  padding-inline: 6px 3px;
  color: var(--text-muted);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.timeline-hint {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.timeline-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--section-soft-bg);
  scrollbar-color: var(--accent) var(--surface-raised);
}

.timeline-scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.timeline-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--timeline-days), minmax(80px, 1fr));
  grid-template-rows: 64px repeat(var(--timeline-lanes), 32px) 12px;
  min-width: 1148px;
  border-left: 1px solid var(--line);
}

.timeline-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 8px 4px;
  text-align: center;
}

.timeline-weekday {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.timeline-day.sunday .timeline-weekday,
.timeline-day.sunday .day-number {
  color: #ff828a;
}

.timeline-day.saturday .timeline-weekday,
.timeline-day.saturday .day-number {
  color: #68b7ff;
}

.timeline-day .day-number {
  margin-top: 3px;
}

.timeline-band {
  height: 27px;
  margin-block: 2px;
  padding-inline: 8px;
  font-size: 0.7rem;
}

.day-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  background: var(--surface-raised);
}

.day-panel h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.day-event-list,
.upcoming-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px 14px;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-align: center;
}

.event-card,
.upcoming-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--category-color, var(--accent));
  border-radius: 10px;
  padding: 12px;
  background: var(--event-card-bg);
}

.event-card.predicted,
.upcoming-card.predicted {
  border-style: dashed;
  border-left-style: solid;
  background: repeating-linear-gradient(135deg, var(--predicted-card-a) 0 8px, var(--predicted-card-b) 8px 16px);
}

.event-card-top,
.upcoming-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.event-card h4,
.upcoming-card h3 {
  margin: 7px 0 6px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.category-badge,
.prediction-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.66rem;
  font-weight: 800;
}

.category-badge {
  color: var(--category-color, var(--accent));
  background: color-mix(in srgb, var(--category-color, var(--accent)) 14%, transparent);
}

.prediction-badge {
  border: 1px dashed var(--accent);
  color: var(--accent);
}

.event-date,
.event-note {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.55;
}

.source-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus-visible {
  text-decoration: underline;
}

.upcoming-section,
.next-event-section,
.rerun-section,
.forecast-section {
  margin-top: 22px;
}

.section-heading-row > p {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.upcoming-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.upcoming-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
}

.upcoming-date-block {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.upcoming-date-block strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 1.05rem;
}

.next-event-section {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--card-bg)), var(--card-bg));
}

.next-event-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.next-event-summary {
  margin: 18px 0 0;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  font-weight: 900;
  line-height: 1.7;
}

.next-event-reasons {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.7;
}

.rerun-intro {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.rerun-candidate-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.rerun-candidate-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: var(--surface-raised);
}

.rerun-rank {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--card-bg);
  background: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
}

.rerun-candidate-card h3 {
  margin: 1px 0 7px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.rerun-candidate-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.forecast-section {
  padding: 0;
  overflow: hidden;
}

.forecast-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  cursor: pointer;
  list-style: none;
}

.forecast-disclosure > summary::-webkit-details-marker {
  display: none;
}

.forecast-disclosure > summary:hover,
.forecast-disclosure > summary:focus-visible {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  outline: none;
}

.forecast-heading {
  display: block;
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  font-weight: 900;
  line-height: 1.2;
}

.forecast-summary-text {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.forecast-open-label {
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
}

.forecast-disclosure[open] .forecast-open-label::before {
  content: '閉じる';
}

.forecast-disclosure[open] .forecast-open-label {
  font-size: 0;
}

.forecast-disclosure[open] .forecast-open-label::before {
  font-size: 0.72rem;
}

.forecast-content {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.5fr);
  gap: 24px;
  border-top: 1px solid var(--line);
  padding: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface-raised);
}

.metric-card h3 {
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.metric-value {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 900;
}

.metric-label {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
}

.forecast-method {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.75;
}

.forecast-method h3 {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.86rem;
}

.forecast-method p {
  margin: 10px 0 0;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-block: 24px 36px;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.7;
}

.site-footer p {
  max-width: 850px;
  margin-bottom: 0;
}

.site-footer a {
  color: var(--accent);
  white-space: nowrap;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration-thickness: 2px;
}

.about-shell {
  width: min(900px, calc(100% - 32px));
  margin-inline: auto;
  padding-block: 32px 64px;
}

.back-link {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  text-decoration: underline;
}

.about-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(24px, 5vw, 48px);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}

.about-card > h1 {
  margin-bottom: 18px;
}

.about-card > p,
.about-card section p,
.about-links {
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.9;
}

.about-card section {
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding-top: 26px;
}

.about-card section h2 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.about-card section p {
  margin-bottom: 0;
}

.about-links {
  margin-bottom: 0;
  padding-left: 1.4rem;
}

.about-links a {
  color: var(--accent);
  font-weight: 700;
}

.error-message {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100% - 40px));
  border: 1px solid var(--danger);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--error-text);
  background: var(--error-bg);
  box-shadow: var(--shadow);
}

[data-category="maintenance"] { --category-color: #f0a33a; }
[data-category="event"] { --category-color: #f2649e; }
[data-category="event_rerun"] { --category-color: #d55fa2; }
[data-category="reward"] { --category-color: #c47aaf; }
[data-category="gacha"] { --category-color: #65c77a; }
[data-category="total"] { --category-color: #ff765b; }
[data-category="grand"] { --category-color: #ff9670; }
[data-category="joint"] { --category-color: #e9b25e; }
[data-category="restriction"] { --category-color: #9a88f2; }

@media (max-width: 1050px) {
  .calendar-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .upcoming-list {
    grid-template-columns: 1fr;
  }

  .rerun-candidate-list {
    grid-template-columns: 1fr;
  }

  .forecast-content {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 700px) {
  .header-inner,
  .app-shell,
  .site-footer {
    width: min(100% - 20px, 1440px);
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
    padding-block: 24px;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
    flex-wrap: wrap;
  }

  .app-shell {
    padding-top: 14px;
  }

  .calendar-toolbar,
  .filter-area,
  .calendar-layout,
  .upcoming-section,
  .next-event-section,
  .rerun-section {
    padding: 14px;
  }

  .forecast-disclosure > summary,
  .forecast-content {
    padding: 14px;
  }

  .calendar-week {
    grid-template-rows: 34px repeat(var(--band-rows), 22px) 16px;
  }

  .day-cell {
    padding: 4px;
  }

  .day-number {
    width: 23px;
    height: 23px;
    font-size: 0.72rem;
  }

  .week-band {
    height: 19px;
    margin-inline: 2px;
    border-left-width: 2px;
    padding-inline: 4px;
    font-size: 0.58rem;
  }

  .day-overflow {
    padding-inline: 4px 2px;
    font-size: 0.57rem;
  }

  .site-footer {
    display: block;
  }

  .site-footer a {
    display: inline-block;
  }

  .about-shell {
    width: min(100% - 20px, 900px);
    padding-block: 20px 44px;
  }
}

@media (max-width: 480px) {
  .calendar-toolbar,
  .section-heading-row {
    align-items: flex-start;
  }

  .calendar-toolbar {
    flex-wrap: wrap;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .month-actions {
    gap: 5px;
  }

  .view-button {
    padding-inline: 10px;
  }

  .icon-button {
    width: 36px;
  }

  .text-button {
    padding-inline: 11px;
  }

  .filter-chip {
    min-height: 31px;
    padding: 5px 9px;
    font-size: 0.72rem;
  }

  .upcoming-card {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 9px;
  }
}
