/* Maylpot Admin Center. Layout: the Mayland Admin Center shell (240px nav on its own surface, white content, 1300px page) with the
   Figma UI3 tokens of mayland.ai's globals.css. Every field, dropdown, copy field, chip and button is one height (--ctl). */
:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fw: 450; --fw-strong: 550;
  --fs-sm: .5625rem; --lh-sm: .875rem;
  --fs-md: .6875rem; --lh-md: 1rem;
  --fs-lg: .8125rem; --lh-lg: 1.375rem;
  --fs-h-md: .9375rem; --lh-h-md: 1.5625rem;
  --fs-h-lg: 1.5rem; --lh-h-lg: 2rem;
  --r-sm: .125rem; --r-md: .3125rem; --r-lg: .8125rem; --r-full: 9999px;
  --ctl: 24px;
  --elev-100: 0 1px 3px #00000026, 0 0 .5px #0000004d;
  --elev-300: 0 1px 3px #0000001a, 0 5px 12px #00000021, 0 0 .5px #00000026;
  --elev-400: 0 2px 5px #00000026, 0 10px 16px #0000001f, 0 0 .5px #0000001f;
  --elev-500: 0 2px 5px #00000026, 0 10px 24px #0000002e, 0 0 .5px #00000014;
  --ease: cubic-bezier(.645, .045, .355, 1);
  --sidebar-w: 240px;

  /* Semantic colour, light (Mayland) */
  --bg: #ffffff; --bg-2: #f5f5f5; --bg-3: #e6e6e6; --bg-hover: #f5f5f5;
  --bg-elevated: #ffffff; --bg-th: #0000000d; --bg-disabled: #d9d9d9;
  --border: #e6e6e6; --border-2: #d9d9d9;
  --text: #000000e5; --text-2: #00000080; --text-3: #0000004d;
  --icon: #000000e5; --icon-2: #00000080; --icon-3: #0000004d;
  --ok-bg: #e0f6e5; --ok: #14ae5c; --ok-ink: #036838;
  --warn-bg: #fff1c2; --warn: #ffcd29; --warn-ink: #5c4100;
  --bad-bg: #ffe2e0; --bad: #f24822; --bad-ink: #bd2915; --bad-border: #ffc7c2;
  --menu-bg: #1e1e1e; --menu-hover: #2c2c2c; --menu-border: #383838; --menu-text: #ffffff; --menu-text-2: #ffffff80;
  --backdrop: #00000080;
  --nav-bg: #f5f6f8;
  --wordmark: #171717; --wordmark-tld: #a3a3a3;
  --ml-tile-top: #3a3a3a; --ml-tile: #0a0a0a; --ml-fg: #ffffff; --ml-fg-2: #a3a3a3;
  --white: #ffffff;

  /* Colour roles: logo variant A "white with honey" (the mockup colour widget's default), baked in.
     Dark mode changes only the primary's UI colour, the text on it and the strong accent (see below). */
  --accent: #1f1f1f; --accent-ui: #1f1f1f; --on-accent: #ffffff; --accent-strong: #1f1f1f;
  --sel-bg: #fdf3dc; --sel-ink: #1a1406; --sel-hover: #ebe1cb;
  --pot-word: #e3a60b; --pot-weight: 820;
  --tile-top: #ffffff; --tile: #f1f1ef; --pot-1: #1a1a1a; --pot-2: #f2a516;
  --accent-ground: var(--bg);
  --brand: var(--accent-ui);
  --brand-hover: color-mix(in srgb, var(--accent-ui) 88%, #000);
  --brand-pressed: color-mix(in srgb, var(--accent-ui) 76%, #000);
  --selected: color-mix(in srgb, var(--accent-ui) 18%, var(--accent-ground));
  --ring: color-mix(in srgb, var(--accent-strong) 30%, transparent);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #2c2c2c; --bg-2: #383838; --bg-3: #444444; --bg-hover: #383838;
    --bg-elevated: #1e1e1e; --bg-th: #ffffff0d; --bg-disabled: #757575;
    --border: #444444; --border-2: #4f4f4f;
    --text: #ffffff; --text-2: #ffffffb2; --text-3: #ffffff66;
    --icon: #ffffff; --icon-2: #ffffffb2; --icon-3: #ffffff66;
    --ok-bg: #2f483c; --ok: #198f51; --ok-ink: #a6e6b8;
    --warn-bg: #5c4100; --warn: #f3c11b; --warn-ink: #ffe08a;
    --bad-bg: #60332a; --bad: #e03e1a; --bad-ink: #fcb5ab; --bad-border: #864537;
    --nav-bg: #0c0f14;
    --wordmark: #ffffff; --wordmark-tld: #a3a3a3;
    --ml-tile-top: #ffffff; --ml-tile: #e8e8e8; --ml-fg: #111111; --ml-fg-2: #737373;
    --accent-ui: #ececea; --on-accent: #1a1406; --accent-strong: #797979;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #2c2c2c; --bg-2: #383838; --bg-3: #444444; --bg-hover: #383838;
  --bg-elevated: #1e1e1e; --bg-th: #ffffff0d; --bg-disabled: #757575;
  --border: #444444; --border-2: #4f4f4f;
  --text: #ffffff; --text-2: #ffffffb2; --text-3: #ffffff66;
  --icon: #ffffff; --icon-2: #ffffffb2; --icon-3: #ffffff66;
  --ok-bg: #2f483c; --ok: #198f51; --ok-ink: #a6e6b8;
  --warn-bg: #5c4100; --warn: #f3c11b; --warn-ink: #ffe08a;
  --bad-bg: #60332a; --bad: #e03e1a; --bad-ink: #fcb5ab; --bad-border: #864537;
  --nav-bg: #0c0f14;
  --wordmark: #ffffff; --wordmark-tld: #a3a3a3;
  --ml-tile-top: #ffffff; --ml-tile: #e8e8e8; --ml-fg: #111111; --ml-fg-2: #737373;
  --accent-ui: #ececea; --on-accent: #1a1406; --accent-strong: #797979;
  color-scheme: dark;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
/* The mockup ran without a doctype (quirks mode), where the mount point filled the page by itself; in standards mode it needs the height. */
#root { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw); letter-spacing: -.002rem;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.ph { line-height: 1; }
h1, h2, h3 { text-wrap: balance; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; background: var(--bg-2); padding-block: 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login-col { width: min(400px, 100%); }
.login-brand { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 18px; }
.login-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--elev-400); padding: 40px; }
.login-foot { display: flex; justify-content: center; margin-top: 18px; font-size: var(--fs-md); }
.family-line { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); }
@media (max-width: 480px) { .login-card { padding: 24px; } }

