/* Bastion window mockups, drawn from the app's real chrome: src/renderer/chrome/chrome.css and main.ts,
   the bar order and sizes in src/shared/layouts.ts, the line icons in src/renderer/common/icons.ts, and the
   Granite tokens in src/renderer/styles/tokens.css. Sizes are the app's pixel sizes divided by 13, in em,
   so setting font-size on a .bx scales the whole window (13px is actual size). */
.bx,
.bx-vars {
  --bx-bg: #f7f8fa;
  --bx-panel: #eceff3;
  --bx-bar: #e8ebef;
  --bx-field: #ffffff;
  --bx-line: #d5dae1;
  --bx-edge: #b4bcc7;
  --bx-text: #1d232b;
  --bx-text-2: #5c6673;
  --bx-accent: #3d5f8f;
  --bx-on-accent: #ffffff;
  --bx-tint: rgba(61, 95, 143, 0.12);
  --bx-warn: #9a5b12;
  --bx-ok: #2e7d4f;
  --bx-danger: #b3261e;
  --bx-skel: #e3e7ec;
}
.bx-vars {
  font:
    400 13px / 1.4 system-ui,
    -apple-system,
    "Segoe UI",
    Ubuntu,
    sans-serif;
  color: var(--bx-text);
}
.bx {
  font:
    400 13px / 1.4 system-ui,
    -apple-system,
    "Segoe UI",
    Ubuntu,
    sans-serif;
  color: var(--bx-text);
  background: var(--bx-bg);
  border: 1px solid var(--bx-edge);
  border-radius: 0.8em;
  overflow: hidden;
  box-shadow:
    0 0.1em 0.2em rgba(16, 22, 31, 0.08),
    0 2em 4.5em -1.4em rgba(16, 22, 31, 0.38);
  display: flex;
  flex-direction: column;
  text-align: left;
  max-width: 100%;
  position: relative;
  min-width: 0;
}
.bx.dark {
  --bx-bg: #1e2228;
  --bx-panel: #262b32;
  --bx-bar: #262b32;
  --bx-field: #16191e;
  --bx-line: #3a414b;
  --bx-edge: #48505b;
  --bx-text: #e5e9ee;
  --bx-text-2: #a1aab6;
  --bx-accent: #8db0e0;
  --bx-on-accent: #10161f;
  --bx-tint: rgba(141, 176, 224, 0.16);
  --bx-warn: #e0a458;
  --bx-ok: #6cc08e;
  --bx-danger: #f08a80;
  --bx-skel: #323842;
}
.bx svg {
  display: block;
}

