:root {
  --bg: #e7f1ef;
  --text: #173034;
  --muted: #5d777a;
  --accent: #147c74;
  --accent-dark: #0f5f63;
  --danger: #bc4f45;
  --ink: #214246;
  --panel: rgba(247, 252, 251, 0.88);
  --line: rgba(39, 73, 76, 0.12);
  --shadow: 0 24px 60px rgba(31, 74, 78, 0.14);
  --hero-bg: linear-gradient(135deg, rgba(252, 255, 254, 0.95), rgba(237, 249, 247, 0.92));
  --hero-side-bg: rgba(255, 255, 255, 0.58);
  --hero-side-border: rgba(39, 73, 76, 0.08);
  --stat-bg: linear-gradient(180deg, rgba(252, 255, 254, 0.92), rgba(242, 249, 248, 0.86));
  --surface-strong: rgba(255, 255, 255, 0.88);
  --surface: rgba(255, 255, 255, 0.82);
  --surface-soft: rgba(255, 255, 255, 0.68);
  --surface-border: rgba(74, 55, 41, 0.12);
  --focus-outline: rgba(196, 91, 44, 0.18);
  --focus-border: rgba(196, 91, 44, 0.38);
  --trend-panel-bg: linear-gradient(180deg, rgba(250, 255, 254, 0.94) 0%, rgba(238, 248, 246, 0.92) 100%);
  --trend-meta-bg: rgba(20, 124, 116, 0.08);
  --chart-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(246, 251, 250, 0.9) 100%);
  --chart-card-border: rgba(39, 73, 76, 0.08);
  --chart-switch-bg: rgba(255, 255, 255, 0.62);
  --axis-line: rgba(74, 55, 41, 0.2);
  --grid-line: rgba(23, 48, 52, 0.18);
  --point-fill: #ffffff;
  --point-stroke: var(--accent-dark);
  --total-area-top: rgba(20, 124, 116, 0.28);
  --total-area-bottom: rgba(20, 124, 116, 0.02);
  --danger-soft: rgba(188, 79, 69, 0.12);
  --danger-soft-hover: rgba(188, 79, 69, 0.2);
  --badge-bg: rgba(196, 91, 44, 0.12);
  --badge-danger-bg: rgba(163, 58, 45, 0.12);
  --warning: #ffcc18;
  --warning-soft: rgba(255, 204, 24, 0.2);
  --scrollbar-thumb: rgba(20, 124, 116, 0.32);
  --scrollbar-thumb-hover: rgba(20, 124, 116, 0.48);
  --scrollbar-track: rgba(20, 124, 116, 0.08);
  --time-pill-bg: rgba(20, 124, 116, 0.12);
  --time-pill-border: rgba(20, 124, 116, 0.18);
  --tooltip-bg: rgba(38, 35, 35, 0.86);
  --tooltip-border: rgba(255, 255, 255, 0.12);
  --tooltip-shadow: 0 18px 42px rgba(17, 42, 45, 0.24);
  --legend-off: rgba(93, 119, 122, 0.72);
  --hover-guide: rgba(94, 214, 201, 0.78);
  --hover-column: rgba(94, 214, 201, 0.08);
}