/* ---------- wordmarks ---------- */
.wordmark { display: inline-block; font-size: 18px; line-height: 1; font-weight: 650; letter-spacing: -.03em; white-space: nowrap; color: var(--wordmark); }
.wordmark .pot { color: var(--pot-word); font-weight: var(--pot-weight); }
.wordmark .tld { color: var(--wordmark-tld); }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); height: 100%; }
.sidebar { --sx: 6px; background: var(--nav-bg); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: 12px; font-size: var(--fs-md); line-height: var(--lh-md); position: relative; z-index: 5; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 20px var(--sx) 8px; }
.sb-brand .sub { display: block; margin-top: 3px; color: var(--text-3); font-size: var(--fs-md); }
.sb-scroll { flex: 1; overflow-y: auto; padding: 22px 0 8px; }
.sb-group { margin-top: 26px; }
.sb-group-label { height: 24px; display: flex; align-items: center; padding: 0 var(--sx); font-weight: var(--fw-strong); color: var(--text-2); }
.sb-item { display: flex; align-items: center; gap: 8px; height: 32px; width: 100%; padding: 0 var(--sx); border-radius: var(--r-md); color: var(--text); text-decoration: none; border: 0; background: none; text-align: left; }
.sb-item .ph { font-size: 16px; color: var(--icon-2); }
.sb-item:hover { background: var(--bg-th); }
.sb-item:hover .ph { color: var(--icon); }
.sb-item.active { background: var(--sel-bg); color: var(--sel-ink); font-weight: var(--fw-strong); }
.sb-item.active .ph { color: var(--sel-ink); }
.sb-item.active:hover { background: var(--sel-hover); }
.sb-badge { margin-left: auto; font-family: var(--mono); font-size: var(--fs-sm); font-weight: var(--fw-strong); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; display: grid; place-items: center; background: var(--bg-th); color: var(--text-2); }
.sb-item.active .sb-badge { background: color-mix(in srgb, var(--sel-ink) 12%, transparent); color: var(--sel-ink); }
.control-row { padding: 8px 0 12px; }
.agent { --a-bg: var(--bg-th); --a-ink: var(--text); --a-dot: var(--icon-3); display: flex; align-items: center; gap: 6px; width: 100%; height: var(--ctl);
  padding: 0 12px 0 var(--sx); border: 0; border-radius: var(--r-full); background: var(--a-bg); color: var(--a-ink); font-size: var(--fs-md); font-weight: var(--fw-strong); }
.agent .ph { font-size: 16px; }
.agent .ph-caret-up { margin-left: auto; font-size: 12px; opacity: .7; }
.agent[data-tone="connected"] { --a-bg: var(--ok-bg); --a-ink: var(--ok-ink); --a-dot: var(--ok); }
.agent:hover { background-image: linear-gradient(var(--bg-th), var(--bg-th)); }
.agent-dot { width: 6px; height: 6px; margin: 0 2px 0 4px; border-radius: 50%; background: var(--a-dot); flex-shrink: 0; }
.iconbtn { width: 24px; height: 24px; display: grid; place-items: center; flex-shrink: 0; border: 0; padding: 0; background: none; border-radius: var(--r-md); color: var(--icon-2); }
.iconbtn:hover { background: var(--bg-th); color: var(--icon); }
.iconbtn .ph { font-size: 16px; }
.iconbtn.lg { width: 28px; height: 28px; }
.sb-foot { border-top: 1px solid var(--border); padding: 10px 0; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
.sb-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border: 0; background: none; border-radius: var(--r-md); text-align: left; }
.sb-user:hover { background: var(--bg-th); }
.sb-user .who { min-width: 0; display: grid; }
.sb-user .nm { font-size: var(--fs-lg); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user .em { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* avatars: a photo, or grey initials */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; font-weight: var(--fw-strong); font-size: var(--fs-md);
  color: var(--text-2); background: var(--bg-3); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); }
