:root {
  color-scheme: dark;
  --app-header-offset: 64px;
  /* Align with public /albums terminal palette (albums_terminal.css) */
  --bg: #0a0a0f;
  --panel: #12121a;
  --line: #1e1e2a;
  --fg: #d8dce8;
  --muted: #6b7080;
  --accent: #22d3ee;
  --accent-glow: 0 0 12px rgba(34, 211, 238, 0.42);
  --violet: #c4b5fd;
  --pop: #ff3dac;
  --danger: #ef4444;
  --warn: #fbbf24;
}

* { box-sizing: border-box; }

.app-shell {
  min-height: 100vh;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family:
    "Noto Sans JP",
    ui-sans-serif,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.45;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-shadow: var(--accent-glow);
  border-bottom: 1px dashed transparent;
}
a:hover {
  color: #67e8f9;
  border-bottom-color: rgba(34, 211, 238, 0.35);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  margin-top: calc(var(--app-header-offset, 64px) + 16px);
  padding: 14px max(18px, env(safe-area-inset-right, 0px)) 48px max(18px, env(safe-area-inset-left, 0px));
  min-width: 0;
  box-sizing: border-box;
}

.main h1 {
  margin: 0 0 14px;
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--violet);
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.28);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.main h2 {
  margin: 20px 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--muted);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  box-sizing: border-box;
  padding-top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

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

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) 28px max(18px, env(safe-area-inset-left, 0px));
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.site-footer__meta {
  margin: 0;
}
.site-footer__accent {
  color: var(--accent);
  text-shadow: var(--accent-glow);
  margin-right: 6px;
}
.muted { color: var(--muted); }

