/* The customers' portal. Colors and the shared pieces (.card, .btn, .badge, .modal) come from app.css. */
.pt-login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.pt-login { width: 380px; max-width: 100%; padding: 28px; }
.pt-brand { display: flex; align-items: center; gap: 12px; }
.pt-brand svg { width: 34px; height: 34px; flex: none; }
.pt-brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.pt-login form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.pt-login label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.pt-login input, .pt-field input {
  height: 42px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--card);
  color: var(--text); font: inherit; font-size: 14px; outline: 0; min-width: 0;
}
.pt-login input:focus, .pt-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pt-login .btn { height: 44px; margin-top: 6px; }
.err { color: var(--red); background: var(--red-soft); border: 1px solid var(--red-border); border-radius: 10px; padding: 9px 12px; font-size: 13px; }

.pt-body { min-height: 100vh; }
.pt-top { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 16px 24px; max-width: 1180px; margin: 0 auto; }
.pt-top-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pt-top-tools form { display: contents; }
.pt-who { color: var(--text-2); font-size: 13px; font-weight: 500; margin-right: 4px; }
.pt-main { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; margin: 0 auto; padding: 0 24px 40px; }
.pt-main h2 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.pt-main h3 { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 16px 0 8px; }
.pt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }

.pt-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.pt-stat { padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); min-width: 0; }
.pt-stat small { display: block; font-size: 12px; color: var(--text-2); }
.pt-stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-stat em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.pt-bar { display: block; height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; margin-top: 8px; }
.pt-bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); }
.pt-bar.warm i { background: var(--amber-dot); }
.pt-bar.hot i { background: var(--red); }

.pt-chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 4px; }
.pt-chart span { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.pt-chart i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--blue); min-height: 2px; }
.pt-chart i.none { background: var(--border); min-height: 1px; height: 1px; }
.pt-chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }

