/* Torrents for Mac — warm shelf, left rail.
   Colours and the rail width live here; everything else is plain rules. */

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-400i.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito Sans";
  src: url("../fonts/nunito-sans-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf7f0;
  --ink: #2d2620;
  --muted: #705f54;
  --ink-soft: #4e433b;
  --accent: #b5651d;
  --accent-ink: #8b4d15;
  --btn: #ac601b;
  --btn-ink: #fffcf7;
  --btn-hover: #995317;
  --rail: #f2e6d4;
  --card: #fffcf7;
  --line: #e3d4c2;
  --soft: #f5eee3;
  --flag: #eddcc6;
  --danger: #8e4235;
  --ok: #3b5944;
  --mark-a: #f8e2cc;
  --mark-b: #e7c8a4;
  --sans: "Nunito Sans", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --rail-w: 240px;
}

html[data-tf-theme="dark"] {
  --paper: #261e18;
  --ink: #f4ece4;
  --muted: #c9b8a8;
  --ink-soft: #e4d5c6;
  --accent: #d4924e;
  --accent-ink: #e2b07a;
  --btn: #d4924e;
  --btn-ink: #1e1814;
  --btn-hover: #e2b07a;
  --rail: #1e1814;
  --card: #2e261f;
  --line: #42382f;
  --soft: #2a221c;
  --flag: #3c2e24;
  --danger: #e3a89e;
  --ok: #b7d0ba;
  --mark-a: #3c2e24;
  --mark-b: #2a221c;
  color-scheme: dark;
}

html { color-scheme: light; }
html[data-tf-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { overflow-wrap: break-word; }

h1 {
  font-size: 2.05rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0 0 0.45em;
}

h2 {
  font-size: 1.38rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-weight: 700;
  margin: 0;
}

h3 { font-size: 1.08rem; margin: 1.2em 0 0.3em; }

a { color: var(--accent-ink); }
a:visited { color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 2px;
}

.tf-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--ink);
  color: var(--paper);
  padding: 6px 10px;
  z-index: 8;
  text-decoration: none;
  font-weight: 700;
}

.tf-skip:focus { top: 8px; }

/* frame: rail is the whole header */
.tf-frame {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  align-items: stretch;
  min-height: 100vh;
}

.tf-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--rail);
  border-right: 1px solid var(--line);
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* safari: otherwise the sticky rail jumps */
}

.tf-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.tf-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 26px 28px 72px;
  max-width: 1180px;
}

.tf-rail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 10px;
}

.tf-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  flex: 1 1 140px;
  min-width: 0;
}

.tf-brand:visited { color: var(--ink); }

.tf-mark {
  width: 36px;
  height: 36px;
  flex: none;
  display: block;
  color: var(--ink);
  background: radial-gradient(circle at 40% 35%, var(--mark-a), var(--mark-b));
  border-radius: 50%;
}

.tf-brand-name {
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.tf-slogan {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.35;
}

.tf-burger {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 5px 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
}

.tf-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 8px 0 0;
}

.tf-menu a {
  color: var(--ink);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 2px;
  font-weight: 600;
}

.tf-menu a:visited { color: var(--ink); }
.tf-menu a:hover { background: var(--soft); }

.tf-menu a[aria-current="page"] {
  background: var(--soft);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 700;
}

.tf-rail-foot {
  margin-top: auto;
  padding-top: 14px;
}

.tf-theme {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  padding: 5px 9px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  background: var(--card);
}

.tf-theme-moon { display: none; }
html[data-tf-theme="dark"] .tf-theme-sun { display: none; }
html[data-tf-theme="dark"] .tf-theme-moon { display: block; }

.tf-user {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}

.tf-signin {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.tf-signin:visited { color: var(--ink); }

.tf-who {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  min-width: 0;
}

.tf-who:visited { color: var(--ink); }

.tf-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--btn-ink);
  display: inline-grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}

.tf-who-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9.5rem;
}

.tf-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tf-bellbox { position: relative; }

.tf-bell, .tf-signout, .tf-fav, .tf-older, .tf-tab, .tf-sort button, .tf-like, .tf-reply, .tf-modal-x {
  cursor: pointer;
}

