:root {
  --bg: #111315;
  --surface: #17191c;
  --surface-soft: #1d2024;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f4f6f8;
  --muted: #a7adb6;
  --faint: #747b86;
  --blue: #3b79b7;
  --blue-soft: rgba(59, 121, 183, 0.2);
  --jpop: #a76439;
  --pop: #a85f86;
  --homework: #7c5aa6;
  --focus: #90c7ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

select,
textarea,
input {
  color: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 19, 21, 0.88);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.header-links {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(58vw, 440px);
  overflow: visible;
  padding: 4px 0;
}

.header-link {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 14px;
  background: #f8f9fb;
  color: #202936;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.header-link:hover,
.header-link:focus-visible {
  border-color: rgba(144, 199, 255, 0.86);
  background: #ffffff;
  outline: none;
}

.header-icon-svg {
  width: 30px;
  height: 30px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.header-icon-svg text {
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.auth-area {
  position: relative;
  flex: 0 0 auto;
}

.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
}

.auth-button:hover,
.auth-button:focus-visible,
.auth-button.active {
  border-color: var(--focus);
  outline: none;
}

.auth-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}

.auth-button.signed-in .auth-dot {
  background: #8bd04f;
}

.auth-button.viewer .auth-dot {
  background: #ffcf6b;
}

.auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: 210px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #191c21;
  box-shadow: var(--shadow);
}

.auth-menu[hidden] {
  display: none;
}

.auth-menu-user {
  padding: 8px 9px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.auth-menu button {
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 850;
}

.auth-menu button:hover,
.auth-menu button:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.search-glyph {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.search-glyph::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: center;
}

.banner {
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #eff3f8;
}

.banner img {
  display: block;
  width: 100%;
  height: clamp(130px, 18vw, 250px);
  object-fit: cover;
  object-position: center;
}

.intro,
.songbook {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.intro {
  padding: 44px 0 26px;
}

.intro-copy {
  max-width: 760px;
}

.intro h1 {
  margin: 0 0 12px;
  font-size: 32px;
  line-height: 1.2;
}

.intro ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
  color: #e5e8ec;
  font-size: 16px;
  font-weight: 650;
}

.intro li + li {
  margin-top: 5px;
}

.intro li::before {
  content: "- ";
  color: var(--muted);
}

.songbook {
  padding: 8px 0 64px;
}

.songbook-head {
  position: sticky;
  top: 54px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
  background: rgba(17, 19, 21, 0.92);
  backdrop-filter: blur(14px);
}

.songbook h2 {
  margin: 0;
  font-size: 24px;
}

#result-summary {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
}

.songbook-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 360px;
}

.random-btn,
.draw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #f4f6f8;
  color: #111315;
  font-weight: 900;
}

.random-btn:hover,
.draw-btn:hover {
  background: #ffffff;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: min(360px, 42vw);
  min-height: 40px;
  color: var(--muted);
}

.search-box .search-glyph {
  position: absolute;
  left: 14px;
  width: 14px;
  height: 14px;
}

#song-search {
  width: 100%;
  min-height: 40px;
  padding: 0 40px 0 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

#song-search:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(144, 199, 255, 0.16);
}

#clear-search {
  position: absolute;
  right: 6px;
  display: none;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
}

#clear-search.visible {
  display: inline-grid;
  place-items: center;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 850;
}

.tab:hover,
.tab:focus-visible {
  border-color: var(--focus);
  color: var(--text);
  outline: none;
}

.tab.active {
  color: #fff;
}

.tab[data-category="K-POP"].active { background: var(--blue); }
.tab[data-category="J-POP"].active { background: var(--jpop); }
.tab[data-category="POP/OST"].active { background: var(--pop); }
.tab[data-category="숙제곡"].active { background: var(--homework); }

.tab-count {
  color: currentColor;
  opacity: 0.74;
  font-size: 12px;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.song-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.song-table th,
.song-table td {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.song-table th:last-child,
.song-table td:last-child {
  border-right: 0;
}

.song-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #20242a;
  color: #d7dce3;
  font-size: 13px;
}

.song-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.018);
}

.edit-mode .song-table tbody tr:hover td {
  background: rgba(144, 199, 255, 0.08);
}

.editable-row,
.editable-card {
  cursor: pointer;
}

.song-row:focus-visible {
  outline: none;
}

.song-row:focus-visible td {
  background: rgba(144, 199, 255, 0.12);
  box-shadow: inset 0 2px 0 rgba(144, 199, 255, 0.62), inset 0 -2px 0 rgba(144, 199, 255, 0.62);
}

.song-table th:nth-child(1),
.song-table td:nth-child(1) {
  width: 86px;
}

