:root {
  --canvas: #edf2ef;
  --surface: #fbfdfb;
  --surface-muted: #f3f7f4;
  --ink: #15342d;
  --ink-soft: #5b6d67;
  --line: #d6e0da;
  --accent: #087d70;
  --accent-strong: #05685e;
  --accent-pale: #d9f1e9;
  --danger: #b94246;
  --danger-pale: #f9e5e5;
  --sidebar: #14372f;
  --sidebar-soft: #a8c6bb;
  --sidebar-line: #2b5549;
  --shadow: 0 18px 45px rgba(21, 52, 45, 0.11);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background-color: var(--canvas);
  background-image: linear-gradient(rgba(8, 125, 112, 0.045) 1px, transparent 1px), linear-gradient(90deg, rgba(8, 125, 112, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(8, 125, 112, 0.3);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(360px, 0.95fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
  padding: clamp(2.5rem, 9vw, 9rem);
  overflow: hidden;
  color: #eff8f3;
  background: var(--sidebar);
}

.login-brand::before,
.login-brand::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.login-brand::before {
  width: 68%;
  height: 1px;
  right: -7%;
  bottom: 23%;
  background: #7dd7bd;
  box-shadow: 0 26px 0 rgba(125, 215, 189, 0.48), 0 -26px 0 rgba(125, 215, 189, 0.28);
  transform: rotate(-32deg);
}

.login-brand::after {
  inset: 0;
  background-image: linear-gradient(120deg, transparent 0 47%, rgba(160, 232, 207, 0.12) 47% 48%, transparent 48% 100%);
  background-size: 100% 84px;
}

.login-brand > * {
  position: relative;
  z-index: 1;
}

.brand-mark {
  display: inline-flex;
  gap: 5px;
  align-items: end;
  width: fit-content;
  margin-bottom: 2rem;
}

.brand-mark span {
  display: block;
  width: 8px;
  background: #8ee0c5;
}

.brand-mark span:nth-child(1) {
  height: 16px;
}

.brand-mark span:nth-child(2) {
  height: 31px;
}

.brand-mark span:nth-child(3) {
  height: 45px;
}

.small-mark {
  margin: 0;
}

.small-mark span {
  width: 5px;
}

.small-mark span:nth-child(1) {
  height: 10px;
}

.small-mark span:nth-child(2) {
  height: 19px;
}

.small-mark span:nth-child(3) {
  height: 28px;
}

.brand-kicker,
.eyebrow {
  margin: 0;
  color: var(--accent);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.71rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-kicker {
  color: #9bd9c3;
}

.login-brand h1 {
  max-width: 540px;
  margin: 0.6rem 0 0;
  font-size: clamp(3.6rem, 7vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.brand-copy {
  max-width: 300px;
  margin: 1.75rem 0 0;
  color: #b8d5c9;
  font-size: 1rem;
  line-height: 1.75;
}

.brand-lines {
  width: 100%;
  max-width: 325px;
  height: 1px;
  margin-top: 4rem;
  background: #4c7d6e;
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 530px);
  min-height: 100%;
  padding: clamp(2rem, 8vw, 7rem);
  margin: 0 auto;
}

.login-heading h2,
.content-heading h2,
.upload-panel h2 {
  margin: 0.4rem 0 0;
  color: var(--ink);
  letter-spacing: 0;
}

.login-heading h2 {
  font-size: 2.3rem;
}

.login-form {
  display: grid;
  gap: 0.65rem;
  margin-top: 2.75rem;
}

.field-label {
  margin-top: 1.1rem;
  color: var(--ink);
  font-size: 0.83rem;
  font-weight: 700;
}

.input-wrap,
.search-box {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.input-wrap {
  padding: 0 0.9rem;
}

.input-wrap:focus-within,
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 125, 112, 0.12);
}

.input-wrap svg,
.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.input-wrap input,
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
}

.form-error {
  min-height: 1.2rem;
  margin: 0.7rem 0 0;
  color: var(--danger);
  font-size: 0.82rem;
}

.primary-button,
.up-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-button:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.primary-button svg,
.up-button svg {
  width: 17px;
  height: 17px;
}

.wide-button {
  width: 100%;
  margin-top: 1.6rem;
}

.dashboard {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 1.5rem 1rem 1rem;
  color: #ecf8f1;
  background: var(--sidebar);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.55rem 2rem;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.sidebar-brand span {
  margin-top: 0.12rem;
  color: var(--sidebar-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.library-nav {
  display: grid;
  gap: 0.32rem;
}

.library-button {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 0.65rem;
  align-items: center;
  min-height: 43px;
  padding: 0.6rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #bad4c9;
  background: transparent;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.library-button:hover,
.library-button.active {
  color: #f6fffa;
  background: #215246;
}

.library-button.active {
  border-color: #397365;
}

.library-button svg {
  width: 18px;
  height: 18px;
}

.library-label {
  overflow: hidden;
  font-size: 0.87rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-count {
  min-width: 1.35rem;
  color: #8db8a9;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  text-align: right;
}

.sidebar-account {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
  gap: 0.65rem;
  align-items: center;
  padding: 1rem 0.55rem 0.35rem;
  margin-top: auto;
  border-top: 1px solid var(--sidebar-line);
}

.account-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid #5d9382;
  border-radius: 50%;
  color: #d9f5e8;
  background: #255e51;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 700;
}

.account-name {
  min-width: 0;
}

.account-name strong,
.account-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-name strong {
  color: #edf9f3;
  font-size: 0.78rem;
}

.account-name span {
  margin-top: 0.17rem;
  color: var(--sidebar-soft);
  font-size: 0.67rem;
}

.workspace {
  min-width: 0;
  padding: clamp(1.3rem, 3vw, 2.7rem);
}

.mobile-header {
  display: none;
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.8rem;
}

.workspace-header h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.search-box {
  width: clamp(190px, 24vw, 280px);
  padding: 0 0.78rem;
  border-radius: 6px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-button:hover {
  border-color: #aec3ba;
  background: var(--surface-muted);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.icon-button[data-tooltip]::after {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 0.34rem 0.48rem;
  border-radius: 4px;
  color: #f4fbf7;
  background: #17372f;
  content: attr(data-tooltip);
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity 130ms ease, transform 130ms ease;
  white-space: nowrap;
}

.icon-button[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.icon-button.inverted {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: transparent;
  color: #c8e4d7;
  background: transparent;
}

.icon-button.inverted:hover {
  background: #255e51;
}

.icon-button.inverted[data-tooltip]::after {
  bottom: calc(100% + 5px);
}

.icon-button.danger {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-color: transparent;
  color: var(--danger);
  background: transparent;
}

.icon-button.danger:hover {
  border-color: #f0b6b7;
  background: var(--danger-pale);
}

.overview {
  display: grid;
  grid-template-columns: minmax(170px, 1.75fr) repeat(2, minmax(105px, 0.55fr)) auto;
  gap: 0;
  align-items: stretch;
  margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 251, 0.62);
}

.overview-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 87px;
  padding: 1rem 1.15rem;
  border-right: 1px solid var(--line);
}

.overview-item span {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.overview-item strong {
  overflow: hidden;
  margin-top: 0.38rem;
  color: var(--ink);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.up-button {
  align-self: center;
  justify-self: end;
  min-height: 38px;
  margin: 0.8rem 1rem;
  border-color: transparent;
  color: var(--accent-strong);
  background: var(--accent-pale);
}

.up-button:hover {
  border-color: #a0d7c9;
  background: #ccebe0;
  transform: none;
}

.catalog-section {
  margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 251, 0.62);
}

.catalog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.8rem;
}

.catalog-heading h2 {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
}

.catalog-count {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
}

.catalog-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  padding: 0 1.15rem 1rem;
}

.catalog-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 1rem 0.8rem;
  padding: 0 1.15rem 1rem;
}

.catalog-item {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0.5rem;
  min-width: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.catalog-item:hover,
.catalog-item:focus-visible {
  outline: 0;
}

.catalog-item-poster {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  background: var(--surface-muted);
}

.catalog-item-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.catalog-item:hover .catalog-item-poster img,
.catalog-item:focus-visible .catalog-item-poster img {
  transform: scale(1.04);
}

.catalog-item-year {
  position: absolute;
  top: 0.45rem;
  left: 0.45rem;
  padding: 0.18rem 0.35rem;
  border-radius: 3px;
  color: #fff;
  background: #13ad53;
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.catalog-item-details {
  display: grid;
  min-width: 0;
  gap: 0.16rem;
}

.catalog-item-details strong,
.catalog-item-details small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-item-details strong {
  font-size: 0.73rem;
  line-height: 1.35;
}

.catalog-item-details small {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.63rem;
}

.catalog-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  padding: 0 1.15rem 1.1rem;
}

.catalog-page {
  min-width: 34px;
  height: 34px;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink-soft);
  background: var(--surface);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  cursor: pointer;
}

.catalog-page:hover,
.catalog-page:focus-visible {
  border-color: var(--accent);
  color: var(--accent-strong);
  outline: 0;
}

.catalog-page.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
  cursor: default;
}

.catalog-dialog {
  width: min(720px, calc(100vw - 2rem));
  max-height: min(720px, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(17, 42, 37, 0.22);
}

.catalog-details {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.15rem;
}

.catalog-poster {
  width: 150px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--surface-muted);
}

.catalog-detail-content {
  min-width: 0;
}

.catalog-synopsis,
.catalog-loading {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.6;
}

.catalog-fields {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.catalog-field {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.75rem;
}

.catalog-field span {
  color: var(--ink-soft);
}

.catalog-field strong {
  font-weight: 700;
}

.catalog-imdb {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.catalog-magnets {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.catalog-magnets-label {
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.catalog-magnet-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.catalog-magnet-row code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.catalog-magnet-button {
  flex: none;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.catalog-magnet-button:hover,
.catalog-magnet-button:focus-visible {
  border-color: var(--accent-strong);
  color: var(--accent-strong);
}

.catalog-magnet-button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.catalog-magnet-button.primary {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: var(--paper, #fff);
}

.torrent-section {
  margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 251, 0.62);
}

.torrent-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.8rem;
}

.torrent-heading h2 {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
}

.torrent-destination {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.torrent-destination-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.45rem;
}

.torrent-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  padding: 0 1.15rem 1rem;
}

.torrent-link-field {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  gap: 0.65rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface);
}

.torrent-link-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 125, 112, 0.12);
}

.torrent-link-field svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.torrent-link-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.82rem;
}

.torrent-rows {
  display: grid;
  border-top: 1px solid var(--line);
}

.torrent-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) minmax(120px, 0.6fr) 44px auto;
  gap: 0.8rem;
  align-items: center;
  min-height: 76px;
  padding: 0.8rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.torrent-main,
.torrent-stats {
  min-width: 0;
}

.torrent-main strong,
.torrent-main span,
.torrent-stats span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.torrent-main strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.torrent-main span,
.torrent-stats span:last-child {
  margin-top: 0.22rem;
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.65rem;
}

.torrent-status {
  color: var(--ink) !important;
  font-size: 0.72rem !important;
  font-weight: 800;
}

.torrent-status[data-state="downloading"] {
  color: var(--accent-strong) !important;
}

.torrent-status[data-state="error"] {
  color: var(--danger) !important;
}

.torrent-progress {
  height: 7px;
  overflow: hidden;
  border-radius: 10px;
  background: #d8e7df;
}

.torrent-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 250ms ease;
}

.torrent-percent {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.69rem;
  text-align: right;
}

.torrent-actions {
  display: flex;
  gap: 0.35rem;
}

.torrent-empty {
  margin: 0;
  padding: 1.5rem 1.15rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.iptv-section {
  margin-bottom: 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 251, 0.62);
}

.iptv-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.8rem;
}

.iptv-heading h2 {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
}

.iptv-hint,
.iptv-result-details,
.iptv-final-url {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
}

.iptv-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  padding: 0 1.15rem 1rem;
}

