:root {
  color-scheme: light;
  --font: 13px;
  --row: 28px;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --line: #e2e8f0;
  --muted: #64748b;
  --accent: #4f46e5;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", sans-serif;
  font-size: var(--font);
  color: #182338;
  background: var(--bg);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.file {
  color: #334155;
  background: #ffffff;
  border: 1px solid #dbe2ec;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover,
.file:hover {
  background: #eef2ff;
}
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button.active,
.primary {
  background: #4f46e5;
  color: white;
  border-color: #4f46e5;
}
input,
select,
textarea {
  color: inherit;
  background: #ffffff;
  border: 1px solid #dbe2ec;
  border-radius: 4px;
  padding: 5px 7px;
  max-width: 100%;
}
input[type="checkbox"] {
  accent-color: #4f46e5;
}
input[type="number"] {
  width: 100px;
}
textarea {
  width: 100%;
  height: 75px;
}
label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
small {
  color: var(--muted);
  font-size: 0.88em;
}
p {
  line-height: 1.7;
}
#app {
  display: flex;
  min-height: 100vh;
}
aside {
  width: 170px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 35px;
  font-size: 17px;
}
.brand small {
  font-size: 10px;
  letter-spacing: 1px;
}
.mark {
  color: var(--accent);
  border: 1px solid #c7d2fe;
  border-radius: 9px;
  width: 35px;
  height: 35px;
  text-align: center;
  line-height: 33px;
  font-size: 22px;
}
nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
nav button {
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 10px;
}
aside footer {
  margin-top: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 2;
}
main {
  width: calc(100% - 170px);
  padding: 20px 22px 30px;
}
.main-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.eyebrow {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 3px;
}
h1 {
  font-size: 24px;
  margin: 5px 0 0;
}
h2 {
  font-size: 17px;
  margin: 0 0 10px;
}
h3 {
  font-size: 14px;
}
.save-status {
  color: #15806b;
  font-size: 11px;
}
.toolbar,
.filters,
.actions,
.list-target,
.range,
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.segments {
  display: flex;
  gap: 3px;
}
.filters {
  min-height: 28px;
}
.chip {
  border-radius: 20px;
  font-size: 0.9em;
  padding: 4px 10px;
}
.list-target {
  color: var(--muted);
  justify-content: flex-end;
}
.list-target > span {
  margin-left: auto;
  font-size: 11px;
}
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  min-width: 0;
}
.split .panel {
  padding: 0;
  overflow: hidden;
}
.panel-head {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 8px;
}
.panel-head h2 {
  margin: 0;
  font-size: 15px;
}
.panel-head span {
  color: var(--muted);
  font-size: 10px;
}
.panel-head select {
  max-width: 145px;
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
}
table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  background: #f8fafc;
  padding: 7px 8px;
  font-size: 0.88em;
  position: sticky;
  top: 0;
  z-index: 1;
}
td {
  padding: 5px 8px;
  border-top: 1px solid #e8edf4;
  overflow: hidden;
  text-overflow: ellipsis;
}
td small {
  display: block;
}
tr:nth-child(even) {
  background: #f6f8fd;
}
tr.selected {
  background: #eef2ff;
}
.selection-table {
  height: calc(15 * var(--row) + 34px);
}
.selection-table th:nth-child(1) {
  width: 49%;
}
.selection-table th:nth-child(2) {
  width: 31%;
}
.selection-table th:nth-child(3) {
  width: 12%;
}
.selection-table th:nth-child(4) {
  width: 8%;
}
.selection-table td {
  height: var(--row);
  padding: 0 6px;
  white-space: nowrap;
  font-size: var(--font);
}
.selection-table .selection-history {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  padding: 3px 0 5px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.selection-table th {
  height: 32px;
}
.song-link {
  border: 0;
  background: transparent;
  padding: 0;
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #334155;
  text-align: left;
}
.song-link:hover {
  text-decoration: underline;
  background: transparent;
}
.plus {
  padding: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 16px;
}
.score {
  display: inline-block;
  color: #4338ca;
  font-variant-numeric: tabular-nums;
  width: 34px;
}
.reason {
  color: var(--muted);
  font-size: 10px;
}
.detail-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 45px;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 10px;
}
.daily {
  padding: 10px 14px;
}
summary {
  cursor: pointer;
  color: #4338ca;
}
.usage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.welcome,
.empty {
  padding: 28px;
  color: var(--muted);
}
.welcome {
  border: 1px dashed #c7d2fe;
  border-radius: 8px;
}
.welcome button {
  margin-right: 10px;
}
.file {
  display: inline-flex;
  position: relative;
  overflow: hidden;
}
.file input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.form-grid label,
form > label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 12px;
}
.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 14px 0;
}
dialog {
  border: 1px solid #dbe2ec;
  border-radius: 10px;
  padding: 22px;
  background: #ffffff;
  color: #182338;
  width: min(1000px, 92vw);
  max-height: 90vh;
}
dialog::backdrop {
  background: #18233866;
}
dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
dialog details {
  margin-top: 20px;
}
dialog table input,
dialog table select,
.import table input,
.import table select {
  width: 100%;
}
.import table th:nth-child(1) {
  width: 9%;
}
.import table th:nth-child(2) {
  width: 23%;
}
.import table th:nth-child(3) {
  width: 20%;
}
.import table th:nth-child(4) {
  width: 17%;
}
.import table input[type="checkbox"] {
  width: auto;
}
.warning {
  color: #926119;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  border-radius: 6px;
  padding: 12px 22px;
  background: #23584b;
  color: #f1fff8;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
}
#toast.visible {
  opacity: 1;
}
#toast.error {
  background: #7b303b;
}
.loading {
  margin: 40px;
}
.busy button,
.busy .file {
  pointer-events: none;
  opacity: 0.6;
}
@media (min-width: 1600px) {
  main {
    padding: 24px 30px;
  }
}
@media (max-width: 1000px) {
  aside {
    width: 135px;
    padding: 20px 10px;
  }
  main {
    width: calc(100% - 135px);
    padding: 16px 12px;
  }
  .reason {
    display: none;
  }
  .selection-table th:nth-child(3) {
    width: 12%;
  }
  .selection-table th:nth-child(1) {
    width: 44%;
  }
  .selection-table th:nth-child(2) {
    width: 34%;
  }
}
@media (max-width: 700px) {
  aside {
    width: 105px;
  }
  .brand {
    font-size: 14px;
  }
  main {
    width: calc(100% - 105px);
  }
  .split,
  .usage-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    gap: 8px;
  }
  .list-target > span {
    width: 100%;
  }
  .main-head {
    align-items: flex-start;
  }
  .save-status {
    display: none;
  }
}
a {
  color: #4f46e5;
}
.demo-link {
  display: inline-block;
  padding: 8px 10px;
}
.sample-banner {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #f1dfa6;
  border-radius: 6px;
  color: #79571e;
  font-size: 11px;
  background: #fff9e9;
}
@media (min-width: 1000px) and (max-height: 800px) {
  main {
    padding-top: 12px;
  }
  .main-head {
    margin-bottom: 8px;
  }
  h1 {
    font-size: 22px;
  }
  .toolbar,
  .filters,
  .actions,
  .list-target {
    margin-top: 6px;
    margin-bottom: 6px;
  }
  .panel-head {
    height: 40px;
  }
  .sample-banner {
    padding: 6px 10px;
    margin-bottom: 6px;
  }
  .filters {
    min-height: 26px;
  }
}
.selection-pages {
  padding: 0 10px;
  font-size: 11px;
  justify-content: space-between;
}
.selection-pages button {
  font-size: 11px;
  padding: 4px 7px;
}
.error-inline {
  background: #fff1f2;
  color: #9f1239;
  border: 1px solid #fecdd3;
  border-radius: 5px;
  padding: 10px 12px;
}
.selection-table th {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#recommend-query {
  width: 170px;
}
body:has(#select-page-songs) main table th:first-child {
  width: 32px;
}