.tf-bell {
  position: relative;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 2px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
}

.tf-bell-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fffcf7;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.tf-drop {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  width: min(280px, 78vw);
  background: var(--card);
  border: 1px solid var(--line);
  z-index: 7;
  padding: 4px 0;
  box-shadow: 0 8px 18px rgba(45, 38, 32, 0.08);
}

.tf-drop[hidden] { display: none; }

.tf-drop-item {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink);
  border-top: 1px solid transparent;
}

.tf-drop-item:visited { color: var(--ink); }
.tf-drop-item:hover { background: var(--soft); }

.tf-unread { font-weight: 700; box-shadow: inset 3px 0 0 var(--accent); }

.tf-drop-item time, .tf-note-row time {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  font-style: normal;
}

.tf-drop-all {
  display: block;
  padding: 8px 12px;
  font-weight: 700;
  border-top: 1px solid var(--line);
}

.tf-signout {
  background: transparent;
  border: 0;
  padding: 4px 0;
  color: var(--accent-ink);
  font-weight: 700;
}

/* tiles */
.tf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}

.tf-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  padding: 11px 11px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink);
  text-decoration: none;
}

.tf-tile:visited { color: var(--ink); }
.tf-tile:hover { background: var(--soft); border-color: #c9b39a; }

.tf-tile-ico {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  flex: none;
}

.tf-tile-name {
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.tf-tile-ver, .tf-bpm {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tf-tile-cat { color: var(--muted); font-size: 0.82rem; }

.tf-tile-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.tf-tile-size {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--flag);
  color: var(--ink);
  padding: 1px 5px;
}

.tf-tile-flag {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  font-weight: 700;
}

/* home */
.tf-leadin {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(210px, 0.85fr);
  gap: 28px 32px;
  align-items: start;
  margin-bottom: 28px;
}

.tf-lede p { margin: 0 0 0.75em; }
.tf-lede ul { margin: 0.2em 0 0.6em; padding-left: 1.15em; }
.tf-sign { color: var(--muted); font-style: italic; }
.tf-lede-cat { max-width: 62ch; color: var(--ink-soft); margin-top: 0; }

.tf-popular {
  border-top: 3px solid var(--accent);
  padding-top: 8px;
}

.tf-popular h2 { margin-bottom: 4px; }

.tf-pop {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tf-pop li { border-top: 1px solid var(--line); }

.tf-pop a {
  display: grid;
  grid-template-columns: 1.5rem 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  text-decoration: none;
  color: var(--ink);
  position: relative;
}

.tf-pop a:visited { color: var(--ink); }

.tf-pop {
  counter-reset: tfpop;
}

.tf-pop li { counter-increment: tfpop; }

.tf-pop a::before {
  content: counter(tfpop);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-ink);
}

.tf-pop img { width: 32px; height: 32px; border-radius: 8px; }
.tf-pop-name { font-weight: 700; overflow-wrap: anywhere; }

.tf-block { margin: 30px 0; min-width: 0; }

.tf-block-head, .tf-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 10px;
}

.tf-kicker {
  margin: 0 0 4px;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.tf-fresh {
  min-width: 0;
  padding: 12px 12px 14px;
  background: var(--soft);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

.tf-fresh-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 6px;
  overscroll-behavior-x: contain;
}

.tf-fresh-row .tf-tile {
  flex: 0 0 188px;
  scroll-snap-align: start;
}

.tf-all { font-weight: 700; white-space: nowrap; }

/* program */
.tf-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.tf-crumbs a { color: var(--muted); }

.tf-prog-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.tf-prog-ico {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  flex: none;
}

.tf-kicker-link {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.tf-updated { margin: 0.2em 0 0; color: var(--muted); font-size: 0.92rem; }

.tf-specs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  border: 1px solid var(--line);
  background: var(--card);
  margin: 0 0 14px;
}

.tf-spec {
  padding: 9px 11px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.tf-spec dt {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.tf-spec dd {
  margin: 3px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
}

.tf-dl, .tf-older, .tf-fav, .tf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  border-radius: 2px;
  border: 1px solid transparent;
  padding: 9px 13px;
}

.tf-dl, .tf-btn {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: var(--btn);
}

.tf-dl:visited, .tf-btn:visited { color: var(--btn-ink); }
.tf-dl:hover, .tf-btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }

.tf-older, .tf-fav {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.tf-older:visited, .tf-fav:visited { color: var(--ink); }
.tf-fav[aria-pressed="true"] {
  background: var(--flag);
  border-color: var(--accent);
}

.tf-reel-title { margin: 0 0 8px; font-size: 1.15rem; }

.tf-reel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  min-width: 0;
  max-width: 100%;
  padding-bottom: 8px;
  margin-bottom: 18px;
  overscroll-behavior-x: contain;
}

.tf-shot {
  flex: 0 0 min(620px, 86%);
  scroll-snap-align: start;
  margin: 0;
}

.tf-shot img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--line);
  background: #2a221c;
}