.mobile-bar { display: none; }
.content { flex: 1; min-height: 0; overflow-y: auto; }
.page { max-width: 1300px; margin: 0 auto; padding-block: 28px 120px; padding-left: max(30px, env(safe-area-inset-left, 0px)); padding-right: max(30px, env(safe-area-inset-right, 0px)); }
.page.narrow { max-width: 960px; margin: 0; }
.backdrop-nav { display: none; }
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: var(--elev-500); padding-top: env(safe-area-inset-top, 0px); }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .backdrop-nav { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 4; border: 0; }
  .mobile-bar { display: flex; align-items: center; gap: 10px; height: 48px; border-bottom: 1px solid var(--border); background: var(--nav-bg);
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); font-size: var(--fs-md); font-weight: var(--fw-strong); }
  .page { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-top: 20px; }
}

/* ---------- page primitives ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.page-title { margin: 0; flex: 1 1 auto; font-size: var(--fs-h-lg); line-height: var(--lh-h-lg); letter-spacing: -.0255rem; font-weight: var(--fw-strong); }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.spacer { flex: 1 1 auto; }
.t-md { font-size: var(--fs-md); line-height: var(--lh-md); }
.t-2 { color: var(--text-2); }
.t-3 { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: var(--fs-md); }
.h-sm { font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-strong); margin: 0; }
.num { font-variant-numeric: tabular-nums; }

/* one control height for buttons, fields, dropdowns, copy fields, chips and segments */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--ctl); padding: 0 8px; border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; font-size: var(--fs-md); line-height: 1; white-space: nowrap; color: var(--text); text-decoration: none; flex-shrink: 0; transition: background .1s var(--ease), border-color .1s var(--ease); }
.btn .ph { font-size: 16px; }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--brand); color: var(--on-accent); font-weight: var(--fw-strong); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-primary:active { background: var(--brand-pressed); }
.btn-secondary { border-color: var(--border); }
.btn-ghost { padding: 0 6px; }
.btn-ghost:hover { background: var(--bg-th); }
.btn-danger { border-color: var(--bad-border); color: var(--bad-ink); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-block { width: 100%; }
.text-action { border: 0; background: none; padding: 0; font-size: var(--fs-md); font-weight: var(--fw-strong); color: var(--text); text-decoration: underline; text-decoration-color: var(--accent-strong); text-underline-offset: 3px; white-space: nowrap; }
.text-action:hover { text-decoration-thickness: 2px; }
.input { display: flex; align-items: center; gap: 6px; width: 100%; height: var(--ctl); padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg); font-size: var(--fs-md); color: var(--text); outline: none; }
.input:hover { border-color: var(--border-2); }
.input:focus, .input:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--ring); }
.input > input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: 0; height: 100%; font-size: inherit; }
.input .ph { color: var(--icon-2); font-size: 16px; flex-shrink: 0; }
.input::placeholder, .input > input::placeholder { color: var(--text-3); }
.input .affix { color: var(--text-3); flex-shrink: 0; }
.input.readonly { background: var(--bg-2); color: var(--text-2); }
.input[aria-invalid="true"], .input:has(input[aria-invalid="true"]) { border-color: var(--bad); box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 20%, transparent); }
.search { width: 240px; max-width: 100%; }
.login-card .input, .login-card .btn { height: 32px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > label, .field > .lbl { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-strong); color: var(--text-2); }
.field .hint { font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-3); }
.form { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; align-items: start; }
@media (max-width: 520px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }
.fg-select { display: flex; align-items: center; width: 100%; min-width: 0; height: var(--ctl); padding: 0 24px 0 8px; border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--bg) no-repeat right 8px center / 10px 10px; text-align: left; font-size: var(--fs-md); color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23757575' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.fg-select-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fg-select[data-placeholder] .fg-select-label { color: var(--text-3); }
.fg-select:hover { border-color: var(--border-2); background-color: var(--bg-2); }
.fg-select[aria-expanded="true"], .fg-select:focus-visible { border-color: var(--accent-strong); outline: none; box-shadow: 0 0 0 2px var(--ring); }
.copyfield { position: relative; min-width: 0; }
.copyfield input { width: 100%; height: var(--ctl); padding: 0 28px 0 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); font-family: var(--mono); font-size: var(--fs-md); color: var(--text); outline: none; }
.copyfield input:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--ring); }
.copyfield .btns { position: absolute; right: 2px; top: 2px; display: flex; gap: 2px; }
.copyfield .btns .iconbtn { width: 20px; height: 20px; }
.copyfield .btns .iconbtn .ph { font-size: 14px; }
.copyfield.pw input { padding-right: 72px; letter-spacing: .02em; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: var(--ctl); padding: 0 4px 0 8px; border: 1px solid transparent; border-radius: var(--r-md);
  background: var(--bg-2); color: var(--text); font-size: var(--fs-md); white-space: nowrap; max-width: 240px; }
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip .ph { font-size: 12px; color: var(--icon-2); flex-shrink: 0; }
.chip:hover { background: var(--bg-3); }
.chip[data-on] { background: var(--sel-bg); color: var(--sel-ink); font-weight: var(--fw-strong); }
.chip[data-on] .ph { color: var(--sel-ink); }
.chip[data-on]:hover { background: var(--sel-hover); }
.seg { display: inline-flex; border-radius: var(--r-md); background: var(--bg-2); flex-shrink: 0; }
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 29px; height: var(--ctl); padding: 0 8px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--text-2); font-size: var(--fs-md); }
.seg button .ph { font-size: 16px; }
.seg button:hover { color: var(--text); }
.seg button:disabled { opacity: .45; pointer-events: none; }
.seg button[aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: var(--elev-100); font-weight: var(--fw-strong); }
.seg.icon button { padding: 0; width: 29px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 20px; }
.resultbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 16px; min-height: var(--ctl); }
.count { font-size: var(--fs-md); color: var(--text-2); font-variant-numeric: tabular-nums; }