.song-table th:nth-child(2),
.song-table td:nth-child(2) {
  width: 27%;
  font-weight: 800;
}

.song-table th:nth-child(3),
.song-table td:nth-child(3) {
  width: 16%;
}

.song-table th:nth-child(4),
.song-table td:nth-child(4) {
  width: 66px;
  text-align: center;
}

.song-table th:nth-child(5),
.song-table td:nth-child(5) {
  width: 78px;
  text-align: center;
}

.song-table th:nth-child(6),
.song-table td:nth-child(6) {
  width: 104px;
  text-align: center;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.cat-kpop { background: var(--blue); }
.cat-jpop { background: var(--jpop); }
.cat-pop { background: var(--pop); }
.cat-homework { background: var(--homework); }

.memo {
  color: #d7dce3;
}

.muted {
  color: var(--faint);
}

.link-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid rgba(144, 199, 255, 0.34);
  border-radius: 7px;
  color: #cfe7ff;
  background: rgba(144, 199, 255, 0.1);
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}

.link-pill:hover,
.link-pill:focus-visible {
  border-color: var(--focus);
  color: #ffffff;
  outline: none;
}

.skill-cell {
  white-space: nowrap;
}

.fish-rating {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1;
}

.fish-empty {
  opacity: 0.16;
  filter: grayscale(1);
}

.card-list {
  display: none;
}

.song-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.song-card:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(144, 199, 255, 0.16);
  outline: none;
}

.song-card + .song-card {
  margin-top: 10px;
}

.song-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.song-card-title {
  margin: 10px 0 4px;
  font-size: 17px;
  font-weight: 900;
}

.song-card-artist {
  color: var(--muted);
  font-weight: 750;
}

.song-card-meta,
.picked-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.song-card-meta span,
.picked-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.song-card-memo {
  margin-top: 10px;
  color: #d7dce3;
  font-size: 14px;
}

.empty-state {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.add-fab-wrap {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  justify-items: end;
  gap: 12px;
}

.add-fab-wrap[hidden] {
  display: none;
}

.add-fab-menu {
  display: grid;
  gap: 10px;
  transform-origin: bottom right;
  animation: fab-menu-in 0.16s ease-out;
}

.add-fab-menu[hidden] {
  display: none;
}

.fab-menu-btn {
  min-width: 176px;
  min-height: 52px;
  padding: 0 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #202b22;
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
  font-size: 18px;
  font-weight: 950;
}

.fab-menu-btn:hover,
.fab-menu-btn:focus-visible {
  border-color: var(--focus);
  background: #26352a;
  outline: none;
}

.add-fab {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #8bd04f;
  color: #ffffff;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.38);
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  transition: transform 0.14s ease, background 0.14s ease;
}

.add-fab:hover,
.add-fab:focus-visible {
  background: #9cdf5f;
  outline: none;
  transform: translateY(-1px);
}

.add-fab.open span {
  transform: rotate(45deg);
}

.add-fab span {
  display: block;
  transform-origin: center;
  transition: transform 0.16s ease;
}

@keyframes fab-menu-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
}

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

.random-modal,
.form-modal {
  position: relative;
  width: min(520px, 100%);
  padding: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #191c21;
  box-shadow: var(--shadow);
}

.form-modal.compact {
  width: min(420px, 100%);
}

.form-modal.wide {
  width: min(760px, 100%);
}

.form-modal.admin-modal {
  width: min(880px, 100%);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 22px;
}

.modal-kicker {
  color: var(--focus);
  font-size: 13px;
  font-weight: 900;
}

.random-modal h2 {
  margin: 4px 0 18px;
  font-size: 28px;
}

.form-modal h2 {
  margin: 4px 0 18px;
  font-size: 26px;
}

.login-copy {
  margin: -6px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.google-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #d9dde3;
  border-radius: 8px;
  background: #ffffff;
  color: #202124;
  font-weight: 850;
}

.google-login-btn img {
  width: 20px;
  height: 20px;
}

.google-login-btn:hover,
.google-login-btn:focus-visible {
  border-color: #aeb5bf;
  background: #f7f8fa;
  outline: none;
}

.google-login-btn:disabled {
  cursor: wait;
  opacity: 0.7;
}

.random-options {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.random-options label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #e5e8ec;
  font-weight: 750;
}

