/* Parinita One's navy / ice-blue palette (One repo: branding/one.css), so the portal and the
   staff console read as part of One rather than separate sites. Moved from Conduit's /account
   (account_ui/static/account.css). */
:root {
  color-scheme: dark;
  --presentation: #071018;
  --header: #0a141e;
  --surface: #10202d;
  --surface-alt: #112535;
  --surface-hover: #173246;
  --border-light: #29465b;
  --border-medium: #31536b;
  --text-primary: #eaf2f8;
  --text-secondary: #9fb7c8;
  --text-tertiary: #819eb1;
  --accent: #69c7ff;
  --submit: #256a96;
  --submit-hover: #195578;
  --danger: #ff9b9b;
  --danger-surface: #2a1418;
  --warn-surface: #2a2312;
  --ok-surface: #0f2a22;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--presentation);
  color: var(--text-primary);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

a { color: var(--accent); }

.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--header);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 8px 28px rgb(0 0 0 / 6%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 650;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { border-radius: 8px; }
.crumb { color: var(--text-secondary); font-size: 14px; }
.crumb::before { content: "/"; margin-right: 12px; color: var(--border-medium); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.who .email {
  color: var(--text-secondary);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

main { max-width: 960px; margin: 0 auto; padding: 28px 20px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }

h1 { margin: 0 0 4px; font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -.035em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
p { margin: 0 0 8px; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }

.card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  background: linear-gradient(160deg, var(--surface), var(--presentation));
}
.card.center { max-width: 30rem; margin: 48px auto 0; text-align: center; }
.card.center img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 16px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.stat { border: 1px solid var(--border-light); border-radius: 12px; padding: 12px 14px; background: var(--surface-alt); }
.stat .value { font-size: 26px; font-weight: 600; letter-spacing: -.03em; }
.stat .label { color: var(--text-secondary); font-size: 13px; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--border-light);
}
.row:first-of-type { border-top: 0; }
.row .who-line { min-width: 0; overflow-wrap: anywhere; }
.row .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
/* The seat count's form: room before the first seat's line. */
.row.seat-change { padding-bottom: 24px; }

.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border: 1px solid var(--border-medium);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 12px;
  vertical-align: 1px;
}
.badge.removed { border-color: #6b3a3f; color: var(--danger); }

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  background: var(--surface-alt);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .06s ease, filter .06s ease, opacity .12s ease, background-color .12s ease;
}
button:hover:not(:disabled), .button:hover { background: var(--surface-hover); }
/* Pressed: a click shows the moment it lands, before any reply. */
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.97); filter: brightness(.85); }
button:focus-visible, .button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:disabled { opacity: .5; cursor: not-allowed; }
/* Waiting on the server (account.js's act): dimmed, "…", no second click. */
button[aria-busy="true"] { cursor: progress; pointer-events: none; }
button[aria-busy="true"]::after { content: "…"; }
button.primary, .button.primary { background: var(--submit); border-color: var(--submit); }
button.primary:hover:not(:disabled), .button.primary:hover { background: var(--submit-hover); }
button.danger { color: var(--danger); border-color: #6b3a3f; background: transparent; }
button.danger:hover:not(:disabled) { background: var(--danger-surface); }
button.link { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); font-weight: 500; }

form.inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
input {
  min-height: 36px;
  min-width: 0;
  flex: 1 1 220px;
  padding: 7px 12px;
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  background: var(--presentation);
  color: var(--text-primary);
  font: inherit;
}
input[type="number"] { flex: 0 0 110px; }
form.signup { display: grid; gap: 14px; margin-top: 16px; max-width: 520px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.field input { flex: none; width: 100%; color: var(--text-primary); }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--text-secondary); }
.check input { flex: none; min-height: 0; width: 18px; height: 18px; }
form.signup button { justify-self: start; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; flex: 3 1 340px; }

.notice:empty { display: none; }
/* Sticks to the top while scrolling, so the result of a click further down
   the page (an error, a confirmation) is always in view. */