/* pills: one height, centred text; .sec takes the secondary colour, .brand a tint of the primary */
.pill { --c-bg: var(--bg-2); --c-ink: var(--text-2); display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: var(--r-full); font-size: var(--fs-md); line-height: 1; white-space: nowrap; background: var(--c-bg); color: var(--c-ink); vertical-align: middle; }
.pill .ph { font-size: 12px; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-dot, currentColor); flex-shrink: 0; }
.pill.ok { --c-bg: var(--ok-bg); --c-ink: var(--ok-ink); --c-dot: var(--ok); }
.pill.warn { --c-bg: var(--warn-bg); --c-ink: var(--warn-ink); --c-dot: var(--warn); }
.pill.brand { --c-bg: var(--selected); --c-ink: var(--text); }
.pill.sec { --c-bg: var(--sel-bg); --c-ink: var(--sel-ink); }
.pill.w { min-width: 84px; }
.pill.ws { min-width: 68px; }

/* tags with a permanent remove button: nothing moves on hover */
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 2px 0 8px; border-radius: var(--r-md); background: var(--bg-2); font-size: var(--fs-md); white-space: nowrap; }
.tag .g { color: var(--text-3); }
.tag .x { width: 20px; height: 20px; display: grid; place-items: center; border: 0; padding: 0; background: none; border-radius: 4px; color: var(--icon-3); }
.tag .x:hover { background: var(--bg-3); color: var(--icon); }
.tag .x .ph { font-size: 12px; }
.tag.plain { padding-right: 8px; }
.tag-add { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px dashed var(--border-2); border-radius: var(--r-md); background: none; color: var(--text-2); font-size: var(--fs-md); }
.tag-add:hover { color: var(--text); border-color: var(--text-3); }
.tag-add .ph { font-size: 12px; }
.switch { position: relative; width: 28px; height: 16px; border-radius: 8px; background: var(--bg-disabled); border: 0; padding: 0; flex-shrink: 0; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: var(--elev-100); transition: transform .15s var(--ease); }
.switch[aria-checked="true"] { background: var(--brand); }
.switch[aria-checked="true"]::after { transform: translateX(12px); }

/* table */
.table-wrap { border: 1px solid var(--border); border-radius: var(--r-lg); overflow-x: auto; background: var(--bg); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); line-height: var(--lh-md); }
.table th { height: 32px; padding: 0 12px; text-align: left; font-weight: var(--fw-strong); color: var(--text-2); white-space: nowrap; border-bottom: 1px solid var(--border); background: var(--bg); }
.table th.sort { cursor: pointer; user-select: none; }
.table th.sort:hover { color: var(--text); }
.table th .ph { font-size: 12px; vertical-align: -1px; margin-left: 2px; }
.table td { height: 48px; padding: 6px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr.click { cursor: pointer; }
.table .muted { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .act { text-align: right; white-space: nowrap; width: 1%; }
.table .act .row { justify-content: flex-end; flex-wrap: nowrap; gap: 4px; }
.ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ident .nm { font-weight: var(--fw-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ident .sub { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr.dim td { color: var(--text-3); }
tr.dim .nm { color: var(--text-2); }

/* brand icon: the logo contained on a light square, else a monogram (Mayland BrandIcon) */
.bicon { display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 3px; overflow: hidden; background: var(--white); box-shadow: inset 0 0 0 1px #0000001a; }
.bicon img { width: 100%; height: 100%; object-fit: contain; display: block; }
.bicon.mono { color: #fff; font-weight: 600; letter-spacing: -.02em; }

/* dark menu (Mayland .fg-menu): names only, left-aligned, the chosen one ticked at the right */
.menu { position: fixed; z-index: 95; min-width: 180px; max-height: 360px; display: flex; flex-direction: column; padding: 6px; border-radius: var(--r-lg);
  background: var(--menu-bg); color: var(--menu-text); border: 1px solid var(--menu-border); box-shadow: var(--elev-400); font-size: var(--fs-md); animation: pop .1s ease-out; }
.menu-list { overflow-y: auto; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--menu-border) transparent; }
.menu-search { display: flex; align-items: center; gap: 8px; height: var(--ctl); margin: -6px -6px 6px; padding: 0 10px; border-bottom: 1px solid var(--menu-border); color: var(--menu-text-2); flex-shrink: 0; }
.menu-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--menu-text); font-size: var(--fs-md); }
.menu-search input::placeholder { color: var(--menu-text-2); }
.menu-head { padding: 8px 8px 4px; color: var(--menu-text-2); font-weight: var(--fw-strong); }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; height: 24px; padding: 0 8px; border: 0; background: none; border-radius: var(--r-md); color: var(--menu-text); text-align: left; white-space: nowrap; }
.menu-item > .ph { font-size: 16px; }
.menu-item .ml { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.menu-item .sel { margin-left: 8px; font-size: 12px; }
.menu-item.strong .ml { font-weight: var(--fw-strong); }
.menu-item.on { background: #ffffff14; }
.menu-item:hover, .menu-item:focus-visible { background: var(--menu-hover); outline: none; }
.menu-item.danger { color: #fcb5ab; }
.menu-sep { height: 1px; margin: 6px 0; background: var(--menu-border); border: 0; flex-shrink: 0; }
.menu-note { padding: 4px 8px 2px; color: var(--menu-text-2); white-space: normal; line-height: 1.45; max-width: 260px; }
@keyframes pop { from { opacity: 0; transform: translateY(2px); } }
/* light popover for the date picker */
.popover { background: var(--bg-elevated); color: var(--text); border-color: var(--border); padding: 0; max-height: none; }
.dp { display: flex; min-width: 0; }
.dp-presets { display: flex; flex-direction: column; gap: 2px; flex: 0 0 140px; padding: 8px; border-right: 1px solid var(--border); }
.dp-presets button { height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; text-align: left; font-size: var(--fs-md); color: var(--text); }
.dp-presets button:hover { background: var(--bg-hover); }
.dp-presets button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-ink); font-weight: var(--fw-strong); }
.dp-main { flex: 1; min-width: 0; padding: 12px 14px 14px; display: grid; gap: 10px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; height: var(--ctl); }
.dp-head b { font-size: var(--fs-lg); font-weight: var(--fw-strong); }
.dp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 34px; row-gap: 2px; }
.dp-wd { display: grid; place-items: center; font-size: var(--fs-md); font-weight: var(--fw-strong); color: var(--text-3); }
.dp-cell { display: grid; place-items: center; }
.dp-cell[data-range] { background: var(--sel-bg); }
.dp-cell[data-start] { border-radius: 50% 0 0 50%; }
.dp-cell[data-end] { border-radius: 0 50% 50% 0; }
.dp-cell[data-start][data-end] { border-radius: 50%; }
.dp-day { position: relative; width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; font-size: var(--fs-md); color: var(--text); }
.dp-day:hover { background: var(--bg-hover); }
.dp-day[data-today]::after { content: ""; position: absolute; left: calc(50% - 2px); bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-strong); }
.dp-day[data-edge], .dp-day[data-edge]:hover { background: var(--brand); color: var(--on-accent); font-weight: var(--fw-strong); }
.dp-day:disabled { color: var(--text-3); pointer-events: none; }
.dp-foot { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.dp-foot .field { flex: 1 1 110px; }
@media (max-width: 560px) { .dp-presets { display: none; } }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--backdrop);
  padding-block: max(24px, env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); animation: fade .15s ease-out; }
.modal { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--elev-500); width: min(560px, 100%); max-height: 100%;
  display: flex; flex-direction: column; overflow: hidden; animation: rise .2s var(--ease); }