.pt-new { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-field input { height: 38px; width: 240px; max-width: 100%; }
.pt-key { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-top: 10px; }
.pt-key.off { background: var(--panel); }
.pt-key-top { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.pt-key-name { flex: 1; min-width: 160px; }
.pt-key-name b { display: block; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pt-key-name small { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pt-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 14px; margin-top: 12px; }
.pt-nums div small { display: block; font-size: 11px; color: var(--muted); }
.pt-nums div b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pt-actions .btn { height: 34px; font-size: 13px; padding: 0 12px; }
.pt-empty { color: var(--muted); font-size: 13px; padding: 18px 0 4px; }

.pt-scroll { overflow-x: auto; margin-top: 12px; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pt-table th { text-align: left; font-weight: 500; color: var(--text-2); padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pt-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pt-table tr.bad td { color: var(--red); }
.mono { font-family: var(--mono); }

.pt-copy { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.pt-copy code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.pt-copy .btn { height: 32px; font-size: 12px; padding: 0 12px; flex: none; }
.pt-code { margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); font-family: var(--mono); font-size: 12px; overflow-x: auto; white-space: pre; }
.pt-models { display: flex; flex-direction: column; gap: 6px; }
.pt-model { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.pt-model code { font-family: var(--mono); font-weight: 600; }
.pt-model small { color: var(--muted); }
.pt-paused { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--amber-border); background: var(--amber-soft); color: var(--amber-ink); font-size: 13px; }
.pt-form { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.pt-form .pt-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.pt-form .pt-field input { width: 100%; height: 42px; }

.pt-top { justify-content: flex-start; }
.pt-brand { margin-right: auto; }
.pt-dash { height: 36px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 10px; font-size: 13px; text-decoration: none; }
.pt-dash[hidden] { display: none; }

/* the account: its name, and a short menu under it */
.pt-menu { position: relative; }
.pt-menu summary { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; list-style: none; user-select: none; }
.pt-menu summary::-webkit-details-marker { display: none; }
.pt-menu summary:hover, .pt-menu[open] summary { background: var(--panel); }
.pt-menu summary svg { width: 14px; height: 14px; color: var(--muted); }
.pt-menu .pt-who { margin: 0; color: var(--text); }
.pt-menu-list { position: absolute; z-index: 20; right: 0; top: calc(100% + 6px); min-width: 190px; padding: 6px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--card); box-shadow: 0 12px 32px rgba(0, 0, 0, .28); }
.pt-menu-list form { display: contents; }
.pt-menu-list button { display: block; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.pt-menu-list button:hover { background: var(--panel-2); }

.pt-stats.has-credit { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pt-stat.low b { color: var(--red); }
@media (max-width: 980px) { .pt-stats.has-credit { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* keys and usage on the left, how to connect beside them */
.pt-cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.pt-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pt-head:last-child { margin-bottom: 0; }
@media (max-width: 980px) { .pt-cols { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 760px) {
  .pt-top { padding: 14px 16px; }
  .pt-main { padding: 0 16px 32px; }
  .pt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pt-field, .pt-field input { width: 100%; }
  .pt-new .btn { flex: 1; }
}

/* ---- a fuller page for customers: greeting, cards with a drawing, a chart that is always there ---- */
.pt-ic { width: 1em; height: 1em; flex: none; }
.pt-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 22px 24px; border-radius: 18px; border: 1px solid var(--border);
  background: radial-gradient(120% 160% at 0% 0%, var(--blue-soft), transparent 60%), var(--card); }
.pt-hero h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.pt-hero p { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.pt-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.pt-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.pt-pill.ok i { background: var(--green-dot); box-shadow: 0 0 0 4px var(--green-soft); }
.pt-pill.warn { border-color: var(--amber-border); color: var(--amber-ink); background: var(--amber-soft); }
.pt-pill.warn i { background: var(--amber-dot); }

.pt-stat { display: flex; align-items: flex-start; gap: 12px; padding: 16px; }
.pt-stat-ic { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 18px; background: var(--blue-soft); color: var(--blue-ink); }
.pt-stat.low .pt-stat-ic { background: var(--red-soft); color: var(--red); }
.pt-stat-body { min-width: 0; flex: 1; }
.pt-stat b { font-size: 24px; }

.pt-chart { position: relative; height: 150px; }
.pt-chart i { background: linear-gradient(180deg, var(--blue), color-mix(in srgb, var(--blue) 55%, transparent)); border-radius: 4px 4px 0 0; }
.pt-chart.is-empty span { align-items: flex-end; }
.pt-chart.is-empty i.none { height: 100%; min-height: 0; background: var(--panel-2); opacity: .45; border-radius: 4px 4px 0 0; }
.pt-chart.is-empty span:nth-child(3n) i.none { height: 34%; }
.pt-chart.is-empty span:nth-child(3n+1) i.none { height: 58%; }
.pt-chart.is-empty span:nth-child(3n+2) i.none { height: 22%; }
.pt-chart.is-empty span:nth-child(5n) i.none { height: 76%; }
.pt-chart-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; font-size: 13px; color: var(--text-2); text-align: center; padding: 0 12px; }

.pt-key { padding: 16px; border-radius: 14px; transition: border-color .15s; }
.pt-key:hover { border-color: var(--border-strong); }
.pt-key-name small { display: block; margin-top: 2px; }
.pt-nums { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); padding: 12px; border-radius: 10px; background: var(--panel); }
.pt-new .btn { height: 38px; }

.pt-steps { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; counter-reset: step; }
.pt-steps li { counter-increment: step; position: relative; padding: 10px 12px 10px 46px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.pt-steps li::before { content: counter(step); position: absolute; left: 12px; top: 11px; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--blue-soft); color: var(--blue-ink); }
.pt-steps li.done::before { content: "✓"; background: var(--green-soft); color: var(--green-ink, var(--text)); }
.pt-steps b { display: block; font-size: 13.5px; }
.pt-steps span { display: block; font-size: 12.5px; color: var(--text-2); margin-top: 1px; }
.pt-steps code { font-family: var(--mono); font-size: 12px; }

.pt-copy .btn, .pt-model .btn, .pt-tabs-copy { display: inline-flex; align-items: center; gap: 6px; }
.pt-models { gap: 8px; }
.pt-model { align-items: center; flex-wrap: nowrap; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.pt-model > div { flex: 1; min-width: 0; }
.pt-model code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-model small { display: block; margin-top: 1px; }
.pt-model-ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; font-size: 16px; background: var(--blue-soft); color: var(--blue-ink); }
.pt-model-ic.img { background: var(--amber-soft); color: var(--amber-ink); }
.pt-model .btn { height: 32px; padding: 0 10px; flex: none; }

.pt-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.pt-tabs [role=tab] { height: 30px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.pt-tabs [role=tab]:hover { color: var(--text); background: var(--panel); }
.pt-tabs [role=tab][aria-selected=true] { color: var(--blue-ink); background: var(--blue-soft); border-color: var(--blue-border); }
.pt-tabs-copy { margin-left: auto; height: 30px; font-size: 12px; padding: 0 10px; }
.pt-code { line-height: 1.6; }
@media (max-width: 760px) { .pt-hero { padding: 18px 16px; } .pt-hero h2 { font-size: 22px; } }

/* the models carry the same logo tile as on the dashboard */
.pt-model-logo { width: 52px; height: 52px; font-size: 34px; border-radius: 13px; line-height: 1; }
.pt-model-logo .logo-wrap { width: 34px; height: 34px; }
.pt-model-logo .logo-wrap svg { display: block; width: 100%; height: 100%; }
.pt-model-logo .pt-model-ic { width: 100%; height: 100%; border-radius: inherit; font-size: 24px; }
.pt-model { padding: 12px 14px; gap: 14px; }
.pt-model b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-model b + code { font-size: 12px; font-weight: 400; color: var(--text-2); }

/* ---- the calm Ribbon page (type and tokens are in app.css): a greeting over the ribbon, a strip of facts ---- */
.pt-top { max-width: none; padding: 1.1rem var(--g); }
.pt-main { max-width: none; padding: 0 var(--g) 3rem; gap: 0; }
.pt-brand svg { display: none; }
.pt-brand h1 { font: 700 1.35rem/1 var(--sans); letter-spacing: -.04em; display: flex; align-items: center; gap: .45rem; }
.pt-brand h1::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: linear-gradient(135deg, var(--r1), var(--r2) 60%, var(--r3)); }
/* the front page's bar: same height and mark, the account as its ink pill */
.pt-top { height: 4.1rem; padding: 0 var(--g); flex-wrap: nowrap; }
.pt-top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); }
.pt-brand h1 { font-size: 1.4rem; gap: .5rem; }
.pt-brand h1::before { width: .8rem; height: .8rem; }
.pt-menu summary, .pt-menu summary:hover, .pt-menu[open] summary { height: 2.1rem; padding: 0 .9rem 0 1.1rem; border: 0; border-radius: 999px; background: var(--ink); color: var(--on-ink); box-shadow: 0 10px 24px rgba(14, 14, 16, .22); }
.pt-menu .pt-who { color: inherit; font: 600 .86rem/1 var(--sans); }
.pt-menu summary svg { color: inherit; }
.pt-hero { position: relative; isolation: isolate; overflow: hidden; display: block; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; margin: 0 calc(-1 * var(--g)); padding: clamp(2.4rem, 4.4vw, 4rem) var(--g) 1.1rem; }
.pt-hero-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.pt-main .pt-hero h2 { font-size: clamp(2rem, 3.4vw, 3.2rem); line-height: 1; text-transform: none; }
.pt-hero p:not(.kicker) { margin-top: .5rem; font-size: .95rem; color: var(--muted); max-width: 44rem; }
.pt-pill { background: var(--bg); border-color: var(--line); color: var(--text); }
.pt-stats, .pt-stats.has-credit { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0; margin: 0 calc(-1 * var(--g)); }
.pt-stat { display: block; background: transparent; border: 0; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; padding: .8rem 1.4rem .9rem var(--g); }
.pt-stat:first-child { border-left: 0; }
.pt-stat-ic { display: none; }
.pt-stat small { font: 400 .72rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pt-stat b { font: 600 clamp(1.3rem, 2vw, 1.9rem)/1.1 var(--sans); font-stretch: 90%; letter-spacing: -.03em; margin-top: .25rem; }
.pt-stat em { font-size: .86rem; margin-top: .3rem; }
.pt-cols { gap: 0 clamp(1.6rem, 3vw, 3.2rem); }
.pt-col { gap: 0; }
.pt-cols .card { border-top: 0; border-bottom: 1px solid var(--line); }
.pt-main h2 { font: 600 clamp(1.6rem, 2.3vw, 2.2rem)/1 var(--sans); font-stretch: 88%; letter-spacing: -.04em; }
.pt-key, .pt-copy, .pt-model, .pt-steps li, .pt-nums { background: transparent; border-color: var(--line); }
/* The example reads like the dashboard's: the page's own ink on its own panel. (It was light text on a
   background colour this page does not define, so it could not be read.) */
.pt-code { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem 1.3rem; }
.pt-steps li::before { background: var(--ink); color: var(--on-ink); }
.pt-chart i { background: var(--blue); }
.pt-tabs [role=tab] { border-radius: 99px; }
.pt-tabs [role=tab][aria-selected=true] { color: var(--on-ink); background: var(--ink); border-color: var(--ink); }
.pt-menu summary, .pt-dash { border-radius: 99px; border-color: var(--line); }
.pt-brand h1 a { color: inherit; text-decoration: none; }
.pt-menu-list a { display: block; padding: 9px 10px; border-radius: 8px; color: var(--text); font-size: 13px; text-decoration: none; }
.pt-menu-list a:hover { background: var(--panel-2); }

.pt-paused + .pt-paused { margin-top: 8px; }
.pt-paused.pt-low { border-color: var(--red-border, var(--amber-border)); background: var(--red-soft, var(--amber-soft)); color: var(--red, var(--amber-ink)); }

.pt-tabs { flex-wrap: wrap; }

.pt-hook input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--card); color: var(--text); font: inherit; font-size: 13px; }

.pt-allow { margin: 8px 0 12px; }
.pt-allow > div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 5px; font-size: 13.5px; }
.pt-bar { display: block; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.pt-bar > i { display: block; height: 100%; background: var(--green); border-radius: 3px; }
.pt-bar.warm > i { background: var(--amber, #d97706); } .pt-bar.hot > i { background: var(--red); }

/* A key's requests: a dozen rows in view, the rest by scrolling inside the table. */
.pt-reqs { max-height: 372px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--border); border-radius: 10px; }
.pt-reqs thead th { position: sticky; top: 0; background: var(--card, var(--panel)); z-index: 1; }

.pt-prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.pt-prompts > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.pt-prompts small { display: block; font-size: 11.5px; color: var(--text-2, var(--muted)); }
.pt-prompts b { font-size: 16px; font-variant-numeric: tabular-nums; }
.pt-advice { margin-top: 10px; line-height: 1.55; }
.pt-advice code { font-size: 12px; }

.pt-key.gone { opacity: .7; }
.pt-key.gone .pt-key-name b { text-decoration: line-through; text-decoration-color: var(--muted); }

.pt-key-tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pt-tag { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pt-tag.gone { background: var(--red-soft); color: var(--red); }
.pt-tag.swapped { background: var(--amber-soft); color: var(--amber-ink); }
.pt-key.gone { opacity: 1; background: color-mix(in srgb, var(--red-soft) 55%, transparent); border-left: 3px solid var(--red); }
.pt-key.gone .pt-key-name b { text-decoration: none; color: var(--text-2, var(--muted)); }
.pt-key.gone .pt-nums { opacity: .6; }
.pt-key.swapped { border-left: 3px solid var(--amber, #d97706); background: color-mix(in srgb, var(--amber-soft) 35%, transparent); }

.pt-for { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2, var(--muted)); }
.pt-for select { height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-strong); background-color: var(--card); color: var(--text); font: inherit; font-size: 13px; }

.pt-forecast { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); font-size: 13px; color: var(--text-2); }
.pt-forecast.warn { border-color: var(--warn, #d97706); }
