:root { --shell-padding: clamp(16px, 3vw, 34px); }
nav, main {
  padding-left: max(var(--shell-padding), env(safe-area-inset-left));
  padding-right: max(var(--shell-padding), env(safe-area-inset-right));
}
nav { max-width: 1440px; padding-top: calc(10px + env(safe-area-inset-top)); gap: 12px; }
main { padding-bottom: max(35px, env(safe-area-inset-bottom)); }
.navlinks { min-width: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.navlinks a { white-space: nowrap; padding: 6px 0; }
.navlinks a:focus-visible { outline-offset: -1px; }
@media (max-width: 920px) { .navlinks { order: 3; flex-basis: 100%; } }
@media (max-width: 650px) { html { scroll-padding-top: calc(103px + env(safe-area-inset-top)); } }

#fx, #metals, #crypto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr)); gap: 8px; }
#fx { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#metals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tile[data-kind] { padding: 11px 12px; border-radius: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 7px; }
.tile[data-kind]:hover { transform: none; }
.tile[data-kind] .symbol { font-size: 15px; line-height: 1.3; margin: 0; }
.tile[data-kind] .quote-name { font-size: 12px; font-weight: 650; line-height: 1.25; overflow-wrap: anywhere; }
.tile[data-kind] strong { grid-column: 1 / -1; margin: 4px 0 0; font-size: clamp(15px, 2.7vw, 21px); line-height: 1.25; white-space: normal; }
.quote-detail { grid-column: 1 / -1; min-height: 1.45em; font-size: 11px; line-height: 1.45; }
.quote-detail:last-child { min-height: 2.9em; }
.source-status { font-variant-numeric: tabular-nums; }
@media (max-width: 650px) {
  #fx, #metals, #crypto { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile[data-kind] { padding: 8px 10px; }
}
.match-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.match-group { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.match-group h3 { margin-bottom: 7px; }
.match-list { max-height: 355px; overflow: auto; }
.match-group p { margin: 7px 0; font-size: 13px; }
.match-group a { font-size: 13px; }
.match-list .match { margin: 4px 0; padding: 7px 8px; border-radius: 8px; }
.matchmeta { margin-bottom: 3px; font-size: 11px; }
.matchline { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 5px; font-size: 12px; }
.matchline .team { flex-direction: row; min-width: 0; justify-content: flex-start; text-align: left; }
.matchline .team:last-child { flex-direction: row-reverse; text-align: right; }
.team span { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.team img { width: 20px; height: 20px; flex: 0 0 auto; }
.matchline .score { font-size: 13px; padding: 3px 6px; border-radius: 5px; }
.live-label { color: var(--red); font-weight: 750; }
@media (max-width: 690px) {
  .match-groups { grid-template-columns: 1fr; }
  #futbol .panel { padding: 12px; }
}
.news-heading { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 6px; }
.news-heading button { font-size: 12px; padding: 5px 8px; }
.newsitem { padding: 7px 0 !important; }
.newsitem img { width: 56px; height: 40px; flex: 0 0 auto; }
.newsitem small { margin-top: 2px; }
.newsitem strong { line-height: 1.3; overflow-wrap: anywhere; }
.newsitem span { min-width: 0; }
.ticker-viewport { overflow: hidden; }
.ticker-track { animation: ticker-scroll var(--ticker-duration, 30s) linear infinite paused; }
.ticker-running:not(.ticker-static) .ticker-track { animation-play-state: running; }
@media (hover: hover) { .ticker-running:not(.ticker-static):hover .ticker-track { animation-play-state: paused; } }
.ticker-viewport:is(:focus-visible, :has(:focus-visible)), .ticker-static { overflow: auto; }
.ticker-viewport:is(:focus-visible, :has(:focus-visible)) .ticker-track, .ticker-static .ticker-track { animation: none; }
.ticker-viewport:is(:focus-visible, :has(:focus-visible)) .ticker-copy, .ticker-static .ticker-copy { display: none; }
@keyframes ticker-scroll { to { transform: translate3d(0, var(--ticker-distance, 0px), 0); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-viewport { overflow: auto; }
  .ticker-copy { display: none; }
}
#tvPlayer { width: min(100%, 850px); padding: 0; overflow: hidden; }
#tvPlayer iframe { width: 100%; height: 100%; border: 0; }
#tvPlay { margin-top: 12px; }
.tv-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.quote-range { grid-column: 1 / -1; width: 100%; height: 5px; margin: 1px 0 0; }
.quote-range[hidden] { display: block; visibility: hidden; }
@media (max-width: 650px) { .quote-range, .quote-range[hidden] { display: none; } }
.ticker-running:not(.ticker-static):active .ticker-track { animation-play-state: paused; }
.matchmeta > span { min-width: 0; overflow-wrap: anywhere; }
#sportNews { scroll-margin-top: 6px; }
#tvPlayer iframe { display: block; }
#tvStatus { margin: 8px 0; }

@media (max-width: 650px) {
  .navlinks a { display: inline-flex; align-items: center; min-height: 44px; }
  html { scroll-padding-top: calc(116px + env(safe-area-inset-top)); }
}