.modal.sm { width: min(440px, 100%); }
.modal.sheet { width: min(720px, 100%); height: min(620px, 100%); }
.modal.xl { width: min(1240px, 100%); height: 100%; }
.modal-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); }
.modal-head .title { font-size: var(--fs-lg); font-weight: var(--fw-strong); flex: 1; min-width: 0; }
.modal-head .tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.modal-head .vr { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.modal-body { padding: 20px; overflow-y: auto; min-height: 0; flex: 1; }
.modal-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.modal-foot .spacer { flex: 1; }
.modal-wrap.still, .modal-wrap.still .modal { animation: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px) scale(.99); } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
.tabs { display: inline-flex; gap: 4px; }
.tabs button { height: 24px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--text-2); font-size: var(--fs-md); }
.tabs button:hover { background: var(--bg-hover); color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--bg-2); color: var(--text); font-weight: var(--fw-strong); }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 99; display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: var(--r-lg); background: var(--menu-bg); color: var(--menu-text); font-size: var(--fs-md); box-shadow: var(--elev-400); animation: rise .2s var(--ease); max-width: calc(100% - 32px); }
.toast .ph { color: #7cd797; font-size: 16px; }

/* ---------- Browse: Mayland's stable masonry; each rendering is cropped to the mail, so the mail fills its tile ---------- */
.masonry { display: flex; align-items: flex-start; min-width: 0; }
.mcol { flex: 1 1 0; min-width: 0; display: grid; align-content: start; }
.tile { position: relative; display: grid; gap: 8px; align-content: start; min-width: 0; }
.media { position: relative; min-width: 0; }
.open { display: block; width: 100%; padding: 0; border: 0; border-radius: var(--r-md); background: none; cursor: pointer; }
.crop { position: relative; display: block; width: 100%; max-width: 100%; overflow: hidden; border-radius: var(--r-md); background: #fff; box-shadow: var(--elev-100); transition: box-shadow .2s ease-out; }
.crop img { display: block; max-width: none; height: auto; }
.tile:hover .crop { box-shadow: var(--elev-300); }
.open:focus-visible { outline: none; }
.open:focus-visible .crop { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.tstatus { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.tbadge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: var(--r-md); font-size: var(--fs-md); font-weight: var(--fw-strong);
  color: var(--sel-ink); background: var(--sel-bg); box-shadow: var(--elev-100); }
.tbadge .ph { font-size: 12px; }
.tbadge.disc { margin-left: auto; background: var(--brand); color: var(--on-accent); }
.ttext { display: grid; gap: 2px; min-width: 0; padding: 0 2px; }
.ttitle { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-md); }
.tmeta .bn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta .dt { margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.mini-thumb { width: 36px; flex-shrink: 0; }
.mini-thumb .crop { border-radius: 4px; }
.empty { padding: 48px 16px; text-align: center; color: var(--text-2); font-size: var(--fs-md); display: grid; justify-items: center; gap: 10px; }

/* ---------- mail detail ---------- */
.detail { display: grid; grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); min-height: 0; flex: 1; }
.leftpane { display: flex; flex-direction: column; min-height: 0; background: var(--bg-2); border-right: 1px solid var(--border); }
.leftbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.leftscroll { overflow-y: auto; min-height: 0; flex: 1; padding: 16px; }
.html-wrap { position: relative; width: 100%; min-height: 200px; overflow: hidden; border-radius: 6px; box-shadow: var(--elev-100); background: #fff; }
.html-wrap iframe { position: absolute; top: 0; left: 0; width: 640px; height: 4000px; border: 0; transform-origin: 0 0; background: #fff; }
.gif-card { display: grid; gap: 8px; margin: 0; }
.gif-card img { width: 100%; display: block; border-radius: 6px; box-shadow: var(--elev-100); }
.leftnote { display: grid; gap: 8px; justify-items: start; padding: 16px; border-radius: var(--r-md); background: var(--bg); color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-md); }
.leftnote b { font-weight: var(--fw-strong); color: var(--text); }
.facts { position: relative; overflow-y: auto; min-height: 0; padding: 0 28px 48px; }
.facts-head { padding-top: 20px; }
.facts-head h2 { margin: 0; font-size: var(--fs-h-md); line-height: var(--lh-h-md); font-weight: var(--fw-strong); letter-spacing: -.005rem; }
.facts-head .pre { margin: 2px 0 0; color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-md); }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.anchors { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; overflow-x: auto; padding: 12px 0 10px; margin-top: 8px; background: var(--bg); border-bottom: 1px solid var(--border); scrollbar-width: none; }
.anchors button { flex-shrink: 0; height: 24px; padding: 0 10px; border: 0; border-radius: var(--r-md); background: none; color: var(--text-2); font-size: var(--fs-md); }
.anchors button:hover { background: var(--bg-hover); color: var(--text); }
.anchors button.on { background: var(--bg-2); color: var(--text); font-weight: var(--fw-strong); }
.dsec { padding: 24px 0 4px; scroll-margin-top: 56px; }
.dsec + .dsec { border-top: 1px solid var(--border); margin-top: 20px; }
.sec-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: var(--fs-lg); line-height: var(--lh-lg); font-weight: var(--fw-strong); }
.sec-title > .ph { font-size: 16px; color: var(--accent-strong); }
.sec-title .aside { margin-left: auto; font-size: var(--fs-md); font-weight: var(--fw); color: var(--text-2); }
.sec-lead { margin: -6px 0 14px; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); max-width: 72ch; }
.summary { margin: 0 0 18px; font-size: var(--fs-lg); line-height: 1.6; max-width: 72ch; }
.kv { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 10px 20px; margin: 0; font-size: var(--fs-md); line-height: var(--lh-md); }
.kv dt { color: var(--text-2); padding-top: 4px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: var(--ctl); }
.kv dd.text { display: block; padding-top: 4px; min-height: 0; }
.kv .quote { font-size: var(--fs-lg); line-height: 1.55; }
.yes, .no { display: inline-flex; align-items: center; gap: 4px; }
.yes .ph { color: var(--ok); } .no .ph { color: var(--icon-3); }
.blocks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.blocks li { display: grid; grid-template-columns: 22px 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 30px; padding: 3px 8px; border-radius: var(--r-md); font-size: var(--fs-md); }
.blocks li:nth-child(odd) { background: var(--bg-2); }
.blocks .ix { font-family: var(--mono); color: var(--text-3); font-size: var(--fs-sm); text-align: right; }
.blocks li > .ph { font-size: 15px; color: var(--icon-2); }
.blocks .ctas { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.blocks li:nth-child(odd) .tag { background: var(--bg); }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; box-shadow: inset 0 0 0 1px #0000002a; vertical-align: -3px; flex-shrink: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.swatches figure { margin: 0; display: grid; gap: 4px; justify-items: start; font-size: var(--fs-md); }
.swatches .big { width: 56px; height: 40px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px #0000001f; }
.pre-box { margin: 0; padding: 12px; max-height: 360px; overflow: auto; border-radius: var(--r-md); background: var(--bg-2); font-family: var(--mono); font-size: var(--fs-md); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.similar { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.note { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--bg-2); font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text); }
.note > .ph { font-size: 16px; color: var(--icon-2); flex-shrink: 0; }
.note > span { flex: 1; min-width: 0; }
.legend { margin: 8px 0 0; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.star { color: var(--accent-strong); font-size: 14px; }
@media (max-width: 860px) {
  .detail { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .leftpane { max-height: 52vh; border-right: 0; border-bottom: 1px solid var(--border); }
  .facts { overflow: visible; padding: 0 16px 32px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dt { margin-top: 10px; }
}

/* ---------- dialogs ---------- */
.role-opts { display: grid; gap: 8px; }
.role-opt { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; }
.role-opt:hover { border-color: var(--border-2); }
.role-opt:has(input:checked) { border-color: var(--accent-strong); background: var(--selected); }
.role-opt input { margin: 3px 0 0; accent-color: var(--accent-strong); }
.role-opt b { font-weight: var(--fw-strong); font-size: var(--fs-md); }
.role-opt span span { display: block; color: var(--text-2); font-size: var(--fs-md); line-height: var(--lh-md); margin-top: 1px; }
.callout { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--selected); font-size: var(--fs-md); line-height: var(--lh-md); }
.callout .ph { font-size: 16px; color: var(--accent-strong); flex-shrink: 0; }
.code { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--menu-bg); color: #e6e6e6; font-family: var(--mono); font-size: var(--fs-md); line-height: 1.6; overflow-x: auto; white-space: pre; }
/* profile sheet: rows like Mayland's .fg-dialog-section */
.psec { display: flex; align-items: center; gap: 16px; padding: 18px 0; }
.psec + .psec { border-top: 1px solid var(--border); }
.psec:first-child { padding-top: 0; }
.psec .pmain { flex: 1; min-width: 0; display: grid; gap: 4px; }
.psec h3 { margin: 0; font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-strong); }
.psec p { margin: 0; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); }
.psec .edit { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.psec .edit .input { max-width: 280px; }
.psec .acts { display: flex; gap: 14px; align-items: center; }
.avatar-btn { padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; line-height: 0; position: relative; flex-shrink: 0; }
.avatar-btn .cam { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); box-shadow: var(--elev-100); color: var(--icon); }
.avatar-btn .cam .ph { font-size: 12px; }
.crop-view { position: relative; width: 240px; height: 240px; border-radius: 50%; overflow: hidden; background: var(--bg-2); cursor: grab; touch-action: none; box-shadow: inset 0 0 0 1px var(--border); }
.crop-view img { position: absolute; max-width: none; user-select: none; pointer-events: none; }
.crop-view:active { cursor: grabbing; }
.zoom-row { display: flex; align-items: center; gap: 8px; width: 240px; }
.zoom-row input { flex: 1; accent-color: var(--accent-strong); }

/* ---------- settings: one card per area, label column + control column, autosave ---------- */
.autosave { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--text-2); }
.autosave .ph { font-size: 14px; color: var(--ok); }
.autosave[data-state="saving"] .ph { color: var(--icon-2); animation: spin 1s linear infinite; }
.autosave[data-state="error"] { color: var(--bad-ink); } .autosave[data-state="error"] .ph { color: var(--bad); }
@keyframes spin { to { transform: rotate(1turn); } }
.cards { display: grid; gap: 20px; margin-top: 24px; }
.card { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg); }
.card-head { display: flex; align-items: center; gap: 8px 12px; min-height: 48px; padding: 10px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head .h-sm { flex: 1 1 auto; }
.srow { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 8px 24px; padding: 16px 20px; align-items: start; }
.srow + .srow { border-top: 1px solid var(--border); }
.srow .lbl { padding-top: 3px; }
.srow .lbl b { display: block; font-size: var(--fs-md); line-height: var(--lh-md); font-weight: var(--fw-strong); }
.srow .lbl span { display: block; margin-top: 2px; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); }
.srow .ctl { display: grid; gap: 8px; min-width: 0; max-width: 480px; }
.srow .ctl .row { flex-wrap: nowrap; }
.result { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); }
.result .ph { font-size: 14px; }
.result.ok .ph { color: var(--ok); }
.meter { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.tagbox { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: var(--ctl); padding: 2px 3px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.tagbox .tag { height: 18px; }
.tagbox .tag .x { width: 16px; height: 16px; }
.tagbox:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--ring); }
.tagbox input { flex: 1 1 140px; min-width: 120px; height: 18px; border: 0; background: none; outline: none; padding: 0 6px; font-size: var(--fs-md); }
@media (max-width: 720px) { .srow { grid-template-columns: minmax(0, 1fr); } .srow .lbl { padding-top: 0; } }

