:root {
  --navy: #004a99;
  --navy-dark: #003a7a;
  --navy-mid: #1a5cb3;
  --blue: #1d5bb8;
  --navy-soft: #e8f0fa;
  --page: #eef2f6;
  --card: #ffffff;
  --line: #d7dee8;
  --text: #1c2430;
  --muted: #6b7787;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
html[data-font="s"] { font-size: 13px; }
html[data-font="m"] { font-size: 15px; }
html[data-font="l"] { font-size: 17px; }
html, body { margin: 0; min-height: 100%; }
body { font-family: "Segoe UI", Helvetica, Arial, sans-serif; color: var(--text); background: var(--page); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  cursor: pointer;
  background: transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy-mid); text-decoration: none; color: #fff; }
.btn[disabled], .btn[disabled]:hover {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--blue);
}
.btn-outline { border-color: var(--blue); color: var(--blue); background: #fff; margin-top: 1.2rem; }
.btn-lg { padding: 0.85rem 2rem; font-size: 1.05rem; }
.dash-body .btn { padding: 0.38rem 0.75rem; font-size: 0.88rem; }
.dash-body .btn-outline { margin-top: 0.9rem; }
.linkish { background: none; border: 0; color: var(--blue); cursor: pointer; font: inherit; padding: 0; }
.linkish.muted { color: var(--muted); }

.logo-mark {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  flex-shrink: 0;
}
.logo-mark .logo-svg { width: 100%; height: 100%; display: block; }
.logo-mark.light { color: #fff; }

.home-body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #eef4ff;
  background:
    radial-gradient(ellipse 70% 50% at 12% -10%, rgba(73, 140, 230, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 10%, rgba(20, 70, 150, 0.55), transparent 50%),
    linear-gradient(165deg, #071833 0%, #0d3b7a 48%, #08244f 100%);
  overflow-x: hidden;
}
.home-glow {
  pointer-events: none;
  position: absolute;
  inset: auto -8rem 8% auto;
  width: min(34rem, 70vw);
  height: min(34rem, 70vw);
  border-radius: 50%;
  border: 18px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.04);
}
.home-glow::after {
  content: "";
  position: absolute;
  width: 42%;
  height: 10px;
  right: -8%;
  bottom: 18%;
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(42deg);
  border-radius: 99px;
}
.home-top, .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1.4rem;
}
.home-top { position: relative; z-index: 2; }
.home-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: inherit;
  text-decoration: none;
}
.home-brand small { display: block; opacity: 0.75; font-size: 0.72rem; font-weight: 400; }
.home-tools { display: flex; align-items: center; gap: 1rem; }
.home-shell {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  width: 100%;
  flex: 1 1 auto;
  margin: 0.6rem auto 0;
  padding: 0 1.5rem;
}
.home-hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 60px rgba(3, 12, 32, 0.28);
}
.home-hero-top {
  padding: 1.15rem 1.4rem 0.45rem;
}
.home-hero-brand {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0;
}
.home-hero-card h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.55rem);
  line-height: 1.12;
  color: #fff;
  margin: 0 0 0.35rem;
  letter-spacing: -0.03em;
}
.home-hero-brand .eyebrow { margin: 0; }
.home-hero-actions {
  display: grid;
  padding: 0.5rem 1.2rem 1.25rem;
}
.home-upload {
  display: grid;
  gap: 0.35rem;
  margin-top: 0;
  place-content: center;
  text-align: center;
  min-height: 10.5rem;
  padding: 1.6rem 1.5rem;
  border: 2px dashed rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  max-width: none;
}
.home-upload:hover { background: rgba(255, 255, 255, 0.14); text-decoration: none; }
.home-upload strong { font-size: 1.45rem; }
.home-upload span { font-size: 0.95rem; color: rgba(235, 242, 255, 0.75); }
.home-drop-form { margin: 0; }
.home-upload { position: relative; cursor: pointer; }
.home-file-input {
  position: absolute;
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  overflow: hidden;
}
.home-upload.is-drag,
.home-upload.is-busy {
  background: rgba(255, 255, 255, 0.2);
  border-color: #fff;
}
.home-drop-form.is-busy { pointer-events: none; }
.home-flash {
  padding: 0 1.2rem 0.2rem;
}
.home-flash .flash { margin: 0 0 0.5rem; }
.home-hero-slash {
  position: relative;
  width: 4.5rem;
  pointer-events: none;
}
.home-hero-slash::before {
  content: "";
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: 50%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-50%) rotate(-28deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.home-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 1.4rem 1.5rem 1.5rem 0.4rem;
}
.home-audiences {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.home-audiences article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.8rem 0.9rem 0.85rem;
}
.home-aud-mark {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-top: 0.05rem;
}
.home-audiences strong {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
}
.home-audiences p {
  margin: 0;
  color: rgba(235, 242, 255, 0.88);
  font-size: 0.88rem;
  line-height: 1.55;
}
.home-audiences .home-aud-note {
  margin-top: 0.55rem;
  color: rgba(210, 224, 248, 0.72);
  font-size: 0.84rem;
}
.home-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}
.home-features article {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 1rem 1.05rem 1.1rem;
}
.home-features strong { display: block; color: #fff; margin-bottom: 0.3rem; }
.home-features p { margin: 0; color: rgba(230, 238, 252, 0.72); line-height: 1.45; }
.eyebrow { letter-spacing: 0.08em; text-transform: uppercase; color: #9dc2ff; font-size: 0.78rem; margin: 0 0 0.4rem; }
.lead { font-size: 1.08rem; line-height: 1.6; color: var(--muted); margin: 0 0 1.6rem; }
.lang-switch { color: #d7e6ff; font-size: 0.85rem; }
.lang-switch.dark { color: var(--blue); }
.font-ctl {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: inherit;
  font-size: 0.75rem;
}
.font-ctl > span { opacity: 0.7; margin-right: 0.2rem; }
.font-btn {
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  opacity: 0.7;
}
.font-btn.font-m { font-size: 0.95rem; }
.font-btn.font-l { font-size: 1.15rem; }
.font-btn.active, .font-btn:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); }
.dash-body .font-ctl { color: var(--muted); }
.dash-body .font-btn { border-color: var(--line); color: var(--navy); }
.dash-body .font-btn.active, .dash-body .font-btn:hover { background: #e8eef8; }

.login-wrap {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 1rem 0.35rem;
  position: relative;
  z-index: 1;
  min-height: 0;
}
.login-card {
  width: min(420px, 100%);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 1rem 1.2rem 1.15rem;
  display: grid;
  gap: 0.65rem;
  color: var(--text);
  box-shadow: 0 24px 50px rgba(3, 12, 32, 0.28);
}
.login-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.login-or::before,
.login-or::after {
  content: "";
  height: 1px;
  background: var(--line);
}
.btn-google {
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  gap: 0.55rem;
}
.btn-google::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  background: url("/static/img/google-g.svg") center / contain no-repeat;
  flex-shrink: 0;
}
.btn-google:hover {
  background: #f8f9fa;
  color: #1f1f1f;
  text-decoration: none;
  border-color: #c6c6c6;
}
.home-body .btn-google {
  margin-top: 0.2rem;
}
.login-form select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  background: #fff;
}
.login-form small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.login-links { margin: 0.15rem 0 0; font-size: 0.85rem; }
.login-links a { color: var(--blue); }
.register-card { width: min(460px, 100%); }
.partner-fields {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding: 0.55rem 0.65rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f3f7fc;
}
.partner-fields[hidden] { display: none; }
.partner-title { margin: 0; font-size: 0.86rem; color: var(--navy); font-weight: 700; }
.pending-box {
  min-width: 0;
  background: #f3f7fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem 0.6rem;
  color: var(--text);
  display: grid;
  gap: 0.2rem;
}
.pending-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.7rem;
}
.pending-head strong { font-size: 0.82rem; color: var(--navy); }
.pending-head .linkish { font-size: 0.78rem; flex-shrink: 0; }
.pending-box p { margin: 0; }
.pending-file {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--text);
}
.pending-box .hint { margin: 0; font-size: 0.72rem; }
.login-card h1 { margin: 0 0 0.15rem; color: var(--navy); font-size: 1.28rem; }
.error-card { gap: 0.75rem; }
.error-card .error-body { margin: 0; color: var(--text); line-height: 1.45; }
.error-card .error-persist { color: var(--muted); font-size: 0.9rem; }
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-top: 0.35rem;
}
.error-card .btn { justify-self: start; }
.login-card .eyebrow { color: var(--blue); margin: 0; }
.login-card input, .form input, .form select, .form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
.form textarea { min-height: 6rem; resize: vertical; }

