/*
 * 2Brain Cortex brand layer — warm workspace edition.
 * The workspace speaks the login's language: a night sidebar with gold light on
 * the left, a warm ivory work surface on the right, gold ink for accents and
 * dark ink for actions. Surfaces stay light and calm for long work sessions.
 */

:root {
  color-scheme: light;
  --cortex-bg: #f7f3ea;
  --cortex-bg-2: #efe8da;
  --cortex-surface: #fffdf8;
  --cortex-surface-2: #fbf7ef;
  --cortex-surface-3: #f3ecdf;
  --cortex-text: #1d1a14;
  --cortex-muted: #6b6252;
  --cortex-dim: #978c78;
  --cortex-line: rgba(80, 60, 30, 0.1);
  --cortex-line-strong: rgba(80, 60, 30, 0.17);
  /* The accent slot keeps its old name; the warm edition fills it with gold ink. */
  --cortex-blue: #9a6a12;
  --cortex-blue-soft: #f6ecd6;
  --cortex-green: #23845b;
  --cortex-red: #c63d43;
  --cortex-gold: #ffc75a;
  --cortex-gold-ink: #9a6a12;
  --cortex-ink: #1d1a14;
  --cortex-ink-fill: linear-gradient(180deg, #2b251c, #16130e);
  --cortex-night: #100e0c;
  --cortex-night-text: #f2ecdd;
  --cortex-night-muted: #8a8171;
  --cortex-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --cortex-shadow: 0 1px 2px rgba(60, 40, 10, 0.04), 0 14px 42px rgba(60, 40, 10, 0.07);
  --cortex-shadow-hover: 0 3px 8px rgba(60, 40, 10, 0.05), 0 22px 56px rgba(60, 40, 10, 0.11);
  --cortex-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", sans-serif;

  --apple-bg: var(--cortex-bg);
  --apple-surface: rgba(255, 253, 248, 0.9);
  --apple-surface-solid: var(--cortex-surface);
  --apple-raised: var(--cortex-surface-2);
  --apple-text: var(--cortex-text);
  --apple-secondary: var(--cortex-muted);
  --apple-tertiary: var(--cortex-dim);
  --apple-line: var(--cortex-line);
  --apple-line-strong: var(--cortex-line-strong);
  --apple-honey: #9a6a12;
  --apple-honey-deep: #7d5409;
  --apple-blue: var(--cortex-blue);
  --apple-green: var(--cortex-green);
  --apple-red: var(--cortex-red);
  --apple-shadow: var(--cortex-shadow);
  --apple-shadow-hover: var(--cortex-shadow-hover);
  --display: var(--cortex-font);
  --text: var(--cortex-font);
  --serif: var(--cortex-font);
  --sans: var(--cortex-font);
  --ink: var(--cortex-text);
  --ink-2: #3f3a30;
  --paper: var(--cortex-bg);
  --paper-bright: var(--cortex-surface);
  --paper-deep: var(--cortex-bg-2);
  --line: var(--cortex-line);
  --line-dark: var(--cortex-line-strong);
  --coral: var(--cortex-blue);
  --teal: var(--cortex-blue);
  --muted: var(--cortex-muted);
  --bee-bg: var(--cortex-bg);
  --bee-bg-2: var(--cortex-bg-2);
  --bee-panel: var(--cortex-surface);
  --bee-panel-2: var(--cortex-surface-2);
  --bee-border: var(--cortex-line);
  --bee-border-strong: var(--cortex-line-strong);
  --bee-text: var(--cortex-text);
  --bee-muted: var(--cortex-muted);
  --bee-dim: var(--cortex-dim);
  --bee-honey: #9a6a12;
  --bee-honey-2: #f1e3c4;
  --bee-amber: var(--cortex-blue);
  --bee-cream: var(--cortex-surface);
  --bee-ink: var(--cortex-text);
  --bee-gradient: linear-gradient(135deg, #f6ecd6, #efe0bd);
}

/* Phase 2 organization and device management */
.organization-switch{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 12px;border:1px solid var(--cortex-line-strong);border-radius:14px;background:var(--cortex-surface);color:var(--cortex-muted);font-size:12px}.organization-switch select{min-width:160px;height:42px;border:0;background:transparent;font:700 14px/1.2 inherit;color:#1d1d1f;outline:none}.team-button{min-width:64px;min-height:44px;padding:0 16px;border:1px solid var(--cortex-line-strong);border-radius:14px;background:var(--cortex-surface);color:var(--cortex-text);font-weight:750}.support-session-banner{position:sticky;top:0;z-index:12;display:flex;align-items:center;gap:14px;min-height:48px;padding:10px 28px;background:#fff3cc;border-bottom:1px solid #e7cf79;color:#4e3c00}.support-session-banner b{font-size:15px}.support-session-banner span{flex:1}.support-session-banner small{color:#725b12}.team-card{width:min(820px,calc(100vw - 32px));max-height:min(780px,calc(100vh - 32px));overflow:auto}.team-invite-form{display:grid;grid-template-columns:1fr 180px auto;gap:12px;align-items:end;margin:24px 0}.team-invite-form label{display:grid;gap:7px;font-weight:700}.team-invite-form input,.team-invite-form select{min-height:48px;padding:0 14px;border:1px solid #d7d7d2;border-radius:12px;background:#fff;font-size:16px}.member-list{margin-top:24px}.member-list>h3{margin:0 0 10px}.member-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:16px 0;border-top:1px solid #e8e8e4}.member-row div:first-child{display:grid;gap:4px;min-width:0}.member-row small{color:#777;overflow-wrap:anywhere}.member-row select{min-height:44px;padding:0 10px;border:1px solid #ddd;border-radius:10px;background:#fff}.member-action{min-height:44px;padding:0 12px;border:0;background:transparent;color:#9a6a12;font-weight:700}.danger-link{color:#b4232d!important}.invite-token-panel{display:grid;gap:10px;padding:16px;border-radius:14px;background:#f4f6f8}.invite-token-panel code{padding:12px;border-radius:10px;background:#fff;overflow-wrap:anywhere}.registration-panel{margin-top:18px;border-top:1px solid #e6e6e1;padding-top:14px}.registration-panel summary{min-height:44px;display:flex;align-items:center;color:#9a6a12;font-weight:700;cursor:pointer}.registration-panel form{display:grid;gap:12px;padding-top:12px}.device-row.revoked{opacity:.7}.device-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.device-actions button{min-height:44px;padding:0 10px}.environment-form input,.environment-form button,.copy-command{min-height:48px}
.pairing-short-code{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0;padding:14px 16px;border-radius:14px;background:#fbf3e2;color:#6d5530}.pairing-short-code:empty{display:none}.pairing-short-code span{font-size:14px}.pairing-short-code b{font:800 19px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;color:#9a6a12}
.password-reset-panel{margin-top:14px;border-top:1px solid #e6e6e1;padding-top:10px}.password-reset-panel summary{min-height:48px;display:flex;align-items:center;color:#9a6a12;font-size:16px;font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer}.password-reset-content{display:grid;gap:12px;padding:10px 0 2px}.password-reset-content>strong{font-size:18px}.password-reset-content form{display:grid;gap:12px}.password-reset-content input,.password-reset-content button{min-height:50px;font-size:16px}.password-reset-content .form-status{margin:0;color:#5f6b76;font-size:14px;line-height:1.5}.customer-system-note{margin:14px 0 0;color:#70757d;font-size:14px;line-height:1.55}.customer-system-note a{color:#9a6a12;text-decoration:underline;text-underline-offset:3px;font-weight:700}
.member-role-badge{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 14px;border:1px solid #e6cf9f;border-radius:999px;background:#f6ecd6;color:#6d5530;font-size:13px;font-weight:800}.member-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
/* Team roles: what the selected role may do, and the all-roles comparison (public-app/team-roles.js) */
.role-help{margin:-8px 0 6px;padding:16px 18px;border:1px solid var(--cortex-line-strong);border-radius:16px;background:var(--cortex-surface)}.role-help:empty{display:none}
.role-help-summary{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0 0 12px}.role-help-summary b{font-size:17px;color:var(--cortex-text)}.role-help-summary span{color:var(--cortex-muted);font-size:14px}
.role-help-lists{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px 24px}.role-help-list h4{margin:0 0 6px;color:var(--cortex-dim);font-size:13px;font-weight:800}
.role-help-list ul{display:grid;gap:6px;margin:0;padding:0;list-style:none}.role-help-list li{position:relative;padding-left:22px;color:var(--cortex-text);font-size:14px;line-height:1.45}
.role-help-list li::before{position:absolute;left:0;top:0;font-weight:800}.role-help-list.is-can li::before{content:"✓";color:var(--cortex-green)}.role-help-list.is-cannot li::before{content:"✕";color:var(--cortex-red)}
.role-help-note{margin:12px 0 0;color:var(--cortex-muted);font-size:13px;line-height:1.5}
.role-compare>summary{display:inline-flex;align-items:center;min-height:44px;color:var(--cortex-gold-ink);font-weight:700;text-decoration:underline;text-underline-offset:4px;cursor:pointer}
.role-compare-scroll{position:relative;margin-top:6px;overflow-x:auto;border:1px solid var(--cortex-line-strong);border-radius:14px;background:var(--cortex-surface)}
.role-compare table{width:100%;min-width:540px;border-collapse:collapse;font-size:14px}.role-compare th,.role-compare td{padding:10px 12px;border-bottom:1px solid var(--cortex-line);text-align:center;white-space:nowrap}
.role-compare thead th{background:var(--cortex-blue-soft);color:var(--cortex-gold-ink);font-size:13px;font-weight:800}.role-compare tbody th{text-align:left;font-weight:600;color:var(--cortex-text);white-space:normal}
.role-compare tr:last-child>*{border-bottom:0}.role-compare td{color:var(--cortex-dim)}.role-compare td.is-allowed{color:var(--cortex-green);font-weight:800}
.team-card .visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media (max-width:620px){.role-compare table{min-width:0;font-size:13px}.role-compare th,.role-compare td{padding:9px 5px}.role-compare tbody th{padding-left:10px}}

.modal :focus-visible,.topbar :focus-visible,.login-screen :focus-visible,.workflow-filter :focus-visible,.segmented :focus-visible{outline:3px solid rgba(214, 150, 40, .42);outline-offset:3px}

@media (max-width:900px){.organization-switch{max-width:190px}.organization-switch span{display:none}.organization-switch select{min-width:0;max-width:145px}.team-button{min-width:56px}.team-invite-form{grid-template-columns:1fr}.member-row{grid-template-columns:1fr}.member-row select,.member-row>div:last-child{width:100%}.member-row>div:last-child{display:flex;gap:8px}.support-session-banner{position:static;align-items:flex-start;flex-wrap:wrap;padding:12px 18px;font-size:15px}}
@media (max-width:620px){.organization-switch{order:5;max-width:calc(100vw - 142px);flex:1}.organization-switch select{max-width:none;width:100%;font-size:15px}.team-button{order:6}.team-card{width:100vw;max-height:100dvh;height:100dvh;border-radius:0;padding:28px 20px}.team-card h2{font-size:32px}.team-invite-form input,.team-invite-form select,.team-invite-form button,.member-action{font-size:16px;min-height:48px}.device-row{align-items:flex-start}.device-actions{width:100%;justify-content:flex-start}.environment-card{font-size:17px}.environment-card h2{font-size:34px}}

/* Individual colored-pencil portraits; shared by market, local employees and hiring. */
.employee-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 4px solid transparent;
  border-radius: 50%;
  background-color: #faf8f3;
  background-image:
    var(--employee-avatar-image, none),
    linear-gradient(135deg, var(--workflow-avatar-start, #dce4ee), var(--workflow-avatar-end, #8fa2b8));
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, 100% 100%;
  background-position: center, center;
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--workflow-accent, #6d7d90) 18%, transparent),
    0 8px 20px color-mix(in srgb, var(--workflow-accent, #6d7d90) 18%, transparent);
}
@media (prefers-reduced-motion: reduce) {
  .employee-avatar-animated {
    background-image:
      var(--employee-avatar-still, none),
      linear-gradient(135deg, var(--workflow-avatar-start, #dce4ee), var(--workflow-avatar-end, #8fa2b8));
  }
}
.employee-avatar-fallback {
  background-image: linear-gradient(135deg, var(--workflow-avatar-start, #dce4ee), var(--workflow-avatar-end, #8fa2b8));
  background-size: 100% 100%;
  background-position: center;
  background-origin: border-box;
  background-clip: border-box;
  color: var(--workflow-ink, #3f5166);
  font: 800 10px/1 ui-monospace, "SFMono-Regular", monospace;
}
.employee-avatar-fallback.honey,
.employee-avatar-fallback.stone,
.employee-avatar-fallback.pine { color: var(--workflow-ink, #3f5166); }
.employee-card-head {
  grid-template-columns: 52px minmax(0, 1fr) auto;
  padding-top: 18px;
}
.employee-identity { min-width: 0; }
.employee-name,
.employee-role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-portrait {
  padding: 28px;
  background: linear-gradient(145deg, #f7f1e7, #ebe4d8);
}
.modal-portrait.honey { background: linear-gradient(145deg, #fff4db, #f2d999); }
.modal-portrait.stone { background: linear-gradient(145deg, #edf0f3, #dfe5ea); }
.modal-portrait.pine { background: linear-gradient(145deg, #edf4ef, #d9e8de); }
.modal-portrait .employee-avatar-modal {
  width: 124px;
  height: 124px;
  flex-basis: 124px;
  max-width: 100%;
  border-width: 5px;
  box-shadow: 0 0 0 1px rgba(32, 33, 36, 0.08), 0 18px 38px rgba(32, 33, 36, 0.15);
}

.employee-modal-card .modal-employee-head {
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 168px;
  overflow: hidden;
}

.employee-modal-card .modal-portrait {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.employee-modal-card .modal-employee-copy {
  align-self: center;
}

.publisher-card .skill-upload-first {
  border: 1.5px dashed #d9b66e;
  background: #fffaf0;
  border-radius: 18px;
  padding: 18px 20px;
  transition: border-color .2s ease, background .2s ease;
}
.publisher-card .skill-upload-first:focus-within { border-color: #c9861a; background: #fbf3e2; }
.skill-inspection-status {
  margin: -4px 0 2px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #f1f3f6;
  color: #687078;
  font-size: 13px;
  line-height: 1.45;
}
.skill-inspection-status[data-state="loading"] { background: #fbf3e2; color: #9a6a12; }
.skill-inspection-status[data-state="success"] { background: #edf8f1; color: #187341; }
.skill-inspection-status[data-state="error"] { background: #fff0ef; color: #b63b34; }

@media (max-width:820px) {
  .employee-avatar { width: 56px; height: 56px; flex-basis: 56px; }
  .employee-card-head { grid-template-columns: 56px minmax(0, 1fr) auto; }
  .employee-modal-card .modal-employee-head { grid-template-columns: 94px minmax(0, 1fr); min-height: 126px; }
  .employee-modal-card .modal-portrait { padding: 12px; }
  .modal-portrait .employee-avatar-modal { width: 68px; height: 68px; flex-basis: 68px; border-width: 3px; }
}

@media (max-width:820px){
  button,input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),select{min-height:44px}
  .language-switch{width:96px;min-width:96px;height:52px;padding:4px}
  .login-language a,.app-language a{min-width:44px;min-height:44px;height:44px}
  .login-panel input,.registration-panel input,.organization-switch,.organization-switch select,.workflow-filter button,.market-toolbar .segmented button,.academy-toolbar select,.report-toolbar input,.report-toolbar select,.report-toolbar button{min-height:48px;font-size:16px}
  .password-reset-panel input,.password-reset-panel button{min-height:50px;font-size:16px}
  .organization-switch select{height:48px}
  .main-nav button,.environment-pill,.icon-button,.mobile-logout,.team-button,.modal-close,.text-button,.device-actions button,.feishu-create-link,.modal summary{min-height:44px}
  .modal-close{min-width:44px}
  .workflow-filter button{padding-block:12px}
  .member-actions{width:100%;justify-content:flex-start}
}

html,
body {
  background: var(--cortex-bg);
  color: var(--cortex-text);
  font-family: var(--cortex-font);
}

body {
  background: linear-gradient(180deg, #fbf8f1 0, var(--cortex-bg) 34rem);
}

.paper-noise {
  display: none;
}

button,
input,
textarea,
select,
.page-heading h1,
.market-heading h1,
html[data-language="en"] .market-heading h1,
.employee-body h3,
.modal-employee-copy h2,
.report-connection-head h2 {
  font-family: var(--cortex-font);
}

::selection {
  background: rgba(214, 150, 40, 0.16);
  color: var(--cortex-text);
}

.kicker,
.market-heading .kicker,
.kicker.light {
  color: var(--cortex-gold-ink);
  font-family: var(--cortex-mono);
  letter-spacing: 0.18em;
}

.muted,
.page-heading p,
.market-heading p,
.section-toolbar .muted,
.market-toolbar .muted,
.story-copy p,
.story-proof p {
  color: var(--cortex-muted);
}

code {
  background: #eef0f2;
  color: #3f4650;
}

/* The only persistent black/gold treatment: the 2Brain identity lockup. */
.brand-lockup {
  gap: 12px;
}

.brand-mark,
.brand-lockup.compact .brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: 0 0 0 1px rgba(32, 33, 36, 0.08), 0 8px 22px rgba(32, 33, 36, 0.1);
  clip-path: none;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-lockup strong {
  color: #17181a;
  font: 690 18px/1.05 var(--cortex-font);
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.brand-lockup strong span {
  color: var(--cortex-gold-ink);
  font-weight: 790;
}

.brand-lockup small {
  margin-top: 6px;
  color: var(--cortex-dim);
  font-family: var(--cortex-mono);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.17em;
}

/* Calm, legible controls: dark ink actions, lit with a thread of gold. */
.button.primary,
.skill-card button {
  border-color: var(--cortex-ink);
  background: var(--cortex-ink-fill);
  color: #fbf3e2;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.2);
}

.button.primary:hover,
.skill-card button:hover {
  border-color: var(--cortex-ink);
  background: var(--cortex-ink-fill);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, 0.26), 0 0 0 1px rgba(224, 164, 58, 0.5), 0 10px 26px rgba(40, 26, 8, 0.18);
}

.button.primary:disabled,
.skill-card button:disabled {
  border-color: #ddd5c6;
  background: #ddd5c6;
  color: #fffdf8;
  box-shadow: none;
}

.button.secondary,
.icon-button,
.mobile-logout {
  border-color: var(--cortex-line-strong);
  background: var(--cortex-surface);
  color: var(--cortex-text);
}

.button.secondary:hover,
.icon-button:hover,
.mobile-logout:hover {
  border-color: rgba(80, 60, 30, 0.28);
  background: #fffaf0;
}

input,
textarea,
select,
.login-panel input,
.feishu-form input,
.feishu-form select {
  border-color: var(--cortex-line-strong);
  background: var(--cortex-surface);
  color: var(--cortex-text);
}

input::placeholder,
textarea::placeholder {
  color: var(--cortex-dim);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--cortex-blue);
  box-shadow: 0 0 0 4px rgba(214, 150, 40, 0.1);
}

/* Login: warm white, with no full-screen brand colour wash. */
.login-screen {
  background: var(--cortex-bg);
}

.login-story,
.login-panel {
  border-color: var(--cortex-line);
  color: var(--cortex-text);
  box-shadow: var(--cortex-shadow);
}

.login-story {
  background:
    radial-gradient(circle at 90% 7%, rgba(177, 142, 76, 0.07), transparent 24rem),
    linear-gradient(145deg, #fcfcfa, #f2f1ec 68%);
}

.login-story::before {
  border-color: rgba(32, 33, 36, 0.06);
  box-shadow: 0 0 0 55px rgba(32, 33, 36, 0.012), 0 0 0 110px rgba(32, 33, 36, 0.008);
}

.login-story::after {
  content: "CORTEX";
  color: rgba(32, 33, 36, 0.025);
}

.story-copy h1,
.story-copy h1 em {
  color: var(--cortex-text);
  font-family: var(--cortex-font);
  font-weight: 710;
}

.story-copy h1 em {
  background: none;
  -webkit-text-fill-color: currentColor;
}

.story-proof {
  border-color: var(--cortex-line);
}

.story-proof span {
  color: #9a6a12;
}

.login-panel {
  grid-template-rows: 1fr auto;
  background: rgba(255, 255, 255, 0.9);
}

.login-form-wrap {
  align-self: center;
}

.demo-accounts button {
  border-color: var(--cortex-line);
  background: #f8f8f7;
  color: var(--cortex-text);
}

.demo-accounts button:hover,
.demo-accounts button.active {
  border-color: rgba(214, 150, 40, 0.24);
  background: #fbf3e2;
  box-shadow: inset 3px 0 var(--cortex-blue);
}

/* App chrome: the night side of the login, carried inside as the sidebar. */
.app-shell,
.main-stage {
  background: transparent;
  color: var(--cortex-text);
}

.sidebar {
  border-color: rgba(238, 228, 200, 0.08);
  background:
    radial-gradient(ellipse 140% 30% at 0% 104%, rgba(255, 160, 40, 0.14), transparent 70%),
    linear-gradient(180deg, var(--cortex-night), #16120e);
  color: var(--cortex-night-text);
}

.sidebar .brand-lockup strong {
  color: var(--cortex-night-text);
}

.sidebar .brand-lockup strong span {
  background: linear-gradient(100deg, #ffb028, #ffd070 55%, #ffe9bb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar .brand-lockup small,
.sidebar .workspace-label {
  color: var(--cortex-night-muted);
  font-family: var(--cortex-mono);
  letter-spacing: 0.2em;
}

.main-nav button {
  color: #b3aa95;
}

.main-nav button b {
  color: #e9e2d0;
}

.main-nav button:hover {
  border-color: rgba(238, 228, 200, 0.08);
  background: rgba(255, 248, 235, 0.04);
  color: var(--cortex-night-text);
}

.main-nav button.active {
  border-color: rgba(238, 228, 200, 0.1);
  background: rgba(255, 248, 235, 0.07);
  color: #fffaf0;
  box-shadow: inset 2px 0 0 #ffb028;
}

.main-nav button.active b {
  color: #fffaf0;
}

.main-nav .nav-index {
  background: rgba(255, 208, 112, 0.08);
  color: #ffd070;
  font-family: var(--cortex-mono);
}

.main-nav button.active .nav-index {
  background: linear-gradient(100deg, #ffb028, #ffd070);
  color: #1d1403;
}

.nav-count {
  background: #ffb028;
  color: #1d1403;
}

.main-nav small,
.user-card small,
.user-card button {
  color: var(--cortex-night-muted);
}

.user-card,
.sidebar-quote {
  border-color: rgba(238, 228, 200, 0.1);
  background: rgba(255, 248, 235, 0.04);
}

.user-card strong {
  color: var(--cortex-night-text);
}

.user-card > span {
  background: rgba(255, 208, 112, 0.12);
  color: #ffd070;
}

.sidebar .logout-button {
  color: #b3aa95;
}

.sidebar .logout-button:hover {
  background: rgba(255, 248, 235, 0.06);
  color: var(--cortex-night-text);
}

.topbar {
  border-color: var(--cortex-line);
  background: rgba(247, 243, 234, 0.84);
  color: var(--cortex-text);
}

.context-label {
  color: var(--cortex-dim);
  font-family: var(--cortex-mono);
}

.topbar strong,
.environment-pill b {
  color: var(--cortex-text);
}

.environment-pill,
.environment-pill:hover,
.icon-button,
.icon-button:hover {
  border-color: var(--cortex-line);
  background: rgba(255, 253, 248, 0.9);
  color: var(--cortex-text);
}

.environment-pill:hover,
.icon-button:hover {
  border-color: var(--cortex-line-strong);
  background: var(--cortex-surface);
}

.environment-pill small,
.environment-pill i {
  color: var(--cortex-muted);
}

.language-switch,
.segmented,
.market-toolbar .segmented {
  background: var(--cortex-bg-2);
  box-shadow: inset 0 0 0 1px rgba(80, 60, 30, 0.04);
}

.language-switch a,
.segmented button {
  color: var(--cortex-muted);
}

.language-switch a:hover,
.segmented button.active {
  background: var(--cortex-surface);
  color: var(--cortex-text);
  box-shadow: 0 1px 5px rgba(60, 40, 10, 0.1);
}

.language-switch a.active {
  background: var(--cortex-ink);
  color: #ffd070;
  box-shadow: 0 2px 8px rgba(40, 26, 8, 0.18);
}

.mobile-cortex-brand {
  display: none;
}

/* Product views */
.page-heading h1,
.market-heading h1,
html[data-language="en"] .market-heading h1,
.compact-heading h1 {
  color: var(--cortex-text);
  font-family: var(--cortex-font);
  font-weight: 710;
}

.page-heading h1 em,
.market-heading h1 em {
  color: #3f4b5a;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.market-toolbar,
.workflow-group-head,
.employee-meta,
.report-date-block,
.skill-compat {
  border-color: var(--cortex-line);
}

.workflow-filter button,
.workflow-filter button:hover {
  border-color: var(--cortex-line);
  background: rgba(255, 255, 255, 0.7);
  color: var(--cortex-muted);
}

.workflow-filter button:hover {
  background: #fff;
  color: var(--cortex-text);
}

.workflow-filter button.active {
  border-color: #2b2d31;
  background: #2b2d31;
  color: #fff;
}

.workflow-filter { flex-wrap: wrap; gap: 8px; }
.workflow-filter button { min-height: 44px; }
.deployment-version-note { margin: 0; padding: 16px 28px; color: #596571; background: #f0f4f8; font-size: 15px; line-height: 1.7; }
.story-proof { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 12px 16px; }
@media (max-width: 640px) {
  .workflow-filter { display: flex; flex-wrap: wrap; overflow: visible; }
  .workflow-filter button, .workflow-filter button:first-child { flex: 0 0 auto; min-height: 48px; }
  .deployment-version-note { padding: 14px 20px; }
}

.workflow-group-head h2,
.employee-body h3,
.skill-card h3,
.panel-title h3,
.catalog-item b {
  color: var(--cortex-text);
}

.workflow-group-head p,
.workflow-group-head > small,
.employee-name,
.employee-card.featured .employee-name,
.employee-tagline,
.employee-card.featured .employee-tagline,
.employee-meta > span,
.skill-card > p,
.skill-version,
.skill-updated,
.skill-compat,
.coverage-note {
  color: var(--cortex-muted);
}

.skill-updated { display: block; margin-top: 5px; font-size: .9em; }
.employee-first-step { margin: 20px 0; padding: 20px 24px; border: 1px solid rgba(154, 106, 18, 0.14); border-radius: 20px; background: linear-gradient(145deg, #fcf6e9, #f5e9cf); color: #4a3818; }
.employee-first-step .kicker { color: var(--cortex-gold-ink); font-size: 10px; }
.employee-first-step h4 { margin: 6px 0 10px; font-size: 19px; line-height: 1.4; }
.employee-first-step p { margin: 8px 0; font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.employee-first-step small { display: block; margin-top: 12px; font-size: 12px; line-height: 1.6; color: #7a6a4f; }
.employee-first-step-action { margin: 6px 0 4px; }
@media (max-width: 600px) { .employee-first-step { padding: 17px 18px; } }

.workflow-group.gtm,
.workflow-gtm {
  --workflow-accent: #5c7fa8;
  --workflow-ink: #355577;
  --workflow-card-start: #fbfdff;
  --workflow-card-surface: #eaf2fb;
  --workflow-card-line: rgba(65, 102, 146, 0.18);
  --workflow-avatar-start: #dceafb;
  --workflow-avatar-end: #7fa4cf;
  --workflow-avatar-soft: #eef5fd;
  --workflow-modal-start: #f3f8fe;
  --workflow-modal-end: #d9e8f8;
}

.workflow-group.crm,
.workflow-crm,
.workflow-group.sales,
.workflow-sales {
  --workflow-accent: #80709b;
  --workflow-ink: #5d4d78;
  --workflow-card-start: #fdfcff;
  --workflow-card-surface: #f1ecf7;
  --workflow-card-line: rgba(112, 91, 145, 0.17);
  --workflow-avatar-start: #ebe4f4;
  --workflow-avatar-end: #aa98c2;
  --workflow-avatar-soft: #f5f1f9;
  --workflow-modal-start: #faf7fc;
  --workflow-modal-end: #e8def1;
}

.workflow-group.cs,
.workflow-cs {
  --workflow-accent: #aa7870;
  --workflow-ink: #7e504a;
  --workflow-card-start: #fffcfa;
  --workflow-card-surface: #f8eeea;
  --workflow-card-line: rgba(158, 104, 92, 0.18);
  --workflow-avatar-start: #f6e5df;
  --workflow-avatar-end: #ceaaa0;
  --workflow-avatar-soft: #fcf3ef;
  --workflow-modal-start: #fff9f5;
  --workflow-modal-end: #efddd4;
}

.workflow-group.fin,
.workflow-fin {
  --workflow-accent: #568370;
  --workflow-ink: #356453;
  --workflow-card-start: #fbfefc;
  --workflow-card-surface: #e7f3ed;
  --workflow-card-line: rgba(64, 119, 96, 0.18);
  --workflow-avatar-start: #deeee6;
  --workflow-avatar-end: #86b7a2;
  --workflow-avatar-soft: #eef7f2;
  --workflow-modal-start: #f3faf6;
  --workflow-modal-end: #d9ece2;
}

.workflow-custom {
  --workflow-accent: #9a7d55;
  --workflow-ink: #6d5637;
  --workflow-card-start: #fffefa;
  --workflow-card-surface: #f5eee2;
  --workflow-card-line: rgba(138, 103, 59, 0.17);
  --workflow-avatar-start: #f5ead6;
  --workflow-avatar-end: #c7aa7a;
  --workflow-avatar-soft: #fbf5ea;
  --workflow-modal-start: #fdf9f1;
  --workflow-modal-end: #eee1cb;
}

.workflow-group-head span,
.workflow-group.crm .workflow-group-head span,
.workflow-group.fin .workflow-group-head span {
  background: color-mix(in srgb, var(--workflow-accent) 12%, white);
  color: color-mix(in srgb, var(--workflow-accent) 86%, black);
}

.employee-card,
.employee-card.featured,
.workflow-group .employee-card,
.workflow-group .employee-card.featured {
  border-color: var(--workflow-card-line);
  background: linear-gradient(145deg, var(--workflow-card-start, #fff) 0%, #fff 43%, var(--workflow-card-surface) 100%);
  color: var(--cortex-text);
  box-shadow: 0 1px 2px rgba(32, 33, 36, 0.025), 0 12px 34px rgba(32, 33, 36, 0.035);
}

.workflow-group .employee-card::before {
  content: "";
  display: block;
  height: 4px;
  flex: 0 0 4px;
  background: linear-gradient(90deg, var(--workflow-avatar-start), var(--workflow-accent), var(--workflow-avatar-end));
  opacity: 0.82;
}

.modal-portrait.workflow-gtm,
.modal-portrait.workflow-crm,
.modal-portrait.workflow-sales,
.modal-portrait.workflow-cs,
.modal-portrait.workflow-fin,
.modal-portrait.workflow-custom {
  background: linear-gradient(145deg, var(--workflow-modal-start), var(--workflow-modal-end));
}

.workflow-group .portrait-state,
.workflow-group .capability-tags span {
  border-color: color-mix(in srgb, var(--workflow-accent) 14%, transparent);
  background: color-mix(in srgb, var(--workflow-card-surface) 72%, white);
  color: var(--workflow-ink);
}

.employee-card:hover,
.workflow-group .employee-card:hover {
  border-color: color-mix(in srgb, var(--workflow-accent) 34%, transparent);
  box-shadow: var(--cortex-shadow-hover);
}

.agent-hex,
.employee-card.stone .agent-hex,
.employee-card.pine .agent-hex {
  background: color-mix(in srgb, var(--workflow-accent) 11%, white);
  color: color-mix(in srgb, var(--workflow-accent) 86%, black);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--workflow-accent) 16%, transparent);
}

.portrait-state,
.employee-card.featured .portrait-state,
.capability-tags span,
.employee-card.featured .capability-tags span,
.skill-state,
.work-status {
  background: #f1ebe0;
  color: #6b6252;
}

.skill-chips span,
.employee-card.featured .skill-chips span,
.academy-seal,
.panel-title > span,
.check-skill:has(input:checked) {
  border-color: rgba(154, 106, 18, 0.16);
  background: #f6ecd6;
  color: #7d5409;
}

.employee-output {
  background: rgba(80, 60, 30, 0.04);
}

.employee-output b,
.employee-card.featured .employee-output b {
  color: var(--cortex-text);
}

.text-button,
.employee-card.featured .text-button {
  color: var(--cortex-blue);
}

.text-button:hover {
  color: #7d5409;
}

.employment-stamp,
.skill-state.mastered,
.work-status.completed {
  background: #e8f5ee;
  color: #25704f;
}

.empty-state,
.panel,
.skill-card,
.metric,
.report-card,
.academy-toolbar,
.report-toolbar,
.employee-builder,
.catalog-panel,
.report-connection-overview {
  border-color: var(--cortex-line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--cortex-text);
  box-shadow: var(--cortex-shadow);
}

.skill-card::before {
  background: linear-gradient(180deg, #ffb028, #d8962a);
}

/* Read-only sample reports stay visibly separate from local work evidence. */
.report-toolbar { flex-wrap: wrap; }
.report-toolbar label { min-width: 0; }
.report-toolbar select { max-width: 100%; }
.report-demo-notice { margin: 0 0 22px; padding: 20px 24px; border: 1px solid #e6d3a8; border-radius: 18px; background: #fbf3e2; color: #5a4520; }
.report-demo-notice b { font-size: 18px; }
.report-demo-notice p { margin: 8px 0 0; font-size: 15px; line-height: 1.7; }
.demo-evaluation { padding: 12px 0; }
.demo-evaluation > strong { font-size: 42px; line-height: 1.2; }
.demo-evaluation strong small { font-size: 20px; color: var(--cortex-muted); }
.demo-evaluation p { font-size: 17px; line-height: 1.8; }
.demo-evaluation > small { color: var(--cortex-muted); }
@media (max-width: 820px) {
  .report-demo-notice { padding: 18px; }
  .report-toolbar label, .report-toolbar select { width: 100%; }
}

.skill-number {
  color: #e9eaec;
}

.skill-state.update {
  background: #f6ecd6;
  color: #7d5409;
}

.skill-state.locked,
.skill-card button:disabled {
  background: #e1e2e5;
  color: #8a8d92;
}

.metric.highlight {
  border-color: rgba(214, 150, 40, 0.18);
  background: linear-gradient(145deg, #fffaf0, #f6ecd6);
  color: var(--cortex-text);
}

.category-bar,
.gauge-ring {
  background-color: #e7e9ec;
}

.gauge-ring::after {
  background: #fff;
}

.category-row,
.signal-list p,
.work-row,
.conversation-row,
.catalog-item,
.report-connection-facts,
.report-connection-facts > div,
.md-editors,
.md-editors details,
.skill-picker {
  border-color: var(--cortex-line);
}

.classification-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 2px solid #6b7f98;
  background: #f1f4f7;
  color: var(--cortex-muted);
  font-size: 10px;
  line-height: 1.55;
}

.work-topic-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}

.work-topic-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--cortex-line);
  border-radius: 999px;
  background: #f2f4f6;
  color: var(--cortex-text);
  font-size: 11px;
  font-weight: 700;
}

.work-topic-list i {
  color: var(--cortex-muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.check-skill,
.md-editors summary,
.device-row,
.feishu-advanced,
.channel-update,
.channel-route,
.dismiss-progress,
.channel-progress {
  border-color: var(--cortex-line);
  background: var(--cortex-surface-2);
  color: var(--cortex-text);
}

/* Operational surfaces stay light; only logs use dark mono panels. */
.modal-card,
.modal-employee-head,
.modal-section,
.employee-profile-details,
.employee-profile-content,
.hire-deployment-section,
.channel-section,
.dismiss-section {
  border-color: var(--cortex-line);
  color: var(--cortex-text);
}

/* Dialogs keep their frosted glass, tinted ivory like the work surface. */
.modal-card {
  background: rgba(255, 253, 248, 0.96);
}

.modal-employee-head {
  background: linear-gradient(140deg, #fbfbfa, #f1f3f5);
}

.modal-close {
  border-color: var(--cortex-line);
  background: #f1ebe0;
  color: var(--cortex-text);
}

.modal-employee-copy > p,
.channel-heading p,
.dismiss-heading p,
.channel-security,
.dismiss-preserved,
.channel-progress span,
.dismiss-progress span {
  color: var(--cortex-muted);
}

.hire-deployment-head,
.hire-deployment-body,
.hire-journey,
.hire-log-details {
  border-color: var(--cortex-line);
  background: var(--cortex-surface-2);
  color: var(--cortex-text);
}

/* Phase 2A — compact pre-deployment Skill choices. */
.hire-skill-config {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--cortex-line);
  border-radius: 18px;
  background: var(--cortex-surface-2);
}

.hire-organization-imprint,
.hire-confirm-imprint {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #dbe5df;
  border-radius: 16px;
  background: #f5f9f6;
}
.hire-organization-imprint > div { min-width: 0; flex: 1; display: grid; gap: 3px; }
.hire-organization-imprint small,
.hire-confirm-imprint small { color: #5f7468; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.hire-organization-imprint b,
.hire-confirm-imprint b { color: var(--cortex-text); font-size: 15px; }
.hire-organization-imprint span { overflow: hidden; color: var(--cortex-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.view-hire-profile { min-height: 44px; flex: 0 0 auto; color: var(--cortex-blue); }
.hire-confirm-imprint { align-items: baseline; flex-wrap: wrap; }
.hire-confirm-imprint span { margin-left: auto; color: var(--cortex-muted); font-size: 12px; }

.hire-skill-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hire-skill-head h4 {
  margin: 4px 0 0;
  font-size: 18px;
  letter-spacing: -.02em;
}

.hire-skill-config > p {
  margin: -5px 0 0;
  color: var(--cortex-muted);
  font-size: 13px;
  line-height: 1.5;
}

.hire-skill-count {
  display: grid;
  min-width: 54px;
  min-height: 38px;
  place-items: center;
  border-radius: 999px;
  background: #e7f3eb;
  color: var(--cortex-green);
  font-size: 14px;
}

.hire-skill-count.invalid {
  background: #fff0f0;
  color: var(--cortex-red);
}

.hire-skill-list {
  display: grid;
  gap: 8px;
}

.hire-skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--cortex-line);
  border-radius: 14px;
  background: #fff;
}

.hire-skill-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.hire-skill-copy b,
.hire-skill-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hire-skill-copy b { font-size: 14px; }
.hire-skill-copy small { color: var(--cortex-muted); font-size: 11px; }

.hire-skill-modes {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(58px, auto));
  padding: 3px;
  border-radius: 12px;
  background: #eceef1;
}

.hire-skill-modes button {
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--cortex-muted);
  font-size: 12px;
  font-weight: 700;
}

.hire-skill-modes button.active {
  background: #fff;
  color: var(--cortex-text);
  box-shadow: 0 1px 4px rgba(32, 33, 36, .1);
}

.hire-skill-modes button[data-hire-skill-mode="strengthen"].active { color: var(--cortex-blue); }
.hire-skill-modes button[data-hire-skill-mode="drop"].active { color: var(--cortex-red); }

.hire-skill-add { display: grid; gap: 7px; }
.hire-skill-add > label { color: var(--cortex-muted); font-size: 12px; font-weight: 700; }
.hire-skill-add > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.hire-skill-add select { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 14px; }
.hire-skill-add .button { min-width: 82px; min-height: 44px; }
.hire-skill-error { color: var(--cortex-red) !important; font-weight: 700; }
.hire-skill-mode-note { font-size: 12px !important; }

/* Keep the decision controls visible independently of long deployment details. */
.sidebar-account { margin-top: auto; padding-top: 24px; }
.sidebar .sidebar-account .user-card { margin: 0; grid-template-columns: 36px minmax(0, 1fr); }
.sidebar-account .user-card > div { min-width: 0; }
.sidebar-account .user-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 44px; margin-top: 12px; padding: 10px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--cortex-muted); font: inherit; font-size: 13px; cursor: pointer; }
.logout-button:hover { background: var(--cortex-surface-3); color: var(--cortex-text); }
.logout-button:focus-visible { outline: 3px solid rgba(214, 150, 40, .42); outline-offset: 2px; }
.logout-icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; }
@media (max-width: 820px) {
  .sidebar-account { display: none; }
  #mobileLogout { min-width: 44px; width: 44px; min-height: 44px; padding: 10px; align-items: center; justify-content: center; }
}

#employeeModal {
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

#employeeModal .employee-modal-card {
  display: flex;
  flex-direction: column;
  width: min(1040px, 100%);
  max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#employeeModalContent {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.employee-modal-scroll {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scroll-padding-block: 52px 16px;
  overflow-wrap: anywhere;
}
.employee-modal-scroll:focus-visible { outline-offset: -3px; }

.employee-modal-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 28px;
  border-top: 1px solid var(--cortex-line-strong);
  background: var(--cortex-surface);
  box-shadow: 0 -6px 20px rgba(28, 34, 40, .04);
}
.employee-action-copy { min-width: 0; }
.employee-action-copy strong { font-size: 13px; }
.employee-action-copy p { margin: 4px 0 0; color: var(--cortex-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.employee-action-buttons { display: flex; gap: 10px; flex: 0 0 auto; }
.employee-modal-actions .button { min-height: 44px; min-width: 116px; padding: 10px 18px; font-size: 14px; white-space: normal; }
.employee-modal-actions .dismiss-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 1 auto;
  max-width: 100%;
}
.employee-modal-actions .dismiss-actions > .button { flex: 0 0 auto; margin: 0; }
.employee-modal-actions .dismiss-actions.hidden { display: none; }
.employee-modal-actions .dismiss-trigger { margin: 0; }

/* Show activity only while an actual request or device confirmation is pending. */
.tool-status.is-loading, .model-status.is-loading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.tool-status.is-loading::before, .model-status.is-loading::before,
.tool-actions button[aria-busy="true"]::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: cortex-request-spin .8s linear infinite;
}
.tool-status.is-loading::before, .model-status.is-loading::before { margin-top: 4px; }
.tool-actions button[aria-busy="true"]:disabled { display: inline-flex; align-items: center; justify-content: center; gap: 8px; opacity: 1; cursor: wait; }
@keyframes cortex-request-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tool-status.is-loading::before, .model-status.is-loading::before,
  .tool-actions button[aria-busy="true"]::before { animation: none; }
}

@media (max-width: 600px) {
  .employee-modal-actions { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 16px; }
  .employee-action-copy strong { display: none; }
  .employee-action-copy p { margin: 0; }
  .employee-action-buttons > .button { flex: 1 1 0; }
  .employee-modal-actions .dismiss-actions { width: 100%; }
  .employee-modal-actions .dismiss-actions > .button { flex: 1 1 0; }
  .employee-modal-actions .button { min-width: 0; padding-inline: 10px; }
}

.hire-confirm-modal {
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.hire-confirm-card {
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc(100vh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#hireConfirmContent {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.hire-confirm-header {
  flex: 0 0 auto;
  padding: 26px 72px 16px 28px;
}

.hire-confirm-header h2 { margin: 8px 0 0; padding: 0; }
.hire-confirm-header .kicker { overflow-wrap: anywhere; }

.hire-confirm-body {
  min-height: 0;
  padding: 0 28px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-wrap: break-word;
}

.hire-confirm-body:focus-visible { outline-offset: -3px; }

.hire-confirm-actions {
  flex: 0 0 auto;
  margin: 0;
  padding: 16px 28px;
  border-top: 1px solid var(--cortex-line-strong);
  background: var(--cortex-surface);
}

.hire-confirm-actions .button { min-width: 0; white-space: normal; }

@media (max-width: 820px) {
  .hire-confirm-header { padding: 20px 68px 14px 20px; }
  .hire-confirm-header h2 { font-size: 25px; }
  .hire-confirm-body { padding: 0 20px 20px; }
  .hire-confirm-actions { padding: 12px 20px; }
}

@media (max-height: 480px) and (min-width: 600px) {
  .hire-confirm-header { padding-top: 14px; padding-bottom: 10px; }
  .hire-confirm-header h2 { font-size: 24px; }
  .hire-confirm-header .kicker { display: none; }
  .hire-confirm-actions { grid-template-columns: minmax(100px, .42fr) minmax(0, 1fr); padding-top: 10px; padding-bottom: 10px; }
  .hire-confirm-actions .button.primary { order: 0; }
}

.hire-confirm-skills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.hire-confirm-skills > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--cortex-line);
  border-radius: 15px;
  background: var(--cortex-surface-2);
}

.hire-confirm-skills small { color: var(--cortex-muted); }
.hire-confirm-skills strong { font-size: 22px; }

.hire-confirm-skill-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.hire-confirm-skill-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--cortex-line);
  border-radius: 12px;
}

.hire-confirm-skill-list li > span:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.hire-confirm-skill-list small { padding: 4px 8px; border-radius: 999px; background: var(--cortex-surface-2); color: var(--cortex-muted); font-weight: 700; }

@media (max-width: 820px) {
  .hire-skill-config { padding: 14px; }
  .hire-skill-row { grid-template-columns: 1fr; gap: 10px; }
  .hire-skill-modes { display: grid; width: 100%; grid-template-columns: repeat(3, 1fr); }
  .hire-skill-modes button { min-height: 46px; font-size: 14px; }
  .hire-skill-add select,
  .hire-skill-add .button { min-height: 48px; font-size: 16px; }
  .hire-confirm-skills > div { min-height: 60px; }
}

@media (max-width: 480px) {
  .hire-confirm-skills { grid-template-columns: 1fr; }
  .hire-skill-add > div { grid-template-columns: 1fr; }
  .hire-skill-add .button { width: 100%; }
  .hire-organization-imprint { align-items: flex-start; flex-direction: column; }
  .view-hire-profile { width: 100%; text-align: left; }
}

.employment-log,
.command-panel,
.environment-card .command-panel {
  border-color: rgba(255, 255, 255, 0.08);
  background: #24262a;
  color: #f6f7f8;
}

.device-action-buttons {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  flex-wrap: wrap;
}

.device-actions .credential-button {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #e6cf9f;
  border-radius: 999px;
  background: #fbf3e2;
  color: #9a6a12;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.device-actions .credential-button:disabled {
  cursor: wait;
  opacity: .65;
}

.credential-rotation-progress {
  display: grid;
  gap: 3px;
  max-width: 510px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #cfe1f3;
  border-radius: 12px;
  background: #f1f7fd;
}

.credential-rotation-progress b,
.credential-rotation-progress small {
  margin: 0;
}

.credential-rotation-progress b {
  color: #075caa;
  font-size: 13px;
}

.credential-rotation-progress small {
  color: #607386;
  font-size: 12px;
  line-height: 1.45;
}

.credential-rotation-progress.complete {
  border-color: #c8e5d5;
  background: #eef8f2;
}

.credential-rotation-progress.complete b { color: #25704f; }
.credential-rotation-progress.failed { border-color: #efcaca; background: #fff3f3; }
.credential-rotation-progress.failed b { color: #b4232d; }

.channel-icon {
  background: var(--cortex-blue-soft);
  color: var(--cortex-blue);
}

.channel-icon.connected,
.channel-ready,
.channel-ready > span,
.channel-state.online {
  background: #e8f5ee;
  color: #25704f;
}

.channel-state {
  background: #eceef0;
  color: var(--cortex-muted);
}

.button.danger,
.dismiss-trigger {
  border-color: rgba(198, 61, 67, 0.22);
  background: #fff;
  color: var(--cortex-red);
}

.button.danger:hover,
.dismiss-trigger:hover {
  background: #fff4f4;
}

.dismiss-missing,
.report-empty {
  border-color: rgba(83, 104, 130, 0.16);
  background: #f1f4f7;
  color: #4b6079;
}

.dismiss-confirm {
  border-color: rgba(198, 61, 67, 0.18);
  background: #fff5f5;
}

.dismiss-confirm h4,
.dismiss-confirm > p {
  color: #a82e35;
}

.report-connection-signal {
  background: #eceef0;
}

.report-connection-overview[data-state="online"] .report-connection-signal {
  background: #e5f6ec;
}

.report-connection-head h2,
.report-connection-facts strong,
.report-empty h3 {
  color: var(--cortex-text);
}

.report-connection-head p,
.report-connection-facts small,
.report-connection-facts span,
.report-empty p {
  color: var(--cortex-muted);
}

.toast {
  border-color: transparent;
  background: rgba(35, 37, 40, 0.95);
  color: #fff;
  box-shadow: 0 14px 36px rgba(32, 33, 36, 0.18);
}

/* Reports must stay inside the stage on compact desktop and long evidence IDs. */
#reportContent,
.report-grid,
.report-grid > *,
.work-row,
.work-row > *,
.conversation-row,
.conversation-row header,
.conversation-row header > * {
  min-width: 0;
}

.work-row h4,
.work-row p,
.work-row small,
.conversation-row b,
.conversation-row p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 1320px) {
  .report-grid,
  .top-report-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Small BEE Sigma endorsement, separate from the product colour system. */
.cortex-footer {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--cortex-dim);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.cortex-footer span {
  color: var(--cortex-muted);
  font-weight: 650;
}

.cortex-footer i {
  width: 22px;
  height: 1px;
  background: var(--cortex-line-strong);
}

.cortex-footer strong {
  color: var(--cortex-gold-ink);
  font-size: inherit;
  font-weight: 680;
}

.login-brand-footer {
  width: min(440px, 100%);
  align-self: end;
  justify-content: center;
  padding-top: 28px;
}

.app-brand-footer {
  justify-content: flex-end;
  margin: -48px clamp(28px, 4vw, 72px) 28px;
  padding-top: 22px;
  border-top: 1px solid var(--cortex-line);
}

@media (max-width: 820px) {
  body {
    background: var(--cortex-bg);
  }

  .topbar {
    border-color: var(--cortex-line);
    background: rgba(247, 243, 234, 0.94);
  }

  /* The bottom bar stays night-dark; the active tab is lit in gold. */
  .sidebar {
    border-color: rgba(238, 228, 200, 0.1);
    background: rgba(16, 14, 12, 0.94);
    box-shadow: 0 12px 32px rgba(20, 12, 4, 0.28);
  }

  .main-nav button.active {
    box-shadow: none;
    background: rgba(255, 208, 112, 0.1);
    color: #ffd070;
  }

  .main-nav button.active b {
    color: #ffd070;
  }

  .topbar {
    gap: 9px;
  }

  .mobile-cortex-brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
  }

  .mobile-cortex-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    box-shadow: 0 0 0 1px var(--cortex-line);
  }

  .mobile-cortex-brand strong {
    color: var(--cortex-text);
    font-size: 12px;
    font-weight: 680;
    letter-spacing: -0.03em;
    white-space: nowrap;
  }

  .top-actions {
    width: auto;
    min-width: 0;
    flex: 1;
  }

  .mobile-logout {
    border-color: var(--cortex-line);
    background: #fff;
    color: var(--cortex-text);
  }

  .app-brand-footer {
    justify-content: center;
    margin: -10px 16px 108px;
    padding-top: 18px;
  }
}

@media (max-width: 600px) {
  .topbar {
    height: auto;
    min-height: 64px;
    align-items: flex-start;
    padding-block: 10px;
  }

  .top-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .organization-switch {
    flex-basis: calc(100% - 63px);
  }

  .mobile-cortex-brand strong {
    display: none;
  }

  .login-brand-footer {
    padding-top: 20px;
  }

  .device-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .device-actions {
    grid-column: 1 / -1;
    align-items: stretch;
  }

  .device-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .device-action-buttons .credential-button {
    grid-column: 1 / -1;
  }

  .device-action-buttons button {
    min-height: 48px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .mobile-cortex-brand img {
    width: 30px;
    height: 30px;
  }

  .app-language {
    width: 66px;
  }

  .environment-pill {
    min-width: 86px;
  }

  .mobile-logout {
    min-width: 52px;
    padding-inline: 8px;
  }

  .cortex-footer {
    gap: 8px;
    font-size: 9px;
  }
}

/* Phase 1 company profile — a quiet, editable briefing rather than another dashboard. */
.company-profile-button {
  min-width: 0;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 5px 8px 5px 5px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--cortex-text);
  text-align: left;
  cursor: pointer;
}

.company-profile-button:hover { background: rgba(32, 33, 36, 0.045); }
.company-profile-button.profile-disabled {
  padding-left: 0;
  background: transparent;
  cursor: default;
  opacity: 1;
}
.company-profile-button.profile-disabled:hover { background: transparent; }
.company-profile-button.profile-disabled .company-profile-icon { display: none; }
.company-profile-button.profile-disabled .company-profile-name strong { max-width: min(320px, 30vw); }

.company-profile-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(164, 103, 0, 0.14);
  border-radius: 12px;
  background: #fff3d5;
  color: #875600;
  font-size: 13px;
  font-weight: 800;
}

.company-profile-copy { min-width: 0; display: grid; gap: 3px; }
.company-profile-name { min-width: 0; display: flex; align-items: center; gap: 9px; }
.company-profile-name strong { max-width: min(260px, 24vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-profile-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef1f4;
  color: #656970;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}
.company-profile-badge.confirmed { background: #e8f3ed; color: #286548; }
.company-profile-badge.verified { background: #e6f3eb; color: #16704a; }
.company-profile-chevron { color: var(--cortex-dim); font-size: 22px; line-height: 1; }

.organization-profile-card {
  width: min(1120px, calc(100vw - 48px));
  max-height: min(940px, calc(100dvh - 40px));
  padding: 40px 48px 44px;
  overflow: auto;
  overscroll-behavior: contain;
  border-color: var(--cortex-line);
  background: var(--cortex-surface);
  box-shadow: 0 28px 80px rgba(24, 27, 31, 0.16);
}

.organization-profile-heading {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 2px 48px 26px 0;
  border-bottom: 1px solid var(--cortex-line);
}

.profile-heading-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #fff1cf;
  color: #885800;
  font-size: 16px;
  font-weight: 820;
}

.organization-profile-heading h2 {
  margin: 5px 0 7px;
  color: var(--cortex-text);
  font-size: clamp(27px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.organization-profile-heading p {
  max-width: 670px;
  margin: 0;
  color: var(--cortex-muted);
  font-size: 15px;
  line-height: 1.6;
}

.organization-profile-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  background: #f0f1f3;
  color: #6b6f75;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}
.organization-profile-status.confirmed,
.organization-profile-status.verified { background: #e8f4ed; color: #1c724c; }

.profile-guidance {
  margin: 20px 0 0;
  padding: 15px 17px;
  display: flex;
  align-items: baseline;
  gap: 10px 16px;
  border: 1px solid #ead7aa;
  border-radius: 15px;
  background: #fff9ea;
  color: #684d14;
}
.profile-guidance b { color: #342b18; font-size: 15px; }
.profile-guidance span { font-size: 14px; line-height: 1.5; }
.profile-guidance.success { border-color: #c9e4d5; background: #f0f8f3; color: #34624c; }

#organizationProfileForm { display: grid; }
.profile-group {
  min-width: 0;
  margin: 0;
  padding: 34px 0;
  display: grid;
  gap: 22px;
  border: 0;
  border-bottom: 1px solid var(--cortex-line);
}
.profile-group legend {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: 0;
}
.profile-group legend > span:first-child {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f2f4;
  color: #696d74;
  font: 750 11px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.profile-group legend > span:last-child { display: grid; gap: 3px; }
.profile-group legend b { color: var(--cortex-text); font-size: 18px; letter-spacing: -0.02em; }
.profile-group legend small { color: var(--cortex-muted); font-size: 13px; font-weight: 450; }
.profile-group label { min-width: 0; display: grid; gap: 10px; color: #45484d; font-size: 14px; font-weight: 700; }
.profile-website-control { display: grid; gap: 9px; }
.profile-website-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.profile-website-head label { display: block; margin: 0; }
.profile-extract-button { min-height: 44px; padding: 9px 16px; flex: 0 0 auto; }
.profile-extract-help { margin: 0; color: var(--cortex-muted); font-size: 13px; line-height: 1.45; }
.profile-group input,
.profile-group textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid #d9dadd;
  border-radius: 13px;
  background: #fbfbfa;
  color: var(--cortex-text);
  font: 500 16px/1.45 var(--cortex-font);
  resize: vertical;
  box-shadow: none;
}
.profile-group textarea { min-height: 132px; overflow-y: hidden; resize: none; line-height: 1.58; }
.profile-group input:hover,
.profile-group textarea:hover { border-color: #c5c7cb; }
.profile-group input:focus,
.profile-group textarea:focus { border-color: #c9a35a; background: #fff; outline: 3px solid rgba(214, 150, 40, 0.11); }
.profile-fields-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
.profile-or { height: 28px; display: flex; align-items: center; gap: 12px; color: var(--cortex-dim); font-size: 10px; font-weight: 750; letter-spacing: 0.12em; }
.profile-or::before,
.profile-or::after { content: ""; height: 1px; flex: 1; background: var(--cortex-line); }
.profile-extraction-result {
  margin-top: 16px;
  padding: 15px;
  display: grid;
  gap: 12px;
  border: 1px solid #dce4ed;
  border-radius: 14px;
  background: #f7f9fb;
}
.profile-extraction-result > div > b { display: block; margin-bottom: 8px; color: #41464e; font-size: 12px; }
.profile-sources { display: grid; gap: 7px; }
.profile-sources a {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 9px;
  color: #185ea9;
  text-decoration: none;
}
.profile-sources a:hover { background: #edf3f9; }
.profile-sources span { overflow-wrap: anywhere; font-size: 13px; font-weight: 680; }
.profile-sources small { overflow-wrap: anywhere; color: #747a82; font-size: 11px; }
.profile-source-empty { color: var(--cortex-muted); font-size: 13px; }
.profile-warnings { display: grid; gap: 5px; }
.profile-warnings p { margin: 0; color: #825713; font-size: 13px; line-height: 1.45; }

.profile-form-error { margin: 18px 0 0; }
.profile-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; }
.profile-form-actions .button { min-width: 150px; min-height: 52px; }

.trial-verification {
  margin-top: 28px;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px 26px;
  align-items: center;
  border: 1px solid var(--cortex-line);
  border-radius: 18px;
  background: #f7f7f5;
}
.trial-verification-copy h3 { margin: 5px 0 5px; color: var(--cortex-text); font-size: 19px; }
.trial-verification-copy p { max-width: 590px; margin: 0; color: var(--cortex-muted); font-size: 13px; line-height: 1.5; }
#trialVerificationRequest { min-width: 190px; display: grid; justify-items: end; gap: 7px; }
#trialVerificationRequest .button { min-height: 48px; }
.trial-destination { margin: 0; color: var(--cortex-muted); font-size: 11px; text-align: right; }
.trial-verification-form { grid-column: 1 / -1; display: grid; gap: 8px; }
.trial-verification-form > label { color: #46494e; font-size: 13px; font-weight: 700; }
.trial-verification-form > div { display: grid; grid-template-columns: minmax(0, 250px) auto; gap: 10px; justify-content: start; }
.trial-verification-form input {
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid #cfd2d6;
  border-radius: 13px;
  background: #fff;
  color: var(--cortex-text);
  font: 780 24px/1 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: 0.18em;
  text-align: center;
}
.trial-verification-form .button { min-height: 58px; }
.trial-verification-verified { display: flex; align-items: center; gap: 11px; color: #176f49; }
.trial-verification-verified > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: #dff2e7; font-weight: 900; }
.trial-verification-verified > div { display: grid; gap: 2px; }
.trial-verification-verified b { font-size: 14px; }
.trial-verification-verified small { color: #668073; font-size: 11px; }
.trial-verification > .form-error { grid-column: 1 / -1; margin: 0; }

@media (max-width: 1100px) {
  .organization-profile-card { width: min(820px, calc(100vw - 28px)); padding: 34px 38px 40px; }
  .profile-fields-two { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .company-profile-button { min-width: 48px; min-height: 48px; padding: 5px; border: 1px solid var(--cortex-line); background: #fff; }
  .company-profile-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .company-profile-copy,
  .company-profile-chevron { display: none; }
  .company-profile-button.profile-disabled { min-width: 0; padding: 0; border: 0; background: transparent; }
  .company-profile-button.profile-disabled .company-profile-copy { display: grid; }
  .company-profile-button.profile-disabled .company-profile-name strong { max-width: 180px; }
  .organization-profile-card { width: min(720px, calc(100vw - 20px)); max-height: calc(100dvh - 20px); padding: 28px 22px 30px; border-radius: 24px; }
  .organization-profile-heading { grid-template-columns: 44px minmax(0, 1fr); padding: 2px 42px 22px 0; }
  .profile-heading-mark { width: 44px; height: 44px; }
  .organization-profile-status { grid-column: 2; justify-self: start; }
  .profile-extract-button { min-height: 52px; }
  .trial-verification { grid-template-columns: 1fr; }
  #trialVerificationRequest { min-width: 0; justify-items: stretch; }
  #trialVerificationRequest .button { min-height: 52px; }
  .trial-destination { text-align: left; }
  .trial-verification-form { grid-column: auto; }
  .trial-verification-form > div { grid-template-columns: 1fr; }
  .trial-verification-form .button { width: 100%; }
}

@media (max-width: 600px) {
  .mobile-cortex-brand { display: none; }
  .topbar.profile-feature-disabled { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .topbar.profile-feature-disabled .company-profile-button { justify-self: start; }
  .topbar.profile-feature-disabled .top-actions { width: 100%; }
  .organization-profile-modal { padding: 0; }
  .organization-profile-card { width: 100vw; height: 100dvh; max-height: 100dvh; padding: 24px 18px 28px; border: 0; border-radius: 0; }
  .organization-profile-heading { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding-right: 38px; }
  .profile-heading-mark { width: 40px; height: 40px; border-radius: 13px; }
  .organization-profile-heading h2 { font-size: 28px; }
  .organization-profile-heading p { font-size: 14px; }
  .profile-guidance { align-items: flex-start; flex-direction: column; }
  .profile-group { padding: 23px 0; }
  .profile-group legend { align-items: flex-start; }
  .profile-group legend b { font-size: 17px; }
  .profile-group input,
  .profile-group textarea { min-height: 54px; font-size: 17px; }
  .profile-website-head { align-items: stretch; flex-direction: column; gap: 9px; }
  .profile-extract-button { width: 100%; min-height: 54px; font-size: 15px; }
  .profile-group textarea { min-height: 104px; }
  .profile-form-actions { align-items: stretch; flex-direction: column-reverse; margin: 0; padding: 18px 0 calc(2px + env(safe-area-inset-bottom)); }
  .profile-form-actions .button { width: 100%; min-height: 54px; font-size: 16px; }
  .trial-verification { margin-top: 22px; padding: 19px; }
}

/* Secondary background work stays compact and separate from employee cards. */
.cleanup-tasks { margin-top: 24px; border: 1px solid var(--cortex-line-strong); border-radius: 18px; background: var(--cortex-surface); overflow: hidden; }
.cleanup-tasks-header { display: flex; align-items: center; gap: 16px; min-height: 68px; padding: 18px 24px; cursor: pointer; list-style: none; }
.cleanup-tasks-header::-webkit-details-marker { display: none; }
.cleanup-tasks-title { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 650; }
.cleanup-tasks-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 8px; background: #f0f2f1; color: var(--cortex-muted); font-size: 12px; font-weight: 600; }
.cleanup-tasks-summary { margin-left: auto; color: var(--cortex-muted); font-size: 12px; }
.cleanup-tasks-chevron { width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); flex: 0 0 auto; margin: -4px 2px 0 6px; color: var(--cortex-muted); }
.cleanup-tasks[open] .cleanup-tasks-chevron { transform: rotate(225deg); margin-top: 4px; }
.cleanup-tasks-body { padding: 0 24px 8px; }
.cleanup-tasks-note { margin: 0 0 12px; color: var(--cortex-muted); font-size: 13px; line-height: 1.6; }
.cleanup-task-list { list-style: none; padding: 0; margin: 0; }
.cleanup-task-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 18px 0; border-top: 1px solid var(--cortex-line-strong); }
.cleanup-task-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: #f1f3f2; color: #737e78; font-size: 17px; }
.cleanup-task-symbol.needs-attention { background: #fff3de; color: #986524; }
.cleanup-task-copy strong { font-size: 14px; font-weight: 650; }
.cleanup-task-status { margin-left: 12px; color: var(--cortex-muted); font-size: 12px; }
.cleanup-task-status.needs-attention { color: #986524; }
.cleanup-task-error { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: #986524; overflow-wrap: anywhere; }
.cleanup-task-link { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; padding: 8px 0 8px 12px; border: 0; background: transparent; color: #42685b; font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
.cleanup-task-link:hover { color: #214c3b; text-decoration: underline; text-underline-offset: 4px; }
.cleanup-task-link:focus-visible, .cleanup-tasks-header:focus-visible { outline: 2px solid #42685b; outline-offset: -3px; border-radius: 8px; }
@media (max-width: 600px) {
  .cleanup-tasks-header { padding: 16px; gap: 10px; flex-wrap: wrap; }
  .cleanup-tasks-summary { order: 3; width: 100%; margin-left: 0; }
  .cleanup-tasks-chevron { margin-left: auto; }
  .cleanup-tasks-body { padding: 0 16px 4px; }
  .cleanup-task-row { gap: 10px; }
  .cleanup-task-status { display: block; margin: 5px 0 0; }
}

/* Bridge upgrade entry on each computer row */
.device-update-hint { color: #b45309; font-weight: 700; }
.device-update-panel { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 2px; padding: 12px 14px; border: 1px solid #f3d9a4; border-radius: 12px; background: #fffaf0; }
.device-update-panel b { color: #8a4b08; font-size: 13px; margin: 0; }
.device-update-panel small { color: #6b5a40; font-size: 12px; line-height: 1.55; margin: 0; }
.device-update-panel .command-box { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fff; color: #4e4637; font: 11px/1.6 "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
.device-update-panel .credential-button { justify-self: start; min-height: 40px; padding: 0 16px; border: 1px solid #e6cf9f; border-radius: 999px; background: #fbf3e2; color: #9a6a12; font-size: 13px; font-weight: 750; cursor: pointer; }

/* Updating and installing: numbered steps; the command is copied, not shown. */
.update-steps, .install-steps { margin: 10px 0 12px; padding-left: 22px; color: #5d5749; font-size: 14px; line-height: 1.7; }
.update-steps li + li, .install-steps li + li { margin-top: 4px; }
.device-update-panel .update-steps { margin: 4px 0 8px; }
.device-update-panel .button { justify-self: start; }

/* AI model sign-in status: one line per employee or computer, and an alert when someone can't answer. */
.model-auth-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 8px 0 0; padding: 7px 10px; border-radius: 10px; background: #f3f6f2; color: #4d6055; font-size: 13px; line-height: 1.5; }
.model-auth-line > i { flex: 0 0 auto; width: 8px; height: 8px; margin: 0; border-radius: 50%; background: #3f9a62; box-shadow: none; }
.model-auth-line b { margin-right: 6px; font-weight: 600; }
.model-auth-line.is-expired, .model-auth-line.is-missing { background: #fdecea; color: #8a2a20; }
.model-auth-line.is-expired > i, .model-auth-line.is-missing > i { background: #c8402f; }
.model-auth-line.is-soon { background: #fff6e5; color: #74531b; }
.model-auth-line.is-soon > i { background: #d08a1d; }
.model-auth-line.is-unknown { color: #6b766f; }
.model-auth-line.is-unknown > i { background: #b9c2bc; }
.model-auth-action { margin-left: auto; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.model-auth-alert { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 0 0 12px; padding: 12px 14px; border: 1px solid #f2c4bf; border-radius: 12px; background: #fdecea; color: #8a2a20; font-size: 14px; line-height: 1.6; }
.model-auth-alert p { flex: 1 1 260px; margin: 0; }
.model-auth-alert b { display: block; }
.model-auth-alert .button { min-height: 38px; padding: 6px 16px; white-space: nowrap; }
.weixin-model-alert { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 4px 0 16px; padding: 12px 14px; border: 1px solid #f2c4bf; border-radius: 12px; background: #fdecea; color: #8a2a20; font-size: 14px; line-height: 1.6; }
.weixin-model-alert p { flex: 1 1 260px; margin: 0; }
.weixin-model-alert b { display: block; }
.weixin-model-reason { margin: 8px 0 0; color: #8a2a20; font-size: 13px; }
.weixin-model-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin: 12px 0; padding: 12px 14px; border: 1px solid #e3e7e1; border-radius: 12px; background: #fff; font-size: 14px; }
.weixin-model-row b { display: block; }
.weixin-model-row small { color: #4d6055; }
.weixin-model-row small.is-expired, .weixin-model-row small.is-missing { color: #a1362c; font-weight: 600; }
.weixin-model-row small.is-soon { color: #8a5a12; font-weight: 600; }
.weixin-model-row .button { min-height: 36px; padding: 6px 14px; font-size: 14px; }

/* Background tasks: release every employee bound to a computer that can no longer clean up. */
.cleanup-release { display: grid; gap: 10px; margin: 12px 0; }
.cleanup-release-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 14px; border: 1px solid #f0d9a8; border-radius: 12px; background: #fff8eb; color: #5d4a22; font-size: 14px; line-height: 1.6; }
.cleanup-release-row p { flex: 1 1 320px; margin: 0; }
.cleanup-release-row b { display: block; color: #3e3115; }
.cleanup-release-row .button { min-height: 38px; padding: 6px 16px; white-space: nowrap; }

/* Works logo (brand assets 2026-10-24): the horizontal lockup replaces the old
   mark and text; the standalone bee is the small mark. Kept at its original
   proportions and never narrower than the brand book's 180px. */
.brand-lockup.works-lockup { display: block; }
.brand-lockup .works-wordmark { display: block; width: 180px; max-width: none; height: auto; }
/* Small marks use the favicon: the same bee with a simplified fill that stays clear at 32–42px. */
.brand-mark img[src="/favicon.svg"],
.mobile-cortex-brand img[src="/favicon.svg"] { object-fit: contain; padding: 2px; background: #F7F5EF; }


/* 连接这台电脑 (2026-10-28, Pin): two numbered steps — the runtime environment first, then the Cortex
   connection assistant (local Bridge) with its pairing code as sub-steps 2.1–2.3. */
.environment-card > .muted, .environment-card .connect-step p, .environment-card .connect-step h3 { text-wrap: pretty; }
.environment-card .connect-step { margin-top: 18px; padding: 20px 22px; border: 1px solid #e9e1d3; border-radius: 18px; background: #fff; }
.environment-card .connect-step-head { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; }
.environment-card .connect-step-index { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1d1a14; color: #ffd070; font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.environment-card .connect-step-head h3 { margin: 4px 0 6px; color: #1d1a14; font-size: 18px; line-height: 1.35; }
.environment-card .connect-step-head p { margin: 0; color: #6b6252; font-size: 14px; line-height: 1.65; }
.environment-card .connect-step-body { margin: 14px 0 0 46px; }
.environment-card .connect-step-body > .muted { margin: 10px 0 0; font-size: 13px; }
.environment-card .connect-step-body > details { margin-top: 8px; }
.environment-card .connect-substeps { margin: 14px 0 0 46px; padding: 0; list-style: none; }
.environment-card .connect-substeps > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 14px 0; border-top: 1px solid #efe8db; }
.environment-card .connect-substeps > li:last-child { padding-bottom: 0; }
.environment-card .connect-substep-index { padding-top: 1px; color: #9a6a12; font: 700 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.environment-card .connect-substep-body { min-width: 0; }
.environment-card .connect-substep-title { display: block; color: #3e3931; font-size: 14.5px; line-height: 1.5; }
.environment-card .connect-substep-hint { margin: 4px 0 0; color: #847b6a; font-size: 12.5px; line-height: 1.6; }
.environment-card .connect-substeps .connection-download { padding: 0; border-bottom: 0; }
.environment-card .connect-substeps .connection-download b { color: #3e3931; font-size: 14.5px; }
.environment-card .connect-substeps .connection-fallback { margin-top: 10px; padding: 10px 0 0; }
.environment-card .connect-substeps .environment-form { margin: 10px 0 0; }
.environment-card .connect-substeps .connection-panel { margin-top: 10px; }
.environment-card .connect-devices-title { margin: 26px 0 4px; color: #1d1a14; font-size: 16px; }
@media (max-width: 600px) {
  .environment-card .connect-step { padding: 16px; }
  .environment-card .connect-step-body, .environment-card .connect-substeps { margin-left: 0; }
}

.device-update-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