/* Strip: 38 px tall, 8 px padding, 2 px gaps. On a Mac the window buttons sit in its first 76 px. */
.bx-top {
  display: flex;
  align-items: center;
  gap: 0.154em;
  height: 2.923em;
  padding: 0 0.615em 0 0;
  background: var(--bx-bar);
  border-bottom: 1px solid var(--bx-line);
  flex: none;
  min-width: 0;
  overflow: hidden;
}
.bx-top.row2 {
  height: 2.462em;
  padding-left: 0.615em;
}
.bx-lights {
  display: flex;
  gap: 0.615em;
  flex: none;
  width: 5.846em;
  padding-left: 0.923em;
  box-sizing: border-box;
}
.bx-lights i {
  width: 0.923em;
  height: 0.923em;
  border-radius: 50%;
  display: block;
}
.bx-lights i:nth-child(1) {
  background: #ec6a5e;
}
.bx-lights i:nth-child(2) {
  background: #f4bf4f;
}
.bx-lights i:nth-child(3) {
  background: #61c554;
}
/* Icon buttons: 28 px with 16 px icons (22 by 20 px with 13 px icons in the footer). */
.bx-ico {
  width: 2.154em;
  height: 2.154em;
  display: grid;
  place-items: center;
  color: var(--bx-text-2);
  flex: none;
  border-radius: 0.4615em;
}
.bx-ico svg {
  width: 1.231em;
  height: 1.231em;
}
.bx-ico.off {
  opacity: 0.45;
}
.bx-sep {
  flex: none;
  align-self: stretch;
  width: 1px;
  margin: 0.692em 0.4615em;
  background: var(--bx-line);
}
/* Address bar: 28 px tall, 34% of the strip when it shares the strip with the tabs. */
.bx-addr {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.4615em;
  min-width: 9.23em;
  height: 2.154em;
  margin: 0 0.3077em;
  padding: 0 0.154em 0 0.692em;
  box-sizing: border-box;
  border: 1px solid var(--bx-line);
  border-radius: 0.4615em;
  background: var(--bx-field);
  white-space: nowrap;
  overflow: hidden;
}
.bx-addr.shares {
  flex: 0 0 34%;
}
.bx-addr .lk {
  display: grid;
  flex: none;
  color: var(--bx-text-2);
}
.bx-addr .lk svg {
  width: 1em;
  height: 1em;
}
.bx-addr .u {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--bx-text-2);
}
.bx-addr .u b {
  color: var(--bx-text);
  font-weight: 600;
}
.bx-addr .u s {
  color: var(--bx-danger);
}
.bx-addr .bx-ico svg {
  width: 1.077em;
  height: 1.077em;
}
/* Tabs: New Tab first, then tabs up to 172 px wide and 28 px tall, each with its close button. */
.bx-tabs {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.154em;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.bx-tabs .bx-new {
  margin-right: 0.154em;
}
.bx-tab {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  width: 13.23em;
  gap: 0.538em;
  min-width: 2.77em;
  height: 2.154em;
  padding: 0 0.3077em 0 0.692em;
  box-sizing: border-box;
  border-radius: 0.4615em;
  color: var(--bx-text);
  overflow: hidden;
  white-space: nowrap;
}
.bx-tab.on {
  background: var(--bx-field);
  box-shadow: 0 0 0 1px var(--bx-line);
}
.bx-tab .fav {
  width: 1.077em;
  height: 1.077em;
  border-radius: 0.25em;
  flex: none;
  display: grid;
  place-items: center;
}
/* Site icons: a white letter on the site's color, in a serif on dark for news sites. */
.bx .fav b {
  font:
    700 0.62em / 1 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #fff;
}
.bx .fav.news {
  background: #1d232b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.bx .fav.news b {
  font:
    700 0.78em / 1 "Newsreader",
    Georgia,
    serif;
}
.bx-tab .t {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bx-tab .x {
  width: 1.385em;
  height: 1.385em;
  display: grid;
  place-items: center;
  color: var(--bx-text-2);
  flex: none;
}
.bx-tab .x svg {
  width: 0.923em;
  height: 0.923em;
}
/* Side panels: 200 px, 6 px padding, the panel color, tabs running top to bottom. */
.bx-mid {
  display: flex;
  flex: 1;
  min-height: 0;
}
.bx-side {
  width: 15.38em;
  flex: none;
  padding: 0.4615em;
  background: var(--bx-panel);
  border-right: 1px solid var(--bx-line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  box-sizing: border-box;
}
.bx-side.right {
  border-right: 0;
  border-left: 1px solid var(--bx-line);
  order: 2;
}
.bx-side .bx-tabs {
  flex-direction: column;
  align-items: stretch;
  height: auto;
  flex: 0 1 auto;
}
.bx-side .bx-new {
  align-self: flex-start;
  margin: 0 0 0.154em;
}
.bx-side .bx-tab {
  width: auto;
  flex: none;
}
/* Footer: 24 px tall (32 px with tabs), 11.5 px text in the secondary color. */
.bx-foot {
  display: flex;
  align-items: center;
  gap: 0.154em;
  height: 1.846em;
  padding: 0 0.615em;
  background: var(--bx-bar);
  border-top: 1px solid var(--bx-line);
  color: var(--bx-text-2);
  flex: none;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.bx-foot.tall {
  height: 2.462em;
}
.bx-foot .bx-sep {
  margin: 0.4615em;
}
.bx-foot .bx-ico {
  width: 1.692em;
  height: 1.538em;
}
.bx-foot .bx-ico svg {
  width: 1em;
  height: 1em;
}
.bx-foot .bx-t {
  font-size: 0.885em;
}
.bx-foot .bx-lp {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bx-foot .bx-item {
  display: flex;
  align-items: center;
  gap: 0.3077em;
  padding: 0 0.3077em;
  flex: none;
}
.bx-foot .bx-item svg {
  width: 1em;
  height: 1em;
}
.bx-foot .bx-zoom {
  display: flex;
  align-items: center;
  flex: none;
}
.bx-foot .bx-zoom .bx-pct {
  width: 3.65em;
  text-align: center;
}
.bx-foot .bx-tabs {
  flex: 1 1 auto;
}
.bx-foot .bx-tab {
  height: 1.846em;
}
.bx-foot .bx-addr {
  height: 1.692em;
}
.bx-page {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--bx-field);
  position: relative;
  overflow: hidden;
}
.bx-page.internal {
  background: var(--bx-panel);
}
.bx-titlebar {
  height: 2.6em;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 0.8em 0 0;
  background: var(--bx-bar);
  border-bottom: 1px solid var(--bx-line);
  font-weight: 600;
  flex: none;
}
.bx-titlebar .bx-lights {
  width: 5.846em;
}
.bx-titlebar .ttl {
  text-align: center;
}
.bx-titlebar .pad {
  width: 5em;
}
.bx-body {
  flex: 1;
  min-height: 0;
  background: var(--bx-bg);
  position: relative;
}

/* A news homepage for windows, sized like a real site at 100% zoom (1em is 13 px of screen, so a 16 px body is
   about 1.2em): a top row, the masthead and sections, the lead story beside its photo with a Most Read list, and
   a row of stories that runs past the bottom of the window. Narrower windows drop the Most Read list and the
   fourth story, the way a real site does. */
.bx-news {
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  container-type: inline-size;
  padding: 0 2.2em 2em;
  color: var(--bx-text);
}
.bx-news .ph {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bx-skel);
}
.bx-news .k {
  display: block;
  color: var(--bx-accent);
  font-weight: 600;
  font-size: 0.8em;
  margin-bottom: 0.4em;
}
.bx-news .util {
  display: flex;
  align-items: center;
  gap: 1.1em;
  height: 2.9em;
  font-size: 0.82em;
  color: var(--bx-text-2);
  white-space: nowrap;
  overflow: hidden;
}
.bx-news .util svg {
  width: 1.35em;
  height: 1.35em;
  flex: none;
}
.bx-news .util .r {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1em;
}
.bx-news .sub {
  background: var(--bx-accent);
  color: var(--bx-on-accent);
  font-weight: 600;
  padding: 0.4em 1em;
  border-radius: 0.3em;
}
.bx-news .mast {
  font: 700 2.9em / 1 var(--serif);
  letter-spacing: -0.015em;
  text-align: center;
  padding: 0.06em 0 0.24em;
  white-space: nowrap;
  overflow: hidden;
}
.bx-news .secs {
  display: flex;
  justify-content: safe center;
  gap: 1.8em;
  padding: 0.6em 0;
  border-top: 1px solid var(--bx-line);
  border-bottom: 3px double var(--bx-line);
  font-size: 0.88em;
  white-space: nowrap;
  overflow: hidden;
}
.bx-news .top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr) minmax(0, 0.95fr);
  padding-top: 1.3em;
}
.bx-news .top > * {
  padding: 0 1.5em;
  min-width: 0;
}
.bx-news .top > :first-child {
  padding-left: 0;
}
.bx-news .top > :last-child {
  padding-right: 0;
}
.bx-news .top > * + * {
  border-left: 1px solid var(--bx-line);
}
.bx-news .hl {
  font: 700 1.95em / 1.1 var(--serif);
  letter-spacing: -0.012em;
  margin-bottom: 0.4em;
  text-wrap: pretty;
}
.bx-news .dek {
  font: 400 1.08em / 1.45 var(--serif);
  color: var(--bx-text-2);
  margin: 0;
}
.bx-news .by {
  display: flex;
  gap: 1em;
  margin-top: 0.85em;
  font-size: 0.78em;
  color: var(--bx-text-2);
}
.bx-news .by b {
  color: var(--bx-text);
  font-weight: 600;
}
.bx-news .rel {
  margin-top: 1em;
  border-top: 1px solid var(--bx-line);
}
.bx-news .rel span {
  display: block;
  padding: 0.6em 0;
  border-bottom: 1px solid var(--bx-line);
  font: 600 0.98em / 1.3 var(--serif);
}
.bx-news figure {
  margin: 0;
}
.bx-news figcaption {
  margin-top: 0.5em;
  font-size: 0.76em;
  line-height: 1.4;
  color: var(--bx-text-2);
}
.bx-news .rh {
  display: block;
  font: 700 1.1em / 1 var(--serif);
  padding-bottom: 0.45em;
  border-bottom: 2px solid var(--bx-text);
}
.bx-news .mr {
  display: grid;
  grid-template-columns: 1.5em minmax(0, 1fr);
  padding: 0.6em 0;
  border-bottom: 1px solid var(--bx-line);
  font: 600 0.95em / 1.3 var(--serif);
}
.bx-news .mr i {
  font: 400 1.35em / 1 var(--serif);
  font-style: normal;
  color: var(--bx-accent);
}
.bx-news .nl {
  margin-top: 1em;
  padding: 0.85em 0.95em 0.95em;
  border-radius: 0.35em;
  background: var(--bx-panel);
  font-size: 0.82em;
  line-height: 1.4;
  color: var(--bx-text-2);
}
.bx-news .nl b {
  display: block;
  font: 700 1.2em / 1.2 var(--serif);
  color: var(--bx-text);
  margin-bottom: 0.2em;
}
.bx-news .nl span {
  display: inline-block;
  margin-top: 0.6em;
  padding: 0.3em 0.85em;
  border: 1px solid var(--bx-text);
  border-radius: 0.3em;
  color: var(--bx-text);
  font-weight: 600;
}
.bx-news .more {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5em;
  margin-top: 1.3em;
  padding-top: 1.2em;
  border-top: 1px solid var(--bx-line);
}
.bx-news .more .k {
  margin: 0.7em 0 0.25em;
}
.bx-news .more b {
  display: block;
  font: 700 1.05em / 1.25 var(--serif);
}
@container (max-width: 64em) {
  .bx-news .top {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr);
  }
  .bx-news .rail,
  .bx-news .more > :nth-child(4) {
    display: none;
  }
  .bx-news .top > :nth-child(2) {
    padding-right: 0;
  }
  .bx-news .more {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@container (max-width: 48em) {
  .bx-news .wx,
  .bx-news .rel span + span {
    display: none;
  }
  .bx-news .mast {
    font-size: 2.3em;
  }
  .bx-news .hl {
    font-size: 1.6em;
  }
}

/* Page content helpers */
.bx-skel {
  height: 0.75em;
  border-radius: 0.4em;
  background: var(--bx-skel);
}
.bx-article {
  padding: 1.8em 2.2em;
  display: grid;
  gap: 0.75em;
  align-content: start;
}
.bx-article .h {
  height: 1.4em;
  width: 55%;
  border-radius: 0.4em;
  background: var(--bx-skel);
  margin-bottom: 0.4em;
}
.bx-article .img {
  aspect-ratio: 16 / 6;
  max-height: 16em;
  border-radius: 0.5em;
  background: linear-gradient(160deg, #c9d6ea 0%, #dfe6f1 45%, #e8dccb 100%);
  max-width: 100%;
}
.bx.dark .bx-article .img {
  background: linear-gradient(160deg, #2a3550 0%, #323b4c 50%, #3b3529 100%);
}
.bx-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.2em;
}
.bx-card {
  background: var(--bx-field);
  border: 1px solid var(--bx-line);
  border-radius: 0.7em;
  padding: 1.5em 1.7em;
  width: min(32em, 100%);
  box-shadow: 0 0.1em 0.3em rgba(16, 22, 31, 0.05);
}
.bx-card h4 {
  margin: 0 0 0.5em;
  font-size: 1.15em;
  font-weight: 600;
  display: flex;
  gap: 0.6em;
  align-items: center;
}
.bx-card h4 svg {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}
.bx-card p {
  margin: 0 0 1em;
  color: var(--bx-text-2);
}
.bx-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  border-top: 1px solid var(--bx-line);
  margin: 0 0 1.1em;
}
.bx-facts span {
  padding: 0.55em 0;
  border-bottom: 1px solid var(--bx-line);
}
.bx-facts span:nth-child(odd) {
  color: var(--bx-text-2);
  padding-right: 2em;
}
.bx-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6em;
  flex-wrap: wrap;
}
.bx-actions .r {
  display: flex;
  gap: 0.5em;
  margin-left: auto;
}
.bx-link {
  color: var(--bx-accent);
  font-size: 0.92em;
}
.bx-b {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.45em 0.95em;
  border-radius: 0.45em;
  border: 1px solid var(--bx-edge);
  background: var(--bx-field);
  color: var(--bx-text);
  font-size: 0.95em;
  white-space: nowrap;
}
.bx-b.primary {
  background: var(--bx-accent);
  border-color: var(--bx-accent);
  color: var(--bx-on-accent);
  font-weight: 600;
}
.bx-sw {
  width: 2.5em;
  height: 1.45em;
  border-radius: 1em;
  background: var(--bx-edge);
  position: relative;
  flex: none;
  display: inline-block;
  transition: background 0.3s;
}
.bx-sw::after {
  content: "";
  position: absolute;
  top: 0.15em;
  left: 0.15em;
  width: 1.15em;
  height: 1.15em;
  border-radius: 50%;
  background: #fff;
  transition: left 0.3s cubic-bezier(0.3, 0.7, 0.3, 1.2);
}
.bx-sw.on {
  background: var(--bx-accent);
}
.bx-sw.on::after {
  left: 1.2em;
}
.bx-rows {
  background: var(--bx-panel);
  border-radius: 0.7em;
  overflow: hidden;
}
.bx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  padding: 0.8em 1em;
  border-bottom: 1px solid var(--bx-line);
}
.bx-row:last-child {
  border-bottom: 0;
}
.bx-row small {
  display: block;
  color: var(--bx-text-2);
}
.bx-row.choice {
  justify-content: flex-start;
}

