/* ══ GreatFire VPN — News tab concept ══════════════════════════════ */

:root {
  --brand:        #ff7f11;
  --brand-dark:   #de6e10;
  --brand-deep:   #c85f08;
  --brand-tint:   #fff2e4;
  --brand-tint-2: #ffe6cd;

  --bg:        #f5f5f5;
  --surface:   #ffffff;
  --ink:       #1c1c1e;
  --ink-2:     #56565a;
  --ink-3:     #8a8a8e;
  --line:      #e7e7ea;

  --blocked:   #d13b3b;
  --blocked-bg:#fdeceb;
  --domestic:  #3a7bd5;
  --domestic-bg:#ebf2fd;

  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --shadow-card: 0 1px 2px rgba(0,0,0,.05), 0 6px 16px rgba(0,0,0,.05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: #15171c;
  color: var(--ink);
}

/* ── Stage layout ────────────────────────────────────────────────── */
.stage {
  display: flex;
  gap: 48px;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 32px 64px;
  flex-wrap: wrap;
}

.phone-wrap { position: sticky; top: 40px; flex: 0 0 auto; }

/* Pixel 7/8 viewport: 412 x 915 CSS px (20:9), the most common Android size. */
.phone {
  width: 412px;
  height: 915px;
  background: var(--bg);
  border-radius: 36px;
  border: 9px solid #0b0c0f;
  box-shadow: 0 40px 80px rgba(0,0,0,.55), 0 0 0 1px #2a2d34;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* ── Status bar ──────────────────────────────────────────────────── */
.statusbar {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 18px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #2b2b2e;
}
.sb-icons { display: flex; gap: 6px; align-items: center; }
.sb-ic { width: 14px; height: 14px; fill: #46464a; }

/* ── Screens ─────────────────────────────────────────────────────── */
.screens { flex: 1 1 auto; position: relative; overflow: hidden; }

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* ── News header ─────────────────────────────────────────────────── */
.news-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 11px 18px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.news-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.news-head .updated { font-size: 11px; color: var(--ink-3); }

.news-body { padding: 12px 14px 22px; display: flex; flex-direction: column; gap: 10px; }

/* ── Hero: speed test ────────────────────────────────────────────── */
.hero {
  position: relative;
  border-radius: var(--r-lg);
  padding: 14px 16px 13px;
  color: #fff;
  background: linear-gradient(145deg, #ff8f2c 0%, var(--brand) 42%, var(--brand-deep) 100%);
  box-shadow: 0 8px 24px rgba(200,95,8,.28);
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -46px; top: -56px;
  width: 168px; height: 168px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.hero::before {
  content: '';
  position: absolute;
  right: -14px; top: -20px;
  width: 104px; height: 104px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.hero > * { position: relative; z-index: 1; }

.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  background: rgba(255,255,255,.2);
  padding: 4px 8px; border-radius: 999px;
}
.hero-last { font-size: 10.5px; color: rgba(255,255,255,.85); white-space: nowrap; }

.hero h3 { margin: 9px 0 4px; font-size: 18px; line-height: 1.22; font-weight: 700; letter-spacing: -.01em; }
.hero p {
  margin: 0; font-size: 12px; line-height: 1.45; color: rgba(255,255,255,.88);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.hero-actions { margin-top: 11px; display: flex; align-items: center; gap: 10px; }

.btn-hero {
  flex: 1 1 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: #fff; color: var(--brand-deep);
  border: 0; border-radius: 999px;
  padding: 11px 16px;
  font: inherit; font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.btn-hero:active { transform: scale(.97); }
.btn-hero svg { width: 17px; height: 17px; fill: currentColor; }

.hero-foot {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,.22);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: rgba(255,255,255,.92);
}
.hero-foot .dot { width: 6px; height: 6px; border-radius: 50%; background: #7ce495; display: inline-block; margin-right: 6px; }

/* ── Generic card ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.card-pad { padding: 15px 16px; }

.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 2px 0;
}
.section-head h4 {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em;
}
.section-head .via {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: none; font: inherit; cursor: pointer;
  font-size: 11.5px; font-weight: 700; color: var(--brand-deep);
  padding: 2px 0;
}
.section-head .via svg { width: 13px; height: 13px; fill: currentColor; }

.section-note {
  margin: -4px 2px 0; font-size: 11px; line-height: 1.4; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Story list ──────────────────────────────────────────────────── */
.stories { display: flex; flex-direction: column; }

.story {
  display: flex; align-items: flex-start; gap: 10px;
  width: 100%; text-align: left;
  background: none;
  border: 0; border-top: 1px solid var(--line);
  padding: 10px 13px 11px;
  font: inherit;
  cursor: pointer;
}
.story:first-child { border-top: 0; }
.story:active { background: #fafafb; }
.story-text { flex: 1 1 auto; min-width: 0; }

.story-img {
  flex: 0 0 auto;
  width: 54px; height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #ececf0;
}

/* Source chips give up width first; the badge and timestamp must stay whole. */
.story-foot {
  display: flex; align-items: center; gap: 5px;
  white-space: nowrap; overflow: hidden;
}
.story-foot .pill { flex: 0 0 auto; }
.story-foot .chip { flex: 0 1 auto; min-width: 52px; }
.story-foot .story-meta { flex: 0 0 auto; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .01em;
  padding: 3px 7px; border-radius: 6px;
}
.pill.blocked   { background: var(--blocked-bg); color: var(--blocked); }
.pill.domestic  { background: var(--domestic-bg); color: var(--domestic); }
.pill.both      { background: #f1efe9; color: #6b6355; }
.pill svg { width: 10px; height: 10px; fill: currentColor; }

.story-meta { margin-left: auto; padding-left: 4px; font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

/* Clamped so an unusually long headline can't push the feed below the fold. */
.story h5 {
  margin: 0 0 6px;
  font-size: 14px; line-height: 1.32; font-weight: 650;
  letter-spacing: -.005em;
  color: var(--ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}

.chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--ink-2);
  background: #f4f4f6; border-radius: 5px;
  padding: 2px 6px;
}
.chip .d { max-width: 132px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.is-blocked { background: var(--blocked-bg); color: #a63030; }
.chip .x { font-size: 9px; flex: 0 0 auto; }

/* ── GreatFire card ──────────────────────────────────────────────── */
.gf {
  display: block; width: 100%; text-align: left;
  background: var(--surface);
  border: 0; border-left: 3px solid var(--brand);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: 11px 13px;
  font: inherit; cursor: pointer;
}
.gf:active { transform: scale(.985); }
.gf-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gf-logo {
  width: 18px; height: 18px; border-radius: 4px;
  background: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
}
.gf-logo svg { width: 11px; height: 11px; fill: #fff; }
.gf-tag {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--brand-deep); background: var(--brand-tint); padding: 3px 7px; border-radius: 6px;
}
.gf h5 {
  margin: 0 0 4px; font-size: 14px; line-height: 1.32; font-weight: 650;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.gf p {
  margin: 0; font-size: 11.5px; line-height: 1.45; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gf .go { margin-left: 4px; display: inline-flex; }
.gf .go svg { width: 14px; height: 14px; fill: var(--brand-deep); }

/* ── Survey banner ───────────────────────────────────────────────── */
.survey {
  display: flex; align-items: center;
  background: var(--brand-tint);
  border: 1px dashed #f5c893;
  border-radius: var(--r-md);
  padding: 9px 6px 9px 13px;
}
.survey-main {
  flex: 1 1 auto; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
  border: 0; background: none; padding: 0; font: inherit;
  text-align: left; cursor: pointer;
}
.survey-title {
  font-size: 13px; font-weight: 650; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.survey-sub {
  font-size: 11px; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.survey-x {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  border: 0; background: none; cursor: pointer;
  color: var(--ink-3); font-size: 12px; line-height: 1;
  border-radius: 50%;
}
.survey-x:active { background: var(--brand-tint-2); }

.btn-primary {
  border: 0; border-radius: 999px;
  background: var(--brand); color: #fff;
  padding: 9px 16px; font: inherit; font-size: 13px; font-weight: 700;
  cursor: pointer;
}
.btn-primary:active { background: var(--brand-dark); }

/* ── Privacy footnote ────────────────────────────────────────────── */
.privacy {
  display: flex; gap: 6px; align-items: center;
  padding: 0 6px;
  font-size: 10.5px; line-height: 1.4; color: var(--ink-3);
  white-space: nowrap; overflow: hidden;
}
.privacy svg { width: 12px; height: 12px; fill: var(--ink-3); flex: 0 0 auto; }
.privacy span { overflow: hidden; text-overflow: ellipsis; }

/* ── Empty / offline state ───────────────────────────────────────── */
.offline {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 0 44px; gap: 6px;
}
.offline-badge {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--brand-tint);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.offline-badge svg { width: 36px; height: 36px; fill: var(--brand); }
.offline h4 { margin: 0; font-size: 17px; font-weight: 700; }
.offline p { margin: 0 0 14px; font-size: 13px; line-height: 1.5; color: var(--ink-3); }

/* ── Skeleton + error ────────────────────────────────────────────── */
.sk-story { cursor: default; }
.sk-line, .sk-thumb {
  background: linear-gradient(90deg, #ececf0 25%, #f6f6f8 50%, #ececf0 75%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.sk-line { height: 11px; margin-bottom: 9px; }
.sk-line.w70 { width: 70%; }
.sk-line.w40 { width: 40%; margin-bottom: 2px; }
.sk-thumb { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.feed-error {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 13px;
  font-size: 12.5px; color: var(--ink-2);
}
.btn-retry {
  border: 1px solid var(--brand); border-radius: 999px;
  background: none; color: var(--brand-deep);
  padding: 6px 14px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.btn-retry:active { background: var(--brand-tint); }

/* ── VPN screen (existing app, simplified) ───────────────────────── */
.vpn-screen { padding: 10px 10px 0; }
.vpn-card {
  background: linear-gradient(180deg, var(--brand) 0%, #fb7b10 100%);
  border-radius: 24px; color: #fff;
  padding: 18px 16px 14px;
  text-align: center;
}
.vpn-logo { font-size: 15px; font-weight: 800; letter-spacing: .06em; opacity: .97; }
.vpn-logo small { display: block; font-size: 7px; letter-spacing: .18em; opacity: .8; margin-top: 3px; font-weight: 600; }
.vpn-state { font-size: 22px; font-weight: 700; margin: 16px 0 6px; }
.vpn-loc { font-size: 14px; opacity: .95; }
.power {
  width: 132px; height: 132px; margin: 22px auto;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.power i {
  width: 98px; height: 98px; border-radius: 50%;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.power svg { width: 42px; height: 42px; fill: var(--brand); }
.trial {
  background: rgba(0,0,0,.09); border-radius: 12px;
  padding: 12px 14px; text-align: left; font-size: 12.5px; line-height: 1.7;
}
.trial .btn-outline {
  float: right; margin-top: 6px;
  border: 1px solid rgba(255,255,255,.7); background: none; color: #fff;
  border-radius: 8px; padding: 6px 16px; font: inherit; font-size: 12.5px;
}
.vpn-rates {
  margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.25);
  font-size: 12.5px; font-family: ui-monospace, monospace; line-height: 1.7;
}
.vpn-sheet {
  margin: 12px 4px 0; background: #fff; border-radius: 16px 16px 0 0;
  padding: 14px 16px; display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.vpn-sheet .auto { font-size: 15px; font-weight: 600; }
.vpn-sheet .best { margin-left: auto; font-size: 12.5px; color: var(--ink-3); }

/* ── Settings screen ─────────────────────────────────────────────── */
.settings-list { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.settings-row {
  background: #fff; border-radius: 12px; padding: 15px 16px;
  font-size: 14px; display: flex; justify-content: space-between; color: var(--ink);
  box-shadow: var(--shadow-card);
}
.settings-row span:last-child { color: var(--ink-3); font-size: 13px; }

/* ── Tab bar ─────────────────────────────────────────────────────── */
.tabbar {
  flex: 0 0 auto;
  height: 74px;
  background: #fff;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: 14px;
  position: relative;
}
/* Android gesture navigation bar */
.tabbar::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 7px;
  transform: translateX(-50%);
  width: 118px; height: 4px;
  border-radius: 2px;
  background: #1c1c1e;
  opacity: .32;
}
.tab {
  border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #676767; font: inherit;
}
.tab-ic { width: 23px; height: 23px; fill: currentColor; }
.tab-ic-wrap { position: relative; display: inline-flex; }
.tab-dot {
  position: absolute; top: -1px; right: -3px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #e4342f; border: 1.5px solid #fff;
}
.tab-label { font-size: 11px; font-weight: 600; }
.tab.is-active { color: var(--brand); }

/* ── Demo panel ──────────────────────────────────────────────────── */
.panel {
  flex: 0 0 330px;
  width: 330px;
  color: #d7d9e0;
  font-size: 13px;
  padding-top: 8px;
}
.panel-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 700; color: #fff; letter-spacing: -.01em; }
.panel-head h1 span { color: var(--brand); font-weight: 600; }
.panel-head p { margin: 0 0 26px; color: #9aa0ac; line-height: 1.55; font-size: 12.5px; }

.ctrl { margin-bottom: 22px; }
.ctrl > label { display: block; font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.ctrl > label small { font-weight: 400; color: #7d8492; }

.segmented { display: flex; gap: 6px; }
.segmented.vertical { flex-direction: column; }
.segmented button {
  flex: 1; padding: 9px 10px;
  background: #22252c; color: #aeb4c0;
  border: 1px solid #31353e; border-radius: 9px;
  font: inherit; font-size: 12.5px; cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.segmented button:hover { background: #2a2e37; }
.segmented button.on {
  background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600;
}

.hint { margin: 8px 0 0; font-size: 11.5px; color: #7d8492; line-height: 1.5; }

.btn-ghost {
  width: 100%; padding: 9px; background: none; color: #aeb4c0;
  border: 1px dashed #3a3f4a; border-radius: 9px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.btn-ghost:hover { color: #fff; border-color: #555b68; }

.panel-foot { border-top: 1px solid #272b33; padding-top: 16px; margin-top: 30px; }
.panel-foot p { margin: 0 0 8px; font-size: 11.5px; color: #7d8492; }
.panel-foot ul { margin: 0; padding-left: 16px; }
.panel-foot li { margin-bottom: 5px; font-size: 12px; }
.panel-foot a { color: #c4c9d3; text-decoration: none; }
.panel-foot a:hover { color: var(--brand); text-decoration: underline; }

@media (max-width: 860px) {
  .stage { padding: 20px 16px 48px; gap: 28px; }
  .phone-wrap { position: static; }
  .panel { flex: 1 1 auto; width: 100%; max-width: 412px; }
}