.tf-shot figcaption {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 5px;
}

.tf-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin: 0 0 8px;
}

.tf-tab {
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 14px;
  margin: 0 0 -1px;
  font-weight: 700;
  color: var(--muted);
}

.tf-tab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.tf-prose {
  max-width: 68ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.tf-prose h2 { margin: 1.45em 0 0.35em; }
.tf-prose h3 { margin: 1.15em 0 0.25em; }
.tf-prose p { margin: 0.7em 0; }
.tf-prose ul, .tf-prose ol { margin: 0.5em 0 0.8em; padding-left: 1.2em; }
.tf-prose li { margin: 0.25em 0; }

.tf-prose blockquote {
  margin: 1em 0;
  padding: 0 0 0 14px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}

.tf-prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--soft);
  padding: 0 4px;
}

.tf-table-wrap { overflow-x: auto; max-width: 100%; }

.tf-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.tf-prose th, .tf-prose td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 7px 8px;
  vertical-align: top;
}

.tf-prose th {
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.tf-faq { margin: 28px 0 10px; max-width: 68ch; }
.tf-faq h2 { margin-bottom: 6px; }

.tf-q { border-top: 1px solid var(--line); padding: 8px 0; }
.tf-q summary { cursor: pointer; font-weight: 700; }
.tf-q p { margin: 0.45em 0 0.2em; }

/* comments */
.tf-comments { margin-top: 28px; max-width: 68ch; }
.tf-cmt-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}

.tf-cmt-count { color: var(--muted); font-weight: 600; }

.tf-sort { display: flex; gap: 6px; }
.tf-sort button {
  background: transparent;
  border: 1px solid var(--line);
  padding: 3px 8px;
  font-weight: 700;
  color: var(--muted);
}
.tf-sort button[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--accent);
}

.tf-cform textarea, .tf-replybox textarea, .tf-field input, .tf-find input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 2px;
}

.tf-cform textarea, .tf-replybox textarea { min-height: 96px; resize: vertical; }
.tf-cform-note, .tf-hint { color: var(--muted); font-size: 0.88rem; margin: 6px 0; }
.tf-form-err { color: var(--danger); font-size: 0.88rem; margin: 4px 0 0; }
.tf-oknote { color: var(--ok); font-weight: 700; }

.tf-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.tf-cmt {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.tf-cmt-hold { opacity: 0.55; }

.tf-cmt-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.tf-cmt-name { font-weight: 700; }
.tf-cmt-date { color: var(--muted); font-size: 0.85rem; }

.tf-badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  padding: 1px 6px;
  font-weight: 700;
}

.tf-cmt-tools { display: flex; gap: 10px; align-items: center; }
.tf-like, .tf-reply {
  background: none;
  border: 0;
  padding: 2px 0;
  color: var(--ink-soft);
  font-weight: 700;
}
.tf-like[aria-pressed="true"] { color: var(--accent-ink); }

.tf-replies {
  margin: 8px 0 0 18px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}

.tf-avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.tf-empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 12px;
}

.tf-guest-note { background: var(--soft); padding: 10px 12px; }

/* forms, account, errors */
.tf-sheet {
  max-width: 32rem;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background: var(--card);
  padding: 14px 14px 16px;
}

