:root {
  color-scheme: light;
  --ink: #2e3037;
  --muted: #6f737f;
  --line: #dedfe6;
  --page: #f6f7fb;
  --panel: #ffffff;
  --default-song: #eff0f3;
  --clear: #bd806b;
  --clear-green: #00a842;
  --clear-orange: #ffeecc;
  --fail: #5f7f99;
  --fc: #9aa5ad;
  --perfect: #d2b56f;
  --accent: #ec5f75;
  --mint: #4bb7a5;
  --blue: #467cc3;
  --shadow: 0 14px 38px rgba(43, 47, 62, 0.12);
  --sticky-major-top: 82px;
  --sticky-minor-top: 132px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(236, 95, 117, 0.12), transparent 26rem),
    radial-gradient(circle at 82% 0%, rgba(75, 183, 165, 0.14), transparent 28rem),
    linear-gradient(180deg, #fafbfe 0%, var(--page) 58%, #edf1f6 100%);
  color: var(--ink);
  font-family:
    "Inter", "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px 4px 18px;
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid #252731;
  border-radius: 50%;
  background: #ffe06a;
  box-shadow: 4px 4px 0 #252731;
  color: #252731;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 19px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.level-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
  min-width: 0;
  overflow-x: auto;
  padding: 2px;
}

.level-pill,
.ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.level-pill {
  width: 48px;
  height: 38px;
}

.level-pill.sran-nav-pill {
  width: auto;
  min-width: 60px;
  flex: 0 0 auto;
  padding: 0 9px;
}

.level-pill.active {
  border-color: #262832;
  background: #262832;
  color: #fff;
}

.level-pill.muted {
  color: #777b87;
}

.level-pill:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.profile-chip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #555b66;
  cursor: pointer;
  font-weight: 700;
}

.profile-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
}

.profile-actions {
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}

.sync-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.sync-button {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #3b3f49;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.sync-button span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: #262832;
  color: #fff;
  font-size: 13px;
  line-height: 1;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #252731;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
}

.icon-button:hover,
.sync-button:hover,
.profile-chip:hover,
.profile-chip[aria-expanded="true"] {
  border-color: #262832;
  box-shadow: 3px 3px 0 #262832;
}

