﻿* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  background: radial-gradient(circle at top, #18223a, #080b13 58%);
  color: #e8eef9;
}
button, input, select { font: inherit; }
button {
  border: 1px solid #30415f;
  border-radius: 10px;
  background: #17233b;
  color: #e8eef9;
  padding: 8px 12px;
}
button:active { transform: translateY(1px); }
.app {
  max-width: 840px;
  margin: 0 auto;
  padding: 10px;
  display: grid;
  gap: 10px;
}
.topbar { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.topbar h1 { margin: 0; font-size: 18px; }
.topbar p { margin: 0; color: #9eb1d3; font-size: 12px; }
.top-actions { display: flex; gap: 8px; }
.app-info-btn {
  border-radius: 999px;
  min-width: 30px;
  min-height: 30px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}
.status-row { display: flex; justify-content: space-between; align-items: center; }
.kpi-row {
  margin-top: -9px;
  margin-bottom: -5px;
  width: 100%;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.event-progress-summary {
  font-size: 11px;
  color: #9ad7d1;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.session-goal-panel {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  min-height: 0;
  height: 13px;
}
.session-goal-card {
  display: inline-grid;
  grid-template-columns: auto auto auto auto;
  align-items: end;
  gap: 5px;
  color: #dce8ff;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  position: relative;
  top: -7px;
}
.session-goal-title {
  align-self: end;
  font-size: 10px;
  line-height: 1;
  color: #9ad7d1;
  letter-spacing: 0;
  padding-bottom: 1px;
}
.session-goal-stats {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-family: Consolas, Monaco, monospace;
  font-weight: 700;
  line-height: 1;
}
.session-goal-done {
  font-size: 18px;
  color: #f8fafc;
}
.session-goal-sep {
  font-size: 13px;
  color: #8ba0c8;
}
.session-goal-target {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #7dd3fc;
  padding: 0 1px;
  font-family: Consolas, Monaco, monospace;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.session-goal-target:hover {
  color: #bae6fd;
}
.session-goal-ring {
  --session-goal-pct: 0%;
  width: 22px;
  height: 22px;
  align-self: end;
  border-radius: 50%;
  border: 1px solid #2e466e;
  background:
    radial-gradient(circle closest-side, #0b1220 63%, transparent 65%),
    conic-gradient(#34d399 var(--session-goal-pct), #13213a 0);
  box-shadow: inset 0 0 4px rgba(52, 211, 153, 0.16);
}
.session-goal-badge {
  align-self: end;
  min-width: 34px;
  padding: 3px 5px 2px;
  border: 1px solid rgba(250, 204, 21, 0.58);
  border-radius: 999px;
  background: rgba(113, 63, 18, 0.62);
  color: #fef3c7;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.16);
}
.session-goal-card.session-goal-clear .session-goal-title {
  color: #facc15;
}
.session-goal-card.session-goal-clear .session-goal-done {
  color: #fde68a;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.34);
}
.session-goal-card.session-goal-clear .session-goal-ring {
  border-color: rgba(250, 204, 21, 0.78);
  background:
    radial-gradient(circle closest-side, #0b1220 63%, transparent 65%),
    conic-gradient(#facc15 var(--session-goal-pct), #24314c 0);
  box-shadow:
    inset 0 0 4px rgba(250, 204, 21, 0.2),
    0 0 14px rgba(250, 204, 21, 0.22);
}
.session-goal-card.session-goal-celebrate .session-goal-done,
.session-goal-card.session-goal-celebrate .session-goal-ring,
.session-goal-card.session-goal-celebrate .session-goal-badge {
  animation: session-goal-pop 620ms ease-out;
}
@keyframes session-goal-pop {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  34% {
    transform: translateY(-3px) scale(1.18);
    filter: brightness(1.45);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}
.session-goal-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: 76px auto auto;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid #30415f;
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.34);
}
.session-goal-popover[hidden] {
  display: none;
}
.session-goal-input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 5px 6px;
  border: 1px solid #30415f;
  border-radius: 6px;
  background: #081020;
  color: #e8eef9;
  font-size: 12px;
}
.session-goal-btn {
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.1;
}
.status-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.track-title-main {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(64vw, 560px);
}
.status-row .track-id {
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  color: #92a5c8;
}
.progress { color: #9eb1d3; font-size: 13px; }
.player-wrap { background: #04070d; border: 1px solid #21304e; border-radius: 12px; overflow: hidden; }
#nicoFrame { width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000; }
.continuous-panel {
  aspect-ratio: 16 / 9;
  display: none;
  width: 100%;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px 14px;
  box-sizing: border-box;
  text-align: center;
  background: linear-gradient(180deg, #101a2c 0%, #0a1020 100%);
  border: 0;
  color: #e8eef9;
  position: relative;
}
.continuous-panel-top {
  position: absolute;
  top: 10px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #9eb1d3;
}
.continuous-panel-top label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.continuous-seek-toggle {
  color: #d7e5ff;
}
.continuous-seek-toggle input {
  margin: 0;
}
#continuousWaitSec {
  width: 64px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid #30415f;
  background: #111a2d;
  color: #e8eef9;
}
.continuous-seek-progress {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 18px;
  margin-top: 6px;
}
.continuous-panel.seek-mode-on .continuous-seek-progress {
  display: inline-flex;
}
.continuous-seek-progress .seek-dot {
  font-size: 14px;
  line-height: 1;
  color: #8ea5cf;
}
.continuous-seek-progress .seek-dot.done {
  color: #ff9b42;
}
.continuous-time {
  font-size: 28px;
  font-family: Consolas, Monaco, monospace;
  letter-spacing: 0.5px;
}
.continuous-time-prefix {
  font-size: 0.46em;
  color: #9eb1d3;
  margin-right: 8px;
  letter-spacing: 0;
}
.continuous-time-extra {
  font-size: 0.68em;
  color: #9eb1d3;
  letter-spacing: 0;
}
.continuous-detail {
  font-size: 12px;
  color: #9eb1d3;
  text-align: center;
}
.continuous-pause-btn {
  margin-top: 2px;
  min-width: 112px;
  padding: 6px 14px;
  font-size: 12px;
}
.player-wrap.continuous-on #nicoFrame {
  display: none;
}
.player-wrap.continuous-on .continuous-panel {
  display: grid;
}
.continuous-panel[hidden] {
  display: none !important;
}
.nav-row, .mark-row, .sort-row, .tag-filter-row, .play-assist-row, .io-row { display: grid; gap: 8px; }
.nav-row { grid-template-columns: 1fr 1fr; }
#btnPrev {
  --prev-hover-progress: 0;
  background-image:
    linear-gradient(90deg, #aa522f 0%, #ffb565 100%),
    linear-gradient(#17233b, #17233b);
  background-repeat: no-repeat, no-repeat;
  background-position: left top, left top;
  background-size: calc(var(--prev-hover-progress) * 100%) 100%, 100% 100%;
  transition: background-size 60ms linear, border-color 120ms ease;
}
#btnPrev.prev-hover-armed {
  border-color: #cc6f4d;
}
#btnNext {
  --next-hover-progress: 0;
  background-image:
    linear-gradient(90deg, #2f5eaa 0%, #65b8ff 100%),
    linear-gradient(#17233b, #17233b);
  background-repeat: no-repeat, no-repeat;
  background-position: left top, left top;
  background-size: calc(var(--next-hover-progress) * 100%) 100%, 100% 100%;
  transition: background-size 60ms linear, border-color 120ms ease;
}
#btnNext.next-hover-armed {
  border-color: #4d80cc;
}
.mark-row { grid-template-columns: repeat(3, 1fr); }
.mark-btn {
  min-height: 42px;
  font-family: "Segoe UI Symbol", "Yu Gothic UI", "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1;
  padding: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mark-btn.active { border-color: #f3b24a; background: #3f2b12; }
.filter-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  font-size: 13px;
}
.filter-row label { display: flex; align-items: center; gap: 6px; }
.sort-row { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(3.2em, auto)); }
.sort-row button {
  white-space: nowrap;
}
.sort-row button[aria-pressed="true"] {
  border-color: #f3b24a;
  background: #3f2b12;
}
.sort-row select {
  border: 1px solid #30415f;
  border-radius: 10px;
  background: #111a2d;
  color: #e8eef9;
  padding: 8px;
}
.tag-filter-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}
.tag-filter-row button {
  padding: 6px 9px;
  white-space: nowrap;
}
.tag-filter-status {
  min-width: 0;
  color: #9eb1d3;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-assist-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.play-assist-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
}
.play-assist-row button {
  padding: 6px 10px;
  white-space: nowrap;
}
.io-row { grid-template-columns: 1fr 1fr; }
.msg { margin: 0; min-height: 1.3em; color: #ffc97a; font-size: 13px; }
.sheet {
  position: fixed;
  inset: auto 0 0 0;
  height: min(60vh, 530px);
  background: #0e1627;
  border-top: 1px solid #30415f;
  transform: translateY(101%);
  transition: transform .18s ease;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
.sheet.open { transform: translateY(0); }
.sheet-resize-handle {
  height: 16px;
  flex: 0 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: ns-resize;
  user-select: none;
  width: 100%;
  padding: 0 12px;
  box-sizing: border-box;
}
.sheet-resize-handle span {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: #6f86ad;
  opacity: 0.9;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid #273754;
  min-height: 52px;
  box-sizing: border-box;
}
.sheet-mode-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sheet-mode-toggle {
  border: none;
  background: transparent;
  color: #e8eef9;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  min-height: 1.2em;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.sheet-mode-toggle:disabled {
  opacity: 0.72;
  cursor: default;
}
.sheet-mode-hint {
  font-size: 11px;
  color: #8ea5cf;
  white-space: nowrap;
  line-height: 1.1;
}
.sheet-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.continuous-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 12px;
  color: #c8d7f2;
}
.continuous-toggle input {
  margin: 0;
}
.sheet-header-actions button {
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
}
.pl-export-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.sheet-header-actions .pl-export-menu-btn {
  min-width: 0;
  width: 28px;
  padding: 6px 0;
  text-align: center;
  line-height: 1;
  font-size: 0;
  position: relative;
}
.sheet-header-actions .pl-export-menu-btn::before {
  content: "";
  display: block;
  width: 12px;
  height: 10px;
  margin: 0 auto;
  background:
    linear-gradient(#d6e3fa, #d6e3fa) 0 0 / 12px 1px no-repeat,
    linear-gradient(#d6e3fa, #d6e3fa) 0 4px / 12px 1px no-repeat,
    linear-gradient(#d6e3fa, #d6e3fa) 0 8px / 12px 1px no-repeat;
}
.pl-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 176px;
  display: grid;
  gap: 4px;
  background: #0f182b;
  border: 1px solid #30415f;
  border-radius: 10px;
  padding: 6px;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}
.pl-export-menu button {
  text-align: left;
  padding: 6px 8px;
  font-size: 12px;
  white-space: nowrap;
}
.pl-export-menu[hidden] {
  display: none !important;
}
.sheet-list {
  overflow: auto;
  padding: 0;
  position: relative;
  min-height: 0;
}
.virtual-list-empty {
  padding: 8px;
}
.virtual-list-spacer {
  width: 1px;
  pointer-events: none;
}
.virtual-list-content {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  display: grid;
  gap: 8px;
  align-content: start;
}
.track-row {
  position: relative;
  border: 1px solid #273754;
  border-radius: 10px;
  padding: 8px;
  background: #121d32;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.track-open-btn {
  --track-hover-progress: 0;
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 999px;
  background-image:
    linear-gradient(90deg, #2f5eaa 0%, #65b8ff 100%),
    linear-gradient(#17233b, #17233b);
  background-repeat: no-repeat, no-repeat;
  background-position: left top, left top;
  background-size: calc(var(--track-hover-progress) * 100%) 100%, 100% 100%;
  transition: background-size 60ms linear, border-color 120ms ease;
}
.track-open-btn.track-hover-armed {
  border-color: #4d80cc;
}
.track-row::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
  line-height: 1;
  color: rgba(224, 234, 255, 0.18);
  opacity: 0;
  pointer-events: none;
}
.track-row.playing { border-color: #88a9e8; }
.track-row.viewed::after { opacity: 1; }
.track-row.missing-track {
  border-color: #334052;
  background: #111827;
  color: #aeb8ca;
}
.track-row.missing-track.playing {
  border-color: #64748b;
}
.track-row.missing-track.viewed::after {
  color: rgba(148, 163, 184, 0.16);
}
.track-thumb {
  --track-hover-progress: 0;
  position: relative;
  flex: 0 0 120px;
  width: 120px;
  height: 90px;
  border: 1px solid #30415f;
  border-radius: 8px;
  background: #0b1220;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}
.track-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(47, 94, 170, 0.52), rgba(101, 184, 255, 0.52));
  transform: scaleX(var(--track-hover-progress));
  transform-origin: left center;
  opacity: 0;
  transition: transform 60ms linear, opacity 120ms ease;
}
.track-thumb.track-hover-armed {
  border-color: #4d80cc;
}
.track-thumb.track-hover-armed::before {
  opacity: 1;
}
.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-view {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(5, 10, 20, 0.82);
  color: #e9f0ff;
  border: 1px solid rgba(90, 122, 175, 0.8);
  font-variant-numeric: tabular-nums;
}
.thumb-forced-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid #4b6ea8;
  background: rgba(26, 46, 82, 0.94);
  color: #dbe9ff;
  font-size: 10px;
  line-height: 1.2;
}
.thumb-pl-rank {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 250, 255, 0.96);
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #5d6b85;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.track-thumb:hover {
  border-color: #4f6da3;
}
.track-row.missing-track .track-thumb {
  cursor: default;
  border-color: #3a4658;
  background:
    linear-gradient(135deg, rgba(148, 163, 184, 0.08) 25%, transparent 25%) 0 0 / 12px 12px,
    linear-gradient(135deg, transparent 75%, rgba(148, 163, 184, 0.08) 75%) 0 0 / 12px 12px,
    #0b1220;
}
.track-row.missing-track .track-thumb:hover {
  border-color: #3a4658;
}
.missing-thumb-label {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}
.track-main {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
  padding-right: 64px;
}
.track-head {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  min-width: 0;
}
.pl-tools {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pl-btn {
  padding: 1px 6px;
  min-width: 24px;
  font-size: 11px;
  line-height: 1.2;
}
.pl-move-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pl-move-input {
  width: 46px;
  min-width: 46px;
  border: 1px solid #30415f;
  border-radius: 7px;
  background: #0d1526;
  color: #e8eef9;
  padding: 2px 5px;
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pl-btn-move-toggle {
  display: none;
  min-width: 28px;
  padding-left: 0;
  padding-right: 0;
}
.pl-move-panel {
  margin-top: 3px;
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}
.track-id {
  color: #9eb1d3;
  font-family: Consolas, Monaco, monospace;
  white-space: nowrap;
}
.track-event {
  color: #88a9e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}
.track-row.missing-track .track-id,
.track-row.missing-track .track-event,
.track-row.missing-track .track-title {
  color: #94a3b8;
}
.track-row.missing-track .track-title {
  font-weight: 700;
}
.track-row.missing-track .inline-mark {
  opacity: 0.72;
}
.track-marks {
  display: inline-flex;
  gap: 6px;
  color: #d5e3ff;
}
.inline-mark {
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  line-height: 1;
  font-size: 18px;
  border-radius: 0;
  width: 1.1em;
  height: 1.1em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI Symbol", "Yu Gothic UI", "Segoe UI", sans-serif;
}
.inline-mark:active {
  transform: none;
}
.mark-star { color: #f2cc64; }
.mark-best { color: #7fc7ff; }
.mark-keep {
  color: #8ff0be;
  font-size: 18px;
}
.track-title { font-size: 13px; font-weight: 600; }
.track-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.track-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  color: #9eb1d3;
}
.track-tag {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  max-width: 11em;
  padding: 1px 6px;
  border: 1px solid rgba(113, 139, 185, 0.34);
  border-radius: 999px;
  background: rgba(21, 35, 61, 0.72);
  color: #b8c9e8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 15, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 10px;
}
.modal.open { display: flex; }
.modal-panel {
  width: min(720px, 96vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid #30415f;
  border-radius: 12px;
  background: #111a2d;
  padding-bottom: 10px;
}
.field { display: grid; gap: 4px; padding: 8px 10px; }
.field input, .field select {
  border: 1px solid #30415f;
  border-radius: 9px;
  background: #0d1526;
  color: #e8eef9;
  padding: 8px;
}
.field.inline { grid-template-columns: auto 1fr; align-items: center; }
.resume-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.event-actions { display: flex; gap: 8px; padding: 0 10px 8px; }
.event-actions button {
  white-space: nowrap;
}
.state-manager-panel {
  width: min(720px, 96vw);
}
.state-manager-list {
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  border: 1px solid #273754;
  border-radius: 10px;
  padding: 8px;
  background: #0f182b;
}
.state-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
  border: 1px solid #30415f;
  border-radius: 10px;
  padding: 8px;
  background: #15223a;
}
.state-row-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.state-row-title {
  font-size: 13px;
  font-weight: 700;
  color: #eaf2ff;
  overflow-wrap: anywhere;
}
.state-row-meta {
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  color: #9eb8e4;
  overflow-wrap: anywhere;
}
.state-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.state-row-actions .danger-btn {
  white-space: nowrap;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.2;
}
.tag-filter-panel {
  width: min(560px, 96vw);
}
.tag-filter-list {
  display: grid;
  gap: 6px;
  max-height: 64vh;
  overflow: auto;
  padding: 10px;
}
.tag-filter-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  text-align: left;
}
.tag-filter-item.selected {
  border-color: #f3b24a;
  background: #3f2b12;
}
.tag-filter-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-filter-count {
  color: #9eb1d3;
  font-variant-numeric: tabular-nums;
}
.tag-filter-empty {
  color: #9eb1d3;
  font-size: 13px;
  padding: 8px 2px;
}
@media (max-width: 620px) {
  .state-row-actions {
    gap: 4px;
  }
  .state-row-actions .danger-btn {
    padding: 2px 5px;
    font-size: 10px;
  }
  .state-row-meta {
    display: grid;
    gap: 2px;
  }
  .state-meta-sep {
    display: none;
  }
}
.state-row-empty {
  border: 1px solid #30415f;
  border-radius: 8px;
  background: #15223a;
  color: #9eb8e4;
  font-size: 12px;
  padding: 10px;
  text-align: center;
}
.modal-panel .msg {
  padding: 0 10px;
}
.info-modal-panel {
  width: min(680px, 96vw);
}
.info-body {
  display: grid;
  gap: 10px;
  padding: 10px;
  line-height: 1.5;
  color: #d9e6fd;
  font-size: 13px;
}
.info-body p {
  margin: 0;
}
.info-guide,
.info-tips {
  border: 1px solid #3f5f95;
  border-radius: 12px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #13213a 0%, #101b31 100%);
  box-shadow: inset 0 0 0 1px rgba(168, 198, 255, 0.08);
}
.info-guide-title,
.info-tips-title {
  font-weight: 700;
  margin: 0 0 7px;
  text-align: center;
  letter-spacing: 0.02em;
}
.info-guide-title {
  color: #dce9ff;
}
.info-tips {
  border-color: #4f73ad;
  background: linear-gradient(180deg, #142947 0%, #11233e 100%);
}
.info-tips-title {
  color: #9fd0ff;
}
.info-guide-list,
.info-tips-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}
.info-guide-list li,
.info-tips-list li {
  margin: 0;
}
.inline-hamburger-sample {
  display: inline-block;
  vertical-align: middle;
  width: 18px;
  height: 18px;
  border: 1px solid #3f5f95;
  border-radius: 7px;
  background: #13233f;
  position: relative;
  top: -1px;
  margin: 0 2px;
}
.inline-hamburger-sample::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 7px;
  transform: translate(-50%, -50%);
  background:
    linear-gradient(#d6e3fa, #d6e3fa) 0 0 / 9px 1px no-repeat,
    linear-gradient(#d6e3fa, #d6e3fa) 0 3px / 9px 1px no-repeat,
    linear-gradient(#d6e3fa, #d6e3fa) 0 6px / 9px 1px no-repeat;
}
.info-body strong {
  color: #eaf2ff;
}
.info-body a {
  color: #9fd0ff;
}
.info-body a:hover {
  color: #c7e4ff;
}
.info-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.danger-btn {
  border-color: #8d3b3b;
  background: #3a1a1a;
  color: #ffd7d7;
}
.danger-btn:hover {
  background: #4a2020;
}
.event-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
}
.event-list-head-actions {
  display: inline-flex;
  gap: 8px;
}
.catalog-filter-row {
  display: flex;
  gap: 8px;
  padding: 0 10px 6px;
}
.catalog-filter-row select {
  min-width: 0;
  flex: 1 1 0;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid #30415f;
  border-radius: 8px;
  background: #0d1526;
  color: #e8eef9;
}
.event-catalog-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 10px 8px;
}
.catalog-list {
  display: grid;
  gap: 6px;
  min-height: 240px;
  max-height: 240px;
  align-content: start;
  overflow: auto;
  border: 1px solid #273754;
  border-radius: 10px;
  padding: 6px;
  background: #0f182b;
}
.catalog-row {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid #30415f;
  background: #15223a;
  color: #e8eef9;
}
.catalog-row.selectable {
  cursor: pointer;
}
.catalog-row.selected {
  border-color: #30415f;
  box-shadow: none;
}
.catalog-row.update {
  border-color: #c59a47;
  background: #3a2e16;
}
.catalog-row.imported {
  border-color: #3f7a5a;
  background: #153629;
}
.catalog-row.update.selected,
.catalog-row.imported.selected {
  border-width: 2px;
}
.catalog-row.update.selected {
  border-color: #d7aa56;
  box-shadow: 0 0 0 1px rgba(215, 170, 86, 0.45);
}
.catalog-row.imported.selected {
  border-color: #6fbe96;
  box-shadow: 0 0 0 1px rgba(111, 190, 150, 0.45);
}
.catalog-left {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}
.catalog-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.catalog-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-meta {
  font-size: 11px;
  color: #abc1e6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-import-btn[disabled] {
  opacity: 0.6;
  cursor: default;
  background: #1c273f;
  border-color: #2d3c59;
}
.catalog-import-btn.secondary {
  background: #1c273f;
  border-color: #2d3c59;
}
hr { border: none; border-top: 1px solid #273754; margin: 8px 10px; }

@media (min-width: 901px) {
  :root {
    --pc-header-h: 68px;
  }
  body {
    height: 100vh;
    overflow: hidden;
  }
  .app {
    position: fixed;
    top: var(--pc-header-h);
    left: min(44vw, 680px);
    right: 0;
    bottom: 0;
    margin-left: 0;
    max-width: none;
    width: auto;
    overflow: auto;
    padding: 12px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    background: radial-gradient(circle at top, #18223a, #080b13 58%);
  }
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--pc-header-h);
    z-index: 30;
    margin: 0;
    padding: 10px 14px;
    border-bottom: 1px solid #253a60;
    background: rgba(14, 24, 44, 0.92);
    backdrop-filter: blur(8px);
    box-sizing: border-box;
  }
  .app > *:not(.topbar) {
    width: min(888px, calc(100% - 24px));
    margin-left: 12px;
    margin-right: auto;
  }
  .player-wrap {
    width: min(480px, calc(100% - 24px));
    margin-left: 12px;
    margin-right: auto;
    background: transparent;
    border: none;
    display: flex;
    justify-content: flex-start;
  }
  .nav-row,
  .mark-row,
  .filter-row,
  .sort-row,
  .tag-filter-row,
  .play-assist-row,
  .io-row,
  .msg {
    width: min(480px, calc(100% - 24px)) !important;
    margin-left: auto;
    margin-right: auto;
  }
  .modal-panel .msg {
    width: auto !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
    padding: 0 !important;
  }
  .status-row,
  .kpi-row {
    width: min(480px, calc(100% - 24px)) !important;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  #nicoFrame {
    width: min(100%, 480px);
    max-width: 480px;
    height: 270px;
    aspect-ratio: auto;
    margin-left: 0;
    margin-right: 0;
  }
  .continuous-panel {
    width: min(100%, 480px);
    max-width: 480px;
    height: 270px;
    aspect-ratio: auto;
    margin-left: 0;
    margin-right: 0;
  }
  .track-open-btn {
    display: inline-block;
    top: 8px;
    right: 8px;
  }
  #listSheet {
    position: fixed;
    left: 0;
    top: var(--pc-header-h);
    bottom: 0;
    width: min(44vw, 680px);
    transform: none !important;
    height: auto;
    border-top: none;
    border-right: 1px solid #30415f;
    z-index: 20;
    border-radius: 0;
    background: #0b1426;
    display: flex;
    flex-direction: column;
  }
  .sheet-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0b1426;
  }
  .sheet-list {
    flex: 1 1 auto;
    overflow: auto;
  }
  #btnOpenList,
  #btnCloseList {
    display: none;
  }
}

@media (max-width: 520px) {
  .session-goal-badge {
    display: none;
  }
  .filter-row {
    gap: 6px;
    font-size: 12px;
  }
  .filter-row label {
    gap: 4px;
    white-space: nowrap;
  }
  .sort-row button {
    padding: 8px 7px;
    min-width: 0;
  }
  .sheet {
    height: min(56vh, 480px);
  }
  .sheet-resize-handle {
    height: 20px;
    flex-basis: 20px;
    padding: 3px 12px 2px;
  }
  .sheet-resize-handle span {
    width: 56px;
    height: 5px;
  }
  .sheet-header {
    align-items: center;
  }
  .sheet-mode-wrap {
    display: grid;
    grid-template-rows: auto auto;
    gap: 1px;
  }
  .sheet-mode-toggle {
    font-size: 15px;
    line-height: 1.1;
  }
  .sheet-mode-hint {
    font-size: 10px;
  }
  .sheet-header-actions {
    gap: 4px;
  }
  .sheet-header-actions button {
    padding: 4px 6px;
    font-size: 11px;
  }
  .sheet-header-actions .pl-export-menu-btn {
    width: 24px;
    padding: 4px 0;
  }
  .sheet-header-actions .pl-export-menu-btn::before {
    width: 10px;
    height: 9px;
    background:
      linear-gradient(#d6e3fa, #d6e3fa) 0 0 / 10px 1px no-repeat,
      linear-gradient(#d6e3fa, #d6e3fa) 0 4px / 10px 1px no-repeat,
      linear-gradient(#d6e3fa, #d6e3fa) 0 8px / 10px 1px no-repeat;
  }
  #btnAddVisibleToPlaylist {
    display: none;
  }
  .track-thumb {
    flex-basis: 104px;
    width: 104px;
    height: 78px;
  }
  .track-head {
    gap: 6px;
    font-size: 11px;
  }
  .inline-mark {
    font-size: 17px;
  }
  .track-title {
    font-size: 12px;
  }
  .event-progress-summary {
    font-size: 10px;
    color: #87c8c1;
  }
}

@media (max-width: 900px) {
  .pl-move-inline {
    display: none;
  }
  .pl-btn-move-toggle {
    display: inline-block;
  }
  .pl-move-panel {
    display: inline-flex;
  }
}
