:root {
  color-scheme: light;
  --page-bg: #f8f6f2;
  --panel-bg: rgba(255, 255, 255, 0.95);
  --text: #30272a;
  --muted: #6e6265;
  --accent: #705063;
  --border: rgba(73, 53, 48, 0.16);
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(248, 246, 242, 0.86), rgba(248, 246, 242, 0.94)),
    url("background.jpg") center / cover fixed;
}

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

.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 10px max(24px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-family: "Crimson Pro", Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 7px;
  object-fit: cover;
}

.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.dashboard-main {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 46px 0 80px;
}

.intro {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Crimson Pro", Georgia, serif;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 6vw, 46px);
  font-weight: 400;
}

.intro > p:last-child,
.muted,
.auth-panel > p {
  color: var(--muted);
  line-height: 1.6;
}

.panel {
  padding: clamp(20px, 5vw, 34px);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel-bg);
  box-shadow: 0 18px 50px rgba(57, 40, 42, 0.1);
}

.panel h2 {
  margin-bottom: 8px;
  font-size: 27px;
  font-weight: 500;
}

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

.panel-heading p {
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stack > * {
  min-width: 0;
}

.stack + .stack,
.conditional {
  margin-top: 18px;
}

label,
legend {
  font-size: 13px;
  font-weight: 600;
}

input:not([type="radio"]):not([type="file"]),
select,
textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: auto;
  resize: vertical;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(112, 80, 99, 0.12);
}

input[type="file"] {
  max-width: 100%;
  padding: 8px 0;
  color: var(--muted);
}

.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.date-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.selected-author {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.selected-author img {
  width: 38px;
  height: 38px;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 35%;
  box-shadow: 0 2px 8px rgba(48, 39, 42, 0.16);
}

.search-row,
.button-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
}

.button {
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s, transform 0.2s;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button.primary {
  background: var(--accent);
  color: #fff;
}

.button.primary:hover:not(:disabled) {
  background: #5f4053;
}

.button.secondary {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
}

.save-button {
  width: 100%;
  margin-top: 12px;
}

.status {
  min-height: 1.2em;
  margin: 0;
  color: var(--accent);
  font-size: 13px;
  line-height: 1.5;
}

.status.error {
  color: #a32946;
}

.search-results {
  display: grid;
  gap: 8px;
}

.search-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.search-result p {
  margin: 4px 0 0;
}

.entry-management-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.entry-management-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.entry-management-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.entry-management-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.entry-management-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.entry-management-byline {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.entry-management-photo {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 1px solid var(--border);
  border-radius: 50%;
  object-fit: cover;
  object-position: center 35%;
}

.entries-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.entries-pagination .button {
  min-height: 36px;
  padding: 7px 12px;
}

.button.danger {
  flex-shrink: 0;
  border-color: rgba(163, 41, 70, 0.24);
  background: #fff;
  color: #a32946;
}

.button.danger:hover:not(:disabled) {
  background: rgba(163, 41, 70, 0.06);
}

.playlist-editor {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.playlist-editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

.playlist-editor-info {
  min-width: 0;
  overflow-wrap: anywhere;
}

.playlist-editor-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.playlist-editor-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.playlist-editor-actions .button {
  min-width: 40px;
  padding: 8px 10px;
}

@media (max-width: 520px) {
  .entry-management-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-management-actions {
    width: 100%;
  }

  .playlist-editor-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.selected-review {
  padding: 13px;
  border: 1px solid rgba(112, 80, 99, 0.25);
  border-radius: 9px;
  background: rgba(112, 80, 99, 0.06);
  line-height: 1.5;
}

.rating-input {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rating-choice {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.rating-choice:has(input:checked) {
  border-color: var(--accent);
  background: rgba(112, 80, 99, 0.08);
}

.rating-choice input {
  accent-color: var(--accent);
}

.mode-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.mode-picker legend {
  padding: 0 5px;
}

.mode-picker label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.mode-picker input {
  accent-color: var(--accent);
}

audio {
  width: 100%;
}

[hidden] {
  display: none !important;
}

@media (max-width: 560px) {
  .dashboard-header {
    padding-right: 16px;
    padding-left: 16px;
  }

  .brand {
    font-size: 18px;
  }

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

  .panel-heading {
    align-items: flex-start;
  }

  .search-result {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-main {
    width: min(100% - 24px, 760px);
    padding-top: 28px;
  }

  .panel {
    padding: 18px;
  }

  .button-row,
  .search-row {
    flex-direction: column;
  }

  .search-row .button {
    width: 100%;
  }

  .entries-pagination {
    gap: 8px;
  }

  .playlist-editor-actions {
    width: 100%;
  }
}