.profile-menu {
  position: relative;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  display: grid;
  width: 244px;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(32, 34, 42, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.profile-dropdown::before {
  position: absolute;
  top: -7px;
  right: 24px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(32, 34, 42, 0.16);
  border-left: 1px solid rgba(32, 34, 42, 0.16);
  background: rgba(255, 255, 255, 0.96);
  content: "";
  transform: rotate(45deg);
}

.profile-dropdown button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #3b3f49;
  cursor: pointer;
  text-align: left;
}

.profile-dropdown button:hover {
  border-color: var(--line);
  background: #f4f5f9;
}

.menu-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: #262832;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.profile-dropdown strong,
.profile-dropdown small {
  display: block;
}

.profile-dropdown strong {
  color: #252731;
  font-size: 13px;
}

.profile-dropdown small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.main-grid {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 80px;
  display: flex;
  max-height: calc(100vh - 98px);
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(222, 223, 230, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.level-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.level-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.level-title strong {
  color: #252731;
  font-size: 54px;
  line-height: 0.82;
}

.progress-box {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.progress-track {
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e7ee;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clear-green), var(--perfect), var(--accent));
}

.sort-button {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  align-items: center;
  width: fit-content;
  min-height: 40px;
  margin-bottom: 12px;
  padding: 6px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3b3f49;
  cursor: pointer;
  text-align: left;
}

.sort-button:hover {
  color: #11131a;
}

.sort-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.sort-button strong {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #262832;
  color: #fff;
  font-size: 16px;
  line-height: 1;
}

.lamp-chart {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.pie-chart {
  position: relative;
  width: 86px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(#dfe2ea 0% 100%);
  box-shadow: inset 0 0 0 1px rgba(38, 40, 50, 0.08);
}

.pie-chart::after {
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.pie-legend {
  display: grid;
  gap: 5px;
}

.pie-legend span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 6px;
  align-items: center;
  color: #555b66;
  font-size: 11px;
  font-weight: 800;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pie-legend b,
.pie-legend em {
  font-style: normal;
  font-weight: 800;
}

.group-list {
  display: grid;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  gap: 8px;
}

.group-list::-webkit-scrollbar,
.activity-box::-webkit-scrollbar {
  width: 8px;
}

.group-list::-webkit-scrollbar-thumb,
.activity-box::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(32, 34, 42, 0.22);
}

.group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: stretch;
}

.group-button {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f4f5f9;
  color: #3b3f49;
  cursor: pointer;
  text-align: left;
}

.collapse-button {
  display: grid;
  min-width: 32px;
  min-height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: #3b3f49;
  cursor: pointer;
  font-weight: 900;
}

.collapse-button:hover {
  border-color: #262832;
}

.group-button.major {
  margin-top: 4px;
  background: #ebeef5;
}

.group-button.minor {
  min-height: 34px;
  margin-left: 14px;
  width: calc(100% - 14px);
  padding: 7px 9px;
  background: #f8f9fc;
}

.group-button.minor strong {
  padding-left: 6px;
  border-left: 3px solid #cfd4df;
}

.group-button.active {
  border-color: #262832;
  background: #fff;
  box-shadow: 3px 3px 0 #262832;
}

.group-button.lamp-fail,
.group-button.lamp-clear,
.group-button.lamp-fc,
.group-button.lamp-perfect {
  border-color: rgba(32, 34, 42, 0.18);
  color: #20222a;
}

.group-button.lamp-fail {
  background: var(--fail);
  color: #fff;
}

.group-button.lamp-clear {
  background: var(--clear);
}

.group-button.lamp-fc {
  background: var(--fc);
}

.group-button.lamp-perfect {
  background: var(--perfect);
}

.group-button.lamp-fail span,
.group-button.lamp-fail strong {
  color: #fff;
}

.group-button.lamp-clear span,
.group-button.lamp-fc span,
.group-button.lamp-perfect span {
  color: rgba(32, 34, 42, 0.68);
}

.group-button strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-button span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.song-area {
  min-width: 0;
}

.toolbar {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 18px 4px 8px;
}

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

h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.batch-toggle {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #3b3f49;
  cursor: pointer;
  white-space: nowrap;
}

.batch-toggle span {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 6px;
  background: #262832;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.batch-toggle strong {
  font-size: 12px;
  font-weight: 900;
}

.batch-toggle:hover,
.batch-toggle[aria-pressed="true"] {
  border-color: #262832;
  box-shadow: 3px 3px 0 #262832;
}

.batch-toggle[aria-pressed="true"] {
  background: #262832;
  color: #fff;
}

.batch-toggle[aria-pressed="true"] span {
  background: var(--accent);
}

.search-box {
  display: grid;
  gap: 5px;
  min-width: 240px;
}

.search-box span,
.control-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-box input,
.control-grid input,
.control-grid select {
  width: 100%;
  height: 36px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.search-box input {
  padding: 0 12px;
}

.ghost-button {
  display: inline-grid;
  place-items: center;
  height: 36px;
  padding: 0 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #555b66;
  font-size: 12px;
  font-weight: 800;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.legend-dot.clear {
  background: var(--clear);
}

.legend-dot.clear-orange {
  background: var(--clear-orange);
}

.legend-dot.fail {
  background: var(--fail);
}

.legend-dot.fc {
  background: var(--fc);
}

.legend-dot.perfect {
  background: var(--perfect);
}

.song-sections {
  display: grid;
  gap: 24px;
}

.song-section {
  min-width: 0;
}

.section-heading {
  position: sticky;
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 12px;
  align-items: center;
  margin: 6px 0 12px;
  padding: 6px 0;
  background: rgba(246, 247, 251, 0.92);
  backdrop-filter: blur(12px);
}

.major-section {
  margin-top: 8px;
}

.major-section > .section-heading {
  top: var(--sticky-major-top);
  z-index: 14;
  margin: 10px 0 8px;
}

.major-section > .section-heading h2 {
  padding: 8px 12px;
  border-radius: 8px;
  background: #262832;
  color: #fff;
  font-size: 24px;
}

.major-section > .section-heading::before {
  height: 3px;
  background: linear-gradient(90deg, #262832, rgba(38, 40, 50, 0.1));
}

.major-section > .song-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.minor-section {
  margin-top: 8px;
}

.minor-section .section-heading {
  top: var(--sticky-minor-top);
  z-index: 13;
  margin: 8px 0 10px;
}

.minor-section .section-heading h2 {
  color: #3c414d;
  font-size: 17px;
}

.minor-section .section-heading::before {
  height: 1px;
  background: linear-gradient(90deg, #8f98a8, rgba(143, 152, 168, 0.08));
}

.section-heading::before {
  grid-column: 2;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, #262832, rgba(38, 40, 50, 0.08));
  content: "";
}

.section-heading h2 {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  color: #252731;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
}

.section-heading span {
  grid-column: 3;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.section-heading .collapse-button {
  grid-column: auto;
  width: 40px;
  min-height: 38px;
  font-size: 18px;
}

.batch-section-select {
  grid-column: auto;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #3b3f49;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.batch-section-select:hover,
.batch-section-select.has-selection {
  border-color: #262832;
  box-shadow: 2px 2px 0 #262832;
}

.batch-section-select[aria-pressed="true"] {
  background: #262832;
  color: #fff;
}

.song-section.collapsed .section-heading {
  margin-bottom: 6px;
}

.song-section.collapsed > .song-list {
  display: none;
}

.song-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.song-card {
  position: relative;
  display: flex;
  min-height: 218px;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid rgba(32, 34, 42, 0.12);
  border-radius: 8px;
  background: var(--song-bg, var(--default-song));
  box-shadow: 0 9px 22px rgba(39, 44, 57, 0.08);
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.song-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(39, 44, 57, 0.13);
}

.card-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: none;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(38, 40, 50, 0.46);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: #fff;
  cursor: pointer;
}

.card-select span {
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.batch-mode .card-select {
  display: grid;
}

.batch-mode .song-card.is-selectable {
  cursor: pointer;
}

.batch-mode .song-card.is-selectable .song-head > div:first-child {
  padding-left: 34px;
}

.batch-mode .song-card.is-selectable .control-grid {
  opacity: 0.44;
  pointer-events: none;
}

.batch-mode .song-card.is-selectable:hover {
  transform: translateY(-2px) scale(1.008);
}

.batch-mode .song-card.is-selected {
  border-color: #262832;
  outline: 3px solid #262832;
  outline-offset: -3px;
  box-shadow: 5px 5px 0 #262832, 0 16px 30px rgba(39, 44, 57, 0.16);
}

.batch-mode .song-card.is-selected .card-select {
  border-color: #262832;
  background: #262832;
}

.card-select:focus-visible,
.batch-toggle:focus-visible,
.batch-section-select:focus-visible,
.batch-panel button:focus-visible,
.batch-panel select:focus-visible {
  outline: 3px solid rgba(236, 95, 117, 0.46);
  outline-offset: 2px;
}

.batch-mode .app-shell {
  padding-bottom: 168px;
}

.batch-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(390px, 1fr) auto;
  gap: 10px 16px;
  align-items: end;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(32, 34, 42, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(31, 35, 48, 0.24), 4px 4px 0 #262832;
  backdrop-filter: blur(18px);
}

.batch-panel-summary {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 176px;
}

.batch-panel-mark {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: #262832;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.batch-panel-summary strong,
.batch-panel-summary small {
  display: block;
}

.batch-panel-summary strong {
  color: #252731;
  font-size: 15px;
}

.batch-panel-summary small {
  max-width: 245px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
}

.batch-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(116px, 1fr));
  gap: 8px;
}

.batch-fields label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.batch-fields span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.batch-fields select {
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 9px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: #f8f9fc;
  color: #252731;
  font-size: 12px;
  font-weight: 800;
}

.batch-panel-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}

.batch-panel-actions button,
.batch-feedback button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.batch-secondary,
.batch-exit,
.batch-feedback button {
  background: #f4f5f9;
  color: #3b3f49;
}

.batch-apply {
  border-color: #262832 !important;
  background: #262832;
  color: #fff;
}

.batch-exit {
  width: 36px;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 1;
}

.batch-panel button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.batch-feedback {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  min-height: 30px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: #4f5561;
  font-size: 12px;
  font-weight: 800;
}

.batch-feedback button {
  min-height: 28px;
  border-color: #262832;
  background: #fff;
}

.song-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: stretch;
}

.song-content {
  min-width: 0;
}

.song-head {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 58px;
}

.genre {
  margin: 0 0 3px;
  color: rgba(30, 32, 40, 0.7);
  font-size: 12px;
  font-weight: 900;
}

.title {
  margin: 0;
  color: #20222a;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.danger-badge {
  flex: 0 0 auto;
  padding: 4px 6px;
  border-radius: 6px;
  background: #262832;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.meta-grid {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) minmax(0, 2fr);
  gap: 6px;
  margin: 10px 0;
}

.meta-grid div {
  min-width: 0;
  padding: 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.48);
}

.meta-grid dt {
  margin: 0 0 2px;
  color: rgba(41, 44, 54, 0.62);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.meta-grid dd {
  margin: 0;
  overflow: hidden;
  color: #2c2f38;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff-cell dd {
  white-space: normal;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.control-grid label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.control-grid select,
.control-grid input {
  padding: 0 8px;
}

.icon-rail {
  display: grid;
  gap: 8px;
  align-items: center;
  justify-items: center;
  align-content: start;
  min-width: 0;
  padding-top: 4px;
}

.icon-rail img {
  max-width: 54px;
  max-height: 32px;
  object-fit: contain;
  image-rendering: auto;
}

.unrecorded-badge {
  display: inline-grid;
  min-width: 52px;
  min-height: 24px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(32, 34, 42, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.64);
  color: #3d424d;
  font-size: 12px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.song-card.status-clear {
  --song-bg: var(--clear);
}

.song-card.status-clear-green {
  --song-bg: var(--clear-green);
}

.song-card.status-clear-orange {
  --song-bg: var(--clear-orange);
}

.song-card.status-fail {
  --song-bg: var(--fail);
}

.song-card.status-fc {
  --song-bg: var(--fc);
}

.song-card.status-perfect {
  --song-bg: var(--perfect);
}

.song-card.status-clear-green,
.song-card.status-fail,
.song-card.status-fc {
  color: #11151b;
}

.song-card.status-fail .genre,
.song-card.status-fail .title,
.song-card.status-fail .meta-grid dd,
.song-card.status-fail .meta-grid dt,
.song-card.status-fail .control-grid span {
  color: #fff;
}

.song-card.status-fail .meta-grid div,
.song-card.status-fail .control-grid input,
.song-card.status-fail .control-grid select {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.song-card.status-fail option {
  color: #20222a;
}

.nav-link-pill {
  display: inline-grid;
  width: auto;
  min-width: 48px;
  place-items: center;
  padding: 0 12px;
  text-decoration: none;
  white-space: nowrap;
}

.home-shell {
  display: flex;
  width: min(1480px, calc(100% - 32px));
  min-height: 100vh;
  flex-direction: column;
  margin: 0 auto;
  padding: 18px 0 20px;
}

.home-topbar {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px 18px;
}

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

.home-nav a {
  display: inline-grid;
  min-height: 38px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #3b3f49;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.home-hero {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 34px;
  align-items: center;
  min-height: 620px;
  padding: 16px 0 34px;
}

.hero-copy,
.home-actions {
  display: grid;
  align-items: center;
  justify-items: center;
}

.hero-card {
  position: relative;
  display: flex;
  width: min(75%, 520px);
  min-width: 360px;
  min-height: 0;
  flex-direction: column;
  justify-content: start;
  overflow: hidden;
  padding: clamp(24px, 3vw, 34px);
  border: 1px solid rgba(222, 223, 230, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72)),
    repeating-linear-gradient(90deg, rgba(38, 40, 50, 0.045) 0 1px, transparent 1px 42px);
  box-shadow: var(--shadow);
}

.hero-card h1 {
  margin: 0;
  color: #252731;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 0.96;
}

.hero-lede {
  max-width: 24rem;
  margin: 10px 0 0;
  color: #4d535e;
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 800;
  line-height: 1.45;
}

.hero-icons {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.hero-icons img {
  width: 46px;
  height: 28px;
  object-fit: contain;
}

.lamp-demo {
  display: grid;
  width: min(100%, 360px);
  margin-top: 16px;
}

.demo-song-card {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(32, 34, 42, 0.13);
  border-radius: 8px;
  background: var(--default-song);
  box-shadow: 0 9px 22px rgba(39, 44, 57, 0.08);
  animation: demo-card-bg 5.4s steps(1, end) infinite;
}

.demo-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.demo-card-head p {
  margin: 0 0 3px;
  color: rgba(30, 32, 40, 0.72);
  font-size: 12px;
  font-weight: 900;
}

.demo-card-head h2 {
  margin: 0;
  color: #20222a;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0;
}

.demo-danger {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.demo-danger {
  background: #262832;
  color: #fff;
}

.demo-meta-grid,
.demo-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-meta-grid div {
  min-width: 0;
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.5);
}

.demo-control-grid div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.demo-meta-grid span,
.demo-control-grid span {
  color: rgba(41, 44, 54, 0.65);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.demo-meta-grid strong {
  display: block;
  overflow: hidden;
  color: #2c2f38;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.demo-field {
  position: relative;
  display: grid;
  height: 34px;
  min-height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #3d424d;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.demo-field i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-style: normal;
  opacity: 0;
}

.demo-clear-clear {
  animation: demo-status-clear 5.4s steps(1, end) infinite;
}

.demo-clear-fc {
  animation: demo-status-fc 5.4s steps(1, end) infinite;
}

.demo-clear-perfect {
  animation: demo-status-perfect 5.4s steps(1, end) infinite;
}

.demo-medal-field img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  max-width: 34px;
  max-height: 34px;
  opacity: 0;
  object-fit: contain;
  transform: translate(-50%, -50%);
}

.demo-medal-clear {
  animation: demo-status-clear 5.4s steps(1, end) infinite;
}

.demo-medal-fc {
  animation: demo-status-fc 5.4s steps(1, end) infinite;
}

.demo-medal-perfect {
  animation: demo-status-perfect 5.4s steps(1, end) infinite;
}

@keyframes demo-status-clear {
  0%,
  33.333% {
    opacity: 1;
  }

  33.334%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-status-fc {
  0%,
  33.333% {
    opacity: 0;
  }

  33.334%,
  66.666% {
    opacity: 1;
  }

  66.667%,
  100% {
    opacity: 0;
  }
}

@keyframes demo-status-perfect {
  0%,
  66.666% {
    opacity: 0;
  }

  66.667%,
  100% {
    opacity: 1;
  }
}

@keyframes demo-card-bg {
  0%,
  33.333% {
    background: var(--clear);
  }

  33.334%,
  66.666% {
    background: var(--fc);
  }

  66.667%,
  100% {
    background: var(--perfect);
  }
}

.home-actions {
  gap: 28px;
}

.auth-actions {
  display: grid;
  width: min(460px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.big-action {
  display: grid;
  min-height: 86px;
  place-items: center;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 900;
  text-decoration: none;
}

.big-action.primary {
  border: 1px solid #262832;
  background: #262832;
  color: #fff;
  box-shadow: 5px 5px 0 #ffe06a;
}

.big-action.secondary {
  border: 1px solid #262832;
  background: rgba(255, 255, 255, 0.82);
  color: #262832;
  box-shadow: 5px 5px 0 rgba(38, 40, 50, 0.2);
}

.quick-entry {
  display: grid;
  gap: 12px;
  justify-items: center;
  color: #555b66;
  font-weight: 900;
}

.quick-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.quick-levels a {
  display: grid;
  width: 58px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #252731;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.quick-levels a:hover,
.home-nav a:hover,
.nav-link-pill:hover {
  border-color: #262832;
  box-shadow: 3px 3px 0 #262832;
}

.site-footer {
  padding: 10px 0 4px;
  color: #707581;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.lounge-shell {
  width: min(1420px, calc(100% - 32px));
}

.lounge-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.lounge-main,
.submit-panel,
.player-detail-panel {
  border: 1px solid rgba(222, 223, 230, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow);
}

.lounge-main {
  min-width: 0;
  padding: 20px;
}

.room-switcher {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid #d6d8e0;
  border-radius: 10px;
  background: #f0f2f6;
}

.room-switcher a {
  display: inline-grid;
  min-height: 36px;
  padding: 0 15px;
  place-items: center;
  border-radius: 7px;
  color: #686e7a;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.room-switcher a.active {
  background: #252731;
  box-shadow: 0 5px 14px rgba(37, 39, 49, 0.16);
  color: #fff;
}

.lounge-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 16px;
}

.lounge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.submit-preview,
.hide-preview {
  min-width: 150px;
}

.level-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding: 2px;
}

.level-tabs button,
.level-tabs a {
  display: inline-grid;
  width: 52px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #3b3f49;
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.level-tabs a.sran-lounge-entry {
  width: auto;
  min-width: 112px;
  padding: 0 14px;
}

.level-tabs button.active {
  border-color: #262832;
  background: #262832;
  color: #fff;
}

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

.rank-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.rank-table th,
.rank-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.rank-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rank-table td {
  color: #343844;
  font-size: 14px;
  font-weight: 800;
}

.rank-table tbody tr:hover,
.rank-table tbody tr.selected {
  background: rgba(246, 247, 251, 0.9);
}

.rank-table tbody tr.rank-row {
  cursor: pointer;
}

.rank-table tbody tr.selected {
  box-shadow: inset 4px 0 0 #262832;
}

.detail-button {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid #262832;
  border-radius: 999px;
  background: #fff;
  color: #262832;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.detail-button:hover {
  background: #262832;
  color: #fff;
}

.rate-pill {
  display: inline-grid;
  min-width: 68px;
  min-height: 28px;
  place-items: center;
  border-radius: 999px;
  color: #20222a;
  font-size: 12px;
  font-weight: 900;
}

.rate-pill.high {
  background: var(--perfect);
}

.rate-pill.mid {
  background: var(--clear);
}

.rate-pill.low {
  background: var(--fail);
  color: #fff;
}

.lounge-side {
  display: grid;
  gap: 18px;
}

.submit-panel,
.player-detail-panel {
  padding: 18px;
}

.activity-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.submit-panel h2,
.player-detail-panel h2,
.activity-panel h2 {
  margin: 0;
  color: #252731;
  font-size: 22px;
}

.submit-panel p:not(.eyebrow),
.player-detail-panel p:not(.eyebrow) {
  margin: 12px 0 16px;
  color: #5a606c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.player-detail-panel {
  position: sticky;
  top: 18px;
}

.detail-empty,
.detail-updated {
  margin-bottom: 0;
}

.detail-summary {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.detail-meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe2ea;
}

.detail-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--clear), var(--fc), var(--perfect));
}

.detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-metrics div {
  display: grid;
  gap: 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f9fc;
}

.detail-metrics strong {
  color: #252731;
  font-size: 18px;
  line-height: 1;
}

.detail-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-song-list {
  display: grid;
  max-height: 62vh;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.detail-song {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 9px;
  border: 1px solid #dfe2ea;
  border-left-width: 5px;
  border-radius: 8px;
  background: #fff;
}

.detail-song.detail-fail {
  border-left-color: var(--fail);
}

.detail-song.detail-clear {
  border-left-color: var(--clear);
}

.detail-song.detail-fc {
  border-left-color: var(--fc);
}

.detail-song.detail-perfect {
  border-left-color: var(--perfect);
}

.detail-song.detail-blank {
  opacity: 0.58;
}

.detail-song-kind {
  display: inline-grid;
  min-height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #f0f2f6;
  color: #343844;
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.detail-song-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.detail-song-body strong,
.detail-song-body span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-song-body strong {
  color: #252731;
  font-size: 13px;
}

.detail-song-body span {
  color: #6a707c;
  font-size: 11px;
  font-weight: 800;
}

.detail-song-extras {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.detail-song-extras img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.detail-song-extras span {
  color: #252731;
  font-size: 12px;
  font-weight: 900;
}

.activity-heading {
  display: flex;
  gap: 16px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.community-view-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid #d6d8e0;
  border-radius: 9px;
  background: #f2f4f8;
}

.community-view-tabs button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #686e7a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.community-view-tabs button.active {
  background: #252731;
  color: #fff;
}

.loading-line {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #5a606c;
  font-weight: 900;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(32, 34, 42, 0.14);
  border-top-color: #252731;
  border-radius: 999px;
  animation: loading-spin 0.8s linear infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.activity-box {
  display: grid;
  max-height: 430px;
  min-height: 260px;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: rgba(246, 247, 251, 0.78);
}

.activity-box p {
  margin: 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: #fff;
  color: #4b515d;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.6;
}

.activity-box strong {
  color: #252731;
}

.activity-clear-preview {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #d6d8e0;
  color: #343844;
  font-size: 12px;
  font-weight: 850;
}

.guestbook-panel {
  display: grid;
  gap: 12px;
}

.guestbook-form {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: #fff;
}

.guestbook-form > label {
  color: #343844;
  font-size: 13px;
  font-weight: 900;
}

.guestbook-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  outline: none;
  background: #f8f9fc;
  color: #252731;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.guestbook-form textarea:focus {
  border-color: #5f6572;
  box-shadow: 0 0 0 3px rgba(70, 124, 195, 0.12);
}

.guestbook-form-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  color: #6a707c;
  font-size: 12px;
  font-weight: 800;
}

.guestbook-counter {
  white-space: nowrap;
}

.guestbook-list {
  display: grid;
  max-height: 500px;
  min-height: 180px;
  gap: 10px;
  overflow: auto;
  padding: 12px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: rgba(246, 247, 251, 0.78);
}

.guestbook-message,
.guestbook-empty,
.guestbook-loading {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.guestbook-message {
  display: grid;
  gap: 8px;
}

.guestbook-message-header {
  display: flex;
  gap: 10px;
  align-items: center;
}

.guestbook-message-header strong {
  color: #252731;
  font-size: 14px;
}

.guestbook-message-header time {
  color: #858a95;
  font-size: 11px;
  font-weight: 800;
}

.guestbook-message-header button {
  margin-left: auto;
  padding: 4px 8px;
  border: 1px solid #d6d8e0;
  border-radius: 6px;
  background: #fff;
  color: #777d89;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
}

.guestbook-message-content {
  margin: 0;
  color: #454b57;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.guestbook-empty,
.guestbook-loading {
  color: #6a707c;
  font-size: 13px;
  font-weight: 800;
}

.confirm-shell {
  min-height: 100vh;
}

.confirm-panel {
  width: min(520px, 100%);
  margin: clamp(48px, 12vh, 120px) auto 0;
  padding: 28px;
  border: 1px solid rgba(32, 34, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.confirm-panel h1 {
  margin: 0;
  color: #252731;
  font-size: 34px;
}

.confirm-panel p:not(.eyebrow) {
  margin: 14px 0 22px;
  color: #555b66;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.7;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.confirm-actions a {
  display: inline-grid;
  min-height: 40px;
  place-items: center;
  padding: 0 14px;
  text-decoration: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(25, 27, 34, 0.36);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid rgba(32, 34, 42, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f0f1f5;
  color: #3b3f49;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.modal-panel h2 {
  margin: 0 36px 8px 0;
  color: #252731;
  font-size: 26px;
}

.modal-copy {
  margin: 0 0 16px;
  color: #5a606c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

.auth-panel form {
  display: grid;
  gap: 12px;
}

.auth-panel label {
  display: grid;
  gap: 6px;
  color: #3d4350;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-panel input {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid #d6d8e0;
  border-radius: 8px;
  background: #fff;
  color: #252731;
  font-size: 15px;
  font-weight: 750;
  text-transform: none;
}

.modal-actions {
  display: flex;
  justify-content: end;
  gap: 10px;
  margin-top: 8px;
}

.modal-primary {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #262832;
  border-radius: 8px;
  background: #262832;
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 1240px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .level-nav {
    justify-content: start;
  }

  .profile-actions {
    justify-self: start;
    flex-wrap: wrap;
  }

  .sync-actions {
    flex-wrap: wrap;
  }

  .song-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .batch-panel {
    grid-template-columns: auto minmax(390px, 1fr);
  }

  .batch-panel-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .home-hero,
  .lounge-grid {
    grid-template-columns: 1fr;
  }

  .player-detail-panel {
    position: static;
  }

  .detail-song-list {
    max-height: 520px;
  }

  .hero-card {
    width: min(520px, 100%);
  }

}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .level-nav {
    justify-content: start;
  }

  .profile-chip,
  .profile-actions {
    justify-self: start;
  }

  .profile-actions {
    flex-wrap: wrap;
  }

  .sync-actions {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    max-height: none;
    overflow: visible;
    position: static;
  }

  .group-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-mode .app-shell {
    padding-bottom: 218px;
  }

  .batch-panel {
    grid-template-columns: 1fr;
  }

  .batch-fields,
  .batch-panel-actions {
    grid-column: 1;
  }

  .batch-panel-actions {
    justify-content: stretch;
  }

  .batch-panel-actions .batch-secondary,
  .batch-panel-actions .batch-apply {
    flex: 1;
  }

  .home-topbar,
  .lounge-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .home-nav {
    justify-content: start;
  }

  .home-hero {
    min-height: auto;
  }

  .hero-card {
    min-width: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --sticky-major-top: 0px;
    --sticky-minor-top: 0px;
  }

  .app-shell {
    width: min(100% - 12px, 1560px);
    padding: 8px 0 18px;
  }

  .topbar {
    gap: 8px;
    padding: 8px 0 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    box-shadow: 3px 3px 0 #252731;
    font-size: 13px;
  }

  .brand strong {
    font-size: 18px;
  }

  .brand small {
    font-size: 11px;
  }

  .level-nav {
    gap: 6px;
    padding: 0 1px 2px;
  }

  .level-pill {
    width: 44px;
    height: 34px;
  }

  .profile-actions {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 7px;
    width: 100%;
    align-items: center;
  }

  .room-button {
    order: 1;
  }

  .profile-menu {
    order: 2;
  }

  .sync-actions {
    order: 3;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .sync-button {
    justify-content: center;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .sync-button span {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    font-size: 11px;
  }

  .profile-chip {
    max-width: 100%;
    min-height: 34px;
    padding: 7px 10px;
  }

  #profile-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .main-grid {
    gap: 8px;
  }

  .side-panel {
    display: grid;
    gap: 8px;
    padding: 8px;
    border-color: rgba(222, 223, 230, 0.72);
    box-shadow: 0 8px 20px rgba(39, 44, 57, 0.08);
  }

  .level-title,
  .lamp-chart {
    display: none;
  }

  .progress-box {
    margin-bottom: 0;
    font-size: 12px;
  }

  .progress-track {
    height: 7px;
    margin-top: 5px;
  }

  .sort-button {
    min-height: 30px;
    margin-bottom: 0;
    padding: 0;
  }

  .sort-button strong {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .group-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 116px;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 1px 3px 1px 1px;
  }

  .group-row {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 4px;
    min-width: 0;
  }

  .group-list::-webkit-scrollbar {
    width: 8px;
  }

  .group-button {
    min-width: 0;
    min-height: 32px;
    padding: 6px 8px;
    gap: 6px;
  }

  .group-button.major {
    margin-top: 0;
  }

  .group-button.minor {
    width: auto;
    min-height: 30px;
    margin-left: 0;
    padding: 6px 8px;
  }

  .group-button strong {
    min-width: 0;
    font-size: 12px;
  }

  .group-button span {
    min-width: max-content;
    font-size: 11px;
  }

  .collapse-button {
    min-width: 30px;
    min-height: 30px;
  }

  .toolbar {
    gap: 8px;
    margin-bottom: 8px;
    padding: 8px 0 4px;
  }

  .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .batch-toggle {
    width: 100%;
  }

  .search-box {
    min-width: 0;
  }

  .search-box input {
    height: 34px;
  }

  .song-sections {
    gap: 14px;
  }

  .section-heading {
    position: static;
    grid-template-columns: auto minmax(24px, 1fr) auto auto auto;
    gap: 6px;
    margin: 4px 0 6px;
    padding: 3px 0;
  }

  .major-section {
    margin-top: 4px;
  }

  .major-section > .section-heading {
    margin: 6px 0 6px;
  }

  .major-section > .section-heading h2 {
    padding: 6px 8px;
    font-size: 18px;
  }

  .minor-section {
    margin-top: 5px;
  }

  .minor-section .section-heading {
    margin: 6px 0;
  }

  .minor-section .section-heading h2 {
    font-size: 14px;
  }

  .section-heading span {
    font-size: 12px;
  }

  .section-heading .collapse-button {
    width: 34px;
    min-height: 32px;
    font-size: 16px;
  }

  .batch-section-select {
    min-height: 32px;
    padding: 0 7px;
    font-size: 10px;
  }

  .major-section > .song-list {
    gap: 8px;
  }

  .minor-section > .song-list,
  .song-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .song-card {
    min-height: 0;
    gap: 7px;
    justify-content: start;
    padding: 8px;
    box-shadow: 0 7px 16px rgba(39, 44, 57, 0.08);
  }

  .song-card:hover {
    transform: none;
  }

  .batch-mode .song-card.is-selectable:hover {
    transform: none;
  }

  .card-select {
    top: 7px;
    left: 7px;
    width: 25px;
    height: 25px;
  }

  .batch-mode .song-card.is-selectable .song-head > div:first-child {
    padding-left: 29px;
  }

  .batch-mode .app-shell {
    padding-bottom: 302px;
  }

  .batch-panel {
    right: 6px;
    bottom: 6px;
    left: 6px;
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
    gap: 9px;
    padding: 10px;
    overflow: auto;
    box-shadow: 0 14px 36px rgba(31, 35, 48, 0.24), 3px 3px 0 #262832;
  }

  .batch-panel-summary {
    min-width: 0;
  }

  .batch-panel-summary small {
    max-width: none;
  }

  .batch-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-write-field {
    grid-column: 1 / -1;
  }

  .batch-panel-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px;
  }

  #batch-select-visible {
    grid-column: 1;
    grid-row: 1;
  }

  #batch-clear-selection {
    grid-column: 2;
    grid-row: 1;
  }

  #batch-apply {
    grid-column: 1 / 3;
    grid-row: 2;
  }

  #batch-exit {
    grid-column: 3;
    grid-row: 1 / 3;
    width: 36px;
    height: 100%;
  }

  .batch-feedback {
    align-items: flex-start;
    justify-content: space-between;
    font-size: 11px;
  }

  .song-main {
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 5px;
  }

  .song-head {
    min-height: 0;
    gap: 5px;
  }

  .genre {
    margin-bottom: 2px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.15;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .danger-badge {
    padding: 3px 4px;
    font-size: 9px;
  }

  .meta-grid {
    grid-template-columns: minmax(42px, 0.8fr) minmax(0, 1.2fr);
    gap: 4px;
    margin: 6px 0;
  }

  .meta-grid div {
    padding: 5px;
  }

  .meta-grid dt {
    font-size: 9px;
  }

  .meta-grid dd {
    font-size: 11px;
  }

  .diff-cell dd {
    white-space: nowrap;
  }

  .control-grid {
    gap: 5px;
  }

  .control-grid label {
    gap: 2px;
  }

  .control-grid span {
    font-size: 9px;
  }

  .control-grid input,
  .control-grid select {
    height: 30px;
    min-width: 0;
    padding: 0 5px;
    font-size: 12px;
  }

  .icon-rail {
    gap: 4px;
    padding-top: 0;
  }

  .icon-rail img {
    max-width: 30px;
    max-height: 20px;
  }

  .unrecorded-badge {
    min-width: 24px;
    min-height: 22px;
    padding: 0;
    font-size: 0;
  }

  .unrecorded-badge::after {
    font-size: 12px;
    content: "-";
  }

  .home-shell,
  .lounge-shell {
    width: min(100% - 20px, 1560px);
  }

  .home-hero {
    gap: 24px;
    padding-top: 8px;
  }

  .hero-card {
    width: 100%;
    aspect-ratio: auto;
    min-height: 420px;
    padding: 26px;
  }

  .hero-card h1 {
    font-size: 46px;
  }

  .auth-actions,
  .lounge-side {
    grid-template-columns: 1fr;
  }

  .detail-song {
    grid-template-columns: 1fr;
  }

  .detail-song-kind {
    width: fit-content;
    padding: 0 10px;
  }

  .detail-song-extras {
    justify-content: flex-start;
  }

  .activity-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .community-view-tabs {
    width: 100%;
  }

  .community-view-tabs button {
    flex: 1;
  }

  .room-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .guestbook-form-footer {
    grid-template-columns: 1fr auto;
  }

  .guestbook-form-footer > :first-child {
    grid-column: 1 / -1;
  }

  .big-action {
    min-height: 72px;
    font-size: 21px;
  }

  .quick-levels a {
    width: 52px;
  }
}