.dash-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  font-size: 0.92rem;
}
.app-topbar {
  height: 58px;
  background: #fff;
  border-bottom: 1px solid #e4e9f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.1rem;
  flex-shrink: 0;
  z-index: 20;
}
.top-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--navy);
  text-decoration: none;
  min-width: 220px;
}
.top-logo:hover { text-decoration: none; }
.top-logo-text { display: flex; align-items: baseline; gap: 0.55rem; }
.top-logo-text strong { font-size: 0.95rem; letter-spacing: 0.02em; }
.top-logo-text em {
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-left: 1px solid #cfd7e3;
  padding-left: 0.55rem;
}
.top-nav {
  display: flex;
  align-items: center;
  gap: 1.6rem;
}
.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #3d4b5c;
  font-size: 0.82rem;
  text-decoration: none;
}
.top-nav a svg { width: 16px; height: 16px; }
.top-nav a:hover, .top-nav a.active { color: var(--navy); text-decoration: none; }
.top-nav .top-submit {
  margin-left: 0.35rem;
  white-space: nowrap;
}
.top-nav a.top-submit,
.top-nav a.top-submit:hover,
.top-nav a.top-submit.active {
  color: #fff;
}
.top-tools { display: flex; align-items: center; justify-content: flex-end; gap: 0.85rem; min-width: 220px; }
.inline-form { display: inline; }
.offer-form .form-row { margin-bottom: 0.75rem; }
.offer-form .form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
@media (max-width: 640px) {
  .offer-form .form-row-2 { grid-template-columns: 1fr; }
}
.billing-profiles {
  display: grid;
  gap: 1rem;
}
.billing-page-head {
  align-items: flex-start;
  gap: 1rem;
}
.billing-add-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #edf1f6;
}
.billing-add-panel[hidden] { display: none !important; }
.billing-add-panel h2 {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  text-transform: none;
  letter-spacing: 0;
}
.billing-rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 0.75rem 0 1rem;
}
@media (max-width: 720px) {
  .billing-rate-grid { grid-template-columns: 1fr; }
}
.billing-rate-box {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}
.billing-rate-box.is-special {
  background: #f3f8ff;
  border-color: #c9daf5;
}
.billing-rate-box h3 {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #5a6b82;
}
.billing-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.25rem;
}
.billing-user-list {
  display: grid;
  gap: 0.75rem;
}
.billing-user-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(15, 35, 70, 0.03);
}
.billing-user-card.has-special-on {
  border-color: #b7d0f5;
  box-shadow: 0 0 0 1px rgba(47, 111, 237, 0.08);
}
.billing-prepaid-list {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e8eef5;
}
.billing-prepaid-list h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}
.billing-prepaid-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.billing-prepaid-ul li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  font-size: 0.88rem;
}
.billing-user-main {
  display: grid;
  grid-template-columns: minmax(10rem, 1.2fr) minmax(12rem, 1.6fr) auto;
  gap: 0.85rem 1rem;
  align-items: center;
  padding: 0.95rem 1.05rem;
}
@media (max-width: 900px) {
  .billing-user-main { grid-template-columns: 1fr; }
}
.billing-user-identity {
  display: grid;
  gap: 0.15rem;
}
.billing-user-identity strong {
  font-size: 1rem;
  color: var(--navy);
}
.billing-user-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.billing-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #4a5a6d;
  font-size: 0.78rem;
  font-weight: 600;
}
.billing-chip.is-on {
  background: #e7f0ff;
  color: #1e4fbf;
}
.billing-chip.is-off {
  background: #f1f3f6;
  color: #7a8798;
}
.billing-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}
.billing-toggle-btn { min-width: 7.5rem; }
.billing-edit-panel {
  padding: 0 1.05rem 1.05rem;
  border-top: 1px solid #edf1f6;
  background: #fbfcfe;
}
.billing-edit-panel[hidden] { display: none !important; }
.billing-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.billing-profile-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.1rem 1.15rem;
  background: #fbfcfe;
}
.billing-profile-card > header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.85rem;
}
.billing-rate-summary ul {
  margin: 0.35rem 0 1rem;
  padding-left: 1.2rem;
}
.billing-pay-box {
  margin: 0 0 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: #f3f7fc;
  border: 1px solid #e2eaf4;
}
.billing-pay-box h3 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--navy);
}
.fees-page-head {
  align-items: flex-start;
  gap: 1rem;
}

/* Modern billing overview (OpenAI-inspired layout, Mloupe palette) */
.bill {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 56rem;
}
.bill-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  width: 100%;
}
.bill-head h1 {
  margin: 0;
  font-size: clamp(1.65rem, 2.4vw, 2rem);
  letter-spacing: -0.02em;
  color: var(--text);
}
.bill-lead {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 36rem;
  line-height: 1.45;
}
.bill-head-btn { margin-top: 0.15rem; }
.bill-head-aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem 1.25rem;
  margin-left: auto;
}
.bill-head-credits {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1.1rem;
}
.bill-head-credits-label {
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--text);
  margin-right: 0.15rem;
}
.bill-head-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  min-width: 3.25rem;
}
.bill-head-credit span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.bill-head-credit strong {
  font-size: 1.45rem;
  line-height: 1.05;
  color: var(--navy);
  font-weight: 750;
}
.bill-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.bill-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.65rem 0.55rem 0.75rem;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.bill-tab:hover { color: var(--text); }
.bill-tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--navy);
}
.bill-panel { display: none; }
.bill-panel.is-active { display: block; }
.bill-panel-head { margin-bottom: 0.85rem; }
.bill-panel-head h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--navy);
}
.bill-panel-head .hint { margin: 0.3rem 0 0; }
.bill-section-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: var(--text);
}
.bill-hero {
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #f7fbff 0%, #ffffff 48%);
}
.bill-balance-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.bill-balance-value {
  display: block;
  margin-top: 0.2rem;
  font-size: clamp(2.1rem, 4vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--navy);
  font-weight: 750;
}
.bill-balance-value.is-due { color: #9a6b00; }
.bill-balance-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}
.bill-due-break {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
}
.bill-due-break span {
  display: inline-flex;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: #fff8e8;
  border: 1px solid #f0d78a;
  color: #7a5a10;
  font-size: 0.75rem;
}
.bill-status-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1rem;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.bill-status-main {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.bill-status-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef4fb;
  color: var(--navy);
  flex-shrink: 0;
}
.bill-status-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
}
.bill-status-title-row strong {
  font-size: 0.95rem;
  color: var(--text);
}
.bill-status-hint {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  max-width: 34rem;
}
.bill-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: #e8eef5;
  color: #4a5b70;
}
.bill-pill.is-on {
  background: #e4f6ea;
  color: #1d7a3a;
}
.bill-status-action { margin-top: 0; }
.bill-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.bill-cta-row .btn { margin-top: 0; }
.bill-cta-primary {
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 999px;
  font-weight: 600;
}
.bill-cta-primary:hover { background: var(--navy-mid); border-color: var(--navy-mid); }
.bill-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}
@media (max-width: 720px) {
  .bill-link-grid { grid-template-columns: 1fr; }
}
.bill-link-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-align: left;
  width: 100%;
  padding: 1rem 1.05rem;
  border: 1px solid #d4e3f5;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bill-link-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 74, 153, 0.08);
  text-decoration: none;
}
.bill-link-card.is-static { cursor: default; }
.bill-link-card.is-static:hover { box-shadow: none; border-color: var(--line); }
.bill-link-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  background: var(--navy-soft);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bill-link-icon svg { width: 1.15rem; height: 1.15rem; }
.bill-link-card strong {
  display: block;
  color: var(--navy);
  font-size: 0.9rem;
  font-weight: 600;
}
.bill-link-card em {
  display: block;
  margin-top: 0.18rem;
  font-style: normal;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.bill-rate-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1rem;
}
@media (max-width: 560px) {
  .bill-rate-strip { grid-template-columns: 1fr; }
}
.bill-rate-strip article {
  border: 1px solid #d4e3f5;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: var(--navy-soft);
}
.bill-rate-strip article.is-on {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 1px 3px rgba(0, 74, 153, 0.08);
}
.bill-rate-strip span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.bill-rate-strip strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--navy);
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}
.bill-rate-strip small {
  display: block;
  margin-top: 0.25rem;
  color: #6b7c90;
  font-size: 0.74rem;
}
.bill-surface {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 0.9rem 1rem 1rem;
}
.bill-back { margin-top: 0.9rem; }

/* OpenAI-style billing shell */
.bill-oai {
  max-width: 52rem;
  gap: 1.5rem;
}
.bill-oai .bill-head h1 {
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.bill-oai .bill-tabs {
  gap: 0 1.25rem;
  border-bottom-color: var(--line);
}
.bill-oai .bill-tab {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  padding: 0.55rem 0 0.85rem;
  border-bottom-width: 2px;
}
.bill-oai .bill-tab.is-active {
  color: var(--navy);
  border-bottom-color: var(--blue);
  font-weight: 600;
}
.bill-oai .bill-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--navy);
}
.bill-oai .bill-balance-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.bill-oai .bill-rate-strip article strong {
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--navy);
}
.bill-oai .bill-rate-strip article {
  background: var(--navy-soft);
  border-color: #d4e3f5;
}
.bill-oai .bill-rate-strip article.is-on {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 1px 3px rgba(0, 74, 153, 0.08);
}
.bill-rate-strip article.is-on span {
  color: var(--blue);
}
.bill-rate-strip article.is-alert {
  background: #fffdf5;
  border-color: #e8c96a;
}
.bill-rate-strip article.is-alert span {
  color: #9a6b00;
}
.bill-rate-strip-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.bill-rate-strip-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
/* Dashboard overview: one row + side total */
.dash-overview-row {
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  margin-top: 1rem;
}
.dash-overview-row .dash-overview-strip {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}
.dash-overview-total {
  flex: 0 0 min(12rem, 22vw);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--blue);
  border-radius: 14px;
  background: linear-gradient(180deg, #f0f7ff 0%, #fff 100%);
  box-shadow: 0 1px 3px rgba(0, 74, 153, 0.08);
}
.dash-overview-total > span {
  font-size: 0.62rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--blue);
}
.dash-overview-total strong {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  font-weight: 650;
  color: var(--navy);
  letter-spacing: -0.03em;
}
.dash-overview-total > small {
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.3;
}
.dash-total-pay {
  margin-top: 0.45rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}
