:root {
  --bg: #101114;
  --surface: #181a20;
  --surface-2: #20232b;
  --surface-3: #272b34;
  --text: #f6f2ea;
  --muted: #a9a39a;
  --stroke: rgba(246, 242, 234, .12);
  --accent: #2f9e8f;
  --accent-2: #e55b5b;
  --danger: #f05d6a;
  --shadow: 0 18px 48px rgba(0, 0, 0, .28);
  color-scheme: dark;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

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

button {
  cursor: pointer;
}

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 14px 90px;
}

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

h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.iconBtn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 22px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.heroText span,
.muted,
.hint,
.sub {
  color: var(--muted);
}

.primary {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow: auto;
  padding: 8px 0 14px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs button,
.pillRow button,
.ratingRow button {
  min-height: 38px;
  white-space: nowrap;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
}

.tabs button.active,
.pillRow button.active,
.ratingRow button.active {
  background: rgba(47, 158, 143, .22);
  border-color: rgba(47, 158, 143, .8);
}

.filters {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  margin-bottom: 14px;
}

.viewSwitch {
  display: grid;
  grid-template-columns: 42px 42px;
  gap: 6px;
}

.viewSwitch button {
  display: grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-2);
  font-size: 18px;
}

.viewSwitch button.active {
  border-color: rgba(47, 158, 143, .85);
  background: rgba(47, 158, 143, .22);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--stroke);
  color: var(--text);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px 13px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 158, 143, .85);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

select {
  min-width: 132px;
}

.grid,
.grid.gridCards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 13px;
}

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

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--status-color, var(--accent));
}

.status-plan {
  --status-color: #e0a94f;
}

.status-watching {
  --status-color: #2f9e8f;
}

.status-watched {
  --status-color: #6bbf59;
}


.status-plan .statusChip {
  background: rgba(224, 169, 79, .18);
}

.status-watching .statusChip {
  background: rgba(47, 158, 143, .2);
}

.status-watched .statusChip {
  background: rgba(107, 191, 89, .18);
}


.ratingChip {
  background: rgba(255, 255, 255, .13);
}

.grid.list .card {
  display: grid;
  grid-template-columns: 76px 1fr;
  min-height: 116px;
}

.grid.list .poster {
  width: 76px;
  min-height: 116px;
  aspect-ratio: auto;
  font-size: 22px;
}

.grid.list .cardBody {
  display: grid;
  align-content: center;
  padding: 10px 12px;
}

.grid.list .card .sub {
  min-height: 0;
}

.grid.list .quickActions {
  justify-content: flex-start;
}

.grid.list .quickActions button {
  flex: 0 1 auto;
  min-width: 94px;
}

.poster {
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #2f9e8f, #e55b5b);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 38px;
  font-weight: 900;
  text-align: center;
  padding: 12px;
}

.cardBody {
  padding: 11px;
}

.card h3 {
  margin: 6px 0 4px;
  font-size: 15px;
  line-height: 1.2;
}

.card .sub {
  margin: 0;
  min-height: 28px;
  font-size: 12px;
  line-height: 1.25;
}

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

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.chip {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-2);
}

.quickActions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.quickActions button {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--stroke);
  color: var(--text);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px 7px;
  font-size: 12px;
}

.quickActions button.primaryMini {
  background: rgba(47, 158, 143, .24);
}

.empty {
  padding: 30px 10px;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .58);
  z-index: 20;
}

.sheet {
  width: 100%;
  max-height: 91vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow);
  padding: 16px;
}

.sheetHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sheetHead h2 {
  margin: 0 0 12px;
}

.searchBox {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

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

.result {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px;
  text-align: left;
  color: var(--text);
}

.result:hover,
.card:hover,
.viewSwitch button:hover,
.quickActions button:hover {
  border-color: rgba(246, 242, 234, .24);
}

.resultPoster {
  width: 56px;
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  background: linear-gradient(135deg, #2f9e8f, #e55b5b);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.result h3 {
  margin: 0;
  font-size: 15px;
}

.result p {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.editHeader {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  align-items: center;
  margin: 6px 0 14px;
}

.smallPoster {
  width: 74px;
  border-radius: 8px;
  overflow: hidden;
}

.editHeader h3 {
  margin: 0 0 4px;
}

label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 14px 0 7px;
}

.pillRow,
.ratingRow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ratingRow button {
  min-width: 48px;
}

.twoCols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.wide {
  flex: 1;
}

.danger {
  border: 1px solid rgba(240, 93, 106, .55);
  color: white;
  background: rgba(240, 93, 106, .24);
  border-radius: 8px;
  padding: 12px 16px;
}

@media (min-width: 760px) {
  .modal {
    align-items: center;
    justify-content: center;
  }

  .sheet {
    max-width: 680px;
    border-radius: 8px;
  }
}

@media (max-width: 420px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  h1 {
    font-size: 28px;
  }

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

  .filters,
  .searchBox {
    grid-template-columns: 1fr;
  }

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

  .grid.list .card {
    grid-template-columns: 68px 1fr;
  }

  .grid.list .poster {
    width: 68px;
    min-height: 104px;
  }
}

.manualResult {
  border-style: dashed;
  opacity: .92;
}