.tf-field { margin: 0 0 12px; }
.tf-field label, .tf-find label { display: block; font-weight: 700; margin-bottom: 4px; }

.tf-check {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 8px 0;
}

.tf-check input { width: auto; }

.tf-auth-links { margin: 12px 0 0; }

.tf-acct-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.tf-acct-head h1 { margin: 0; font-size: 1.7rem; }

.tf-atabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.tf-atabs a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 4px 8px;
}

.tf-atabs a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.tf-note-list, .tf-mine-list { list-style: none; margin: 0; padding: 0; }
.tf-note-row, .tf-mine {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.tf-note-row a { font-weight: 700; }

.tf-saved {
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-weight: 700;
  color: var(--ok);
}

.tf-toc { margin: 0 0 16px; padding-left: 1.1em; }
.tf-help { max-width: 68ch; }

.tf-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 16px;
}

.tf-pager a, .tf-page-now {
  min-width: 2.1rem;
  text-align: center;
  padding: 4px 8px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.tf-page-now {
  background: var(--btn);
  color: var(--btn-ink);
  border-color: var(--btn);
}

.tf-pagecount { color: var(--muted); margin: 12px 0 0; }

.tf-foot {
  border-top: 1px solid var(--line);
  padding: 16px 28px 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
}

.tf-foot a { color: inherit; text-decoration: none; font-weight: 700; }
.tf-foot a:hover { text-decoration: underline; }
.tf-foot nav { display: flex; flex-wrap: wrap; gap: 8px 14px; }

.tf-totop {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

html.tf-js .tf-totop {
  opacity: 0;
  pointer-events: none;
}

html.tf-js .tf-totop-on {
  opacity: 1;
  pointer-events: auto;
}

.tf-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
}

.tf-modal[hidden] { display: none !important; }

.tf-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(45, 38, 32, 0.48);
}

.tf-modal-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(84vh, 720px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  padding: 18px 18px 22px;
}

.tf-modal-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
}

.tf-steps { padding-left: 1.2em; }
.tf-steps li { margin: 0.35em 0; }

.tf-build { margin-top: 14px; }
.tf-build h3 { margin: 0 0 4px; }

.tf-mirror {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  margin-top: 8px;
}

.tf-mirror:visited { color: var(--ink); }
.tf-mirror:hover { border-color: var(--accent); }

.tf-old-list { list-style: none; margin: 0; padding: 0; }
.tf-old-list li { border-top: 1px solid var(--line); padding: 8px 0; }
.tf-old-list a { font-weight: 700; }

.tf-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.tf-rack a { font-weight: 700; }