/* Everyday selection view; full controls stay in the management view. */
.mode-link {
  color: var(--muted);
  font-size: 12px;
  margin-top: 24px;
}
.simple-mode {
  --font: 14px;
}
.simple-mode #app {
  display: block;
}
.simple-mode aside {
  width: 100%;
  height: auto;
  position: static;
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 14px 28px;
  border-right: 0;
  border-bottom: 1px solid var(--line);
}
.simple-mode .brand {
  flex-direction: row;
  align-items: center;
  margin: 0;
  font-size: 17px;
}
.simple-mode .brand small,
.simple-mode .mark,
.simple-mode aside footer,
.simple-mode .eyebrow,
.simple-mode .save-status {
  display: none;
}
.simple-mode nav {
  flex-direction: row;
  gap: 8px;
}
.simple-mode nav button {
  text-align: center;
  padding: 10px 16px;
}
.simple-mode .mode-link {
  margin: 0 0 0 auto;
}
.simple-mode main {
  width: 100%;
  max-width: 1400px;
  margin: auto;
  padding: 24px 28px;
}
.simple-mode .main-head {
  margin-bottom: 8px;
}
.simple-intro {
  color: var(--muted);
  margin: 0 0 20px;
  font-size: 14px;
}
.simple-controls,
.simple-list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.simple-controls .segments button {
  padding: 9px 22px;
}
.simple-controls input {
  width: 250px;
}
.simple-options {
  margin: 0 0 16px;
  color: var(--muted);
}
.simple-options[open] {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.simple-list-bar {
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 8px;
}
.simple-mode .selection-table th:nth-child(1) {
  width: 49%;
}
.simple-mode .selection-table th:nth-child(2) {
  width: 35%;
}
.simple-mode .selection-table th:nth-child(3) {
  width: 16%;
}
.simple-mode .selection-table .plus {
  padding: 4px 8px;
  width: auto;
  font-size: 12px;
}
.simple-mode .selection-table .song-link {
  font-size: 14px;
}
.simple-mode .split {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 700px) {
  .simple-mode aside {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  .simple-mode main {
    padding: 16px 12px;
  }
  .simple-mode .split {
    grid-template-columns: 1fr;
  }
  .simple-controls label {
    width: 100%;
  }
  .simple-mode .mode-link {
    font-size: 11px;
  }
}

.simple-mode button:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (min-width: 701px) {
  .simple-mode main {
    padding-top: 16px;
  }
  .simple-mode aside {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .simple-intro {
    margin-bottom: 12px;
  }
}

.range-controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--panel);
  padding: 4px 10px;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 5px 10px #0003;
}
.range-controls .range,
.range-controls .pagination {
  margin: 8px 0;
}

.import tr.range-selected {
  background: #eef2ff;
}
.import tr.range-selected td:first-child {
  box-shadow: inset 3px 0 var(--accent);
}
.range-line {
  min-width: 36px;
  border-color: transparent;
}
.range-line[aria-pressed="true"] {
  background: #4f46e5;
}
.range-help {
  color: var(--muted);
  margin: 6px 0;
  font-size: 12px;
}

/* Clear visual hierarchy across selection and management. */
:root {
  font-size: 14px;
  line-height: 1.5;
}
button,
.file {
  border-radius: 9px;
  padding: 8px 12px;
  transition:
    background 0.15s,
    border-color 0.15s;
  font-weight: 550;
}
button.active,
.primary {
  box-shadow: 0 3px 8px #4f46e51a;
}
input,
select,
textarea {
  border-radius: 8px;
  padding: 8px 10px;
}
aside {
  padding: 28px 16px;
}
.brand {
  gap: 7px;
  margin-bottom: 28px;
}
.brand strong {
  letter-spacing: -0.5px;
  font-size: 20px;
}
.mark {
  background: #eef2ff;
  color: #4f46e5;
  border: 0;
}
nav button {
  color: #64748b;
  font-weight: 600;
  border-radius: 10px;
}
nav button.active {
  background: #eef2ff;
  color: #4338ca;
  box-shadow: none;
}
nav button:hover {
  color: #4338ca;
}
main {
  padding: 26px;
}
.main-head {
  margin-bottom: 24px;
}
h1 {
  font-size: 27px;
  letter-spacing: -0.8px;
}
.eyebrow {
  color: #8491a6;
  letter-spacing: 2px;
}
.save-status {
  background: #eaf8f1;
  border-radius: 30px;
  padding: 6px 10px;
}
.panel {
  border-radius: 14px;
  box-shadow: 0 2px 6px #18233803;
}
.panel-head {
  border-bottom: 1px solid var(--line);
}
th {
  color: #66758a;
  font-size: 12px;
  font-weight: 600;
}
.table-wrap {
  border-radius: 10px;
}
.actions,
.toolbar,
.filters {
  gap: 12px;
}
.form-grid label {
  gap: 8px;
  color: #526174;
  font-size: 12px;
  font-weight: 600;
}
.form-grid input,
.form-grid select {
  color: #182338;
  font-size: 14px;
  font-weight: 400;
}
dialog {
  border-radius: 18px;
  box-shadow: 0 24px 80px #18233833;
  padding: 24px;
}
dialog header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.mode-link {
  font-weight: 500;
  text-decoration: none;
}
.mode-link:hover {
  text-decoration: underline;
}
.simple-mode aside {
  background: #ffffff;
}
.simple-list-bar {
  border: 1px solid var(--line);
}
.simple-mode .selection-table .plus {
  border-radius: 6px;
  color: #4338ca;
  background: #eef2ff;
}
.import {
  padding: 22px;
}
.import-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.import-title h2 {
  margin: 0;
  font-size: 21px;
}
.file-pill {
  display: inline-block;
  background: #f1f5f9;
  color: #526174;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.import-steps {
  display: flex;
  gap: 20px;
  margin: 0 0 22px;
  color: #64748b;
  font-size: 13px;
  flex-wrap: wrap;
}
.import-steps strong {
  color: #4338ca;
}
.import .range-controls {
  background: #ffffffee;
  backdrop-filter: blur(12px);
  border: 1px solid #dbe2ec;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 20px 0 16px;
  box-shadow: 0 4px 12px #1823380a;
}
.import .range {
  margin: 0;
  gap: 8px;
}
.import .range input {
  width: 76px;
}
.import .range [data-action="range"] {
  color: #4338ca;
  background: #eef2ff;
  border-color: #c7d2fe;
}
.import .range .import-submit {
  margin-left: auto;
}
.import .range-help {
  margin-top: 10px;
}
#range-selection-count {
  font-weight: 700;
  color: #4338ca;
}
.import table td {
  padding: 8px 5px;
}
.import table input:not([type="checkbox"]) {
  background: transparent;
  border-color: transparent;
  padding: 6px 8px;
}
.import table input:not([type="checkbox"]):hover {
  border-color: #dbe2ec;
  background: #ffffff;
}
.import table input:focus {
  background: #ffffff;
  border-color: #818cf8;
}
.import .range-line {
  background: transparent;
  color: #64748b;
}
.import .range-line[aria-pressed="true"] {
  background: #4f46e5;
  color: #ffffff;
}
.import tr.range-selected {
  background: #eef2ff;
}
.import small {
  font-size: 11px;
}
.import-notes {
  color: #64748b;
  margin: 0 0 16px;
  font-size: 12px;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
@media (max-width: 700px) {
  .import {
    padding: 14px;
  }
  .import-title {
    flex-wrap: wrap;
  }
  .import .range .import-submit {
    margin-left: 0;
  }
}

@media (min-width: 701px) {
  .simple-mode .simple-intro {
    margin-bottom: 8px;
  }
  .simple-mode .simple-list-bar {
    margin-bottom: 8px;
  }
}

.filter-context {
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
  font-weight: 400;
}
.history-notice {
  padding: 16px 20px;
  background: #eef2ff;
  border-radius: 12px;
  margin: 12px 0;
  color: #3730a3;
}
.history-notice p {
  margin: 6px 0 10px;
  font-size: 13px;
}
.must-guide {
  padding: 28px 20px;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.8;
}
.must-guide strong {
  color: #334155;
}

.simple-mode .empty-recommendations {
  display: none;
}

.staple-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}
.staple-filters label {
  flex-direction: column;
  align-items: flex-start;
  color: var(--muted);
  font-size: 12px;
}
.staple-filters select,
.staple-filters input {
  font-size: 14px;
  color: #182338;
}
.staple-summary {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin: 20px 0 8px;
}
.staple-summary strong {
  font-size: 20px;
}
.staple-summary span {
  color: var(--muted);
}
.staple-events {
  margin: 12px 0 20px;
  color: var(--muted);
}
.staple-table td {
  padding: 14px 12px;
  vertical-align: top;
}
.staple-artist {
  display: block;
  margin-top: 4px;
}
.staple-table details {
  font-size: 12px;
  margin-top: 6px;
  color: var(--muted);
}
.staple-table ul {
  padding-left: 16px;
  min-width: 180px;
}
.usage-rate {
  font-size: 20px;
  font-weight: 700;
  color: #4338ca;
}
.staple-table meter {
  display: block;
  width: 90px;
  height: 8px;
  accent-color: #4f46e5;
}