/* Settings window: the sidebar of pages (General through Advanced, then Documentation), and the page beside it. */
.bx-set {
  display: grid;
  grid-template-columns: 12.5em minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
.bx-set .side {
  background: var(--bx-panel);
  border-right: 1px solid var(--bx-line);
  padding: 0.9em 0.6em;
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  overflow: hidden;
}
.bx-set .find {
  height: 2.1em;
  border: 1px solid var(--bx-line);
  border-radius: 0.45em;
  background: var(--bx-field);
  color: var(--bx-text-2);
  display: flex;
  align-items: center;
  padding: 0 0.6em;
  margin-bottom: 0.6em;
  flex: none;
}
.bx-set .side span {
  padding: 0.32em 0.6em;
  border-radius: 0.4em;
  color: var(--bx-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: none;
}
.bx-set .side span.on {
  background: var(--bx-tint);
  color: var(--bx-text);
  font-weight: 600;
}
.bx-set .main {
  padding: 1.2em 1.4em;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  overflow: hidden;
  min-width: 0;
}
.bx-set .main > b {
  font-size: 1.35em;
}
.bx-set .main > i {
  font-style: normal;
  color: var(--bx-text-2);
  font-weight: 600;
  font-size: 0.92em;
  margin-top: 0.3em;
}
.bx-radio {
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 1.5px solid var(--bx-edge);
  flex: none;
  display: inline-block;
  position: relative;
  transition: border-color 0.3s;
}
.bx-radio::after {
  content: "";
  position: absolute;
  inset: 0.18em;
  border-radius: 50%;
  background: var(--bx-accent);
  transform: scale(0);
  transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.3, 1.4);
}
.bx-radio.on {
  border-color: var(--bx-accent);
}
.bx-radio.on::after {
  transform: scale(1);
}

/* Bookmarks bar: 26 px tall with 8 px sides; items 22 px tall in 12 px type with 13 px icons. Under the top bars
   it has a line below; just above the footer, a line above. */
.bx-bm {
  display: flex;
  align-items: center;
  gap: 0.154em;
  height: 2em;
  padding: 0 0.615em;
  background: var(--bx-bar);
  border-bottom: 1px solid var(--bx-line);
  flex: none;
  overflow: hidden;
  white-space: nowrap;
}
.bx-bm.bottom {
  border-bottom: 0;
  border-top: 1px solid var(--bx-line);
}
.bx-bm span {
  display: flex;
  align-items: center;
  gap: 0.417em;
  height: 1.833em;
  padding: 0 0.583em;
  border-radius: 0.5em;
  font-size: 0.923em;
  color: var(--bx-text);
  flex: none;
  min-width: 0;
}
.bx-bm span b {
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bx-bm svg {
  width: 1.083em;
  height: 1.083em;
  color: var(--bx-text-2);
  flex: none;
}
.bx-bm .fav {
  width: 1.083em;
  height: 1.083em;
  border-radius: 0.25em;
  display: grid;
  place-items: center;
  flex: none;
}
.bx-pop {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.3em 0.7em;
  border: 1px solid var(--bx-line);
  border-radius: 0.45em;
  background: var(--bx-field);
  white-space: nowrap;
  flex: none;
}
.bx-pop::after {
  content: "";
  width: 0.38em;
  height: 0.38em;
  border-right: 1.5px solid var(--bx-text-2);
  border-bottom: 1.5px solid var(--bx-text-2);
  transform: translateY(-0.12em) rotate(45deg);
}
.bx-seg {
  display: inline-flex;
  border: 1px solid var(--bx-line);
  border-radius: 0.45em;
  overflow: hidden;
  flex: none;
}
.bx-seg span {
  padding: 0.28em 0.75em;
  white-space: nowrap;
}
.bx-seg span + span {
  border-left: 1px solid var(--bx-line);
}
.bx-seg span.on {
  background: var(--bx-accent);
  color: var(--bx-on-accent);
  font-weight: 600;
}