/* ---------- API guide ---------- */
.api-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; margin-top: 24px; padding: 20px; border: 1px solid var(--border); border-radius: var(--r-lg); }
.api-hero .lbl { font-size: var(--fs-md); font-weight: var(--fw-strong); color: var(--text-2); margin-bottom: 6px; }
.api-url { display: flex; align-items: center; gap: 8px; min-width: 0; }
.api-url code { font-family: var(--mono); font-size: 18px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.api-facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.api-sub { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); color: var(--text-3); }
.api-sub a { color: inherit; }
@media (max-width: 760px) { .api-hero { grid-template-columns: minmax(0, 1fr); } .api-facts { justify-content: flex-start; } .api-url code { font-size: 15px; } }

/* Swagger UI in Maylpot tokens */
#swagger { margin-top: 24px; }
.swagger-ui, .swagger-ui .opblock-tag, .swagger-ui .opblock .opblock-summary-path, .swagger-ui .opblock .opblock-summary-description, .swagger-ui .opblock-description-wrapper p,
.swagger-ui .markdown p, .swagger-ui .renderedMarkdown p, .swagger-ui table thead tr td, .swagger-ui table thead tr th, .swagger-ui .parameter__name, .swagger-ui .parameter__type,
.swagger-ui .parameter__in, .swagger-ui .response-col_status, .swagger-ui .response-col_links, .swagger-ui .tab li, .swagger-ui .opblock .opblock-section-header h4,
.swagger-ui label, .swagger-ui .model-title, .swagger-ui .model, .swagger-ui .prop-type, .swagger-ui .responses-inner h4, .swagger-ui .responses-inner h5,
.swagger-ui .btn, .swagger-ui section.models h4, .swagger-ui .dialog-ux .modal-ux-header h3, .swagger-ui .dialog-ux .modal-ux-content p, .swagger-ui .dialog-ux .modal-ux-content h4 {
  font-family: var(--font) !important; color: var(--text); }