.log-preview table {
  min-width: 1100px;
}
.log-preview .row-deleted {
  opacity: 0.55;
  background: #fff1f2;
}
.row-deleted td:not(:last-child) {
  pointer-events: none;
  text-decoration: line-through;
}
.genre-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.genre-chips button {
  font-size: 11px;
  padding: 2px 5px;
  background: #eef2ff;
  color: #4338ca;
}
.genre-correction {
  border: 1px solid #f1dfa6;
  background: #fff9e9;
  padding: 12px;
  border-radius: 10px;
  margin: 10px 0;
}
.genre-correction p {
  font-size: 12px;
}

.sort-heading {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 3px 0;
  font-size: inherit;
  font-weight: 600;
}
.event-unused {
  color: var(--muted);
  background: #f8fafc;
}
.usage-badge {
  display: inline-block;
  border-radius: 20px;
  padding: 3px 8px;
  background: #edf1f6;
}
.event-used .usage-badge {
  color: #11634f;
  background: #e6f6ef;
}

/* スマートフォン（iPhone など）向け：拡大されない入力欄、押しやすいボタン、折り返す表 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button,
.file,
select {
  touch-action: manipulation;
}
@media (max-width: 700px) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
  /* iOS Safari は16px未満の入力欄をタップすると画面を拡大してしまう */
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 44px;
  }
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 0;
  }
  button,
  .file {
    min-height: 44px;
  }
  #recommend-query {
    width: 100%;
  }
  .simple-mode nav {
    width: 100%;
    overflow-x: auto;
  }
  .simple-mode nav button {
    padding: 10px 14px;
    flex-shrink: 0;
  }
  /* 表の曲名・アーティストを「…」で切らず、折り返して全部見せる */
  .selection-table td,
  .selection-table .song-link {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
  }
  .selection-table th {
    white-space: normal;
  }
  .simple-mode .selection-table th:nth-child(1) {
    width: 50%;
  }
  .simple-mode .selection-table th:nth-child(2) {
    width: 32%;
  }
  .simple-mode .selection-table th:nth-child(3) {
    width: 18%;
  }
  .simple-mode .selection-table .plus {
    min-width: 52px;
    padding: 8px 10px;
    font-size: 14px;
  }
  /* データ管理画面：左の細いサイドバーをやめて、上部の横スクロールメニューにする */
  body:not(.simple-mode) #app {
    display: block;
  }
  body:not(.simple-mode) aside {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  body:not(.simple-mode) .brand {
    margin: 0;
  }
  body:not(.simple-mode) .brand small,
  body:not(.simple-mode) .mark,
  body:not(.simple-mode) aside footer {
    display: none;
  }
  body:not(.simple-mode) nav {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
  }
  body:not(.simple-mode) nav button {
    flex-shrink: 0;
    text-align: center;
  }
  body:not(.simple-mode) main {
    width: 100%;
    padding: 16px 12px 30px;
  }
  /* 横に長い表は、ページ全体ではなく表の中だけ横スクロールさせる */
  body:not(.simple-mode) main .panel {
    overflow-x: auto;
  }
  /* 列の多い表は最低幅を持たせ、表の枠の中で横スクロールさせる（列が潰れて読めなくなるのを防ぐ） */
  body:not(.simple-mode) .table-wrap table,
  .simple-mode .table-wrap:not(.selection-table) table {
    min-width: 620px;
  }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
}
.nowrap {
  white-space: nowrap;
}

/* 画面上部の絞り込みメニュー（折り畳み） */
.fold {
  margin: 0 0 14px;
}
.fold > summary {
  cursor: pointer;
  padding: 10px 2px;
  color: #4338ca;
  font-weight: 600;
  list-style-position: inside;
}
.fold[open] > summary {
  margin-bottom: 4px;
}
.fold .filter-context {
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}
.staple-events summary {
  white-space: nowrap;
}

.work-search {
  margin: 8px 0;
}
.new-work[hidden] {
  display: none;
}
/* 作品での使われ方（OP・ED・挿入歌・その他）のタブ */
.theme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.theme-tabs label {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}
.theme-tabs label.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.theme-tabs input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.theme-tabs label:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.theme-chip {
  display: inline-block;
  margin-left: 4px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 0.85em;
}
.tag-add input {
  width: 14em;
}
