:root {
  --bg: #f3f5f8;
  --ink: #1c2430;
  --muted: #66758a;
  --card: #ffffff;
  --line: #e3e8ef;
  --accent: #1f6feb;
  --accent-dark: #1558c0;
  --accent-soft: #e8f1ff;
  --ok: #1a7f4b;
  --danger: #c62828;
  --shadow: 0 8px 24px rgba(28, 36, 48, 0.06);
  --radius: 12px;
  --font: "Segoe UI", "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

.page-bg { display: none; }

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: .45rem .7rem;
  border-radius: 8px;
}
.nav a:hover, .nav a.active { color: var(--accent); background: var(--accent-soft); }
.userbox { margin-left: auto; display: flex; align-items: center; gap: .65rem; color: var(--muted); font-size: .9rem; }

.main { width: min(1400px, calc(100% - 1.5rem)); margin: 1rem auto 3rem; }

.list-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.list-bar-left, .list-bar-right {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}
.list-bar-form {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-wrap: wrap;
}
.list-bar-form input[type="text"] { width: 140px; }
.list-bar-form select { width: auto; min-width: 110px; }

.pref-strip { margin-bottom: .75rem; padding: .65rem .85rem; }
.pref-list.horizontal {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0;
}
.pref-list.horizontal li {
  max-width: 280px;
  flex: 0 1 auto;
}

.robot-layout { display: block; }
.results-panel { margin-top: .75rem; }

.filter-card { margin-bottom: 0; }

.footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 1.25rem; }

.hero-strip { display: none; }

.panel, .side-panel, .auth-card, .stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel, .side-panel { padding: 1rem 1.1rem; }

.robot-page { display: grid; gap: 1rem; }
.filter-card h2, .results-toolbar h2 {
  margin: 0 0 .85rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.filter-form { display: grid; gap: .75rem; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
}
.filter-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .75rem;
}
@media (max-width: 1000px) {
  .filter-grid, .filter-grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .filter-grid, .filter-grid-3 { grid-template-columns: 1fr; }
}