.notice {
  position: sticky;
  top: 12px;
  z-index: 10;
  width: min(920px, calc(100% - 28px));
  margin: 20px auto 0;
  box-shadow: 0 8px 28px rgb(0 0 0 / 35%);
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: 12px;
  background: var(--surface-alt);
}
.notice.error { border-color: #6b3a3f; background: var(--danger-surface); }
.notice.ok { border-color: #2c6b57; background: var(--ok-surface); }
.banner { border-color: #6b5a2c; background: var(--warn-surface); }
.plan-pending { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px;
  padding: 12px 16px; border-width: 1px; border-style: solid; border-radius: 12px; }
.plan-pending p { margin: 0; flex: 1 1 260px; }
.confirm { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.confirm p { margin: 0; color: var(--text-secondary); flex: 1 1 260px; }

.subhead { margin: 18px 0 4px; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
form.invite input:not([type=email]) { flex: 1 1 140px; }
ol.activity { margin: 0; padding: 0; list-style: none; }
ol.activity li { padding: 8px 0; border-top: 1px solid var(--border-light); font-size: 14px; }
ol.activity li:first-child { border-top: 0; }
ol.activity time { color: var(--text-tertiary); margin-right: 8px; }

@media (max-width: 640px) {
  .bar { padding: 10px 14px; gap: 8px; }
  .crumb, .who .email { display: none; }
  main { padding: 20px 14px 48px; }
  .row { grid-template-columns: 1fr; }
  .row .actions { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
.count { width: 5.5rem; flex: none; }
.addons { justify-content: flex-end; }

/* A confirmation over the page (confirmDialog). */
.modal {
  width: min(28rem, calc(100vw - 32px));
  padding: 24px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .5);
}
.modal::backdrop { background: rgba(4, 10, 16, .65); }
.modal h2 { margin: 0 0 10px; font-size: 18px; }
.modal p { margin: 0 0 20px; color: var(--text-secondary); line-height: 1.55; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* The signed-in email's menu, top right (header()). */
.menu-wrap { position: relative; }
.menu-toggle { display: inline-flex; align-items: center; gap: 8px; max-width: 280px; }
.menu-toggle .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle .menu-short { display: none; }
.menu-toggle .caret { font-size: 11px; color: var(--text-secondary); }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px;
  display: flex; flex-direction: column; padding: 6px;
  border: 1px solid var(--border-medium); border-radius: 12px; background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}
.menu[hidden] { display: none; }
.menu button { justify-content: flex-start; text-align: left; border: 0; background: transparent; width: 100%; white-space: nowrap; }
.menu button:hover:not(:disabled) { background: var(--surface-hover); }
@media (max-width: 640px) {
  .menu-toggle .menu-short { display: inline; }
}

/* A form in a pop-up (passwordDialog). */
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form .field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-secondary); }
.modal-form input { width: 100%; }
.modal .form-error { margin: 0; min-height: 1.2em; color: var(--danger); font-size: 14px; }
.modal .form-error:empty { display: none; }

/* An owner's page: the summary strip, tabs, and the team table. */
.page-head h1 { margin-bottom: 4px; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 0 0 20px; }
.summary .stat { display: flex; flex-direction: column; gap: 2px; padding: 16px 18px; }
.summary .stat .detail { color: var(--text-tertiary); font-size: 12.5px; margin-top: 4px; }
.summary .stat button { align-self: flex-start; margin-top: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border-light); margin-bottom: 20px; overflow-x: auto; }
.tabs [role="tab"] {
  border: 0; border-radius: 0; background: transparent; padding: 10px 14px; white-space: nowrap;
  color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs [role="tab"]:hover:not(:disabled) { background: transparent; color: var(--text-primary); }
.tabs [role="tab"][aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--submit); }
.tab-panel[hidden] { display: none; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack > .card { margin: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.panel-head .count { color: var(--text-tertiary); font-size: 14px; font-weight: 400; }

.team { border: 1px solid var(--border-light); border-radius: 12px; overflow: visible; }
.team-row {
  display: grid; grid-template-columns: minmax(0, 2.2fr) 110px minmax(160px, 1.4fr) 48px;
  align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border-light);
}
.team-row:first-child { border-top: 0; }
.team-row.heading { color: var(--text-tertiary); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding-block: 8px; }
.team-row .person { display: flex; flex-direction: column; min-width: 0; }
.team-row .person .email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row .role { color: var(--text-secondary); font-size: 14px; }
.team-row .used { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-size: 14px; }
.team-row .act { display: flex; justify-content: flex-end; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-alt); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--submit); }
.team-note { margin: 10px 2px 0; }
button.icon { padding: 4px 10px; font-size: 16px; line-height: 1; }
.menu .danger-text { color: var(--danger); }
.modal-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.team-row .badge { margin-left: 0; justify-self: start; }
.nowrap { white-space: nowrap; }
.seat-note { margin-top: 12px; }
.who .button .short { display: none; }

@media (max-width: 640px) {
  .team-row { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 6px; }
  .team-row.heading { display: none; }
  .team-row .person { grid-column: 1 / 3; grid-row: 1; }
  .team-row .act { grid-column: 3; grid-row: 1 / 3; }
  .team-row .role { grid-column: 1; grid-row: 2; }
  .team-row .used { grid-column: 2; grid-row: 2; grid-template-columns: 64px 1fr; }
  .who .button .long { display: none; }
  .who .button .short { display: inline; }
  .modal-form .two { grid-template-columns: 1fr; }
}

/* An add-on's details page (detailsLink). */
.details-link { display: inline-block; margin-top: 4px; font-size: 13.5px; color: var(--accent); text-decoration: none; }
.details-link:hover { text-decoration: underline; }

/* The Team table's sortable headings. */
.team-row.heading .sort {
  border: 0; background: transparent; padding: 0; color: inherit; font: inherit;
  text-transform: inherit; letter-spacing: inherit; cursor: pointer;
}
.team-row.heading .sort:hover:not(:disabled) { background: transparent; color: var(--text-primary); }
.team-row.heading .sort.current { color: var(--text-primary); }

