/* The operators' portal (src/portal.rs): the site's palette and buttons
   (site.css), laid out as a console rather than a page. */
.portal { padding-bottom: 0; }
.p-wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
.p-bar { background: var(--title); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.p-bar-in { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 16px; }
.p-tag { font: 10px var(--mono); color: var(--rust-bright); letter-spacing: .12em; margin-left: 10px; vertical-align: middle; }
.p-out { margin: 0; }
.p-h { font: 18px var(--mono); margin: 32px 0 12px; letter-spacing: .02em; }
.p-card { background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; margin: 0 0 16px; }
.p-card h1 { font: 18px var(--mono); margin: 0 0 10px; }
.p-card h2 { font: 14px var(--mono); margin: 0 0 10px; color: var(--text); }
.p-card h3 { font: 12px var(--mono); margin: 14px 0 6px; color: var(--text-dim); letter-spacing: .06em; text-transform: uppercase; }
.p-card summary { cursor: pointer; font: 12px var(--mono); color: var(--text-dim); }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.p-grid .p-card { margin: 0; }
.p-grid { margin-bottom: 16px; }
.p-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 0 0 8px; font: 12px var(--mono); }
.p-kv dt { color: var(--text-faint); }
.p-kv dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.p-cols { grid-template-columns: repeat(4, max-content 1fr); margin-top: 12px; }
.p-cols dd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-dot { font-size: 12px; }
.p-bad { color: var(--bad); }
.p-error { color: var(--bad); border: 1px solid var(--bad); background: var(--well); padding: 10px 12px; font: 12px var(--mono); }
.p-warn { border-color: var(--warn); }
.p-warn h3 { color: var(--warn); }
.p-table { width: 100%; border-collapse: collapse; font: 12px var(--mono); background: var(--panel); border: 1px solid var(--line); margin-bottom: 16px; }
.p-table th { text-align: left; color: var(--text-faint); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--line-bright); background: var(--title); }
.p-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.p-table tr:nth-child(even) td { background: var(--zebra); }
.p-table a code:hover { color: var(--rust-bright); }
.p-chip { display: inline-block; font: 10px var(--mono); padding: 1px 6px; margin: 1px 3px 1px 0; border: 1px solid var(--line-bright); color: var(--syn-type); }
.p-form label { display: flex; flex-direction: column; gap: 4px; font: 11px var(--mono); color: var(--text-dim); letter-spacing: .04em; }
.p-form .p-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.p-form fieldset { border: 1px solid var(--line); margin: 0 0 12px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.p-form legend { font: 11px var(--mono); color: var(--text-dim); padding: 0 6px; }
.p-check { flex-direction: row !important; align-items: center; gap: 6px !important; color: var(--text) !important; font-size: 12px !important; }
.portal input[type=text], .portal input[type=password], .portal input:not([type]), .portal select {
  background: var(--input); color: var(--text); border: 1px solid var(--line-bright); padding: 8px 10px; font: 13px var(--mono); }
.portal input:focus, .portal select:focus { outline: none; border-color: var(--rust); }
.portal input[type=checkbox] { accent-color: var(--rust); }
.p-login { max-width: 420px; margin: 80px auto; }
.p-login form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.p-login label { display: flex; flex-direction: column; gap: 4px; font: 11px var(--mono); color: var(--text-dim); }
.p-actions { display: flex; gap: 8px; margin-top: 8px; }
.p-actions form { margin: 0; }
.p-actions.p-end { justify-content: flex-end; }
.p-danger { border-color: var(--rust-dim); }
.p-danger label { display: flex; flex-direction: column; gap: 4px; font: 11px var(--mono); color: var(--text-dim); margin: 10px 0; max-width: 360px; }
.p-secret { color: var(--rust-bright); font-size: 14px; }
.p-raw { font: 11px/1.5 var(--mono); color: var(--text-dim); white-space: pre-wrap; max-height: 480px; overflow: auto; margin: 10px 0 0; }
.p-foot { font: 11px var(--mono); padding: 24px 28px 32px; }

/* metric | value views: compact, the description on hover */
.p-mt { border-collapse: collapse; font: 12px var(--mono); width: 100%; }
.p-mt td { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.p-mt td:first-child { color: var(--text-faint); white-space: nowrap; width: 1%; padding-right: 18px; }
.p-mt td:last-child { color: var(--text); overflow-wrap: anywhere; }
.p-mt tr:hover td { background: var(--raised); }
.p-mt-cols { display: block; columns: 3 320px; column-gap: 28px; }
.p-mt-cols tbody { display: block; }
.p-mt-cols tr { display: flex; break-inside: avoid; }
.p-mt-cols td { flex: 0 0 auto; }
.p-mt-cols td:first-child { flex: 0 0 48%; width: auto; }

/* a page that opens with a card (sign-in, a deploy result) keeps its distance from the bar */
main.p-wrap > .p-card:first-child { margin-top: 32px; }

/* top bar: the two screens, the deploy button */
.p-bar-in { justify-content: flex-start; }
.p-nav { display: flex; gap: 4px; margin-left: 28px; height: 100%; }
.p-nav a { display: flex; align-items: center; padding: 0 14px; font: 12px var(--mono); letter-spacing: .08em; color: var(--text-dim); border-bottom: 2px solid transparent; }
.p-nav a:hover { color: var(--text); }
.p-nav a.on { color: var(--text); border-bottom-color: var(--rust); }
.p-bar-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.p-head .p-h { margin-bottom: 12px; }
.p-crumbs { font: 11px var(--mono); color: var(--text-faint); margin: 24px 0 -18px; }
.p-crumbs a { color: var(--text-dim); }
.p-crumbs a:hover, .p-sub:hover { color: var(--rust-bright); }
.p-sub { color: var(--syn-table); }
.p-state { font: 10px var(--mono); letter-spacing: .12em; border: 1px solid currentColor; padding: 2px 7px; margin-left: 10px; vertical-align: middle; }
.p-flash { margin: 20px 0 0; padding: 10px 14px; border: 1px solid var(--ok); background: var(--well); color: var(--text); font: 12px var(--mono); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.p-x { background: none; border: 0; color: var(--text-dim); font: 18px var(--mono); cursor: pointer; padding: 0 4px; line-height: 1; }
.p-x:hover { color: var(--text); }
.btn:disabled, .btn.off { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn.on { border-color: var(--rust); color: var(--text); }
.p-btn-danger { border-color: var(--bad); color: var(--bad); }
.p-btn-danger:hover { background: var(--bad); color: #fff; }

/* the databases list */
.p-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.p-toolbar input[type=search] { min-width: 260px; background: var(--input); color: var(--text); border: 1px solid var(--line-bright); padding: 7px 10px; font: 12px var(--mono); }
.p-toolbar input[type=search]:focus { outline: none; border-color: var(--rust); }
.p-toolbar select { padding: 6px 8px; font-size: 12px; }
.p-grow { flex: 1; }
.p-count { font: 12px var(--mono); }
.p-sort { color: var(--text-faint); }
.p-sort:hover, .p-sort.on { color: var(--text); }
.p-right { text-align: right; }
.p-nowrap { white-space: nowrap; }
.p-table tbody tr:hover td { background: var(--raised); }
.p-pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin: 4px 0 16px; }
.p-gap { color: var(--text-faint); font: 12px var(--mono); padding: 0 4px; }
.p-empty { text-align: center; padding: 40px 18px; }
.p-empty p { color: var(--text-dim); margin: 0 0 14px; }

/* shards */
.p-shard h2 a { color: var(--text); }
.p-shard h2 a:hover { color: var(--rust-bright); }
.p-card-foot { margin-top: 14px; }
.p-lines { max-height: none; }
.p-grid-2 { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); }

/* the database page */
.p-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 16px; flex-wrap: wrap; }
.p-tabs a { font: 11px var(--mono); letter-spacing: .06em; color: var(--text-dim); padding: 8px 12px; }
.p-tabs a:hover { color: var(--text); background: var(--raised); }
.p-scroll { overflow-x: auto; }
.p-inner { margin: 0; }
.p-stmt code { display: inline-block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
[id] { scroll-margin-top: 72px; }
.p-copyable dd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-created h1 .ok { font-size: 14px; vertical-align: middle; }

/* forms: deploy and the database's settings */
.p-form h3 { margin: 18px 0 10px; }
.p-form h3:first-of-type { margin-top: 0; }
.p-form small { font: 10px var(--mono); color: var(--text-faint); letter-spacing: 0; }
.p-row-1 { grid-template-columns: 1fr !important; }
.p-inline { display: flex; gap: 6px; }
.p-inline input { flex: 1; min-width: 0; }
.p-inline select { flex: 0 0 auto; }
.p-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin-bottom: 14px; }
.p-plan, .p-feature { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); background: var(--well); padding: 10px 12px; cursor: pointer; }
.p-plan:hover, .p-feature:hover { border-color: var(--line-bright); }
.p-plan:has(input:checked), .p-feature:has(input:checked) { border-color: var(--rust); background: var(--raised); }
.p-plan input, .p-feature input { margin-top: 2px; accent-color: var(--rust); }
.p-plan span, .p-feature span { display: flex; flex-direction: column; gap: 3px; }
.p-plan b, .p-feature b { font: 12px var(--mono); color: var(--text); font-weight: 400; text-transform: none; }
.p-feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 14px; }
.p-feature-grid-1 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.p-form-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.p-form-foot .dim { font-size: 12px; }

