/* The public site's palette, scaled for the working surfaces of Postager. */
:root, :root[data-theme="dark"] {
  --bg: var(--postager-paper);
  --surface: var(--postager-tint);
  --raised: var(--postager-white);
  --rail: var(--postager-paper);
  --ink: var(--postager-ink);
  --muted: var(--postager-muted);
  --line: var(--postager-line);
  --selected: var(--postager-selected);
  --key: var(--postager-tint);
  --key-hover: var(--postager-selected);
  --accent: var(--postager-accent);
  --glass: var(--postager-frost);
  --rail-glass: var(--postager-frost);
  --radius-control: 11px;
  --radius-card: 16px;
  --radius-window: 24px;
  --radius-tile: 16px;
}

body.adaptive-shell {
  background: linear-gradient(145deg,
      color-mix(in srgb, var(--postager-paper), transparent 48%),
      color-mix(in srgb, var(--postager-paper), transparent 14%) 75%),
    var(--postager-pastel) center / cover fixed;
}

body.auth-mode {
  background: linear-gradient(120deg, var(--postager-paper) 6%, transparent 92%),
    var(--postager-pastel) center / cover fixed;
}

body.adaptive-shell .header { border-top: 0; }
body.adaptive-shell .sidebar { border-top: 0; }
body.adaptive-shell .postager-wordmark, .auth-logo .postager-wordmark {
  font-weight: 750;
  letter-spacing: -.07em;
  font-synthesis: weight;
}

body.adaptive-shell .postager-wordmark > span, .auth-logo .postager-wordmark > span {
  position: relative;
  top: -.45em;
  margin: 0 0 0 1px;
  color: var(--accent);
  font-size: .55em;
  vertical-align: baseline;
}

body.adaptive-shell #nav { background: transparent; }
body.adaptive-shell .nav-item:nth-child(n) {
  border: 0;
  border-radius: var(--radius-tile);
}
body.adaptive-shell .nav-item[aria-current] { color: var(--accent); }
:is(.glyph-wrap, body.adaptive-shell .nav-item > .reference-nav-icon) { color: var(--accent); }
body.adaptive-shell .nav-item[aria-current] .reference-nav-icon {
  color: var(--postager-on-primary);
  background: var(--postager-primary);
}
body.adaptive-shell .brand.workspace-circle { background: var(--selected); }
body.adaptive-shell .brand.workspace-circle.selected {
  background: var(--postager-primary);
  color: var(--postager-on-primary);
  outline-color: var(--accent);
}
body.adaptive-shell .add-brand {
  color: var(--accent);
  background: var(--control);
  border-color: var(--postager-border);
}
body.adaptive-shell .add-brand:hover { background: var(--selected); }
body.adaptive-shell .add-brand > span { background: currentColor; }

body.adaptive-shell .tab:nth-child(n) { border-radius: var(--postager-pill); }
body.adaptive-shell .tab.active { color: var(--accent); background: var(--selected); }
body.adaptive-shell .tab.active::after { content: none; }

:is(.plain-button,.editor-actions button,.connection-dialog button.primary,.channel > button,
  .google-button,.auth-submit,.theme-button,.header-signup,.modal-head button,.setup-footer button),
body.adaptive-shell .add-post { border-radius: var(--postager-pill); }

:is(.plain-button.primary,.editor-actions button[data-save="Published"],.connection-dialog button.primary,
  .auth-submit,.header-signup,.setup-footer .primary),
body.adaptive-shell .add-post {
  background: var(--postager-primary);
  border-color: var(--postager-primary);
  color: var(--postager-on-primary);
}
:is(.plain-button.primary,.editor-actions button[data-save="Published"],.connection-dialog button.primary,
  .auth-submit,.header-signup,.setup-footer .primary):enabled:hover,
body.adaptive-shell .add-post:enabled:hover,
body.adaptive-shell .header-signup:hover {
  background: var(--postager-primary-hover);
  border-color: var(--postager-primary-hover);
  color: var(--postager-on-primary);
}

#main :is(button, a, input, select, textarea):focus-visible,
:is(.header, .sidebar, .modal, .setup-screen) :is(button, a, input, select, textarea):focus-visible {
  outline-color: var(--accent);
}