.dash-overview-inbox {
  border-color: #1d7a3a;
  background: linear-gradient(180deg, #f4fbf6 0%, #fff 100%);
}
.dash-overview-inbox > span { color: #1d7a3a; }
.bill-rate-strip article.is-active-rate {
  background: #e6f4ea;
  border-color: #1d7a3a;
  box-shadow: 0 1px 3px rgba(29, 122, 58, 0.1);
}
.bill-rate-strip article.is-active-rate span {
  color: #1d7a3a;
}
.bill-rate-strip article.is-active-rate strong {
  color: #145c2d;
}
.bill-rate-strip article.is-inactive-rate {
  background: #f8fafc;
  border-color: #d7dee8;
  opacity: 0.92;
}
.bill-rate-strip article.is-inactive-rate span {
  color: var(--muted);
}
.dash-fee-badge {
  display: inline-block;
  font-style: normal;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #1d7a3a;
  color: #fff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}
.dash-fee-badge.is-inactive {
  background: #94a3b8;
  color: #fff;
}
.dash-stat-link,
.dash-tier-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  text-decoration: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.6rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.dash-stat-link:hover,
.dash-tier-btn:hover {
  border-color: #1d5bb8;
  box-shadow: 0 1px 4px rgba(13, 59, 122, 0.12);
}
.dash-stat-link.is-on {
  background: #eef4fb;
  border-color: #1d5bb8;
}
.dash-stat-link.is-alert {
  background: #fff5f5;
  border-color: #c0392b;
}
.dash-tier-form {
  margin: 0;
  min-width: 0;
  border-radius: 14px;
}
.dash-overview-strip .dash-stat-link span,
.dash-overview-strip .dash-tier-btn span {
  font-size: 0.62rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.dash-overview-strip .dash-stat-link strong,
.dash-overview-strip .dash-tier-btn strong {
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--ink);
}
.dash-overview-strip .dash-stat-link small,
.dash-overview-strip .dash-tier-btn small {
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.3;
}
.dash-overview-strip .dash-stat-link.is-active-rate,
.dash-overview-strip .dash-tier-btn.is-active-rate {
  background: #e6f4ea !important;
  border-color: #1d7a3a !important;
  box-shadow: 0 1px 3px rgba(29, 122, 58, 0.1);
  opacity: 1;
}
.dash-overview-strip .dash-stat-link.is-active-rate span,
.dash-overview-strip .dash-tier-btn.is-active-rate span {
  color: #1d7a3a !important;
}
.dash-overview-strip .dash-stat-link.is-active-rate strong,
.dash-overview-strip .dash-tier-btn.is-active-rate strong {
  color: #145c2d !important;
}
.dash-overview-strip .dash-stat-link.is-inactive-rate,
.dash-overview-strip .dash-tier-btn.is-inactive-rate {
  background: #f8fafc !important;
  border-color: #d7dee8 !important;
  opacity: 0.92;
}
.dash-overview-strip .dash-stat-link.is-inactive-rate span,
.dash-overview-strip .dash-tier-btn.is-inactive-rate span {
  color: var(--muted);
}
.dash-fee-card small.dash-fee-meta,
.dash-fee-card .dash-fee-meta {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin-top: 0.35rem;
  padding-top: 0.3rem;
  border-top: 1px solid rgba(29, 122, 58, 0.15);
  font-size: 0.58rem;
  font-weight: 600;
  color: #1d7a3a;
  line-height: 1.35;
}
.dash-fee-card.is-inactive-rate .dash-fee-meta {
  border-top-color: var(--line);
  color: var(--muted);
}
.dash-fee-card.has-due.is-active-rate {
  border-color: #1d7a3a;
}
@media (max-width: 900px) {
  .dash-overview-row { flex-direction: column; }
  .dash-overview-total { flex: none; width: 100%; }
}
.dash-overview-strip.bill-rate-strip-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
}
.dash-overview-strip article {
  padding: 0.7rem 0.6rem;
  min-width: 0;
}
.dash-overview-strip span {
  font-size: 0.62rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
}
.dash-overview-strip strong {
  font-size: clamp(1.1rem, 1.6vw, 1.55rem);
  margin-top: 0.15rem;
}
.dash-overview-strip small {
  font-size: 0.6rem;
  line-height: 1.25;
  margin-top: 0.2rem;
}
@media (max-width: 1100px) {
  .bill-rate-strip-6:not(.dash-overview-strip) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .bill-rate-strip-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bill-rate-strip-6:not(.dash-overview-strip) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-overview-strip.bill-rate-strip-6 {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.25rem;
  }
  .dash-overview-strip article {
    flex: 0 0 min(42vw, 10.5rem);
  }
}
@media (max-width: 560px) {
  .bill-rate-strip:not(.dash-overview-strip) { grid-template-columns: 1fr; }
}
.bill-rate-strip-config {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 720px) {
  .bill-rate-strip-config { grid-template-columns: 1fr; }
}
.bill-rate-strip-config strong {
  font-size: 0.82rem;
  font-weight: 600;
  word-break: break-all;
}
.bill-cta-outline {
  border-radius: 999px;
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
  margin-top: 0;
}
.bill-cta-outline:hover {
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
}

/* Shared dashboard shell (billing-style) */
.dash-ui {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
}
.dash-ui .bill-head h1 {
  font-size: clamp(1.85rem, 3vw, 2.35rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--navy);
  text-transform: none;
  margin: 0;
}
.dash-ui .bill-section-title {
  margin: 1rem 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--navy);
  text-transform: none;
  letter-spacing: 0;
}
.dash-ui .bill-balance-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.dash-ui-section {
  border: 1px solid #d4e3f5;
  border-radius: 14px;
  background: #fff;
  padding: 1.1rem 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 74, 153, 0.04);
}
.dash-ui-section .bill-section-title {
  margin: 0;
  font-size: 1.05rem;
}
.dash-ui-page-head {
  margin-bottom: 0.85rem;
}
.dash-ui-page-head .btn { margin-top: 0; }
.dash-ui-eta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* Pill buttons across the signed-in app */
.dash-body .btn-primary {
  border-radius: 999px;
  background: var(--blue);
  border-color: var(--blue);
  font-weight: 600;
}
.dash-body .btn-primary:hover {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
}
.dash-body .btn-outline {
  border-radius: 999px;
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
}
.dash-body .btn-outline:hover {
  background: var(--navy-soft);
  color: var(--navy);
  text-decoration: none;
}
.dash-body .page-head .btn-outline { margin-top: 0; }

.bill-oai .bill-rate-strip article.is-on span {
  color: var(--blue);
}
.bill-oai .bill-status-card {
  margin-top: 1.35rem;
  border-radius: 14px;
  border-color: #e8e8e8;
}
.bill-oai .bill-status-card-muted {
  opacity: 0.92;
}
.bill-oai .bill-status-card-muted .bill-status-action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.bill-oai .bill-cta-primary {
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
}
.bill-oai .bill-cta-primary:hover {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
  color: #fff;
}
.bill-oai .bill-cta-row .btn-outline {
  border-radius: 999px;
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
}
.bill-oai .bill-link-grid {
  margin-top: 1.35rem;
  gap: 0.5rem;
}
.bill-oai .bill-link-card {
  border-radius: 14px;
  border-color: #d4e3f5;
  padding: 1rem 1.05rem;
}
.bill-oai .bill-link-card:hover {
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(0, 74, 153, 0.08);
}
.bill-oai .bill-link-icon {
  background: var(--navy-soft);
  color: var(--blue);
  border-radius: 8px;
}
.bill-oai .bill-link-card strong {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}
.bill-oai .bill-buy-pay.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  border-radius: 999px;
}
.bill-oai .bill-buy-pay.btn-primary:hover {
  background: var(--navy-mid);
  border-color: var(--navy-mid);
}