/* the deploy dialog */
.p-dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-bright); padding: 0; width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); }
.p-dialog::backdrop { background: rgba(8, 6, 5, .72); }
.p-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--title); position: sticky; top: 0; z-index: 1; }
.p-dialog-head h2 { font: 15px var(--mono); margin: 0; }
.p-dialog .p-deploy { padding: 18px 20px 20px; }
@media (max-width: 860px) { .p-nav { margin-left: 8px; } .p-nav a { padding: 0 8px; } .p-tag { display: none; } }
/* cards with a box to tick: the box beside its text, not above it */
.p-form label.p-plan, .p-form label.p-feature { flex-direction: row; align-items: flex-start; gap: 10px; color: var(--text); }
.p-form h3, .p-dialog h3 { font: 11px var(--mono); color: var(--text-dim); letter-spacing: .08em; text-transform: uppercase; margin: 18px 0 10px; }
.p-mt-cols td:last-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.p-sub-details { margin-top: 12px; }
.p-sub-details summary { cursor: pointer; font: 12px var(--mono); color: var(--text-dim); margin-bottom: 8px; }
.p-me { font: 12px var(--mono); color: var(--text-dim); padding: 0 6px; }
.p-me:hover, .p-me.on { color: var(--text); }
.p-issues { list-style: none; padding: 0; margin: 0; }
.p-issues li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p-issues li:last-child { border-bottom: 0; }
.p-inline-confirm { display: flex; gap: 6px; align-items: center; }
.p-inline-confirm input { width: 140px; padding: 5px 8px !important; font-size: 11px !important; }

