/* Byline phone app (2.2): the same frosted-glass system as the extension. */
:root {
  --field-1: #e3ebf5; --field-2: #f2f5f9; --field-3: #eaeff5;
  --glass: rgba(255, 255, 255, .7); --glass-2: rgba(255, 255, 255, .5); --glass-hi: rgba(255, 255, 255, .95);
  --line: rgba(20, 42, 72, .12); --line-2: rgba(20, 42, 72, .2);
  --ink: #132033; --ink-2: #364559; --muted: #5d6b7e; --brand: #102a48; --brand-fg: #fff; --link: #1957b8; --err: #b42318;
  --glow: rgba(25, 87, 184, .16);
  --shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 12px 32px -18px rgba(16, 42, 72, .45);
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --field-1: #0a1422; --field-2: #0f1b2c; --field-3: #0c1726;
    --glass: rgba(24, 37, 58, .68); --glass-2: rgba(24, 37, 58, .45); --glass-hi: rgba(255, 255, 255, .1);
    --line: rgba(255, 255, 255, .09); --line-2: rgba(255, 255, 255, .17);
    --ink: #e6edf6; --ink-2: #bac6d6; --muted: #8e9cb1; --brand: #dbe7f7; --brand-fg: #0d1d33; --link: #8ab8ff; --err: #f2867a;
    --glow: rgba(138, 184, 255, .10);
    --shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 14px 34px -18px rgba(0, 0, 0, .75);
  }
}
* { box-sizing: border-box; }
html { background: var(--field-2); }
html, body { margin: 0; color: var(--ink); font: 16px/1.5 var(--sans); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: radial-gradient(110% 55% at 0% 0%, var(--glow), transparent 60%), radial-gradient(90% 50% at 100% 100%, rgba(120, 140, 170, .12), transparent 60%),
              linear-gradient(170deg, var(--field-1), var(--field-2) 45%, var(--field-3));
  background-attachment: fixed;
}
button, textarea, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ask, .list, .install-help, .news-item, .news-search input, .news-tab {
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
}
/* ---------- app shell (2.2): large title, screens, bottom tab bar, report sheet ---------- */
html, body { overscroll-behavior-y: none; }
body { -webkit-tap-highlight-color: transparent; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
textarea, input, .news-hl, .recent .t, .install-help p, .hint { -webkit-user-select: text; user-select: text; }
.appbar { position: sticky; top: 0; z-index: 20; padding: calc(env(safe-area-inset-top) + 10px) 20px 10px;
  background: linear-gradient(to bottom, var(--field-1) 60%, transparent); }
.appbar-in { max-width: 720px; margin: 0 auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.title { margin: 0; font: 700 34px/1.1 var(--serif); letter-spacing: -.01em; }
.chipbtn { min-height: 36px; padding: 0 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; }
body { padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 4px 16px calc(96px + env(safe-area-inset-bottom)); }
.screen[hidden] { display: none; }

.ask { background: var(--glass); border: 1px solid var(--line); border-radius: 24px; padding: 18px 16px 16px; box-shadow: var(--shadow); }
.ask-lead { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; }
textarea { width: 100%; min-height: 96px; resize: none; border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 15px; background: var(--glass-hi); font-size: 17px; line-height: 1.4; }
@media (prefers-color-scheme: dark) { textarea, .news-search input { background: rgba(0, 0, 0, .22) !important; } }
textarea:focus, .news-search input:focus { outline: 2px solid var(--link); outline-offset: 1px; }
.row { display: flex; gap: 10px; margin-top: 12px; }
button { cursor: pointer; border-radius: 14px; min-height: 48px; padding: 0 18px; border: 0; }
button:active, .recent button:active, .news-item:active { transform: scale(.985); }
.primary { background: var(--brand); color: var(--brand-fg); font-weight: 650; flex: 1; font-size: 17px; }
.primary:disabled { opacity: .6; cursor: progress; }
.ghost { background: var(--glass-2); border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 600; }
.big { min-height: 52px; }
.row .ghost { flex: 0 0 34%; }
.hint { margin: 14px 4px 0; color: var(--muted); font-size: 14px; text-align: center; }
.status { margin: 12px 2px 0; font-size: 15px; }
.status:empty { display: none; }
.status.busy::before { content: ""; display: inline-block; width: 15px; height: 15px; margin-right: 9px; vertical-align: -2px; border: 2px solid var(--line-2); border-top-color: var(--link); border-radius: 50%; animation: spin .8s linear infinite; }
.status.err { color: var(--err); }
@keyframes spin { to { transform: rotate(360deg); } }

.recent { margin-top: 28px; }
.recent h2, .install-help h2 { font: 700 21px/1.25 var(--serif); color: var(--ink); margin: 0 4px 10px; }
.list, .recent ul { list-style: none; margin: 0; padding: 0; background: var(--glass); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.recent li + li { border-top: 1px solid var(--line); }
.recent button { width: 100%; display: flex; align-items: center; gap: 13px; text-align: left; background: transparent; padding: 12px 14px; min-height: 64px; border-radius: 0; }
.recent .sc { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 700 18px/1 var(--serif); color: #fff; background: #7a8494; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); }
.recent .tx { min-width: 0; display: flex; flex-direction: column; flex: 1; }
.recent .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 16px; }
.recent .d { color: var(--muted); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent button::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); opacity: .6; margin-right: 4px; }
.install-help { margin-top: 24px; background: var(--glass-2); border: 1px dashed var(--line-2); border-radius: 20px; padding: 16px; font-size: 15px; }
.install-help h2 { margin: 0 0 6px; font-size: 18px; }
.install-help p { margin: 0; color: var(--ink-2); }

/* settings: the extension's settings page fills the screen between the title and the tab bar */
.screen-frame { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 64px); bottom: calc(64px + env(safe-area-inset-bottom)); }
.screen-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }

