:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #5d6470;
  --paper: #fffaf3;
  --panel: #ffffff;
  --line: #dad7ce;
  --soft-line: #ebe6db;
  --accent: #136f63;
  --accent-strong: #0b5148;
  --blue: #1f5d9e;
  --rose: #b34163;
  --shadow: 0 10px 30px rgb(50 42 31 / 8%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.remote-shell,
.admin-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.text-link {
  color: var(--accent-strong);
  font-weight: 750;
  text-underline-offset: 4px;
}

.brand {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1;
}

.status {
  color: var(--muted);
  font-size: 18px;
}

.screen {
  display: grid;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.current-photo {
  display: grid;
  grid-template-columns: minmax(180px, 38%) 1fr;
  gap: 20px;
  align-items: center;
}

.current-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #111;
  border-radius: 6px;
}

.photo-number {
  font-size: clamp(48px, 10vw, 92px);
  font-weight: 800;
  line-height: 1;
}

.photo-title {
  margin-top: 8px;
  color: var(--muted);
  font-size: 24px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.controls.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
}

.button {
  min-height: 88px;
  border: 0;
  border-radius: 8px;
  padding: 18px;
  color: white;
  background: var(--accent);
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 800;
  cursor: pointer;
}

.button:active {
  transform: translateY(1px);
}

.button.secondary {
  background: var(--blue);
}

.button.rose {
  background: var(--rose);
}

.button.compact {
  min-height: 54px;
  padding: 12px 16px;
  font-size: 18px;
}

.button.mini {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 14px;
  font-weight: 800;
}

.tag-grid,
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.spotify-embed-shell {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #121212;
}

.spotify-embed {
  width: 100%;
  height: 352px;
  border: 0;
  display: block;
}

.number-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.number-form input {
  min-height: 70px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 18px;
  font-size: 30px;
}

.section-title {
  margin: 0 0 14px;
  font-size: 24px;
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.viewer {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #050505;
  color: #fff;
}

.viewer-photo {
  width: 100vw;
  height: 100vh;
  object-fit: contain;
  display: block;
}

.viewer-badge {
  position: fixed;
  right: 28px;
  bottom: 24px;
  min-width: 110px;
  border-radius: 8px;
  padding: 14px 18px;
  background: rgb(0 0 0 / 72%);
  color: white;
  font-size: clamp(34px, 6vw, 72px);
  font-weight: 900;
  text-align: center;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.stat-panel {
  min-height: 150px;
}

.import-panel input[type="file"] {
  width: 100%;
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fbfaf7;
}

.admin-section {
  margin-top: 20px;
}

.stack,
.inline-form,
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

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

.inline-form input,
.toolbar select {
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: white;
}

.inline-form input {
  flex: 1;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tag-manager {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tag-editor {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 110px auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfaf7;
}

.tag-editor input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: white;
}

.tag-count {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.tag-item {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: white;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.photo-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 24px rgb(50 42 31 / 7%);
}

.photo-select {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 0;
  color: var(--muted);
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #111;
  display: block;
}

.photo-card-body,
.tag-checks {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.photo-card-body span {
  min-height: 38px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tag-checks {
  border-top: 1px solid var(--soft-line);
}

.tag-check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  line-height: 1.25;
}

.metric {
  font-size: 44px;
  font-weight: 850;
}

@media (max-width: 720px) {
  .remote-shell,
  .admin-shell {
    padding: 16px;
  }

  .current-photo,
  .controls,
  .number-form,
  .inline-form,
  .toolbar,
  .tag-editor {
    grid-template-columns: 1fr;
  }

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

  .section-heading {
    display: block;
  }
}
