/* ============================================================================
   Tenant admin portal — brand v2 ("Pomelow — modern refresh" design canvas:
   Admin — Home / Users / Domain & mail artboards).

   Loaded by app/templates/portal/base.html, after pomelow.css: section 1
   re-points that file's tokens at v2 so every existing portal screen (cards,
   tables, badges, forms, notices) picks the new look up without changes.
   The self-signup pages (signup_base.html) load it too, for the same v2
   tokens and controls, with signup.css on top. The operator console doesn't.
   ========================================================================== */

/* ---- 1. Tokens ---------------------------------------------------------- */
:root {
  --ink:        #0F2419;
  --ink-2:      #33443B;
  --ink-3:      #3D4D44;
  --slate:      #5C6B63;
  --mist:       #F6F7F5;
  --paper:      #FFFFFF;
  --line:       #E3E7E4;
  --line-soft:  #EEF1EE;
  --line-strong:#D5DBD7;
  --pomelo:     #F6919F;
  --pomelo-bg:  #FDEEF0;
  --pomelo-ink: #A3223F;
  --rind-v2:    #7DB22A;
  --green-bg:   #EEF7D9;
  --green-ink:  #3B5A0C;
  --amber-bg-2: #FFF4D6;
  --amber-ink-2:#6E4E00;
  --grey-bg:    #F1F3F1;

  /* pomelow.css names, re-pointed */
  --ink-soft:   var(--ink-2);
  --sage:       var(--slate);
  --pith:       var(--mist);
  --pith-dim:   var(--grey-bg);
  --white:      var(--paper);
  --ground:     var(--mist);
  --flesh:      var(--ink);
  --flesh-dark: var(--pomelo-ink);
  --rind:       var(--rind-v2);
  --rind-dark:  var(--green-ink);
  --amber:      #E0B23A;
  --amber-ink:  var(--amber-ink-2);
  --amber-bg:   var(--amber-bg-2);
  --ok-bg:      var(--green-bg);
  --ok-ink:     var(--green-ink);
  --off-bg:     var(--pomelo-bg);
  --off-ink:    var(--pomelo-ink);

  --display: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body:    var(--display);
  --mono:    'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

body { background: var(--mist); font-size: 14px; }
h1, h2, h3 { font-family: var(--body); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 30px; letter-spacing: -0.03em; line-height: 1.15; }
h2 { font-size: 15px; }
a { color: var(--ink); }
a:hover { color: var(--pomelo-ink); }
:focus-visible { outline-color: var(--pomelo-ink); }
.muted, .hint { color: var(--slate); font-size: 13px; }
.mono { font-family: var(--mono); }
.grow { flex: 1 1 auto; }

/* ---- 2. Buttons, forms, badges, notices (restyle of pomelow.css) --------- */
button, .btn-ghost {
  height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 500; font-size: 14px;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
button:hover, .btn-ghost:hover { background: var(--mist); color: var(--ink); text-decoration: none; }
button[type="submit"], .btn-primary {
  height: 40px; padding: 0 16px; border-radius: 8px; font-weight: 500; font-size: 14px;
  background: var(--ink); color: #fff; border: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
button[type="submit"]:hover, .btn-primary:hover { background: #1F3A2B; color: #fff; text-decoration: none; }
button.btn-ghost, button[type="submit"].btn-ghost {
  background: #fff; color: var(--ink); border: 1px solid var(--line-strong);
}
button.btn-ghost:hover, button[type="submit"].btn-ghost:hover { background: var(--mist); color: var(--ink); }
.btn-danger, button.btn-danger, button[type="submit"].btn-danger { background: #fff; color: var(--pomelo-ink); border: 1px solid #F3C2CB; }
.btn-danger:hover, button.btn-danger:hover { background: var(--pomelo-bg); color: var(--pomelo-ink); }
.btn-small, button.btn-small { height: 34px; padding: 0 12px; font-size: 13px; }
td button, form.inline button {
  height: auto; border: none; background: none; padding: 4px 2px;
  font-size: 13px; font-weight: 500; color: var(--slate);
}
td button:hover, form.inline button:hover { background: none; color: var(--pomelo-ink); }
input[type="text"], input[type="email"], input[type="password"], input:not([type]), select, textarea {
  height: 40px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px;
  font-size: 14px; background: #fff;
}
textarea { height: auto; padding: 10px 12px; }
.field label { color: var(--ink); font-weight: 500; }
.badge {
  font-family: var(--body); font-size: 11px; font-weight: 500; padding: 3px 9px;
  letter-spacing: 0; border-radius: 999px;
}
.badge.active, .badge.ready, .badge.live, .badge.ok { background: var(--green-bg); color: var(--green-ink); }
.badge.pending, .badge.soon, .badge.warn { background: var(--amber-bg-2); color: var(--amber-ink-2); }
.badge.off, .badge.error { background: var(--pomelo-bg); color: var(--pomelo-ink); }
.badge.suspended, .badge.grey { background: var(--grey-bg); color: var(--ink-3); }
.badge.plan { background: var(--pomelo-bg); color: var(--pomelo-ink); }
.dot.ready { background: var(--rind-v2); }
.dot.error { background: var(--pomelo-ink); }
.notice, .warning, .error { border-radius: 10px; font-size: 13px; }
.notice { background: var(--green-bg); color: var(--green-ink); }
.warning { background: var(--amber-bg-2); color: #4A3500; }
code { background: var(--grey-bg); font-size: 12px; }

/* cards + tables: white, hairline, 16px radius (the artboards' panels) */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 20px 22px; margin: 0 0 20px;
}
.card > h2, .card > h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; }
.danger-card { border-color: #F3C2CB; }
table { font-size: 13px; }
th {
  font-family: var(--body); font-size: 12px; font-weight: 500; text-transform: none;
  letter-spacing: 0; color: var(--slate); background: var(--mist); padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.card table { margin: 4px 0 16px; }
th:first-child, td:first-child { padding-left: 0; }
th:first-child { padding-left: 12px; }
.phead { align-items: flex-end; margin-bottom: 8px; }
.psub { font-size: 14px; color: var(--slate); margin: 0 0 24px; }
.tool-control { background: var(--mist); border-color: var(--line); }
.tool-control button { height: 26px; border-color: var(--line-strong); }

/* ---- Assistant panel (docked, right) ------------------------------------ */
.pa-assist { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.pa-assist[aria-expanded="true"] { background: var(--green-bg); border-color: var(--line-strong); }
.as-panel {
  width: 380px; flex: none; box-sizing: border-box; background: var(--paper); border-left: 1px solid var(--line);
  position: sticky; top: 60px; align-self: flex-start; height: calc(100vh - 60px);
  display: flex; flex-direction: column;
}
.as-panel[hidden] { display: none; }
.as-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.as-panel-head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.as-panel-head h2:focus { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.as-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 16px 16px; gap: 10px; }
.as-looking { margin: 0; font-size: 12px; color: var(--slate); }
.as-pn-msg { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.as-pn-msg p { margin: 0; }
.as-log { flex: 1; min-height: 0; overflow-y: auto; }
.as-pn-form { display: flex; gap: 8px; margin: 0; }
.as-pn-form input { flex: 1; min-width: 0; }
.as-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.as-thinking { display: none; margin: 0; font-size: 13px; color: var(--slate); }
.as-thinking.htmx-request { display: block; }
.as-panel .as-msg { max-width: none; }
@media (max-width: 1100px) and (min-width: 721px) { .as-panel { width: 320px; } }
@media (max-width: 720px) {
  .as-panel { position: fixed; inset: 0; width: auto; height: auto; z-index: 50; border-left: none; }
  .pa-assist span { display: none; }
}

/* ---- 3. Shell: top bar + left nav -------------------------------------- */
.pa-top {
  position: sticky; top: 0; z-index: 10;
  height: 60px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px;
}
.pa-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.pa-brand:hover { color: var(--ink); text-decoration: none; }
.pa-brand span { font-size: 18px; font-weight: 600; letter-spacing: -0.04em; }
.pa-admin { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--ink); color: #fff; }
.pa-sep { width: 1px; height: 20px; background: var(--line); }
.pa-org { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.pa-addr { font-family: var(--mono); font-size: 11px; color: var(--slate); white-space: nowrap; }
.pa-back { font-size: 13px; font-weight: 500; text-decoration: none; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.pa-back:hover { text-decoration: none; }
/* Slot the app switcher (Home's embed.js, variant=switcher) mounts into. */
.pa-apps { display: flex; flex: none; color: var(--ink); }
.pa-av {
  width: 32px; height: 32px; border-radius: 50%; background: var(--pomelo-bg); color: var(--pomelo-ink);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none;
}
.pa-body { display: flex; min-height: calc(100vh - 60px); }
.pa-nav {
  width: 248px; flex-shrink: 0; box-sizing: border-box; padding: 20px 14px;
  display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line);
}
.pa-nav a {
  height: 38px; padding: 0 12px; border-radius: 8px; display: flex; align-items: center; gap: 11px;
  font-size: 14px; color: var(--ink-2); border: 1px solid transparent; text-decoration: none;
}
.pa-nav a svg { color: var(--slate); flex: none; }
.pa-nav a:hover { background: #fff; color: var(--ink); text-decoration: none; }
.pa-nav a.active { background: #fff; border-color: var(--line); color: var(--ink); font-weight: 600; }
.pa-nav a.active svg { color: var(--ink); }
.pa-nav a.pa-sub { height: 30px; padding-left: 38px; font-size: 13px; }
.pa-nav .pa-group { font-size: 12px; color: var(--slate); padding: 14px 12px 4px; }
.pa-nav .pa-seats {
  height: auto; align-items: stretch; font-size: 13px;
  margin-top: auto; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink);
}
.pa-nav a.pa-seats:hover { text-decoration: none; color: var(--ink); border-color: var(--line-strong); }
.pa-seats-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pa-seats b { font-size: 13px; font-weight: 600; }
.pa-seats .mono { font-size: 11px; color: var(--slate); }
.pa-bar { display: block; height: 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.pa-bar span { display: block; height: 100%; background: var(--pomelo); }
.pa-nav a.pa-signout { height: auto; font-size: 12px; color: var(--slate); padding: 10px 12px 0; }
main.portal-main { flex: 1; min-width: 0; max-width: none; padding: 32px 40px 64px; }
.pa-page { max-width: 1112px; }

/* ---- 4. Admin — Home ----------------------------------------------------- */
.pa-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 24px; }
.pa-head p { margin: 6px 0 0; font-size: 14px; color: var(--slate); }
.pa-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.stat-l { font-size: 13px; color: var(--slate); }
.stat-v { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.stat-v.sm { font-size: 20px; }
.stat-f { font-size: 12px; color: var(--slate); }
.pa-row2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; min-width: 0; }
.panel-head { padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-head h2 { margin: 0; }
.panel-head .mono { font-size: 11px; color: var(--slate); }
.panel-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.todo { list-style: none; margin: 0; padding: 0; }
.todo li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.todo-ic { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; }
.todo-ic.amber { background: var(--amber-bg-2); color: var(--amber-ink-2); }
.todo-ic.pink { background: var(--pomelo-bg); color: var(--pomelo-ink); }
.todo-ic.green { background: var(--green-bg); color: var(--green-ink); }
.todo-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-tx b { font-size: 14px; font-weight: 600; }
.todo-tx span { font-size: 13px; color: var(--slate); }
.todo .btn-ghost { height: 34px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.todo-empty { padding: 16px 20px 20px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--slate); margin: 0; }
.activity { list-style: none; margin: 0; padding: 0 20px 8px; }
.activity li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.activity .adot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin-top: 7px; flex: none; }
.activity .atx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.activity .mono { font-size: 11px; color: var(--slate); }

/* ---- 5. Admin — Users ------------------------------------------------------ */
.pa-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pa-search {
  width: 300px; max-width: 100%; height: 38px; border-radius: 8px; background: #fff;
  border: 1px solid var(--line-strong); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--slate);
}
.pa-search input { flex: 1; min-width: 0; border: none !important; outline: none; height: 36px; padding: 0 !important; background: transparent; }
.fchip {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-size: 13px; font-weight: 400; color: var(--ink); display: inline-flex; align-items: center; text-decoration: none;
}
.fchip:hover { border-color: var(--line-strong); color: var(--ink); text-decoration: none; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500; }
.users-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.users-wrap.no-sel { grid-template-columns: minmax(0, 1fr); }
.utable { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.urow, .uhead { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.8fr) minmax(0, 1.1fr) minmax(0, 0.8fr); gap: 12px; align-items: center; padding: 0 20px; }
.uhead { height: 44px; background: var(--mist); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 500; color: var(--slate); }
.urow { min-height: 64px; border-bottom: 1px solid var(--line-soft); text-decoration: none; color: var(--ink); }
.urow:last-child { border-bottom: none; }
.urow:hover { background: var(--mist); color: var(--ink); text-decoration: none; }
.urow.sel { background: var(--pomelo-bg); }
.uwho { display: flex; align-items: center; gap: 12px; min-width: 0; }
.uav {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grey-bg); color: var(--ink);
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex: none;
}
.urow.sel .uav, .udetail .uav { background: var(--ink); color: #fff; }
.uname { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.uname b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uname span { font-family: var(--mono); font-size: 11px; color: var(--slate); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urow .cell { font-size: 13px; min-width: 0; }
.uempty { padding: 20px; color: var(--slate); font-size: 13px; }

.udetail {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; gap: 22px; position: sticky; top: 84px;
}
.udetail .uav { width: 52px; height: 52px; font-size: 17px; }
.ud-head { display: flex; align-items: center; gap: 14px; }
.ud-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ud-name b { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.ud-name span { font-family: var(--mono); font-size: 12px; color: var(--slate); overflow-wrap: anywhere; }
.ud-sec { display: flex; flex-direction: column; gap: 4px; }
.ud-sec-h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.ud-sec-h .mono { font-weight: 400; font-size: 11px; color: var(--slate); }
.ud-kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; min-height: 30px; }
.ud-kv > span:first-child { color: var(--ink-2); }
.ud-app { min-height: 52px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.ud-app:last-child { border-bottom: none; }
.ud-app-ic { width: 32px; height: 32px; border-radius: 8px; background: var(--pomelo-bg); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.ud-app-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ud-app-tx b { font-size: 14px; font-weight: 500; }
.ud-app-tx span { font-size: 12px; color: var(--slate); overflow-wrap: anywhere; }
.switch {
  width: 40px; height: 24px; border-radius: 999px; border: none; padding: 3px; cursor: pointer;
  background: var(--line-strong); display: flex; justify-content: flex-start; flex: none;
}
.switch[aria-checked="true"] { background: var(--ink); justify-content: flex-end; }
.switch:hover { background: #B9C2BD; }
.switch[aria-checked="true"]:hover { background: #1F3A2B; }
.switch span { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,36,25,.3); }
.ud-actions { display: flex; gap: 10px; }
.ud-actions form { flex: 1; display: flex; }
.ud-actions button { flex: 1; }
.users-note { margin: 16px 0 0; max-width: 72ch; line-height: 1.55; }
.ud-reason { margin: 2px 0 10px; font-size: 12px; color: var(--slate); line-height: 1.45; }
.ud-reason + form { margin: 0 0 10px; }

/* ---- Settings -> Activity log (portal/settings/activity.html) ------------- */
.alog-form { align-items: flex-end; }
.alog-date { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--slate); }
.alog-date input { height: 38px; }
.alog { overflow: hidden; margin-bottom: 8px; }
.alog-table { width: 100%; border-collapse: collapse; }
.alog-table th:first-child, .alog-table td:first-child { padding-left: 20px; }
.alog-table td { vertical-align: top; overflow-wrap: anywhere; }
.alog-table td.mono { font-size: 12px; color: var(--slate); white-space: nowrap; }
.alog-table tbody tr:last-child td { border-bottom: none; }
.alog-pages { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.alog-pages .mono { font-size: 11px; color: var(--slate); }
.alog-nav { display: flex; gap: 8px; }

/* ---- Apps -> Mail -> Access (portal/mail/access.html) -------------------- */
.as-choices input[type="radio"], .as-choices input[type="checkbox"] { flex: none; accent-color: var(--ink); }
.as-choices label > span { min-width: 0; }
.ma-trouble { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 20px; }
.ma-trouble form { margin: 0; }
.ma-list { margin: 4px 0 12px; padding-left: 20px; font-size: 13px; }
.ma-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- 6. Admin — Domain & mail --------------------------------------------- */
.dm-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.dm-main { min-width: 0; }
.dm-side { display: flex; flex-direction: column; gap: 20px; }
.dm-side .card { margin: 0; }
.dm-status { display: flex; flex-direction: column; gap: 20px; }
.dm-title { display: flex; align-items: center; gap: 14px; }
.dm-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--pomelo-bg); color: var(--ink); display: flex; align-items: center; justify-content: center; flex: none; }
.dm-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dm-name b { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.dm-name span { font-size: 13px; color: var(--slate); }
.steps4 { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.steps4 li { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.steps4 li.todo-step { color: var(--slate); }
.steps4 .bar { flex: 1 1 24px; min-width: 24px; height: 1px; background: var(--line); }
.steps4 .num {
  width: 26px; height: 26px; border-radius: 50%; box-sizing: border-box; font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.steps4 .done .num { background: var(--ink); color: #fff; }
.steps4 .current .num { border: 2px solid var(--pomelo); background: #fff; }
.steps4 .todo-step .num { border: 1.5px solid var(--line-strong); color: var(--slate); }
.addr-card { background: var(--ink); color: #fff; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.addr-card .mono.k { font-size: 11px; color: var(--pomelo); }
.addr-card .mono.v { font-size: 15px; overflow-wrap: anywhere; }
.addr-card p { margin: 0; font-size: 13px; line-height: 1.5; color: #9FB0A7; }

/* ---- 7. Responsive -------------------------------------------------------- */
@media (max-width: 1180px) {
  .users-wrap, .dm-grid { grid-template-columns: minmax(0, 1fr); }
  .udetail { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pa-body { flex-direction: column; }
  .pa-nav { width: auto; flex-direction: row; flex-wrap: wrap; border-right: none; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .pa-nav .pa-group, .pa-nav .pa-seats, .pa-nav a.pa-signout { display: none; }
  .pa-addr, .pa-sep, .pa-org { display: none; }
  .pa-top { padding: 0 16px; }
  main.portal-main { padding: 24px 16px 48px; }
  .pa-row2 { grid-template-columns: minmax(0, 1fr); }
  .urow, .uhead { grid-template-columns: minmax(0, 1fr) auto; }
  .urow .cell.c-role, .urow .cell.c-mail, .uhead .c-role, .uhead .c-mail { display: none; }
  .alog-table .alog-cat { display: none; }
}
@media (max-width: 520px) {
  .pa-search { width: 100%; }
  .alog-date { flex: 1 1 130px; }
  .alog-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .alog-table, .alog-table tbody, .alog-table tr, .alog-table td { display: block; width: 100%; box-sizing: border-box; }
  .alog-table tr { padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
  .alog-table tbody tr:last-child { border-bottom: none; }
  .alog-table td, .alog-table th:first-child, .alog-table td:first-child { padding: 1px 0; border: none; }
  .alog-table td[data-label="Who"]::before { content: "by "; color: var(--slate); }
  .stats { grid-template-columns: minmax(0, 1fr); }
  .pa-back span { display: none; }
  .todo li { flex-wrap: wrap; }
}

/* Add-ons screen (portal/addons.html) */
.addon-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.addon-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 10px; background: var(--mist); color: var(--ink);
}
.addon-title { flex: 1; min-width: 0; }
.addon-title h2 { font-size: 15px; font-weight: 600; margin: 0; }
.addon-title p { margin: 2px 0 0; font-size: 13px; }
.addon-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.addon-actions form { margin: 0; }
.addon-note { font-size: 12px; margin: 12px 0 0; }

/* --- Assistant (portal/assistant.html) --------------------------------- */
.as-sec { margin-bottom: 20px; }
.as-body { padding: 0 20px 20px; }
.as-meta { font-size: 12px; color: var(--slate); }
.todo li.as-done .todo-tx b { color: var(--slate); text-decoration: line-through; }
.todo li.as-dismissed { opacity: 0.6; }
.todo li form { margin: 0; }
.as-choices { border: 0; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; }
.as-choices legend { font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.as-choices label { font-size: 14px; display: flex; align-items: center; gap: 8px; }
input[type="number"] { height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; max-width: 120px; }
.as-ask { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.as-ask-row { display: flex; gap: 10px; }
.as-ask-row input { flex: 1; min-width: 0; }
.as-tools { list-style: none; margin: 0; padding: 0; }
.as-tools li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.as-tools li form { margin: 0; }
.as-tools .badge { margin-left: 6px; vertical-align: middle; }
.as-msg { padding: 10px 14px; border-radius: 12px; margin-bottom: 10px; max-width: 72ch; }
.as-msg p { margin: 0 0 6px; white-space: pre-line; }
.as-msg.user { background: var(--mist); margin-left: auto; }
.as-msg.assistant { background: var(--green-bg); }
.as-inline { display: inline; }
@media (max-width: 720px) {
  .as-sec .todo li { flex-wrap: wrap; }
  .as-sec .todo li .todo-tx { flex: 1 1 calc(100% - 48px); }
  .as-sec .todo li > a, .as-sec .todo li > form { margin-left: 48px; }
  .as-sec .todo li > a + form { margin-left: 0; }
}

/* --- Role control (portal/users/list.html) ------------------------------- */
.role-blurb { margin: 0 0 6px; }
.role-form { display: flex; flex-direction: column; gap: 10px; margin: 2px 0 0; }
.role-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.role-form legend { font-size: 12px; color: var(--slate); padding: 0; margin-bottom: 6px; }
.role-opt { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.role-opt:has(input:checked) { border-color: var(--ink); background: var(--mist); }
.role-opt input { flex: none; margin-top: 3px; accent-color: var(--ink); }
.role-opt > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.role-opt b { font-size: 13px; font-weight: 600; }
.role-opt > span > span { font-size: 12px; color: var(--slate); line-height: 1.4; }
.role-confirm { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.role-confirm input { flex: none; margin-top: 2px; accent-color: var(--ink); }
