#tsunami-root {
  color-scheme: dark;
  --bg: #0e1218;
  --surface: #151b24;
  --raised: #1c2531;
  --line: #293342;
  --text: #e3e9f0;
  --muted: #91a0b4;
  --accent: #8adbc6;
  --amber: #e9bb76;
  --error: #f29a98;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
:where(#tsunami-root) * {
  box-sizing: border-box;
}
body {
  margin: 0;

  background: #0e1218;
}
:where(#tsunami-root) button,
:where(#tsunami-root) input,
:where(#tsunami-root) select {
  font: inherit;
}
:where(#tsunami-root) button,
:where(#tsunami-root) a,
:where(#tsunami-root) input,
:where(#tsunami-root) select {
  touch-action: manipulation;
}
:where(#tsunami-root) button {
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  padding: 9px 13px;
  font-weight: 550;
  white-space: nowrap;
}
:where(#tsunami-root) button:disabled {
  cursor: default;
  opacity: 0.5;
}
:where(#tsunami-root) button:hover:not(:disabled) {
  background: var(--raised);
}
:where(#tsunami-root) input,
:where(#tsunami-root) select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 6px;
  min-width: 0;
}
:where(#tsunami-root) input::placeholder {
  color: #748298;
}
:where(#tsunami-root) input:focus,
:where(#tsunami-root) select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px #8adbc619;
}
:where(#tsunami-root) :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
:where(#tsunami-root) [hidden] {
  display: none !important;
}
:where(#tsunami-root) a {
  color: inherit;
  text-decoration: none;
}
:where(#tsunami-root) .muted {
  color: var(--muted);
}
:where(#tsunami-root) .primary {
  background: var(--accent);
  color: #092b24;
  border-color: var(--accent);
}
:where(#tsunami-root) .primary:hover:not(:disabled) {
  background: #a6ecd9;
}
:where(#tsunami-root) .primary span {
  margin-left: 12px;
  opacity: 0.65;
}
:where(#tsunami-root) .quiet {
  background: var(--surface);
  border-color: var(--line);
  color: var(--muted);
}
:where(#tsunami-root) .icon {
  font-size: 20px;
  padding: 4px 10px;
  color: var(--muted);
}
:where(#tsunami-root) .warning {
  color: var(--amber);
}
:where(#tsunami-root) .boot {
  padding: 40px;
  color: var(--muted);
}
:where(#tsunami-root) .boot:empty {
  display: none;
}
:where(#tsunami-root) .topbar {
  height: 68px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 38px;
  padding: 0 32px;
  background: #10151d;
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
:where(#tsunami-root) .brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
  font-weight: 760;
  letter-spacing: -0.8px;
}
:where(#tsunami-root) .brand-mark {
  font-size: 42px;
  color: var(--accent);
  font-weight: 400;
  line-height: 1;
}
:where(#tsunami-root) .tag {
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1.2px;
  padding: 4px 5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-left: 3px;
}
:where(#tsunami-root) .topbar nav {
  display: flex;
  align-self: stretch;
  gap: 8px;
}
:where(#tsunami-root) .topbar nav button {
  position: relative;
  color: var(--muted);
  border-radius: 0;
  padding: 0 12px;
}
:where(#tsunami-root) .topbar nav button.active {
  color: var(--text);
}
:where(#tsunami-root) .topbar nav button.active:after {
  content: "";
  position: absolute;
  bottom: -1px;
  height: 2px;
  left: 12px;
  right: 12px;
  background: var(--accent);
}
:where(#tsunami-root) .count {
  background: var(--raised);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  margin-left: 5px;
}
:where(#tsunami-root) .account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
:where(#tsunami-root) #account-button {
  color: var(--muted);
  font-size: 12px;
}
:where(#tsunami-root) main {
  max-width: 1440px;
  margin: auto;
  padding: 28px 32px;
  min-height: calc(100dvh - 114px);
}
:where(#tsunami-root) .searchbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 7px 8px 7px 16px;
}
:where(#tsunami-root) .search-symbol {
  font-size: 30px;
  line-height: 1;
  color: var(--muted);
}
:where(#tsunami-root) .searchbar input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 8px 0;
  box-shadow: none;
}
:where(#tsunami-root) .searchbar:focus-within {
  border-color: #648d85;
}
:where(#tsunami-root) .searchbar .primary {
  min-height: 40px;
}
:where(#tsunami-root) .filters {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 28px;
}
:where(#tsunami-root) .filters label {
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted);
}
:where(#tsunami-root) .filters input,
:where(#tsunami-root) .filters select {
  font-size: 12px;
  padding: 7px 10px;
  background: var(--surface);
}
:where(#tsunami-root) .filters input {
  width: 155px;
}
:where(#tsunami-root) .filters .quiet {
  font-size: 11px;
  padding: 7px 9px;
  background: none;
  border: 0;
}
:where(#tsunami-root) .sectionbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 13px;
  gap: 12px;
  min-height: 32px;
}
:where(#tsunami-root) .sectionbar > div {
  display: flex;
  align-items: center;
  gap: 13px;
}
:where(#tsunami-root) .sectionbar strong {
  font-size: 13px;
}
:where(#tsunami-root) .sectionbar .muted {
  font-size: 11px;
}
:where(#tsunami-root) .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
:where(#tsunami-root) table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
:where(#tsunami-root) th {
  background: var(--surface);
  text-align: left;
  font-weight: 500;
  border-bottom: 1px solid var(--line);
}
:where(#tsunami-root) th button {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 16px;
}
:where(#tsunami-root) th button span {
  color: var(--accent);
}
:where(#tsunami-root) td {
  padding: 13px 16px;
  border-bottom: 1px solid #222c38;
}
:where(#tsunami-root) tr:last-child td {
  border-bottom: 0;
}
:where(#tsunami-root) tbody tr:hover,
:where(#tsunami-root) tbody tr.selected {
  background: #18222c;
}
:where(#tsunami-root) .numeric {
  font-variant-numeric: tabular-nums;
  text-align: right;
  width: 96px;
}
:where(#tsunami-root) .numeric button {
  padding-left: 6px;
  padding-right: 16px;
}
:where(#tsunami-root) .action-col {
  width: 68px;
  text-align: right;
  padding-left: 0;
}
:where(#tsunami-root) .release-cell {
  min-width: 0;
}
:where(#tsunami-root) .title-text {
  font-size: 13px;
  font-weight: 530;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
:where(#tsunami-root) .release-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
:where(#tsunami-root) .release-tags span {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.4;
  color: #98a6ba;
  background: #202a36;
  padding: 2px 5px;
  border-radius: 3px;
}
:where(#tsunami-root) .release-tags .group-tag {
  background: transparent;
  color: #82c6b7;
  padding-left: 3px;
}
:where(#tsunami-root) .size-cell {
  white-space: nowrap;
  font-size: 12px;
}
:where(#tsunami-root) .seeds {
  color: #91c5b2;
  font-size: 12px;
}
:where(#tsunami-root) .peers {
  font-size: 12px;
}
:where(#tsunami-root) .download {
  background: #18332e;
  color: var(--accent);
  border: 1px solid #295147;
  font-size: 20px;
  line-height: 1;
  min-width: 35px;
  padding: 8px;
}
:where(#tsunami-root) .download:hover:not(:disabled) {
  background: #245043;
}
:where(#tsunami-root) .download.added {
  border-color: transparent;
  background: transparent;
  font-size: 16px;
}
:where(#tsunami-root) .empty {
  padding: 80px 20px 100px;
  text-align: center;
  color: var(--muted);
}
:where(#tsunami-root) .empty-mark {
  display: inline-block;
  font-size: 48px;
  color: #496071;
  line-height: 1.2;
}
:where(#tsunami-root) .empty h1,
:where(#tsunami-root) .empty h2 {
  font-size: 18px;
  font-weight: 570;
  color: #bccad7;
  margin: 20px 0 10px;
}
:where(#tsunami-root) .empty p {
  font-size: 12px;
  line-height: 1.6;
}
:where(#tsunami-root) .chip {
  font-size: 11px;
  margin-top: 12px;
  border-color: var(--line);
  color: var(--muted);
  white-space: normal;
  max-width: 100%;
}
:where(#tsunami-root) .chip span {
  margin-left: 8px;
  color: var(--accent);
}
:where(#tsunami-root) .download-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 12px;
}
:where(#tsunami-root) .download-heading {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: space-between;
}
:where(#tsunami-root) .status-pill {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--raised);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
:where(#tsunami-root) .status-pill.running {
  background: #193a30;
  color: var(--accent);
}
:where(#tsunami-root) progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  margin: 17px 0;
  background: #293442;
}
:where(#tsunami-root) progress::-webkit-progress-bar {
  background: #293442;
}
:where(#tsunami-root) progress::-webkit-progress-value {
  background: var(--accent);
}
:where(#tsunami-root) progress::-moz-progress-bar {
  background: var(--accent);
}
:where(#tsunami-root) .download-details {
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
:where(#tsunami-root) .download-details strong {
  color: var(--text);
}
:where(#tsunami-root) .download-details .quiet {
  padding: 5px 10px;
  font-size: 11px;
}
:where(#tsunami-root) .speed-down {
  color: var(--accent);
}
:where(#tsunami-root) .requester {
  margin-left: 0;
}
:where(#tsunami-root) .inline-warning {
  color: var(--amber);
  font-size: 12px;
  line-height: 1.6;
}
:where(#tsunami-root) .users-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
:where(#tsunami-root) .user-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
:where(#tsunami-root) .user-row:last-child {
  border: 0;
}
:where(#tsunami-root) .user-row strong {
  min-width: 100px;
}
:where(#tsunami-root) .user-row button {
  margin-left: auto;
}
:where(#tsunami-root) .avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #20362f;
  color: var(--accent);
  font-size: 11px;
}
:where(#tsunami-root) .connection-panel {
  margin-top: 30px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
}
:where(#tsunami-root) .connection-panel p {
  font-size: 11px;
  overflow-wrap: anywhere;
}
:where(#tsunami-root) .login {
  width: min(360px, calc(100% - 40px));
  margin: 14vh auto;
}
:where(#tsunami-root) .login .brand {
  margin-bottom: 38px;
}
:where(#tsunami-root) .login form {
  display: grid;
  gap: 17px;
}
:where(#tsunami-root) .login .primary {
  width: 100%;
  display: flex;
  justify-content: space-between;
}
:where(#tsunami-root) .form-error {
  color: var(--error);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
:where(#tsunami-root) .form-error:empty {
  display: none;
}
:where(#tsunami-root) label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
:where(#tsunami-root) .login input {
  width: 100%;
  min-height: 43px;
  background: var(--surface);
}
:where(#tsunami-root) dialog {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100dvh - 40px);
  overflow: auto;
  border: 1px solid #394a5a;
  border-radius: 12px;
  padding: 26px;
  background: var(--surface);
  color: var(--text);
}
:where(#tsunami-root) dialog::backdrop {
  background: #03090ecc;
  backdrop-filter: blur(4px);
}
:where(#tsunami-root) dialog h2 {
  font-size: 18px;
  margin: 0 0 8px;
}
:where(#tsunami-root) dialog form {
  display: grid;
  gap: 18px;
}
:where(#tsunami-root) .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}
:where(#tsunami-root) .release-title {
  overflow-wrap: anywhere;
  line-height: 1.7;
  font-size: 13px;
  margin: 0;
}
:where(#tsunami-root) .form-row {
  display: flex;
  gap: 24px;
  align-items: end;
}
:where(#tsunami-root) .form-row label:first-child {
  flex: 1;
}
:where(#tsunami-root) .checkbox {
  display: flex;
  align-items: center;
  min-height: 40px;
}
:where(#tsunami-root) .checkbox input {
  accent-color: var(--accent);
}
:where(#tsunami-root) .password-tools {
  display: flex;
  gap: 8px;
}
:where(#tsunami-root) .password-tools input {
  flex: 1;
  width: 100%;
  font-family: ui-monospace, monospace;
}
:where(#tsunami-root) dialog .muted {
  font-size: 11px;
  margin: 0;
}
:where(#tsunami-root) #toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: #203b33;
  border: 1px solid #49715e;
  color: #d5f5e7;
  padding: 13px 20px;
  border-radius: 8px;
  box-shadow: 0 12px 40px #0006;
  max-width: calc(100% - 32px);
  font-size: 12px;
}
:where(#tsunami-root) #toast.error {
  background: #3b2729;
  border-color: #825257;
  color: #f5ccca;
}
:where(#tsunami-root) .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
@media (max-width: 800px) {
  :where(#tsunami-root) .topbar {
    padding: 0 18px;
    gap: 16px;
  }
  :where(#tsunami-root) .brand {
    font-size: 20px;
  }
  :where(#tsunami-root) .brand .tag {
    display: none;
  }
  :where(#tsunami-root) .topbar nav {
    gap: 0;
  }
  :where(#tsunami-root) .topbar nav button {
    padding: 0 9px;
    font-size: 12px;
  }
  :where(#tsunami-root) .account {
    gap: 0;
  }
  :where(#tsunami-root) main {
    padding: 22px 18px;
  }
  :where(#tsunami-root) .filters {
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
  }
  :where(#tsunami-root) .filters label {
    font-size: 10px;
    gap: 6px;
  }
  :where(#tsunami-root) .filters input {
    width: 130px;
  }
  :where(#tsunami-root) .numeric {
    width: 76px;
  }
  :where(#tsunami-root) .peers {
    display: none;
  }
  :where(#tsunami-root) td {
    padding: 12px;
  }
  :where(#tsunami-root) .action-col {
    width: 55px;
    padding-right: 10px;
  }
  :where(#tsunami-root) .numeric button {
    padding-right: 12px;
  }
  :where(#tsunami-root) .sectionbar > div {
    gap: 8px;
  }
  :where(#tsunami-root) .sectionbar .muted {
    font-size: 10px;
  }
}
@media (max-width: 520px) {
  :where(#tsunami-root) .topbar {
    height: auto;
    min-height: 95px;
    flex-wrap: wrap;
    padding: 10px 14px 0;
    gap: 0;
  }
  :where(#tsunami-root) .topbar .brand {
    order: 0;
  }
  :where(#tsunami-root) .account {
    order: 1;
  }
  :where(#tsunami-root) .topbar nav {
    order: 2;
    width: 100%;
    height: 41px;
    margin-top: 4px;
  }
  :where(#tsunami-root) .topbar nav button {
    flex: 1;
  }
  :where(#tsunami-root) .topbar nav button.active:after {
    left: 8px;
    right: 8px;
  }
  :where(#tsunami-root) main {
    padding: 18px 12px;
    min-height: calc(100dvh - 145px);
  }
  :where(#tsunami-root) .searchbar {
    gap: 8px;
    padding-left: 10px;
  }
  :where(#tsunami-root) .searchbar input {
    font-size: 14px;
  }
  :where(#tsunami-root) .search-symbol {
    display: none;
  }
  :where(#tsunami-root) .searchbar .primary {
    padding: 9px 11px;
    font-size: 12px;
  }
  :where(#tsunami-root) .searchbar .primary span {
    display: none;
  }
  :where(#tsunami-root) .filters {
    gap: 9px;
  }
  :where(#tsunami-root) .filters label {
    display: grid;
    gap: 5px;
  }
  :where(#tsunami-root) .filters input {
    width: 120px;
  }
  :where(#tsunami-root) .filters select {
    max-width: 115px;
  }
  :where(#tsunami-root) .filters .quiet {
    margin-top: 15px;
  }
  :where(#tsunami-root) .title-text {
    font-size: 12px;
  }
  :where(#tsunami-root) .numeric {
    width: 65px;
  }
  :where(#tsunami-root) .action-col {
    width: 47px;
  }
  :where(#tsunami-root) .numeric button {
    padding: 10px 5px;
    font-size: 10px;
  }
  :where(#tsunami-root) td {
    padding: 12px 8px;
  }
  :where(#tsunami-root) .release-tags {
    gap: 3px;
    flex-wrap: wrap;
  }
  :where(#tsunami-root) .release-tags span {
    font-size: 9px;
  }
  :where(#tsunami-root) .size-cell {
    font-size: 11px;
  }
  :where(#tsunami-root) .seeds {
    font-size: 11px;
  }
  :where(#tsunami-root) .download {
    min-width: 30px;
    padding: 8px;
  }
  :where(#tsunami-root) .empty {
    padding: 55px 8px;
  }
  :where(#tsunami-root) .empty h1 {
    font-size: 17px;
  }
  :where(#tsunami-root) .sectionbar .muted {
    display: none;
  }
  :where(#tsunami-root) .download-card {
    padding: 13px;
  }
  :where(#tsunami-root) .download-heading {
    gap: 8px;
  }
  :where(#tsunami-root) .download-details {
    gap: 12px;
  }
  :where(#tsunami-root) .user-row {
    padding: 12px;
    gap: 10px;
    flex-wrap: wrap;
  }
  :where(#tsunami-root) .user-row strong {
    min-width: 70px;
  }
  :where(#tsunami-root) .user-row .muted {
    font-size: 10px;
  }
  :where(#tsunami-root) .connection-panel {
    align-items: flex-start;
    flex-direction: column;
    padding: 15px;
  }
  :where(#tsunami-root) dialog {
    padding: 20px;
  }
  :where(#tsunami-root) .password-tools .quiet {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :where(#tsunami-root) * {
    scroll-behavior: auto !important;
  }
}
:where(#tsunami-root) .plex-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
:where(#tsunami-root) .plex-toolbar input {
  flex: 1;
  min-width: 110px;
}
:where(#tsunami-root) .plex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 20px;
}
:where(#tsunami-root) .plex-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
:where(#tsunami-root) .plex-card img,
:where(#tsunami-root) .poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface);
}
:where(#tsunami-root) .poster-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}
:where(#tsunami-root) .plex-card strong {
  font-size: 13px;
}
:where(#tsunami-root) .plex-card .muted {
  font-size: 11px;
}
:where(#tsunami-root) .plex-pagination {
  display: flex;
  gap: 15px;
  justify-content: center;
  align-items: center;
  margin: 24px 0;
}
:where(#tsunami-root) .plex-import {
  width: min(720px, calc(100vw - 28px));
  max-height: 90dvh;
  overflow: auto;
}
:where(#tsunami-root) .plex-matches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin: 12px 0;
  padding: 2px;
}
:where(#tsunami-root) .plex-match {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 500px) {
  :where(#tsunami-root) .plex-matches {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
:where(#tsunami-root) .plex-match {
  flex: 0 0 100px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
  font-size: 11px;
  white-space: normal;
}
:where(#tsunami-root) .plex-match img {
  width: 70px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 4px;
}
:where(#tsunami-root) #plex-plan {
  font-size: 12px;
  margin-top: 15px;
  overflow-wrap: anywhere;
}
:where(#tsunami-root) #plex-plan ul {
  padding-left: 18px;
  max-height: 180px;
  overflow: auto;
}
:where(#tsunami-root) #plex-plan li {
  margin: 8px 0;
}
@media (max-width: 500px) {
  :where(#tsunami-root) .topbar nav button {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 12px;
  }
  :where(#tsunami-root) .plex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}
:where(#tsunami-root) .plex-tasks {
  margin: 0 0 20px;
}
:where(#tsunami-root) .plex-tasks summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  padding: 8px 0;
}
:where(#tsunami-root) .plex-tasks[open] summary {
  margin-bottom: 10px;
}
:where(#tsunami-root) .plex-import-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  border: 0;
  padding: 0;
  margin: 18px 0;
}
:where(#tsunami-root) .plex-import-modes label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
:where(#tsunami-root) .plex-import-modes input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}
:where(#tsunami-root) .plex-match[aria-pressed="true"] {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
:where(#tsunami-root) #plex-match-query {
  width: 100%;
}
:where(#tsunami-root) #plex-import-status:empty,
:where(#tsunami-root) #plex-match-status:empty {
  display: none;
}
:where(#tsunami-root) #plex-seasons {
  margin: 0 0 14px;
}
:where(#tsunami-root) .plex-view-toggle {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
}
:where(#tsunami-root) .plex-view-toggle button {
  padding: 6px 12px;
  background: transparent;
  color: var(--muted);
}
:where(#tsunami-root) .plex-view-toggle button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
:where(#tsunami-root) button.plex-card {
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
  justify-content: start;
  white-space: normal;
  align-items: stretch;
}
:where(#tsunami-root) button.plex-card:hover strong {
  color: var(--accent);
}
:where(#tsunami-root) .plex-grid.plex-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
:where(#tsunami-root) .plex-list button.plex-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
:where(#tsunami-root) .plex-list .plex-card img,
:where(#tsunami-root) .plex-list .poster-placeholder {
  width: 42px;
  height: 63px;
  aspect-ratio: 2/3;
}
:where(#tsunami-root) dialog.plex-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(600px, 100vw);
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  border-radius: 0;
  border-width: 0 0 0 1px;
  padding: 24px;
  overflow: auto;
}
:where(#tsunami-root) .plex-drawer-header {
  display: flex;
  align-items: start;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}
:where(#tsunami-root) .plex-drawer-header h2 {
  margin: 0;
  font-size: 24px;
  overflow-wrap: anywhere;
}
:where(#tsunami-root) .plex-drawer-header button {
  flex-shrink: 0;
}
:where(#tsunami-root) .plex-detail-overview {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
:where(#tsunami-root) .plex-detail-overview img,
:where(#tsunami-root) .plex-detail-overview .poster-placeholder {
  width: 130px;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
}
:where(#tsunami-root) .plex-detail-overview p {
  margin: 0 0 10px;
  line-height: 1.5;
}
:where(#tsunami-root) .plex-detail-summary {
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-line;
  margin: 24px 0;
}
:where(#tsunami-root) .plex-drawer h3 {
  font-size: 15px;
  margin: 24px 0 16px;
}
:where(#tsunami-root) .plex-seasons-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 14px;
}
:where(#tsunami-root) .plex-season {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
}
:where(#tsunami-root) .plex-season img,
:where(#tsunami-root) .plex-season .poster-placeholder {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
}
:where(#tsunami-root) .plex-season .muted,
:where(#tsunami-root) .plex-media-info {
  font-size: 12px;
}
@media (max-width: 500px) {
  :where(#tsunami-root) dialog.plex-drawer {
    padding: 18px;
  }
  :where(#tsunami-root) .plex-list button.plex-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 4px 12px;
  }
  :where(#tsunami-root) .plex-list .plex-card img,
  :where(#tsunami-root) .plex-list .poster-placeholder {
    width: 36px;
    height: 54px;
    grid-row: span 2;
  }
  :where(#tsunami-root) .plex-list .plex-card .muted {
    grid-column: 2;
  }
  :where(#tsunami-root) .plex-seasons-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  :where(#tsunami-root) .plex-detail-overview {
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 14px;
  }
  :where(#tsunami-root) .plex-detail-overview img,
  :where(#tsunami-root) .plex-detail-overview .poster-placeholder {
    width: 100px;
  }
}
:where(#tsunami-root) /* Shared poster dimensions keep the show and its seasons at the same scale. */
.plex-drawer {
  --plex-poster-width: 130px;
}
:where(#tsunami-root) .plex-detail-overview {
  grid-template-columns: var(--plex-poster-width) minmax(0, 1fr);
}
:where(#tsunami-root) .plex-detail-overview img,
:where(#tsunami-root) .plex-detail-overview .poster-placeholder,
:where(#tsunami-root) .plex-season img,
:where(#tsunami-root) .plex-season .poster-placeholder {
  width: var(--plex-poster-width);
}
:where(#tsunami-root) .plex-seasons-grid {
  grid-template-columns: repeat(auto-fill, var(--plex-poster-width));
}
:where(#tsunami-root) button.plex-season {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  align-items: start;
  white-space: normal;
}
:where(#tsunami-root) button.plex-season:hover strong {
  color: var(--accent);
}
:where(#tsunami-root) .plex-season-back {
  margin-bottom: 20px;
}
:where(#tsunami-root) .plex-episodes {
  margin-top: 24px;
  font-size: 12px;
}
:where(#tsunami-root) .plex-episodes th,
:where(#tsunami-root) .plex-episodes td {
  padding: 10px 6px;
  vertical-align: top;
}
:where(#tsunami-root) .plex-episodes th:first-child {
  width: 36px;
}
:where(#tsunami-root) .plex-episodes th:nth-child(3) {
  width: 62px;
}
:where(#tsunami-root) .plex-episodes th:nth-child(4) {
  width: 78px;
}
:where(#tsunami-root) .plex-episodes td:nth-child(2) {
  overflow-wrap: anywhere;
}
:where(#tsunami-root) .plex-episodes td:not(:nth-child(2)) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 500px) {
  :where(#tsunami-root) .plex-drawer {
    --plex-poster-width: 100px;
  }
  :where(#tsunami-root) .plex-episodes th:first-child {
    width: 28px;
  }
  :where(#tsunami-root) .plex-episodes th:nth-child(3) {
    width: 48px;
  }
  :where(#tsunami-root) .plex-episodes th:nth-child(4) {
    width: 68px;
  }
  :where(#tsunami-root) .plex-episodes th,
  :where(#tsunami-root) .plex-episodes td {
    padding: 10px 4px;
  }
}
:where(#tsunami-root) .plex-filename {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
  white-space: normal;
  margin-top: 5px;
  user-select: text;
}
:where(#tsunami-root) .plex-search-sticky {
  position: sticky;
  top: var(--topbar-height, 68px);
  z-index: 4;
  background: var(--bg, #0c1118);
  padding: 12px 0 1px;
  margin-top: -12px;
}
:where(#tsunami-root) .plex-toolbar .plex-view-toggle {
  margin-bottom: 0;
}
:where(#tsunami-root) #plex-sync {
  flex: 0 0 auto;
}
:where(#tsunami-root) [data-plex-sync][aria-busy="true"] .plex-sync-icon {
  animation: plex-sync-spin 1s linear infinite;
}
@keyframes plex-sync-spin {
  to {
    transform: rotate(360deg);
  }
}
:where(#tsunami-root) .plex-toolbar {
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 12px;
}
:where(#tsunami-root) .plex-toolbar .plex-view-toggle {
  flex: 0 0 auto;
}
:where(#tsunami-root) .plex-toolbar #plex-query {
  min-width: 0;
  width: 0;
}
:where(#tsunami-root) .plex-toolbar .plex-display-toggle button,
:where(#tsunami-root) .plex-toolbar #plex-sync {
  width: 36px;
  height: 36px;
  padding: 8px;
}
@media (max-width: 520px) {
  :where(#tsunami-root) .plex-toolbar {
    gap: 4px;
  }
  :where(#tsunami-root) .plex-toolbar .plex-view-toggle {
    gap: 2px;
  }
  :where(#tsunami-root) .plex-toolbar [data-plex-kind] {
    padding: 6px 5px;
    font-size: 11px;
  }
  :where(#tsunami-root) .plex-toolbar .plex-display-toggle button,
  :where(#tsunami-root) .plex-toolbar #plex-sync {
    width: 28px;
    height: 34px;
    padding: 5px;
  }
  :where(#tsunami-root) .plex-toolbar #plex-query {
    padding-inline: 7px;
  }
}
:where(#tsunami-root) .plex-seasons-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
:where(#tsunami-root) .plex-seasons-grid .plex-season {
  min-width: 0;
}
:where(#tsunami-root) .plex-seasons-grid .plex-season img,
:where(#tsunami-root) .plex-seasons-grid .plex-season .poster-placeholder {
  width: 100%;
}
:where(#tsunami-root) .plex-episode-popup {
  position: fixed;
  z-index: 10;
  width: min(420px, calc(100vw - 16px));
  max-height: min(420px, calc(100dvh - 16px));
  overflow: hidden;
  pointer-events: none;
  padding: 16px;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 40px #0008;
  font-size: 12px;
  line-height: 1.5;
}
:where(#tsunami-root) .plex-episode-popup p {
  margin: 8px 0 0;
}
:where(#tsunami-root) .plex-episodes tbody tr:hover,
:where(#tsunami-root) .plex-episodes tbody tr:focus-visible {
  background: var(--raised);
}
:where(#tsunami-root) .plex-season-navigation .plex-season-back {
  margin: 10px 0 0;
  width: 100%;
  padding: 7px 4px;
}
:where(#tsunami-root) .downloads-toolbar {
  justify-content: flex-end;
}
:where(#tsunami-root) .plex-import-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
:where(#tsunami-root) .plex-import-heading h2 {
  margin: 0;
}
:where(#tsunami-root) .plex-import-heading button {
  font-size: 22px;
  padding: 3px 10px;
}
:where(#tsunami-root) .plex-import-summary {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
}
:where(#tsunami-root) .plex-import-summary dt {
  color: var(--muted);
}
:where(#tsunami-root) .plex-import-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}
:where(#tsunami-root) .plex-import-file {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
:where(#tsunami-root) .plex-import-file dd {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
:where(#tsunami-root) #plex-plan:focus {
  outline: none;
}
@media (max-width: 500px) {
  :where(#tsunami-root) .plex-import-summary {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 10px;
  }
}
:where(#tsunami-root) .copy-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: plex-sync-spin 0.8s linear infinite;
}
:where(#tsunami-root) .plex-copy-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
:where(#tsunami-root) .plex-detected {
  padding: 14px;
  margin-bottom: 20px;
  background: var(--raised);
  border-radius: 6px;
}
:where(#tsunami-root) .plex-detected > .muted {
  display: block;
  margin-bottom: 12px;
  font-size: 11px;
}

:where(#tsunami-root) .release-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
  margin: 0;
}
:where(#tsunami-root) .release-summary > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}
:where(#tsunami-root) .release-summary .release-summary-title {
  grid-column: 1 / -1;
}
:where(#tsunami-root) .release-summary dt {
  color: var(--muted);
}
:where(#tsunami-root) .release-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}
:where(#tsunami-root) .library-legend {
  margin-bottom: 12px;
}
:where(#tsunami-root) .release-filter-panel {
  margin: 0 0 18px;
}
:where(#tsunami-root) .release-filter-panel summary {
  cursor: pointer;
  color: var(--muted);
}
:where(#tsunami-root) .release-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
:where(#tsunami-root) .release-filters input,
:where(#tsunami-root) .release-filters select {
  width: 100%;
}
@media (max-width: 500px) {
  :where(#tsunami-root) .release-summary {
    gap: 10px 14px;
  }
  :where(#tsunami-root) .release-summary > div {
    display: block;
  }
  :where(#tsunami-root) .release-summary dt {
    font-size: 11px;
    margin-bottom: 3px;
  }
}

:where(#tsunami-root) .infinite-more {
  grid-column: 1 / -1;
  min-height: 32px;
  padding: 10px;
  text-align: center;
  color: var(--muted);
}

:where(#tsunami-root) .worker-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; color: var(--muted); }
:where(#tsunami-root) .worker-status > span { width: 7px; height: 7px; border-radius: 50%; background: #ed7070; }
:where(#tsunami-root) .worker-status[data-online="true"] > span { background: #72c99a; }
:where(#tsunami-root) .plex-match-search { display: flex; align-items: center; gap: 8px; }
:where(#tsunami-root) .plex-match-search input { flex: 1; min-width: 0; }
:where(#tsunami-root) #plex-match-sync { flex-shrink: 0; padding: 10px; }

:where(#tsunami-root) .plex-version { align-items: flex-start; margin: 12px 0; }
:where(#tsunami-root) .plex-version > span { min-width: 0; overflow-wrap: anywhere; }
:where(#tsunami-root) .plex-version .muted { display: block; }
:where(#tsunami-root) .replacement-summary { overflow-wrap: anywhere; }

:where(#tsunami-root) .status-pill.seeding { background: #1b513c; color: #a7f3c7; border: 1px solid #317355; }
:where(#tsunami-root) .transfer-stats { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 14px; }
:where(#tsunami-root) .user-pill { padding: 4px 8px; background: var(--raised); border: 1px solid #34404d; border-radius: 999px; color: var(--text); }
:where(#tsunami-root) .download-details .plex-copy-action { background: #090e13; border-color: #38414a; color: #e7eaf0; padding: 8px 12px; }
:where(#tsunami-root) .download-details .plex-copy-action:hover { background: #17212b; border-color: #e5a00d; }
:where(#tsunami-root) .plex-button-logo { width: 36px; height: 20px; object-fit: contain; }

:where(#tsunami-root) .download-details { gap: 12px; }
:where(#tsunami-root) .download-details .plex-copy-action { margin-left: auto; }
:where(#tsunami-root) .plex-copy-arrow { position: relative; display: inline-block; width: 24px; height: 18px; flex-shrink: 0; }
:where(#tsunami-root) .plex-copy-arrow::before { content: ""; position: absolute; left: 0; top: 8px; width: 23px; border-top: 2px solid currentColor; }
:where(#tsunami-root) .plex-copy-arrow::after { content: ""; position: absolute; right: 1px; top: 3px; width: 10px; height: 10px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); }

:where(#tsunami-root) .downloads-toolbar { display: flex; gap: 12px; flex-wrap: nowrap; }
:where(#tsunami-root) #downloads-query { flex: 1; min-width: 0; }
:where(#tsunami-root) #refresh-downloads { flex-shrink: 0; }

:where(#tsunami-root) .plex-present { margin-left: auto; display: inline-flex; align-items: center; opacity: .3; padding: 8px 12px; }
:where(#tsunami-root) .plex-present:hover { opacity: .6; }
:where(#tsunami-root) .tmdb-toolbar { display:flex; align-items:center; gap:12px; position:sticky; top:var(--topbar-height,72px); z-index:5; background:var(--bg); padding:12px 0; }
:where(#tsunami-root) .tmdb-toolbar input { flex:1; min-width:0; }
:where(#tsunami-root) .tmdb-card { display:flex; flex-direction:column; align-items:stretch; text-align:left; gap:8px; white-space:normal; }
:where(#tsunami-root) .tmdb-card img, :where(#tsunami-root) .tmdb-card .poster-placeholder { width:100%; aspect-ratio:2/3; object-fit:cover; border-radius:6px; }
:where(#tsunami-root) .tmdb-card strong { overflow-wrap:anywhere; }
:where(#tsunami-root) .tmdb-source { display:inline-block; margin:12px 0; color:var(--accent); }
:where(#tsunami-root) .tmdb-credits { color:var(--muted); font-size:11px; margin-top:24px; }
:where(#tsunami-root) .tmdb-credits img { margin-top:12px; }
:where(#tsunami-root) .tmdb-episode { border-bottom:1px solid #34404d; }
:where(#tsunami-root) .tmdb-episode summary { display:grid; grid-template-columns:30px 1fr auto; gap:12px; cursor:pointer; padding:12px 0; }
:where(#tsunami-root) .tmdb-episode-info { display:flex; gap:16px; align-items:flex-start; padding-bottom:12px; }
:where(#tsunami-root) .tmdb-episode-info img { width:140px; max-width:35%; border-radius:5px; }
:where(#tsunami-root) .tmdb-episode-info p { margin:0; }
@media(max-width:600px) {
 :where(#tsunami-root) .tmdb-toolbar { flex-wrap:wrap; }
 :where(#tsunami-root) .tmdb-toolbar input { flex-basis:100%; }
 :where(#tsunami-root) .tmdb-episode summary { grid-template-columns:24px 1fr; }
 :where(#tsunami-root) .tmdb-episode summary .muted { grid-column:2; }
}
:where(#tsunami-root) .topbar nav { min-width:0; overflow-x:auto; }
@media(max-width:520px) { :where(#tsunami-root) .topbar nav { flex: 0 0 100%; } }

:where(#tsunami-root) .match-source { overflow-wrap:anywhere; font-size:13px; }
:where(#tsunami-root) .match-picked { display:flex; gap:20px; margin:20px 0; }
:where(#tsunami-root) .match-picked img { width:100px; border-radius:8px; }
:where(#tsunami-root) .match-episodes { display:grid; gap:8px; margin:16px 0; }
:where(#tsunami-root) .match-episodes label { display:flex; align-items:center; gap:12px; padding:8px; }
:where(#tsunami-root) .match-episodes input { width:auto; }
:where(#tsunami-root) .match-selection { overflow-wrap:anywhere; }
:where(#tsunami-root) .download-match { font-size:12px; color:var(--muted); padding:4px 0; text-align:left; border:0; }

:where(#tsunami-root) .tmdb-source { margin-right: 18px; }
:where(#tsunami-root) .download-actions { margin-left:auto; display:flex; align-items:center; justify-content:flex-end; gap:16px; max-width:100%; flex-wrap:wrap; }
:where(#tsunami-root) .download-actions .download-match { color:var(--accent); border:0; background:none; padding:6px 0; max-width:260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
:where(#tsunami-root) .download-actions .download-match:hover { background:none; text-decoration:underline; }
:where(#tsunami-root) .download-actions .plex-copy-action, :where(#tsunami-root) .download-actions .plex-present { margin-left:0; }
:where(#tsunami-root) .tmdb-follow { margin:12px 16px 12px 0; }
:where(#tsunami-root) .following-toolbar { display:flex; align-items:center; flex-wrap:nowrap; gap:12px; margin:16px 0; }
:where(#tsunami-root) .following-toolbar input[type=search] { flex:1; min-width:0; width:0; }
:where(#tsunami-root) #following-root > .following-toolbar > button { flex-shrink:0; white-space:nowrap; }
:where(#tsunami-root) .following-filter { display:flex; align-items:center; gap:8px; }
:where(#tsunami-root) .following-filter input { width:auto; }
:where(#tsunami-root) .following-links { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
:where(#tsunami-root) .following-association { margin:16px 0; }
:where(#tsunami-root) .following-association > button { margin:8px 12px 0 0; }
:where(#tsunami-root) .following-episodes { width:100%; }
:where(#tsunami-root) .following-episodes td { vertical-align:top; }
:where(#tsunami-root) .following-episodes details { font-size:12px; max-width:360px; white-space:normal; }
@media (max-width:600px) {
 :where(#tsunami-root) .following-episodes thead { display:none; }
 :where(#tsunami-root) .following-episodes tbody { display:block; }
 :where(#tsunami-root) .following-episodes tr { display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:8px; padding:12px 4px; border-bottom:1px solid var(--border); }
 :where(#tsunami-root) .following-episodes td { padding:0; border:0; white-space:normal; }
 :where(#tsunami-root) .following-episodes td:nth-child(3) { grid-column:2; grid-row:2; }
 :where(#tsunami-root) .following-episodes td:nth-child(4) { grid-column:3; grid-row:1; }
 :where(#tsunami-root) .following-episodes td:nth-child(5) { grid-column:3; grid-row:2; }
}
:where(#tsunami-root) .match-dialog { width:min(820px,calc(100vw - 28px)); padding-bottom:0; }
:where(#tsunami-root) .match-dialog .tmdb-toolbar { position:static; }
:where(#tsunami-root) .match-dialog .dialog-actions { position:sticky; bottom:0; background:var(--surface); padding:16px 0; margin-top:18px; border-top:1px solid var(--line); z-index:2; }
:where(#tsunami-root) .match-picked { align-items:center; padding:16px; border-radius:10px; background:#1c2833; }
:where(#tsunami-root) .match-picked img { width:76px; }
:where(#tsunami-root) .match-picked h3 { margin:0 0 6px; }
:where(#tsunami-root) .match-season-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-top:18px; }
:where(#tsunami-root) .match-season-bar > label:first-child { display:flex; align-items:center; gap:12px; }
:where(#tsunami-root) .match-multiple, :where(#tsunami-root) .match-follow { display:flex; align-items:center; gap:10px; }
:where(#tsunami-root) .match-multiple input, :where(#tsunami-root) .match-follow input { width:auto; }
:where(#tsunami-root) .match-follow { padding:16px 0; color:var(--accent); }
:where(#tsunami-root) .match-selection { color:var(--accent); margin:14px 0; }
:where(#tsunami-root) .match-episodes { grid-template-columns:repeat(2,minmax(0,1fr)); }
:where(#tsunami-root) .match-episodes > button { grid-column:1/-1; justify-self:end; }
:where(#tsunami-root) .match-episodes label { border:1px solid var(--line); border-radius:8px; padding:14px; cursor:pointer; align-items:start; }
:where(#tsunami-root) .match-episodes label > span { display:grid; gap:5px; }
:where(#tsunami-root) .match-episodes label.is-selected { background:#193830; border-color:var(--accent); }
:where(#tsunami-root) .match-episodes input { margin-top:3px; accent-color:var(--accent); }
:where(#tsunami-root) .download-actions .download-follow { border:0; background:none; color:var(--accent); padding:6px 0; }
@media(max-width:600px){
 :where(#tsunami-root) .match-episodes { grid-template-columns:1fr; }
 :where(#tsunami-root) .match-season-bar { flex-wrap:wrap; }
}
:where(#tsunami-root) .match-episodes label { border-color:#34414d; }
:where(#tsunami-root) .match-dialog .dialog-actions { border-top-color:#34414d; }
:where(#tsunami-root) .match-episodes label.is-selected { border-color:var(--accent); }
:where(#tsunami-root) .match-picked img { width:62px; }
:where(#tsunami-root) #notifications-button { position:relative; }
:where(#tsunami-root) .notification-list { display:grid; gap:10px; margin-top:16px; }
:where(#tsunami-root) .notification { display:flex; width:100%; gap:14px; text-align:left; align-items:center; background:var(--surface); }
:where(#tsunami-root) .notification.unread { border-left:3px solid var(--accent); background:var(--raised); }
:where(#tsunami-root) .notification img { width:50px; border-radius:5px; }
:where(#tsunami-root) .notification > span { display:grid; gap:6px; }
:where(#tsunami-root) .policy-fields { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; margin:16px 0; }
:where(#tsunami-root) .policy-field { border:1px solid var(--line); padding:12px; border-radius:8px; }
:where(#tsunami-root) .policy-field select { width:100%; margin:8px 0; }
:where(#tsunami-root) .policy-request { border:1px solid var(--line); padding:16px; border-radius:10px; margin:12px 0; }
:where(#tsunami-root) .policy-request button { margin-right:12px; }
:where(#tsunami-root) #preferences-root { margin-bottom:32px; }
:where(#tsunami-root) .policy-fields { grid-template-columns:1fr; }
:where(#tsunami-root) .policy-field summary { cursor:pointer; }
:where(#tsunami-root) .policy-field summary input { width:auto; margin:0 10px; accent-color:var(--accent); }
:where(#tsunami-root) .policy-settings { border:0; margin:16px 0 0; padding:0; min-width:0; display:grid; gap:12px; }
:where(#tsunami-root) .policy-settings:disabled { opacity:.45; }
:where(#tsunami-root) .policy-option { display:flex; align-items:center; gap:8px; padding:7px 12px; border:1px solid transparent; border-radius:6px; }
:where(#tsunami-root) .policy-option.is-selected { background:#193830; border-color:var(--accent); }
:where(#tsunami-root) .policy-option label { flex:1; display:flex; align-items:center; gap:12px; min-width:0; overflow-wrap:anywhere; }
:where(#tsunami-root) .policy-option input { width:auto; accent-color:var(--accent); }
:where(#tsunami-root) .policy-option button { padding:6px 12px; }
:where(#tsunami-root) .policy-rank { color:var(--accent); }
:where(#tsunami-root) .policy-options { display:grid; gap:5px; }
:where(#tsunami-root) .admin-layout { display:grid; grid-template-columns:200px minmax(0,1fr); gap:28px; align-items:start; }
:where(#tsunami-root) .admin-menu { position:sticky; top:85px; display:grid; gap:6px; }
:where(#tsunami-root) .admin-menu button { background:none; border:0; text-align:left; color:var(--muted); }
:where(#tsunami-root) .admin-menu button[aria-current=page] { color:var(--accent); background:#193830; }
:where(#tsunami-root) .admin-content { min-width:0; }
:where(#tsunami-root) .tmdb-download { margin:12px 12px 12px 0; }
@media(max-width:650px) {
 :where(#tsunami-root) .admin-layout { grid-template-columns:1fr; gap:16px; }
 :where(#tsunami-root) .admin-menu { position:static; display:flex; flex-wrap:wrap; }
}
:where(#tsunami-root) .policy-saved { border:1px solid var(--line); border-radius:8px; padding:14px; }
:where(#tsunami-root) .policy-saved header { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
:where(#tsunami-root) .policy-saved header button { margin-left:auto; }
:where(#tsunami-root) .policy-saved-values { display:flex; flex-wrap:wrap; gap:10px 28px; margin:14px 0 0; padding-left:24px; }
:where(#tsunami-root) .policy-saved-values li { padding-right:10px; color:var(--accent); }
:where(#tsunami-root) .policy-savebar { position:fixed; bottom:0; left:0; right:0; display:flex; justify-content:flex-end; gap:12px; padding:14px max(20px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)); background:var(--surface); border-top:1px solid var(--line); z-index:20; }
:where(#tsunami-root) #preferences-root,
:where(#tsunami-root) #email-settings-form { padding-bottom:90px; }
:where(#tsunami-root) .starred-result { background:#142922; }
:where(#tsunami-root) .starred-result .title-text { color:var(--accent); }
:where(#tsunami-root) .result-section th { text-align:left; padding:18px 12px 10px; color:var(--accent); border-bottom:1px solid var(--line); }
:where(#tsunami-root) .release-tags .kind-tag { color:var(--accent); }
:where(#tsunami-root) .release-tags .quality-warning { color:#edc480; }
:where(#tsunami-root) .search-tools { display:flex; align-items:center; gap:12px; }
:where(#tsunami-root) .search-tools .searchbar { flex:1; min-width:0; }
:where(#tsunami-root) .search-tools .searchbar input { min-width:0; width:0; }
:where(#tsunami-root) #toggle-search-filters { flex:none; min-height:44px; }
:where(#tsunami-root) #toggle-search-filters[aria-expanded=true] { color:var(--accent); border-color:var(--accent); }
 :where(#tsunami-root) #search-filters { width:min(640px,100vw); }
:where(#tsunami-root) #search-filters .filters { display:grid; grid-template-columns:1fr 1fr; align-items:end; }
:where(#tsunami-root) #search-filters .filters label { display:grid; gap:8px; }
:where(#tsunami-root) #search-filters .filters input, :where(#tsunami-root) #search-filters .filters select { width:100%; max-width:none; }
:where(#tsunami-root) #search-filters .release-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
@media(max-width:480px) {
 :where(#tsunami-root) .search-tools { gap:6px; }
 :where(#tsunami-root) #toggle-search-filters { padding:8px; font-size:12px; }
}
:where(#tsunami-root) .release-with-score { display:flex; align-items:flex-start; gap:12px; }
:where(#tsunami-root) .release-description { min-width:0; flex:1; }
:where(#tsunami-root) .match-score { flex:0 0 46px; width:46px; height:46px; display:grid; place-items:center; border-radius:7px; font-weight:750; font-size:13px; font-variant-numeric:tabular-nums; color:#fff; }
:where(#tsunami-root) .match-score.excellent { background:#267855; }
:where(#tsunami-root) .match-score.good { background:#376e74; }
:where(#tsunami-root) .match-score.fair { background:#86601f; }
:where(#tsunami-root) .match-score.poor { background:#943f49; }
:where(#tsunami-root) .match-score.unrated { background:#394653; }

:where(#tsunami-root) .preference-mark { margin-left:5px; font-style:normal; font-size:11px; font-weight:800; }
:where(#tsunami-root) .preference-mark.is-match { color:#8bddb0; }
:where(#tsunami-root) .preference-mark.is-mismatch { color:#ff8790; }

:where(#tsunami-root) .inferred-mark { color:#f2c268; font-style:normal; margin-right:4px; }
:where(#tsunami-root) .release-tags .unknown-tag { color:var(--muted); background:transparent; border:1px dashed var(--line); }

:where(#tsunami-root) .quality-col { width:78px; text-align:center; }
:where(#tsunami-root) th.quality-col button { padding:12px 4px; }
:where(#tsunami-root) td.quality-col .match-score { margin:auto; }
@media(max-width:650px) {
 :where(#tsunami-root) .quality-col { width:52px; padding-left:4px; padding-right:4px; }
 :where(#tsunami-root) .quality-col .match-score { width:36px; height:36px; font-size:11px; }
 :where(#tsunami-root) th.quality-col button { font-size:10px; }
}

:where(#tsunami-root) .episode-size-picker { border:0; padding:0; margin:12px 0; display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; }
:where(#tsunami-root) .episode-size-picker #episode-size-label { flex-shrink:0; margin-right:16px; color:var(--muted); font-size:12px; }
:where(#tsunami-root) .episode-size-picker label { display:flex; align-items:center; gap:6px; font-size:12px; cursor:pointer; }
:where(#tsunami-root) .episode-size-picker input { width:auto; accent-color:var(--accent); }

:where(#tsunami-root) .score-wrap { position:relative; display:inline-block; vertical-align:middle; }
:where(#tsunami-root) .score-award { position:absolute; right:-7px; bottom:-7px; font-size:20px; line-height:1; filter:drop-shadow(0 2px 2px #0009); cursor:help; }
@media(max-width:650px) {
 :where(#tsunami-root) .score-award { font-size:16px; right:-5px; bottom:-5px; }
}

:where(#tsunami-root) .recent-searches { margin:22px 0; max-width:720px; }
:where(#tsunami-root) .recent-searches h2 { font-size:13px; font-weight:500; color:var(--muted); margin:0 0 10px; }
:where(#tsunami-root) .recent-searches ul { list-style:none; margin:0; padding:0; display:grid; gap:4px; }
:where(#tsunami-root) .recent-searches button { display:block; width:100%; text-align:left; border:0; background:transparent; padding:9px 12px; overflow-wrap:anywhere; color:var(--text); }
:where(#tsunami-root) .recent-searches button:hover { background:var(--surface); color:var(--accent); }

:where(#tsunami-root) .recent-search-heading { display:flex; align-items:baseline; gap:14px; margin-bottom:10px; }
:where(#tsunami-root) .recent-search-heading h2 { margin:0; }
:where(#tsunami-root) .recent-searches .clear-recents { width:auto; padding:4px 0; color:var(--accent); font-size:12px; font-weight:400; text-decoration:underline; text-underline-offset:3px; }
:where(#tsunami-root) .recent-searches .clear-recents:hover { background:transparent; }

:where(#tsunami-root) .download-card.is-downloading progress::-webkit-progress-value { background:#70b7f2; }
:where(#tsunami-root) .download-card.is-downloading progress::-moz-progress-bar { background:#70b7f2; }
:where(#tsunami-root) .download-card.is-downloading .status-pill.running,
:where(#tsunami-root) .download-card.is-downloading .status-pill.seeding { background:#19364c; color:#8ecaff; border-color:#315b7a; }
:where(#tsunami-root) .download-card.is-downloading .speed-down { color:#8ecaff; }

:where(#tsunami-root) .plex-sort-controls { display:flex; flex:none; align-items:center; gap:4px; }
:where(#tsunami-root) #plex-sort { max-width:175px; padding:9px 38px 9px 12px; font-size:12px; }
:where(#tsunami-root) #plex-sort-direction { padding:8px 10px; }
@media(max-width:800px) {
 :where(#tsunami-root) .plex-toolbar { flex-wrap:wrap; }
 :where(#tsunami-root) .plex-sort-controls { margin-left:auto; }
}

/* Consistent arrow spacing across native single-choice dropdowns. */
:where(#tsunami-root) select:not([multiple]):not([size]) {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%23dce3eb' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

:where(#tsunami-root) .following-association input { width:100%; margin-top:8px; }
:where(#tsunami-root) .following-association-result { margin:12px 0; }

:where(#tsunami-root) .following-episodes th { padding:10px 12px; font-size:11px; color:var(--muted); }
:where(#tsunami-root) .following-episodes th:first-child { width:46px; }
:where(#tsunami-root) .following-episodes th:nth-child(3) { width:104px; }
:where(#tsunami-root) .following-episodes th:nth-child(4) { width:150px; }
:where(#tsunami-root) .following-episodes th:last-child { width:94px; }
:where(#tsunami-root) .following-episodes td { padding:12px; vertical-align:middle; font-size:13px; }
:where(#tsunami-root) .following-episodes td:first-child { color:var(--muted); font-variant-numeric:tabular-nums; }
:where(#tsunami-root) .following-episodes td:nth-child(2) { overflow-wrap:anywhere; }
:where(#tsunami-root) .following-episodes td:nth-child(3) { color:var(--muted); font-size:12px; white-space:nowrap; font-variant-numeric:tabular-nums; }
:where(#tsunami-root) .following-episodes td:last-child { text-align:right; }
:where(#tsunami-root) .following-episodes strong { font-weight:550; line-height:1.4; }
:where(#tsunami-root) .following-episodes details { max-width:none; margin-top:5px; }
:where(#tsunami-root) .following-episodes summary { color:var(--muted); cursor:pointer; font-size:11px; }
:where(#tsunami-root) .following-episodes details p { line-height:1.6; margin:8px 0 0; color:var(--muted); }
:where(#tsunami-root) .following-episodes button.quiet { padding:6px 9px; font-size:12px; color:var(--accent); }
:where(#tsunami-root) .following-episodes .status-pill { white-space:nowrap; font-size:10px; }
:where(#tsunami-root) .following-episodes .episode-state-download { color:#8ecaff; background:#19364c; }
:where(#tsunami-root) .following-episodes .episode-state-missing { color:#d5b77f; background:#302b22; }
@media(max-width:600px) {
 :where(#tsunami-root) .following-episodes td { padding:0; }
 :where(#tsunami-root) .following-episodes tr { padding:12px; border-color:var(--line); }
}

:where(#tsunami-root) .following-episode-actions { display:flex; align-items:center; justify-content:flex-end; gap:4px; }
:where(#tsunami-root) .following-episodes th:last-child { width:160px; }
:where(#tsunami-root) .following-episodes th:nth-child(4) { width:125px; }
:where(#tsunami-root) .following-episodes .episode-download-button { background:#193830; border-color:#315c51; }
:where(#tsunami-root) .episode-download-dialog { width:min(680px,calc(100vw - 28px)); padding:24px; }
:where(#tsunami-root) .episode-download-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px; }
:where(#tsunami-root) .episode-download-heading h2 { margin:0; }
:where(#tsunami-root) .episode-download-show { display:flex; gap:16px; align-items:center; margin-bottom:20px; }
:where(#tsunami-root) .episode-download-show img { width:64px; border-radius:6px; }
:where(#tsunami-root) .episode-download-show h3 { margin:0 0 6px; }
:where(#tsunami-root) .episode-download-best { display:flex; gap:16px; padding:16px; border:1px solid #315c51; border-radius:8px; background:#142922; overflow-wrap:anywhere; }
:where(#tsunami-root) .episode-download-best p { margin:8px 0 0; }
:where(#tsunami-root) .episode-download-score { flex:none; display:flex; flex-direction:column; align-items:center; gap:6px; font-weight:700; font-size:20px; }
:where(#tsunami-root) .episode-download-copy { display:flex; gap:10px; align-items:center; margin:20px 0 12px; }
:where(#tsunami-root) .episode-download-destination { padding:14px; border:1px solid var(--line); border-radius:6px; }
:where(#tsunami-root) .episode-download-destination code { display:block; overflow-wrap:anywhere; margin:8px 0; font-size:12px; }
:where(#tsunami-root) .episode-download-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:24px; }
:where(#tsunami-root) .episode-download-sizes { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:14px; }
:where(#tsunami-root) .episode-download-sizes label { display:flex; align-items:center; gap:6px; }
@media(max-width:600px) {
 :where(#tsunami-root) .following-episode-actions { flex-wrap:wrap; }
 :where(#tsunami-root) .following-episodes td:nth-child(5) { grid-column:2 / 4; }
 :where(#tsunami-root) .following-episodes td:nth-child(3) { grid-row:3; }
}

:where(#tsunami-root) .following-episodes tr.episode-next { background:#182e39; }
:where(#tsunami-root) .following-episodes tr.episode-next:hover { background:#1d3947; }
:where(#tsunami-root) .following-episodes tr.episode-next td:first-child { box-shadow:inset 3px 0 #70b7f2; color:#a8d6fa; }
:where(#tsunami-root) .following-episodes tr.episode-next strong { color:#a8d6fa; }
:where(#tsunami-root) .following-episodes tr.episode-next .episode-state-upcoming { color:#a8d6fa; background:#234655; }
@media(max-width:600px) {
 :where(#tsunami-root) .following-episodes tr.episode-next { box-shadow:inset 3px 0 #70b7f2; }
 :where(#tsunami-root) .following-episodes tr.episode-next td:first-child { box-shadow:none; }
}

:where(#tsunami-root) .season-approval-dialog { width:min(680px,calc(100vw - 28px)); padding:24px; }
:where(#tsunami-root) .season-engine-note { color:#e3c48a; background:#302b22; padding:12px; border-radius:6px; }
:where(#tsunami-root) .season-scope { display:flex; flex-wrap:wrap; gap:12px 22px; border:0; padding:0; margin:22px 0; }
:where(#tsunami-root) .season-scope legend { margin-bottom:10px; }
:where(#tsunami-root) .season-scope label { display:flex; align-items:center; gap:8px; }
:where(#tsunami-root) .season-reference { display:grid; gap:8px; }
:where(#tsunami-root) .season-reference select { width:100%; }
:where(#tsunami-root) .season-reference-name { overflow-wrap:anywhere; font-size:12px; display:block; }
:where(#tsunami-root) .season-authorization { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; margin:0 0 16px; font-size:12px; }
:where(#tsunami-root) .season-authorization.configured { display:block; border:1px solid #315c51; border-radius:8px; padding:14px; }
:where(#tsunami-root) .season-authorization-heading { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
:where(#tsunami-root) .season-authorization-heading strong { flex:1; }
:where(#tsunami-root) .season-authorization p { margin:8px 0; }
:where(#tsunami-root) .season-authorization button { padding:6px 8px; font-size:12px; }

.search-idle { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,2fr); gap: 2rem; margin-top: 1.5rem; align-items: start; }
.search-idle[hidden] { display: none; }
.search-idle .recent-searches { margin: 0; }
.search-idle h2 { font-size: 1.05rem; margin: 0 0 1rem; }
.upcoming-activity { min-width: 0; }
.upcoming-activity > p { font-size: .85rem; margin: 0 0 1rem; }
:where(#tsunami-root) #upcoming-status:empty { display:none; }
:where(#tsunami-root) .upcoming-items { list-style:none; padding:0; margin:0; }
:where(#tsunami-root) .upcoming-item { display:flex; gap:24px; padding:16px 0; }
:where(#tsunami-root) .upcoming-item + .upcoming-item { border-top:1px solid var(--line); }
:where(#tsunami-root) .upcoming-date { flex:0 0 125px; color:var(--muted); font-size:.87rem; }
:where(#tsunami-root) .upcoming-description { min-width:0; font-size:.87rem; }
:where(#tsunami-root) .upcoming-episode, :where(#tsunami-root) .upcoming-description small { display:block; margin-top:4px; }
@media(max-width:500px) { :where(#tsunami-root) .upcoming-item { gap:16px; } :where(#tsunami-root) .upcoming-date { flex-basis:100px; } }
@media(max-width:900px) { .search-idle { grid-template-columns: minmax(0,1fr); } }

:where(#tsunami-root) .plex-open-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 12px; border: 1px solid #38414a; border-radius: 8px; background: #090e13; color: #e7eaf0; text-decoration: none; white-space: nowrap; font-size: 13px; }
:where(#tsunami-root) .plex-open-action:hover { background: #17212b; border-color: #e5a00d; }
:where(#tsunami-root) .plex-open-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:where(#tsunami-root) .plex-episode-open { text-align: right; }

:where(#tsunami-root) .plex-detail-overview .plex-open-action .plex-button-logo { width: 36px; height: 20px; min-width: 36px; aspect-ratio: auto; object-fit: contain; border-radius: 0; }

:where(#tsunami-root) .episode-size-picker label[hidden] { display:none; }
:where(#tsunami-root) .episode-size-picker.detecting > :not(#episode-runtime-loading) { display:none; }
:where(#tsunami-root) #episode-runtime-loading { display:inline-flex; align-items:center; height:26px; }
:where(#tsunami-root) #episode-runtime-loading[hidden] { display:none; }
:where(#tsunami-root) #episode-size-hint.runtime-confirmed { margin-left:auto; color:var(--accent); }

:where(#tsunami-root) #search-filters { padding:0; overflow:hidden; }
:where(#tsunami-root) #search-filters[open] { display:flex; flex-direction:column; }
:where(#tsunami-root) #search-filters .plex-drawer-header { flex-shrink:0; padding:24px; margin:0; }
:where(#tsunami-root) .search-filters-content { flex:1; min-height:0; overflow-y:auto; padding:0 24px 24px; }
:where(#tsunami-root) .search-filters-footer { flex-shrink:0; display:flex; justify-content:flex-end; padding:14px 24px calc(14px + env(safe-area-inset-bottom)); background:var(--surface); border-top:1px solid var(--line); }

:where(#tsunami-root) .downloads-tabs { display:flex; flex-shrink:0; gap:4px; margin-bottom:0; }
:where(#tsunami-root) .downloads-tabs button { white-space:nowrap; }
:where(#tsunami-root) .downloads-tabs button[aria-pressed=true] { color:var(--accent); border-color:var(--accent); background:var(--raised); }
:where(#tsunami-root) .downloads-toolbar #downloads-query { flex:1; min-width:0; }
@media(max-width:650px) { :where(#tsunami-root) .downloads-toolbar { flex-wrap:wrap; } :where(#tsunami-root) .downloads-tabs { flex-basis:100%; } }

:where(#tsunami-root) .nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 5px;
  border-radius: 999px;
  background: #c73545;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  vertical-align: middle;
}
:where(#tsunami-root) .nav-count-muted { background: #536170; }

:where(#tsunami-root) .following-mode {
  align-self: flex-start;
  width: fit-content;
  margin: 10px 0 6px;
}
:where(#tsunami-root) .following-mode-auto { background: #d8ac45; color: #251b08; }
:where(#tsunami-root) .following-mode-manual { background: #536170; color: #fff; }
.home-activity-column { min-width:0; }
.suggestions-upcoming { margin-top:2rem; }
.suggestions-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:12px; }
.search-idle .suggestions-heading h2 { margin:0; }
:where(#tsunami-root) [data-suggestion-filter] { padding:6px 10px; font-size:12px; }
:where(#tsunami-root) [data-suggestion-filter][aria-pressed=true] { color:var(--accent); border-color:var(--accent); }
:where(#tsunami-root) #suggestions-status:empty { display:none; }
:where(#tsunami-root) #suggestions-upcoming h3 { color:var(--muted); font-size:12px; font-weight:500; margin:16px 0 0; }
.suggestions-existing { grid-column:1 / -1; min-width:0; width:100%; }
.suggestions-covers { display:flex; gap:20px; overflow-x:auto; padding:4px 2px 16px; scroll-snap-type:x proximity; }
:where(#tsunami-root) .suggestion-cover { flex:0 0 155px; display:flex; flex-direction:column; gap:6px; white-space:normal; padding:0; background:transparent; border:0; text-align:left; scroll-snap-align:start; }
:where(#tsunami-root) .suggestion-cover img, :where(#tsunami-root) .suggestion-cover .poster-placeholder { width:155px; height:232px; object-fit:cover; border-radius:8px; }
:where(#tsunami-root) .suggestion-cover strong { font-size:13px; line-height:1.4; }
:where(#tsunami-root) .suggestion-cover span, :where(#tsunami-root) .suggestion-cover small { font-size:11px; }
:where(#tsunami-root) .suggestion-title { color:var(--accent); padding:0; background:transparent; border:0; text-align:left; font-size:inherit; }
.suggestions-arrows { display:flex; gap:8px; }

:where(#tsunami-root) .notification-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e33e4d;
  pointer-events: none;
}

 :where(#tsunami-root) .account .header-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:36px;
  padding:8px;
  border:0;
  background:transparent;
  box-shadow:none;
  color:var(--muted);
}
:where(#tsunami-root) .account .header-icon:hover:not(:disabled),
:where(#tsunami-root) .account .header-icon:focus-visible {
  background:var(--raised);
  color:var(--accent);
}

.disk-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.disk-card { display:flex; align-items:center; gap:24px; border:1px solid var(--line); border-radius:16px; padding:28px; background:var(--surface); }
.disk-ring { flex:0 0 120px; height:120px; border-radius:50%; display:grid; place-items:center; position:relative; }
.disk-ring svg { position:absolute; inset:0; width:100%; height:100%; }
.disk-ring strong { z-index:1; font-size:24px; }
.disk-card h3 { margin:0; font-size:18px; }
.disk-card p { margin:8px 0 0; font-size:12px; }
.disk-card .disk-free { color:var(--accent); font-size:17px; }
.settings-form { max-width:650px; display:grid; gap:16px; }
.profile-email-toggle { display:flex; gap:10px; align-items:center; margin:8px 0 0; }
:where(#tsunami-root) .profile-email-toggle input { width:auto; }
.profile-password { margin-top:24px; padding-top:20px; border-top:1px solid var(--line); }
.profile-password summary { cursor:pointer; color:var(--muted); }
@media(max-width:1100px) { .disk-card { flex-direction:column; text-align:center; gap:16px; padding:20px; } .disk-ring { width:120px; } }
@media(max-width:500px) { .disk-summary { gap:12px; } .disk-card { padding:14px 8px; gap:12px; } .disk-card h3 { font-size:15px; } .disk-card .disk-free { font-size:15px; } .disk-ring { width:90px; flex-basis:90px; height:90px; } }

.suggestions-arrows { align-items:center; flex-wrap:wrap; }
.suggestions-arrows .plex-view-toggle { margin-right:12px; }

:where(#tsunami-root) .suggestion-availability { display:block; width:fit-content; margin:4px 0; font-size:10px; font-weight:600; }
:where(#tsunami-root) .availability-cinema { background:#d8ac45; color:#251b08; }
:where(#tsunami-root) .availability-digital, :where(#tsunami-root) .availability-physical { background:#1b513c; color:#a7f3c7; }
:where(#tsunami-root) .availability-tv, :where(#tsunami-root) .availability-upcoming, :where(#tsunami-root) .availability-unknown { background:#536170; color:#fff; }

:where(#tsunami-root) .summary-services { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:24px; }
:where(#tsunami-root) .service-card { padding:20px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
:where(#tsunami-root) .service-card h3 { margin:0; }
:where(#tsunami-root) .service-card .sectionbar { margin:0; }
:where(#tsunami-root) .service-card p { margin:16px 0 0; }
:where(#tsunami-root) .service-card .worker-status { font-size:14px; }
:where(#tsunami-root) .connection-result { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin-top:16px; font-size:14px; }
:where(#tsunami-root) .connection-directory { flex-basis:100%; overflow-wrap:anywhere; }
:where(#tsunami-root) .connection-result[data-state="success"] .connection-result-title { color:#72c99a; }
:where(#tsunami-root) .connection-result[data-state="error"] .connection-result-title { color:#ed7070; }
@media(max-width:750px) {
 :where(#tsunami-root) .summary-services { grid-template-columns:1fr; }
 :where(#tsunami-root) .connection-result { grid-column:1; }
}

:where(#tsunami-root) .service-card .service-transmission { margin-top:20px; padding-top:20px; border-top:1px solid var(--line); }
:where(#tsunami-root) .service-retest { margin-top:16px; }
:where(#tsunami-root) .worker-status[data-online="pending"] > span { background:var(--muted); }

:where(#tsunami-root) #profile-form { padding-bottom:90px; }
:where(#tsunami-root) #profile-form input[readonly] { color:var(--muted); background:var(--surface); cursor:default; }
:where(#tsunami-root) .profile-passkeys { margin-top:32px; padding-top:24px; border-top:1px solid var(--line); }

:where(#tsunami-root) [data-profile-panel] > h2 { margin:0 0 24px; }

:where(#tsunami-root) .aws-credentials-ok { color:#72c99a; }

:where(#tsunami-root) .catalogue-discovery { min-width:0; margin-top:20px; }
:where(#tsunami-root) .discovery-filters { display:flex; align-items:end; flex-wrap:wrap; gap:14px; padding:18px; background:var(--surface); border:1px solid var(--line); border-radius:12px; }
:where(#tsunami-root) .discovery-filters label { color:var(--muted); font-size:12px; display:grid; gap:7px; }
:where(#tsunami-root) .discovery-filters select { min-width:150px; }
:where(#tsunami-root) .discovery-widget { margin-top:32px; min-width:0; }
:where(#tsunami-root) .discovery-widget header { display:flex; align-items:center; justify-content:space-between; gap:16px; }
:where(#tsunami-root) .discovery-widget h2 { margin:0; font-size:19px; }
:where(#tsunami-root) .discovery-widget header p { margin:6px 0 0; }
:where(#tsunami-root) .discovery-arrows { display:flex; gap:8px; }
:where(#tsunami-root) .discovery-track { display:flex; gap:18px; overflow-x:auto; padding:8px 2px 16px; scroll-snap-type:x proximity; }
:where(#tsunami-root) .discovery-card { flex:0 0 154px; width:154px; display:flex; flex-direction:column; align-items:stretch; padding:0; text-align:left; white-space:normal; background:none; scroll-snap-align:start; }
:where(#tsunami-root) .discovery-card img, :where(#tsunami-root) .discovery-card .poster-placeholder { width:154px; height:231px; object-fit:cover; border-radius:10px; background:var(--raised); }
:where(#tsunami-root) .discovery-card strong { margin:6px 0; line-height:1.4; }
:where(#tsunami-root) .discovery-meta { color:var(--muted); font-size:11px; margin-top:10px; }
:where(#tsunami-root) .discovery-rating { color:var(--amber); font-size:12px; margin-top:auto; }
:where(#tsunami-root) .discovery-more { flex:0 0 115px; align-self:center; }
@media(max-width:600px) { :where(#tsunami-root) .discovery-filters label { flex:1 1 130px; } :where(#tsunami-root) .discovery-filters select { min-width:0; width:100%; } }

:where(#tsunami-root) .tmdb-cast { margin:28px 0; }
:where(#tsunami-root) .tmdb-cast h3 { margin:0; }
:where(#tsunami-root) .tmdb-cast-track { display:flex; gap:20px; overflow-x:auto; padding:4px 2px 14px; }
:where(#tsunami-root) .tmdb-cast-person { flex:0 0 112px; display:flex; flex-direction:column; align-items:center; text-align:center; gap:7px; text-decoration:none; color:var(--text); font-size:12px; }
:where(#tsunami-root) .tmdb-cast-person:hover strong { color:var(--accent); }
:where(#tsunami-root) .tmdb-cast-photo { width:88px; height:88px; border-radius:50%; object-fit:cover; object-position:center 25%; background:var(--raised); }
:where(#tsunami-root) .tmdb-cast-placeholder { display:grid; place-items:center; font-size:24px; color:var(--muted); }
:where(#tsunami-root) .tmdb-cast-person span { font-size:11px; }

:where(#tsunami-root) .tmdb-season-owned { display:flex; flex-direction:column; align-items:center; gap:8px; min-width:0; }
:where(#tsunami-root) .tmdb-season-owned .plex-season { width:100%; }
:where(#tsunami-root) .tmdb-presence-action { display:inline-flex; align-items:center; flex-wrap:wrap; gap:8px; margin:8px 0; }
:where(#tsunami-root) .tmdb-season-owned .tmdb-presence-action { justify-content:center; font-size:13px; }
:where(#tsunami-root) .tmdb-season-owned .plex-open-action { padding:8px 10px; }

:where(#tsunami-root) .match-auto-copy { margin:20px 0; padding:16px; border-radius:10px; background:var(--raised); }
:where(#tsunami-root) .match-auto-copy label { display:flex; align-items:center; gap:10px; }
:where(#tsunami-root) .match-auto-copy .plex-filename { overflow-wrap:anywhere; }

:where(#tsunami-root) button.danger { color:#fff; background:#a52c3c; border:1px solid #cf4a59; }
:where(#tsunami-root) button.danger:hover:not(:disabled) { background:#bd3446; }
:where(#tsunami-root) .plex-delete-action { margin:8px; }
:where(#tsunami-root) .plex-delete-dialog { width:min(760px,calc(100vw - 32px)); max-height:85dvh; overflow:auto; }
:where(#tsunami-root) .plex-delete-files { padding-left:20px; }
:where(#tsunami-root) .plex-delete-files li { padding:10px 0; border-bottom:1px solid var(--border); }
:where(#tsunami-root) .plex-delete-files code { display:block; overflow-wrap:anywhere; font-size:12px; }
:where(#tsunami-root) .plex-delete-dialog input { display:block; margin-top:8px; }

/* Mobile/PWA: single-line menus, touch gestures and display cutouts. */
html { touch-action:pan-x pan-y; }
body { overscroll-behavior-y:none; }
:where(#tsunami-root) .topbar nav,
:where(#tsunami-root) .plex-view-toggle { display:flex; flex-wrap:nowrap; min-width:0; max-width:100%; overflow-x:auto; overflow-y:hidden; overscroll-behavior-x:contain; scrollbar-width:none; }
:where(#tsunami-root) .topbar nav::-webkit-scrollbar,
:where(#tsunami-root) .plex-view-toggle::-webkit-scrollbar { display:none; }
:where(#tsunami-root) .topbar nav button,
:where(#tsunami-root) .plex-view-toggle button { flex:0 0 auto; white-space:nowrap; }
:where(#tsunami-root) .pwa-network { position:sticky; top:0; padding:8px 16px; background:#634b1f; color:#fff; text-align:center; z-index:100; }
:where(#tsunami-root) .pwa-install { display:block; margin:16px auto; }
:where(#tsunami-root) .pwa-install[hidden] { display:none; }
@media (pointer:coarse) {
 :where(#tsunami-root) input:not([type=checkbox]):not([type=radio]), :where(#tsunami-root) select, :where(#tsunami-root) textarea { font-size:16px; }
 :where(#tsunami-root) button { min-height:44px; }
}
@media (max-width:760px) {
 :where(#tsunami-root) .topbar { padding-top:max(10px,env(safe-area-inset-top)); padding-left:max(14px,env(safe-area-inset-left)); padding-right:max(14px,env(safe-area-inset-right)); }
 :where(#tsunami-root) main { padding-left:max(12px,env(safe-area-inset-left)); padding-right:max(12px,env(safe-area-inset-right)); padding-bottom:calc(24px + env(safe-area-inset-bottom)); }
 :where(#tsunami-root) .admin-menu { display:flex; flex-wrap:nowrap; gap:2px; min-width:0; max-width:100%; overflow-x:auto; overflow-y:hidden; scrollbar-width:none; }
 :where(#tsunami-root) .admin-menu::-webkit-scrollbar { display:none; }
 :where(#tsunami-root) .admin-menu button { flex:0 0 auto; padding:8px 9px; white-space:nowrap; }
 :where(#tsunami-root) .downloads-tabs { flex-shrink:1; }
 :where(#tsunami-root) .suggestions-arrows { min-width:0; max-width:100%; }
 :where(#tsunami-root) dialog { max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px); }
}
@media (max-width:760px) {
 :where(#tsunami-root) .topbar nav button { font-size:14px; padding-inline:16px; min-height:44px; }
 :where(#tsunami-root) .topbar nav { height:48px; }
}

/* Keep horizontal gestures inside their scroller, without edge bounce. */
html, body { overflow-x:clip; overscroll-behavior-x:none; }
:where(#tsunami-root) .topbar nav,
:where(#tsunami-root) .plex-view-toggle,
:where(#tsunami-root) .admin-menu,
:where(#tsunami-root) .discovery-track,
:where(#tsunami-root) .tmdb-cast-track,
:where(#tsunami-root) .suggestions-covers,
:where(#tsunami-root) .table-wrap { overscroll-behavior-x:none; }

/* Upcoming schedule: one date, grouped shows, quieter hierarchy. */
:where(#tsunami-root) .upcoming-activity > h2 { font-size:18px; font-weight:550; color:#b9c4d0; margin-bottom:14px; }
:where(#tsunami-root) .upcoming-item { padding:14px 0; gap:20px; align-items:flex-start; }
:where(#tsunami-root) .upcoming-item + .upcoming-item { border-top-color:#26303a; }
:where(#tsunami-root) .upcoming-date { font-size:12px; line-height:1.6; color:#8e9bac; }
:where(#tsunami-root) .upcoming-description { flex:1; font-size:13px; line-height:1.6; }
:where(#tsunami-root) .upcoming-show + .upcoming-show { margin-top:16px; }
:where(#tsunami-root) .upcoming-show h3 { margin:0 0 5px; font-size:13px; line-height:1.5; font-weight:550; color:#b9c4d0; }
:where(#tsunami-root) .upcoming-episodes { margin:0; padding-left:15px; list-style:disc; color:#94a3b5; }
:where(#tsunami-root) .upcoming-episodes > li { padding:2px 0; }
:where(#tsunami-root) .upcoming-episodes > li::marker { color:#526171; font-size:9px; }
:where(#tsunami-root) .upcoming-episode { margin-top:0; }
:where(#tsunami-root) .upcoming-description small { font-size:11px; margin-top:2px; }
@media(max-width:500px) {
 :where(#tsunami-root) .upcoming-item { gap:14px; }
 :where(#tsunami-root) .upcoming-date { flex-basis:88px; font-size:11px; }
}

/* Shared calendar typography; preserve the existing date column. */
:where(#tsunami-root) .upcoming-show h3,
:where(#tsunami-root) .suggestion-title { color:var(--accent); font-size:13px; font-weight:550; line-height:1.5; }
:where(#tsunami-root) .suggestion-title { display:block; width:100%; min-width:0; min-height:0; white-space:normal; overflow-wrap:anywhere; }
:where(#tsunami-root) .upcoming-episode { white-space:normal; overflow-wrap:anywhere; font-size:13px; font-weight:400; line-height:1.6; color:var(--text); }

@media (max-width:520px) {
 :where(#tsunami-root) .topbar { padding-inline:0; }
 :where(#tsunami-root) .topbar > .brand { margin-left:max(14px,env(safe-area-inset-left)); }
 :where(#tsunami-root) .topbar > .account { margin-right:max(14px,env(safe-area-inset-right)); }
 :where(#tsunami-root) .topbar nav { width:100%; max-width:100%; margin-inline:0; }
 :where(#tsunami-root) .topbar nav button { border-inline:0; }
 :where(#tsunami-root) .topbar nav button.active:after { left:0; right:0; }
}

@media (max-width:520px) {
 :where(#tsunami-root) .topbar nav button:last-child { padding-right:16px; margin-right:0; }
}

:where(#tsunami-root) .refresh-icon { display:inline-flex; align-items:center; justify-content:center; width:calc(1lh + 22px); height:calc(1lh + 22px); min-height:0; padding:0; flex-shrink:0; font-size:inherit; }

:where(#tsunami-root) .refresh-icon > span { font-size:22px; line-height:1; }
@media (pointer:coarse) { :where(#tsunami-root) .refresh-icon { font-size:16px; } }
:where(#tsunami-root) #search-kind:not([hidden])::after { content:""; }
:where(#tsunami-root) .episode-size-picker { flex-wrap:nowrap; gap:10px; margin:0 0 14px; min-width:0; }
:where(#tsunami-root) .episode-size-picker #episode-size-label { margin-right:0; padding:0; }
:where(#tsunami-root) .episode-size-picker label { white-space:nowrap; flex-shrink:0; }
:where(#tsunami-root) #episode-size-hint { font-size:11px; white-space:nowrap; }
:where(#tsunami-root) #episode-size-hint.runtime-confirmed { margin-left:0; }

/* Plex library: categories, search, then result controls. */
:where(#tsunami-root) .plex-kind-tabs { gap:2px; margin:0 0 12px; }
:where(#tsunami-root) .plex-kind-tabs button { padding:8px 9px; }
:where(#tsunami-root) .plex-toolbar { gap:12px; flex-wrap:nowrap; }
:where(#tsunami-root) .plex-toolbar #plex-query { width:auto; padding:10px 12px; }
:where(#tsunami-root) .plex-toolbar #plex-sync { display:inline-flex; gap:6px; width:auto; height:calc(1lh + 22px); min-height:0; padding:0 10px; }
:where(#tsunami-root) .plex-results-toolbar { flex-wrap:nowrap; gap:8px; }
:where(#tsunami-root) .plex-results-toolbar > strong { white-space:nowrap; }
:where(#tsunami-root) .plex-results-actions { display:flex; align-items:center; gap:8px; margin-left:auto; min-width:0; }
:where(#tsunami-root) .plex-results-actions .plex-view-toggle { margin:0; flex-shrink:0; gap:2px; }
:where(#tsunami-root) .plex-results-actions .plex-display-toggle button { padding:6px; display:inline-flex; align-items:center; justify-content:center; }
:where(#tsunami-root) #plex-sort { color:var(--accent); border:0; border-radius:0; background:transparent; padding:8px 0; font-size:12px; cursor:pointer; width:auto; max-width:115px; appearance:none; -webkit-appearance:none; }
:where(#tsunami-root) #plex-sort option { color:var(--text); background:var(--surface); }
:where(#tsunami-root) #plex-sort-direction { border:0; background:transparent; color:var(--accent); padding:6px 4px; }
:where(#tsunami-root) #plex-sort:hover, :where(#tsunami-root) #plex-sort-direction:hover { text-decoration:underline; }

:where(#tsunami-root) #following-root > .following-toolbar { margin-top:0; }

:where(#tsunami-root) #tmdb-browser > .tmdb-toolbar { flex-direction:column; align-items:stretch; flex-wrap:nowrap; gap:12px; padding:0 0 12px; margin:0 0 8px; }
:where(#tsunami-root) #tmdb-browser > .tmdb-toolbar > .plex-view-toggle { gap:2px; margin:0; }
:where(#tsunami-root) #tmdb-browser > .tmdb-toolbar [data-tmdb-kind] { padding:8px 9px; }
:where(#tsunami-root) #tmdb-browser > .tmdb-toolbar input { flex:auto; width:100%; }
:where(#tsunami-root) #tmdb-browser > .tmdb-status:empty { display:none; }
:where(#tsunami-root) #tmdb-browser > .tmdb-results:empty { display:none; }
:where(#tsunami-root) .discovery-heading { margin:0 0 12px; font-size:18px; font-weight:550; }

:where(#tsunami-root) *::-webkit-scrollbar:horizontal { height:0; }
:where(#tsunami-root) .discovery-track,
:where(#tsunami-root) .tmdb-cast-track,
:where(#tsunami-root) .suggestions-covers,
:where(#tsunami-root) .plex-seasons-grid,
:where(#tsunami-root) .table-wrap { scrollbar-width:none; }
:where(#tsunami-root) .recommendation-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
:where(#tsunami-root) .plex-seasons-grid { display:flex; overflow-x:auto; gap:16px; padding:4px 2px 12px; scroll-snap-type:x proximity; overscroll-behavior-x:none; }
:where(#tsunami-root) .plex-seasons-grid > * { flex:0 0 140px; min-width:0; scroll-snap-align:start; }
:where(#tsunami-root) .nav-service-logo { display:block; object-fit:contain; height:20px; }
:where(#tsunami-root) .nav-plex-logo { width:40px; height:16px; }
:where(#tsunami-root) .nav-tmdb-logo { width:58px; }

:where(#tsunami-root) .release-details { display:flex; flex-wrap:wrap; gap:4px; }
@media(max-width:650px) {
 :where(#tsunami-root) #results-table { display:block; }
 :where(#tsunami-root) #results-table thead { display:table; width:100%; table-layout:fixed; }
 :where(#tsunami-root) #results { display:block; }
 :where(#tsunami-root) #results tr[data-id] { display:grid; grid-template-columns:52px minmax(0,1fr) 72px 36px 40px; gap:10px 6px; padding:12px 8px; border-bottom:1px solid var(--line); align-items:center; }
 :where(#tsunami-root) #results tr[data-id] > td { border:0; padding:0; width:auto; min-width:0; }
 :where(#tsunami-root) #results tr[data-id] .release-cell,
 :where(#tsunami-root) #results tr[data-id] .release-details { display:contents; }
 :where(#tsunami-root) #results tr[data-id] .quality-col { grid-row:1; grid-column:1; width:52px; }
 :where(#tsunami-root) #results tr[data-id] .title-text { grid-row:1; grid-column:2 / -1; min-width:0; overflow-wrap:anywhere; }
 :where(#tsunami-root) #results tr[data-id] .release-category { grid-row:2; grid-column:1 / 3; margin:0; }
 :where(#tsunami-root) #results tr[data-id] .size-cell { grid-row:2; grid-column:3; }
 :where(#tsunami-root) #results tr[data-id] .seeds { grid-row:2; grid-column:4; }
 :where(#tsunami-root) #results tr[data-id] .action-col { grid-row:2; grid-column:5; }
 :where(#tsunami-root) #results tr[data-id] .release-details > .release-tags:not(.release-category) { grid-row:3; grid-column:1 / -1; margin:0; }
}
@media(max-width:650px) {
 :where(#tsunami-root) #results tr:not([data-id]),
 :where(#tsunami-root) #results tr:not([data-id]) > td,
 :where(#tsunami-root) #results .result-section > th { display:block; width:100%; }
}

@media(max-width:650px) {
 :where(#tsunami-root) #results tr[data-id] { grid-template-columns:52px minmax(0,1fr) 72px 72px; }
 :where(#tsunami-root) #results tr[data-id] .title-text { grid-column:2 / -1; padding-right:46px; }
 :where(#tsunami-root) #results tr[data-id] .action-col { grid-row:1; grid-column:4; justify-self:end; }
 :where(#tsunami-root) #results tr[data-id] .size-cell { grid-column:3; justify-self:end; }
 :where(#tsunami-root) #results tr[data-id] .seeds { grid-column:4; justify-self:end; white-space:nowrap; }
 :where(#tsunami-root) #results-table thead { display:block; }
 :where(#tsunami-root) #results-table thead tr { display:grid; grid-template-columns:52px minmax(0,1fr) 72px 72px; column-gap:6px; padding:0 8px; background:var(--surface); border-bottom:1px solid var(--line); }
 :where(#tsunami-root) #results-table thead th { width:auto; min-width:0; border:0; }
 :where(#tsunami-root) #results-table thead th.numeric { text-align:right; }
 :where(#tsunami-root) #results-table thead th.numeric button { padding-inline:0; }
 :where(#tsunami-root) #results-table thead th.action-col { display:none; }
}
/* Keep the result summary and duration controls evenly spaced. */
:where(#tsunami-root) .search-results-heading { min-height:0; margin:14px 0 10px; line-height:20px; }
:where(#tsunami-root) .search-results-heading:has(+ .episode-size-picker[hidden]) { margin-bottom:14px; }
:where(#tsunami-root) .episode-size-picker { min-height:24px; margin:0 0 14px; line-height:20px; }
:where(#tsunami-root) .episode-size-picker label { margin:0; }
:where(#tsunami-root) .topbar nav button { display:inline-flex; align-items:center; justify-content:center; gap:8px; line-height:1; }
:where(#tsunami-root) .topbar nav button > svg,
:where(#tsunami-root) .topbar nav button > img { display:block; flex-shrink:0; }
:where(#tsunami-root) .topbar nav .nav-count { margin-left:0; flex-shrink:0; }
:where(#tsunami-root) .topbar nav { gap:0; flex:1; }
:where(#tsunami-root) .topbar nav button { flex:0 0 20%; width:20%; min-width:0; padding-inline:0; }
:where(#tsunami-root) .topbar nav button:last-child { padding-inline:0; }
:where(#tsunami-root) .topbar nav button.active:after { left:0; right:0; }
@media(max-width:800px) {
 :where(#tsunami-root) .topbar { flex-wrap:wrap; height:auto; gap:0; padding-bottom:0; }
 :where(#tsunami-root) .topbar > .brand { order:0; }
 :where(#tsunami-root) .topbar > .account { order:1; margin-left:auto; }
 :where(#tsunami-root) .topbar nav { order:2; flex:0 0 100%; width:100%; height:48px; margin-top:4px; }
}

:where(#tsunami-root) #session-expired { padding:14px; text-align:center; color:var(--amber); }
:where(#tsunami-root) #session-expired a { color:var(--accent); text-decoration:underline; cursor:pointer; }
:where(#tsunami-root) .passkey-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
:where(#tsunami-root) .passkey-row small { display:block; margin-top:4px; }
:where(#tsunami-root) #passkey-create-form { margin-top:16px; }

:where(#tsunami-root) .person-overview { display:flex; align-items:flex-start; gap:24px; margin:16px 0 24px; }
:where(#tsunami-root) .person-photo { width:140px; flex:0 0 140px; aspect-ratio:2/3; object-fit:cover; border-radius:8px; }
:where(#tsunami-root) .person-overview h2 { margin-top:0; }
:where(#tsunami-root) .person-biography { white-space:pre-line; line-height:1.7; display:-webkit-box; -webkit-line-clamp:6; -webkit-box-orient:vertical; overflow:hidden; }
:where(#tsunami-root) .person-biography.expanded { display:block; }
:where(#tsunami-root) .person-credit-filters { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
:where(#tsunami-root) .person-credit-filters .plex-view-toggle { margin:0; }
:where(#tsunami-root) .person-credit-filters input { flex:1; min-width:180px; }
:where(#tsunami-root) .person-credit { width:100%; display:flex; align-items:center; text-align:left; white-space:normal; gap:14px; padding:12px 0; border-bottom:1px solid var(--line); border-radius:0; }
:where(#tsunami-root) .person-credit-year { flex:0 0 38px; }
:where(#tsunami-root) .person-credit img, :where(#tsunami-root) .person-credit-placeholder { width:40px; height:60px; flex:0 0 40px; border-radius:4px; object-fit:cover; }
:where(#tsunami-root) .person-credit-description { min-width:0; }
:where(#tsunami-root) .person-credit strong { display:block; color:var(--accent); }
:where(#tsunami-root) .person-credit small { display:block; margin-top:5px; font-weight:400; }
@media(max-width:520px) { :where(#tsunami-root) .person-overview { gap:16px; } :where(#tsunami-root) .person-photo { width:100px; flex-basis:100px; } }

:where(#tsunami-root) .person-credit-placeholder { display:flex; align-items:center; justify-content:center; background:var(--raised); border:1px solid var(--line); color:var(--muted); font-size:20px; line-height:1; }


:where(#tsunami-root) .passkey-offer { width:min(440px,calc(100vw - 32px)); padding:24px; }
:where(#tsunami-root) .passkey-offer p { line-height:1.6; }
:where(#tsunami-root) .passkey-offer-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:12px; margin-top:20px; }

:where(#tsunami-root) .following-resultsbar > p { margin:0; }
:where(#tsunami-root) .following-resultsbar .plex-display-toggle { margin:0 0 0 auto; flex-shrink:0; }
:where(#tsunami-root) .plex-display-toggle button,
:where(#tsunami-root) .plex-results-actions .plex-display-toggle button { width:32px; height:32px; min-width:32px; min-height:32px; padding:0; display:inline-flex; align-items:center; justify-content:center; flex:0 0 32px; }
:where(#tsunami-root) .following-list { display:flex; flex-direction:column; gap:0; }
:where(#tsunami-root) .following-list > .plex-card { display:grid; grid-template-columns:56px minmax(0,1fr); align-items:center; column-gap:14px; row-gap:5px; text-align:left; padding:12px 0; border-bottom:1px solid var(--line); border-radius:0; }
:where(#tsunami-root) .following-list > .plex-card > img,
:where(#tsunami-root) .following-list > .plex-card > .poster-placeholder { grid-column:1; grid-row:1 / span 4; width:56px; height:84px; object-fit:cover; }
:where(#tsunami-root) .following-list > .plex-card > :not(img):not(.poster-placeholder) { grid-column:2; justify-self:start; }
:where(#tsunami-root) .following-list > .plex-card > strong { white-space:normal; }
:where(#tsunami-root) .following-resultsbar > p.muted { display:block; }

:where(#tsunami-root) .plex-grid.cards-compact { display:grid; grid-template-columns:repeat(auto-fill,minmax(105px,1fr)); gap:16px 10px; }
:where(#tsunami-root) .cards-compact .plex-card { gap:4px; font-size:11px; }
:where(#tsunami-root) .cards-compact .plex-card strong { font-size:11px; line-height:1.35; overflow-wrap:anywhere; }
:where(#tsunami-root) .cards-compact .status-pill { font-size:9px; padding:3px 5px; }
@media(max-width:650px) {
 :where(#tsunami-root) .plex-grid.cards-compact { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px 8px; }
 :where(#tsunami-root) .plex-results-actions { gap:4px; }
 :where(#tsunami-root) #plex-sort { max-width:105px; }
}

/* Keep Plex titles and their year/count visually together. */
:where(#tsunami-root) #plex-library:not(.plex-list) .plex-card { row-gap:2px; }
:where(#tsunami-root) #plex-library:not(.plex-list) .plex-card > :first-child { margin-bottom:5px; }
:where(#tsunami-root) #plex-library.plex-list .plex-card { row-gap:2px; }

:where(#tsunami-root) .tmdb-resultsbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 16px; }
:where(#tsunami-root) .tmdb-resultsbar[hidden] { display:none; }
:where(#tsunami-root) .tmdb-resultsbar .tmdb-status { margin:0; }
:where(#tsunami-root) .tmdb-resultsbar .plex-display-toggle { flex-shrink:0; }

/* Upcoming releases: calendar dates and compact poster cards. */
:where(#tsunami-root) .upcoming-item { gap:18px; padding:16px 0; }
:where(#tsunami-root) .upcoming-date { flex:0 0 80px; text-align:center; line-height:1.3; padding-top:8px; }
:where(#tsunami-root) .upcoming-date time { display:flex; flex-direction:column; align-items:center; }
:where(#tsunami-root) .upcoming-date strong { display:block; font-size:32px; font-weight:550; letter-spacing:-1px; color:#cbd6df; }
:where(#tsunami-root) .upcoming-date time > span { font-size:12px; }
:where(#tsunami-root) .upcoming-date small { font-size:10px; margin-top:2px; }
:where(#tsunami-root) .upcoming-countdown { display:block; margin-top:8px; font-size:10px; color:var(--accent); }
:where(#tsunami-root) .upcoming-countdown.is-today { background:#193b34; border-radius:20px; padding:4px 3px; }
:where(#tsunami-root) .upcoming-show { display:flex; align-items:flex-start; gap:14px; padding:12px; background:linear-gradient(115deg,#152523,#141b23 70%); border-radius:12px; }
:where(#tsunami-root) .upcoming-show + .upcoming-show { margin-top:10px; }
:where(#tsunami-root) button.upcoming-cover { flex:0 0 60px; padding:0; border:0; background:transparent; border-radius:6px; overflow:hidden; }
:where(#tsunami-root) .upcoming-poster { display:block; width:60px; height:90px; object-fit:cover; }
:where(#tsunami-root) .upcoming-poster-empty { display:grid; place-items:center; background:#24332f; color:#80a599; font-size:25px; }
:where(#tsunami-root) .upcoming-show-content { min-width:0; flex:1; }
:where(#tsunami-root) button.upcoming-title { display:block; padding:0; min-height:0; border:0; background:none; border-radius:0; color:var(--accent); font:inherit; text-align:left; white-space:normal; overflow-wrap:anywhere; }
:where(#tsunami-root) button.upcoming-title:hover { text-decoration:underline; }
:where(#tsunami-root) .upcoming-episodes { list-style:none; padding:0; }
:where(#tsunami-root) .upcoming-episode { font-size:12px; color:#a9b7c5; line-height:1.5; }
@media(max-width:500px) {
 :where(#tsunami-root) .upcoming-item { gap:10px; }
 :where(#tsunami-root) .upcoming-date { flex-basis:66px; }
 :where(#tsunami-root) .upcoming-date strong { font-size:28px; }
 :where(#tsunami-root) .upcoming-show { padding:10px; gap:10px; }
 :where(#tsunami-root) button.upcoming-cover { flex-basis:46px; }
 :where(#tsunami-root) .upcoming-poster { width:46px; height:69px; }
}

:where(#tsunami-root) #recent-searches .recent-search-link,
:where(#tsunami-root) .recent-searches .recent-search-close { display:none; }
:where(#tsunami-root) dialog.recent-search-dialog { width:min(440px,calc(100vw - 32px)); max-width:440px; max-height:80dvh; margin:auto; padding:20px; border:1px solid var(--line); border-radius:16px; background:var(--surface); color:var(--text); overflow-y:auto; }
:where(#tsunami-root) .recent-search-dialog .recent-search-heading { align-items:center; gap:12px; }
:where(#tsunami-root) .recent-search-dialog .recent-search-heading h2 { flex:1; font-size:16px; color:var(--text); }
:where(#tsunami-root) .recent-search-dialog .recent-search-close { display:block; width:32px; padding:4px; text-align:center; font-size:22px; flex-shrink:0; }
@media(max-width:900px) {
 :where(#tsunami-root) #recent-searches .recent-search-link { display:inline-block; width:auto; padding:0; color:var(--accent); font-size:13px; font-weight:400; text-decoration:underline; text-underline-offset:3px; }
 :where(#tsunami-root) #recent-searches .recent-search-link:hover { background:none; }
}

:where(#tsunami-root) .search-tools .searchbar { width:100%; }
:where(#tsunami-root) #toggle-search-filters { display:inline-flex; align-items:center; justify-content:center; flex:0 0 32px; width:32px; height:32px; min-width:32px; min-height:32px; padding:0; }
:where(#tsunami-root) #toggle-search-filters[hidden] { display:none; }
:where(#tsunami-root) .search-results-heading > div { min-width:0; }
@media(max-width:900px) {
 :where(#tsunami-root) #search-idle { margin-top:8px; row-gap:24px; }
 :where(#tsunami-root) #recent-searches { margin:0; }
}

:where(#tsunami-root) .watch-filters { gap:2px; margin:0 0 10px; }
:where(#tsunami-root) .watch-filters button { padding:7px 9px; font-size:12px; }
:where(#tsunami-root) .watch-caption { font-size:11px; margin:0 0 12px; }
:where(#tsunami-root) #watch-status { font-size:12px; }
:where(#tsunami-root) #watch-status:empty { display:none; }
:where(#tsunami-root) .upcoming-description small.watch-relation { margin-top:7px; font-size:10px; color:#7f998f; }
:where(#tsunami-root) .watch-more { margin-top:12px; font-size:12px; }
:where(#tsunami-root) #suggestions-upcoming .upcoming-show h3 { margin:0 0 5px; font-size:13px; line-height:1.5; font-weight:550; }

html.dialog-scroll-locked { overflow:hidden; overscroll-behavior:none; }
html.dialog-scroll-locked body { position:fixed; top:var(--dialog-page-top); left:var(--dialog-page-left); width:100%; padding-right:var(--dialog-page-padding); overflow:hidden; }
:where(#tsunami-root) dialog { overscroll-behavior:contain; }

:where(#tsunami-root) .catalogue-drawer-title { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; overflow-wrap:anywhere; }
:where(#tsunami-root) .catalogue-drawer-logo { display:block; width:64px; height:18px; object-fit:contain; flex-shrink:0; }

:where(#tsunami-root) .tmdb-history-back { display:block; max-width:100%; margin:0 0 16px; padding:6px 0; border:0; background:transparent; color:var(--accent); text-align:left; white-space:normal; overflow-wrap:anywhere; font-size:12px; }
:where(#tsunami-root) .tmdb-history-back[hidden] { display:none; }

:where(#tsunami-root) .close-stack-confirm { width:min(400px,calc(100vw - 32px)); padding:24px; border-radius:14px; }

/* Full-width opaque headers stay accessible while drawer content scrolls. */
:where(#tsunami-root) dialog.plex-drawer { --drawer-inset:24px; }
:where(#tsunami-root) .plex-drawer > .plex-drawer-header {
 position:sticky; top:calc(-1 * var(--drawer-inset)); z-index:20;
 display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px;
 margin:calc(-1 * var(--drawer-inset)) calc(-1 * var(--drawer-inset)) 20px;
 padding:16px var(--drawer-inset); background:var(--surface);
 border-bottom:1px solid var(--line); box-shadow:0 6px 16px #00000012;
}
:where(#tsunami-root) .plex-drawer > .plex-drawer-header h2 { flex:1; min-width:0; font-size:21px; line-height:1.3; }
:where(#tsunami-root) .plex-drawer > .plex-drawer-header > button:not(.tmdb-history-back) { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-height:32px; padding:0; flex:0 0 32px; }
:where(#tsunami-root) .plex-drawer-header > .tmdb-history-back { flex:0 0 100%; width:100%; margin:0; padding:2px 0; font-size:12px; line-height:1.5; }
:where(#tsunami-root) #search-filters > .plex-drawer-header { top:0; margin:0; padding:16px 24px; }
@media(max-width:500px) {
 :where(#tsunami-root) dialog.plex-drawer { --drawer-inset:18px; }
 :where(#tsunami-root) .plex-drawer > .plex-drawer-header { padding-top:max(14px,env(safe-area-inset-top)); padding-bottom:14px; }
 :where(#tsunami-root) .plex-drawer > .plex-drawer-header h2 { font-size:20px; }
}

:where(#tsunami-root) .season-episode-count { font-size:15px; margin:24px 0 8px; }
:where(#tsunami-root) .season-episode-card { display:grid; grid-template-columns:minmax(0,34%) minmax(0,1fr); gap:16px; padding:16px 0; }
:where(#tsunami-root) .season-episode-card + .season-episode-card { border-top:1px solid var(--line); }
:where(#tsunami-root) .season-episode-thumb { display:block; width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:7px; background:var(--raised); }
:where(#tsunami-root) .season-episode-thumb.missing { display:grid; place-items:center; color:var(--muted); font-size:24px; }
:where(#tsunami-root) .season-episode-content { min-width:0; }
:where(#tsunami-root) .season-episode-number { display:block; color:var(--muted); font-size:10px; margin-bottom:3px; }
:where(#tsunami-root) .season-episode-content h4 { margin:0 0 3px; font-size:13px; font-weight:550; line-height:1.4; overflow-wrap:anywhere; }
:where(#tsunami-root) .season-episode-content > small { font-size:10px; }
:where(#tsunami-root) .season-episode-synopsis { font-size:12px; line-height:1.5; color:#a1afbf; margin:6px 0 8px; overflow-wrap:anywhere; }
:where(#tsunami-root) .season-episode-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
:where(#tsunami-root) .season-episode-actions button,:where(#tsunami-root) .season-episode-actions a { font-size:11px; padding:5px 7px; }
:where(#tsunami-root) .season-episode-files { margin-top:8px; font-size:11px; color:var(--muted); }
:where(#tsunami-root) .season-episode-files summary { cursor:pointer; }
@media(max-width:500px) { :where(#tsunami-root) .season-episode-card { gap:12px; padding:14px 0; } }

:where(#tsunami-root) dialog.drawer-overview { width:min(680px,calc(100vw - 28px)); max-height:85dvh; padding:24px; border-radius:18px; background:var(--surface); }
:where(#tsunami-root) .drawer-overview-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; }
:where(#tsunami-root) .drawer-overview-heading h2 { margin:0; font-size:21px; }
:where(#tsunami-root) .drawer-overview-heading p { margin:5px 0 0; font-size:12px; }
:where(#tsunami-root) .drawer-overview-heading > button { padding:0; width:32px; height:32px; }
:where(#tsunami-root) .drawer-overview-hint { color:var(--muted); font-size:12px; line-height:1.5; margin:16px 0; }
:where(#tsunami-root) .drawer-overview-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
:where(#tsunami-root) button.drawer-overview-card { display:flex; flex-direction:column; gap:7px; min-width:0; padding:8px; border:1px solid var(--line); border-radius:12px; background:var(--bg); text-align:left; white-space:normal; }
:where(#tsunami-root) button.drawer-overview-card.current { border-color:var(--accent); background:#152c27; }
:where(#tsunami-root) button.drawer-overview-card:hover { border-color:var(--accent); }
:where(#tsunami-root) .drawer-overview-preview { position:relative; display:block; width:100%; }
:where(#tsunami-root) .drawer-overview-art { display:block; width:100%; height:140px; border-radius:7px; object-fit:cover; object-position:top; background:#23332f; }
:where(#tsunami-root) .drawer-overview-art.missing { display:grid; place-items:center; font-size:32px; color:#769d91; }
:where(#tsunami-root) .drawer-overview-step,:where(#tsunami-root) .drawer-overview-current { position:absolute; top:6px; padding:3px 6px; border-radius:5px; background:#0d141ee8; color:var(--text); font-size:10px; }
:where(#tsunami-root) .drawer-overview-step { left:6px; }
:where(#tsunami-root) .drawer-overview-current { right:6px; color:var(--accent); }
:where(#tsunami-root) .drawer-overview-card strong { font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
:where(#tsunami-root) .drawer-overview-card small { color:var(--muted); font-size:10px; }
@media(max-width:500px){ :where(#tsunami-root) dialog.drawer-overview { padding:18px; } :where(#tsunami-root) .drawer-overview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.search-match-banner {
  display:flex;align-items:center;gap:16px;padding:14px 16px;
  margin:12px 0;border:1px solid var(--accent);border-radius:12px;
  background:var(--surface);font-size:14px;
}
.search-match-banner[hidden] {display:none}
.search-match-banner > div {flex:1;min-width:0}
.search-match-banner strong,.search-match-banner a {color:var(--accent)}
.search-match-banner p {margin:4px 0 0;color:var(--muted)}
.search-match-banner a {white-space:nowrap}

:where(#tsunami-root) .search-match-banner.is-unmatched {border-style:dashed;border-color:var(--line);color:var(--muted);}
:where(#tsunami-root) .search-match-banner.is-unmatched > span {flex:1;}
:where(#tsunami-root) .search-match-link {padding:0;border:0;background:none;color:var(--accent);text-decoration:underline;text-underline-offset:3px;white-space:nowrap;font-size:13px;}
:where(#tsunami-root) .search-match-poster {width:40px;height:60px;object-fit:cover;border-radius:5px;flex-shrink:0;}
:where(#tsunami-root) #search-kind {margin-right:10px;}
@media(min-width:901px) {
 :where(#tsunami-root) .search-results-heading {gap:16px;margin-bottom:14px;}
 :where(#tsunami-root) .search-results-heading > div:first-child {flex:1;}
 :where(#tsunami-root) .search-results-heading > .episode-size-picker {flex:0 1 auto;margin:0;}
}

:where(#tsunami-root) #results tr.starred-result:hover,
:where(#tsunami-root) #results tr.starred-result.selected { background:#1e3b31; }
:where(#tsunami-root) #results .seeds { white-space:nowrap; }
:where(#tsunami-root) .search-match-selection > label {display:grid;gap:6px;margin-bottom:16px;}
:where(#tsunami-root) .search-match-episodes {display:grid;gap:8px;max-height:40dvh;overflow-y:auto;}
:where(#tsunami-root) .search-match-episodes label {display:flex;align-items:center;gap:10px;padding:8px;cursor:pointer;}
:where(#tsunami-root) .search-match-episodes input {width:auto;flex-shrink:0;}
:where(#tsunami-root) .search-match-banner small {display:block;margin-top:4px;}
:where(#tsunami-root) .search-match-banner.is-proposed {border-color:#b98b38;background:#292519;}
:where(#tsunami-root) .search-match-banner.is-proposed strong,
:where(#tsunami-root) .search-match-banner.is-proposed .search-match-link {color:#edc477;}
:where(#tsunami-root) .search-match-banner.is-proposed .quiet {border-color:#b98b38;color:#edc477;}
@media(max-width:600px) {
 :where(#tsunami-root) .search-match-banner {flex-wrap:wrap;gap:10px;}
 :where(#tsunami-root) .search-match-banner > div {flex-basis:calc(100% - 60px);}
}
:where(#tsunami-root) .match-proposal-description {display:flex;align-items:center;gap:6px;}
:where(#tsunami-root) .match-plex-status {display:inline-flex;align-items:center;gap:5px;}
:where(#tsunami-root) .match-plex-yes {color:var(--accent);font-weight:700;}
:where(#tsunami-root) .match-plex-no {color:#ed747e;font-weight:700;}
:where(#tsunami-root) .result-section .other-results-toggle {display:flex;align-items:center;justify-content:space-between;width:100%;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;}
:where(#tsunami-root) .search-match-banner > div > .match-plex-status {display:flex;width:fit-content;margin-top:4px;}
:where(#tsunami-root) #results .result-section > th {padding:0;vertical-align:middle;}
:where(#tsunami-root) #results .result-section-label,
:where(#tsunami-root) #results .other-results-toggle {display:flex;align-items:center;justify-content:flex-start;gap:8px;width:100%;min-height:48px;padding:12px;box-sizing:border-box;line-height:24px;}
:where(#tsunami-root) #results .other-results-toggle > span {font-size:24px;line-height:24px;}
:where(#tsunami-root) .user-identity {flex:1;min-width:0;}
:where(#tsunami-root) .user-identity > strong {display:block;}
:where(#tsunami-root) .user-plex-profile {display:flex;align-items:center;gap:8px;margin-top:4px;color:var(--muted);font-size:12px;}
:where(#tsunami-root) .following-association {margin:18px 0;padding:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;}
:where(#tsunami-root) .following-association > summary {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;cursor:pointer;list-style:none;}
:where(#tsunami-root) .following-association > summary::-webkit-details-marker {display:none;}
:where(#tsunami-root) .following-plex-summary {display:flex;align-items:center;gap:12px;min-width:0;font-size:13px;}
:where(#tsunami-root) .following-plex-summary img {flex-shrink:0;}
:where(#tsunami-root) .following-plex-summary .is-linked {color:var(--accent);}
:where(#tsunami-root) .following-link-edit {font-size:12px;color:var(--accent);flex-shrink:0;}
:where(#tsunami-root) .following-association > input {width:calc(100% - 28px);margin:0 14px 10px;font-size:16px;}
:where(#tsunami-root) .following-association-result:empty {display:none;}
:where(#tsunami-root) .following-association-result {margin:0 14px 10px;font-size:12px;}
:where(#tsunami-root) .following-links {margin:0 14px;}
:where(#tsunami-root) .following-link-actions {display:flex;flex-wrap:wrap;gap:8px;padding:0 14px 14px;}
:where(#tsunami-root) .following-link-actions button {font-size:12px;padding:7px 10px;min-height:32px;}
:where(#tsunami-root) .following-drawer .following-toolbar {display:grid;grid-template-columns:minmax(0,1fr) auto 42px;align-items:center;gap:12px;margin:16px 0;}
:where(#tsunami-root) .following-toolbar select {width:100%;min-width:0;height:42px;padding:8px 10px;font-size:14px;}
:where(#tsunami-root) .following-toolbar .following-filter {display:flex;align-items:center;gap:6px;margin:0;font-size:12px;white-space:nowrap;}
:where(#tsunami-root) .following-toolbar input[type=checkbox] {width:18px;height:18px;margin:0;}
:where(#tsunami-root) .following-toolbar .following-refresh {width:42px;height:42px;padding:0;font-size:24px;line-height:1;}
:where(#tsunami-root) .subscription-row {display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line);}
:where(#tsunami-root) .subscription-row > img,.subscription-placeholder {width:36px;height:54px;object-fit:cover;border-radius:4px;}
:where(#tsunami-root) .subscription-title {flex:1;min-width:0;font-size:14px;}
:where(#tsunami-root) .subscription-title small {display:block;}
:where(#tsunami-root) .subscription-row label {display:flex;align-items:center;gap:8px;white-space:nowrap;font-size:12px;}
:where(#tsunami-root) .subscription-row input {width:18px;height:18px;}
:where(#tsunami-root) .following-drawer .plex-detail-overview:not(:has(> img)) {grid-template-columns:minmax(0,1fr);}

:where(#tsunami-root) .plex-drawer > .plex-drawer-header > .drawer-overview-trigger[hidden] { display:none; }
@media(max-width:600px) {
 :where(#tsunami-root) dialog.plex-drawer { border-left-width:0; }
}

/* Poster hover adds breathing room without changing card geometry. */
@media (hover:hover) and (pointer:fine) {
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover,.drawer-overview-card) {
  transition:background-color 150ms ease-in-out,box-shadow 150ms ease-in-out;
 }
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover,.drawer-overview-card):hover:not(:disabled) {
  background-color:var(--raised);
  box-shadow:0 0 0 8px var(--raised);
 }
 /* Make room for the halo at the edges of horizontally scrolling rails. */
 :where(#tsunami-root) :is(.suggestions-covers,.discovery-track,.tmdb-cast-track,.plex-seasons-grid) {
  padding-left:10px;padding-right:10px;margin-left:-8px;margin-right:-8px;
 }
 :where(#tsunami-root) :is(.suggestions-covers,.tmdb-cast-track,.plex-seasons-grid) {
  padding-top:12px;margin-top:-8px;
 }
}
@media (prefers-reduced-motion:reduce) {
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover,.drawer-overview-card) { transition:none; }
}

@media(max-width:900px) {
 :where(#tsunami-root) .suggestions-heading > .suggestions-arrows {width:100%;margin-left:0;justify-content:flex-end;}
 :where(#tsunami-root) .suggestions-heading > .suggestions-arrows > .plex-view-toggle {margin-left:0;margin-right:auto;}
 :where(#tsunami-root) .discovery-widget header {flex-wrap:wrap;}
 :where(#tsunami-root) .discovery-arrows {margin-left:auto;justify-content:flex-end;}
}

/* One height and baseline for carousel filters and navigation. */
:where(#tsunami-root) :is(.suggestions-arrows,.discovery-arrows) {
 --carousel-control-size:40px;
 align-items:center;
}
:where(#tsunami-root) .suggestions-arrows {flex-wrap:nowrap;}
:where(#tsunami-root) .suggestions-arrows .plex-view-toggle {margin:0 8px 0 0;align-items:center;}
:where(#tsunami-root) :is(.suggestions-arrows,.discovery-arrows) button {
 display:inline-flex;align-items:center;justify-content:center;
 height:var(--carousel-control-size);min-height:var(--carousel-control-size);
 padding-top:0;padding-bottom:0;line-height:1;
}
:where(#tsunami-root) :is(.suggestions-arrows,.discovery-arrows) > button {
 width:var(--carousel-control-size);flex:0 0 var(--carousel-control-size);padding:0;
}
@media(pointer:coarse) {
 :where(#tsunami-root) :is(.suggestions-arrows,.discovery-arrows) {--carousel-control-size:44px;}
}

/* Keep the match action beside the title, including on narrow screens. */
:where(#tsunami-root) .search-match-heading {display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
:where(#tsunami-root) .search-match-heading strong {min-width:0;overflow-wrap:anywhere;}
:where(#tsunami-root) .search-match-heading .search-match-link {flex-shrink:0;line-height:inherit;}
:where(#tsunami-root) .search-download-dialog .match-auto-copy input {width:auto;flex-shrink:0;}
/* Match cards: align the three text rows with the poster on touch screens too. */
:where(#tsunami-root) .search-match-banner:has(> .search-match-poster) {align-items:stretch;}
:where(#tsunami-root) .search-match-banner > .search-match-poster {width:48px;height:auto;min-height:72px;align-self:stretch;object-fit:cover;}
:where(#tsunami-root) .search-match-banner > div {display:flex;flex-direction:column;min-height:72px;}
:where(#tsunami-root) .search-match-heading {align-items:baseline;gap:8px;line-height:20px;}
:where(#tsunami-root) .search-match-heading .search-match-link {min-height:0;margin:0;padding:0;line-height:20px;}
:where(#tsunami-root) .search-match-banner small {margin-top:2px;line-height:18px;}
:where(#tsunami-root) .search-match-banner > div > .match-plex-status,
:where(#tsunami-root) .search-match-banner > div > .match-proposal-description {margin-top:auto;padding-top:2px;line-height:20px;}
@media(max-width:900px) {
 :where(#tsunami-root) #recent-searches {order:-1;}
 :where(#tsunami-root) #recent-searches .recent-search-link {min-height:28px;line-height:20px;padding:4px 0;}
}
:where(#tsunami-root) .test-mode-setting {display:flex;align-items:center;justify-content:space-between;gap:20px;padding:16px;background:var(--raised);border-radius:12px;}
:where(#tsunami-root) .test-mode-setting small {display:block;color:var(--muted);margin-top:5px;font-size:12px;}
:where(#tsunami-root) .test-mode-setting input[role=switch] {appearance:none;width:51px;height:31px;min-width:51px;padding:0;margin:0;border:0;border-radius:20px;background:#53606e;position:relative;cursor:pointer;transition:background .18s;}
:where(#tsunami-root) .test-mode-setting input[role=switch]::after {content:'';position:absolute;left:3px;top:3px;width:25px;height:25px;background:white;border-radius:50%;box-shadow:0 1px 3px #0005;transition:transform .18s;}
:where(#tsunami-root) .test-mode-setting input[role=switch]:checked {background:var(--accent);}
:where(#tsunami-root) .test-mode-setting input[role=switch]:checked::after {transform:translateX(20px);}
@media(prefers-reduced-motion:reduce){:where(#tsunami-root) .test-mode-setting input[role=switch],:where(#tsunami-root) .test-mode-setting input[role=switch]::after{transition:none;}}
/* Brief touch feedback uses an outer halo, without resizing the card. */
@media (hover:none), (pointer:coarse) {
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover,.drawer-overview-card) {
  -webkit-tap-highlight-color:transparent;
  transition:background-color 150ms ease-out,box-shadow 150ms ease-out;
 }
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover):hover:not(.is-tapped) {background-color:transparent;}
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover,.drawer-overview-card).is-tapped:not(:disabled) {
  background-color:var(--raised);
  box-shadow:0 0 0 8px var(--raised);
  transition:none;
 }
 :where(#tsunami-root) :is(.suggestions-covers,.discovery-track,.tmdb-cast-track,.plex-seasons-grid) {
  padding-left:10px;padding-right:10px;margin-left:-8px;margin-right:-8px;
 }
 :where(#tsunami-root) :is(.suggestions-covers,.tmdb-cast-track,.plex-seasons-grid) {padding-top:12px;margin-top:-8px;}
}
@media (prefers-reduced-motion:reduce) {
 :where(#tsunami-root) :is(.plex-card,.tmdb-card,.suggestion-cover,.discovery-card,.plex-season,.tmdb-cast-person,.person-credit,.upcoming-cover,.drawer-overview-card) {transition:none;}
}
:where(#tsunami-root) .policy-duration-size {display:grid;gap:12px;}
:where(#tsunami-root) .policy-duration-size label {display:grid;gap:6px;}
:where(#tsunami-root) .policy-duration-size p {margin:0;line-height:1.6;}
:where(#tsunami-root) [data-size-reference] {white-space:pre-line;}

:where(#tsunami-root) .match-plex-breakdown {gap:10px;flex-wrap:wrap;font-size:12px;line-height:20px;}
:where(#tsunami-root) .match-plex-breakdown .plex-button-logo {width:38px;height:18px;}
:where(#tsunami-root) .match-plex-level {display:inline-flex;align-items:center;gap:4px;white-space:nowrap;color:var(--muted);}
:where(#tsunami-root) .match-plex-level > :first-child {font-size:16px;}

/* Desktop navigation owns a fixed rail; the content fills every remaining pixel. */
:where(#tsunami-root) .sidebar-label,
:where(#tsunami-root) .sidebar-submenu {display:none;}
@media (min-width:1024px) {
  #tsunami-root {--sidebar-width:220px;--topbar-height:0px !important;}
  :where(#tsunami-root) .topbar {position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);height:100dvh;padding:20px 12px 12px;display:flex;flex-direction:column;align-items:stretch;gap:16px;border-bottom:0;border-right:1px solid var(--line);}
  :where(#tsunami-root) .topbar > .brand {flex-shrink:0;padding:0 10px;margin:0;}
  :where(#tsunami-root) .topbar nav {display:flex;flex-direction:column;align-self:stretch;flex:1;min-height:0;width:100%;height:auto;gap:2px;margin:0;overflow-y:auto;overflow-x:hidden;}
  :where(#tsunami-root) .topbar nav > button {flex:0 0 auto;width:100%;min-height:36px;justify-content:flex-start;padding:8px 10px;border-radius:7px;gap:10px;text-align:left;font-size:14px;}
  :where(#tsunami-root) .topbar nav > button:last-child {padding:8px 10px;}
  :where(#tsunami-root) .topbar nav > button.active {background:var(--raised);color:var(--accent);}
  :where(#tsunami-root) .topbar nav button.active:after {display:none;}
  :where(#tsunami-root) .sidebar-label {display:inline;}
  :where(#tsunami-root) .topbar nav .nav-count {margin:0 0 0 2px;min-width:16px;height:16px;padding:0 4px;font-size:10px;line-height:16px;}
  :where(#tsunami-root) .sidebar-submenu {display:grid;gap:0;margin:0 0 8px 20px;padding-left:9px;border-left:1px solid var(--line);}
  :where(#tsunami-root) .topbar nav .sidebar-submenu button {display:block;flex:none;width:100%;min-height:28px;padding:4px 10px;text-align:left;border-radius:6px;font-size:12px;line-height:20px;}
  :where(#tsunami-root) .topbar nav .sidebar-submenu button:hover,
  :where(#tsunami-root) .topbar nav .sidebar-submenu button.is-current {background:var(--raised);color:var(--accent);}
  :where(#tsunami-root) .topbar > .account {flex-shrink:0;margin:0;gap:4px;padding-top:14px;border-top:1px solid var(--line);flex-wrap:wrap;}
  :where(#tsunami-root) #account-button {flex:1;text-align:left;padding-left:8px;}
  :where(#tsunami-root) #app > main {box-sizing:border-box;width:calc(100% - var(--sidebar-width));max-width:none;margin:0 0 0 var(--sidebar-width);min-height:100dvh;padding:24px;}
  :where(#tsunami-root) .topbar nav > button > svg {width:20px;height:20px;}
  :where(#tsunami-root) .topbar nav > button > .nav-service-logo {margin-left:0;object-position:left center;}
  :where(#tsunami-root) .topbar nav > button > .nav-plex-logo {width:36px;height:16px;}
  :where(#tsunami-root) .topbar nav > button > .nav-tmdb-logo {width:68px;height:16px;}
  :where(#tsunami-root) .admin-menu {top:24px;}
}

/* Reserve media geometry before either metadata or remote images arrive. */
:where(#tsunami-root) :is(.suggestions-covers,.discovery-track) {min-height:350px;align-items:flex-start;}
:where(#tsunami-root) :is(.recent-plex,.personal-suggestions,.discovery-widget) > p[role="status"] {min-height:20px;margin:8px 0;}
:where(#tsunami-root) .suggestion-cover strong {min-height:36px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
:where(#tsunami-root) .suggestion-cover small {display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
:where(#tsunami-root) :is(.plex-card,.tmdb-card) > img {aspect-ratio:2/3;object-fit:cover;background:var(--raised);}
:where(#tsunami-root) .media-skeleton {pointer-events:none;}
:where(#tsunami-root) .media-skeleton-card {display:flex;flex-direction:column;gap:8px;min-width:0;}
:where(#tsunami-root) :is(.suggestions-covers,.discovery-track) > .media-skeleton-card {flex:0 0 155px;}
:where(#tsunami-root) :is(.media-skeleton-poster,.media-skeleton-line,.media-skeleton-thumb) {display:block;background:var(--raised);border-radius:6px;}
:where(#tsunami-root) .media-skeleton-poster {width:100%;aspect-ratio:2/3;}
:where(#tsunami-root) .media-skeleton-line {height:14px;width:88%;margin:3px 0;}
:where(#tsunami-root) .media-skeleton-line:last-child {width:60%;}
:where(#tsunami-root) .media-skeleton-detail {display:grid;grid-template-columns:140px minmax(0,1fr);gap:24px;min-height:350px;padding:16px 0;}
:where(#tsunami-root) .media-skeleton-detail .media-skeleton-line {margin:14px 0;}
:where(#tsunami-root) .media-skeleton-row {display:flex;gap:18px;padding:16px 0;min-height:100px;}
:where(#tsunami-root) .media-skeleton-thumb {width:80px;height:60px;flex-shrink:0;}
:where(#tsunami-root) .media-skeleton-row > div {flex:1;}
:where(#tsunami-root) :is(.plex-list,.following-list) > .media-skeleton-card {display:grid;grid-template-columns:56px minmax(0,1fr);column-gap:14px;}
:where(#tsunami-root) :is(.plex-list,.following-list) .media-skeleton-poster {grid-row:span 3;}
@media(max-width:600px){:where(#tsunami-root) .media-skeleton-detail {grid-template-columns:90px minmax(0,1fr);gap:16px;}}
:where(#tsunami-root) :is(#upcoming-list,#suggestions-calendar) {min-height:300px;}
:where(#tsunami-root) :is(#upcoming-status,#watch-status) {min-height:20px;}
:where(#tsunami-root) .plex-cast-slot {min-height:200px;}
:where(#tsunami-root) .plex-related-slot {min-height:350px;}
:where(#tsunami-root) .plex-cast-slot .media-skeleton-rows {display:flex;gap:20px;overflow:hidden;height:200px;}
:where(#tsunami-root) .plex-cast-slot .media-skeleton-row {flex:0 0 112px;display:flex;flex-direction:column;align-items:center;}
:where(#tsunami-root) .plex-cast-slot .media-skeleton-thumb {width:88px;height:88px;border-radius:50%;}
:where(#tsunami-root) .plex-cast-slot .media-skeleton-row > div {width:100%;}
:where(#tsunami-root) :is(.plex-detail-overview,.plex-season) > img {aspect-ratio:2/3;object-fit:cover;background:var(--raised);}
:where(#tsunami-root) .discovery-card strong {min-height:36px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
:where(#tsunami-root) .search-match-banner {min-height:112px;}
:where(#tsunami-root) #passkey-login {justify-content:center;min-height:58px;font-size:17px;border-radius:10px;}
:where(#tsunami-root) #password-login-toggle {text-align:center;color:var(--muted);font-size:13px;text-decoration:underline;text-underline-offset:3px;}
:where(#tsunami-root) #password-login-toggle:hover {color:var(--accent);}
:where(#tsunami-root) #login-password {border:0;padding:8px 0 0;margin:0;min-width:0;display:grid;gap:17px;}
/* A focused entry point with a single clear primary action. */
#tsunami-root:has(> #login:not([hidden])) {min-height:100svh;background:radial-gradient(ellipse at 50% 20%,rgba(141,219,200,.055),transparent 60%);padding:clamp(56px,16vh,160px) 20px 40px;}
:where(#tsunami-root) #login {box-sizing:border-box;width:min(420px,100%);margin:0 auto;padding:36px 30px 28px;border:1px solid #2b3d42;border-radius:20px;background:linear-gradient(150deg,#172128,#111920);box-shadow:0 20px 60px #0003;}
:where(#tsunami-root) #login .brand {justify-content:center;gap:12px;font-size:30px;margin:0 0 38px;}
:where(#tsunami-root) #login .brand-mark {font-size:54px;}
:where(#tsunami-root) #login-form {gap:20px;}
:where(#tsunami-root) #passkey-login {display:flex;align-items:center;justify-content:center;gap:12px;min-height:56px;padding:14px 16px;font-size:15px;font-weight:650;border:1px solid #a4e6d7;border-radius:10px;box-shadow:0 3px 12px #0002;}
:where(#tsunami-root) #passkey-login span {margin:0;opacity:1;white-space:nowrap;}
:where(#tsunami-root) #passkey-login svg {flex-shrink:0;}
:where(#tsunami-root) #passkey-login .login-arrow {margin-left:auto;opacity:.7;}
:where(#tsunami-root) #password-login-toggle {justify-self:center;font-size:12px;line-height:20px;text-decoration-color:#607177;text-underline-offset:5px;}
:where(#tsunami-root) #login-form > .form-error:empty {display:none;}
:where(#tsunami-root) #login-password {padding-top:20px;border-top:1px solid var(--line);}
@media(max-width:420px){
 :where(#tsunami-root) #login {padding:30px 22px 26px;}
 :where(#tsunami-root) #login .brand {font-size:28px;margin-bottom:30px;}
 :where(#tsunami-root) #passkey-login {gap:8px;padding-inline:12px;font-size:14px;}
}

:where(#tsunami-root) .season-selection-list {display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;border:0;padding:12px 0;margin:0;max-height:45vh;overflow:auto;}
:where(#tsunami-root) .season-selection-row {display:flex;align-items:center;gap:12px;background:var(--panel,#17212b);border:1px solid var(--line);border-radius:12px;padding:14px;cursor:pointer;}
:where(#tsunami-root) .season-selection-row:has(input:checked) {border-color:var(--accent,#8ddbc8);background:#1c3430;}
:where(#tsunami-root) .season-selection-row span {display:grid;gap:5px;}
:where(#tsunami-root) .season-selection-actions {display:flex;gap:8px;flex-wrap:wrap;}