:root[data-theme="dark"] {
  --bg: #0d1719;
  --text: #e2f0ee;
  --muted: #9eb8b5;
  --accent: #5cd2c1;
  --accent-dark: #33b1a0;
  --danger: #f08b80;
  --ink: #d4f0ec;
  --panel: rgba(16, 28, 31, 0.84);
  --line: rgba(126, 169, 165, 0.16);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  --hero-bg: linear-gradient(135deg, rgba(17, 31, 34, 0.96), rgba(14, 42, 40, 0.92));
  --hero-side-bg: rgba(8, 20, 22, 0.46);
  --hero-side-border: rgba(126, 169, 165, 0.12);
  --stat-bg: linear-gradient(180deg, rgba(22, 36, 39, 0.96), rgba(15, 27, 30, 0.92));
  --surface-strong: rgba(22, 38, 41, 0.94);
  --surface: rgba(18, 30, 33, 0.88);
  --surface-soft: rgba(17, 28, 31, 0.86);
  --surface-border: rgba(126, 169, 165, 0.14);
  --focus-outline: rgba(92, 210, 193, 0.18);
  --focus-border: rgba(92, 210, 193, 0.34);
  --trend-panel-bg: linear-gradient(180deg, rgba(18, 34, 37, 0.96) 0%, rgba(14, 27, 29, 0.92) 100%);
  --trend-meta-bg: rgba(92, 210, 193, 0.12);
  --chart-card-bg: linear-gradient(180deg, rgba(18, 31, 34, 0.95) 0%, rgba(12, 22, 24, 0.98) 100%);
  --chart-card-border: rgba(126, 169, 165, 0.12);
  --chart-switch-bg: rgba(16, 30, 33, 0.8);
  --axis-line: rgba(194, 232, 226, 0.16);
  --grid-line: rgba(194, 232, 226, 0.18);
  --point-fill: #0d1719;
  --point-stroke: #7be0d2;
  --total-area-top: rgba(92, 210, 193, 0.24);
  --total-area-bottom: rgba(92, 210, 193, 0.02);
  --danger-soft: rgba(240, 139, 128, 0.14);
  --danger-soft-hover: rgba(240, 139, 128, 0.22);
  --badge-bg: rgba(92, 210, 193, 0.12);
  --badge-danger-bg: rgba(240, 139, 128, 0.14);
  --warning: #ffe45c;
  --warning-soft: rgba(255, 228, 92, 0.18);
  --scrollbar-thumb: rgba(92, 210, 193, 0.34);
  --scrollbar-thumb-hover: rgba(92, 210, 193, 0.5);
  --scrollbar-track: rgba(92, 210, 193, 0.08);
  --time-pill-bg: rgba(92, 210, 193, 0.14);
  --time-pill-border: rgba(92, 210, 193, 0.18);
  --tooltip-bg: rgba(38, 35, 35, 0.5);
  --tooltip-border: rgba(255, 255, 255, 0.12);
  --tooltip-shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
  --legend-off: rgba(158, 184, 181, 0.84);
  --hover-guide: rgba(94, 214, 201, 0.78);
  --hover-column: rgba(94, 214, 201, 0.08);
}

* {
  box-sizing: border-box;
}

body,
.hero,
.panel,
.hero-side,
.theme-switcher,
.theme-button,
.field select,
.search-input,
.chart,
.chart-switches,
.filter-button,
.chart-switch,
.map-list li,
.history-item,
.danger-button,
.badge,
.trend-panel .meta,
.primary {
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.trend-line,
.axis,
.grid-line,
.point,
.total-area,
.point-label,
.axis-label {
  transition:
    stroke 180ms ease,
    fill 180ms ease,
    opacity 180ms ease;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color-scheme: light;
  background:
    radial-gradient(circle at 0% 0%, rgba(192, 236, 229, 0.92), transparent 22%),
    radial-gradient(circle at 100% 10%, rgba(81, 167, 156, 0.18), transparent 20%),
    radial-gradient(circle at 50% 100%, rgba(20, 124, 116, 0.08), transparent 28%),
    linear-gradient(180deg, #f8fcfb 0%, var(--bg) 100%);
}

:root[data-theme="dark"] body {
  color-scheme: dark;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 120, 112, 0.22), transparent 20%),
    radial-gradient(circle at 100% 10%, rgba(38, 109, 118, 0.16), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(92, 210, 193, 0.08), transparent 24%),
    linear-gradient(180deg, #0a1315 0%, var(--bg) 100%);
}

html {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

body::-webkit-scrollbar,
.map-list::-webkit-scrollbar,
.history-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-track,
.map-list::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.map-list::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

body::-webkit-scrollbar-thumb:hover,
.map-list::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

.shell {
  width: min(1680px, calc(100vw - 36px));
  margin: 16px auto 32px;
  isolation: isolate;
}

.hero,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-clip: padding-box;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(320px, 0.8fr);
  gap: 32px;
  padding: 30px 32px;
  align-items: center;
  background: var(--hero-bg), var(--panel);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-logo {
  display: block;
  width: clamp(38px, 5vw, 54px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 16px rgba(17, 42, 45, 0.12));
}

:root[data-theme="dark"] .brand-logo {
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.28));
}

