/* aitism: the account and admin pages. Plain operate pages under the same sign bar; styles.css comes first. */
.bar .spacer { flex: 1; }
.desk { max-width: 620px; margin: 40px auto 72px; padding: 0 16px; display: grid; gap: 16px; }
.desk.wide { max-width: 1180px; }
.desk .plate { margin: 0; }
.stack { display: grid; gap: 16px; min-width: 0; }
.desk h1 { flex: 1; min-width: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.desk [tabindex="-1"]:focus { outline: none; }
.desk [tabindex="-1"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
/* jumping to a section or a message keeps it clear of the sticky sign bar */
.desk .panel, .desk [tabindex="-1"] { scroll-margin-top: calc(var(--bar-h) + 16px); }

.panel { min-width: 0; display: grid; gap: 14px; padding: 18px 18px 20px; border-radius: 8px; background: var(--panel);
  box-shadow: 0 0 0 1px var(--rule), 0 3px 8px rgba(11,21,40,.08); }
.panel h2 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.panel h3 { font-size: 16px; font-weight: 700; line-height: 1.3; }
.panel p { color: var(--ink-2); line-height: 1.45; overflow-wrap: anywhere; }
.panel p b { color: var(--ink); }
.panel .small { font-size: 14px; }
.panel a:not(.btn) { color: var(--sign); font-weight: 700; text-underline-offset: 3px; }
.panel a:not(.btn):hover { color: var(--focus); }
.loading { color: var(--ink-2); padding: 4px 2px; }

.form { display: grid; gap: 14px; }
.fld .opt { font-weight: 400; color: var(--ink-2); }
.desk .hint { font-size: 12px; font-weight: 400; color: var(--ink-2); line-height: 1.4; }
.fld textarea { resize: vertical; line-height: 1.4; min-height: 84px; }
.fld :is(input, textarea)[aria-invalid="true"] { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.fld-inline { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.fld-inline .fld { flex: 1 1 140px; }
.fld-inline .fld:not(.wide) { max-width: 220px; }
.fld-inline .fld.wide { flex: 3 1 220px; }
.fld-inline .btn { min-height: 40px; }
.err { font-size: 14px; font-weight: 700; color: var(--danger); line-height: 1.4; }
.err[hidden] { display: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.desk .btn { text-decoration: none; }
.desk .btn-big { padding: 10px 16px; font-size: 16px; }
.btn-danger:hover:not(:disabled) { background: var(--danger-deep); border-color: var(--danger-deep); }
/* what just happened: a ring in the line colour, like the stations */
.said { position: relative; padding: 10px 12px 10px 36px; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--rule-2);
  font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.4; overflow-wrap: anywhere; }
.said::before { content: ""; position: absolute; left: 12px; top: 13px; width: 14px; height: 14px; border-radius: 999px; border: 3px solid var(--line); box-sizing: border-box; }
.said.bad::before { border-color: var(--danger); }

/* counts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0; }
.fact { min-width: 0; padding: 10px 12px; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.fact dt { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.fact dd { margin: 2px 0 0; font-size: 22px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fact dd small { font-size: 14px; font-weight: 500; color: var(--ink-2); }

/* the account's topics */
.topics { list-style: none; margin: 0; padding: 0; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.topics > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 12px; }
.topics > li + li { border-top: 1px solid var(--rule); }
.topic-name { font-weight: 700; overflow-wrap: anywhere; }
.topic-sub { grid-column: 1; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.topics .actions { grid-column: 2; grid-row: 1 / span 2; }
.topics .confirm { grid-column: 1 / -1; margin: 8px 0 0; }
.empty { font-size: 14px; color: var(--ink-2); padding: 12px; border-radius: var(--r); border: 1px dashed var(--rule-2); background: var(--paper); }

/* the admin desk */
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump a { text-decoration: none; color: var(--ink); }
.jump .push { margin-left: auto; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.part { display: grid; gap: 14px; min-width: 0; }
.part:empty { display: none; }
.switches { display: grid; gap: 8px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: var(--r);
  background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.switch-row > span { font-weight: 700; line-height: 1.35; }
.switch-row small { display: block; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px 12px; flex-wrap: wrap; align-items: flex-end; }
.filters .fld { min-width: 160px; }
.filters .fld.wide { flex: 1 1 260px; max-width: 420px; }
.only { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 40px; }
.only:empty { display: none; }

.tbl { position: relative; overflow-x: auto; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.tbl th, .tbl td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--rule); }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl thead th { position: sticky; top: 0; font-size: 12px; font-weight: 700; color: var(--ink-2); white-space: nowrap; background: var(--panel); }
.tbl .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .when { white-space: nowrap; color: var(--ink-2); }
.tbl .who { font-weight: 700; min-width: 200px; overflow-wrap: anywhere; }
.tbl .sub { display: block; font-weight: 400; color: var(--ink-2); overflow-wrap: anywhere; }
.tbl .actions { gap: 6px; min-width: 220px; }
.tbl .btn { padding: 4px 9px; font-size: 14px; }
.tbl .of { color: var(--ink-2); }
/* More and Details stay marked while their row is open */
.desk .btn[aria-expanded="true"] { border-color: var(--ink); background: var(--hover); }
.tbl tr.more > td { background: var(--hover); }
.tbl tr.more .form { max-width: 560px; }
.tbl .tag { white-space: nowrap; display: inline-block; }
.tag.pending { border-style: dashed; }
.tag.active { background: var(--sign); border-color: var(--sign); color: #fff; }
.tag.suspended, .tag.refused, .tag.failed { color: var(--danger); border-color: var(--danger); }
.tag.ready { border-color: var(--line); color: var(--ink); }
.tag.queued, .tag.writing { border-style: dashed; }
/* amber is light, so it only appears on navy */
.tag.admin { background: var(--sign); border-color: var(--sign); color: var(--amber); }
.tbl .mail { min-width: 160px; overflow-wrap: anywhere; }
.tbl .confirm { margin: 0; min-width: 240px; }
.kv code, .tbl code { font: 12px/1.5 monospace; }
/* the row opened under a person or a topic */
.more-box { display: grid; gap: 12px; max-width: 820px; }
.more-box .confirm { margin: 0; }
.more-part { display: grid; gap: 10px; }
.more-part + .more-part { padding-top: 12px; border-top: 1px solid var(--rule); }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: 14px; line-height: 1.45; }
.kv dt { font-weight: 700; color: var(--ink-2); }
.kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
/* a new invite, shown once */
.made { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 2px var(--line); }
pre.json { margin: 0; max-height: 440px; overflow: auto; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--rule);
  background: var(--paper); color: var(--ink); font: 12px/1.5 monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy { display: flex; gap: 8px; align-items: stretch; }
.copy input { flex: 1; min-width: 0; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2);
  border-radius: var(--r); padding: 7px 10px; min-height: 40px; }
.code-big { font-size: 22px; font-weight: 800; letter-spacing: .06em; color: var(--ink); }
.log { list-style: none; margin: 0; padding: 0; font-size: 14px; border-radius: var(--r); background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
.log > li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 12px; padding: 8px 12px; overflow-wrap: anywhere; }
.log > li + li { border-top: 1px solid var(--rule); }
.log .when { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log code { font: 12px/1.5 monospace; color: var(--ink-2); }

@media (max-width: 859px) {
  .desk .panel, .desk [tabindex="-1"] { scroll-margin-top: 16px; }
}
@media (max-width: 599px) {
  .desk { margin-top: 20px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv dd + dt { margin-top: 8px; }
  .panel { padding: 14px 14px 16px; }
  .copy { flex-direction: column; }
  .topics > li { grid-template-columns: minmax(0, 1fr); }
  .topics .actions { grid-column: 1; grid-row: auto; margin-top: 6px; }
  .log > li { grid-template-columns: minmax(0, 1fr); }
}