.iptv-url-field {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 44px;
  gap: 0.65rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-soft);
  background: var(--surface);
}

.iptv-url-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 125, 112, 0.12);
}

.iptv-url-field svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
}

.iptv-url-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 0.82rem;
}

.iptv-result {
  display: grid;
  gap: 0.55rem;
  padding: 0.9rem 1.15rem;
  border-top: 1px solid var(--line);
  background: var(--accent-pale);
}

.iptv-result[data-kind="error"] {
  background: var(--danger-pale);
  color: var(--danger);
}

.iptv-result-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.iptv-result-details span:not(:last-child)::after {
  margin-left: 0.55rem;
  color: var(--line);
  content: "|";
}

.iptv-final-url {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-view {
  width: min(100%, 1080px);
}

.catalog-view {
  width: min(100%, 1080px);
}

.tv-active .media-only,
.catalog-active .media-only {
  display: none;
}

.catalog-source-group {
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.catalog-source-field {
  display: grid;
  gap: 0.25rem;
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.62rem;
}

.catalog-source-field select {
  min-width: 150px;
  height: 32px;
  padding: 0 0.5rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface);
  font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 0.75rem;
}

.tv-workspace-header {
  padding-bottom: 1.8rem;
}

.tv-status {
  padding: 0.42rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
}

.tv-status[data-state="ready"] {
  border-color: #9ed8c9;
  color: var(--accent-strong);
  background: var(--accent-pale);
}

.tv-panel {
  margin-bottom: 1.5rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(251, 253, 251, 0.62);
}

.tv-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem 0.8rem;
}