body.adaptive-shell .post-open { border-radius: inherit; }
body.adaptive-shell .post-open .post-image { border-radius: calc(var(--radius-card) - var(--stroke)) 0 0 calc(var(--radius-card) - var(--stroke)); }
:is(body.adaptive-shell .post, body.adaptive-shell .delivery-card, .surface-group, .channels,
  .analytics-overview, .auth-shell, .auth-action-page, .modal) { box-shadow: var(--postager-shadow); }
body.adaptive-shell .post:hover, body.adaptive-shell .post.is-expanded { border-color: var(--postager-border); }
body.adaptive-shell .special-day {
  padding: 2px 7px;
  background: var(--postager-warm);
  border-radius: var(--postager-pill);
}
body.adaptive-shell .special-day:empty { display: none; }
.page-heading h1, .auth-content h1, .setup-body h1, .auth-action-page h1 {
  font-weight: 700;
  font-synthesis: weight;
  letter-spacing: -.055em;
}
.group-heading, .modal-head, .analytics-access > summary { background: var(--surface); }
.modal-head { border-radius: var(--radius-window) var(--radius-window) 0 0; }
.modal { background: var(--postager-paper); }
.composer-brand-mark { color: var(--accent); }
.composer-provider-fields:not(:has(fieldset:not([hidden]))) { display: none; }
.analytics-overview {
  background: linear-gradient(120deg, var(--postager-frost), var(--surface));
}
.analytics-totals > div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.analytics-totals dd { color: var(--accent); }
.analytics-network-coverage meter::-webkit-meter-bar { background: var(--line); }
#analyticsResults {
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--control);
}
#analyticsResults > :last-child { border-bottom: 0; }
.analytics-entry summary:hover { background: var(--surface); }

.auth-mode .auth-shell { --setup-artwork: none; }
.auth-left, .setup-pane { background: var(--postager-paper); }
.auth-art, .setup-illustration {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--postager-pastel);
}
.auth-art::before, .setup-illustration::before {
  content: 'POSTAGER';
  position: absolute;
  z-index: -1;
  inset: 12% 0 auto;
  color: var(--postager-frost);
  font: 900 clamp(32px, 7.1vw, 92px)/.9 var(--font);
  font-synthesis: weight;
  letter-spacing: -.1em;
  text-align: center;
}
.auth-art img, .setup-illustration img {
  display: block;
  width: min(65%, 300px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border: 5px solid var(--postager-white);
  border-radius: 50%;
  box-shadow: 0 20px 46px -23px rgb(60 34 72 / 55%);
}
.setup-pane::before, .setup-pane::after { display: none; }
.auth-mode .auth-action-page { background: var(--postager-paper); }
.auth-action-page a { color: var(--accent); }
.auth-action-page a.auth-action-logo { color: var(--ink); font-size: 23px; }

@media (max-width: 850px) {
  .setup-illustration::before { inset-block-start: 14%; }
  .setup-screen .setup-illustration img { width: clamp(86px, 17dvh, 146px); height: auto; object-position: center; }
}
@media (max-width: 850px) and (max-height: 590px) {
  .setup-screen .setup-illustration img { width: 69px; }
}

@media (max-width: 760px) {
  .auth-art { display: none; }
  body.adaptive-shell:not(.auth-mode) .sidebar { width: 58px; }
  body.adaptive-shell:not(.auth-mode) main { margin-left: 58px; padding-right: 12px; }
  body.adaptive-shell .sidebar .add-post {
    width: 44px;
    min-height: 44px;
    left: 7px;
    padding: 0;
    font-size: 0;
    gap: 0;
    justify-content: center;
  }
  body.adaptive-shell .sidebar .nav-item { min-height: 44px; padding: 0; justify-content: center; }
  body.adaptive-shell .sidebar .nav-item :is(.reference-nav-copy,.reference-chevron) { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  :root, :root[data-theme="dark"] { --glass: var(--surface); --rail-glass: var(--rail); }
}

@media (forced-colors: active) {
  body.adaptive-shell, body.auth-mode, .auth-art, .setup-illustration { background: Canvas; }
}