.bill-success-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.bill-success-modal.is-open {
  display: flex;
}
.bill-success-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}
.bill-success-card {
  position: relative;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
  padding: 1.5rem 1.35rem 1.35rem;
  border: 1px solid rgba(37, 99, 235, 0.12);
}
.bill-success-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.bill-success-close:hover {
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}
.bill-success-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bill-success-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  color: var(--navy);
}
.bill-success-body {
  margin: 0 0 1.1rem;
  color: var(--text);
  line-height: 1.5;
}
.bill-success-ok {
  width: 100%;
  border-radius: 999px;
}
.bill-unilis-due-hint {
  margin: 0.35rem 0 1rem;
}
.bill-unilis-due-strip article.has-due strong {
  color: var(--blue);
}
.bill-rate-strip-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bill-rate-strip-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .bill-rate-strip-2,
  .bill-rate-strip-3 { grid-template-columns: 1fr; }
}
.bill-unilis-due-strip .dash-overview-total-card {
  background: #fff;
  border-color: var(--blue);
  box-shadow: 0 1px 3px rgba(0, 74, 153, 0.08);
}
.bill-unilis-due-strip .dash-overview-total-card strong {
  color: var(--blue);
  font-size: 1.75rem;
}
.fees-pay-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin: 0 0 0.75rem;
}
.fees-pay-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.fees-pay-toolbar-pay {
  margin-left: auto;
}
.fees-pay-toolbar .fees-pay-btn {
  margin-top: 0;
  padding: 0.38rem 0.85rem;
  font-size: 0.78rem;
  line-height: 1.2;
  min-height: 0;
  border-radius: 999px;
}
.fees-pay-toolbar .fees-pay-btn.btn-primary {
  padding: 0.38rem 0.95rem;
}
.fees-pay-toolbar .fees-pay-btn:hover {
  background: var(--navy-soft);
}
tr.is-pay-pending td {
  color: var(--muted);
}

/* Minimal buy / billing */
.bill-min .bill-lead { display: none; }
.bill-min-hero {
  padding: 1.25rem 0 0.5rem;
}
.bill-min-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.85rem 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.bill-min-credits-hero {
  margin: 0.35rem 0 1rem;
}
.bill-min-credits-hero strong {
  font-size: 1.75rem;
  display: inline-block;
  margin-left: 0.2rem;
}
.bill-buy {
  max-width: 36rem;
  padding: 0.5rem 0 1.5rem;
  min-width: 0;
}
.bill-buy h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.bill-buy-balance {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.bill-buy-balance strong { color: var(--text); }
.bill-buy-form label { display: block; margin-top: 0.75rem; }
.bill-buy-tiers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.55rem;
  margin: 0.25rem 0 0.85rem;
}
.bill-buy-tier {
  margin: 0 !important;
  cursor: pointer;
  min-width: 0;
}
.bill-buy-tier input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.bill-buy-tier span {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bill-buy-tier strong { font-size: 0.92rem; color: var(--text); }
.bill-buy-tier small {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.25;
}
.bill-buy-alt { margin-top: 1rem; }
.bill-buy-alt .linkish {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent, #1a5fb4);
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
}
.bill-manual-status { margin-top: 2rem; }
.bill-manual-status h3 {
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}
.bill-reject-form input[type="text"] {
  min-width: 10rem;
  margin-right: 0.35rem;
  font-size: 0.8rem;
}
.bill-receipt-panel { margin-top: 0.85rem; }
.bill-receipt-lead {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}
.bill-receipt-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.bill-receipt-contacts .btn {
  margin-top: 0;
  width: auto;
}
.bill-receipt-choose {
  border: 0;
  margin: 0.85rem 0 1rem;
  padding: 0;
  min-width: 0;
}
.bill-tier-err {
  color: #9b1c1c;
  margin: -0.35rem 0 0.5rem;
}
.bill-receipt-choose legend {
  font-weight: 650;
  font-size: 0.9rem;
  margin-bottom: 0.45rem;
  padding: 0;
}
.bill-receipt-choose .bill-buy-total {
  margin-top: 0.65rem;
  font-size: 1.25rem;
}
.service-out {
  border: 1px solid #f0c7c7;
  background: #fff7f7;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0 1rem;
}
.service-out strong {
  display: block;
  color: #9b1c1c;
  font-size: 1rem;
}
.service-out p {
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.service-out-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.service-out-actions .btn { margin-top: 0; }
.bill-buy-tier input:checked + span {
  border-color: var(--navy);
  box-shadow: 0 0 0 1px var(--navy);
  background: #f5f9ff;
}
.bill-buy-qty input {
  width: 6rem;
  max-width: 100%;
}
.bill-buy-summary {
  margin: 1rem 0 1.15rem;
}
.bill-buy-total {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--navy);
}
.bill-buy-credits-line {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
}
.bill-buy-note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.bill-buy-pay {
  width: 100%;
  margin-top: 0;
}
.bill-min-details {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.bill-min-details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}
.bill-min-details[open] summary { margin-bottom: 0.65rem; }
.bill-min-pay-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1rem;
}
.bill-buy-history { margin-top: 2rem; }
.bill-buy-history h3 {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bill-buy-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.bill-buy-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--text);
}
.bill-buy-list em { font-style: normal; color: var(--muted); }
.bill-buy-list em.ok { color: #1d7a3a; }
.bill-buy-list em.bad { color: #b42318; }
.account-buy-btn {
  margin-top: 0.55rem !important;
  align-self: flex-start;
  width: auto;
}

.fees-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}
@media (max-width: 960px) {
  .fees-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .fees-summary { grid-template-columns: 1fr; }
}
.fees-summary-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  background: #f8fafc;
  min-width: 0;
}
.fees-summary-card span {
  display: block;
  color: #667789;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.fees-summary-card strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--navy);
  font-size: 1.25rem;
  line-height: 1.15;
}
.fees-summary-card small {
  display: block;
  margin-top: 0.25rem;
  color: #6b7c90;
  font-size: 0.72rem;
  line-height: 1.3;
}
.fees-summary-card.is-due {
  border-color: #e0c35a;
  background: #fffbf0;
}
.fees-summary-card.is-special {
  border-color: #b7d0f5;
  background: #f3f7ff;
}
.fees-summary-card.is-alert {
  border-color: #f0b4ae;
  background: #fff5f4;
}
.fees-due-break {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.75rem;
  color: #5a6b82;
  font-size: 0.85rem;
}
.fees-section h2,
.fees-section-head h2 {
  margin: 0;
  font-size: 1.02rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  color: var(--navy);
}
.fees-section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}
.fees-section-head .hint { margin: 0.3rem 0 0; }
.fees-pay-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.85rem 1.2rem;
  align-items: flex-end;
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid #edf1f6;
}
.fees-pay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.fees-deposit-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 0.85rem;
  margin-bottom: 1rem;
}
@media (max-width: 800px) {
  .fees-deposit-grid { grid-template-columns: 1fr; }
}
.fees-rate-cards {
  display: grid;
  gap: 0.55rem;
}
.fees-rate-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
}
.fees-rate-card.is-on {
  border-color: #b7d0f5;
  background: #f3f7ff;
}
.fees-rate-card span {
  display: block;
  font-size: 0.7rem;
  font-weight: 650;
  color: #667789;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.fees-rate-card strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.2rem;
  color: var(--navy);
}
.fees-rate-card small {
  display: block;
  margin-top: 0.2rem;
  color: #6b7c90;
  font-size: 0.75rem;
}
.fees-pay-box { margin: 0; height: 100%; }
.fees-amount {
  margin: 0.35rem 0 0.75rem;
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}
.fees-subhead {
  margin: 1.35rem 0 0.65rem;
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--navy);
}
.fees-deposit-form { margin-top: 0.25rem; }