/* bottom tab bar */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 4px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); background: var(--glass); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.tb { flex: 1; max-width: 160px; min-height: 52px; background: transparent; border-radius: 14px; padding: 4px 0 0; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tb svg { width: 26px; height: 26px; }
.tb[aria-current="page"] { color: var(--link); }
.tb:active { transform: scale(.94); }

/* the report: a full-screen sheet that slides in from the right */
.sheet { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: radial-gradient(110% 55% at 0% 0%, var(--glow), transparent 60%), linear-gradient(170deg, var(--field-1), var(--field-2) 45%, var(--field-3));
  transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .sheet { transition: none; } }
.sheet-bar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px;
  background: var(--glass); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.sheet-title { font: 600 16px/1.2 var(--serif); text-align: center; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbtn { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 10px; background: transparent; color: var(--link); font-size: 17px; font-weight: 500; text-decoration: none; border-radius: 12px; }
.navbtn.end { justify-self: end; }
.sheet iframe { flex: 1; width: 100%; border: 0; display: block; background: transparent; padding-bottom: env(safe-area-inset-bottom); }
body.sheet-open { overflow: hidden; }
body.sheet-open .tabbar { visibility: hidden; }

@media (min-width: 700px) { .title { font-size: 40px; } .ask { padding: 24px; } }
/* news */
.news { margin-top: 24px; }
.news-search { display: flex; gap: 8px; }
.news-search input { flex: 1; min-width: 0; min-height: 48px; border: 1px solid var(--line-2); border-radius: 14px; padding: 0 14px; background: var(--glass-hi); color: var(--ink); font: inherit; font-size: 16px; }
.news-search .primary { flex: none; }
.news-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.news-tabs::-webkit-scrollbar { display: none; }
.news-tab { flex: none; min-height: 38px; padding: 0 15px; border-radius: 999px; background: var(--glass-2); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.news-tab[aria-selected="true"] { background: var(--brand); color: var(--brand-fg); border-color: transparent; }
.news-opts { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 10px 2px 8px; font-size: 13px; color: var(--muted); }
.news-eng { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.news-item { display: flex; align-items: stretch; background: var(--glass); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.news-card { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; background: none; border-radius: 0; padding: 12px 12px 12px 14px; }
.news-src { font-size: 13px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-src b { color: var(--ink-2); font-weight: 650; }
.news-hl { font: 600 17px/1.3 var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-badge { font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; background: rgba(91, 107, 127, .14); color: var(--ink-2); margin-top: 2px; }
.news-badge.good { background: rgba(12, 122, 83, .13); color: #0b6a48; }
.news-badge.mixed { background: rgba(166, 92, 0, .13); color: #8a4c00; }
.news-badge.bad { background: rgba(180, 35, 24, .12); color: #9b1f15; }
.news-badge.known { background: rgba(25, 87, 184, .12); color: #1a4f9c; }
.news-badge.wait { opacity: .6; }
.news-open { flex: none; display: grid; place-items: center; padding: 0 14px; border-left: 1px solid var(--line); color: var(--link); font-size: 14px; font-weight: 600; text-decoration: none; }
.news-foot { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0 0; min-height: 1px; }
.news-foot.busy::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--line-2); border-top-color: var(--link); border-radius: 50%; animation: spin .8s linear infinite; }
.news-foot .ghost { min-height: 40px; }
.news-err { color: var(--err); margin: 0 0 8px; }
.news-note { color: var(--muted); font-size: 12.5px; margin: 14px 2px 0; }
.news-note a { color: inherit; }
@media (prefers-color-scheme: dark) {
  .news-badge.good { background: rgba(67, 192, 143, .16); color: #7fe0b7; }
  .news-badge.mixed { background: rgba(227, 164, 71, .16); color: #f2c27a; }
  .news-badge.bad { background: rgba(242, 134, 122, .16); color: #f8b1a8; }
  .news-badge.known { background: rgba(138, 184, 255, .16); color: #b5d1ff; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
[hidden] { display: none !important; }
/* grade key on the Check screen */
.key { margin-top: 28px; }
.key h2 { font: 700 21px/1.25 var(--serif); margin: 0 4px 10px; }
.keylist li { display: flex; align-items: center; gap: 13px; padding: 10px 14px; }
.keylist li + li { border-top: 1px solid var(--line); }
.keylist .g { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 17px/1 var(--serif); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .4); }
.keylist b { display: block; font-weight: 650; font-size: 15.5px; }
.keylist span span, .keylist li > span:last-child { color: var(--muted); font-size: 13.5px; line-height: 1.35; }
.keylist li > span:last-child b { color: var(--ink); }
.key-note { margin: 10px 4px 0; color: var(--muted); font-size: 13.5px; }
