/* 明るい配色を初期表示にし、夜間配色も選択できる。 */
:root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #f7f4ec;
  --panel: #fffdf7;
  --ink: #26352d;
  --muted: #596457;
  --gold: #805c17;
  --line: #d9d5c5;
}
.theme-switch {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 80;
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 4px 22px #0002;
}
.theme-switch button {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.theme-switch button[aria-pressed="true"] {
  background: #d8b764;
  color: #222b20;
  font-weight: 700;
}
body {
  padding-bottom: 70px;
}
:root:not([data-theme="dark"]) body {
  background: linear-gradient(160deg, #fffdf7, #f3f0e5 60%, #eef3ed);
}
:root:not([data-theme="dark"])
  :is(
    .panel,
    .card,
    .account-bar,
    .kpi-card,
    .chart-card,
    .insight-toolbar,
    .ranking-shell,
    .guild-log-row,
    .equipment-slot,
    dialog,
    .guide-rules article,
    .guide-resource-grid article,
    .guide-raids article,
    .guide-timeline article,
    .feature-portals > a,
    .founding-journal,
    .brief-grid .panel,
    .mission,
    .callout
  ) {
  background: #fffdf7;
  border-color: var(--line);
  color: var(--ink);
  box-shadow: 0 4px 20px #6e5b1810;
}
:root:not([data-theme="dark"])
  :is(.podium-card, .registration-board, .armory-paper) {
  background: linear-gradient(125deg, #fff5da, #fffdf8 55%, #edf4e9);
  border-color: #c8ad70;
  box-shadow: 0 8px 24px #6e5b1812;
}
:root:not([data-theme="dark"])
  :is(.local-notice, .stats, .principles, .guide-callout) {
  background: #ede8d7;
  color: #4d5946;
}
:root:not([data-theme="dark"]) :is(input, select, textarea) {
  background: #fffefa;
  color: #26352d;
  border-color: #b9bca7;
}
:root:not([data-theme="dark"]) :is(input, textarea)::placeholder {
  color: #767e70;
}
:root:not([data-theme="dark"])
  :is(
    .registration-heading h2,
    .registration-public,
    .arrival-title strong,
    .podium-value,
    .kpi-card strong,
    .guide-raids strong,
    .guide-timeline strong,
    .guide-rules span,
    .guide-page summary,
    .armory-portrait strong,
    .attribute-grid .card strong
  ) {
  color: #795717;
}
:root:not([data-theme="dark"])
  :is(
    .registration-heading p,
    .arrival-details,
    .arrival-time,
    .registration-note,
    #registration-status,
    .guide-source,
    .guide-timeline small,
    .guide-raids small,
    .snapshot-note,
    .slot-label,
    .guild-log-row small,
    .record-id,
    .insights-status,
    .chart-label,
    .chart-card > p,
    .founding-journal p,
    .founding-journal time,
    .guide-resource-grid p
  ) {
  color: #56624e;
}
:root:not([data-theme="dark"])
  :is(
    .podium-card.class-themed h2,
    .registration-entry.class-themed .arrival-title strong:last-child,
    .card.class-themed h3
  ) {
  color: color-mix(in srgb, var(--class-color) 40%, #14291f);
}
:root:not([data-theme="dark"])
  :is(
    .tag,
    .quiet,
    .filter-row button,
    .ranking-switch button,
    .secondary,
    .button-link,
    .file-picker button
  ) {
  background: #fffdf7;
  border-color: #aaa988;
  color: #555b35;
}
:root:not([data-theme="dark"])
  :is(
    .filter-row button[aria-pressed="true"],
    .ranking-switch button[aria-pressed="true"],
    .button-link[aria-current="page"],
    .primary
  ) {
  background: #d9b666;
  color: #242d20;
  border-color: #c29c47;
}
:root:not([data-theme="dark"]) :is(.admin-table th, .ranking-table th) {
  background: #e9e6d5;
  color: #4a542e;
}
:root:not([data-theme="dark"])
  :is(.admin-table th, .admin-table td, .ranking-table td, .ranking-table th) {
  border-color: #d8dacb;
}
:root:not([data-theme="dark"]) .admin-table tbody tr:nth-child(even) {
  background: #f1f3e9;
}
:root:not([data-theme="dark"])
  :is(.admin-table tbody tr:hover, .ranking-table tbody tr:hover) {
  background: #e8efdc;
}
:root:not([data-theme="dark"]) #admin-controls button {
  background: #f7f5e9;
  color: #4c562e;
  border-color: #b1b597;
}
:root:not([data-theme="dark"]) #admin-controls button[aria-pressed="true"] {
  background: #d9b666;
  color: #243020;
}
:root:not([data-theme="dark"]) #class-options .class-option {
  background: #f4f5ed;
  color: #26352d;
}
:root:not([data-theme="dark"]) .class-option:has(input:checked) {
  background: #e2ecd6 !important;
}
:root:not([data-theme="dark"]) .equipment-slot.quality-2 {
  color: #25651c;
}
:root:not([data-theme="dark"]) .equipment-slot.quality-3 {
  color: #125393;
}
:root:not([data-theme="dark"]) .equipment-slot.quality-4 {
  color: #7522a8;
}
:root:not([data-theme="dark"])
  :is(
    .equipment-slot.quality-5,
    .equipment-slot.quality-6,
    .equipment-slot.quality-7
  ) {
  color: #8b4b00;
}
:root:not([data-theme="dark"]) .equipment-slot:hover {
  background: #f3f0df;
}
:root:not([data-theme="dark"]) .launch-gate {
  background: #f7efd9;
  color: #25362d;
}
:root:not([data-theme="dark"]) .portal-art {
  opacity: 0.9;
}
:root:not([data-theme="dark"]) .launch-gate:before {
  background:
    linear-gradient(90deg, #fff9e638, #fff9e6c9 35%, #fff9e6c9 65%, #fff9e638),
    linear-gradient(0deg, #f7f4ec80, transparent 40%);
}
:root:not([data-theme="dark"]) .launch-gate:after {
  background: linear-gradient(0deg, #f7f4ec, transparent 70%);
}
:root:not([data-theme="dark"])
  .launch-gate
  :is(h2, h2 span, .eyebrow, .launch-subtitle, .launch-source, #launch-status) {
  color: #4f592d;
  text-shadow: none;
}
:root:not([data-theme="dark"]) .launch-gate .countdown > div {
  background: #fffaf0e8;
  border-color: #c8b17a;
  box-shadow: 0 8px 24px #6e5b1820;
}
:root:not([data-theme="dark"]) .countdown strong {
  color: #795717;
  text-shadow: none;
}
:root:not([data-theme="dark"]) .countdown span {
  color: #596457;
}
:root:not([data-theme="dark"]) .hero {
  background:
    linear-gradient(90deg, #f7f4eced 0%, #f7f4ecb8 42%, #f7f4ec40 100%),
    url("assets/portal-expedition.png") center 70% / cover no-repeat;
}
:root:not([data-theme="dark"]) .hero .landscape {
  opacity: 0.12;
}
:root:not([data-theme="dark"]) .hero :is(h1, .lead, .hero-kicker, .hero-foot) {
  color: #26352d;
}
:root:not([data-theme="dark"]) #toast {
  background: #fff9df;
  color: #26352d;
  border-color: #c8b17a;
}
/* 名簿全体の版心を揃え、登録履歴の高さを制限する。 */
[data-page="roster"] {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
[data-page="roster"] .section-heading {
  margin: 0;
  padding: 36px 0 24px;
}
[data-page="roster"] :is(.filter-row, .role-summary, .event-grid) {
  margin-left: 0;
  margin-right: 0;
}
[data-page="roster"] .registration-board {
  margin: 0 0 20px;
  padding: 20px 24px;
}
[data-page="roster"] .registration-heading h2 {
  font-size: 24px;
  margin: 4px 0 8px;
}
[data-page="roster"] .registration-heading p {
  margin: 4px 0;
  font-size: 13px;
}
[data-page="roster"] .registration-heading .eyebrow {
  font-size: 10px;
}
[data-page="roster"] .registration-list {
  max-height: 280px;
  overflow-y: auto;
  margin: 12px 0;
}
[data-page="roster"] .registration-entry {
  padding-top: 12px;
  padding-bottom: 12px;
}
[data-page="roster"] .registration-note {
  padding-top: 10px;
  margin-bottom: 0;
}
[data-page="roster"] .account-bar {
  padding: 14px 20px;
  border-radius: 8px;
}
@media (max-width: 700px) {
  [data-page="roster"] {
    width: calc(100% - 28px);
  }
  [data-page="roster"] .registration-board {
    padding: 16px;
  }
  [data-page="roster"] .registration-heading {
    flex-wrap: wrap;
    gap: 8px;
  }
  [data-page="roster"] .registration-heading h2 {
    font-size: 22px;
  }
  .theme-switch {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .theme-switch button {
    padding: 9px 13px;
  }
}