.swagger-ui .wrapper { padding: 0; max-width: none; }
.swagger-ui .svg-assets { position: absolute; width: 0; height: 0; overflow: hidden; }
.swagger-ui .information-container, .swagger-ui .scheme-container { display: none; }
.swagger-ui .opblock-tag { border-bottom: 1px solid var(--border); font-size: var(--fs-h-md); font-weight: var(--fw-strong); padding: 12px 0 10px; margin: 0 0 10px; }
.swagger-ui .opblock-tag small { font-size: var(--fs-md); color: var(--text-2); font-weight: var(--fw); padding: 0 12px; }
.swagger-ui .opblock-tag svg, .swagger-ui .expand-operation svg, .swagger-ui .opblock-control-arrow svg { fill: var(--icon-2); }
.swagger-ui .opblock { border-radius: var(--r-lg); box-shadow: none; border: 1px solid var(--border) !important; background: var(--bg) !important; margin: 0 0 6px; overflow: hidden; }
.swagger-ui .opblock .opblock-summary { border: 0 !important; padding: 6px 10px; }
.swagger-ui .opblock .opblock-summary:hover { background: var(--bg-hover); }
.swagger-ui .opblock .opblock-summary-method { min-width: 62px; padding: 4px 0; border-radius: var(--r-md); font-family: var(--mono); font-size: 10px; font-weight: 600; text-shadow: none; }
.swagger-ui .opblock.opblock-get .opblock-summary-method { background: var(--selected); color: var(--text); }
.swagger-ui .opblock.opblock-post .opblock-summary-method { background: var(--sel-bg); color: var(--sel-ink); }
.swagger-ui .opblock.opblock-patch .opblock-summary-method { background: var(--warn-bg); color: var(--warn-ink); }
.swagger-ui .opblock.opblock-delete .opblock-summary-method { background: var(--bad-bg); color: var(--bad-ink); }
.swagger-ui .opblock .opblock-summary-path { font-family: var(--mono) !important; font-size: 12px; font-weight: 500; }
.swagger-ui .opblock .opblock-summary-description { font-size: var(--fs-md); color: var(--text-2); }
.swagger-ui .opblock .opblock-section-header { background: var(--bg-2); box-shadow: none; padding: 6px 16px; min-height: 0; }
.swagger-ui .opblock-description-wrapper p, .swagger-ui .renderedMarkdown p { font-size: var(--fs-md); line-height: 1.6; color: var(--text-2); }
.swagger-ui table thead tr th, .swagger-ui table thead tr td { font-size: var(--fs-md); border-bottom: 1px solid var(--border); color: var(--text-2); }
.swagger-ui .parameter__name { font-family: var(--mono) !important; font-size: var(--fs-md); }
.swagger-ui .parameter__type, .swagger-ui .parameter__in { color: var(--text-3); font-size: var(--fs-sm); }
.swagger-ui .parameter__name.required::after, .swagger-ui .parameter__name.required span { color: var(--bad-ink); }
.swagger-ui .btn { border-radius: var(--r-md); box-shadow: none; font-size: var(--fs-md); font-weight: var(--fw-strong); border: 1px solid var(--border); background: var(--bg); height: var(--ctl); padding: 0 12px; }
.swagger-ui .btn:hover { box-shadow: none; background: var(--bg-hover); }
.swagger-ui .btn.execute { background: var(--brand); color: var(--on-accent); border-color: transparent; }
.swagger-ui .btn.cancel { border-color: var(--bad-border); color: var(--bad-ink); }
.swagger-ui input[type=text], .swagger-ui input[type=password], .swagger-ui input[type=search], .swagger-ui select {
  height: var(--ctl); padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-md); box-shadow: none; }
