/* Dashboard, webmail, admin, docs and the small pages. Tokens, fonts and .btn come from base.css. */

body { font-size: 14px; }
code, kbd { font: 500 .88em/1.4 var(--f-mono); padding: .12em .34em; background: var(--ground-2); color: var(--text); border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.mono { font-family: var(--f-mono); }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, .93);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar-in { display: flex; align-items: center; gap: 24px; height: 54px; }
.tabs { display: flex; gap: 0; margin-right: auto; padding: 0; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; display: flex; align-items: center; padding: 0 11px;
  font: 400 13px/1 var(--f-body); color: var(--text-2); text-decoration: none; white-space: nowrap;
  transition: color .12s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current='page'] { color: var(--text); font-weight: 500; }
.tabs a[aria-current='page']::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--text); }
.bar-right { display: flex; align-items: center; gap: 16px; margin-left: auto; font: 400 12.5px/1 var(--f-body); color: var(--text-2); }
.bar-bal { color: var(--text); font-weight: 500; text-decoration: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-bal b { color: var(--text); font-weight: 500; }
.tabs + .bar-right { margin-left: 0; }
.bar-right .link { font: 400 12.5px/1 var(--f-body); }

/* ---------- layout ---------- */
.page { padding: clamp(24px, 3.4vw, 40px) 0 96px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 32px; margin-bottom: clamp(20px, 2.6vw, 30px); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.page-head p { max-width: 40em; margin-top: 8px; color: var(--text-2); font-size: 13px; }
h1.t { font: 500 clamp(23px, 2.7vw, 30px)/1.15 var(--f-display); letter-spacing: -.028em; text-wrap: balance; }
h2.t { font: 500 16px/1.25 var(--f-display); letter-spacing: -.015em; }
h3.t { font: 500 13.5px/1.3 var(--f-body); }
.sec-t { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 0 0 12px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(26px, 3.2vw, 40px); }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(20px, 3.4vw, 48px); align-items: start; }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 auto; min-width: 0; }
.gap-s { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.gap-m { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.rule { height: 0; border: 0; border-top: 1px solid var(--line); margin: 0; }
.pad { padding: clamp(18px, 2.6vw, 26px); }

/* ---------- readouts ---------- */
.reads { display: flex; flex-wrap: wrap; gap: 18px 44px; margin: 0; }
.reads > div { min-width: 0; }
.reads dt { font: 500 9.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.reads dd { margin: 8px 0 0; font: 500 clamp(21px, 2.5vw, 27px)/1 var(--f-display); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.reads dd small { font-size: .58em; color: var(--muted); margin-right: 2px; }
.reads dd.sm { font-size: 16px; }
.reads .sub { margin-top: 5px; font: 400 11.5px/1.3 var(--f-body); color: var(--muted); }

/* ---------- forms ---------- */
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.field > label, .lbl { font: 500 12px/1.3 var(--f-body); color: var(--text); }
.in {
  width: 100%; min-height: 36px; padding: 0 10px; color: var(--text); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r);
  font: 400 13.5px/1.2 var(--f-body);
  transition: border-color .12s, box-shadow .12s;
}
textarea.in { padding: 9px 10px; line-height: 1.55; min-height: 100px; resize: vertical; }
select.in {
  appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.in.mono { font-family: var(--f-mono); font-size: 12px; }
.in:hover { border-color: var(--text-2); }
.in:focus-visible { outline: none; border-color: var(--text); box-shadow: var(--ring); }
.in::placeholder { color: var(--muted); }
.in[readonly] { color: var(--text-2); background: var(--panel-2); }
.hint { font: 400 11.5px/1.5 var(--f-body); color: var(--muted); }
.err { font: 500 12.5px/1.5 var(--f-body); color: var(--danger); }
.ok { color: var(--ok); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn-xs { min-height: 26px; padding: 0 8px; font: 500 11.5px/1 var(--f-body); }
.btn-danger { color: var(--danger); border-color: var(--line-2); }
.btn-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn:disabled { opacity: .4; cursor: default; pointer-events: none; }
.btn.is-busy { opacity: .55; pointer-events: none; }
.link {
  color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  text-decoration-color: var(--line-2);
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
}
.link:hover { text-decoration-color: var(--text); }

.seg { display: inline-flex; max-width: 100%; overflow-x: auto; border: 1px solid var(--line-2); border-radius: var(--r); }
.seg button { min-height: 30px; padding: 0 11px; font: 400 12px/1 var(--f-body); color: var(--text-2); background: transparent; border: 0; cursor: pointer; white-space: nowrap; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed='true'] { background: var(--text); color: #fff; font-weight: 500; }
.seg button:hover:not([aria-pressed='true']) { color: var(--text); background: var(--ground-2); }

/* ---------- tables ---------- */
.tbl-wrap {
  overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-l);
}
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { padding: 9px 12px; text-align: left; font: 500 9.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.tbl td { padding: 10px 12px; border-top: 1px solid var(--line); font: 400 12.5px/1.35 var(--f-body); color: var(--text-2); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl td:first-child { color: var(--text); font-weight: 500; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--panel-2); }
.tbl .secret { letter-spacing: .02em; user-select: all; font-family: var(--f-mono); }
.empty { padding: 26px 12px; color: var(--muted); font-size: 12.5px; }

.tag {
  display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 3px;
  font: 500 9.5px/1.5 var(--f-mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-2); background: var(--ground-2); box-shadow: inset 0 0 0 1px var(--line);
}
.tag.go { color: var(--ok); box-shadow: inset 0 0 0 1px #b7dcc8; background: #f2faf5; }
.tag.hot { color: #fff; background: var(--text); box-shadow: none; }
.tag.bad { color: var(--danger); box-shadow: inset 0 0 0 1px #e8c4bf; background: #fdf4f3; }

/* ---------- auth ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 400px); gap: clamp(28px, 6vw, 96px); align-items: center; min-height: calc(100svh - 54px - 130px); }
.auth h1 { max-width: 10em; }
.auth form { display: grid; gap: 14px; padding: clamp(20px, 2.6vw, 28px); }
.auth .alt { font: 400 12.5px/1.5 var(--f-body); color: var(--text-2); }

/* ---------- dashboard bits ---------- */
.buyer { padding: clamp(18px, 2.6vw, 28px); }
.buyer .big { display: flex; align-items: baseline; gap: 3px; margin: 12px 0 3px; font: 500 clamp(38px, 5.4vw, 60px)/1 var(--f-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.buyer .big small { font-size: .5em; color: var(--muted); }
.prov { display: grid; gap: 10px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); }
.dl { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.preview {
  margin: 0; padding: 11px 12px; max-height: 200px; overflow: auto;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-s);
  font: 400 11.5px/1.8 var(--f-mono); color: var(--text-2); white-space: pre;
}
.secret-box { display: flex; gap: 6px; }
.secret-box .in { flex: 1; }
.steps { display: grid; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; padding: 11px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps b { font: 500 9.5px/1.8 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.code {
  margin: 0; min-width: 0; max-width: 100%; overflow: hidden;
  background: var(--dark-2); border: 1px solid var(--dark-line); border-radius: var(--r);
}
.code figcaption {
  padding: 8px 13px; border-bottom: 1px solid var(--dark-line);
  font: 500 9.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: #6f6f6f;
}
.code pre { margin: 0; padding: 13px; overflow-x: auto; font: 400 11.5px/1.8 var(--f-mono); color: #c4c4c4; }
.code code { padding: 0; background: none; font-size: inherit; color: inherit; border-radius: 0; box-shadow: none; }
.c-k { color: #fff; font-weight: 500; }
.c-h { color: #6f6f6f; }
.c-s { color: #a8a8a8; }
.c-n { color: #d4d4d4; }
.c-d { color: #6f6f6f; }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 6px; width: min(400px, 100% - 28px); pointer-events: none; }
.toast {
  position: relative; padding: 10px 12px 10px 26px;
  background: var(--text); border: 1px solid var(--text); border-radius: var(--r);
  font: 400 12.5px/1.45 var(--f-body); color: #fff;
  animation: rise .22s var(--ease) both;
}
.toast::before { content: ''; position: absolute; left: 11px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: #fff; }
.toast.bad::before { background: #ff8f80; }
.toast.good::before { background: #7ee0ad; }

.spin { display: inline-block; width: 12px; height: 12px; border: 1.5px solid var(--line-2); border-top-color: var(--text); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 36px 0; color: var(--muted); font: 400 12px var(--f-mono); }

/* ---------- webmail ---------- */
.mail-shell { display: grid; grid-template-columns: 320px minmax(0, 1fr); height: calc(100svh - 54px); background: var(--panel); }
.mail-list { overflow-y: auto; background: var(--panel-2); border-right: 1px solid var(--line); }
.mail-tools { position: sticky; top: 0; z-index: 2; display: flex; gap: 6px; padding: 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.mail-tools .in { min-height: 32px; font-size: 12.5px; }
.msg-row {
  display: block; width: 100%; padding: 10px 12px; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; color: var(--text-2);
}
.msg-row:hover { background: var(--panel); }
.msg-row[aria-current='true'] { background: var(--panel); box-shadow: inset 2px 0 0 var(--text); }
.msg-row .from { display: flex; justify-content: space-between; gap: 8px; font: 400 11.5px/1.2 var(--f-body); color: var(--text-2); }
.msg-row .subj { margin-top: 4px; font: 400 13px/1.35 var(--f-body); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row .prev { margin-top: 3px; font: 400 11.5px/1.4 var(--f-body); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row.unread .subj { color: var(--text); font-weight: 500; }
.msg-row.unread .from::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 7px; border-radius: 50%; background: var(--text); }
.msg-row .code-chip {
  display: inline-block; margin-top: 6px; padding: 2px 5px; border-radius: 3px;
  font: 500 10px/1.5 var(--f-mono); letter-spacing: .08em;
  color: var(--text); background: var(--ground-2); box-shadow: inset 0 0 0 1px var(--line);
}
.mail-view { display: flex; flex-direction: column; min-width: 0; overflow-y: auto; }
.mail-view-head { padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.mail-view-head h2 { font: 500 18px/1.3 var(--f-display); letter-spacing: -.02em; }
.mail-view-head .meta { margin-top: 6px; font: 400 11.5px/1.7 var(--f-mono); color: var(--text-2); }
.mail-code { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0 0; padding: 11px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); }
.mail-code b { font: 500 22px/1 var(--f-mono); letter-spacing: .14em; color: var(--text); }
.mail-body { flex: 1; padding: 16px 22px 36px; }
.mail-body pre { margin: 0; white-space: pre-wrap; word-break: break-word; font: 400 13.5px/1.7 var(--f-body); color: var(--text); }
.mail-body iframe { width: 100%; height: 70vh; min-height: 400px; border: 1px solid var(--line); border-radius: var(--r-s); background: #fff; }
.mail-links { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 5px; font: 400 11.5px/1.4 var(--f-mono); }
.mail-links a { color: var(--text-2); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.mail-links a:hover { color: var(--text); }
.mail-empty { display: grid; place-items: center; flex: 1; padding: 36px; color: var(--muted); text-align: center; }
.mail-back { display: none; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 500 10px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); }
.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.live.on::before { background: var(--ok); }

/* ---------- admin ---------- */
.adm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px 28px; }
.adm-sub { margin: 28px 0 10px; }
.inline-edit { min-height: 30px; max-width: 120px; font-size: 12px; }
.cms-item { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.cms-item-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font: 400 10.5px/1.3 var(--f-mono); color: var(--muted); }
.cms-item textarea { min-height: 66px; field-sizing: content; max-height: 260px; }
.cms-default { font: 400 12px/1.5 var(--f-body); color: var(--muted); }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(24px, 4.5vw, 64px); padding: clamp(24px, 3.4vw, 44px) 0 110px; align-items: start; }
.docs-nav { position: sticky; top: 76px; display: grid; gap: 1px; font: 400 12.5px/1.3 var(--f-body); border-left: 1px solid var(--line); }
.docs-nav a { padding: 6px 10px; color: var(--text-2); text-decoration: none; margin-left: -1px; border-left: 1px solid transparent; }
.docs-nav a:hover { color: var(--text); border-left-color: var(--line-2); }
.docs-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(36px, 4.5vw, 60px); max-width: 820px; min-width: 0; }
.docs-body section { scroll-margin-top: 76px; }
.docs-body h2 { margin-bottom: 12px; }
.docs-body h3 { margin: 24px 0 8px; font: 500 14px/1.35 var(--f-display); }
.docs-body p { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; }
.docs-body .code { margin: 14px 0; }
.ep { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px; margin: 24px 0 7px; padding-top: 16px; border-top: 1px solid var(--line); }
.ep .m { padding: 3px 6px; border-radius: 3px; background: var(--text); font: 500 10px/1.5 var(--f-mono); letter-spacing: .08em; color: #fff; }
.ep .p { font: 500 12.5px/1.35 var(--f-mono); color: var(--text); word-break: break-all; }
.docs-body ul { margin: 0 0 12px; padding-left: 18px; color: var(--text-2); font-size: 13.5px; }
.docs-body li { margin: 3px 0; }

/* ---------- small pages ---------- */
.solo { display: grid; place-items: center; min-height: 100svh; padding: 28px; }
.solo > div {
  width: min(520px, 100%); padding: clamp(24px, 3.4vw, 38px);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-l);
}
.solo h1 { margin-bottom: 12px; }
.solo p { margin: 0 0 10px; color: var(--text-2); }

@media (max-width: 960px) {
  .split, .split-even, .auth { grid-template-columns: minmax(0, 1fr); }
  .auth { min-height: 0; }
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-nav { position: static; border-left: 0; border-bottom: 1px solid var(--line); grid-auto-flow: column; overflow-x: auto; }
  .docs-nav a { margin-left: 0; border-left: 0; white-space: nowrap; }
  .docs-nav a:hover { border-left-color: transparent; }
}
@media (max-width: 760px) {
  .bar-in { gap: 12px; }
  .bar-right .hide-s { display: none; }
  .mail-shell { grid-template-columns: minmax(0, 1fr); }
  .mail-shell[data-open='1'] .mail-list { display: none; }
  .mail-shell:not([data-open='1']) .mail-view { display: none; }
  .mail-back { display: inline-flex; }
  .mail-view-head, .mail-body { padding-inline: 16px; }
  .steps li { grid-template-columns: minmax(0, 1fr); gap: 3px; }
}
@media (max-width: 420px) {
  .bar-in { gap: 8px; }
  .bar .mark { font-size: 14px; gap: 6px; }
  .bar .mark::before { width: 16px; height: 16px; }
  .bar-right { gap: 8px; flex: 0 0 auto; }
  .bar-right .link { display: none; }
  .tabs a { padding: 0 9px; }
  .tbl th, .tbl td { padding-inline: 9px; }
}