@media (max-width: 860px) {
  .tf-frame { grid-template-columns: minmax(0, 1fr); }
  .tf-rail {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .tf-burger { display: inline-flex; }
  html.tf-js .tf-menu { display: none; }
  html.tf-js .tf-menu.tf-shown { display: flex; }
  .tf-leadin { grid-template-columns: minmax(0, 1fr); }
  .tf-main { padding: 16px 14px 68px; }
  .tf-foot { padding: 14px 14px 22px; }
  .tf-rail-foot { margin-top: 10px; }
}

@media (max-width: 420px) {
  h1 { font-size: 1.65rem; }
  .tf-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .tf-who-name { max-width: 7.5rem; }
  .tf-shot { flex-basis: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* program page keeps the article column narrower than the specs strip */
.tf-prog .tf-prose { margin-top: 2px; }

/* сеть: поиск в колонке, липкая колонка на телефоне, состояния, которых нет в макете */
img.tf-mark { background: none; border-radius: 8px; object-fit: contain; }
.tf-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tf-find { display: flex; min-width: 0; margin: 4px 0 2px; }
.tf-find input { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-right: 0; background: var(--card); color: var(--ink); padding: 7px 9px; font: inherit; font-size: 0.92rem; }
.tf-find button { display: inline-flex; align-items: center; justify-content: center; width: 36px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.tf-miss .tf-find { display: block; }
.tf-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--soft); border: 1px solid var(--line); color: var(--accent-ink); font-weight: 700; text-transform: uppercase; border-radius: 12px; }
.tf-ph-sm { width: 32px; height: 32px; border-radius: 7px; font-size: 0.75rem; flex: none; }
img.tf-tile-ico, img.tf-prog-ico { object-fit: contain; }
.tf-fav .tf-fav-on { display: none; }
.tf-fav[aria-pressed="true"] .tf-fav-on { display: inline; }
.tf-fav[aria-pressed="true"] .tf-fav-off { display: none; }
.tf-intel { margin-left: 8px; }
.tf-install { margin-top: 26px; }
.tf-replies:empty { display: none; }
.tf-page-gap { border: 0 !important; }
.tf-dmca { margin-top: 26px; }
.tf-dmca label > span { display: block; font-weight: 700; margin-bottom: 4px; }
.tf-dmca input[type="text"], .tf-dmca input[type="email"], .tf-dmca input[type="url"], .tf-dmca textarea { width: 100%; }
.tf-modal-body ol { padding-left: 1.3em; }
[id] { scroll-margin-top: 20px; }
@media (max-width: 860px) {
  .tf-rail { position: sticky; top: 0; z-index: 30; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 12px; }
  .tf-rail-top { flex: 1 1 auto; order: 1; align-items: center; }
  .tf-rail-foot { order: 2; margin-top: 0 !important; padding-top: 0; }
  .tf-theme-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tf-find { order: 3; flex: 1 1 100%; margin: 0; }
  .tf-slogan { display: none; }
  .tf-menu { order: 4; flex: 1 1 100%; margin: 0; }
  .tf-brand-name { font-size: 0.95rem; }
  [id] { scroll-margin-top: 130px; }
}
@media (max-width: 860px) {
  .tf-rail-top { flex-wrap: nowrap; min-width: 0; gap: 8px; }
  .tf-brand { flex: 1 1 auto; min-width: 0; }
  .tf-brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tf-rail-top .tf-user { flex: none; }
  .tf-burger span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tf-mark { width: 30px; height: 30px; }
}
@media (max-width: 860px) {
  .tf-rail-top { flex: 1 1 0; }
  .tf-brand { min-width: 36px; overflow: hidden; }
  .tf-brand .tf-mark { flex: none; }
}

/* правки аудита 02.11: обложка вместо букв, плитки шире и подписи читаемые, скриншот программы крупнее, характеристики крупнее, кнопка скачивания заметнее */
img.tf-tile-ico.is-cover, img.tf-prog-ico.is-cover, img.tf-pop-ico.is-cover { object-fit: cover; }
.tf-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tf-tile-ver, .tf-bpm { font-size: 13px; }
.tf-tile-cat { font-size: 0.875rem; }
.tf-tile-size { font-size: 13px; }
.tf-tile-flag { font-size: 12px; }
.tf-spec dt { font-size: 12px; }
.tf-spec dd { font-size: 14px; }
.tf-shot { flex-basis: min(860px, 92%); }
.tf-actions .tf-dl { padding: 12px 20px; font-size: 1.05rem; }
@media (max-width: 520px) { .tf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* правки 02.11 (2): на широком экране контент по центру области справа от боковой колонки; лента «Fresh» листается стрелками, без системной полосы */
.tf-main { max-width: 1320px; margin-inline: auto; width: 100%; }
.tf-fresh-row { scrollbar-width: none; padding-bottom: 0; }
.tf-fresh-row::-webkit-scrollbar { display: none; }
.tf-shelf-nav { display: flex; gap: 6px; margin: 0; }
.tf-shelf-btn { width: 36px; height: 36px; border: 1px solid var(--line); background: var(--paper, #fff); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; border-radius: 2px; }
.tf-shelf-btn:hover { border-color: var(--accent); }
.tf-reel { scrollbar-width: none; }
.tf-reel::-webkit-scrollbar { display: none; }
/* правки 02.11 (3): на широком экране весь каркас (боковая колонка + контент) — одним блоком по центру, а не колонка у левого края экрана */
@media (min-width: 861px) {
  .tf-frame { max-width: calc(var(--rail-w) + 1320px); margin: 0 auto; border-left: 1px solid var(--line); }
  .tf-main { margin-inline: 0; }
}