/* Long /artists/… slug (and similar): one line, ellipsis, never overflow main column */
.public-route-line {
  margin: 0 0 14px;
  display: block;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.public-route-line__a {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.notice {
  border: 1px solid rgba(34, 211, 238, 0.45);
  padding: 10px 12px;
  border-radius: 3px;
  background: rgba(18, 18, 26, 0.6);
  box-shadow: var(--accent-glow);
}
.warn { border: 1px solid var(--warn); color: #ffe6a8; padding: 10px 12px; border-radius: 3px; background: rgba(251, 191, 36, 0.06); }

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  min-width: 0;
}

.album-card {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transition: border-color 0.12s, box-shadow 0.12s;
  min-width: 0;
}
.album-card:hover {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.08);
}

.album-card > a {
  border-bottom: none;
}
.album-card > a:hover {
  opacity: 0.94;
}

/* Square thumb area on home grid (covers non-square source images) */
.album-card > a:has(img.album-card__cover) {
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid rgba(30, 30, 42, 0.9);
}

.album-card__cover {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border: 0;
  border-radius: 0;
}

.album-card__title {
  margin: 10px 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.album-card__title a {
  color: var(--accent);
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.album-card__title a:hover {
  color: #67e8f9;
}

.album-card__cover--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  font-size: 32px;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 2px;
  background: rgba(18, 18, 26, 0.85);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  vertical-align: top;
}
.data-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: var(--violet);
}

.data-table .data-table__slug-cell {
  min-width: 0;
}

.data-table .data-table__slug-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.data-table--artists,
.data-table--artists-no-slug,
.data-table--dashboard-albums,
.data-table--dashboard-albums-no-slug,
.data-table--admin-artists,
.data-table--admin-albums {
  table-layout: fixed;
  width: 100%;
}

.data-table--artists th,
.data-table--artists td,
.data-table--artists-no-slug th,
.data-table--artists-no-slug td,
.data-table--dashboard-albums th,
.data-table--dashboard-albums td,
.data-table--dashboard-albums-no-slug th,
.data-table--dashboard-albums-no-slug td,
.data-table--admin-artists th,
.data-table--admin-artists td,
.data-table--admin-albums th,
.data-table--admin-albums td {
  min-width: 0;
  vertical-align: middle;
}

.data-table--artists .data-table__name-cell {
  width: 24%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table--artists .data-table__slug-cell {
  width: 48%;
}

.data-table--artists thead th:nth-child(3),
.data-table--artists tbody td:nth-child(3) {
  width: 10%;
  white-space: nowrap;
}

.data-table--artists thead th:nth-child(4),
.data-table--artists tbody td:nth-child(4) {
  width: 12%;
  white-space: nowrap;
  text-align: right;
}

.data-table--artists-no-slug .data-table__name-cell {
  width: 52%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table--artists-no-slug thead th:nth-child(2),
.data-table--artists-no-slug tbody td:nth-child(2) {
  width: 18%;
  white-space: nowrap;
}

.data-table--artists-no-slug thead th:nth-child(3),
.data-table--artists-no-slug tbody td:nth-child(3) {
  width: 30%;
  white-space: nowrap;
  text-align: right;
}

.data-table--dashboard-albums .data-table__title-cell {
  width: 30%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table--dashboard-albums thead th:nth-child(2),
.data-table--dashboard-albums tbody td:nth-child(2) {
  width: 14%;
  white-space: nowrap;
}

.data-table--dashboard-albums .data-table__slug-cell {
  width: 36%;
}

.data-table--dashboard-albums thead th:nth-child(4),
.data-table--dashboard-albums tbody td:nth-child(4) {
  width: 20%;
  white-space: nowrap;
  text-align: right;
}

.data-table--dashboard-albums-no-slug .data-table__title-cell {
  width: 46%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table--dashboard-albums-no-slug thead th:nth-child(2),
.data-table--dashboard-albums-no-slug tbody td:nth-child(2) {
  width: 18%;
  white-space: nowrap;
}

.data-table--dashboard-albums-no-slug thead th:nth-child(3),
.data-table--dashboard-albums-no-slug tbody td:nth-child(3) {
  width: 36%;
  white-space: nowrap;
  text-align: right;
}

.data-table--admin-artists .data-table__name-cell {
  width: 34%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table--admin-artists .data-table__slug-cell {
  width: 46%;
}

.data-table--admin-artists thead th:nth-child(3),
.data-table--admin-artists tbody td:nth-child(3) {
  width: 20%;
  white-space: nowrap;
  text-align: right;
}

.data-table--admin-albums .data-table__title-cell {
  width: 28%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table--admin-albums .data-table__slug-cell {
  width: 36%;
}

.data-table--admin-albums thead th:nth-child(3),
.data-table--admin-albums tbody td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
}

.data-table--admin-albums thead th:nth-child(4),
.data-table--admin-albums tbody td:nth-child(4) {
  width: 22%;
  white-space: nowrap;
  text-align: right;
}

.stack-form label { display: grid; gap: 4px; margin-bottom: 10px; }

.stack-form__field-hint {
  margin: -6px 0 12px;
  font-size: 12px;
  line-height: 1.4;
}

.status-fieldset {
  border: 0;
  margin: 0 0 10px;
  padding: 0;
  min-width: 0;
}

.status-fieldset__legend {
  padding: 0;
  margin-bottom: 6px;
  font: inherit;
  color: var(--fg);
}

.status-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.status-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--fg);
  font-size: 14px;
  user-select: none;
}

.status-radio input {
  accent-color: var(--accent);
  width: 1.05em;
  height: 1.05em;
  margin: 0;
  flex-shrink: 0;
}
.stack-form input,
.stack-form textarea,
.stack-form select {
  background: #08080c;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 8px 10px;
}
.stack-form button,
.stack-form-submit,
.danger-zone button,
table button {
  background: rgba(18, 18, 26, 0.95);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 7px 12px;
  cursor: pointer;
}
.stack-form button,
.stack-form-submit {
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.45);
  color: var(--accent);
}
.stack-form button:hover,
.stack-form-submit:hover {
  border-color: rgba(34, 211, 238, 0.75);
  color: #67e8f9;
}
.danger-zone { margin-top: 14px; }
.danger-zone button { border-color: #7f1d1d; color: #fecaca; }

/* Dashboard stack forms: Save (left) / Delete (right), hr, Back icon (left) */
.dash-form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.dash-form-actions .danger-zone {
  margin-top: 0;
}

.dash-form-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 14px 0 0;
}

.dash-form-back {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 10px 0 0;
  padding: 0;
}

.dash-form-back__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  background: rgba(18, 18, 26, 0.95);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.12);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dash-form-back__btn:hover {
  border-color: rgba(34, 211, 238, 0.75);
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.22);
}

.dash-form-back__btn:active {
  background: rgba(34, 211, 238, 0.15);
}

.dash-form-back__icon {
  display: block;
  flex-shrink: 0;
}

.dash-form-back__label {
  line-height: 1;
}

.errors { color: #fecaca; border: 1px solid #7f1d1d; padding: 8px 12px; border-radius: 3px; }

.album-public__hero { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: start; margin-bottom: 12px; }
.album-public__cover { width: 160px; border-radius: 3px; display: block; border: 1px solid var(--line); }

.player-shell { border: 1px solid var(--line); border-radius: 3px; padding: 10px; background: var(--panel); }
.player-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.seek-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
#seek-bar { width: 100%; }

.track-list { padding-left: 18px; margin: 0; }
.track-item {
  background: none; border: 0; color: var(--accent); cursor: pointer; padding: 2px 0;
  font: inherit; text-align: left; text-shadow: var(--accent-glow);
}

.inline-stack { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inline-label { display: flex; gap: 6px; align-items: center; }

.link-list { margin: 0; padding-left: 18px; }

.dash-greeting {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.dash-greeting__name {
  color: var(--accent);
  text-shadow: var(--accent-glow);
}

.account-detail {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  font-size: 13px;
}
.account-detail dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}
.account-detail dd {
  margin: 0;
}

.account-profile-body {
  margin: 8px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  color: var(--fg);
  max-width: 100%;
  overflow-x: auto;
}

.current-media-block { margin-bottom: 12px; }
.thumb-preview {
  max-width: 220px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 3px;
  border: 1px solid var(--line);
  display: block;
  object-fit: cover;
}
.inline-audio-preview {
  width: 100%;
  max-width: 420px;
  height: 40px;
}

/* --- Public home: admin notices (accordion; align with .main h1) --- */
.home-notices {
  margin: 0 0 22px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.home-notices__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-notice {
  border: none;
}

.home-notice__summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 0 2px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  box-sizing: border-box;
}

.home-notice__head {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.home-notice__toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 3px;
  color: var(--accent);
  background: rgba(18, 18, 26, 0.75);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.14);
  pointer-events: none;
}

.home-notice__icon {
  display: block;
}

.home-notice__icon--collapse {
  display: none;
}

.home-notice[open] .home-notice__icon--expand {
  display: none;
}

.home-notice[open] .home-notice__icon--collapse {
  display: block;
}

.home-notice__summary:hover .home-notice__toggle {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.22);
}

.home-notice__summary::-webkit-details-marker {
  display: none;
}

.home-notice__summary::marker {
  content: "";
}

/* Match .main h1 (Published releases) */
.home-notice__title {
  display: inline;
  font-size: clamp(17px, 2.4vw, 21px);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--violet);
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.28);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.home-notice__subtitle {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-shadow: var(--accent-glow);
}

.home-notice__panel {
  margin: 0;
  padding: 4px 0 10px;
  border: none;
  background: transparent;
}

.home-notice__body {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  word-break: break-word;
  color: var(--muted);
  background: transparent;
  border: none;
  border-radius: 0;
  max-height: 40vh;
  overflow: auto;
}

.home-notice__body strong {
  font-weight: 400;
  font-size: inherit;
  color: #fde68a;
  text-shadow: none;
}

.home-notice__link {
  color: #949db3;
  text-decoration: none;
  text-shadow: none;
  border-bottom: 1px dashed rgba(148, 157, 179, 0.55);
}

.home-notice__link:hover {
  color: #b8c0d4;
  border-bottom-color: rgba(184, 192, 212, 0.65);
}

@media (max-width: 640px) {
  .album-public__hero { grid-template-columns: 1fr; }
  .album-public__cover { width: 100%; max-width: 240px; }
}