.random-count {
  min-height: 20px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

.random-result {
  min-height: 142px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111315;
}

.result-placeholder {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.random-result .picked-category {
  width: max-content;
}

.random-result h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.24;
}

.random-result p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.random-result .picked-note {
  color: #d7dce3;
  font-size: 14px;
}

.draw-btn {
  width: 100%;
  margin-top: 14px;
}

.secondary-btn {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.secondary-btn:hover,
.secondary-btn:focus-visible {
  border-color: var(--focus);
  color: var(--text);
  outline: none;
}

.song-form {
  display: grid;
  gap: 14px;
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) 96px;
  align-items: end;
}

.inline-form .draw-btn {
  margin-top: 0;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.admin-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.admin-tab.active {
  border-color: rgba(144, 199, 255, 0.5);
  background: rgba(144, 199, 255, 0.13);
  color: var(--text);
}

.admin-tab:hover,
.admin-tab:focus-visible {
  border-color: var(--focus);
  color: var(--text);
  outline: none;
}

.admin-panel[hidden] {
  display: none;
}

.editor-list,
.up-event-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.editor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.editor-email {
  color: var(--text);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.role-badge,
.up-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(144, 199, 255, 0.13);
  color: #cfe7ff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-mini-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.admin-mini-btn:hover,
.admin-mini-btn:focus-visible {
  border-color: var(--focus);
  color: var(--text);
  outline: none;
}

.admin-mini-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.42;
}

.admin-empty {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.form-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 10px;
  align-items: center;
}

.form-actions .draw-btn {
  margin-top: 0;
}

.up-event-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.up-event-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.up-event-title {
  margin: 0;
  font-size: 18px;
  font-weight: 950;
}

.up-event-meta,
.up-event-memo {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.up-event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.up-entry-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.up-entry-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 8px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
}

.up-entry-main {
  min-width: 0;
  color: #e5e8ec;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.up-entry-main strong {
  color: var(--text);
}

.up-count {
  color: #cfe7ff;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.up-entry-form {
  display: grid;
  grid-template-columns: 1fr 1.2fr 74px 1fr 72px;
  gap: 8px;
}

.up-entry-form input {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #111315;
  color: var(--text);
  outline: none;
}

.up-entry-form input:focus {
  border-color: var(--focus);
}

.up-entry-form button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #f4f6f8;
  color: #111315;
  font-weight: 950;
}

.song-form label {
  display: grid;
  gap: 7px;
  color: #e5e8ec;
  font-weight: 800;
}

.song-form label span {
  color: var(--muted);
  font-size: 13px;
}

.song-form input,
.song-form select,
.song-form textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.skill-picker {
  display: grid;
  grid-template-columns: repeat(5, 44px);
  gap: 8px;
}

.skill-pick {
  display: grid;
  place-items: center;
  width: 44px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  opacity: 0.28;
  filter: grayscale(1);
  font-size: 19px;
  line-height: 1;
}

.skill-pick.active {
  border-color: rgba(144, 199, 255, 0.46);
  background: rgba(144, 199, 255, 0.1);
  opacity: 1;
  filter: none;
}

.skill-pick:hover,
.skill-pick:focus-visible {
  border-color: var(--focus);
  opacity: 1;
  outline: none;
}

.song-form textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.5;
}

.song-form input:focus,
.song-form select:focus,
.song-form textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(144, 199, 255, 0.16);
}

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

.form-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

@media (max-width: 820px) {
  .site-header {
    height: 52px;
    padding: 0 12px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .header-links {
    max-width: none;
    gap: 7px;
  }

  .header-link {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .header-icon-svg {
    transform: scale(0.9);
  }

  .intro,
  .songbook {
    width: min(100% - 24px, 1180px);
  }

  .intro {
    padding-top: 30px;
  }

  .intro h1 {
    font-size: 28px;
  }

  .intro ul {
    font-size: 15px;
  }

  .songbook-head {
    position: static;
    display: grid;
    gap: 12px;
  }

  .songbook-tools {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-box {
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .card-list {
    display: block;
  }

  .inline-form,
  .form-actions,
  .up-entry-form,
  .up-entry-item {
    grid-template-columns: 1fr;
  }

  .up-event-head {
    display: grid;
  }
}

@media (max-width: 520px) {
  .brand span:last-child {
    display: none;
  }

  .header-links {
    max-width: none;
    gap: 6px;
  }

  .header-link {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .header-icon-svg {
    width: 26px;
    height: 26px;
    transform: none;
  }

  .auth-button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 13px;
  }

  .banner img {
    height: 112px;
  }

  .songbook-tools {
    grid-template-columns: 1fr;
  }

  .random-btn {
    width: 100%;
  }

  .add-fab-wrap {
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .fab-menu-btn {
    min-width: 160px;
    min-height: 50px;
    font-size: 17px;
  }

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

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

  .tab {
    justify-content: center;
  }
}