.rich-content {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #243247;
}
.rich-content ul { margin: 0.35rem 0; padding-left: 1.2rem; }
.rich-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.25rem 0 0.4rem;
}
.rich-toolbar button {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.28rem 0.55rem;
  border: 1px solid #d5dde8;
  border-radius: 6px;
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}
.rich-toolbar button:hover { background: #f3f7fc; }
.rich-editor {
  min-height: 6.5rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d5dde8;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--navy);
}
.rich-editor:empty:before {
  content: attr(data-placeholder);
  color: #8a97ab;
  pointer-events: none;
}
.rich-editor:focus {
  outline: none;
  border-color: #2f6fed;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}
.auto-run-form {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  vertical-align: middle;
}
.auto-run-form select {
  font: inherit;
  font-size: 0.9em;
  padding: 0.2rem 0.4rem;
  border: 1px solid #c5d0de;
  border-radius: 4px;
  background: #fff;
  color: #1c2430;
}
.auto-window {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #4a5a6d;
}
.rerun-box {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e6ebf2;
}
.linkish.danger { color: #9b1c1c; }
.account-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
  text-decoration: none;
}
.account-btn:hover { text-decoration: none; }
.account-meta { display: grid; text-align: left; line-height: 1.15; }
.account-meta strong {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #243041;
}
.account-meta small { font-size: 0.68rem; color: var(--muted); }
.chevron { color: var(--muted); font-size: 0.7rem; }
.account-drop {
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(16, 32, 56, 0.12);
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.55rem;
  z-index: 30;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #d7e6f8; color: var(--navy);
  display: grid; place-items: center; font-size: 0.85rem; font-weight: 700;
}

.app-frame { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 232px;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar.collapsed { width: 58px; }
.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-foot,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-title { display: none; }
.sidebar-top { display: flex; justify-content: flex-end; padding: 0.55rem 0.55rem 0.15rem; }
.collapse-btn { background: transparent; color: #fff; border: 0; cursor: pointer; font-size: 1rem; line-height: 1; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0; padding: 0.15rem 0.4rem 0.5rem; overflow-y: auto; }
.nav-section { display: grid; gap: 0.05rem; padding: 0.2rem 0 0.35rem; }
.nav-section + .nav-section {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: 0.1rem;
  padding-top: 0.45rem;
}
.nav-section-title {
  display: block;
  padding: 0.1rem 0.7rem 0.3rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #fff;
  padding: 0.55rem 0.7rem;
  border-radius: 0;
  border-left: 3px solid transparent;
  text-decoration: none;
  font-size: 0.82rem;
}
.nav-link svg { width: 16px; height: 16px; fill: currentColor; flex-shrink: 0; }
.nav-link:hover { background: rgba(255, 255, 255, 0.08); text-decoration: none; }
.nav-link.active { background: rgba(255, 255, 255, 0.12); border-left-color: #7eb6ff; }
.nav-badge { margin-left: auto; background: #fff; color: var(--navy); border-radius: 10px; font-size: 0.68rem; font-style: normal; padding: 0 0.35rem; }
.nav-logout { margin: 0; }
.nav-logout .logout-link {
  width: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.nav-logout .logout-link:hover { background: rgba(255, 255, 255, 0.08); }
.sidebar-foot {
  margin-top: auto;
  padding: 0.9rem 0.8rem 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}
.sidebar-foot a {
  display: block;
  margin-top: 0.45rem;
  color: #d7e6ff;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
  opacity: 1;
}
.sidebar-foot a:hover { text-decoration: underline; }
.sidebar-by {
  margin-top: 0.45rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
  opacity: 1;
}
.sidebar-by a { display: inline; margin-top: 0; }

.legal-wrap {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100% - 2rem));
  margin: 1.2rem auto 2rem;
  padding: 1.5rem 1.5rem 2rem;
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(3, 12, 32, 0.22);
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin: 0 0 1.25rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(15, 35, 70, 0.12);
  font-size: 0.88rem;
}
.legal-nav a {
  color: var(--navy);
  text-decoration: none;
  opacity: 0.75;
}
.legal-nav a:hover { opacity: 1; text-decoration: underline; }
.legal-nav a[aria-current="page"] {
  opacity: 1;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.legal-nav-app {
  margin-bottom: 1rem;
}
.legal-doc h1 {
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
  color: var(--navy);
  margin: 0 0 0.9rem;
}
.legal-doc h2 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 1rem;
  color: var(--navy);
  margin: 1.35rem 0 0.45rem;
}
.legal-doc h3 {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.95rem;
  color: var(--navy);
  margin: 0.9rem 0 0.35rem;
}
.legal-doc p, .legal-doc li { line-height: 1.55; color: #2a3340; }
.legal-doc ul { padding-left: 1.2rem; }
.legal-highlights {
  margin: 1.15rem 0 1.35rem;
  padding: 1rem 1.1rem 1rem 1.25rem;
  border-left: 4px solid var(--navy);
  border-radius: 0 8px 8px 0;
  background: #eef3fb;
}
.legal-highlights ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style: disc;
}
.legal-highlights li {
  margin: 0.55rem 0;
  font-size: 0.94rem;
  color: #1e2a3a;
}
.legal-highlights li:first-child { margin-top: 0; }
.legal-highlights li:last-child { margin-bottom: 0; }
.legal-by { margin-top: 1.4rem; opacity: 0.9; }
.legal-by a { color: var(--navy); }
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: 1rem 1.4rem 1.3rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: rgba(235, 242, 255, 0.7);
}
.home-body:not(.legal-page) .site-foot {
  margin-top: auto;
  padding: 0.55rem 1.4rem 0.9rem;
}
.site-foot a { color: #d7e6ff; }

.workspace { flex: 1; min-width: 0; padding: 1rem 1.15rem 1.4rem; }
.sheet {
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(20, 36, 60, 0.04);
  padding: 1.15rem 1.25rem 1.2rem;
  min-height: calc(100vh - 90px);
}
.crumbs {
  color: var(--muted);
  font-size: 0.75rem;
  margin-bottom: 0.85rem;
}
.crumbs span { margin: 0 0.35rem; color: #b0b8c4; }
.crumbs a { color: var(--blue); }
.crumbs a:hover { text-decoration: underline; }
.sheet .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 1.25rem;
}
.card h1, .card h2, .sheet > .card:first-of-type h1 {
  margin: 0 0 0.7rem;
  color: var(--navy);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 800;
}
.page-head { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; margin-bottom: 0.7rem; }
.page-head h1, .page-head h2 { margin: 0; }
.author-link { font-weight: 650; color: var(--navy); }
.author-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
}
.archive-mini-form { margin: 0; }
.archive-mini-btn {
  appearance: none;
  margin: 0;
  padding: 0.12rem 0.45rem;
  border: 1px solid #c5d0df;
  border-radius: 4px;
  background: #f7f9fc;
  color: #4a5a6d;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 550;
  letter-spacing: 0.01em;
  line-height: 1.3;
  cursor: pointer;
}
.archive-mini-btn:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: #eef3fb;
}
.archive-month { margin-top: 1.15rem; }
.archive-month:first-child { margin-top: 0.35rem; }
.archive-month-title {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--navy);
  text-transform: none;
  letter-spacing: 0;
}
.archive-folder-rename {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.65rem;
}
.archive-folder-rename input[type="text"] {
  min-width: 12rem;
  max-width: 20rem;
  padding: 0.28rem 0.45rem;
  font-size: 0.82rem;
}
.archive-create-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin-bottom: 1rem;
}
.archive-create-row input[type="text"] {
  flex: 1 1 14rem;
  min-width: 0;
}
.archive-folder-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.archive-folder-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem;
  border-radius: 10px;
}
.archive-folder-row.is-renaming .archive-folder-open,
.archive-folder-row.is-renaming .archive-folder-tools { display: none; }
.archive-folder-open {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--navy);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.archive-folder-row.is-default .archive-folder-open {
  background: #f3f7fc;
  border-color: #c9daf5;
}
.archive-folder-open:hover {
  border-color: #b8c7de;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 35, 70, 0.06);
}
.archive-folder-icon {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  color: #2f6fed;
}
.archive-folder-icon.is-muted { color: #8a97ab; }
.archive-folder-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}
.archive-folder-label {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 650;
  font-size: 0.95rem;
}
.archive-folder-badge {
  flex: 0 0 auto;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e7f0ff;
  color: #1e4fbf;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.archive-folder-count {
  flex: 0 0 auto;
  min-width: 1.5rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e8eef8;
  color: #4a5a6d;
  font-size: 0.75rem;
  font-weight: 650;
  text-align: center;
}
.archive-folder-tools {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.archive-pen,
.archive-trash {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #7a8aa0;
  cursor: pointer;
}
.archive-pen svg,
.archive-trash svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
}
.archive-pen:hover {
  color: var(--navy);
  background: #eef3fb;
  border-color: #d5dde8;
}
.archive-trash:hover {
  color: #b42318;
  background: #fdecec;
  border-color: #f0c4c0;
}
.archive-folder-rename-inline {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem 0.15rem 0.15rem;
}
.archive-folder-rename-inline[hidden] { display: none !important; }
.archive-folder-rename-inline input[type="text"] {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid #2f6fed;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
}
.archive-folder-empty {
  padding: 0.85rem 0.2rem;
  color: #6b7c90;
  font-size: 0.9rem;
}
.archive-folder-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(56rem, calc(100% - 1.5rem));
  max-height: calc(100vh - 2rem);
  background: #fff;
  box-shadow: 0 28px 60px rgba(3, 12, 32, 0.32);
}
.archive-folder-dialog::backdrop {
  background: rgba(8, 18, 40, 0.5);
  backdrop-filter: blur(2px);
}
.archive-folder-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 2rem);
}
.archive-folder-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid #edf1f6;
}
.archive-folder-dialog-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: none;
  letter-spacing: 0;
}
.archive-folder-dialog-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6b7c90;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}
.archive-folder-dialog-close:hover { background: #f3f7fc; color: var(--navy); }
.archive-folder-dialog-body {
  padding: 0.85rem 1.15rem 1.15rem;
  overflow: auto;
}
.archive-month.is-compact { margin-top: 0; }
.archive-folder-admin { margin-bottom: 1.4rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.archive-delete-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(26rem, calc(100% - 1.5rem));
  background: #fff;
  box-shadow: 0 28px 60px rgba(3, 12, 32, 0.32);
}
.archive-delete-dialog::backdrop {
  background: rgba(8, 18, 40, 0.5);
  backdrop-filter: blur(2px);
}
.archive-delete-form {
  padding: 1.25rem 1.25rem 1.15rem;
  display: grid;
  gap: 0.85rem;
}
.archive-delete-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: none;
  letter-spacing: 0;
}
.archive-delete-head .hint { margin: 0.4rem 0 0; }
.archive-delete-choices {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.archive-delete-choice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.75rem 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  cursor: pointer;
}
.archive-delete-choice:has(input:checked) {
  border-color: #2f6fed;
  background: #f3f7ff;
  box-shadow: 0 0 0 1px rgba(47, 111, 237, 0.15);
}
.archive-delete-choice input { margin-top: 0.2rem; }
.archive-delete-choice strong {
  display: block;
  font-size: 0.9rem;
  color: var(--navy);
  font-weight: 650;
  line-height: 1.35;
}
.archive-delete-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.25rem;
}
.btn-danger {
  background: #b42318;
  color: #fff;
  border-color: #b42318;
}
.btn-danger:hover {
  background: #912018;
  color: #fff;
  text-decoration: none;
}
.archive-dialog {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: min(24rem, calc(100% - 2rem));
  background: #fff;
  box-shadow: 0 28px 60px rgba(3, 12, 32, 0.32);
}
.archive-dialog::backdrop {
  background: rgba(8, 18, 40, 0.5);
  backdrop-filter: blur(2px);
}
.archive-dialog-form {
  padding: 1.35rem 1.35rem 1.25rem;
  display: grid;
  gap: 0.55rem;
}
.archive-dialog-head {
  margin-bottom: 0.35rem;
}
.archive-dialog-form h2,
.archive-dialog-head h2 {
  margin: 0;
  color: var(--navy);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.archive-dialog-authors {
  margin: 0.35rem 0 0;
  color: #5a6b82;
  font-size: 0.9rem;
  line-height: 1.35;
}
.archive-field {
  display: block;
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5a6b82;
}
.archive-select,
.archive-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid #d5dde8;
  border-radius: 10px;
  background: #f8fafc;
  color: var(--navy);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.archive-select:focus,
.archive-input:focus {
  outline: none;
  border-color: #2f6fed;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.18);
}
.archive-new-block {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.15rem;
  padding: 0.75rem 0.8rem 0.85rem;
  border-radius: 12px;
  background: #f3f7fc;
  border: 1px solid #e2eaf4;
}
.archive-new-block[hidden] { display: none !important; }
.archive-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding-top: 0.85rem;
  border-top: 1px solid #edf1f6;
}
.archive-dialog-actions .btn { min-width: 6.5rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.data-table tr.js-row-link { cursor: pointer; }
.data-table tr.js-row-link:hover td { background: #f6f9fd; }
.file-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.file-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  margin-bottom: 0.4rem;
}
.file-list .btn-outline { margin-top: 0; }
.comment-box {
  background: #f6f9fd;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  white-space: pre-wrap;
  font-size: 0.85rem;
  line-height: 1.45;
  margin: 0 0 1rem;
}
.card h2 {
  margin: 1.1rem 0 0.45rem;
  color: var(--navy);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 800;
}
.danger-btn { color: #b42318; border-color: #f0c4c0; }
.hint, .empty { color: var(--muted); }
.ok-hint { color: #0b6b3a; }
.fail-box {
  background: #fde8e8;
  color: #9b1c1c;
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin: 0.6rem 0 1rem;
}
.fail-box p { margin: 0.25rem 0 0; }
.fail-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 1.1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.doc-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.35rem 0 1rem;
}
.doc-stats article {
  border: 1px solid #edf1f6;
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
}
.doc-stats span { color: var(--muted); font-size: 0.72rem; }
.doc-stats strong { display: block; font-size: 1.15rem; color: var(--navy); margin-top: 0.15rem; }
.doc-stats-single { grid-template-columns: max-content; }
.wallet-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0.85rem 0 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, #f7fbff 0%, #fff 55%);
}
.wallet-box h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.wallet-box .hint { margin: 0 0 0.45rem; max-width: 42rem; }
.wallet-credits {
  margin: 0;
  font-size: 0.92rem;
  color: var(--navy);
}
.wallet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.wallet-actions .btn { margin-top: 0; }
.stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.55rem 0 0.85rem;
  align-items: stretch;
}
/* Keep fee cards as siblings of count cards so all 6 share one row */
.stats-fees {
  display: contents;
}
.stats-account {
  grid-column: span 2;
  min-width: 0;
}
.account-summary {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  height: 100%;
  border: 1px solid #c8d9e8;
  background: linear-gradient(180deg, #f6faff 0%, #fff 70%);
}
.account-summary-title {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 550;
  line-height: 1.25;
}
.account-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.account-slot {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
}
.account-slot-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.account-slot-count {
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--navy);
  font-weight: 700;
}
.account-slot-detail {
  font-size: 0.58rem;
  line-height: 1.3;
  color: #5a6a7c;
}
.account-slot-price {
  font-size: 0.56rem;
  color: #667789;
  font-weight: 550;
}
.account-summary-owed {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--line);
  font-size: 0.62rem;
  color: var(--muted);
}
.account-summary-owed.has-balance strong {
  color: #b45309;
  font-size: 0.95rem;
}
.account-owed-none {
  color: #5a6a7c;
  font-size: 0.58rem;
}
@media (max-width: 1100px) {
  .stats-account { grid-column: span 2; }
}
@media (max-width: 640px) {
  .stats-account { grid-column: span 2; }
  .account-summary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stats article {
  border: 1px solid #c5d6ea;
  border-radius: 8px;
  padding: 0.4rem 0.45rem 0.45rem;
  background: var(--navy-soft);
  min-width: 0;
}

.stats > article > span {
  color: var(--muted);
  font-size: 0.68rem;
  display: block;
  line-height: 1.25;
  font-weight: 550;
}
.stats > article > strong {
  display: block;
  font-size: 1.15rem;
  color: var(--navy);
  margin-top: 0.1rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.15;
}
.stats small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.65rem;
  line-height: 1.3;
}
.stats .alert { border-color: #c9a227; }

.stat-fee {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 0;
}
.stat-fee-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
}
.stat-fee-label {
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.2;
  font-weight: 550;
}
.fee-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
}
.fee-status {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.2;
  font-style: normal;
}
.fee-rate {
  font-size: 0.58rem;
  color: #667789;
  font-weight: 550;
  white-space: nowrap;
}
.stat-fee .stat-fee-amount {
  display: block;
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 700;
  font-style: normal;
  margin: 0;
  line-height: 1.15;
}
.stat-fee .stat-fee-detail {
  margin-top: 0;
  color: #5a6a7c;
  font-size: 0.58rem;
  line-height: 1.25;
}
.stat-fee .stat-fee-usage {
  display: block;
  margin-top: 0.2rem;
  color: #3d4f63;
  font-size: 0.58rem;
  font-weight: 650;
  line-height: 1.25;
}
.stat-fee.is-active {
  border-color: #1f7a4d;
  background: linear-gradient(180deg, #f3faf6 0%, #fff 72%);
}
.stat-fee.is-active .fee-status {
  background: #e3f6ec;
  color: #146c42;
}
.stat-fee.is-inactive {
  border-color: #d7dee8;
  background: #fafbfc;
}
.stat-fee.is-inactive .fee-status {
  background: #eef1f5;
  color: #6a7788;
}
.stat-fee.has-due {
  border-color: #c9a227;
  box-shadow: inset 0 0 0 1px rgba(201, 162, 39, 0.16);
}
.stat-fee.has-due.is-active {
  border-color: #1f7a4d;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 77, 0.14);
}
.eta-set {
  margin-top: 0.85rem;
  padding: 0.7rem 0.8rem;
  border: 1px dashed #c5d0de;
  border-radius: 6px;
  background: #f7f9fc;
  max-width: 420px;
}
.eta-set-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.35rem;
}
.eta-set-row select {
  min-width: 8rem;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-size: 0.88rem;
}
.eta-set-hint {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.72rem;
}
.mode-set { max-width: 640px; }
.mode-set .eta-set-hint { margin-bottom: 0.55rem; }
.mode-set-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* flex (not bare grid): Chrome puts native validation UI as a grid item and opens a blank 2nd column */
.form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 560px;
  margin: 1rem 0;
  min-width: 0;
}
.fancy-form { max-width: 720px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.form-grid label { display: grid; gap: 0.3rem; font-size: 0.78rem; color: var(--muted); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid small { font-size: 0.72rem; color: var(--muted); }
.upload-form-grid {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.85rem;
}
.upload-file { display: grid; gap: 0.45rem; grid-column: 1 / -1; }
.upload-file .dropzone { min-height: 6.5rem; align-content: center; }
.page-est {
  margin: 0;
  font-size: 0.78rem;
  color: var(--navy);
  font-weight: 600;
}
.deadline-short {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #f0c36d;
  background: #fff8e8;
  color: #7a4e00;
  font-size: 0.78rem;
  line-height: 1.35;
}
input.js-dt-picker {
  cursor: pointer;
  caret-color: transparent;
}
input.js-dt-picker::-webkit-calendar-picker-indicator {
  pointer-events: none;
}
.dt-pop {
  position: absolute;
  z-index: 80;
  width: min(22rem, calc(100vw - 1.2rem));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(20, 36, 60, 0.18);
  color: var(--text);
  overflow: hidden;
}
.dt-pop-main { display: grid; }
.dt-cal { padding: 0.7rem 0.75rem 0.35rem; }
.dt-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}
.dt-cal-head strong { font-size: 0.92rem; text-transform: capitalize; }
.dt-nav {
  width: 1.7rem;
  height: 1.7rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--navy);
}
.dt-week, .dt-days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.dt-week { color: var(--muted); font-size: 0.68rem; margin-bottom: 0.2rem; }
.dt-day {
  height: 1.85rem;
  border: 0;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}
