/* Large, high-contrast and simple — built for comfortable everyday use. */
:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5f5f66;
  --border: #d9d6cf;
  --primary: #b4410f;
  --primary-text: #ffffff;
  --primary-soft: #fbe9df;
  --danger: #b3261e;
  --success-bg: #e3f4e6;
  --success-text: #1f5f2b;
  --error-bg: #fde7e5;
  --error-text: #8c1d18;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --surface: #222226;
    --text: #f2f2f4;
    --muted: #b0b0b8;
    --border: #3a3a40;
    --primary: #f08a4b;
    --primary-text: #17171a;
    --primary-soft: #3a2a20;
    --danger: #ff8a80;
    --success-bg: #1d3524;
    --success-text: #a8e2b4;
    --error-bg: #3d1f1d;
    --error-text: #ffb4ab;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { font-size: 19px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans", "Noto Sans Devanagari", system-ui, sans-serif;
  line-height: 1.55;
}

a { color: var(--primary); }

h1 { font-size: 1.7rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.6rem; }

.container { max-width: 860px; margin: 0 auto; padding: 1.2rem 16px 4rem; }

/* Top bar ---------------------------------------------------------------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.2rem;
  padding: 0.7rem 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 0.3rem; flex: 1; }
.topbar nav a {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}
.topbar nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.logout { margin: 0; }
button.link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }

/* Cards & layout --------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.card.narrow { max-width: 420px; margin: 3rem auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.page-head h1 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.muted, .hint, .meta { color: var(--muted); }
.meta, .hint { font-size: 0.85rem; }
.empty { color: var(--muted); padding: 1rem 0; list-style: none; }

/* Forms ------------------------------------------------------------------ */
.field { margin-bottom: 1.1rem; }
label, .label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.6rem;
}
textarea { min-height: 10rem; resize: vertical; font-size: 1.1rem; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }

.choice-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  margin: 0;
}
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 600; }
.choice.disabled { opacity: 0.4; cursor: not-allowed; }
.choice input { width: 1.2rem; height: 1.2rem; accent-color: var(--primary); }

.errorlist { color: var(--error-text); margin: 0 0 0.5rem; padding-left: 1.2rem; }

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.filters input, .filters select { width: auto; flex: 1 1 10rem; margin: 0; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { flex: 1 1 12rem; width: auto; margin: 0; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  min-height: 2.6rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn-danger { color: var(--danger); }
.btn-big { font-size: 1.2rem; padding: 0.8rem 1.6rem; }
.btn-block { width: 100%; margin-top: 0.5rem; }
.btn-small { min-height: 2rem; padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.btn-icon { min-width: 2.6rem; padding: 0.3rem 0.5rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }

/* Alerts ----------------------------------------------------------------- */
.alert { padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 600; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }

/* Media lists ------------------------------------------------------------ */
.media-list { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.media-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem;
  margin-bottom: 0.6rem;
}
.media-row form { margin: 0; }
.media-row.playing { border: 2px solid var(--primary); background: var(--primary-soft); }
.media-main { flex: 1; min-width: 0; }
.media-title { font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.media-main audio { width: 100%; margin-top: 0.4rem; height: 2.4rem; }
.drag-handle { cursor: grab; font-size: 1.4rem; color: var(--muted); padding: 0 0.3rem; user-select: none; touch-action: none; }
.move-buttons { display: flex; flex-direction: column; gap: 0.25rem; }
.move-buttons .btn { min-height: 2rem; }
.sortable-ghost { opacity: 0.4; }

.big-player { width: 100%; margin-top: 0.8rem; }
.text-block { white-space: normal; font-size: 1.05rem; overflow-wrap: anywhere; }

.playlist-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.playlist-card { display: flex; flex-direction: column; gap: 0.2rem; text-decoration: none; color: var(--text); height: 100%; margin: 0; }
.playlist-card:hover { border-color: var(--primary); }

.checklist { list-style: none; padding: 0; max-height: 22rem; overflow-y: auto; margin: 0 0 1rem; }
.checklist label { font-weight: 400; display: flex; gap: 0.6rem; align-items: center; padding: 0.35rem 0; cursor: pointer; }
.checklist input { width: 1.3rem; height: 1.3rem; flex: none; accent-color: var(--primary); }

details.card summary { cursor: pointer; font-weight: 600; }
details.card form { margin-top: 1rem; }

@media (max-width: 640px) {
  html { font-size: 17px; }
  .media-row { flex-wrap: wrap; }
  .topbar { justify-content: space-between; }
  .topbar nav { order: 3; flex-basis: 100%; }
}
