:root {
  --bg: #0f1420;
  --bg-soft: #151b2b;
  --card: #151b2b;
  --text-main: #f7f8ff;
  --text-sub: #a6b0d8;
  --border-soft: #111624;

  --shadow-light: -8px -8px 16px rgba(255, 255, 255, 0.04);
  --shadow-dark: 12px 12px 24px rgba(0, 0, 0, 0.7);

  --accent: #4f8cff;
  --accent-soft: #2b3c6a;

  --holiday-main: #ff6b81;
  --holiday-sub: #ffb347;
  --holiday-citizen: #4fdf8f;

  --radius-lg: 18px;
  --radius-pill: 999px;
}

body.light-theme {
  --bg: #e6ecf7;
  --bg-soft: #f3f6fc;
  --card: #f3f6fc;
  --text-main: #1b2330;
  --text-sub: #5c6478;
  --border-soft: #cfd6e6;

  --shadow-light: -8px -8px 16px rgba(255, 255, 255, 0.9);
  --shadow-dark: 10px 10px 20px rgba(163, 177, 198, 0.7);

  --accent: #2f6bff;
  --accent-soft: #d7e1ff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1b2340 0, var(--bg) 55%, #050712 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

body.light-theme {
  background: radial-gradient(circle at top, #ffffff 0, #e6ecf7 55%, #d5ddef 100%);
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  flex: 1;
}

/* HEADER */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f8cff, #9b6bff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(79, 140, 255, 0.7);
}

.brand-text-main {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-text-sub {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-sub);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* BUTTONS & SELECT */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--card);
  color: var(--text-main);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  cursor: pointer;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-light), 14px 14px 26px rgba(0, 0, 0, 0.8);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.4),
              inset -4px -4px 8px rgba(255, 255, 255, 0.05);
}

.btn-toggle {
  min-width: 90px;
  justify-content: center;
}

.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--card);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  font-size: 12px;
  color: var(--text-sub);
}

.select-wrap label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

select {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-main);
  font-size: 13px;
}

/* HEADER PILL */
.header-pill {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--card);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  font-size: 11px;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4fdf8f;
  box-shadow: 0 0 10px rgba(79, 223, 143, 0.9);
}

/* CARD (ニューモーフィズム) */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  padding: 18px 18px 16px;
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.2fr);
  gap: 18px;
}

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

.hero-title {
  font-size: clamp(22px, 3.2vw, 28px);
  font-weight: 650;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

.hero-desc strong {
  color: var(--text-main);
}

.hero-controls {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.status-pill {
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-soft);
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.4),
              inset -4px -4px 8px rgba(255, 255, 255, 0.04);
  font-size: 11px;
  color: var(--text-sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #4fdf8f;
}

.hero-api {
  margin-top: 10px;
}

.error-text {
  margin-top: 8px;
  font-size: 12px;
  color: #ff6b81;
}

/* HERO SIDE */
.hero-side {
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  padding: 14px 14px 12px;
}

.side-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.side-list {
  margin-bottom: 10px;
  padding-left: 1.1em;
  font-size: 12px;
  color: var(--text-sub);
}

.side-list li {
  margin-bottom: 3px;
}

/* SECTION TITLE */
.section-title {
  margin-top: 20px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}

/* CALENDAR WRAPPER */
.calendar-wrapper {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 960px) {
  .calendar-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .calendar-wrapper {
    display: none;
  }
}

/* MONTH CARD */
.month-card {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow-light), var(--shadow-dark);
  padding: 12px 12px 10px;
}

.month-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.month-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.month-sub {
  font-size: 11px;
  color: var(--text-sub);
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 3px;
  font-size: 13px;
}

.day-cell {
  min-height: 40px;
  border-radius: 12px;
  background: var(--bg-soft);
  box-shadow: var(--shadow-light), var(--shadow-dark);
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  overflow: hidden;
}

.day-num {
  font-size: 13px;
  margin-bottom: 2px;
}

.holiday-name {
  font-size: 10px;
  color: #ff9ba5;
  line-height: 1.2;
  padding: 0 2px;
  word-break: break-all;
}

.empty {
  opacity: 0;
  pointer-events: none;
}

.today {
  box-shadow: inset 4px 4px 8px rgba(0, 0, 0, 0.5),
              inset -4px -4px 8px rgba(255, 255, 255, 0.06);
  border: 1px solid var(--accent);
}

/* HOLIDAY COLORS */
.holiday-main {
  color: var(--holiday-main);
  font-weight: 600;
}

.holiday-sub {
  color: var(--holiday-sub);
  font-weight: 600;
}

.holiday-citizen {
  color: var(--holiday-citizen);
  font-weight: 600;
}

.holiday-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.holiday-dot.main {
  background: var(--holiday-main);
}

.holiday-dot.sub {
  background: var(--holiday-sub);
}

.holiday-dot.citizen {
  background: var(--holiday-citizen);
}

/* MOBILE SWIPER */
.month-swiper {
  margin-top: 20px;
  display: none;
}

@media (max-width: 640px) {
  .month-swiper {
    display: block;
  }
}

.swiper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.swiper-title {
  font-size: 15px;
  font-weight: 600;
}

.swiper-btn {
  font-size: 12px;
  padding: 4px 10px;
}

.swiper-card {
  touch-action: pan-y;
}

/* TABLE */
.table-section {
  margin-top: 24px;
}

.table-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.table-sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

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

.holiday-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.holiday-table th,
.holiday-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

body.light-theme .holiday-table th,
body.light-theme .holiday-table td {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.holiday-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-sub);
}

.holiday-type-badge {
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  border: 1px solid transparent;
}

.badge-main {
  color: var(--holiday-main);
  border-color: var(--holiday-main);
}

.badge-sub {
  color: var(--holiday-sub);
  border-color: var(--holiday-sub);
}

.badge-citizen {
  color: var(--holiday-citizen);
  border-color: var(--holiday-citizen);
}

/* FOOTER */
.footer {
  padding: 10px 16px 18px;
  font-size: 11px;
  color: var(--text-sub);
  text-align: center;
}

.footer a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* PRINT */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .page {
    max-width: 100%;
    padding: 0;
  }
  .header,
  .hero,
  .month-swiper,
  .header-right {
    display: none !important;
  }
  .calendar-wrapper {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .month-card,
  .table-section {
    box-shadow: none !important;
    background: #ffffff !important;
  }
  .footer {
    display: none !important;
  }
}