.dt-day:hover { background: #eef4fb; }
.dt-day.is-on { background: var(--blue); color: #fff; }
.dt-time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem 0.55rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}
.dt-time span.js-dt-time-label { color: var(--muted); margin-right: 0.15rem; }
.dt-time-sep { color: var(--muted); }
.dt-time select {
  width: auto;
  min-width: 3.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.28rem 0.35rem;
  font: inherit;
  background: #fff;
}
.dt-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.35rem 0.7rem 0.45rem;
  border-top: 1px solid var(--line);
}
.dt-foot-right { display: flex; align-items: center; gap: 0.45rem; }
.dt-txt {
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.25rem 0.35rem;
}
.dt-ok {
  border: 0;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 4px;
  padding: 0.32rem 0.85rem;
}
.upload-meta { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 0.9rem; }
.upload-meta span {
  background: #eef4fb;
  color: var(--navy);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}
.dropzone-wrap { position: relative; }
.dropzone {
  display: grid;
  gap: 0.25rem;
  position: relative;
  border: 1px dashed #9bb4d4;
  background: #f6f9fd;
  border-radius: 8px;
  padding: 1.1rem 2.2rem 1.1rem 1rem;
  cursor: pointer;
  text-align: center;
  color: var(--navy);
}
.dropzone input { position: absolute; opacity: 0; width: 0.1px; height: 0.1px; }
.dropzone strong { font-size: 0.82rem; }
.dropzone span { color: var(--muted); font-size: 0.78rem; word-break: break-word; }
.dropzone.is-busy { border-color: var(--blue); background: #eef4fb; }
.dropzone.is-ok { border-color: #16a34a; background: #f0fdf4; }
.dropzone.is-fail { border-color: #dc2626; background: #fef2f2; }
.dropzone-del {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #9b1c1c;
  cursor: pointer;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(20, 36, 60, 0.18);
}
.dropzone-del:hover { background: #fde8e8; }
.file-status { margin: 0.4rem 0 0; font-size: 0.82rem; }
.file-status.is-ok { color: #14532d; }
.file-status.is-err { color: #9b1c1c; }
.file-status.is-wait { color: var(--blue); }
.pdf-warn {
  margin: 0.45rem 0 0;
  color: #8a5a12;
  font-size: 0.74rem;
  line-height: 1.4;
}
.pdf-warn a { color: #1d5bb8; }
.form-actions { display: flex; gap: 0.7rem; align-items: center; }
.form-actions .btn-outline { margin-top: 0; }
.notify-panel h2 { margin-bottom: 0.35rem; }
.notify-panel h3 { margin: 0 0 0.55rem; color: var(--navy); font-size: 0.88rem; text-transform: none; letter-spacing: 0; }
.notify-types { margin: 0 0 1.1rem; }
.notify-types-intro { margin: 0 0 0.45rem; color: var(--muted); font-size: 0.78rem; }
.notify-prefs-form { margin: 0 0 0.2rem; }
.notify-prefs {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  justify-content: start;
  column-gap: 1rem;
  row-gap: 0.22rem;
  margin: 0 0 0.55rem;
}
.notify-pref {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
}
.notify-pref input {
  margin: 0;
  width: 0.78rem;
  height: 0.78rem;
  flex: none;
}
.notify-pref span { font-size: 0.72rem; color: #2a3340; line-height: 1.2; }
.notify-list { list-style: none; margin: 0 0 0.8rem; padding: 0; }
.notify-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid #edf1f6;
  border-radius: 6px;
  margin-bottom: 0.45rem;
}
.account-drop { display: none; }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin: 0.2rem 0 0.9rem;
}
.filters label { display: grid; gap: 0.28rem; font-size: 0.75rem; color: var(--muted); }
.filters input, .filters select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.65rem;
  min-width: 12rem;
  font: inherit;
  background: #fff;
}
.filter-links { display: flex; gap: 0.85rem; width: 100%; }
.filter-links .linkish { font-size: 0.78rem; }

.table-wrap { overflow: auto; border: 1px solid #edf1f6; border-radius: 4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.data-table th {
  text-align: left;
  background: #f5f7fa;
  color: #1c2430;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid #e6ebf2;
}
.data-table th.js-sort { padding: 0; }
.data-table .sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.data-table .sort-btn:hover,
.data-table .sort-btn:focus-visible {
  background: #eef2f7;
  outline: none;
}
.data-table .sort-ind {
  font-weight: 600;
  color: var(--muted, #6b7785);
  min-width: 0.85em;
}
.data-table th[aria-sort="ascending"] .sort-ind,
.data-table th[aria-sort="descending"] .sort-ind {
  color: #1c2430;
}
.data-table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid #f0f3f7; vertical-align: top; }
.empty-row td { text-align: center; color: var(--muted); padding: 2.6rem 0.6rem; }
.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.pager select, .pager input {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.2rem 0.3rem;
  font: inherit;
  background: #fff;
}
.pager input { width: 2.1rem; text-align: center; }
.pager button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  cursor: pointer;
  color: #607089;
}

.pill { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.75rem; line-height: 1.25; }
.pill.ok { background: #e5f6ea; color: #1b6b34; }
.pill.wait { background: #eef3fb; color: var(--navy); }
.pill.analyzing {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #eef4ff;
  color: #12408a;
  border: 1px solid #b7cdf0;
  border-radius: 12px;
  padding: 0.35rem 0.55rem 0.35rem 0.4rem;
  max-width: 22rem;
}
.analyzing-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
}
.analyzing-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 2.8em;
  text-align: right;
  margin-left: auto;
  align-self: center;
}
.phase-copy {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  flex: 1 1 auto;
}
.phase-label {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0d3b7a;
}
.phase-activity {
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.25;
  color: #3d5f94;
}
.phase-icon {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(29, 91, 184, 0.12);
  position: relative;
  overflow: hidden;
}
.phase-icon-inner {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 2px;
  background: #1d5bb8;
}
.phase-icon-1 .phase-icon-inner {
  width: 2px;
  height: 0.7rem;
  border-radius: 1px;
  animation: phase-blink 1s step-end infinite;
}
.phase-icon-2 .phase-icon-inner {
  width: 70%;
  height: 2px;
  border-radius: 1px;
  animation: phase-scan 1.4s ease-in-out infinite;
}
.phase-icon-3 {
  animation: phase-pulse 1.5s ease-in-out infinite;
}
.phase-icon-3 .phase-icon-inner {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  border: 2px solid #1d5bb8;
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(29, 91, 184, 0.25);
}
.phase-icon-4 .phase-icon-inner {
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  box-shadow: 0.45rem 0 0 #1d5bb8;
  animation: phase-nodes 1.2s ease-in-out infinite;
}
.phase-icon-5 .phase-icon-inner {
  width: 60%;
  height: 3px;
  border-radius: 999px;
  animation: phase-slide 1.3s ease-in-out infinite;
}
.phase-icon-6 {
  background: rgba(27, 107, 52, 0.14);
}
.phase-icon-6 .phase-icon-inner {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #1b6b34;
  box-shadow: 0 0 0 0 rgba(27, 107, 52, 0.45);
  animation: phase-seal 1.6s ease-out infinite;
}
.pill.analyzing.phase-1 { animation: phase-fade 0.8s ease; }
.pill.analyzing.phase-6 {
  background: #e8f7ee;
  border-color: #a8d7b6;
  color: #1b6b34;
}
.pill.analyzing.phase-6 .phase-label { color: #1b6b34; }
.pill.analyzing.phase-6 .phase-activity { color: #2f7a48; }
.eta-text {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.page-head .analyzing-cell { align-items: flex-end; }
.page-head .eta-text { text-align: right; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes phase-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
@keyframes phase-scan {
  0% { transform: translateY(-0.35rem); opacity: 0.35; }
  50% { transform: translateY(0.35rem); opacity: 1; }
  100% { transform: translateY(-0.35rem); opacity: 0.35; }
}
@keyframes phase-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes phase-nodes {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(0.08rem); opacity: 1; }
}
@keyframes phase-slide {
  0% { transform: translateX(-0.2rem); width: 35%; }
  50% { transform: translateX(0.15rem); width: 70%; }
  100% { transform: translateX(-0.2rem); width: 35%; }
}
@keyframes phase-seal {
  0% { box-shadow: 0 0 0 0 rgba(27, 107, 52, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(27, 107, 52, 0); }
  100% { box-shadow: 0 0 0 0 rgba(27, 107, 52, 0); }
}
@keyframes phase-fade {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
.pill.bad { background: #fde8e8; color: #9b1c1c; }

.flash-wrap { margin-bottom: 0.8rem; }
.flash { padding: 0.7rem 0.8rem; border-radius: 4px; color: var(--text); }
.flash-ok { background: #e5f6ea; color: #14532d; }
.flash-error { background: #fde8e8; color: #9b1c1c; }
.login-card .flash { padding: 0.45rem 0.55rem; font-size: 0.82rem; margin: 0; }
.home-flash .flash-ok { color: #14532d; }
.home-flash .flash-error { color: #9b1c1c; }
.support-wa { margin: 0.65rem 0 0; }
.flash .support-wa { margin-top: 0.55rem; }
.support-wa-btn { font-size: 0.85rem; }
.ai-cost-line strong { font-variant-numeric: tabular-nums; }
.needed-by-warn { color: #8a5a00; display: block; margin-top: 0.35rem; }
.upload-fee-tier {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem 1rem;
  margin: 0;
  background: #f8fafc;
}
.upload-fee-tier legend {
  padding: 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
}
.upload-fee-tier-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
}
.upload-fee-tier-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.upload-fee-tier-card {
  position: relative;
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 0.85rem 0.85rem;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.upload-fee-tier-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.upload-fee-tier-card.is-selected {
  border-color: #1d7a3a;
  background: #e6f4ea;
  box-shadow: 0 1px 3px rgba(29, 122, 58, 0.12);
}
.upload-fee-tier-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}
.upload-fee-tier-meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.upload-fee-tier-card .dash-fee-badge {
  justify-self: start;
  margin-top: 0.2rem;
}
@media (max-width: 720px) {
  .upload-fee-tier-options { grid-template-columns: 1fr; }
}
.row-actions { display: flex; gap: 0.6rem; margin-top: 0.6rem; align-items: center; flex-wrap: wrap; }
.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.split-2 h2 { margin: 0 0 0.8rem; color: var(--navy); font-size: 0.95rem; }
@media (max-width: 800px) {
  .split-2 { grid-template-columns: 1fr; }
  .notify-prefs { grid-template-columns: 1fr 1fr; column-gap: 0.7rem; }
  .notify-pref { white-space: normal; }
}

@media (max-width: 800px) {
  .app-topbar { height: auto; flex-wrap: wrap; gap: 0.6rem; padding: 0.6rem 0.8rem; }
  .top-logo, .top-tools { min-width: 0; }
  .top-nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 0.6rem; }
  .top-nav .top-submit { margin-left: auto; }
  .app-frame { flex-direction: column; }
  .sidebar { width: 100%; }
  .sidebar.collapsed { width: 100%; }
  .sheet { min-height: 0; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-stats { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .home-features { grid-template-columns: 1fr; }
  .home-tools { flex-wrap: wrap; justify-content: flex-end; }
  .home-hero-card {
    min-height: 0;
  }
  .home-hero-top {
    padding: 1rem 1.2rem 0.3rem;
  }
  .home-hero-actions {
    grid-template-columns: 1fr;
    padding: 0.3rem 1.1rem 1.05rem;
  }
  .home-upload { min-height: 8.5rem; }
  .home-audiences {
    grid-template-columns: 1fr;
    margin-top: 0.65rem;
  }
  .home-hero-brand { padding: 0; }
}

/* Homepage 2 — preview at /home2; does not affect the live homepage */
.home2-body {
  --h2-navy: #00356e;
  --h2-ink: #f4f1e8;
  --h2-paper: #dce3ee;
  margin: 0;
  min-height: 100vh;
  color: var(--h2-navy);
  background: var(--h2-paper);
  font-family: Sora, "Segoe UI", sans-serif;
}
.home2-body .logo-mark.light { color: #f4f1e8; }
.home2-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.6rem;
  color: #f4f1e8;
}
.home2-wordmark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: inherit;
  text-decoration: none;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.home2-wordmark:hover { text-decoration: none; color: #fff; }
.home2-tools {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
}
.home2-tools a { color: #f4f1e8; }
.home2-tools a:hover { color: #fff; }
.home2-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  color: var(--h2-ink);
}
.home2-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 50%;
  animation: home2-drift 22s ease-in-out infinite alternate;
}
.home2-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 28, 58, 0.88) 0%, rgba(0, 28, 58, 0.42) 42%, rgba(0, 28, 58, 0.08) 72%),
    linear-gradient(180deg, rgba(0, 22, 46, 0.35) 0%, transparent 22%, rgba(0, 18, 38, 0.55) 100%);
  pointer-events: none;
}
.home2-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 38rem;
  padding: 7.5rem 1.6rem 3.4rem;
  animation: home2-rise 0.9s ease-out both;
}
.home2-brand {
  margin: 0 0 0.7rem;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(3.4rem, 8vw, 6.4rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.045em;
  color: #fff;
}
.home2-hero-copy h1 {
  margin: 0 0 0.85rem;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 500;
  line-height: 1.25;
  color: #f4f1e8;
}
.home2-lead {
  margin: 0 0 1.6rem;
  max-width: 28rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(244, 241, 232, 0.82);
}
.home2-drop-form { margin: 0; }
.home2-cta {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  max-width: 26rem;
  padding: 0.15rem 0 0.45rem;
  border-bottom: 1px solid rgba(244, 241, 232, 0.45);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  transition: border-color 0.25s ease;
}
.home2-cta::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 0;
  height: 2px;
  background: #f4f1e8;
  transition: width 0.35s ease;
}
.home2-cta:hover { text-decoration: none; color: #fff; border-color: transparent; }
.home2-cta:hover::after { width: 100%; }
.home2-cta strong {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.home2-cta span {
  font-size: 0.82rem;
  color: rgba(244, 241, 232, 0.7);
}
.home2-cta.is-drag,
.home2-cta.is-busy {
  border-color: #fff;
}
.home2-hero-copy .flash-error {
  margin: 0 0 0.9rem;
  padding: 0;
  background: none;
  border: 0;
  color: #ffd2c8;
  font-size: 0.9rem;
}
.home2-chapter {
  max-width: 40rem;
  padding: 4.2rem 1.6rem;
}
.home2-chapter h2 {
  margin: 0 0 0.85rem;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--h2-navy);
  text-transform: none;
}
.home2-chapter p {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  line-height: 1.65;
  color: #1d334d;
}
.home2-note {
  color: #4a6078 !important;
  font-size: 0.95rem !important;
}
.home2-chapter-alt {
  margin-left: auto;
  padding-top: 0;
}
.home2-body .site-foot {
  color: #5a7088;
  padding: 1.4rem 1.6rem 2rem;
}
.home2-body .site-foot a { color: var(--h2-navy); }
@keyframes home2-rise {
  from { opacity: 0; transform: translateY(1.1rem); }
  to { opacity: 1; transform: none; }
}
@keyframes home2-drift {
  from { transform: scale(1.04) translateX(0); }
  to { transform: scale(1.1) translateX(-1.4%); }
}
@media (prefers-reduced-motion: reduce) {
  .home2-hero-img, .home2-hero-copy { animation: none; }
}
@media (max-width: 800px) {
  .home2-hero-copy { padding: 6.5rem 1.2rem 2.4rem; }
  .home2-brand { font-size: clamp(2.8rem, 16vw, 4.2rem); }
  .home2-chapter, .home2-chapter-alt { padding: 2.6rem 1.2rem; }
  .home2-chapter-alt { margin-left: 0; }
}

/* Admin site health — extends dash-ui / billing components */
.health-dash .bill-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.health-lead { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.92rem; max-width: 36rem; }
.health-meta { margin: 0.45rem 0 0; font-size: 0.8rem; color: var(--muted); }
.health-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.65rem; }
.health-overall {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
}
.health-overall-healthy { background: #e6f4ea; color: #1d7a3a; }
.health-overall-attention { background: #fff4e5; color: #9a6b00; }
.health-overall-critical { background: #fdecea; color: #b42318; }
.health-refresh-btn { margin-top: 0; }
.health-rec-grid .health-rec-ok { border-color: #b8dfc4; background: #f8fcf9; }
.health-rec-grid .health-rec-warn { border-color: #e8c96a; background: #fffdf5; }
.health-rec-grid .health-rec-critical { border-color: #f0b4b0; background: #fff8f7; }
.health-check-grid .bill-link-card em {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.health-check-card.health-check-ok .bill-link-icon { background: #e6f4ea; color: #1d7a3a; }
.health-check-card.health-check-warn .bill-link-icon { background: #fff4e5; color: #9a6b00; }
.health-check-card.health-check-critical .bill-link-icon { background: #fdecea; color: #b42318; }
.health-check-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
  display: block;
}
.health-env-code {
  font-size: 0.78rem;
  background: transparent;
  padding: 0;
  font-weight: 600;
  color: var(--navy);
}