.tv-panel-heading h2 {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
}

.tv-token-form,
.tv-channel-form {
  display: grid;
  gap: 0.65rem;
  padding: 0 1.15rem 1rem;
}

.tv-token-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.tv-channel-form {
  grid-template-columns: minmax(140px, 0.6fr) minmax(220px, 1.4fr) minmax(120px, 0.5fr) minmax(180px, 1fr) auto;
  align-items: end;
}

.tv-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.tv-field input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.tv-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8, 125, 112, 0.12);
}

.tv-playlist-url {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--line);
  background: var(--accent-pale);
}

.tv-playlist-url code {
  overflow: hidden;
  color: var(--ink);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-channels {
  display: grid;
  border-top: 1px solid var(--line);
}

.tv-channel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 1rem;
  align-items: center;
  min-height: 72px;
  padding: 0.8rem 1.15rem;
  border-bottom: 1px solid var(--line);
}

.tv-channel-details {
  display: grid;
  min-width: 0;
  gap: 0.18rem;
}

.tv-channel-details strong,
.tv-channel-details span,
.tv-channel-details code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-channel-details strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.tv-channel-details span,
.tv-channel-details code {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.67rem;
}

.tv-channel-actions {
  display: flex;
  gap: 0.2rem;
}

.tv-edit-form {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
}