h1,
h2,
.value {
  margin: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.02;
}

.subtitle {
  margin: 16px 0 0;
  max-width: 920px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 17px;
}

.access-hint {
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.access-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 0 4px 0 2px;
  font-size: 13px;
  font-weight: 800;
  border: 1px solid transparent;
}

.access-pill.is-admin {
  color: var(--accent-dark);
  background: rgba(20, 124, 116, 0.12);
  border-color: rgba(20, 124, 116, 0.18);
}

.access-pill.is-guest {
  color: #a36c00;
  background: rgba(255, 214, 10, 0.16);
  border-color: rgba(255, 214, 10, 0.28);
}

:root[data-theme="dark"] .access-pill.is-admin {
  color: #98efe4;
  background: rgba(94, 214, 201, 0.14);
  border-color: rgba(94, 214, 201, 0.22);
}

:root[data-theme="dark"] .access-pill.is-guest {
  color: #ffe27a;
  background: rgba(255, 214, 10, 0.14);
  border-color: rgba(255, 214, 10, 0.24);
}

.hero-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  align-items: stretch;
  min-height: 100%;
  padding: 18px;
  border-radius: 22px;
  background: var(--hero-side-bg);
  border: 1px solid var(--hero-side-border);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-clip: padding-box;
}

.hero-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.theme-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
}

.theme-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.theme-button:hover {
  transform: translateY(-1px);
  background: var(--surface-strong);
}

.theme-button.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fffaf6;
}

.primary {
  border: 0;
  border-radius: 999px;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fffaf7;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: transform 140ms ease, opacity 140ms ease;
}

.ghost-button,
.icon-button {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  background: var(--surface-strong);
}

.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.ghost-button:disabled:hover,
.danger-button:disabled:hover {
  transform: none;
}

.icon-button {
  padding: 9px 14px;
}

.primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.primary.is-busy:disabled {
  cursor: wait;
}

.status,
.meta,
.helper,
.filter-copy {
  color: var(--muted);
}