.swagger-ui textarea { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); color: var(--text); font-family: var(--mono); font-size: var(--fs-md); }
.swagger-ui .response-col_status { font-family: var(--mono) !important; font-size: var(--fs-md); }
.swagger-ui .responses-inner { padding: 12px 16px; }
.swagger-ui .model-box { background: var(--bg-2); border-radius: var(--r-md); }
.swagger-ui .microlight { border-radius: var(--r-md); font-size: var(--fs-md) !important; }
.swagger-ui .tab li button.tablinks { color: inherit; }
.swagger-ui .prop-format { color: var(--text-3); }
.swagger-ui .copy-to-clipboard { background: var(--bg-3); }


/* ---------- live app additions (states the mockup did not need) ---------- */
.toast.bad .ph { color: #fcb5ab; }
.agent[data-tone="offline"] { --a-bg: var(--warn-bg); --a-ink: var(--warn-ink); --a-dot: var(--warn); }
.loadmore { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 28px; }
.ro { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-3); }
.ro .ph { font-size: 12px; }
.form-err { margin: 0; color: var(--bad-ink); font-size: var(--fs-md); line-height: var(--lh-md); }
.connect-links { display: grid; gap: 6px; justify-items: center; text-align: center; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); }
.connect-links a.text-action { display: inline-block; }
.hints { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: var(--fs-md); line-height: var(--lh-md); color: var(--text-2); }
.status-line { margin: 0; text-align: center; font-size: var(--fs-md); color: var(--text-3); }
.agent-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.agent-row + .agent-row { border-top: 1px solid var(--border); }
.agent-row .pmain { flex: 1; min-width: 0; display: grid; gap: 2px; }
.agent-list { display: grid; margin-top: 4px; }