.tv-edit-form .dialog-actions {
  padding: 0.25rem 0 0;
  border-top: 0;
}

.m3u-import-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 0.8fr) auto;
  gap: 0.65rem;
  align-items: end;
  padding: 0 1.15rem 1rem;
}

.m3u-import-result {
  border-top: 1px solid var(--line);
}

.m3u-import-summary,
.m3u-import-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.15rem;
}

.m3u-import-summary {
  color: var(--ink);
  background: var(--accent-pale);
  font-size: 0.8rem;
}

.m3u-select-all {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.45rem;
  align-items: center;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.m3u-select-all input,
.m3u-import-channel input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.m3u-import-channels {
  display: grid;
  max-height: 360px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.m3u-import-channel {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 1.15rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.m3u-import-channel:hover {
  background: var(--surface-muted);
}

.m3u-import-channel-details {
  display: grid;
  min-width: 0;
  gap: 0.15rem;
}

.m3u-import-channel-details strong,
.m3u-import-channel-details span,
.m3u-import-channel-details code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.m3u-import-channel-details strong {
  color: var(--ink);
  font-size: 0.8rem;
}

.m3u-import-channel-details span,
.m3u-import-channel-details code,
.m3u-import-actions > span {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.67rem;
}

.m3u-import-actions {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.tv-empty {
  margin: 0;
  padding: 1.5rem 1.15rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.content-area {
  min-height: 360px;
}

.content-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.content-heading h2 {
  font-size: 1.25rem;
}

.item-count {
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.72rem;
}

.table-wrap {
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 650px;
  border-spacing: 0;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  padding: 0.75rem 0.85rem;
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  height: 66px;
  padding: 0.7rem 0.85rem;
  color: var(--ink-soft);
  font-size: 0.79rem;
}

tbody tr {
  background: rgba(251, 253, 251, 0.45);
  transition: background 140ms ease;
}

tbody tr:hover {
  background: var(--surface);
}

th:first-child,
td:first-child {
  width: 48%;
  padding-left: 0.15rem;
}

th:last-child,
td:last-child {
  width: 48px;
  padding-right: 0.1rem;
  text-align: right;
}

.name-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
}

.name-cell > svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  color: var(--accent);
}

.entry-name,
.directory-link {
  overflow: hidden;
  color: inherit;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-link {
  padding: 0;
  border: 0;
  background: transparent;
}

.directory-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.type-cell,
.size-cell,
.date-cell {
  white-space: nowrap;
}

.size-cell,
.date-cell {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.7rem;
}

.row-actions {
  display: flex;
  gap: 0.2rem;
  justify-content: flex-end;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 0.85rem;
  padding: 5rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  background: rgba(251, 253, 251, 0.48);
}

.empty-state svg {
  width: 31px;
  height: 31px;
  color: var(--accent);
}

.empty-state p {
  margin: 0;
  font-size: 0.86rem;
}

.upload-panel {
  position: fixed;
  z-index: 10;
  right: 1.5rem;
  bottom: 1.5rem;
  width: min(390px, calc(100vw - 2rem));
  max-height: min(440px, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.upload-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.upload-panel h2 {
  font-size: 1.1rem;
}

.upload-rows {
  display: grid;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px 66px;
  gap: 0.7rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}

.upload-row:last-child {
  border-bottom: 0;
}

.upload-details {
  min-width: 0;
}

.upload-details strong,
.upload-details span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-details strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.upload-details span {
  margin-top: 0.22rem;
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.64rem;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 10px;
  background: #d8e7df;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 120ms linear;
}

.upload-row[data-state="done"] .progress-bar {
  background: #2c9a5e;
}

.upload-row[data-state="failed"] .progress-bar {
  background: var(--danger);
}

.upload-percent {
  overflow: hidden;
  color: var(--ink-soft);
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dialog-backdrop {
  position: fixed;
  z-index: 25;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(12, 40, 32, 0.5);
}

.destination-dialog {
  width: min(520px, 100%);
  max-height: min(620px, calc(100vh - 2rem));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.dialog-header {
  border-bottom: 1px solid var(--line);
}

.dialog-header h2 {
  margin: 0.35rem 0 0;
  font-size: 1.2rem;
}

.dialog-path {
  margin: 0;
  padding: 0.85rem 1rem;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.8rem;
}

.dialog-path strong {
  color: var(--ink);
  font-family: "DM Mono", ui-monospace, monospace;
  font-weight: 500;
}

.destination-library-field {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 700;
}

.destination-library-field select {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: var(--surface-muted);
  font: inherit;
}

.destination-folders {
  display: grid;
  max-height: 310px;
  overflow-y: auto;
}

.destination-folder {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 18px;
  gap: 0.7rem;
  align-items: center;
  min-height: 52px;
  padding: 0.75rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  font-size: 0.83rem;
  font-weight: 700;
  text-align: left;
}

.destination-folder:hover {
  background: var(--surface-muted);
  color: var(--accent-strong);
}

.destination-folder span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destination-folder svg:first-child {
  color: var(--accent);
}

.destination-folder svg:last-child {
  color: var(--ink-soft);
}

.destination-empty {
  margin: 0;
  padding: 2rem 1rem;
  color: var(--ink-soft);
  font-size: 0.82rem;
  text-align: center;
}

.dialog-actions {
  border-top: 1px solid var(--line);
}

.dialog-up-button {
  justify-content: flex-start;
  margin: 0;
}

.toast {
  position: fixed;
  z-index: 30;
  bottom: 1.5rem;
  left: 50%;
  max-width: min(440px, calc(100vw - 2rem));
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: #f6fffa;
  background: #1b4d40;
  box-shadow: 0 9px 22px rgba(21, 52, 45, 0.2);
  font-size: 0.82rem;
  font-weight: 700;
  transform: translateX(-50%);
}

.toast[data-type="error"] {
  background: #9f353b;
}

@media (max-width: 960px) {
  .dashboard {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .sidebar {
    padding: 1rem 0.75rem;
  }

  .sidebar-brand {
    justify-content: center;
    padding: 0.45rem 0 1.7rem;
  }

  .sidebar-brand > div:last-child,
  .library-label,
  .library-count,
  .account-name {
    display: none;
  }

  .library-button {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.7rem;
  }

  .sidebar-account {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 1rem 0 0;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .search-box {
    flex: 1;
  }
}

@media (max-width: 680px) {
  body {
    background-size: 22px 22px;
  }

  .login-shell {
    display: block;
  }

  .login-brand {
    min-height: 300px;
    padding: 2.4rem 1.8rem;
  }

  .login-brand h1 {
    font-size: 4rem;
  }

  .brand-copy,
  .brand-lines {
    margin-top: 1rem;
  }

  .login-panel {
    min-height: auto;
    padding: 2.5rem 1.8rem 3rem;
  }

  .dashboard {
    display: block;
  }

  .mobile-header {
    display: flex;
    position: sticky;
    z-index: 20;
    top: 0;
    align-items: center;
    justify-content: space-between;
    min-height: calc(3.8rem + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 0.85rem 0;
    color: #ecf8f1;
    background: var(--sidebar);
    box-shadow: 0 1px 0 var(--sidebar-line);
  }

  .mobile-header-brand {
    display: flex;
    gap: 0.6rem;
    align-items: center;
  }

  .mobile-header-brand strong {
    font-size: 0.95rem;
  }

  .mobile-header .icon-button {
    border-color: #397365;
    color: #ecf8f1;
    background: #215246;
  }

  /* Barra de navegação inferior, estilo app */
  .sidebar {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    top: auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    padding: 0.3rem 0.4rem calc(0.3rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--sidebar-line);
    box-shadow: 0 -6px 18px rgba(9, 34, 28, 0.28);
    gap: 0.2rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .sidebar-brand {
    display: none;
  }

  .library-nav {
    display: contents;
  }

  .library-button {
    display: grid;
    position: relative;
    flex: 0 0 68px;
    grid-template-columns: 1fr;
    gap: 0.18rem;
    justify-items: center;
    align-content: center;
    min-width: 0;
    min-height: 52px;
    padding: 0.4rem 0.25rem;
    border-radius: 8px;
    text-align: center;
  }

  .library-button svg {
    width: 21px;
    height: 21px;
  }

  .library-label {
    display: block;
    max-width: 100%;
    font-size: 0.6rem;
    white-space: nowrap;
  }

  .library-count {
    display: none;
  }

  .sidebar-account {
    display: none;
  }

  .workspace {
    padding: 1rem 0.85rem calc(5.4rem + env(safe-area-inset-bottom));
  }

  .workspace-header {
    gap: 1rem;
    padding-bottom: 1.2rem;
  }

  .header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .search-box {
    width: auto;
  }

  .header-actions .primary-button {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
  }

  .header-actions .upload-folder-button {
    grid-column: 2;
    grid-row: 2;
  }

  .overview {
    grid-template-columns: 1fr 1fr;
    margin-bottom: 1.5rem;
  }

  .overview-item:first-child {
    grid-column: 1 / -1;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
  }

  .overview-item:nth-child(3) {
    border-right: 0;
  }

  .up-button {
    grid-column: 1 / -1;
    justify-self: stretch;
    margin: 0.75rem;
  }

  .table-wrap {
    margin: 0;
    padding: 0;
    overflow: visible;
    border-top: 0;
  }

  table,
  tbody {
    display: block;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 0.55rem;
  }

  tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.7rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
  }

  td,
  th:first-child,
  td:first-child,
  th:last-child,
  td:last-child {
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }

  td:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  td:last-child {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .type-cell,
  .size-cell,
  .date-cell {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    margin-top: 0.15rem;
    font-size: 0.65rem;
  }

  .type-cell::before,
  .size-cell::before,
  .date-cell::before {
    color: var(--ink-soft);
    content: attr(data-label) ":";
    font-family: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
  }

  .date-cell {
    display: none;
  }

  .name-cell {
    gap: 0.6rem;
  }

  .entry-name,
  .directory-link {
    font-size: 0.8rem;
  }

  .icon-button.danger {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .empty-state {
    padding: 3.5rem 1rem;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .torrent-section {
    margin-bottom: 1.5rem;
  }

  .catalog-section {
    margin-bottom: 1.5rem;
  }

  .catalog-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9rem;
  }

  .catalog-heading h2 {
    font-size: 1.05rem;
  }

  .catalog-source-group {
    width: 100%;
    align-items: end;
    justify-content: space-between;
  }

  .catalog-source-field,
  .catalog-source-field select {
    min-width: 0;
    width: 100%;
  }

  .catalog-form {
    grid-template-columns: 1fr;
    padding: 0 0.9rem 0.9rem;
  }

  .catalog-form .primary-button {
    width: 100%;
  }

  .catalog-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem 0.65rem;
    padding: 0 0.9rem 0.9rem;
  }

  .catalog-pagination {
    gap: 0.3rem;
    padding: 0 0.9rem 1rem;
  }

  .catalog-page {
    min-width: 32px;
    height: 32px;
    padding: 0 0.45rem;
  }

  .catalog-dialog {
    width: 100%;
    max-height: min(82dvh, 720px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
  }

  .catalog-details {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.9rem;
  }

  .catalog-poster {
    width: 96px;
  }

  .catalog-field {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .torrent-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9rem;
  }

  .torrent-heading h2 {
    font-size: 1.05rem;
  }

  .torrent-destination {
    width: 100%;
    text-align: left;
  }

  .torrent-form {
    grid-template-columns: 1fr;
    padding: 0 0.9rem 0.9rem;
  }

  .torrent-form .primary-button {
    width: 100%;
  }

  .torrent-link-field {
    height: 48px;
  }

  .torrent-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem 0.7rem;
    padding: 0.85rem 0.9rem;
  }

  .torrent-main {
    grid-column: 1;
    grid-row: 1;
  }

  .torrent-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .torrent-stats {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .torrent-stats span {
    display: inline;
  }

  .torrent-stats span:last-child::before {
    content: " · ";
  }

  .torrent-progress {
    grid-column: 1;
    grid-row: 3;
  }

  .torrent-percent {
    grid-column: 2;
    grid-row: 3;
  }

  .torrent-empty {
    padding: 1.2rem 0.9rem;
  }

  .iptv-section {
    margin-bottom: 1rem;
  }

  .iptv-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.9rem;
  }

  .iptv-form {
    grid-template-columns: 1fr;
    padding: 0 0.9rem 0.9rem;
  }

  .iptv-form .primary-button {
    width: 100%;
  }

  .iptv-result {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .m3u-import-form {
    grid-template-columns: 1fr;
    padding: 0 0.9rem 0.9rem;
  }

  .m3u-import-form .primary-button {
    width: 100%;
  }

  .m3u-import-summary,
  .m3u-import-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.75rem 0.9rem;
  }

  .m3u-import-actions .primary-button {
    width: 100%;
  }

  .m3u-import-channel {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .dialog-backdrop {
    align-items: end;
    padding: 0;
  }

  .destination-dialog {
    width: 100%;
    max-height: min(82dvh, 720px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
  }

  .dialog-header,
  .dialog-actions {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .dialog-header {
    position: relative;
    padding-top: 1.3rem;
  }

  .dialog-header::before {
    position: absolute;
    top: 0.55rem;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 8px;
    background: #b6c9c0;
    content: "";
    transform: translateX(-50%);
  }

  .destination-folders {
    max-height: 42dvh;
  }

  .destination-folder {
    min-height: 58px;
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom));
  }

  .dialog-up-button {
    min-height: 44px;
    padding: 0.55rem 0.7rem;
  }

  .dialog-actions .primary-button {
    min-height: 44px;
    white-space: nowrap;
  }

  .upload-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(52dvh, 460px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
  }

  .upload-panel-header {
    padding: 0.9rem;
  }

  .upload-row {
    grid-template-columns: minmax(0, 1fr) 72px 64px;
    gap: 0.55rem;
    padding: 0.85rem 0.9rem;
  }

  .tv-workspace-header {
    align-items: flex-start;
    flex-direction: row;
    padding-bottom: 1.2rem;
  }

  .tv-panel {
    margin-bottom: 1rem;
  }

  .tv-panel-heading,
  .tv-token-form,
  .tv-channel-form,
  .tv-playlist-url,
  .tv-channel {
    padding-right: 0.9rem;
    padding-left: 0.9rem;
  }

  .tv-token-form,
  .tv-channel-form {
    grid-template-columns: 1fr;
  }

  .tv-token-form .primary-button,
  .tv-channel-form .primary-button {
    width: 100%;
  }

  .tv-playlist-url {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .tv-channel {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .toast {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    font-size: 0.78rem;
  }
}