/* the providers' catalogue (src/portal_providers.rs) */
.portal textarea { background: var(--input); color: var(--text); border: 1px solid var(--line-bright); padding: 8px 10px; font: 12px var(--mono); width: 100%; box-sizing: border-box; resize: vertical; }
.portal textarea:focus { outline: none; border-color: var(--rust); }
.p-notes { font-size: 12px; margin: 0 0 14px; max-width: 980px; }
.p-edit-row td { background: transparent !important; padding-top: 0; }
.p-edit-row details summary { font: 11px var(--mono); color: var(--text-faint); padding: 2px 0 6px; }
.p-edit-row details[open] { border-left: 2px solid var(--rust); padding: 6px 0 4px 12px; margin: 0 0 8px; }
.p-members { margin: 0 0 14px; width: auto; }
.p-members td { padding: 3px 10px 3px 0 !important; border-bottom: 0; width: auto !important; }
.p-members tr:first-child td { color: var(--text-faint); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.p-members input { width: 4em; }
.p-offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.p-offers .p-card { margin: 0; }
.p-offer.off { opacity: .55; border-style: dashed; }
.p-price { font: 22px var(--mono); color: var(--text); margin: 4px 0 0; }
.p-price small { font-size: 12px; color: var(--text-dim); }
@media (max-width: 720px) { .p-grid-2 { grid-template-columns: 1fr; } }
/* a form under a table in the same card: room above it, and a rule */
.p-inner + .p-form, .p-scroll + .p-form, .p-inner + form, .p-scroll + form { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* offers: the operator's price breakdown and the customer's view */
.p-breakdown { border-top: 1px solid var(--line); padding-top: 6px; }
.p-customer { border-color: var(--line-bright); }
.p-customer > .p-offers { margin: 0; }

/* the provider page's wide tables scroll inside their card; ids, names
   and dates keep their shape; notes and reasons wrap in their own width */
.p-scroll { max-width: 100%; }
.p-scroll > .p-table { margin-bottom: 0; }
.p-table .p-id, .p-table .p-nowrap, .p-table .p-nowrap code { white-space: nowrap; }
.p-table td.p-name { min-width: 18ch; }
.p-table td.p-cpu { min-width: 16ch; }
.p-table td.p-note { min-width: 20ch; max-width: 30ch; white-space: normal; }
.p-arrangements tbody.p-group tr td { background: transparent !important; }
.p-arrangements tbody.p-group tr:first-child td { border-bottom: 0; }
.p-arrangements tbody.p-group:nth-child(odd) td { background: var(--zebra) !important; }
.p-reason td { padding-top: 0 !important; }
.p-why { max-width: 100ch; font-size: 11px; white-space: normal; }
.p-editors { margin-top: 14px; }
.p-editors h3 { margin: 0 0 6px; }
.p-editors details { border-top: 1px solid var(--line); padding: 6px 0; }
.p-editors details summary { font: 11px var(--mono); color: var(--text-faint); cursor: pointer; }
.p-editors details[open] { border-left: 2px solid var(--rust); padding: 6px 0 8px 12px; }
.p-card .p-form .p-row { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.p-hosts { align-items: center; gap: 10px; }

/* Notices (src/portal_notices.rs). */
.p-count { display: inline-block; min-width: 16px; padding: 0 4px; margin-left: 2px; font: 10px var(--mono); text-align: center; color: #111; border-radius: 2px; }
.p-count.crit { background: var(--bad); }
.p-count.warn { background: var(--warn); }
.p-level { font: 10px var(--mono); letter-spacing: .1em; padding: 1px 6px; border: 1px solid currentColor; }
.p-level.critical { color: var(--bad); }
.p-level.warning { color: var(--warn); }
.p-level.info { color: var(--syn-type); }
.p-notice.acked { opacity: .65; }
.p-customer { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--syn-type); }
.p-notice-list { list-style: none; margin: 0; padding: 0; }
.p-notice-list li { padding: 6px 0; border-top: 1px solid var(--line); }
.p-notice-list li:first-child { border-top: 0; }
.p-notices { border-color: var(--warn); }

/* Deployments (src/portal_deploys.rs). */
.p-deploy-head { display: flex; align-items: baseline; gap: 12px; }
.p-deploy-pct { font: 600 28px var(--mono); }
.p-progress { height: 8px; margin: 10px 0 12px; background: var(--line); overflow: hidden; }
.p-progress > span { display: block; height: 100%; background: var(--syn-type); transition: width .6s ease; }
.p-deploy.done .p-progress > span { background: var(--ok); }
.p-deploy.failed .p-progress > span, .p-deploy.interrupted .p-progress > span { background: var(--bad); }
.p-deploy-live { margin: 0 0 12px; }
.p-spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--line-bright); border-top-color: var(--syn-type); border-radius: 50%; animation: p-spin .8s linear infinite; vertical-align: -1px; }
@keyframes p-spin { to { transform: rotate(360deg); } }
.p-deploy-log { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.p-deploy-log li { padding: 4px 0; border-top: 1px solid var(--line); }
.p-deploy-ready { margin: 8px 0 16px; padding: 12px 14px; border: 1px solid var(--ok); }
.p-secret { user-select: all; }
.p-inline { display: inline; margin-left: 8px; }
.p-progress-0 { width: 0%; }
.p-progress-1 { width: 1%; }
.p-progress-2 { width: 2%; }
.p-progress-3 { width: 3%; }
.p-progress-4 { width: 4%; }
.p-progress-5 { width: 5%; }
.p-progress-6 { width: 6%; }
.p-progress-7 { width: 7%; }
.p-progress-8 { width: 8%; }
.p-progress-9 { width: 9%; }
.p-progress-10 { width: 10%; }
.p-progress-11 { width: 11%; }
.p-progress-12 { width: 12%; }
.p-progress-13 { width: 13%; }
.p-progress-14 { width: 14%; }
.p-progress-15 { width: 15%; }
.p-progress-16 { width: 16%; }
.p-progress-17 { width: 17%; }
.p-progress-18 { width: 18%; }
.p-progress-19 { width: 19%; }
.p-progress-20 { width: 20%; }
.p-progress-21 { width: 21%; }
.p-progress-22 { width: 22%; }
.p-progress-23 { width: 23%; }
.p-progress-24 { width: 24%; }
.p-progress-25 { width: 25%; }
.p-progress-26 { width: 26%; }
.p-progress-27 { width: 27%; }
.p-progress-28 { width: 28%; }
.p-progress-29 { width: 29%; }
.p-progress-30 { width: 30%; }
.p-progress-31 { width: 31%; }
.p-progress-32 { width: 32%; }
.p-progress-33 { width: 33%; }
.p-progress-34 { width: 34%; }
.p-progress-35 { width: 35%; }
.p-progress-36 { width: 36%; }
.p-progress-37 { width: 37%; }
.p-progress-38 { width: 38%; }
.p-progress-39 { width: 39%; }
.p-progress-40 { width: 40%; }
.p-progress-41 { width: 41%; }
.p-progress-42 { width: 42%; }
.p-progress-43 { width: 43%; }
.p-progress-44 { width: 44%; }
.p-progress-45 { width: 45%; }
.p-progress-46 { width: 46%; }
.p-progress-47 { width: 47%; }
.p-progress-48 { width: 48%; }
.p-progress-49 { width: 49%; }
.p-progress-50 { width: 50%; }
.p-progress-51 { width: 51%; }
.p-progress-52 { width: 52%; }
.p-progress-53 { width: 53%; }
.p-progress-54 { width: 54%; }
.p-progress-55 { width: 55%; }
.p-progress-56 { width: 56%; }
.p-progress-57 { width: 57%; }
.p-progress-58 { width: 58%; }
.p-progress-59 { width: 59%; }
.p-progress-60 { width: 60%; }
.p-progress-61 { width: 61%; }
.p-progress-62 { width: 62%; }
.p-progress-63 { width: 63%; }
.p-progress-64 { width: 64%; }
.p-progress-65 { width: 65%; }
.p-progress-66 { width: 66%; }
.p-progress-67 { width: 67%; }
.p-progress-68 { width: 68%; }
.p-progress-69 { width: 69%; }
.p-progress-70 { width: 70%; }
.p-progress-71 { width: 71%; }
.p-progress-72 { width: 72%; }
.p-progress-73 { width: 73%; }
.p-progress-74 { width: 74%; }
.p-progress-75 { width: 75%; }
.p-progress-76 { width: 76%; }
.p-progress-77 { width: 77%; }
.p-progress-78 { width: 78%; }
.p-progress-79 { width: 79%; }
.p-progress-80 { width: 80%; }
.p-progress-81 { width: 81%; }
.p-progress-82 { width: 82%; }
.p-progress-83 { width: 83%; }
.p-progress-84 { width: 84%; }
.p-progress-85 { width: 85%; }
.p-progress-86 { width: 86%; }
.p-progress-87 { width: 87%; }
.p-progress-88 { width: 88%; }
.p-progress-89 { width: 89%; }
.p-progress-90 { width: 90%; }
.p-progress-91 { width: 91%; }
.p-progress-92 { width: 92%; }
.p-progress-93 { width: 93%; }
.p-progress-94 { width: 94%; }
.p-progress-95 { width: 95%; }
.p-progress-96 { width: 96%; }
.p-progress-97 { width: 97%; }
.p-progress-98 { width: 98%; }
.p-progress-99 { width: 99%; }
.p-progress-100 { width: 100%; }
/* Two-factor set-up: the QR code (src/qr.rs, an inline SVG in the site's
   colours), framed like the site's windows. */
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 18px 0 14px; }
.qr-box .qr { display: block; width: 220px; height: 220px; border: 1px solid var(--rust); padding: 0; background: #E8E2DC; image-rendering: pixelated; }
.qr-box p { margin: 0; font-size: 13px; text-align: center; }