label { display: grid; gap: .3rem; font-size: .86rem; }
label > span, .label { color: var(--muted); font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(31,111,235,.25); border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .55rem 1rem;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline {
  background: #fff;
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-small {
  width: 32px; height: 32px; padding: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}
.btn-tiny { padding: .2rem .45rem; font-size: .78rem; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.btn-tiny.danger { color: var(--danger); }
.btn-tiny.js-pasif-kayit {
  border-color: #f0b4b4;
  color: var(--danger);
  background: #fff;
  white-space: nowrap;
}
.btn-tiny.js-pasif-kayit:hover {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}

.btn.btn-add {
  background: var(--accent);
  color: #fff !important;
  border-color: var(--accent);
  border-radius: 8px;
  padding: .4rem .7rem;
  font-size: .82rem;
  white-space: nowrap;
  gap: .35rem;
  opacity: 1;
  visibility: visible;
}
.btn.btn-add .plus {
  display: inline-grid;
  place-items: center;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  background: rgba(255,255,255,.25);
  font-weight: 700;
}
.btn.btn-add:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff !important;
}
.btn.btn-add:disabled { opacity: .6; cursor: wait; }

.filter-actions { display: flex; gap: .5rem; align-items: end; padding-top: 1.15rem; }
.range-row { display: flex; gap: .4rem; }
.range-row input { width: 100%; }

/* Checkbox'lı çoklu seçim (YÖK Atlas tarzı) */
.ms { position: relative; }
.ms-control {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
  font: inherit;
  color: var(--text, #1f2933);
  cursor: pointer;
  text-align: left;
}
.ms-control:hover { border-color: #b9c2cc; }
.ms.open .ms-control { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(25,118,210,.12); }
.ms-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-label.is-placeholder { color: #8a95a1; }
.ms-control.has-value .ms-label { color: var(--accent); font-weight: 600; }
.ms-caret {
  flex: 0 0 auto;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #8a95a1;
  transition: transform .15s;
}
.ms.open .ms-caret { transform: rotate(180deg); }
.ms-panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: .5rem;
}
.ms-search-wrap { margin-bottom: .4rem; }
.ms-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: .45rem .6rem;
  font: inherit;
}
.ms-search:focus { outline: none; border-color: var(--accent); }
.ms-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .15rem .4rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: .3rem;
}
.ms-count { font-size: .8rem; color: var(--muted, #667); }
.ms-clear {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: .82rem;
  cursor: pointer;
  padding: .1rem .3rem;
}
.ms-clear:hover { text-decoration: underline; }
.ms-options { max-height: 260px; overflow-y: auto; }
.ms-option {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .45rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: .9rem;
}
.ms-option[hidden],
.ms-option.ms-hidden { display: none !important; }
.ms-empty {
  padding: .6rem .45rem;
  color: var(--muted, #667);
  font-size: .88rem;
  text-align: center;
}
.ms-option:hover { background: #f2f6fb; }
.ms-option input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--accent); }
.ms-option span { overflow: hidden; text-overflow: ellipsis; }

.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: .75rem; }
.alert-error { background: #fdecea; color: var(--danger); }
.alert-ok { background: #e8f6ee; color: var(--ok); }

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.toolbar-left, .toolbar-right { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg button {
  border: 0;
  background: #fff;
  padding: .45rem .8rem;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button.active { background: var(--accent); color: #fff; }
.quick-search {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}
.quick-search input[type="search"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .7rem;
  min-width: 260px;
  font-size: .9rem;
}
.quick-search input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(25, 118, 210, .12);
}
.quick-count { font-size: .8rem; color: var(--muted, #667); white-space: nowrap; }
#search-btn .btn-spin[hidden] { display: none; }
#search-btn .btn-spin:not([hidden]) { display: inline-block; }
#search-btn:disabled { opacity: .7; cursor: progress; }
.list-badge {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: .45rem .85rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}
.list-badge .count {
  background: #e53935;
  border-radius: 999px;
  min-width: 1.3rem;
  height: 1.3rem;
  display: inline-grid;
  place-items: center;
  font-size: .75rem;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: .7rem .65rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th {
  background: #f7f9fc;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #f8fbff; }
.cell-strong { font-weight: 700; }
.cell-soft { color: var(--muted); font-size: .82rem; margin-top: .15rem; }
.muted { color: var(--muted); }
.result-meta { color: var(--muted); margin: 0 0 .65rem; font-size: .9rem; }
.empty-hint { color: var(--muted); padding: 1.5rem 0; text-align: center; }
.pager { display: flex; gap: .75rem; align-items: center; margin-top: 1rem; flex-wrap: wrap; }
.per-page-wrap {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-right: .5rem;
  font-size: .88rem;
  color: var(--muted);
}
.per-page-wrap input {
  width: 72px;
  padding: .35rem .45rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: inherit;
}

.robot-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 980px) {
  .robot-layout { grid-template-columns: 1fr; }
}

.pref-list { list-style: none; padding: 0; margin: .75rem 0; display: grid; gap: .5rem; }
.pref-list li {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  padding: .65rem .7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.pref-main { display: flex; gap: .5rem; min-width: 0; }
.pref-actions { display: flex; gap: .2rem; align-items: start; }
.side-panel h2, .panel h2 { margin: 0 0 .75rem; font-size: 1.05rem; }
.side-panel hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

.stack { display: grid; gap: .75rem; }
.stack.tight { gap: .5rem; }
.two-col { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.wide-left { grid-template-columns: 2fr 1fr; }
@media (max-width: 800px) { .two-col, .wide-left { grid-template-columns: 1fr; } }

.list-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.list-cards li a, .list-cards li {
  display: grid;
  gap: .15rem;
  padding: .75rem .9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-bottom: 1rem; }
.stat { padding: .9rem 1rem; }
.stat span { color: var(--muted); display: block; margin-bottom: .2rem; font-size: .85rem; }
.stat strong { font-size: 1.4rem; }

.auth-wrap { display: grid; place-items: center; min-height: 70vh; }
.auth-card { width: min(420px, 100%); padding: 1.75rem; }
.auth-card h1 { margin: 0 0 .5rem; font-size: 1.6rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .72rem; color: var(--accent); font-weight: 700; margin: 0 0 .4rem; }
.lead { color: var(--muted); }
.hint { margin-top: 1rem; color: var(--muted); font-size: .88rem; }
.hint ul { padding-left: 1.1rem; }
.auth-switch {
  margin: 1.1rem 0 0;
  text-align: center;
  color: var(--muted);
  font-size: .92rem;
}
.auth-switch a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.username-field { display: grid; gap: .35rem; }
.username-input-wrap { position: relative; }
.username-input-wrap input { padding-right: 2.2rem; width: 100%; box-sizing: border-box; }
.username-icon {
  position: absolute;
  right: .7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: .95rem;
  font-weight: 700;
  pointer-events: none;
  color: var(--muted);
}
.username-icon.is-ok { color: var(--ok, #1b7a3d); }
.username-icon.is-err { color: var(--danger, #c62828); }
.username-icon.is-loading { color: var(--muted); }
.username-status {
  min-height: 1.1em;
  font-size: .85rem;
  color: var(--muted);
}
.username-status.is-ok { color: var(--ok, #1b7a3d); }
.username-status.is-err { color: var(--danger, #c62828); }
.username-status.is-loading { color: var(--muted); }
.username-field input:focus { outline: none; }
.username-field:has(.is-ok) input { border-color: var(--ok, #1b7a3d); }
.username-field:has(.is-err) input { border-color: var(--danger, #c62828); }
code { background: #eef2f7; padding: .1rem .35rem; border-radius: 4px; }

.toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  padding: .75rem 1rem; border-radius: 8px; background: #1c2430; color: #fff;
  box-shadow: var(--shadow); max-width: min(340px, calc(100% - 2rem));
}
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

.bulk-bar {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  margin: 0 0 .75rem; padding: .55rem .7rem;
  border: 1px solid var(--line); border-radius: 8px; background: #f7f9fc;
}
.check { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .86rem; }
.row-mini-actions { display: flex; gap: .3rem; margin-top: .3rem; flex-wrap: wrap; }
.kont-cell { font-size: .82rem; white-space: nowrap; }
tr.is-pasif { opacity: .4; background: #fff5f5; }
.user-edit {
  border: 1px solid var(--line); border-radius: 8px;
  padding: .7rem .9rem; margin-bottom: .55rem; background: #fff;
}
.user-edit summary { cursor: pointer; display: flex; gap: .65rem; align-items: baseline; flex-wrap: wrap; }
.inline-form { display: inline; }

/* Choices overrides — compact combobox look */
.choices { margin-bottom: 0; font-size: .9rem; }
.choices__inner {
  border-radius: 8px !important;
  border: 1px solid var(--line) !important;
  min-height: 38px !important;
  padding: 4px 8px !important;
  background: #fff !important;
}
.choices__list--dropdown, .choices__list[aria-expanded] {
  border-radius: 8px !important;
  border-color: var(--line) !important;
  z-index: 40 !important;
}
.choices__list--multiple .choices__item {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  border-radius: 6px !important;
  font-size: .8rem;
}
.choices[data-type*="select-multiple"] .choices__inner { min-height: 38px; }
.choices__placeholder { opacity: .7; }
.meta-inline { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
.pill {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 999px;
  padding: .25rem .65rem;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
}
.pill.warn { background: #fff3e0; color: #c45c00; }

.detail-only { display: none; }
body.view-detail .detail-only { display: block; }
body.view-detail .summary-only { display: none; }

.prog-cell .fakulte { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; }
.prog-cell .adi { font-weight: 700; margin-top: .1rem; }
.prog-cell .sure { color: var(--muted); font-size: .82rem; }

/* ---- Sürükle-bırak ---- */
.dnd-handle {
  flex: 0 0 auto;
  border: 0;
  background: #eef2f7;
  color: #6b7a8d;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  cursor: grab;
  font-size: .95rem;
  line-height: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.dnd-handle:active { cursor: grabbing; background: var(--accent-soft); color: var(--accent); }
.dnd-dragging {
  opacity: .95;
  background: #fff !important;
  border-color: var(--accent) !important;
}
.dnd-placeholder {
  border: 2px dashed var(--accent) !important;
  background: var(--accent-soft) !important;
  border-radius: 8px;
  min-height: 48px;
  list-style: none;
}
.dnd-hint {
  margin: 0 0 .75rem;
  color: var(--muted);
  font-size: .88rem;
}
.dnd-hint.tight { margin: 0 0 .45rem; font-size: .82rem; }

.pref-list li {
  align-items: center;
}
.pref-list .dnd-handle { margin-right: .15rem; }
.pref-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .65rem;
  margin-top: .35rem;
  font-size: .8rem;
  color: var(--muted);
}

/* ---- Liste detay sayfası (site ile aynı dil) ---- */
.list-page {
  display: grid;
  gap: 1rem;
}
.lp-head { margin-bottom: 0; }
.lp-title {
  display: block;
  font-size: 1.15rem;
  color: var(--ink);
}
.lp-board { margin: 0; }
.lp-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}
.lp-item {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: .65rem;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.lp-item:hover {
  background: #f8fbff;
  border-color: #d0dae8;
}
.lp-handle.dnd-handle {
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  display: grid;
  place-content: center;
  gap: 3px;
  color: transparent;
  font-size: 0;
}
.lp-handle.dnd-handle span {
  display: block;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
}
.lp-handle.dnd-handle:hover {
  background: var(--accent-soft);
  border-color: #b7cef5;
}
.lp-handle.dnd-handle:hover span { background: var(--accent); }

.lp-rank {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
}
.lp-content { min-width: 0; }
.lp-program { font-size: .98rem; }
.lp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-top: .45rem;
}
.lp-tags .pill {
  margin: 0;
}
.lp-remove { margin: 0; }
.lp-item.dnd-dragging {
  box-shadow: var(--shadow) !important;
  border-color: var(--accent) !important;
  background: #fff !important;
}
.list-settings h2 {
  margin: 0 0 .85rem;
  font-size: 1.05rem;
}
.lp-settings-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}
.lp-rename-row {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.lp-rename-row input { flex: 1; min-width: 0; }

@media (max-width: 900px) {
  .lp-settings-grid { grid-template-columns: 1fr; }
  .lp-item {
    grid-template-columns: auto auto 1fr;
    grid-template-areas:
      "handle rank remove"
      "content content content";
  }
  .lp-handle { grid-area: handle; }
  .lp-rank { grid-area: rank; }
  .lp-content { grid-area: content; }
  .lp-remove { grid-area: remove; justify-self: end; }
}
@media (max-width: 560px) {
  .lp-rename-row { flex-direction: column; align-items: stretch; }
}

/* ---- Mobil navigasyon ---- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0;
  cursor: pointer;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    padding: .65rem .85rem;
    gap: .5rem;
  }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    gap: .15rem;
    padding: .35rem 0 .15rem;
  }
  body.nav-open .nav { display: flex; }
  .nav a {
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    background: #fff;
  }
  .userbox {
    margin-left: 0;
    order: 2;
  }
  .main { width: calc(100% - 1rem); margin: .75rem auto 2rem; }
  .list-settings-grid,
  .lp-settings-grid { grid-template-columns: 1fr; }
  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-left, .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }
  .quick-search { width: 100%; }
  .quick-search input[type="search"] {
    min-width: 0;
    width: 100%;
  }
  .data-table { font-size: .82rem; }
  .data-table th, .data-table td { padding: .55rem .45rem; }
  .btn.btn-add {
    padding: .35rem .55rem;
    font-size: .78rem;
  }
  .pref-list.horizontal {
    flex-direction: column;
  }
  .pref-list.horizontal li {
    max-width: none;
    width: 100%;
  }
  .list-bar-form input[type="text"] { width: 120px; }
  .stats-row { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .auth-card { width: 100%; padding: 1.25rem; }
  .ms-panel { position: fixed; left: .75rem; right: .75rem; top: auto; max-height: 60vh; }
  .ms-options { max-height: 40vh; }
}

@media (max-width: 560px) {
  .brand { font-size: 1rem; }
  .userbox span { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .filter-actions { flex-wrap: wrap; }
  .filter-actions .btn { flex: 1; justify-content: center; }
  .pager { justify-content: center; }
  .lp-title { font-size: 1.05rem; }
  .lp-head .list-bar-right { width: 100%; }
  .lp-head .list-bar-right .btn { flex: 1; justify-content: center; }
  .pref-meta { gap: .25rem .5rem; }
  th:nth-child(1), td:nth-child(1) { /* keep checkbox */ }
}

@media (hover: none) {
  .dnd-handle { width: 2.4rem; height: 2.4rem; font-size: 1.05rem; }
}