body.modal-open {
  overflow: hidden;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.stat {
  padding: 20px 22px;
  min-height: 126px;
  background: var(--stat-bg);
}

.label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.value {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
}

.value.accent {
  color: var(--accent);
}

.value.danger {
  color: var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(360px, 0.92fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.panel {
  padding: 22px;
  min-width: 0;
}

.layout > .stack:last-child {
  position: sticky;
  top: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.modal-shell[hidden] {
  display: none;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 22, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  width: min(100%, 520px);
  padding: 22px;
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.modal-head {
  align-items: center;
}

.modal-copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.settings-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.password-field {
  position: relative;
}

.password-field .search-input {
  min-width: 0;
  padding-right: 92px;
}

.field-action {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 9px 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  z-index: 2;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.field-action:hover {
  transform: translateY(calc(-50% - 1px));
  background: var(--surface-strong);
}

.field-action.is-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.field-action.is-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-action.is-icon:hover {
  transform: translateY(-50%);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.field-action.is-icon .eye-closed {
  display: none;
}

.field-action.is-icon.is-active {
  color: var(--accent-dark);
}

.field-action.is-icon.is-active .eye-open {
  display: none;
}

.field-action.is-icon.is-active .eye-closed {
  display: block;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.modal-manage-row {
  display: flex;
  justify-content: flex-start;
  margin-top: -2px;
}

.panel-head.subhead {
  margin-top: 18px;
}

.change-panel {
  min-height: 0;
  min-width: 0;
}

.change-panel .map-list {
  max-height: none;
  overflow: visible;
}

.filter-panel .map-list {
  max-height: 68vh;
}

.manage-panel {
  margin-top: 18px;
}

.manage-panel .history-list {
  max-height: none;
  overflow: visible;
}

h2 {
  font-size: 22px;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.compare-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.compare-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  min-width: 0;
}

.compare-slot {
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  min-width: 0;
}

.compare-slot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.compare-kicker {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.target-slot .compare-kicker {
  color: var(--accent);
}

.base-slot .compare-kicker {
  color: var(--muted);
}

.compare-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.compare-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.timeline-panel {
  margin-top: 14px;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  min-width: 0;
  overflow: visible;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.compare-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
}

.compare-timeline.empty {
  display: block;
}

.timeline-empty {
  color: var(--muted);
  font-size: 13px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.timeline-item:hover {
  transform: translateY(-1px);
  background: var(--surface-strong);
}

.timeline-item.is-pending-base {
  border-color: rgba(255, 204, 24, 0.5);
  box-shadow:
    inset 0 0 0 1px rgba(255, 204, 24, 0.18),
    0 10px 24px rgba(255, 204, 24, 0.08);
}

.timeline-item.is-muted {
  opacity: 0.56;
  border-color: rgba(129, 149, 180, 0.18);
  background: rgba(129, 149, 180, 0.08);
}

.timeline-item.is-muted:hover {
  transform: none;
}


.timeline-item.is-target {
  border-color: rgba(20, 124, 116, 0.34);
  box-shadow: inset 0 0 0 1px rgba(20, 124, 116, 0.12);
}

.timeline-item.is-base {
  border-color: rgba(255, 204, 24, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 204, 24, 0.14);
}

.timeline-item.is-target.is-base {
  border-color: rgba(129, 101, 235, 0.34);
  box-shadow: inset 0 0 0 1px rgba(129, 101, 235, 0.16);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  margin-top: 4px;
  border-radius: 999px;
  flex: 0 0 12px;
  background: var(--muted);
}

.timeline-item.is-target .timeline-dot {
  background: var(--accent);
}

.timeline-item.is-base .timeline-dot {
  background: var(--warning);
}

.timeline-item.is-target.is-base .timeline-dot {
  background: #8165eb;
}

.timeline-meta {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.timeline-meta strong {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.timeline-meta span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-stats {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.timeline-stat {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid transparent;
}

.timeline-stat.is-bookable {
  color: var(--accent-dark);
  background: rgba(20, 124, 116, 0.1);
  border-color: rgba(20, 124, 116, 0.16);
}

.timeline-stat.is-forbidden {
  color: #c63b3b;
  background: rgba(226, 82, 82, 0.1);
  border-color: rgba(226, 82, 82, 0.18);
}

.compare-chip {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.compare-chip.ghost {
  color: var(--muted);
}

.compare-chip:hover {
  transform: translateY(-1px);
  background: var(--surface-strong);
}

.compare-chip.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fffaf6;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 14px;
}

.field span {
  color: var(--muted);
}

.field select,
.search-input {
  width: 100%;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 13px 15px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 15px;
}

.field select:focus,
.search-input:focus {
  outline: 2px solid var(--focus-outline);
  border-color: var(--focus-border);
}

.helper {
  margin: 14px 0 0;
  line-height: 1.6;
}

.time-diff-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  margin: 0 2px;
  background: var(--time-pill-bg);
  border: 1px solid var(--time-pill-border);
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.trend-panel {
  padding: 24px;
  background: var(--trend-panel-bg);
  min-width: 0;
}

.compare-panel,
.filter-panel,
.manage-panel {
  min-width: 0;
}

.trend-panel .panel-head {
  align-items: flex-start;
}

.trend-panel .meta {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--trend-meta-bg);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.chart {
  margin-top: 16px;
  min-height: 300px;
  display: grid;
  align-items: center;
  padding: 14px;
  border-radius: 24px;
  background: var(--chart-card-bg);
  border: 1px solid var(--chart-card-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  position: relative;
  overflow: visible;
}

:root.theme-switching .hero,
:root.theme-switching .panel,
:root.theme-switching .hero-side,
:root.theme-switching .chart,
:root.theme-switching .chart-tooltip {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.chart-surface {
  border-radius: 18px;
  overflow: hidden;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.chart-switches {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 8px;
  align-items: center;
}

.chart-mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.chart-mode-copy {
  color: var(--muted);
  font-size: 13px;
}

.legend-item {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.legend-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  transform: translateY(-50%);
}

.legend-item.total::before {
  background: var(--accent);
}

.legend-item.mg::before {
  background: #ef8b2c;
}

.legend-item.surf::before {
  background: #3b82f6;
}

.legend-item.bhop::before {
  background: #8b5cf6;
}

.legend-item.other::before {
  background: #7c8b52;
}

.chart-empty {
  color: var(--muted);
}

.chart-svg {
  width: 100%;
  height: 420px;
}

.axis {
  stroke: var(--axis-line);
  stroke-width: 1.5;
}

.grid-line {
  stroke: var(--grid-line);
  stroke-width: 1.2;
  stroke-dasharray: 6 8;
}

.grid-tick {
  stroke: var(--grid-line);
  stroke-width: 2;
  stroke-linecap: round;
}

.hover-guide {
  stroke: var(--hover-guide);
  stroke-width: 1.5;
  stroke-dasharray: 5 7;
  opacity: 0;
  transition: opacity 160ms ease;
}

.hover-guide.is-visible {
  opacity: 1;
}

.hover-column {
  fill: var(--hover-column);
  opacity: 0;
  transition: opacity 160ms ease;
}

.hover-column.is-visible {
  opacity: 1;
}

.compare-range {
  fill: rgba(20, 124, 116, 0.1);
  stroke: rgba(20, 124, 116, 0.22);
  stroke-width: 1;
}

.trend-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-line.total-line {
  stroke: var(--accent);
  stroke-width: 4.5;
}

.trend-line.mg-line {
  stroke: #ef8b2c;
}

.trend-line.surf-line {
  stroke: #3b82f6;
}

.trend-line.bhop-line {
  stroke: #8b5cf6;
}

.trend-line.other-line {
  stroke: #7c8b52;
}

.total-area {
  fill: url(#totalAreaFill);
}

.hover-band {
  fill: transparent;
  pointer-events: all;
}

.point {
  fill: var(--point-fill);
  stroke: var(--point-stroke);
  stroke-width: 2.5;
}

.line-point {
  fill: var(--point-fill);
  stroke-width: 2;
}

.line-point.total-point {
  stroke: var(--accent);
}

.line-point.mg-point {
  stroke: #ef8b2c;
}

.line-point.surf-point {
  stroke: #3b82f6;
}

.line-point.bhop-point {
  stroke: #8b5cf6;
}

.line-point.other-point {
  stroke: #7c8b52;
}

.point-label {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.point-label-total {
  fill: var(--muted);
}

.point-label-mg {
  fill: #ef8b2c;
}

.point-label-surf {
  fill: #3b82f6;
}

.point-label-bhop {
  fill: #8b5cf6;
}

.point-label-other {
  fill: #7c8b52;
}

.axis-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.axis-label-y {
  font-size: 11px;
  font-weight: 800;
  opacity: 1;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  min-width: 210px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--tooltip-bg);
  border: 1px solid var(--tooltip-border);
  box-shadow: var(--tooltip-shadow);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transform-origin: center bottom;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.chart-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.96);
  font-size: 11px;
  line-height: 1.45;
}

.tooltip-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 2px;
  flex: 0 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.tooltip-dot.total {
  background: var(--accent);
}

.tooltip-dot.mg {
  background: #ef8b2c;
}

.tooltip-dot.surf {
  background: #3b82f6;
}

.tooltip-dot.bhop {
  background: #8b5cf6;
}

.tooltip-dot.other {
  background: #7c8b52;
}

.tooltip-label {
  display: inline-block;
  color: rgba(255, 255, 255, 0.98);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  align-items: center;
}

.filter-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.filter-stat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.filter-stat strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.filter-stat:hover {
  transform: translateY(-1px);
}

.filter-stat.is-active {
  box-shadow: inset 0 0 0 1px rgba(20, 124, 116, 0.12);
  border-color: rgba(20, 124, 116, 0.26);
}

.filter-stat.is-warning {
  color: #b77900;
  background: rgba(255, 214, 10, 0.14);
  border-color: rgba(255, 214, 10, 0.32);
}

.filter-stat.is-warning strong {
  color: #b77900;
}

.filter-stat.is-muted {
  color: var(--muted);
}

.filter-stat.is-accent {
  color: var(--accent-dark);
  background: rgba(20, 124, 116, 0.12);
  border-color: rgba(20, 124, 116, 0.22);
}

.filter-stat.is-accent strong {
  color: var(--accent-dark);
}

.filter-stat.is-accent.is-active {
  box-shadow: inset 0 0 0 1px rgba(20, 124, 116, 0.18);
  border-color: rgba(20, 124, 116, 0.34);
}

.filter-stat.is-warning.is-active {
  box-shadow: inset 0 0 0 1px rgba(255, 214, 10, 0.22);
  border-color: rgba(255, 214, 10, 0.44);
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.search-input {
  min-width: min(100%, 320px);
  flex: 1 1 320px;
}

.filter-button {
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.chart-switch {
  border: 0;
  border-radius: 999px;
  padding: 6px 0 6px 28px;
  background: transparent;
  color: var(--legend-off);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  position: relative;
  transition: color 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.filter-button:hover {
  transform: translateY(-1px);
}

.chart-switch:hover {
  transform: translateY(-1px);
  color: var(--text);
}

.filter-button.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: #fffaf6;
}

.chart-switch.is-active {
  color: var(--text);
  font-weight: 700;
}

.chart-switch.is-locked {
  cursor: default;
  opacity: 1;
}

.chart-switch.is-locked:hover {
  transform: none;
}

.chart-switch::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  transform: translateY(-50%);
  border: 1.8px solid currentColor;
  background: transparent;
}

.chart-switch.series-total {
  color: var(--accent);
}

.chart-switch.series-mg {
  color: #ef8b2c;
}

.chart-switch.series-surf {
  color: #3b82f6;
}

.chart-switch.series-bhop {
  color: #8b5cf6;
}

.chart-switch.series-other {
  color: #7c8b52;
}

.chart-switch:not(.is-active) {
  opacity: 0.56;
}

.chart-switch.is-active::before {
  background: currentColor;
}

.badge {
  min-width: 40px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--accent);
  text-align: center;
  font-weight: 800;
}

.badge.danger {
  background: var(--badge-danger-bg);
  color: var(--danger);
}

.map-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.map-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
}

.map-list li.is-forbidden {
  background: rgba(226, 82, 82, 0.06);
  border-color: rgba(226, 82, 82, 0.55);
  box-shadow:
    inset 0 0 0 1px rgba(226, 82, 82, 0.12),
    0 10px 22px rgba(226, 82, 82, 0.08);
}

.map-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.map-workshop-link {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  background: rgba(59, 130, 246, 0.08);
  color: #2a67c7;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.map-workshop-link:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.14);
}

.map-difficulty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  color: #f8fff7;
  line-height: 1;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 8px 16px rgba(17, 24, 39, 0.1);
}

.map-head .map-difficulty {
  color: #f8fff7;
}

.map-difficulty.level-easy {
  background: rgb(29, 160, 18);
}

.map-difficulty.level-normal {
  background: rgb(102, 160, 18);
}

.map-difficulty.level-hard {
  background: rgb(85, 121, 33);
}

.map-difficulty.level-very-hard {
  background: rgb(121, 95, 33);
}

.map-difficulty.level-epic {
  background: rgb(121, 62, 33);
}

.map-difficulty.level-nightmare {
  background: rgb(121, 49, 33);
}

.map-difficulty.level-abyss {
  background: rgb(68, 32, 24);
}

.map-change-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.map-list li .map-change-badge {
  color: #6f5200;
}

.map-list li strong {
  font-size: 15px;
}

.map-list li span {
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}

.map-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  background: rgba(129, 149, 180, 0.08);
  line-height: 1.35;
}

.map-meta-pill em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.map-meta-pill strong {
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  word-break: break-word;
}

.map-meta-pill.is-name {
  background: rgba(20, 124, 116, 0.1);
  border-color: rgba(20, 124, 116, 0.18);
}

.map-meta-pill.is-name em,
.map-meta-pill.is-name strong {
  color: var(--accent-dark);
}

.map-meta-pill.is-code {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.18);
}

.map-meta-pill.is-code em,
.map-meta-pill.is-code strong {
  color: #2a67c7;
}

.map-meta-pill.is-price {
  background: rgba(239, 139, 44, 0.12);
  border-color: rgba(239, 139, 44, 0.24);
}

.map-meta-pill.is-price em,
.map-meta-pill.is-price strong {
  color: #c56d17;
}

.map-meta-pill.is-forbidden {
  background: rgba(226, 82, 82, 0.12);
  border-color: rgba(226, 82, 82, 0.28);
}

.map-meta-pill.is-forbidden em,
.map-meta-pill.is-forbidden strong {
  color: #c63b3b;
}

:root[data-theme="dark"] .map-change-badge {
  background: linear-gradient(135deg, #f0c93d, #c99514);
  color: #3d2a00;
  border-color: rgba(255, 244, 197, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(201, 149, 20, 0.18);
}

:root[data-theme="dark"] .map-list li .map-change-badge {
  color: #3d2a00;
}

:root[data-theme="dark"] .map-list li strong {
  color: #f4fbfa;
}

:root[data-theme="dark"] .map-list li span {
  color: #b7cbc8;
}

:root[data-theme="dark"] .map-meta-pill {
  background: rgba(168, 184, 206, 0.1);
  border-color: rgba(168, 184, 206, 0.16);
}

:root[data-theme="dark"] .map-meta-pill em {
  color: #a6b8c4;
}

:root[data-theme="dark"] .map-meta-pill strong {
  color: #f4fbfa;
}

:root[data-theme="dark"] .map-meta-pill.is-name {
  background: rgba(94, 214, 201, 0.14);
  border-color: rgba(94, 214, 201, 0.22);
}

:root[data-theme="dark"] .map-meta-pill.is-name em,
:root[data-theme="dark"] .map-meta-pill.is-name strong {
  color: #98efe4;
}

:root[data-theme="dark"] .map-meta-pill.is-code {
  background: rgba(91, 157, 255, 0.14);
  border-color: rgba(91, 157, 255, 0.24);
}

:root[data-theme="dark"] .map-meta-pill.is-code em,
:root[data-theme="dark"] .map-meta-pill.is-code strong {
  color: #9bc2ff;
}

:root[data-theme="dark"] .map-workshop-link {
  color: #9bc2ff;
  background: rgba(91, 157, 255, 0.14);
  border-color: rgba(91, 157, 255, 0.24);
}

:root[data-theme="dark"] .map-workshop-link:hover {
  background: rgba(91, 157, 255, 0.2);
}

:root[data-theme="dark"] .map-meta-pill.is-price {
  background: rgba(255, 171, 89, 0.14);
  border-color: rgba(255, 171, 89, 0.24);
}

:root[data-theme="dark"] .map-meta-pill.is-price em,
:root[data-theme="dark"] .map-meta-pill.is-price strong {
  color: #ffc88b;
}

:root[data-theme="dark"] .map-meta-pill.is-forbidden {
  background: rgba(255, 112, 112, 0.14);
  border-color: rgba(255, 112, 112, 0.24);
}

:root[data-theme="dark"] .map-meta-pill.is-forbidden em,
:root[data-theme="dark"] .map-meta-pill.is-forbidden strong {
  color: #ff9e9e;
}

:root[data-theme="dark"] .map-list li.is-forbidden {
  background: rgba(226, 82, 82, 0.1);
  border-color: rgba(255, 120, 120, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(255, 120, 120, 0.12),
    0 12px 26px rgba(120, 18, 18, 0.18);
}

.map-list.empty li {
  color: var(--muted);
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
  max-height: none;
  overflow: visible;
  padding-right: 4px;
}

.history-list.empty li {
  color: var(--muted);
}

.history-day-group {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.history-day-group.is-even {
  background: rgba(255, 255, 255, 0.72);
}

.history-day-group.is-odd {
  background: rgba(20, 124, 116, 0.05);
}

:root[data-theme="dark"] .history-day-group.is-even {
  background: rgba(17, 28, 31, 0.92);
}

:root[data-theme="dark"] .history-day-group.is-odd {
  background: rgba(92, 210, 193, 0.06);
}

.history-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid var(--surface-border);
}

:root[data-theme="dark"] .history-day-header {
  background: rgba(255, 255, 255, 0.04);
}

.history-day-header strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}

.history-day-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-day-rows {
  display: grid;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: transparent;
}

.history-row + .history-row {
  border-top: 1px solid var(--surface-border);
}

.history-row.is-target {
  background: rgba(20, 124, 116, 0.09);
}

.history-row.is-base {
  background: rgba(255, 204, 24, 0.08);
}

:root[data-theme="dark"] .history-row.is-target {
  background: rgba(92, 210, 193, 0.08);
}

:root[data-theme="dark"] .history-row.is-base {
  background: rgba(255, 204, 24, 0.08);
}

@media (max-height: 980px) {
  .layout > .stack:last-child {
    position: static;
  }

  .change-panel .map-list {
    max-height: min(72vh, 920px);
    overflow: auto;
  }
}

.history-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.history-meta strong {
  font-size: 14px;
}

.history-meta span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.history-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.history-stat {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(129, 149, 180, 0.1);
  border: 1px solid rgba(129, 149, 180, 0.18);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
}

.history-stat.is-bookable {
  color: var(--accent-dark);
  background: rgba(20, 124, 116, 0.1);
  border-color: rgba(20, 124, 116, 0.16);
}

.history-stat.is-forbidden {
  color: #c63b3b;
  background: rgba(226, 82, 82, 0.1);
  border-color: rgba(226, 82, 82, 0.18);
}

:root[data-theme="dark"] .history-stat {
  background: rgba(168, 184, 206, 0.1);
  border-color: rgba(168, 184, 206, 0.16);
  color: #f4fbfa;
}

:root[data-theme="dark"] .history-stat.is-bookable {
  color: #98efe4;
  background: rgba(94, 214, 201, 0.14);
  border-color: rgba(94, 214, 201, 0.22);
}

:root[data-theme="dark"] .history-stat.is-forbidden {
  color: #ff9e9e;
  background: rgba(255, 112, 112, 0.14);
  border-color: rgba(255, 112, 112, 0.24);
}

.history-actions {
  flex-shrink: 0;
}

.danger-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.danger-button:hover {
  background: var(--danger-soft-hover);
}

@media (max-width: 1080px) {
  .hero,
  .layout,
  .stats-grid,
  .compare-controls,
  .compare-grid {
    grid-template-columns: 1fr;
  }

  .layout > .stack:last-child {
    position: static;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 16px, 1680px);
    margin-top: 10px;
  }

  .hero,
  .panel {
    border-radius: 20px;
  }

  .hero {
    padding: 22px 20px;
    gap: 18px;
  }

  .hero-side {
    padding: 14px;
  }

  .hero-title {
    gap: 10px;
  }

  .hero-topbar,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chart {
    padding: 10px;
  }
}
