@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --ink: #181827;
  --ink-soft: #333347;
  --muted: #737389;
  --muted-2: #9898aa;
  --line: #e7e5ed;
  --line-strong: #d7d3df;
  --canvas: #f7f7fa;
  --paper: #ffffff;
  --nav: #20202b;
  --nav-deep: #17171f;
  --purple: #6c45ee;
  --purple-dark: #5632d8;
  --purple-soft: #f1edff;
  --purple-line: #dcd2ff;
  --orange: #ef8d3d;
  --orange-soft: #fff3e9;
  --green: #1e8a63;
  --green-soft: #e9f7f1;
  --amber: #a56c12;
  --amber-soft: #fff5dc;
  --danger: #b33e39;
  --danger-soft: #fff0ee;
  --blue: #4269c8;
  --blue-soft: #eef3ff;
  --shadow-sm: 0 1px 3px rgb(24 24 39 / 5%);
  --shadow-md: 0 12px 35px rgb(24 24 39 / 8%);
  --font-family-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-page-title: 26px;
  --font-section-title: 16px;
  --font-body: 14px;
  --font-menu: 14px;
  --font-table: 13px;
  --font-small: 12px;
  --font-badge: 11px;
  --line-page-title: 32px;
  --line-section-title: 22px;
  --line-body: 21px;
  --line-table: 18px;
  --line-small: 16px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  font-family: var(--font-family-ui);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, a, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { display: block; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
::selection { background: var(--purple-line); color: var(--ink); }

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgb(108 69 238 / 25%);
  outline-offset: 2px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--purple);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .15em;
}

.muted, .empty-state { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.align-right { text-align: right !important; }
.table-subline { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.primary-button {
  border: 1px solid var(--purple);
  background: var(--purple);
  color: #fff;
  box-shadow: 0 5px 14px rgb(108 69 238 / 18%);
}

.primary-button:hover:not(:disabled) { background: var(--purple-dark); border-color: var(--purple-dark); transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft); }
.secondary-button:hover:not(:disabled) { border-color: #bdb7ca; background: #faf9fc; }
.primary-button:disabled, .secondary-button:disabled, .filter-tab:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.primary-button.compact, .secondary-button.compact { min-height: 34px; padding: 0 12px; font-size: 11px; }
.full-button { width: 100%; }
.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

input, select, textarea {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}

input::placeholder, textarea::placeholder { color: #aaa6b4; }

/* Login */

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(270px, 31vw) minmax(0, 1fr);
  background: #f5f4f8;
}

.login-sidebar {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 80%, rgb(108 69 238 / 24%), transparent 31%),
    linear-gradient(150deg, var(--nav-deep), #292837);
  color: #fff;
}

.login-sidebar::after {
  position: absolute;
  right: -95px;
  bottom: 13%;
  width: 260px;
  height: 260px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  box-shadow: 0 0 0 45px rgb(255 255 255 / 2%), 0 0 0 90px rgb(255 255 255 / 2%);
  content: "";
}

.sidebar-brand {
  display: flex;
  height: 76px;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  padding: 17px 20px;
  background: var(--nav);
  color: #fff;
  letter-spacing: .06em;
}

.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 13px; letter-spacing: .075em; }
.sidebar-brand small { margin-top: 3px; color: var(--orange); font-size: 9px; letter-spacing: .24em; }

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--orange);
  border-radius: 9px;
  color: var(--orange);
  font-size: 20px;
  font-weight: 900;
}

.login-logo { background: transparent; padding: 26px 30px; }
.login-sidebar-copy { position: relative; z-index: 1; max-width: 430px; margin: auto 30px; }
.version-label { display: inline-flex; padding: 6px 9px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 999px; color: #bdb9cc; font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.login-sidebar-copy h2 { max-width: 390px; margin: 20px 0 13px; font-size: clamp(30px, 3.2vw, 48px); line-height: 1.04; letter-spacing: -.045em; }
.login-sidebar-copy p { max-width: 370px; margin: 0; color: #aaa6ba; font-size: 14px; line-height: 1.65; }
.login-trust { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; margin: 0 30px 30px; color: #e7e4ee; font-size: 11px; }
.login-trust svg { width: 20px; height: 20px; fill: none; stroke: var(--orange); stroke-width: 1.7; }
.login-trust small { color: #9692a4; }

.login-stage {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 430px);
  align-items: center;
  gap: clamp(35px, 7vw, 110px);
  padding: clamp(35px, 7vw, 100px);
}

.login-welcome { max-width: 620px; }
.login-welcome h1 { margin: 9px 0 34px; font-size: clamp(32px, 4vw, 57px); line-height: 1.03; letter-spacing: -.055em; }
.feature-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; align-items: flex-start; gap: 15px; }
.feature-list > li > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--purple-soft); color: var(--purple); font-size: 10px; font-weight: 900; }
.feature-list li div { display: grid; gap: 4px; }
.feature-list strong { font-size: 13px; }
.feature-list small { color: var(--muted); line-height: 1.45; }

.login-card {
  position: relative;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 26px 70px rgb(24 24 39 / 10%);
}

.login-card-mark { display: grid; width: 46px; height: 46px; margin-bottom: 25px; place-items: center; border-radius: 12px; background: var(--nav); color: var(--orange); font-size: 22px; font-weight: 900; }
.login-card h2 { margin: 8px 0 11px; font-size: 25px; letter-spacing: -.035em; }
.login-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-action { width: 100%; min-height: 48px; justify-content: space-between; margin-top: 24px; padding: 0 20px; }
.login-note { display: flex; align-items: center; gap: 9px; margin-top: 20px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.login-note svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: var(--green); stroke-width: 1.8; }

/* Application shell */

.app-shell { display: grid; min-height: 100vh; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.main-nav { display: grid; gap: 3px; padding: 16px 11px; overflow-y: auto; }
.nav-label { margin: 3px 11px 7px; color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .16em; }
.nav-label-spaced { margin-top: 14px; }
.nav-item {
  display: flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #646375;
  font-size: 11px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover { background: #f7f6fa; color: var(--ink); }
.nav-item.active { background: var(--purple-soft); color: var(--purple-dark); font-weight: 800; }
.nav-icon { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.sidebar-project { display: grid; gap: 5px; margin: auto 13px 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9fc; }
.sidebar-project > span { color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.sidebar-project strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-project small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.sidebar-project i, .environment-switch i, .environment-card i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple-dark); font-size: 12px; font-weight: 900; }
.user-meta { display: grid; min-width: 0; flex: 1; }
.user-meta strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.user-meta span { margin-top: 2px; color: var(--muted); font-size: 9px; }
.icon-only { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; }
.icon-only:hover { border-color: var(--line-strong); background: #faf9fc; color: var(--ink); }

.app-content { min-width: 0; background: var(--canvas); }
.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  min-height: 76px;
  grid-template-columns: minmax(180px, 1fr) auto minmax(300px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 12px 27px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(12px);
}

.breadcrumbs { display: flex; align-items: center; gap: 9px; min-width: 0; color: var(--muted); font-size: 11px; }
.breadcrumbs i { color: #c2bfca; font-style: normal; }
.breadcrumbs strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.environment-switch { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9fc; }
.environment-switch > span { color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.environment-switch strong { display: flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }

.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.context-chip { display: inline-flex; padding: 7px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; }
.agent-context { border-color: #cce8dc; background: var(--green-soft); color: var(--green); }
.top-user { display: grid; min-width: 95px; padding-left: 10px; border-left: 1px solid var(--line); }
.top-user span { overflow: hidden; max-width: 130px; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.top-user small { margin-top: 2px; color: var(--muted); font-size: 8px; }

.app-main { width: min(1600px, 100%); margin: 0 auto; padding: 26px 28px 18px; }
.status { width: min(1600px, 100%); min-height: 26px; margin: 0 auto; padding: 0 28px 18px; color: var(--muted); font-size: 10px; }

/* Shared page structures */

.view-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.view-header h2 { margin: 0; font-size: 26px; letter-spacing: -.045em; }
.view-header .muted { max-width: 720px; margin: 7px 0 0; font-size: 12px; line-height: 1.5; }
.header-actions { display: flex; align-items: center; gap: 9px; }

.control-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 18px; }
.content-column { min-width: 0; }
.side-column, .context-rail { display: grid; gap: 12px; min-width: 0; }
.rail-card { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.rail-card > p:first-of-type { margin-top: 0; }
.rail-card > p:last-of-type { margin-bottom: 0; }
.compact-card { padding: 13px 15px; }
.compact-card p { font-size: 10px; line-height: 1.5; }
.rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.rail-heading strong { color: var(--purple); font-size: 12px; letter-spacing: 0; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

.surface-toolbar { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; border: 1px solid var(--line); border-bottom: 0; border-radius: 9px 9px 0 0; background: #fff; }
.search-box { display: flex; width: min(420px, 100%); align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #faf9fc; color: var(--muted); }
.search-box input { width: 100%; height: 35px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.result-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.result-count b { color: var(--ink); }

.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.section-heading p { margin: 5px 0 0; font-size: 10px; line-height: 1.5; }
.section-label { margin: 20px 0 12px; font-size: 14px; }
.spaced { margin-top: 29px; }

.table-shell { overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.surface-toolbar + .table-shell { border-radius: 0 0 9px 9px; }
.table-shell table { width: 100%; border-collapse: collapse; }
.table-shell th, .table-shell td { padding: 12px 13px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; white-space: nowrap; }
.table-shell th { color: var(--muted-2); background: #faf9fc; font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.table-shell tr:last-child td { border-bottom: 0; }
.table-shell tbody tr:hover { background: #fcfbfe; }

.state-badge, .environment-label, .gate-chip, .pill, .role-label {
  display: inline-flex;
  width: max-content;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .02em;
}

.state-badge.success { background: var(--green-soft); color: var(--green); }
.state-badge.warning { background: var(--amber-soft); color: var(--amber); }
.state-badge.danger { background: var(--danger-soft); color: var(--danger); }
.state-badge.neutral { background: #f0eff3; color: #676576; }
.environment-label.staging { background: var(--green-soft); color: var(--green); }
.environment-label.production { background: var(--danger-soft); color: var(--danger); }
.gate-chip { background: var(--danger-soft); color: var(--danger); }
.neutral-gate { background: var(--purple-soft); color: var(--purple-dark); }
.pill { background: #f1f0f4; color: #6c6979; }
.role-label { background: var(--purple-soft); color: var(--purple-dark); }
.danger-text { color: var(--danger) !important; }

.empty-card { padding: 27px; border: 1px dashed var(--line-strong); border-radius: 9px; background: #fff; text-align: center; }
.empty-card h3 { margin: 0 0 7px; font-size: 14px; }
.empty-card p { margin: 0; font-size: 11px; }

.filter-tabs { display: flex; align-items: center; gap: 3px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.filter-tab { min-height: 38px; padding: 0 13px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 10px; font-weight: 800; cursor: pointer; }
.filter-tab:hover:not(:disabled), .filter-tab.active { color: var(--purple); }
.filter-tab.active { border-bottom-color: var(--purple); }
.compact-tabs { margin: 0; border: 0; }

.notice { display: grid; gap: 5px; margin-top: 18px; padding: 13px; border: 1px solid #f0d5c1; border-radius: 8px; background: var(--orange-soft); text-align: left; }
.notice span { color: var(--muted); font-size: 10px; line-height: 1.5; }

.locked-view { max-width: 700px; margin: 8vh auto; padding: 45px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-md); text-align: center; }
.locked-view h2 { margin: 12px 0 9px; font-size: 27px; }
.locked-view > p { color: var(--muted); line-height: 1.6; }
.locked-icon { display: grid; width: 50px; height: 50px; margin: 0 auto 17px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 24px; }

/* Chat */

.chat-workspace {
  display: grid;
  min-height: calc(100vh - 138px);
  grid-template-columns: 226px minmax(390px, 1fr) 267px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.conversation-panel { min-width: 0; padding: 17px 13px; border-right: 1px solid var(--line); background: #faf9fc; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin: 0; font-size: 14px; }
.round-button { display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--purple-line); border-radius: 7px; background: var(--purple-soft); color: var(--purple); font-size: 18px; cursor: pointer; }
.privacy-banner { margin: 15px 0 13px; padding: 8px 9px; border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 9px; font-weight: 800; }
.project-picker { margin-bottom: 14px; }
.project-picker label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 800; }
.project-picker select { width: 100%; height: 35px; padding: 0 9px; font-size: 10px; }
.conversation-list { display: grid; gap: 4px; max-height: calc(100vh - 340px); overflow-y: auto; }
.conversation-item { display: grid; width: 100%; gap: 4px; padding: 10px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.conversation-item > span { overflow: hidden; font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item small { color: var(--muted); font-size: 8px; }
.conversation-item:hover { background: #fff; }
.conversation-item.active { border-color: var(--purple-line); background: var(--purple-soft); }

.chat-panel { display: grid; min-width: 0; grid-template-rows: auto minmax(280px, 1fr) auto auto; background: #fff; }
.chat-heading { display: flex; min-height: 72px; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.chat-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.heading-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.private-badge, .agent-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 900; }
.private-badge { background: var(--green-soft); color: var(--green); }
.agent-badge { background: var(--blue-soft); color: var(--blue); }
.messages { display: flex; min-height: 0; flex-direction: column; gap: 14px; padding: 22px; overflow-y: auto; background: #fff; }
.message { max-width: min(760px, 88%); padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #faf9fc; font-size: 12px; line-height: 1.55; }
.message.user { align-self: flex-end; border-color: var(--purple-line); background: var(--purple-soft); }
.message.agent { align-self: flex-start; }
.message.pending { border-style: dashed; }
.message-author { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.chat-empty { display: grid; place-items: center; align-self: center; margin: auto; text-align: center; }
.chat-empty > span { display: grid; width: 44px; height: 44px; margin-bottom: 9px; place-items: center; border-radius: 13px; background: var(--purple-soft); color: var(--purple); font-size: 20px; }
.chat-empty strong { color: var(--ink); }
.chat-empty p { max-width: 320px; margin: 5px 0; font-size: 10px; }
.agent-thinking { display: flex; align-items: center; gap: 8px; }
.agent-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); animation: pulse 1.4s ease-in-out infinite; }

.chat-tools { display: flex; min-height: 48px; align-items: center; gap: 12px; padding: 7px 17px; border-top: 1px solid var(--line); }
.privacy-hint { color: var(--muted); font-size: 9px; }
.composer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 9px; padding: 11px 17px 16px; }
.composer-input { padding: 8px 10px 6px; border: 1px solid var(--line-strong); border-radius: 9px; background: #fff; }
.composer-input:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgb(108 69 238 / 10%); }
.composer textarea { display: block; width: 100%; min-height: 42px; max-height: 180px; padding: 3px; border: 0; outline: 0; resize: vertical; font-size: 12px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 5px; }
.composer-tool { padding: 4px 0; border: 0; background: transparent; color: var(--purple); font-size: 9px; font-weight: 800; cursor: pointer; }
.mode-picker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 750; }
.mode-picker select { height: 27px; padding: 0 7px; font-size: 9px; }
.send-button { min-width: 77px; }
.context-rail { padding: 13px; border-left: 1px solid var(--line); background: #faf9fc; align-content: start; }
.context-list { display: grid; gap: 9px; margin: 0; }
.context-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.context-list dt { color: var(--muted); font-size: 9px; }
.context-list dd { max-width: 135px; margin: 0; overflow: hidden; font-size: 9px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.agent-summary { display: flex; align-items: center; gap: 9px; }
.agent-orb { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: var(--purple); color: #fff; }
.agent-summary > div { display: grid; gap: 3px; min-width: 0; }
.agent-summary strong { font-size: 11px; }
.agent-summary small { color: var(--muted); font-size: 8px; }
.permission-line, .gate-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 9px; }
.permission-line span, .gate-row span { color: var(--muted); }
.permission-line strong, .gate-row strong { font-size: 9px; text-align: right; }
.activity-card summary, .expandable-library > summary, .ux-reference > summary { cursor: pointer; list-style: none; }
.activity-card summary::-webkit-details-marker, .expandable-library > summary::-webkit-details-marker, .ux-reference > summary::-webkit-details-marker { display: none; }
.activity-card summary { display: flex; justify-content: space-between; color: var(--ink); font-size: 10px; font-weight: 800; }
.activity-card summary span { color: var(--purple); }
.run-timeline { display: grid; gap: 6px; max-height: 190px; margin-top: 12px; overflow-y: auto; }
.run-timeline > span { display: grid; gap: 2px; padding: 7px 8px; border-left: 2px solid var(--purple); background: #faf9fc; }
.run-timeline b { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.run-timeline small { color: var(--muted); font-size: 7px; }

/* Projects */

.project-table td:first-child { min-width: 240px; }
.project-cell { display: flex; align-items: center; gap: 10px; }
.project-cell > div { display: grid; gap: 3px; }
.project-cell strong { font-size: 11px; }
.project-cell small { color: var(--muted); font-size: 9px; }
.project-mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--orange-soft); color: #bd6827; font-size: 9px; font-weight: 900; }
.small-mark { width: 29px; height: 29px; }
.recent-list { display: grid; }
.recent-project, .quick-action { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.recent-project:last-child, .quick-action:last-child { border-bottom: 0; }
.recent-project > span:nth-child(2), .quick-action > div { display: grid; min-width: 0; flex: 1; gap: 2px; }
.recent-project strong, .quick-action strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.recent-project small, .quick-action small { color: var(--muted); font-size: 8px; }
.recent-project b, .quick-action b { color: var(--purple); font-size: 12px; }
.quick-action > span { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 7px; background: var(--purple-soft); color: var(--purple); font-size: 12px; }

/* Materials */

.material-tabs, .settings-tabs { margin-bottom: 18px; background: transparent; }
.library-section { margin-top: 15px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.first-section { margin-top: 0; }
.library-files { display: grid; gap: 7px; }
.library-file { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.file-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: var(--orange-soft); color: #bd6827; font-size: 8px; font-weight: 900; }
.material-main { display: grid; min-width: 0; flex: 1; gap: 3px; }
.material-main strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.material-main span { color: var(--muted); font-size: 8px; }
.material-library-item { display: block; }
.material-summary { display: flex; align-items: center; gap: 10px; }
.material-version-list { display: grid; gap: 6px; margin: 10px 0; }
.material-version { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; border-radius: 7px; background: #faf9fc; }
.material-version > div { display: grid; gap: 3px; }
.material-version strong { font-size: 9px; }
.material-version span { color: var(--muted); font-size: 8px; }
.material-upload-form { display: flex; align-items: center; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line); }
.material-upload-form input { min-width: 0; flex: 1; border: 0; font-size: 9px; }
.inline-form { display: grid; grid-template-columns: minmax(180px, 1fr) 170px auto; gap: 9px; margin-bottom: 17px; padding: 13px; border: 1px solid var(--purple-line); border-radius: 9px; background: var(--purple-soft); }
.inline-form input, .inline-form select { height: 38px; padding: 0 10px; font-size: 10px; }
.expandable-library > summary { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.expandable-library > summary > span:first-child { display: grid; gap: 3px; }
.expandable-library > summary strong { font-size: 14px; }
.expandable-library > summary small { color: var(--muted); font-size: 9px; }
.expandable-library[open] > summary { margin-bottom: 14px; }
.mockup-library, .mockup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.mockup-card, .mockup-grid figure { overflow: hidden; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.mockup-card img, .mockup-grid img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); }
.mockup-card > div { display: grid; gap: 3px; padding: 9px; }
.mockup-card > div strong { font-size: 9px; }
.mockup-card > div span { color: var(--muted); font-size: 8px; }
.mockup-card > .secondary-button { margin: 0 9px 9px; }
.mockup-grid figcaption { padding: 8px; color: var(--muted); font-size: 8px; }
.diagnostic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 7px; }
.diagnostic { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #faf9fc; }
.diagnostic span { color: var(--muted); font-size: 8px; }
.diagnostic strong { font-size: 10px; }
.metric-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.metric-list > div { display: grid; gap: 3px; padding: 9px 5px; border-radius: 7px; background: #faf9fc; text-align: center; }
.metric-list strong { color: var(--purple); font-size: 16px; }
.metric-list span { color: var(--muted); font-size: 7px; }

/* Work orders */

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 17px; }
.metric-card { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-top: 3px solid #aaa6b3; border-radius: 8px; background: #fff; }
.metric-card.purple { border-top-color: var(--purple); }
.metric-card.amber { border-top-color: #d4962e; }
.metric-card.green { border-top-color: var(--green); }
.metric-card > span { color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.metric-card strong { font-size: 24px; letter-spacing: -.04em; }
.metric-card small { color: var(--muted); font-size: 8px; }
.work-order-list { overflow: hidden; border: 1px solid var(--line); border-radius: 0 0 9px 9px; background: #fff; }
.work-order-columns { display: grid; grid-template-columns: 92px minmax(170px, 1fr) 120px 110px; gap: 10px; padding: 9px 13px; border-bottom: 1px solid var(--line); background: #faf9fc; color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.operation-card { padding: 0 13px; border-bottom: 1px solid var(--line); background: #fff; }
.operation-card:last-child { border-bottom: 0; }
.work-order-main { display: grid; min-height: 67px; grid-template-columns: 92px minmax(170px, 1fr) 120px 110px; align-items: center; gap: 10px; }
.public-id { color: var(--purple); font-size: 9px; }
.work-order-main h3 { margin: 0; font-size: 10px; }
.work-order-main p { margin: 4px 0 0; color: var(--muted); font-size: 8px; }
.updated-at { color: var(--muted); font-size: 8px; }
.operation-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; padding: 0 0 10px; }
.transition-form { display: flex; align-items: center; gap: 7px; }
.transition-form select { height: 34px; padding: 0 8px; font-size: 9px; }
.final-state { font-size: 8px; }
.context-package-slot:empty { display: none; }
.context-package-panel { display: grid; gap: 11px; margin-bottom: 12px; padding: 12px; border: 1px solid var(--purple-line); border-radius: 8px; background: var(--purple-soft); }
.context-package-panel p { margin: 4px 0 0; font-size: 9px; }
.context-history, .context-choices { display: grid; gap: 6px; }
.context-package-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.context-package-row > div { display: grid; gap: 3px; }
.context-package-row strong { font-size: 9px; }
.context-package-row span { color: var(--muted); font-size: 8px; }
.context-package-form { display: grid; gap: 9px; }
.context-choice { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }
.context-choice > span { display: grid; gap: 3px; }
.context-choice strong { font-size: 9px; }
.context-choice small { color: var(--muted); font-size: 8px; }
.work-order-panel { display: grid; grid-template-columns: 1fr 1.5fr 200px 115px auto; align-items: end; gap: 8px; margin-bottom: 16px; padding: 13px; border: 1px solid var(--purple-line); border-radius: 9px; background: var(--purple-soft); }
.work-order-panel input, .work-order-panel textarea, .work-order-panel select { min-height: 38px; padding: 7px 9px; font-size: 10px; }
.work-order-panel textarea { resize: vertical; }
.history-list { display: grid; }
.history-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history-row:last-child { border-bottom: 0; }
.history-row > i { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: #aaa6b3; }
.history-row > i.success { background: var(--green); }
.history-row > i.warning { background: #d4962e; }
.history-row > i.danger { background: var(--danger); }
.history-row > div { display: grid; min-width: 0; gap: 3px; }
.history-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.history-row span { color: var(--muted); font-size: 8px; }

.project-history-dialog { width: min(1040px, calc(100vw - 32px)); }
.project-history-shell { width: 100%; max-width: none; }
.project-history-content { display: grid; max-height: min(72vh, 760px); gap: 20px; padding: 18px 22px; overflow: auto; }
.project-history-content > section { display: grid; gap: 10px; }
.project-history-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project-history-summary > div { display: grid; gap: 3px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.project-history-summary strong { font-size: 20px; }
.project-history-summary span { color: var(--muted); font-size: 11px; }
.project-history-sources { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 9px; }
.history-source-card { display: grid; min-width: 0; gap: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; }
.history-source-card > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.history-source-card strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.history-source-card small { color: var(--muted); font-size: 10px; }
.history-source-card code,
.project-history-event code { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.project-history-events { display: grid; }
.project-history-event { position: relative; display: grid; grid-template-columns: 11px minmax(0, 1fr); gap: 10px; min-height: 76px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.project-history-event > i { z-index: 1; width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--muted-2); }
.project-history-event > i.success { background: var(--green); }
.project-history-event > i.danger { background: var(--danger); }
.project-history-event > i.production { background: #6548cc; }
.project-history-event > div { display: grid; min-width: 0; gap: 3px; }
.project-history-event header { display: flex; justify-content: space-between; gap: 12px; }
.project-history-event header span { color: var(--blue); font-size: 10px; font-weight: var(--weight-semibold); text-transform: uppercase; }
.project-history-event time,
.project-history-event small { color: var(--muted); font-size: 10px; }
.project-history-event strong { font-size: 12px; }

@media (max-width: 680px) {
  .project-history-summary { grid-template-columns: 1fr; }
  .project-history-event header { display: grid; gap: 2px; }
}

/* Deploy */

.environment-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 13px; }
.environment-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.dev-card { border-top: 3px solid var(--green); }
.prod-card { border-top: 3px solid var(--danger); }
.environment-card > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.environment-card > div:first-child > span { color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .1em; }
.environment-card > div:first-child strong { display: flex; align-items: center; gap: 7px; font-size: 10px; }
.environment-card p { margin: 9px 0 14px; color: var(--muted); font-size: 9px; }
.environment-card dl { display: flex; gap: 22px; margin: 0; }
.environment-card dl > div { display: grid; gap: 3px; }
.environment-card dt { color: var(--muted); font-size: 8px; }
.environment-card dd { margin: 0; font-size: 12px; font-weight: 850; }
.production-lock { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; padding: 13px 15px; border: 1px solid #efc3bd; border-radius: 9px; background: var(--danger-soft); }
.production-lock > div { display: grid; gap: 3px; }
.production-lock strong { font-size: 10px; }
.production-lock span { color: #805955; font-size: 9px; }
.production-lock .lock-mark { color: var(--danger); font-size: 9px; font-weight: 900; letter-spacing: .11em; }
.deploy-tabs { margin-bottom: 15px; }
.target-section { margin-top: 16px; }
.target-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.target-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9fc; }
.target-card > div { display: grid; gap: 3px; }
.target-card strong { font-size: 9px; }
.target-card span { color: var(--muted); font-size: 8px; }
.target-card .state-badge { justify-self: start; }
.timeline-list { display: grid; }
.timeline-item { display: flex; align-items: flex-start; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-item > i { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 4px; border-radius: 50%; background: #aaa6b3; }
.timeline-item > i.success { background: var(--green); }
.timeline-item > i.warning { background: #d4962e; }
.timeline-item > i.danger { background: var(--danger); }
.timeline-item > div { display: grid; min-width: 0; flex: 1; gap: 2px; }
.timeline-item strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.timeline-item span, .timeline-item small { color: var(--muted); font-size: 7px; }

/* Agents */

.provider-strip { margin-bottom: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 9px; }
.provider-card { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf9fc; }
.provider-logo { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--nav); color: #fff; font-size: 9px; font-weight: 900; }
.provider-card > div:nth-child(2) { display: grid; min-width: 0; flex: 1; gap: 3px; }
.provider-card strong { font-size: 10px; }
.provider-card span:not(.state-badge) { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.compact-agent .agent-orb { width: 29px; height: 29px; border-radius: 8px; font-size: 10px; }

/* Settings */

.settings-tabs { display: flex; border-bottom: 1px solid var(--line); }
.invite-panel { display: grid; grid-template-columns: 1fr 1.25fr 170px auto; align-items: end; gap: 9px; padding: 14px; border: 1px solid var(--purple-line); border-radius: 9px; background: var(--purple-soft); }
.invite-panel > div { display: grid; gap: 5px; }
.invite-panel label { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.invite-panel input, .invite-panel select, .user-admin-form select { height: 38px; padding: 0 9px; font-size: 9px; }
.avatar.small { width: 32px; height: 32px; font-size: 10px; }
.user-admin-form { display: flex; }
.role-explanation { padding: 9px 0; border-bottom: 1px solid var(--line); }
.role-explanation:last-child { padding-bottom: 0; border-bottom: 0; }
.role-explanation strong { color: var(--purple); font-size: 9px; }
.role-explanation p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.45; }

/* Help */

.help-hero { margin: -26px -28px 24px; padding: 34px 28px 37px; background: linear-gradient(130deg, #efebff, #f7f4ff 55%, #fff4eb); text-align: center; }
.help-hero h2 { margin: 5px 0 18px; font-size: 28px; letter-spacing: -.045em; }
.help-search { display: flex; width: min(560px, 100%); align-items: center; gap: 9px; margin: 0 auto; padding: 0 13px; border: 1px solid var(--purple-line); border-radius: 9px; background: #fff; box-shadow: 0 8px 22px rgb(75 53 142 / 8%); color: var(--muted); }
.help-search input { width: 100%; height: 45px; border: 0; outline: 0; font-size: 11px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.guide-card { display: grid; min-height: 155px; justify-items: start; gap: 7px; padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; cursor: pointer; }
.guide-card:hover { border-color: var(--purple-line); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.guide-card > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: var(--purple-soft); color: var(--purple); font-size: 14px; }
.guide-card strong { margin-top: 2px; font-size: 12px; }
.guide-card small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.guide-card b { margin-top: auto; color: var(--purple); font-size: 9px; }
.faq-heading { margin-top: 25px; }
.faq-list { display: grid; gap: 7px; }
.faq-list details { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.faq-list summary { cursor: pointer; font-size: 10px; font-weight: 800; }
.faq-list p { margin: 10px 0 2px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.ux-reference { margin-top: 20px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.ux-reference > summary { font-size: 10px; font-weight: 800; }
.ux-reference[open] > summary { margin-bottom: 13px; }
.support-card { padding: 22px 17px; border-radius: 10px; background: var(--nav); color: #fff; text-align: center; }
.support-icon { display: grid; width: 38px; height: 38px; margin: 0 auto 12px; place-items: center; border-radius: 11px; background: var(--purple); font-weight: 900; }
.support-card h3 { margin: 0; font-size: 14px; }
.support-card p { margin: 9px 0 15px; color: #aaa6b6; font-size: 9px; line-height: 1.55; }
.support-card .primary-button { width: 100%; }
.system-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.system-status:last-child { border-bottom: 0; }
.system-status span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 8px; }
.system-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.system-status i.warning-dot { background: #d4962e; }
.system-status i.blocked-dot { background: var(--danger); }
.system-status strong { font-size: 8px; }

/* Responsive */

@keyframes pulse { 50% { opacity: .35; transform: scale(.82); } }

@media (max-width: 1250px) {
  .chat-workspace { grid-template-columns: 220px minmax(380px, 1fr); }
  .context-rail { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 0; }
  .login-stage { grid-template-columns: 1fr; gap: 35px; }
  .login-welcome { display: none; }
  .login-card { width: min(440px, 100%); margin: auto; }
  .work-order-panel { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1060px) {
  .topbar { grid-template-columns: 1fr auto; }
  .environment-switch { display: none; }
  .control-layout { grid-template-columns: minmax(0, 1fr) 245px; }
  .invite-panel { grid-template-columns: 1fr 1fr; }
  .user-admin-form { align-items: flex-start; flex-wrap: wrap; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: sticky; width: 100%; min-width: 0; max-width: 100vw; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .sidebar-brand { display: none; }
  .main-nav { display: flex; width: 100%; min-width: 0; max-width: 100%; padding: 8px; overflow-x: auto; overflow-y: hidden; }
  .nav-label { display: none; }
  .nav-item { width: max-content; min-width: max-content; padding: 0 10px; }
  .sidebar-project, .sidebar-user { display: none; }
  .topbar { top: 55px; min-height: 63px; padding: 10px 18px; }
  .top-user, .agent-context { display: none; }
  .app-main { padding: 20px 18px 14px; }
  .status { padding: 0 18px 14px; }
  .control-layout { grid-template-columns: 1fr; }
  .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-workspace { min-height: auto; grid-template-columns: 210px minmax(360px, 1fr); overflow-x: auto; }
  .context-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-hero { margin: -20px -18px 20px; padding: 28px 18px; }
  .work-order-columns { display: none; }
  .work-order-main { grid-template-columns: 88px minmax(160px, 1fr) 110px; }
  .updated-at { display: none; }
}

@media (max-width: 700px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-sidebar { min-height: 305px; }
  .login-logo { display: flex; height: 62px; padding: 16px 24px; }
  .login-logo .brand-mark { width: 34px; height: 34px; }
  .login-sidebar-copy { margin: 20px 24px 35px; }
  .login-sidebar-copy h2 { font-size: 31px; }
  .login-sidebar-copy p, .login-trust { display: none; }
  .login-stage { padding: 24px; }
  .login-card { padding: 30px 24px; }
  .topbar { grid-template-columns: 1fr auto; }
  .top-actions .primary-button { min-width: 38px; padding: 0 10px; font-size: 0; }
  .top-actions .primary-button::before { content: "+"; font-size: 17px; }
  .view-header { flex-direction: column; }
  .header-actions { width: 100%; justify-content: space-between; }
  .side-column, .context-rail { grid-template-columns: 1fr; }
  .chat-workspace { display: block; overflow: visible; }
  .conversation-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-list { max-height: 180px; }
  .chat-panel { min-height: 620px; }
  .context-rail { border-top: 1px solid var(--line); }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .environment-cards, .guide-grid { grid-template-columns: 1fr; }
  .surface-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .material-summary, .material-version, .material-upload-form, .context-package-row { align-items: flex-start; flex-direction: column; }
  .material-summary .secondary-button, .material-version .secondary-button, .material-upload-form .secondary-button, .context-package-row .secondary-button { width: 100%; }
  .inline-form, .work-order-panel, .invite-panel { grid-template-columns: 1fr; }
  .work-order-main { grid-template-columns: 1fr auto; padding: 12px 0; }
  .public-id { grid-column: 1 / -1; }
  .operation-actions { align-items: stretch; flex-direction: column; }
  .transition-form { width: 100%; }
  .transition-form select { flex: 1; }
  .context-package-button { width: 100%; }
  .production-lock { align-items: flex-start; flex-direction: column; }
  .mockup-library, .mockup-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 470px) {
  .topbar { gap: 8px; padding-inline: 12px; }
  .breadcrumbs span, .breadcrumbs i { display: none; }
  .app-main { padding-inline: 12px; }
  .status { padding-inline: 12px; }
  .composer { grid-template-columns: 1fr; }
  .send-button { width: 100%; }
  .chat-tools { align-items: flex-start; flex-direction: column; }
  .mockup-library, .mockup-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Wiki Orchestra */

.wiki-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin: -26px -28px 20px;
  padding: 27px 28px 24px;
  border-bottom: 1px solid var(--purple-line);
  background: linear-gradient(125deg, #f1edff, #faf8ff 64%, #fff5ec);
}

.wiki-header h2 { margin: 0; font-size: 28px; letter-spacing: -.045em; }
.wiki-header p:not(.eyebrow) { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.wiki-meta { display: grid; min-width: 145px; justify-items: end; gap: 3px; }
.wiki-meta span { color: var(--purple); font-size: 8px; font-weight: 900; letter-spacing: .11em; }
.wiki-meta strong { font-size: 12px; }
.wiki-meta small { color: var(--muted); font-size: 8px; }

.wiki-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr) 225px;
  align-items: start;
  gap: 17px;
}

.wiki-index {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.wiki-search {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #faf9fc;
  color: var(--muted);
}

.wiki-search input { width: 100%; height: 35px; padding: 0; border: 0; outline: 0; background: transparent; font-size: 9px; }
.wiki-index nav { max-height: calc(100vh - 215px); padding: 0 8px 12px; overflow-y: auto; }
.wiki-nav-group h3 { margin: 13px 8px 5px; color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.wiki-nav-item { display: grid; width: 100%; gap: 3px; padding: 9px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; cursor: pointer; }
.wiki-nav-item:hover { background: #faf9fc; }
.wiki-nav-item.active { background: var(--purple-soft); color: var(--purple-dark); }
.wiki-nav-item strong { font-size: 9px; }
.wiki-nav-item small { display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 7px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.wiki-article { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.wiki-article-heading { padding: 25px 28px 22px; border-bottom: 1px solid var(--line); background: #fcfbfe; }
.wiki-article-heading > span { color: var(--purple); font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.wiki-article-heading h1 { margin: 7px 0 8px; font-size: clamp(23px, 3vw, 34px); letter-spacing: -.045em; }
.wiki-article-heading p { max-width: 700px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.wiki-content { max-width: 800px; padding: 26px 28px 34px; color: var(--ink-soft); font-size: 11px; line-height: 1.72; }
.wiki-content .wiki-lead { margin-top: 0; color: var(--ink); font-size: 13px; line-height: 1.65; }
.wiki-content h3 { scroll-margin-top: 100px; margin: 27px 0 9px; color: var(--ink); font-size: 15px; letter-spacing: -.02em; }
.wiki-content p { margin: 8px 0; }
.wiki-content ul, .wiki-content ol { display: grid; gap: 6px; margin: 9px 0; padding-left: 20px; }
.wiki-content li::marker { color: var(--purple); font-weight: 800; }
.wiki-content code { padding: 2px 5px; border-radius: 4px; background: #f1eff5; color: #4f397e; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; }
.wiki-callout, .wiki-warning { margin: 18px 0; padding: 13px 14px; border: 1px solid var(--purple-line); border-left: 3px solid var(--purple); border-radius: 7px; background: var(--purple-soft); }
.wiki-warning { border-color: #efd4bf; border-left-color: var(--orange); background: var(--orange-soft); }
.wiki-callout strong, .wiki-warning strong { color: var(--ink); font-size: 10px; }
.wiki-callout p, .wiki-warning p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.wiki-checklist { padding-left: 0 !important; list-style: none; }
.wiki-checklist li { position: relative; padding-left: 24px; }
.wiki-checklist li::before { position: absolute; left: 0; top: 2px; display: grid; width: 15px; height: 15px; place-items: center; border: 1px solid var(--purple-line); border-radius: 4px; color: var(--purple); content: "✓"; font-size: 8px; }
.wiki-glossary { display: grid; gap: 0; margin: 0; }
.wiki-glossary > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wiki-glossary dt { color: var(--ink); font-weight: 850; }
.wiki-glossary dd { margin: 0; color: var(--muted); }
.wiki-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 28px; border-top: 1px solid var(--line); background: #faf9fc; color: var(--muted); font-size: 8px; }

.wiki-toc { display: grid; gap: 12px; }
#wiki-heading-links { display: grid; }
#wiki-heading-links button { padding: 7px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 8px; text-align: left; cursor: pointer; }
#wiki-heading-links button:last-child { border-bottom: 0; }
#wiki-heading-links button:hover { color: var(--purple); }

.queue-list { display: grid; }
.queue-row { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.queue-row:last-child { border-bottom: 0; }
.queue-row > span { overflow: hidden; font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.codex-change-version { align-items: flex-start; }
.codex-change-version .git-dot.dirty { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 14%, transparent); }
.codex-change-version > div { display: grid; min-width: 0; gap: 4px; }
.codex-change-version .state-badge { width: max-content; }
.change-set-actions, .operation-decision-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.change-set-actions .text-button { font-size: 10px; }
.danger-text { color: var(--danger) !important; }
.change-evidence-dialog .dialog-shell { width: min(1000px, calc(100vw - 32px)); }
.change-diff { max-height: 58vh; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #172033; font-size: 11px; line-height: 17px; white-space: pre; }
.deployment-web-operations-card { display: grid; gap: 12px; padding-bottom: 14px; }
.deployment-web-operations-card > p, .deployment-web-operations-card > button, .operation-request-list { margin-inline: 14px; }
.deployment-web-operations-card > p { margin-block: 0; color: var(--muted); font-size: 11px; line-height: 17px; }
.operation-request-list { display: grid; gap: 8px; }
.operation-request-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.operation-request-row > div:first-child { display: grid; min-width: 0; gap: 2px; }
.operation-request-row strong { font-size: 11px; }
.operation-request-row small, .operation-request-row code, .operation-request-row p { color: var(--muted); font-size: 9px; }
.operation-request-row code { overflow: hidden; text-overflow: ellipsis; }
.operation-request-row p, .operation-decision-actions { grid-column: 1 / -1; margin: 0; }
.queue-note { margin: 11px 0 !important; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; line-height: 1.5; }

@media (max-width: 1200px) {
  .wiki-layout { grid-template-columns: 225px minmax(0, 1fr); }
  .wiki-toc { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 780px) {
  .wiki-header { align-items: flex-start; flex-direction: column; margin: -20px -18px 18px; padding: 23px 18px; }
  .wiki-meta { justify-items: start; }
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-index nav { max-height: 330px; }
  .wiki-toc { grid-template-columns: 1fr; }
  .wiki-article-heading, .wiki-content { padding-inline: 20px; }
  .wiki-footer { align-items: flex-start; flex-direction: column; padding-inline: 20px; }
}

@media (max-width: 520px) {
  .wiki-glossary > div { grid-template-columns: 1fr; gap: 3px; }
  .header-actions { align-items: stretch; flex-direction: column; }
}

/* UX-01 — operational agent chat */

.ux-chat-page { display: grid; gap: 13px; }
.ux-chat-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.ux-chat-heading h2 { margin: 1px 0 4px; font-size: 23px; letter-spacing: -.035em; }
.ux-chat-heading > div > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 10px; }
.chat-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.chat-heading-actions label { display: grid; gap: 3px; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chat-heading-actions select { min-width: 180px; height: 32px; padding: 0 8px; font-size: 9px; text-transform: none; }

.chat-operational-grid {
  display: grid;
  min-height: calc(100vh - 192px);
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 13px;
}
.ux-chat-page .chat-panel {
  min-height: 690px;
  grid-template-rows: minmax(300px, 1fr) auto auto auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.ux-chat-page .messages { gap: 11px; padding: 13px; background: #fdfcfe; }
.ux-chat-page .message { width: 100%; max-width: none; align-self: stretch; padding: 14px 15px; background: #fff; }
.ux-chat-page .message.user { align-self: stretch; border-color: #ebe7f0; background: #fbf9ff; }
.message-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.message-meta .message-author { margin: 0; color: var(--ink); }
.message-meta time { color: var(--muted); font-size: 8px; }
.linked-previews { padding: 0 13px 12px; border-top: 1px solid var(--line); }
.linked-previews .section-heading { padding: 11px 0 8px; }
.preview-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.preview-strip figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.preview-strip img { display: block; width: 100%; height: 145px; object-fit: cover; object-position: top; background: #f5f4f7; }
.preview-strip figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 9px; }
.preview-strip figcaption strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.preview-strip figcaption span { color: var(--muted); font-size: 7px; }
.ux-chat-page .chat-tools { padding-inline: 13px; }
.ux-chat-page .composer { padding: 10px 13px 12px; }
.composer-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-attachments .composer-tool { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-soft); }
.composer-attachments .composer-tool:hover { border-color: var(--purple-line); color: var(--purple); }
.composer-tool:disabled { cursor: not-allowed; opacity: .45; }
.chat-audit-note { padding: 7px 13px; border-top: 1px solid var(--line); background: #faf9fc; color: var(--muted); font-size: 7px; text-align: center; }

.chat-operational-grid > .context-rail { display: grid; padding: 0; border: 0; background: transparent; gap: 9px; align-content: start; }
.request-material-card { padding: 0; overflow: visible; }
.request-material-card > .rail-heading { padding: 12px 13px 8px; }
.request-material-list { display: grid; padding: 0 8px; }
.request-material { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto 20px; align-items: center; gap: 7px; padding: 8px 4px; border-top: 1px solid var(--line); }
.request-material:first-child { border-top: 0; }
.request-material .file-icon { width: 29px; height: 29px; font-size: 7px; }
.request-material > div { display: grid; min-width: 0; gap: 2px; }
.request-material > div strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.request-material > div small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.request-material .state-badge { padding-inline: 5px; font-size: 6px; }
.rail-link { display: block; width: calc(100% - 16px); margin: 7px 8px 10px; padding-top: 8px; border-top: 1px solid var(--line); text-align: center; }
.compact-copy { margin: 7px 0; font-size: 8px; line-height: 1.5; }
.row-menu { position: relative; }
.row-menu > summary { display: grid; width: 20px; height: 24px; place-items: center; cursor: pointer; list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > div { position: absolute; z-index: 6; top: 25px; right: 0; display: grid; width: 155px; padding: 5px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.row-menu a, .row-menu button { padding: 7px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); font-size: 8px; text-align: left; text-decoration: none; cursor: pointer; }
.row-menu a:hover, .row-menu button:hover { background: var(--purple-soft); color: var(--purple); }
.involved-agent-list { display: grid; margin-top: 9px; }
.involved-agent { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 0; border-top: 1px solid var(--line); }
.involved-agent:first-child { border-top: 0; }
.involved-agent .agent-orb { width: 29px; height: 29px; border-radius: 8px; font-size: 11px; }
.involved-agent > div { display: grid; min-width: 0; gap: 2px; }
.involved-agent strong { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.involved-agent small { color: var(--muted); font-size: 7px; }
.git-version-list { display: grid; margin-top: 8px; }
.git-version { display: flex; align-items: center; gap: 7px; padding: 6px 0; border-top: 1px solid var(--line); }
.git-version:first-child { border-top: 0; }
.git-dot { width: 8px; height: 8px; border: 2px solid var(--purple); border-radius: 50%; }
.git-version > div { display: grid; gap: 2px; }
.git-version strong { font-size: 8px; }
.git-version small { color: var(--muted); font-size: 7px; }
.advanced-rollback-button { width: 100%; min-height: 42px; border: 1px solid var(--purple); border-radius: 7px; background: #fff; color: var(--purple); font-size: 9px; font-weight: 850; cursor: pointer; }
.advanced-rollback-button:hover { background: var(--purple-soft); }
.advanced-rollback-button:disabled { border-color: var(--line-strong); color: var(--muted); cursor: not-allowed; }

.governed-dialog { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 24px 80px rgb(26 19 42 / 28%); }
.governed-dialog::backdrop { background: rgb(21 17 31 / 52%); backdrop-filter: blur(3px); }
.dialog-shell { display: grid; gap: 17px; padding: 21px; }
.dialog-shell > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.dialog-shell > header h2 { margin: 2px 0 4px; font-size: 21px; }
.dialog-shell > header p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 9px; }
.dialog-shell > footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.field-label { display: grid; gap: 6px; color: var(--ink); font-size: 9px; font-weight: 800; }
.field-label input, .field-label textarea { width: 100%; padding: 10px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; font-weight: 500; resize: vertical; }
.dialog-warning { margin-right: auto; color: var(--muted); font-size: 8px; }
.rollback-current { display: grid; gap: 4px; padding: 12px 13px; border: 1px solid var(--purple-line); border-radius: 8px; background: var(--purple-soft); }
.rollback-current span { color: var(--purple); font-size: 7px; font-weight: 900; letter-spacing: .09em; }
.rollback-current strong { font-size: 13px; }
.rollback-current small { color: var(--muted); font-size: 8px; }
.rollback-version-list { display: grid; gap: 7px; }
.rollback-version-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.rollback-version-card:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); }
.rollback-version-card > span:nth-of-type(1) { display: grid; gap: 2px; }
.rollback-version-card strong { font-size: 9px; }
.rollback-version-card small, .rollback-hash { color: var(--muted); font-size: 7px; }
.rollback-hash { grid-column: 2 / -1; }
.rollback-analysis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rollback-analysis > div { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; }
.rollback-analysis span { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .08em; }
.rollback-analysis strong { font-size: 8px; line-height: 1.45; }
.rollback-gates { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px; border-radius: 7px; background: #faf9fc; color: var(--ink-soft); font-size: 8px; }
.compact-empty { padding: 14px; }
.compact-empty p { margin-bottom: 0; font-size: 8px; }

@media (max-width: 1180px) {
  .chat-operational-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .chat-heading-actions { align-items: flex-end; flex-direction: column; }
}

@media (max-width: 900px) {
  .ux-chat-heading { align-items: flex-start; flex-direction: column; }
  .chat-heading-actions { width: 100%; align-items: center; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
  .chat-operational-grid { grid-template-columns: 1fr; }
  .chat-operational-grid > .context-rail { grid-template-columns: 1fr 1fr; }
  .request-material-card, .advanced-rollback-button { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .chat-heading-actions { align-items: stretch; flex-direction: column; }
  .chat-heading-actions select { width: 100%; }
  .chat-operational-grid > .context-rail { grid-template-columns: 1fr; }
  .request-material-card, .advanced-rollback-button { grid-column: auto; }
  .preview-strip, .rollback-analysis, .rollback-gates { grid-template-columns: 1fr; }
  .composer-actions { align-items: stretch; flex-direction: column; }
  .composer-attachments { display: grid; grid-template-columns: 1fr; }
  .composer-attachments .composer-tool { text-align: left; }
  .dialog-shell > footer { align-items: stretch; flex-direction: column; }
  .dialog-warning { margin: 0; }
}

@media print {
  .sidebar, .topbar, .status, .wiki-header, .wiki-index, .wiki-toc, .wiki-footer { display: none !important; }
  .app-shell, .wiki-layout { display: block; }
  .app-main { padding: 0; }
  .wiki-article { border: 0; box-shadow: none; }
  .wiki-content { max-width: none; }
}

/* UX v3.0 official surface alignment */

.login-screen {
  grid-template-columns: 230px minmax(0, 1fr);
  background: #f8f8fa;
}

.login-sidebar {
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.login-sidebar::after { display: none; }
.login-logo { height: 76px; padding: 17px 20px; background: var(--nav); }
.login-nav-preview { display: grid; gap: 3px; padding: 18px 11px; }
.login-nav-preview > span { margin: 6px 11px; color: var(--muted-2); font-size: 8px; font-weight: 900; letter-spacing: .15em; }
.login-nav-preview > i { display: flex; min-height: 39px; align-items: center; gap: 11px; padding: 0 11px; border-radius: 7px; color: #6a6877; font-size: 13px; font-style: normal; }
.login-nav-preview > i b { font-size: 11px; font-weight: 650; }
.login-nav-preview > i.active { background: var(--purple-soft); color: var(--purple-dark); }
.login-nav-preview > i.active b { font-weight: 800; }
.login-trust { margin: auto 13px 16px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #faf9fc; color: var(--ink); }
.login-trust small { color: var(--muted); }
.login-trust svg { stroke: var(--purple); }

.login-stage {
  display: grid;
  min-width: 0;
  grid-template: 76px minmax(0, 1fr) auto / 1fr;
  gap: 0;
  padding: 0;
}

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10px;
}

.login-topbar span { display: flex; align-items: center; gap: 8px; }
.login-topbar span i { color: #c4c1cb; font-style: normal; }
.login-topbar strong { display: flex; align-items: center; gap: 7px; color: var(--green); font-size: 9px; }
.login-topbar strong i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.login-content { display: grid; width: min(1050px, calc(100% - 64px)); align-items: center; justify-self: center; gap: clamp(50px, 8vw, 130px); grid-template-columns: minmax(320px, 1fr) minmax(360px, 420px); padding: 54px 0; }
.login-welcome { max-width: 520px; }
.login-welcome h1 { margin: 8px 0 15px; font-size: clamp(38px, 4.3vw, 60px); line-height: 1.02; }
.login-lead { max-width: 490px; margin: 0 0 30px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.feature-list { gap: 13px; }
.feature-list > li > span { width: 31px; height: 31px; }
.feature-list strong { font-size: 11px; }
.feature-list small { font-size: 9px; }
.login-card { padding: 34px; border-radius: 11px; box-shadow: 0 16px 45px rgb(24 24 39 / 8%); }
.login-card-mark { width: 40px; height: 40px; margin-bottom: 20px; border-radius: 9px; font-size: 19px; }
.login-card h2 { font-size: 23px; }
.login-copy { font-size: 11px; }
.identity-flow { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #faf9fc; color: var(--muted); font-size: 8px; }
.identity-flow span { display: flex; align-items: center; gap: 5px; }
.identity-flow b { display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 7px; }
.identity-flow i { color: #bbb7c4; font-style: normal; }
.login-action { margin-top: 14px; }
.login-remember { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 8px; }
.login-remember input { width: 13px; height: 13px; margin: 0; }
.login-note { margin-top: 14px; }
.login-links { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.login-links a { color: var(--purple); font-weight: 800; text-decoration: none; }
.login-footer { display: flex; min-height: 48px; align-items: center; justify-content: space-between; padding: 0 28px; border-top: 1px solid var(--line); background: #fff; color: var(--muted-2); font-size: 8px; }

.project-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 18px; }
.project-quick-card { display: flex; min-height: 68px; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; text-align: left; cursor: pointer; box-shadow: var(--shadow-sm); }
.project-quick-card:hover:not(:disabled) { border-color: var(--purple-line); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.project-quick-card:disabled { cursor: not-allowed; opacity: .58; }
.project-quick-card > span { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 8px; background: var(--purple-soft); color: var(--purple); font-size: 13px; }
.project-quick-card > div { display: grid; min-width: 0; gap: 3px; }
.project-quick-card strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.project-quick-card small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.agent-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 9px; font-weight: 900; }
.active-member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.active-member > div { display: grid; min-width: 0; gap: 2px; }
.active-member strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.active-member small { color: var(--muted); font-size: 7px; }
.active-member > i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.rail-footnote { margin: 11px 0 0 !important; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 7px; line-height: 1.5; }

@media (max-width: 1100px) {
  .login-content { grid-template-columns: 1fr; }
  .login-content .login-welcome { display: none; }
  .login-card { width: min(420px, 100%); justify-self: center; }
  .project-quick-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-sidebar { min-height: auto; }
  .login-nav-preview, .login-trust { display: none; }
  .login-stage { grid-template-rows: 54px minmax(0, 1fr) auto; }
  .login-topbar { padding: 0 18px; }
  .login-content { width: 100%; padding: 25px 18px; }
  .login-footer { padding: 0 18px; }
  .login-footer span:last-child { display: none; }
  .project-quick-grid { grid-template-columns: 1fr; }
}

.material-command-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.material-command-bar .material-tabs { margin: 0; border: 0; }
.compact-search { width: min(250px, 100%); }
.material-catalog { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.material-catalog-head,
.material-catalog-row {
  display: grid;
  min-width: 780px;
  grid-template-columns: minmax(155px, 1.6fr) 63px 44px 58px 82px 82px 62px 70px 27px;
  align-items: center;
  gap: 9px;
}
.material-catalog-head { min-height: 38px; padding: 0 11px; border-bottom: 1px solid var(--line); background: #faf9fc; color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.material-catalog-record { min-width: 780px; border-bottom: 1px solid var(--line); }
.material-catalog-record:last-child { border-bottom: 0; }
.material-catalog-row { min-height: 58px; padding: 8px 11px; }
.material-catalog-row:hover { background: #fcfbfe; }
.material-name-cell { display: flex; min-width: 0; align-items: center; gap: 8px; }
.material-name-cell > div:last-child { display: grid; min-width: 0; gap: 3px; }
.material-name-cell strong, .catalog-author, .catalog-date, .origin-label { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.material-name-cell small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.type-label, .version-label-cell { color: var(--ink-soft); font-size: 8px; font-weight: 750; }
.visibility-label { width: max-content; padding: 4px 6px; border-radius: 999px; font-size: 7px; font-weight: 900; }
.visibility-label.private { background: var(--blue-soft); color: var(--blue); }
.visibility-label.shared { background: var(--green-soft); color: var(--green); }
.origin-label { color: var(--muted); }
.catalog-menu { width: 27px; height: 27px; border: 0; }
.material-catalog-detail { display: none; padding: 0 11px 12px 52px; background: #fcfbfe; }
.material-catalog-record.expanded .material-catalog-detail { display: block; }
.material-catalog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.material-catalog-actions:empty { display: none; }

.work-order-toolbar { flex-wrap: wrap; }
.official-work-order-table { overflow-x: auto; }
.official-work-order-columns,
.official-work-order-row {
  display: grid;
  min-width: 800px;
  grid-template-columns: 92px minmax(165px, 1.5fr) 56px 88px 68px 90px 110px 27px;
  align-items: center;
  gap: 10px;
}
.official-work-order-columns { min-height: 38px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.work-order-record { min-width: 800px; }
.official-work-order-row { min-height: 62px; padding: 8px 12px; }
.work-order-identity, .work-order-title, .approval-cell { display: grid; min-width: 0; gap: 3px; }
.work-order-identity .public-id { font-size: 8px; font-weight: 850; }
.work-order-identity small, .work-order-title p, .approval-cell small { overflow: hidden; margin: 0; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.work-order-title h3 { overflow: hidden; margin: 0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.priority-badge { width: max-content; padding: 4px 6px; border-radius: 999px; background: #f1eff4; color: var(--muted); font-size: 7px; font-weight: 900; }
.priority-badge.priority-high, .priority-badge.priority-critical { background: var(--danger-soft); color: var(--danger); }
.priority-badge.priority-medium { background: var(--amber-soft); color: var(--amber); }
.assigned-agents { overflow: hidden; color: var(--ink-soft); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.context-count-button { display: grid; gap: 1px; padding: 5px; border: 0; border-radius: 6px; background: var(--purple-soft); color: var(--purple); font-size: 9px; font-weight: 900; cursor: pointer; }
.context-count-button small { font-size: 6px; font-weight: 700; }
.approval-cell { color: var(--ink-soft); font-size: 8px; }
.work-order-more { width: 27px; height: 27px; border: 0; }
.work-order-record .operation-actions { display: none; min-width: 800px; padding: 4px 12px 10px; background: #fcfbfe; }
.work-order-record.actions-open .operation-actions,
.work-order-record:has(.context-package-panel) .operation-actions { display: flex; }
.work-order-record .context-package-slot:not(:empty) { min-width: 800px; padding: 0 12px 12px; background: #fcfbfe; }

@media (max-width: 900px) {
  .material-command-bar { align-items: stretch; flex-direction: column; padding-bottom: 10px; }
  .compact-search { width: 100%; }
  .work-order-toolbar { align-items: stretch; flex-direction: column; }
}

@media (max-width: 700px) {
  .material-catalog-actions { align-items: stretch; flex-direction: column; }
}

.agent-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 14px; }
.agent-metrics article { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.agent-metrics span { color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .09em; }
.agent-metrics strong { font-size: 20px; letter-spacing: -.04em; }
.agent-metrics small { color: var(--muted); font-size: 7px; }
.provider-muted { background: #e9e7ed; color: #8d8998; }
.surface-title { font-size: 10px; }
.agent-table { border-radius: 0 0 9px 9px; }
.agent-table td:nth-child(1) { min-width: 145px; }
.agent-table td:nth-child(3) { max-width: 145px; overflow: hidden; text-overflow: ellipsis; }
.agent-table td:nth-child(5) { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.agent-permission-menu { position: relative; }
.agent-permission-menu summary { width: max-content; padding: 5px 7px; border-radius: 999px; background: var(--purple-soft); color: var(--purple); font-size: 7px; font-weight: 900; cursor: pointer; list-style: none; }
.agent-permission-menu summary::-webkit-details-marker { display: none; }
.agent-permission-menu > div { position: absolute; z-index: 8; top: 28px; right: 0; display: grid; width: 210px; gap: 5px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-md); color: var(--ink-soft); font-size: 7px; }
.policy-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.policy-toggle input { width: 28px; height: 15px; accent-color: var(--purple); }

.release-flow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.release-flow > span { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 8px; font-weight: 750; }
.release-flow b { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 7px; }
.release-flow i { color: #c2bdcb; font-size: 8px; font-style: normal; }
.release-flow .blocked-step { color: var(--danger); }
.release-flow .blocked-step b { background: var(--danger-soft); color: var(--danger); }
.official-target-grid { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.governed-target { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.governed-target > div:first-child { display: grid; gap: 3px; }
.governed-target > div:first-child strong { font-size: 11px; }
.governed-target > div:first-child span { color: var(--muted); font-size: 8px; }
.target-comparison { display: grid; grid-column: 1 / -1; grid-template-columns: auto 1fr auto auto 1fr; align-items: center; gap: 7px; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: #faf9fc; }
.target-comparison span { color: var(--muted-2); font-size: 7px; font-weight: 900; }
.target-comparison strong { font-size: 8px; }
.target-comparison i { color: #bbb6c4; font-size: 8px; font-style: normal; }
.device-switch { display: flex; grid-column: 1 / -1; gap: 3px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.device-switch button { padding: 5px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 7px; font-weight: 800; cursor: pointer; }
.device-switch button.active { background: var(--purple-soft); color: var(--purple); }
.project-preview-frame { width: 100%; max-width: 100%; grid-column: 1 / -1; justify-self: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 7px; background: #f7f6f9; transition: width .18s ease; }
.project-preview-frame.tablet { width: 72%; }
.project-preview-frame.mobile { width: 42%; }
.preview-browser { display: flex; height: 24px; align-items: center; gap: 4px; padding: 0 7px; border-bottom: 1px solid var(--line); background: #fff; }
.preview-browser span { width: 5px; height: 5px; border-radius: 50%; background: #d6d2dc; }
.preview-browser b { overflow: hidden; margin-left: 5px; color: var(--muted); font-size: 6px; text-overflow: ellipsis; white-space: nowrap; }
.preview-canvas { display: grid; min-height: 120px; place-content: center; gap: 5px; padding: 15px; background: linear-gradient(135deg, #f1edff, #fff 55%, #fff3e9); text-align: center; }
.preview-canvas strong { font-size: 9px; }
.preview-canvas small { color: var(--muted); font-size: 7px; }
.target-actions { display: flex; grid-column: 1 / -1; gap: 7px; }
.target-actions .secondary-button { flex: 1; min-height: 34px; font-size: 8px; }

@media (max-width: 900px) {
  .agent-metrics { grid-template-columns: repeat(2, 1fr); }
  .agent-table { overflow-x: auto; }
  .agent-table table { min-width: 900px; }
}

@media (max-width: 620px) {
  .agent-metrics { grid-template-columns: 1fr 1fr; }
  .release-flow { align-items: stretch; flex-direction: column; }
  .release-flow > i { display: none; }
}

.settings-tabs { overflow-x: auto; margin-bottom: 17px; }
.settings-tabs .filter-tab { flex: 0 0 auto; }
.settings-panel { min-width: 0; }
.settings-overview-grid, .security-control-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.settings-overview-grid article, .security-control-grid article { display: grid; gap: 5px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.settings-overview-grid span, .security-control-grid span { color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .09em; }
.settings-overview-grid strong, .security-control-grid strong { font-size: 13px; }
.settings-overview-grid small, .security-control-grid small { color: var(--muted); font-size: 8px; line-height: 1.5; }
.settings-feature-panel { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; padding: 25px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.settings-feature-panel h3 { margin: 0 0 7px; font-size: 18px; }
.settings-feature-panel .muted { max-width: 690px; font-size: 10px; line-height: 1.6; }
.settings-check-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; color: var(--muted); font-size: 8px; }
.user-directory, .project-permission-matrix { overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.user-directory-head,
.user-directory-row {
  display: grid;
  min-width: 800px;
  grid-template-columns: minmax(175px, 1.4fr) 120px 80px 82px 88px 86px 57px;
  align-items: center;
  gap: 10px;
}
.user-directory-head { min-height: 38px; padding: 0 11px; border-bottom: 1px solid var(--line); background: #faf9fc; color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.user-directory-row { min-height: 59px; margin: 0; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.user-directory-row:last-child { border-bottom: 0; }
.user-directory-row:hover { background: #fcfbfe; }
.directory-user { display: flex; min-width: 0; align-items: center; gap: 8px; }
.directory-user > div:last-child { display: grid; min-width: 0; gap: 3px; }
.directory-user strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.directory-user span, .directory-projects, .directory-login, .directory-updated { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.user-directory-row select { width: 100%; height: 32px; padding: 0 7px; font-size: 7px; }
.project-permission-head,
.project-permission-row { display: grid; min-width: 780px; grid-template-columns: minmax(180px, 1.5fr) 120px 1fr 1fr 1fr; align-items: center; gap: 10px; }
.project-permission-head { min-height: 36px; padding: 0 11px; border-bottom: 1px solid var(--line); background: #faf9fc; color: var(--muted-2); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.project-permission-row { min-height: 52px; padding: 8px 11px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.project-permission-row:last-child { border-bottom: 0; }
.project-permission-row > div { display: flex; align-items: center; gap: 8px; }
.project-permission-row > div strong { font-size: 9px; }
.success-text { color: var(--green); font-weight: 800; }
.workflow-settings { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.workflow-settings > div { display: grid; flex: 1; justify-items: center; gap: 5px; text-align: center; }
.workflow-settings > div > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 8px; font-weight: 900; }
.workflow-settings strong { font-size: 9px; }
.workflow-settings small { color: var(--muted); font-size: 7px; }
.workflow-settings i { color: #c6c1ce; font-size: 9px; font-style: normal; }

.guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-card { min-height: 138px; }
.help-onboarding { margin-top: 24px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.onboarding-flow { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.onboarding-flow > div { display: grid; min-width: 0; flex: 1; justify-items: center; gap: 4px; text-align: center; }
.onboarding-flow > div > span { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 8px; font-weight: 900; }
.onboarding-flow strong { font-size: 8px; }
.onboarding-flow small { color: var(--muted); font-size: 7px; line-height: 1.4; }
.onboarding-flow i { color: #c5c0cc; font-size: 8px; font-style: normal; }

@media (max-width: 900px) {
  .settings-overview-grid, .security-control-grid { grid-template-columns: 1fr 1fr; }
  .guide-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .settings-overview-grid, .security-control-grid, .guide-grid { grid-template-columns: 1fr; }
  .settings-feature-panel { align-items: stretch; flex-direction: column; }
  .settings-check-list { grid-template-columns: 1fr; }
  .workflow-settings, .onboarding-flow { align-items: stretch; flex-direction: column; }
  .workflow-settings i, .onboarding-flow i { display: none; }
}

/* CARTECHINI LAB typography v1.0 and UX-01 approved visual alignment */

body, button, a, input, select, textarea { font-family: var(--font-family-ui); }
:is(#app-shell, #login-view) { font-size: var(--font-body); line-height: var(--line-body); }
:is(#app-shell, #login-view) :is(span, strong, b, a, dt, dd, figcaption) { font-size: inherit; }
:is(#app-shell, #login-view) :is(p, li) { font-size: var(--font-body); font-weight: var(--weight-regular); line-height: var(--line-body); }
:is(#app-shell, #login-view) :is(small, time) { font-size: var(--font-small); font-weight: var(--weight-regular); line-height: var(--line-small); }
#login-view :is(span, strong, b, i, a, label) { font-size: var(--font-small); line-height: var(--line-small); }
#login-view .login-nav-preview > i,
#login-view .login-nav-preview > i b { font-size: var(--font-menu); line-height: 20px; }
#login-view .login-card-mark { font-size: 19px; line-height: 1; }
#login-view .login-action { font-size: 14px; line-height: 18px; font-weight: var(--weight-semibold); }
#app-shell :is(button, input, select, textarea, label, summary) { font-size: 13px; line-height: 18px; }
#app-shell :is(.primary-button, .secondary-button) { font-weight: var(--weight-semibold); }
#app-shell :is(.state-badge, .environment-label, .gate-chip, .pill, .role-label, .priority-badge, .visibility-label) { font-size: var(--font-badge); line-height: var(--line-small); font-weight: var(--weight-semibold); }
#app-shell :is(.nav-label, .eyebrow, .rail-heading, .surface-toolbar, .result-count) { font-size: var(--font-small); line-height: var(--line-small); }
#app-shell :is(.table-shell td, .material-catalog-row, .user-directory-row, .project-permission-row, .official-work-order-row) { font-size: var(--font-table); line-height: var(--line-table); font-weight: var(--weight-regular); }
#app-shell :is(.table-shell th, .material-catalog-head, .user-directory-head, .project-permission-head, .official-work-order-columns) { font-size: var(--font-small); line-height: var(--line-small); font-weight: var(--weight-semibold); }
#app-shell .file-icon { font-size: var(--font-badge); line-height: var(--line-small); }
#app-shell .permission-line { font-size: var(--font-small); line-height: var(--line-small); }
#app-shell .gate-row { font-size: var(--font-small); line-height: var(--line-small); }
#app-shell .release-flow > i { font-size: var(--font-badge); line-height: var(--line-small); }
#app-shell .work-order-title h3 { font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
#app-shell .provider-logo { font-size: var(--font-badge); line-height: var(--line-small); }
#app-shell .avatar.small { font-size: var(--font-badge); line-height: 1; }
#app-shell .onboarding-flow i { font-size: var(--font-badge); line-height: var(--line-small); }
#app-shell .wiki-nav-group h3 { font-size: var(--font-small); line-height: var(--line-small); }
#app-shell .wiki-footer { font-size: var(--font-small); line-height: var(--line-small); }
#app-shell .agent-permission-menu > div,
#app-shell .agent-permission-menu > div span { font-size: var(--font-badge); line-height: var(--line-small); }
#app-shell :is(.view-header h2, .ux-chat-heading h2) { font-size: var(--font-page-title); line-height: var(--line-page-title); font-weight: var(--weight-bold); }
#app-shell :is(.section-heading h3, .rail-card h3) { font-size: var(--font-section-title); line-height: var(--line-section-title); font-weight: var(--weight-semibold); }

.sidebar-brand {
  height: 118px;
  padding: 18px 20px;
  align-items: flex-start;
  background: #071326;
}
.brand-wordmark { display: grid; align-content: center; gap: 0; line-height: 1; }
:is(#app-shell, #login-view) .brand-wordmark strong { color: #fff; font-size: 21px; line-height: 24px; font-weight: var(--weight-medium); letter-spacing: .02em; }
:is(#app-shell, #login-view) .brand-wordmark b { color: #f4a43b; font-size: 39px; line-height: 39px; font-weight: var(--weight-bold); letter-spacing: .025em; }
:is(#app-shell, #login-view) .brand-wordmark small { margin-top: 3px; color: #fff; font-size: 11px; line-height: 15px; font-weight: var(--weight-regular); letter-spacing: 0; }
.login-logo { height: auto; padding: 26px 30px; background: transparent; }

.main-nav { gap: 7px; padding-block: 17px; }
.nav-item { min-height: 43px; gap: 12px; font-size: var(--font-menu) !important; line-height: 20px; font-weight: var(--weight-medium); }
.nav-item.active { background: #f5f2ff; color: #5b3fe3; font-weight: var(--weight-medium); }
.nav-icon { width: 19px; height: 19px; }

.sidebar-project { gap: 7px; padding: 14px; background: #fbfbfc; }
#app-shell .sidebar-project > span { font-size: 11px; line-height: var(--line-small); font-weight: var(--weight-semibold); }
#app-shell .sidebar-project > strong { font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.sidebar-project-switch { position: relative; display: block; margin-top: 5px; }
.sidebar-project-switch select { width: 100%; height: 36px; appearance: none; padding: 0 34px 0 10px; border-color: var(--line); background: #fff; color: var(--ink); font-size: 12px !important; font-weight: var(--weight-medium); cursor: pointer; }
.sidebar-project-switch svg { position: absolute; right: 10px; top: 10px; width: 16px; height: 16px; pointer-events: none; fill: none; stroke: currentColor; stroke-width: 1.7; }

.topbar { min-height: 60px; padding-block: 8px; }
.top-request-button { border-color: var(--line); background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.top-request-button:hover:not(:disabled) { border-color: var(--purple-line); color: var(--purple); }
.topbar-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; color: var(--ink); }
.topbar-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.top-user { display: flex; min-width: 0; align-items: center; gap: 9px; }
.top-user > div { display: grid; min-width: 0; }
#app-shell .top-user-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #fde8c9; color: #27211a; font-size: 11px; line-height: 1; font-weight: var(--weight-bold); }
#app-shell .top-user > div > span { max-width: 130px; overflow: hidden; font-size: 12px; line-height: 16px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }

.ux-chat-page { gap: 14px; }
.ux-chat-heading { align-items: center; }
.ux-chat-heading h2 { margin: 0 0 2px; letter-spacing: -.025em; }
.ux-chat-heading > div > p:not(.eyebrow) { font-size: 14px !important; line-height: 21px; }
.quick-actions-menu { position: relative; z-index: 10; }
.quick-actions-menu > summary { display: flex; min-height: 38px; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--purple); border-radius: 7px; background: #fff; color: var(--purple); font-weight: var(--weight-medium); cursor: pointer; list-style: none; }
.quick-actions-menu > summary::-webkit-details-marker { display: none; }
.quick-actions-menu > summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.quick-actions-popover { position: absolute; top: 46px; right: 0; display: grid; width: 320px; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-md); }
.quick-actions-popover label { display: grid; gap: 5px; color: var(--muted); font-size: 12px !important; font-weight: var(--weight-medium); }
.quick-actions-popover select { width: 100%; min-height: 38px; padding: 0 10px; }
.quick-actions-popover .secondary-button { width: 100%; }

.chat-operational-grid { min-height: calc(100vh - 154px); grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 430px); gap: 14px; }
.ux-chat-page .chat-panel { min-height: 690px; grid-template-rows: minmax(260px, 1fr) auto auto auto; border-radius: 8px; }
.ux-chat-page .messages { gap: 10px; padding: 12px; background: #fff; }
.ux-chat-page .message { display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ux-chat-page .message.user { border-color: var(--line); background: #fff; }
.message-avatar { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; font-size: 12px !important; line-height: 1; font-weight: var(--weight-bold); }
.message-avatar.user-avatar { background: #fde8c9; color: #27211a; }
.message-avatar.agent-avatar { background: #08162b; color: #fff; }
.message-body { min-width: 0; }
.message-meta { min-height: 22px; justify-content: flex-start; margin-bottom: 5px; }
.message-meta > div { display: flex; min-width: 0; align-items: baseline; gap: 7px; }
#app-shell .message-author { margin: 0; color: var(--ink); font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); letter-spacing: 0; text-transform: none; }
.message-meta > div small { color: var(--muted); }
#app-shell .message-meta time { margin-left: 4px; color: var(--muted); font-size: 11px; line-height: 16px; }
.message-more { display: grid; width: 28px; height: 28px; margin: -3px -4px -3px auto; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.message-meta > .state-badge { margin-left: auto; }
.message-meta > .state-badge + .message-more { margin-left: 0; }
.message-more svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
#app-shell .message-text { color: var(--ink); font-size: 14px; line-height: 21px; font-weight: var(--weight-regular); }

.linked-previews { padding: 0 12px 12px; }
.linked-previews .section-heading { align-items: center; margin: 0; padding: 12px 0 9px; }
.preview-strip { gap: 10px; }
.preview-strip img { height: 155px; }
.preview-strip figcaption { min-height: 54px; }
.preview-strip figcaption > div { display: grid; min-width: 0; gap: 2px; }
#app-shell .preview-strip figcaption strong { overflow: hidden; font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.preview-strip figcaption .preview-open { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); text-decoration: none; }
.preview-strip figcaption svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.ux-chat-page .composer { grid-template-columns: minmax(0, 1fr) 128px; align-items: stretch; gap: 10px; padding: 10px 12px; }
.ux-chat-page .composer-input { min-height: 94px; border-color: var(--line-strong); border-radius: 8px; }
.ux-chat-page .composer textarea { min-height: 48px; padding: 11px 12px 4px; font-size: 14px !important; line-height: 21px; }
.ux-chat-page .composer-actions { padding: 5px 7px 7px; }
.composer-attachments { gap: 6px; }
#app-shell .composer-attachments .composer-tool { min-height: 33px; padding: 0 9px; border-color: var(--line); background: #fff; color: var(--ink); font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); }
.composer-tool svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.markdown-icon { font-size: 11px !important; font-weight: var(--weight-semibold); }
#app-shell .mode-picker { font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); }
#app-shell .mode-picker select { height: 32px; font-size: 12px; }
.send-button { min-height: 94px; padding: 0 14px; border-color: #071326; background: #071326; box-shadow: none; font-size: 14px !important; }
.send-button:hover:not(:disabled) { border-color: #14243d; background: #14243d; }
.send-button > svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.send-chevron { margin-left: auto; padding-left: 10px; border-left: 1px solid rgb(255 255 255 / 28%); }
#app-shell .chat-audit-note { padding: 8px 13px; font-size: 11px; line-height: 16px; }

.chat-operational-grid > .context-rail { gap: 10px; }
.request-material-card > .rail-heading { min-height: 42px; margin: 0; padding: 10px 13px; }
.request-material { grid-template-columns: 36px minmax(0, 1fr) 116px 24px; gap: 9px; padding: 10px 5px; }
.request-material .file-icon { width: 34px; height: 34px; font-size: 11px; }
.request-material .file-icon.mockup { background: #eef3ff; color: #4269c8; }
.request-material .file-icon.markdown { background: #fff3e9; color: #bd6827; }
#app-shell .request-material > div strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
#app-shell .request-material > div small { font-size: 11px; line-height: 16px; }
#app-shell .request-material > time { color: var(--muted); font-size: 11px; line-height: 16px; text-align: right; }
.row-menu > summary svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
#app-shell .row-menu :is(a, button) { font-size: 12px; line-height: 16px; }
#app-shell .rail-link { font-size: 12px; line-height: 16px; }
.activity-card > summary { min-height: 24px; font-size: 13px !important; font-weight: var(--weight-semibold); }
.activity-card > summary span { min-width: 24px; text-align: center; }
.involved-agent { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 9px; padding: 10px 0; }
.agent-initials { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #08162b; color: #fff; font-size: 11px !important; font-weight: var(--weight-bold); }
#app-shell .involved-agent strong { font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); }
#app-shell .involved-agent small { font-size: 11px; line-height: 16px; }
#app-shell :is(.run-timeline b, .git-version strong) { font-size: 12px; line-height: 16px; }
#app-shell :is(.run-timeline small, .git-version small, .compact-copy) { font-size: 11px; line-height: 16px; }
.advanced-rollback-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: 13px !important; line-height: 18px; font-weight: var(--weight-medium); }
.advanced-rollback-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* UX-02 — Progetti */

.projects-header { align-items: center; margin-bottom: 18px; }
.projects-header h2 { margin-bottom: 2px; letter-spacing: -.025em; }
.projects-header .muted { font-size: 14px; line-height: 21px; }
.projects-actions-menu .quick-actions-popover { width: 270px; }
.projects-control-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
.project-command-bar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.project-search { width: min(400px, 100%); background: #fff; }
#app-shell .project-search input { height: 42px; font-size: 13px; line-height: 18px; }
.project-filter-controls { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.project-select { position: relative; display: block; }
.project-select select { min-width: 160px; height: 42px; appearance: none; padding: 0 38px 0 13px; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; background: #fff; color: var(--ink); cursor: pointer; }
.project-select svg { position: absolute; right: 12px; top: 13px; width: 16px; height: 16px; pointer-events: none; fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-shell .project-filter-button { display: flex; min-height: 42px; align-items: center; gap: 7px; padding: 0 14px; border: 1px solid var(--purple-line); border-radius: 7px; background: #fff; color: var(--purple); font-size: 13px; line-height: 18px; font-weight: var(--weight-medium); cursor: pointer; }
.project-filter-button.active { background: var(--purple-soft) !important; }
.project-filter-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.project-table { overflow: visible; border-radius: 8px; }
.project-table table { table-layout: fixed; }
.project-table th:nth-child(1) { width: 30%; }
.project-table th:nth-child(2) { width: 12%; }
.project-table th:nth-child(3) { width: 18%; }
.project-table th:nth-child(4) { width: 22%; }
.project-table th:nth-child(5) { width: 11%; }
.project-table th:nth-child(6) { width: 7%; }
#app-shell .project-table th { height: 48px; padding: 0 14px; color: var(--ink); background: #fcfbfd; letter-spacing: 0; text-transform: none; }
#app-shell .project-table td { height: 66px; padding: 10px 14px; color: var(--ink-soft); }
.project-table tbody tr { background: #fff; }
.project-table td:first-child { min-width: 0; }
.project-cell { gap: 12px; }
.project-cell > div { min-width: 0; gap: 2px; }
#app-shell .project-cell strong { overflow: hidden; color: var(--ink); font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
#app-shell .project-cell small { overflow: hidden; font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.project-mark { width: 38px; height: 38px; border-radius: 9px; font-size: 11px !important; line-height: 1; }
.project-mark.tone-0 { background: var(--purple-soft); color: var(--purple); }
.project-mark.tone-1 { background: var(--orange-soft); color: #bd6827; }
.project-mark.tone-2 { background: var(--green-soft); color: var(--green); }
.project-mark.tone-3 { background: var(--blue-soft); color: var(--blue); }
.small-mark { width: 34px; height: 34px; }
#app-shell .project-count-link { padding: 3px; border: 0; background: transparent; color: var(--purple); font-size: 13px; line-height: 18px; font-weight: var(--weight-medium); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.project-agent-stack { display: flex; align-items: center; }
.project-agent-stack span,
.project-agent-stack b,
.project-agent-empty { display: grid; width: 28px; height: 28px; margin-left: -5px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #f2f1f5; color: var(--ink); font-size: 11px !important; line-height: 1; font-weight: var(--weight-semibold); }
.project-agent-stack span:first-child { margin-left: 0; }
.project-agent-stack .tone-0 { background: #fde8c9; }
.project-agent-stack .tone-1 { background: #e6efff; }
.project-agent-stack .tone-2 { background: #e3f5ed; }
.project-agent-stack .tone-3 { background: #efe9ff; }
.project-agent-empty { margin: 0; color: var(--muted); }
.project-row-menu { position: relative; display: inline-block; }
.project-row-menu > summary { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; color: var(--ink); cursor: pointer; list-style: none; }
.project-row-menu > summary::-webkit-details-marker { display: none; }
.project-row-menu > summary:hover { background: #f5f3f8; }
.project-row-menu > summary svg { width: 18px; height: 18px; fill: currentColor; }
.project-row-menu > div { position: absolute; z-index: 12; top: 34px; right: 0; display: grid; width: 165px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-md); }
#app-shell .project-row-menu button { padding: 8px 9px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font-size: 12px; line-height: 16px; text-align: left; cursor: pointer; }
.project-row-menu button:hover { background: var(--purple-soft) !important; color: var(--purple) !important; }

.project-pagination { display: grid; min-height: 52px; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; background: #fff; color: var(--muted); }
#app-shell .project-pagination,
#app-shell .project-pagination label,
#app-shell .project-pagination span { font-size: 12px; line-height: 16px; }
.project-pagination label { display: flex; align-items: center; gap: 7px; }
.project-pagination select { height: 32px; padding: 0 24px 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.project-pagination > span { justify-self: center; }
.project-pagination nav { display: flex; justify-self: end; gap: 4px; }
.project-pagination nav button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); }
.project-pagination nav button.active { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }

.project-side-column { gap: 14px; }
.project-rail-card { padding: 15px; }
.project-rail-heading { display: flex; min-height: 28px; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.project-rail-heading h3 { margin: 0; color: var(--ink); font-size: 16px; line-height: 22px; font-weight: var(--weight-semibold); }
#app-shell .project-rail-heading .text-button { font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); }
.recent-project { min-height: 60px; padding: 10px 0; gap: 10px; }
#app-shell .recent-project strong { font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); }
#app-shell .recent-project small { font-size: 11px; line-height: 16px; }
.recent-project .environment-label { margin-left: auto; }
#app-shell .recent-project > b { color: var(--ink); font-size: 20px; line-height: 20px; font-weight: var(--weight-regular); }
.project-essential-list { display: grid; }
.project-essential-action { display: flex; min-height: 66px; align-items: center; gap: 11px; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.project-essential-action:last-child { border-bottom: 0; }
.project-essential-action:disabled { cursor: not-allowed; opacity: .5; }
.project-essential-action > span { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border: 1px solid var(--purple-line); border-radius: 8px; color: var(--purple); }
.project-essential-action > span svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.project-essential-action > div { display: grid; min-width: 0; flex: 1; gap: 2px; }
#app-shell .project-essential-action strong { font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); }
#app-shell .project-essential-action small { color: var(--muted); font-size: 11px; line-height: 16px; }
#app-shell .project-essential-action > b { color: var(--ink); font-size: 20px; line-height: 20px; font-weight: var(--weight-regular); }
.project-essential-action:hover:not(:disabled) > div strong { color: var(--purple); }

/* UX-03 — Materiali progetto */

.materials-header { align-items: center; margin-bottom: 18px; }
.materials-header h2 { margin-bottom: 2px; letter-spacing: -.025em; }
.materials-header .muted { font-size: 14px; line-height: 21px; }
.materials-actions-menu .quick-actions-popover { width: 260px; }
.material-command-bar { min-height: 44px; overflow-x: auto; margin-bottom: 14px; }
.material-command-bar .material-tabs { flex: 0 0 auto; }
#app-shell .material-tabs .filter-tab { min-height: 42px; padding: 0 15px; font-size: 13px; line-height: 18px; }

.materials-control-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
.material-content-column { min-width: 0; gap: 14px; }
.material-package-card { display: grid; min-height: 92px; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.material-package-card.empty { border-color: var(--line); background: #fff; }
.material-package-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 8px; background: var(--purple-soft); color: var(--purple); }
.material-package-card.empty .material-package-icon { background: var(--purple-soft); color: var(--purple); }
.material-package-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.material-package-card > div { display: grid; min-width: 0; gap: 2px; }
#app-shell .material-package-card small { color: var(--purple); font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.material-package-card.empty small { color: var(--muted) !important; }
#app-shell .material-package-card h3 { overflow: hidden; margin: 0; color: var(--ink); font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
#app-shell .material-package-card p { overflow: hidden; margin: 0; color: var(--muted); font-size: 12px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
#app-shell .material-package-card .state-badge { font-size: 11px; line-height: 16px; }

.material-table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
.material-table-toolbar { display: flex; min-height: 66px; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.material-search { width: min(330px, 100%); flex: 1 1 240px; background: #fff; }
#app-shell .material-search input { height: 40px; font-size: 13px; line-height: 18px; }
.material-filter-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.material-select { position: relative; display: block; }
.material-select select { min-width: 118px; height: 40px; appearance: none; padding: 0 31px 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; background: #fff; color: var(--ink); font-size: 12px; line-height: 16px; cursor: pointer; }
.material-select.material-sort select { min-width: 128px; }
.material-select svg { position: absolute; top: 12px; right: 9px; width: 15px; height: 15px; pointer-events: none; fill: none; stroke: currentColor; stroke-width: 1.7; }
.material-table-card .material-catalog { overflow-x: auto; border: 0; border-radius: 0; box-shadow: none; }
.material-table-card .material-catalog-head,
.material-table-card .material-catalog-row { min-width: 840px; grid-template-columns: minmax(235px, 2fr) 100px 76px 100px 160px 72px; gap: 10px; }
.material-table-card .material-catalog-head { min-height: 44px; padding: 0 13px; background: #fbfafc; color: var(--ink-soft); font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); letter-spacing: 0; text-transform: none; }
.material-table-card .material-catalog-record { min-width: 840px; }
.material-table-card .material-catalog-row { min-height: 66px; padding: 10px 13px; }
.material-table-card .material-name-cell { gap: 11px; }
.material-table-card .material-name-cell .file-icon { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 7px; background: #eef1f7; color: #526078; font-size: 11px; line-height: 1; font-weight: var(--weight-semibold); }
.material-table-card .material-name-cell .file-icon.markdown { background: #fff0e4; color: #b86122; }
.material-table-card .material-name-cell .file-icon.mockup { background: #eaf0ff; color: #4168c8; }
.material-table-card .material-name-cell .file-icon.archive { background: #e5f6ed; color: var(--green); }
#app-shell .material-table-card .material-name-cell strong { font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); }
#app-shell .material-table-card .material-name-cell small { font-size: 11px; line-height: 16px; }
#app-shell .material-table-card :is(.type-label, .version-label-cell) { color: var(--ink-soft); font-size: 12px; line-height: 16px; font-weight: var(--weight-regular); }
#app-shell .material-table-card .state-badge { width: max-content; font-size: 11px; line-height: 16px; }
.catalog-date { display: grid; min-width: 0; gap: 1px; }
#app-shell .catalog-date strong { overflow: hidden; color: var(--ink-soft); font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); text-overflow: ellipsis; white-space: nowrap; }
#app-shell .catalog-date small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.material-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.material-preview-action,
.material-table-card .catalog-menu { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.material-preview-action:hover,
.material-table-card .catalog-menu:hover { background: var(--purple-soft); color: var(--purple); }
.material-preview-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.material-table-card .catalog-menu svg { width: 18px; height: 18px; fill: currentColor; }
.material-table-card .material-catalog-detail { padding: 0 13px 13px 60px; border-top: 1px dashed var(--line); }
.material-version-list { display: grid; gap: 6px; padding-top: 10px; }
.material-version { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.material-version > div { display: grid; min-width: 0; gap: 2px; }
#app-shell .material-version strong { font-size: 12px; line-height: 16px; font-weight: var(--weight-semibold); }
#app-shell .material-version span { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.material-upload-form { display: flex; align-items: center; gap: 7px; }
.material-upload-form input { min-width: 0; max-width: 250px; font-size: 11px; }
.material-filter-empty { padding: 28px 16px; color: var(--muted); font-size: 13px; line-height: 18px; text-align: center; }
.material-pagination { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 13px; border-top: 1px solid var(--line); color: var(--muted); }
#app-shell .material-pagination > span { font-size: 12px; line-height: 16px; }
.material-pagination nav { display: flex; gap: 4px; }
.material-pagination nav button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.material-pagination nav button.active { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }

.material-side-column { gap: 14px; }
.material-side-column .rail-card { padding: 15px; }
.material-add-card > summary { display: flex; min-height: 30px; align-items: center; justify-content: space-between; color: var(--ink); font-size: 16px; line-height: 22px; font-weight: var(--weight-semibold); cursor: pointer; list-style: none; }
.material-add-card > summary::-webkit-details-marker { display: none; }
.material-add-card > summary span { color: var(--muted); font-size: 14px; transition: transform .15s ease; }
.material-add-card:not([open]) > summary span { transform: rotate(180deg); }
.material-add-list { display: grid; margin-top: 8px; }
.material-add-list button { display: flex; min-height: 46px; align-items: center; gap: 11px; padding: 7px 2px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 13px; line-height: 18px; font-weight: var(--weight-medium); text-align: left; cursor: pointer; }
.material-add-list button:last-child { border-bottom: 0; }
.material-add-list button:hover { color: var(--purple); }
.material-add-list button > svg,
.material-add-list button > span { width: 20px; height: 20px; flex: 0 0 auto; }
.material-add-list button > svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
.material-add-list .markdown-icon { display: grid; place-items: center; color: #b86122; }
.material-package-details dl,
.material-summary-card dl { display: grid; margin: 0; }
.material-package-details dl > div,
.material-summary-card dl > div { display: flex; min-height: 38px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.material-package-details dl > div:last-child,
.material-summary-card dl > div:last-child { border-bottom: 0; }
#app-shell .material-package-details :is(dt, dd),
#app-shell .material-summary-card :is(dt, dd) { margin: 0; font-size: 12px; line-height: 16px; }
#app-shell .material-package-details dt,
#app-shell .material-summary-card dt { color: var(--muted); }
#app-shell .material-package-details dd,
#app-shell .material-summary-card dd { overflow: hidden; color: var(--ink); font-weight: var(--weight-semibold); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.material-package-details .full-button { width: 100%; margin-top: 11px; }
.summary-type { display: inline-grid; min-width: 31px; height: 24px; margin-right: 7px; place-items: center; border-radius: 5px; background: #f1eff4; color: var(--purple); font-size: 11px !important; font-weight: var(--weight-semibold); }
#app-shell .material-view-all { margin-top: 9px; padding: 4px 0; font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); }
#app-shell .material-visibility-note { margin: 8px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 16px; }
.material-support-panel { border-radius: 8px; box-shadow: none; }
.material-support-panel > summary { min-height: 58px; padding: 12px 14px; }
#app-shell .material-support-panel > summary strong { font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
#app-shell .material-support-panel > summary small { font-size: 11px; line-height: 16px; }
.markdown-dialog textarea { resize: vertical; }

/* UX-04 — Ordini di lavoro */

.work-orders-header { align-items: center; margin-bottom: 18px; }
.work-orders-header h2 { margin-bottom: 2px; letter-spacing: -.025em; }
.work-orders-header .muted { font-size: 14px; line-height: 21px; }
#app-shell .work-orders-header .primary-button { min-height: 40px; padding-inline: 15px; font-size: 13px; line-height: 18px; }

.work-order-metrics { gap: 10px; margin-bottom: 14px; }
.work-order-metric { display: grid; min-height: 106px; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
.work-order-metric-icon { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); }
.work-order-metric.review .work-order-metric-icon { background: var(--amber-soft); color: var(--amber); }
.work-order-metric.ready .work-order-metric-icon { background: var(--green-soft); color: var(--green); }
.work-order-metric.published .work-order-metric-icon { background: #eee9ff; color: #6548cc; }
.work-order-metric-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.work-order-metric > div { display: grid; min-width: 0; gap: 2px; }
#app-shell .work-order-metric > div > span { color: var(--ink); font-size: 12px; line-height: 16px; font-weight: var(--weight-medium); }
#app-shell .work-order-metric strong { color: var(--ink); font-size: 24px; line-height: 30px; font-weight: var(--weight-bold); letter-spacing: -.035em; }
#app-shell .work-order-metric small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }

.work-orders-control-layout { grid-template-columns: minmax(0, 1fr) 286px; gap: 14px; }
.work-order-content-column { min-width: 0; }
.work-order-table-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
.work-order-table-toolbar { display: grid; min-height: 64px; grid-template-columns: minmax(170px, 1.4fr) repeat(4, minmax(84px, .65fr)) auto 38px; align-items: center; gap: 7px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.work-order-search { width: 100%; min-width: 0; background: #fff; }
.work-order-search > svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-shell .work-order-search input { height: 38px; font-size: 12px; line-height: 16px; }
.work-order-select { position: relative; display: block; min-width: 0; }
.work-order-select select { width: 100%; height: 40px; appearance: none; padding: 0 29px 0 9px; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; background: #fff; color: var(--ink); font-size: 11px; line-height: 16px; cursor: pointer; text-overflow: ellipsis; }
.work-order-select > svg { position: absolute; top: 12px; right: 8px; width: 15px; height: 15px; pointer-events: none; fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-shell .work-order-advanced-button { display: flex; min-height: 40px; align-items: center; gap: 6px; padding: 0 10px; white-space: nowrap; font-size: 11px; line-height: 16px; }
.work-order-advanced-button.active { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }
.work-order-advanced-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.work-order-refresh { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); cursor: pointer; }
.work-order-refresh:hover { border-color: var(--purple-line); color: var(--purple); }
.work-order-refresh svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.work-order-advanced-filters { display: flex; align-items: end; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfafc; }
.work-order-advanced-filters label { display: grid; min-width: 170px; gap: 4px; color: var(--muted); font-size: 11px; line-height: 16px; font-weight: var(--weight-medium); }
.work-order-advanced-filters select { height: 36px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 12px; }
#app-shell .work-order-advanced-filters .text-button { min-height: 36px; font-size: 12px; line-height: 16px; }

.work-order-table-card .official-work-order-table { overflow-x: auto; border: 0; border-radius: 0; }
.work-order-table-card .official-work-order-columns,
.work-order-table-card .official-work-order-row { min-width: 880px; grid-template-columns: 92px minmax(160px, 1.5fr) 100px 64px 100px 55px 98px 120px 27px; gap: 8px; }
.work-order-table-card .official-work-order-columns { min-height: 44px; padding: 0 12px; background: #fbfafc; color: var(--ink-soft); font-size: 11px; line-height: 16px; font-weight: var(--weight-medium); letter-spacing: 0; text-transform: none; }
.work-order-table-card .work-order-record { min-width: 880px; padding: 0; }
.work-order-table-card .official-work-order-row { min-height: 64px; padding: 9px 12px; }
.work-order-identity { display: flex; align-items: center; gap: 6px; }
.work-order-kind-icon { display: grid; width: 24px; height: 24px; flex: 0 0 auto; place-items: center; border-radius: 6px; background: var(--purple-soft); color: var(--purple); }
.work-order-kind-icon.warning { background: var(--amber-soft); color: var(--amber); }
.work-order-kind-icon.success { background: var(--green-soft); color: var(--green); }
.work-order-kind-icon.published { background: #eee9ff; color: #6548cc; }
.work-order-kind-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-shell .work-order-identity .public-id { overflow: hidden; color: var(--ink); font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.work-order-title { gap: 1px; }
#app-shell .work-order-title h3 { overflow: hidden; color: var(--ink); font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
#app-shell .work-order-title p { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
#app-shell .work-order-project { overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
#app-shell .work-order-table-card .priority-badge { font-size: 11px; line-height: 16px; }
.work-order-agent-stack { display: flex; align-items: center; }
.work-order-agent-stack :is(i, b, em) { display: grid; width: 27px; height: 27px; margin-left: -5px; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #f1eff4; color: var(--ink); font-size: 11px; line-height: 1; font-style: normal; font-weight: var(--weight-semibold); }
.work-order-agent-stack :first-child { margin-left: 0; }
.work-order-agent-stack .tone-0 { background: #fde8c9; }
.work-order-agent-stack .tone-1 { background: #e6efff; }
.work-order-agent-stack .tone-2 { background: #e3f5ed; }
.work-order-agent-stack .tone-3 { background: #efe9ff; }
.work-order-table-card .context-count-button { display: flex; min-height: 30px; align-items: center; justify-content: center; gap: 4px; padding: 4px 6px; font-size: 11px; line-height: 16px; }
.work-order-table-card .context-count-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-shell .work-order-table-card .state-badge { width: max-content; max-width: 96px; overflow: hidden; font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.state-badge.published { background: #eee9ff; color: #6548cc; }
.work-order-updated { display: grid; min-width: 0; gap: 1px; }
#app-shell .work-order-updated strong { overflow: hidden; color: var(--ink-soft); font-size: 11px; line-height: 16px; font-weight: var(--weight-medium); text-overflow: ellipsis; white-space: nowrap; }
#app-shell .work-order-updated small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.work-order-table-card .work-order-more { display: grid; width: 27px; height: 27px; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.work-order-table-card .work-order-more:hover,
.work-order-table-card .work-order-more[aria-expanded="true"] { background: var(--purple-soft); color: var(--purple); }
.work-order-table-card .work-order-more svg { width: 18px; height: 18px; fill: currentColor; }
.work-order-table-card .work-order-record .operation-actions { min-width: 880px; min-height: 54px; align-items: center; padding: 8px 12px; border-top: 1px dashed var(--line); }
.work-order-approval-detail { margin-right: auto; color: var(--muted); font-size: 11px; line-height: 16px; }
.work-order-approval-detail strong { color: var(--ink-soft); }
.work-order-table-card .transition-form select { height: 34px; font-size: 12px; line-height: 16px; }
#app-shell .work-order-table-card .final-state { font-size: 11px; line-height: 16px; }
.work-order-table-card .work-order-record .context-package-slot:not(:empty) { min-width: 880px; padding: 0 12px 12px; }
#app-shell .work-order-record .context-package-panel :is(p, strong, span, small, label) { font-size: 11px; line-height: 16px; }
.work-order-filter-empty { padding: 28px 16px; color: var(--muted); font-size: 13px; line-height: 18px; text-align: center; }
.work-order-pagination { display: flex; min-height: 50px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--muted); }
#app-shell .work-order-pagination > span { font-size: 12px; line-height: 16px; }
.work-order-pagination nav { display: flex; gap: 4px; }
.work-order-pagination nav button { display: grid; width: 30px; height: 30px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.work-order-pagination nav button.active { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }

.work-order-side-column { gap: 14px; }
.work-order-side-column .rail-card { padding: 15px; }
.work-order-side-column .project-rail-heading { margin-bottom: 6px; }
.work-order-side-column .project-rail-heading h3 { display: flex; align-items: center; gap: 7px; }
.work-order-side-column .project-rail-heading h3 svg { width: 18px; height: 18px; fill: none; stroke: var(--purple); stroke-width: 1.7; }
.work-order-side-action { display: flex; width: 100%; min-height: 46px; align-items: center; gap: 10px; padding: 8px 3px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.work-order-side-action:last-child { border-bottom: 0; }
.work-order-side-action > :is(svg, span) { width: 19px; height: 19px; flex: 0 0 auto; color: var(--purple); }
.work-order-side-action > svg { fill: none; stroke: currentColor; stroke-width: 1.7; }
#app-shell .work-order-side-action strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-medium); }
.work-order-side-action:hover:not(:disabled) { color: var(--purple); }
.work-order-side-action:disabled { cursor: not-allowed; opacity: .48; }
.work-order-side-action.primary-side-action { min-height: 40px; justify-content: center; margin: 8px 0 5px; padding: 0 10px; border: 1px solid var(--purple-line); border-radius: 6px; color: var(--purple); text-align: center; }
.work-order-side-action.primary-side-action > span { width: auto; height: auto; }
.ux-work-history { min-height: 53px; padding: 9px 0; }
.ux-work-history > i.published { background: #6548cc; }
#app-shell .ux-work-history strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
#app-shell .ux-work-history span { font-size: 11px; line-height: 16px; }
#app-shell .work-order-history-card > .text-button { width: 100%; margin-top: 8px; padding: 7px 0 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 16px; text-align: center; }
.work-order-dialog { width: min(720px, calc(100vw - 32px)); }
.work-order-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 16px; }
.work-order-description-field { grid-column: 1 / -1; }
.work-order-dialog textarea { resize: vertical; }

@media (max-width: 1180px) {
  .chat-operational-grid { grid-template-columns: minmax(0, 1fr) 340px; }
  .request-material { grid-template-columns: 34px minmax(0, 1fr) 24px; }
  .request-material > time { display: none; }
  .projects-control-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .project-command-bar { align-items: stretch; flex-direction: column; }
  .project-search { width: 100%; }
  .project-filter-controls { justify-content: flex-start; }
  .materials-control-layout { grid-template-columns: minmax(0, 1fr) 285px; }
  .material-table-toolbar { align-items: stretch; flex-direction: column; }
  .material-search { width: 100%; max-width: none; }
  .material-filter-controls { justify-content: flex-start; }
  .material-package-card { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .material-package-card > button { grid-column: 2 / -1; justify-self: start; }
  .work-orders-control-layout { grid-template-columns: minmax(0, 1fr) 250px; }
  .work-order-table-toolbar { grid-template-columns: minmax(170px, 1fr) repeat(2, minmax(100px, .65fr)) auto 38px; }
  .work-order-table-toolbar .work-order-select:nth-of-type(4),
  .work-order-table-toolbar .work-order-select:nth-of-type(5) { grid-row: 2; }
}

@media (max-width: 900px) {
  .sidebar-brand { height: auto; }
  .quick-actions-popover { right: auto; left: 0; }
  .chat-operational-grid { grid-template-columns: 1fr; }
  .projects-control-layout { grid-template-columns: 1fr; }
  .project-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-table { overflow-x: auto; }
  .project-table table { min-width: 820px; }
  .materials-control-layout { grid-template-columns: 1fr; }
  .material-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .material-add-card { grid-row: span 2; }
  .work-orders-control-layout { grid-template-columns: 1fr; }
  .work-order-side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  #app-shell :is(.view-header h2, .ux-chat-heading h2) { font-size: 23px; line-height: 29px; }
  .ux-chat-heading { align-items: flex-start; }
  .quick-actions-popover { position: fixed; top: 118px; right: 12px; left: 12px; width: auto; }
  .ux-chat-page .composer { grid-template-columns: 1fr; }
  .send-button { min-height: 52px; width: 100%; }
  .composer-attachments { display: grid; grid-template-columns: 1fr; }
  #app-shell .composer-attachments .composer-tool { font-size: 13px; text-align: left; }
  .preview-strip { grid-template-columns: 1fr; }
  .projects-header { align-items: flex-start; }
  .project-filter-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .project-select select { min-width: 0; width: 100%; }
  .project-filter-button { grid-column: 1 / -1; justify-content: center; }
  .project-pagination { grid-template-columns: 1fr auto; }
  .project-pagination > span { display: none; }
  .project-side-column { grid-template-columns: 1fr; }
  .materials-header { align-items: flex-start; }
  .material-filter-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .material-select select { width: 100%; min-width: 0; }
  .material-select.material-sort { grid-column: 1 / -1; }
  .material-package-card { grid-template-columns: 42px minmax(0, 1fr); }
  .material-package-card > .state-badge { justify-self: start; }
  .material-package-card > button { grid-column: 1 / -1; width: 100%; }
  .material-side-column { grid-template-columns: 1fr; }
  .material-add-card { grid-row: auto; }
  .material-table-card .material-catalog-detail { padding-left: 13px; }
  .material-catalog-actions,
  .material-upload-form,
  .material-version { align-items: stretch; flex-direction: column; }
  .work-orders-header { align-items: flex-start; }
  .work-order-metrics { grid-template-columns: 1fr 1fr; }
  .work-order-table-toolbar { grid-template-columns: 1fr 1fr; }
  .work-order-search,
  .work-order-advanced-button { grid-column: 1 / -1; }
  .work-order-table-toolbar .work-order-select:nth-of-type(4),
  .work-order-table-toolbar .work-order-select:nth-of-type(5) { grid-row: auto; }
  .work-order-refresh { justify-self: end; }
  .work-order-advanced-filters { align-items: stretch; flex-direction: column; }
  .work-order-advanced-filters label { min-width: 0; }
  .work-order-side-column { grid-template-columns: 1fr; }
  .work-order-dialog-grid { grid-template-columns: 1fr; }
  .work-order-description-field { grid-column: auto; }
}

/* UX-05 — Deploy & Anteprime */

.deploy-header { margin-bottom: 16px; }
.deploy-header h2 { letter-spacing: -.035em; }
.deploy-quick-button svg,
.deploy-environment-panel button svg,
.deployment-safety-card button svg,
.deploy-history-card h3 svg,
.deploy-governance-note svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.deploy-environment-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 174px minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
  margin-bottom: 14px;
}
.deploy-environment-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.deploy-environment-panel > header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.deploy-environment-panel > header > strong { font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.deploy-environment-panel > header > strong span { color: var(--muted); font-weight: var(--weight-regular); }
.deploy-environment-panel.dev > header { box-shadow: inset 3px 0 0 var(--green); }
.deploy-environment-panel.production > header { box-shadow: inset 3px 0 0 var(--danger); }
.deploy-environment-panel > .full-button { width: calc(100% - 28px); margin: 0 14px 13px; }
.deploy-environment-panel.production > .full-button:disabled { opacity: .72; }
.deploy-environment-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 15px; }
.deploy-environment-facts > div { display: grid; min-width: 0; gap: 5px; }
.deploy-environment-facts span { color: var(--muted); font-size: 11px; line-height: 16px; }
.deploy-environment-facts strong { display: flex; min-width: 0; align-items: center; gap: 6px; overflow: hidden; font-size: 12px; line-height: 18px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.deploy-avatar { display: inline-grid; width: 22px; height: 22px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #fff2df; color: #7f5421; font-size: 11px; font-style: normal; line-height: 1; }
.deploy-avatar.agent { background: var(--orange-soft); color: var(--orange); }
.deploy-production-note { display: block; margin: -3px 14px 14px; color: var(--muted); font-size: 11px; line-height: 16px; }
.deploy-production-note strong { color: var(--danger); }
.deploy-compare-bridge { display: grid; align-content: center; justify-items: center; gap: 3px; padding: 10px 0; text-align: center; }
.deploy-compare-bridge > span { display: grid; width: 42px; height: 42px; margin-bottom: 4px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink-soft); }
.deploy-compare-bridge > span svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.deploy-compare-bridge strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.deploy-compare-bridge small { color: var(--muted); font-size: 11px; line-height: 16px; }
.deploy-compare-bridge .secondary-button { width: 100%; min-height: 38px; margin-top: 9px; padding-inline: 10px; border-color: var(--purple-line); color: var(--purple); }

.deploy-workspace-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(430px, .95fr); align-items: start; gap: 14px; }
.deploy-primary-column,
.deploy-secondary-column { display: grid; min-width: 0; gap: 14px; }
.deploy-secondary-grid { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; gap: 14px; }
.deploy-surface { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.deploy-surface-heading { display: flex; min-height: 47px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.deploy-surface-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.deploy-surface-heading > span:not(.state-badge) { color: var(--muted); font-size: 11px; line-height: 16px; }
.deploy-device-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; padding: 0 12px; border-bottom: 1px solid var(--line); }
.deploy-device-switch button { display: flex; min-height: 43px; align-items: center; justify-content: center; gap: 7px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 12px; line-height: 18px; font-weight: var(--weight-medium); cursor: pointer; }
.deploy-device-switch button.active { border-bottom-color: var(--purple); background: transparent; color: var(--purple); }
.deploy-device-switch svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.deployment-preview-card .project-preview-frame { width: calc(100% - 24px); margin: 12px; border-color: var(--line-strong); border-radius: 6px; }
.deployment-preview-card .project-preview-frame.tablet { width: 72%; margin-inline: auto; }
.deployment-preview-card .project-preview-frame.mobile { width: 42%; margin-inline: auto; }
.staging-render { min-height: 270px; background: #fbfbfd; color: #1e2440; }
.staging-render > header { display: flex; min-height: 42px; align-items: center; gap: 18px; padding: 0 14px; border-bottom: 1px solid #eceaf1; background: #fff; }
.staging-render > header strong { color: #313b70; font-size: 12px; line-height: 17px; }
.staging-render > header nav { flex: 1; color: #85879a; font-size: 11px; line-height: 16px; }
.staging-render > header i { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--orange-soft); color: #916029; font-size: 11px; font-style: normal; }
.staging-render > div { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(150px, .9fr); min-height: 228px; align-items: center; gap: 18px; padding: 26px; background: linear-gradient(130deg, #fff 5%, #faf9ff 58%, #f1edff); }
.staging-render section { display: grid; justify-items: start; gap: 8px; }
.staging-render section small { color: var(--purple); font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); letter-spacing: .04em; }
.staging-render section strong { font-size: clamp(18px, 2vw, 26px); line-height: 1.13; letter-spacing: -.035em; }
.staging-render section p { max-width: 390px; margin: 0; color: var(--muted); font-size: 12px !important; line-height: 18px !important; }
.staging-render section button { min-height: 33px; padding: 0 12px; border: 0; border-radius: 5px; background: var(--purple); color: #fff; font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); cursor: pointer; }
.staging-render aside { position: relative; min-height: 160px; }
.staging-render aside span { position: absolute; display: block; border-radius: 18px; background: linear-gradient(145deg, #ece9ff, #cfc5ff); box-shadow: 0 16px 28px rgb(73 52 154 / 12%); transform: rotate(8deg); }
.staging-render aside span:nth-child(1) { inset: 10% 11% 22% 12%; }
.staging-render aside span:nth-child(2) { width: 42%; height: 42%; right: 1%; bottom: 9%; background: linear-gradient(145deg, #ffd9ad, #f1a95d); transform: rotate(-15deg); }
.staging-render aside span:nth-child(3) { width: 33%; height: 29%; top: 0; left: 0; background: linear-gradient(145deg, #fff, #dad4f5); transform: rotate(-11deg); }

.deploy-version-list,
.deploy-history-list { display: grid; padding: 3px 14px; }
.deploy-version-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; min-height: 69px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.deploy-version-row:last-child { border-bottom: 0; }
.deploy-version-row > div { display: grid; min-width: 0; gap: 2px; }
.deploy-version-row > div strong { overflow: hidden; font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.deploy-version-row > div small,
.deploy-version-actor { color: var(--muted); font-size: 11px; line-height: 16px; }
.deploy-version-actor { grid-column: 1; }
.deploy-version-row .icon-only { grid-column: 2; grid-row: 1 / span 2; width: 28px; height: 28px; padding: 5px; }
.deploy-version-row .icon-only svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.deploy-versions-card > .text-button,
.deploy-history-card > .text-button { width: calc(100% - 28px); margin: 4px 14px 12px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11px; line-height: 16px; text-align: center; }

.patch-ledger-header { align-items: center; }
.patch-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.patch-summary-grid article { display: grid; gap: 5px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.patch-summary-grid span { color: var(--muted-2); font-size: 8px; font-weight: var(--weight-bold); letter-spacing: .08em; }
.patch-summary-grid strong { font-size: 20px; line-height: 25px; }
.patch-summary-grid small { color: var(--muted); font-size: 10px; line-height: 15px; }
.patch-filter-bar { display: grid; grid-template-columns: repeat(3, minmax(150px, 1fr)) auto; align-items: end; gap: 10px; margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.patch-filter-bar label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: var(--weight-semibold); }
.patch-filter-bar select { min-width: 0; height: 35px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); }
.patch-audit-note { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 10px; }
.patch-audit-note svg { width: 14px; height: 14px; fill: none; stroke: var(--green); stroke-width: 1.8; }
.patch-audit-note strong { color: var(--ink); }
.patch-deep-evidence { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.patch-deep-evidence > summary { padding: 12px 14px; color: var(--ink); font-size: 11px; font-weight: var(--weight-semibold); cursor: pointer; }
.patch-deep-evidence .table-scroll { max-height: 340px; overflow: auto; border-top: 1px solid var(--line); }
.patch-deep-evidence table { width: 100%; border-collapse: collapse; font-size: 9px; }
.patch-deep-evidence th, .patch-deep-evidence td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.patch-deep-evidence th { position: sticky; top: 0; background: var(--surface-soft); color: var(--muted); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.patch-deep-evidence code { font-size: 9px; }
.patch-deep-evidence > p { margin: 0; padding: 9px 14px 11px; color: var(--muted); font-size: 9px; }
.patch-chronology { display: grid; gap: 24px; }
.patch-month { display: grid; gap: 8px; }
.patch-month > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px solid var(--line-strong); }
.patch-month > header h3 { margin: 0; font-size: 15px; text-transform: capitalize; }
.patch-month > header span { color: var(--muted); font-size: 10px; }
.patch-timeline-list { display: grid; }
.patch-event-card { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.patch-event-card::before { position: absolute; top: 27px; bottom: -14px; left: 5px; width: 1px; background: var(--line-strong); content: ""; }
.patch-event-card:last-child::before { display: none; }
.patch-event-card > i { z-index: 1; width: 11px; height: 11px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: var(--muted-2); box-shadow: 0 0 0 1px var(--line-strong); }
.patch-event-card > i.success { background: var(--green); }
.patch-event-card > i.warning { background: #d4962e; }
.patch-event-body { display: grid; min-width: 0; gap: 7px; }
.patch-event-body > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.patch-event-body > header > div { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; }
.patch-event-body > header > div > span { color: var(--blue); font-size: 10px; font-weight: var(--weight-bold); text-transform: uppercase; }
.patch-event-body time { color: var(--muted); font-size: 10px; }
.patch-event-body h3 { overflow-wrap: anywhere; margin: 0; font-size: 13px; line-height: 18px; }
.patch-facts { display: flex; flex-wrap: wrap; gap: 5px; }
.patch-facts span { padding: 3px 7px; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: 9px; }
.patch-bundle-path { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.patch-event-body details { border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.patch-event-body summary { padding: 7px 9px; color: var(--muted); font-size: 10px; cursor: pointer; }
.patch-event-body ul { display: grid; max-height: 240px; gap: 0; margin: 0; padding: 0 9px 7px; overflow: auto; list-style: none; }
.patch-event-body li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.patch-event-body li code { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.patch-event-body li span { color: var(--muted); font-size: 9px; }
.patch-event-card.backup-only > i { background: var(--muted-2); }
.patch-empty { display: grid; min-height: 220px; place-content: center; justify-items: center; gap: 10px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); text-align: center; }
.loading-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--blue); animation: pulse 1.2s ease-in-out infinite; }

@media (max-width: 1050px) {
  .patch-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patch-filter-bar { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 650px) {
  .patch-summary-grid, .patch-filter-bar { grid-template-columns: 1fr; }
  .patch-event-body > header, .patch-event-body li { grid-template-columns: 1fr; }
  .patch-event-body > header { display: grid; }
}
.deploy-history-row { position: relative; display: grid; grid-template-columns: 11px minmax(0, 1fr); gap: 0 8px; min-height: 74px; padding: 11px 0; }
.deploy-history-row:not(:last-child)::before { position: absolute; top: 23px; bottom: -12px; left: 4px; width: 1px; background: var(--line-strong); content: ""; }
.deploy-history-row > i { z-index: 1; width: 9px; height: 9px; margin-top: 3px; border-radius: 50%; background: var(--muted-2); }
.deploy-history-row > i.success { background: var(--green); }
.deploy-history-row > i.warning { background: var(--blue); }
.deploy-history-row > i.danger { background: var(--danger); }
.deploy-history-row > div { display: grid; gap: 2px; }
.deploy-history-row time,
.deploy-history-row small,
.deploy-history-actor { color: var(--muted); font-size: 11px; line-height: 16px; }
.deploy-history-row strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.deploy-history-actor { grid-column: 2; }

.deployment-workflow-card { padding-bottom: 13px; }
.deployment-workflow { display: grid; grid-template-columns: repeat(5, 1fr); padding: 21px 18px 5px; }
.deploy-workflow-step { position: relative; display: grid; justify-items: center; gap: 4px; padding-inline: 5px; text-align: center; }
.deploy-workflow-step:not(:last-child)::after { position: absolute; z-index: 0; top: 14px; left: calc(50% + 17px); width: calc(100% - 34px); height: 1px; background: var(--line-strong); content: ""; }
.deploy-workflow-step b { z-index: 1; display: grid; width: 29px; height: 29px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: #fff; color: var(--muted); font-size: 11px; line-height: 1; }
.deploy-workflow-step.complete b { border-color: var(--purple); background: var(--purple); color: #fff; }
.deploy-workflow-step.blocked b { border-color: #e6b9b4; background: var(--danger-soft); color: var(--danger); }
.deploy-workflow-step strong { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.deploy-workflow-step small { color: var(--muted); font-size: 11px; line-height: 15px; }

.deployment-safety-card,
.deployment-audit-card { padding-bottom: 14px; }
.deployment-safety-card > p,
.deployment-audit-card > p { margin: 12px 14px; color: var(--muted); font-size: 11px !important; line-height: 17px !important; }
.deployment-safety-card > .secondary-button { width: calc(100% - 28px); margin: 0 14px; border-color: var(--purple-line); color: var(--purple); }
.deployment-safety-card > small { display: block; margin: 8px 14px 0; color: var(--muted); font-size: 11px; line-height: 16px; }
.deployment-audit-card .queue-list { padding: 3px 14px; }
.deployment-audit-card .queue-row { min-height: 42px; padding-block: 8px; }
.deployment-audit-card .queue-row > span { font-size: 11px; line-height: 16px; }
.deployment-audit-card > .text-button { margin: 0 14px; font-size: 11px; line-height: 16px; }
.deploy-governance-note { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.deploy-governance-note svg { flex: 0 0 auto; color: var(--purple); }
.deploy-governance-note strong { color: var(--ink-soft); }

@media (max-width: 1180px) {
  .deploy-environment-comparison { grid-template-columns: minmax(0, 1fr) 135px minmax(0, 1fr); }
  .deploy-environment-facts { grid-template-columns: 1fr 1fr; }
  .deploy-environment-facts > div:last-child { grid-column: 1 / -1; }
  .deploy-workspace-grid { grid-template-columns: minmax(0, 1fr) 390px; }
  .deploy-secondary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .deploy-environment-comparison { grid-template-columns: 1fr; }
  .deploy-compare-bridge { grid-template-columns: auto auto 1fr; justify-items: start; gap: 5px 9px; padding: 0; text-align: left; }
  .deploy-compare-bridge > span { grid-row: 1 / span 2; margin: 0; }
  .deploy-compare-bridge > small { grid-column: 2; }
  .deploy-compare-bridge .secondary-button { grid-column: 3; grid-row: 1 / span 2; margin: 0; }
  .deploy-workspace-grid { grid-template-columns: 1fr; }
  .deploy-secondary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .deploy-header .header-actions,
  .deploy-header .deploy-quick-button { width: 100%; }
  .deploy-environment-facts { grid-template-columns: 1fr; }
  .deploy-environment-facts > div:last-child { grid-column: auto; }
  .deploy-compare-bridge { grid-template-columns: auto 1fr; }
  .deploy-compare-bridge .secondary-button { grid-column: 1 / -1; grid-row: auto; }
  .deploy-secondary-grid { grid-template-columns: 1fr; }
  .deployment-preview-card .project-preview-frame.tablet { width: 84%; }
  .deployment-preview-card .project-preview-frame.mobile { width: 64%; }
  .staging-render > header nav { display: none; }
  .staging-render > div { grid-template-columns: 1fr; min-height: 330px; padding: 19px; }
  .staging-render aside { min-height: 110px; }
  .deployment-workflow { grid-template-columns: 1fr; gap: 10px; padding-inline: 15px; }
  .deploy-workflow-step { grid-template-columns: 29px 1fr; justify-items: start; align-items: center; text-align: left; }
  .deploy-workflow-step:not(:last-child)::after { top: 29px; bottom: -11px; left: 14px; width: 1px; height: auto; }
  .deploy-workflow-step b { grid-row: 1 / span 2; }
  .deploy-workflow-step small { grid-column: 2; }
}

/* UX-06 — Agenti */

.agents-header { margin-bottom: 18px; }
.agents-header h2 { letter-spacing: -.035em; }
.agents-workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 306px; align-items: start; gap: 18px; }
.agents-primary-column,
.agents-secondary-column { display: grid; min-width: 0; gap: 15px; }
.agents-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 11px; }
.agents-section-heading h3 { margin: 0; font-size: 16px; line-height: 22px; font-weight: var(--weight-semibold); }
.agents-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 16px; }
.agents-section-heading .secondary-button { min-height: 36px; border-color: var(--purple-line); color: var(--purple); }
.ux-provider-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ux-provider-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) 30px; grid-template-rows: auto auto; min-width: 0; min-height: 116px; gap: 7px 10px; padding: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.ux-provider-card.connected { border-color: #d8eae2; }
.ux-provider-card > .provider-logo { grid-row: 1 / span 2; width: 42px; height: 42px; border-radius: 50%; font-size: 11px; line-height: 1; }
.provider-openai { background: #12a47b; }
.provider-anthropic { background: #f3e5da; color: #4f3529; }
.provider-gemini { background: #eef1ff; color: #5f60e8; }
.ux-provider-card > div:nth-child(2) { align-self: start; gap: 2px; }
.ux-provider-card > div:nth-child(2) strong { font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); }
.ux-provider-card > div:nth-child(2) span,
.ux-provider-card > div:nth-child(2) small { display: block; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.ux-provider-card > .state-badge { grid-column: 2; grid-row: 2; align-self: end; justify-self: start; }
.ux-provider-card > .icon-only { grid-column: 3; grid-row: 1 / span 2; align-self: start; width: 28px; height: 28px; padding: 5px; }
.ux-provider-card > .icon-only svg,
.agent-row-more svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }

.agent-directory-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.agent-directory-toolbar { display: grid; grid-template-columns: minmax(170px, 1fr) minmax(180px, 240px) auto; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--line); }
.agent-directory-toolbar > div { display: grid; gap: 2px; }
.agent-directory-toolbar h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.agent-directory-toolbar h3 span { color: var(--muted); font-weight: var(--weight-regular); }
.agent-directory-toolbar small { color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-directory-search { width: 100%; }
.agent-directory-search svg,
.agent-filter-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.agent-filter-button { min-height: 36px; padding-inline: 12px; }
.agent-filter-button.active { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }
.agent-filter-panel { display: flex; align-items: flex-end; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); background: #faf9fc; }
.agent-filter-panel label { display: grid; min-width: 120px; gap: 4px; color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-filter-panel select { min-height: 34px; padding: 0 30px 0 9px; font-size: 12px; line-height: 18px; }
.agent-filter-panel .text-button { min-height: 34px; margin-left: auto; }
.agent-directory-head,
.agent-directory-row { display: grid; grid-template-columns: minmax(180px, 1.55fr) minmax(92px, .75fr) minmax(90px, .7fr) minmax(120px, 1fr) minmax(96px, .72fr) 82px 42px; align-items: center; gap: 10px; }
.agent-directory-head { min-height: 41px; padding: 0 13px; border-bottom: 1px solid var(--line); background: #faf9fc; color: var(--muted); }
.agent-directory-head span { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.agent-directory-row { min-height: 70px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
.agent-directory-row:last-of-type { border-bottom: 0; }
.agent-directory-identity { display: flex; min-width: 0; align-items: center; gap: 9px; }
.agent-directory-identity .agent-orb { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #121b34; color: #fff; font-size: 11px; line-height: 1; font-weight: var(--weight-semibold); }
.agent-directory-identity > div { display: grid; min-width: 0; gap: 2px; }
.agent-directory-identity strong { overflow: hidden; font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.agent-directory-identity small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.agent-provider-cell { display: flex; min-width: 0; align-items: center; gap: 6px; }
.agent-provider-cell strong,
.agent-role-cell,
.agent-project-cell { overflow: hidden; font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.provider-mini { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #12a47b; color: #fff; font-size: 11px; line-height: 1; font-weight: var(--weight-semibold); }
.agent-permission-menu summary { padding: 5px 8px; font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.agent-permission-menu > div { top: 31px; width: 235px; gap: 6px; padding: 11px; font-size: 11px; line-height: 16px; }
.agent-permission-menu .permission-denied { padding-top: 5px; border-top: 1px solid var(--line); color: var(--danger); }
.agent-row-more { width: 30px; height: 30px; padding: 6px; }
.agent-filter-empty { padding: 25px 15px; color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
.agent-directory-footer { display: flex; min-height: 48px; align-items: center; justify-content: flex-end; gap: 16px; padding: 0 13px; border-top: 1px solid var(--line); color: var(--muted); }
.agent-directory-footer > span { font-size: 11px; line-height: 16px; }
.agent-directory-footer nav { display: flex; align-items: center; gap: 4px; }
.agent-directory-footer nav button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; }
.agent-directory-footer nav button.active { background: var(--purple-soft); color: var(--purple); }
.agent-invite-banner { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 14px 16px; border: 1px solid var(--purple-line); border-radius: 9px; background: #faf8ff; }
.agent-invite-banner > span { color: var(--purple); font-size: 28px; line-height: 1; }
.agent-invite-banner > div { display: grid; gap: 2px; }
.agent-invite-banner strong { font-size: 13px; line-height: 18px; font-weight: var(--weight-semibold); }
.agent-invite-banner small { color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-invite-banner .primary-button:disabled { opacity: .62; }

.agent-policy-card,
.agent-usage-card,
.agent-isolation-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.agent-policy-card > header,
.agent-usage-card > header { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 9px; padding: 0 13px; border-bottom: 1px solid var(--line); }
.agent-policy-card > header h3,
.agent-usage-card > header h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.agent-policy-card > header h3 svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.7; }
.agent-policy-card > header > span,
.agent-usage-card > header > span { color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-policy-body { padding: 13px; }
.agent-policy-body > strong { display: block; margin-bottom: 4px; font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.agent-policy-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.agent-policy-toggle > span { display: grid; gap: 2px; }
.agent-policy-toggle strong { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.agent-policy-toggle small { color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-policy-toggle input { position: relative; width: 34px; height: 19px; margin: 0; appearance: none; border: 0; border-radius: 999px; background: #d8d5de; opacity: 1; }
.agent-policy-toggle input::before { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 18%); content: ""; }
.agent-policy-toggle input:checked { background: var(--purple); }
.agent-policy-toggle input:checked::before { left: 17px; }
.agent-approval-policy { display: grid; gap: 6px; padding: 12px 0; color: var(--ink-soft); font-size: 11px; line-height: 16px; }
.agent-approval-policy select { width: 100%; min-height: 36px; padding: 0 9px; color: var(--ink-soft); font-size: 11px; opacity: 1; }
.agent-hard-locks { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.agent-hard-locks span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-hard-locks svg { width: 14px; height: 14px; fill: none; stroke: var(--danger); stroke-width: 1.8; }
.agent-hard-locks b { margin-left: auto; color: var(--danger); font-size: 11px; line-height: 16px; }
.agent-policy-link { display: flex; width: 100%; min-height: 42px; align-items: center; justify-content: space-between; padding: 0 13px; border: 0; border-top: 1px solid var(--line); background: #fff; color: var(--purple); font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); cursor: pointer; }
.agent-usage-list { display: grid; padding: 4px 13px; }
.agent-usage-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; min-height: 67px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.agent-usage-row:last-child { border-bottom: 0; }
.usage-agent-avatar { display: grid; width: 30px; height: 30px; grid-row: 1 / span 2; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 11px; line-height: 1; font-weight: var(--weight-semibold); }
.agent-usage-row > div { display: grid; min-width: 0; gap: 2px; }
.agent-usage-row strong { overflow: hidden; font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); text-overflow: ellipsis; white-space: nowrap; }
.agent-usage-row small,
.agent-usage-row time { color: var(--muted); font-size: 11px; line-height: 16px; }
.agent-usage-row time { justify-self: end; }
.agent-usage-row > .state-badge { grid-column: 3; justify-self: end; }
.agent-usage-card > .text-button { width: calc(100% - 26px); margin: 3px 13px 12px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 11px; line-height: 16px; text-align: center; }
.agent-isolation-card { display: flex; align-items: flex-start; gap: 10px; padding: 13px; }
.agent-isolation-card > svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--purple); stroke-width: 1.7; }
.agent-isolation-card > div { display: grid; gap: 3px; }
.agent-isolation-card strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.agent-isolation-card p { margin: 0; color: var(--muted); font-size: 11px !important; line-height: 17px !important; }

@media (max-width: 1180px) {
  .agents-workspace-grid { grid-template-columns: minmax(0, 1fr) 280px; }
  .ux-provider-card { grid-template-columns: 36px minmax(0, 1fr) 28px; padding: 11px; }
  .ux-provider-card > .provider-logo { width: 36px; height: 36px; }
  .agent-directory-head,
  .agent-directory-row { grid-template-columns: minmax(160px, 1.4fr) 90px 82px minmax(100px, .9fr) 92px 76px 32px; gap: 7px; }
}

@media (max-width: 900px) {
  .agents-workspace-grid { grid-template-columns: 1fr; }
  .agents-secondary-column { grid-template-columns: 1fr 1fr; align-items: start; }
  .agent-isolation-card { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .agents-section-heading { align-items: stretch; flex-direction: column; }
  .ux-provider-grid { grid-template-columns: 1fr; }
  .ux-provider-card { min-height: 92px; }
  .agent-directory-toolbar { grid-template-columns: 1fr auto; }
  .agent-directory-toolbar > div,
  .agent-directory-search { grid-column: 1 / -1; }
  .agent-filter-panel { align-items: stretch; flex-direction: column; }
  .agent-filter-panel label { width: 100%; }
  .agent-filter-panel .text-button { margin-left: 0; }
  .agent-directory-head { display: none; }
  .agent-directory-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 13px; }
  .agent-directory-identity { grid-column: 1; }
  .agent-directory-row > .state-badge { grid-column: 2; grid-row: 1; }
  .agent-provider-cell,
  .agent-role-cell,
  .agent-project-cell { grid-column: 1 / -1; }
  .agent-role-cell::before { color: var(--muted); content: "Ruolo · "; }
  .agent-project-cell::before { color: var(--muted); content: "Progetti · "; }
  .agent-permission-menu { grid-column: 1; }
  .agent-row-more { grid-column: 2; grid-row: 5; }
  .agent-directory-footer { justify-content: space-between; }
  .agent-invite-banner { grid-template-columns: 34px minmax(0, 1fr); }
  .agent-invite-banner .primary-button { grid-column: 1 / -1; width: 100%; }
  .agents-secondary-column { grid-template-columns: 1fr; }
  .agent-isolation-card { grid-column: auto; }
}

/* UX-07 — Impostazioni, Utenti & Permessi */

.settings-header { margin-bottom: 13px; }
.settings-header h2 { letter-spacing: -.035em; }
.settings-tabs { gap: 22px; padding-inline: 8px; }
.settings-tabs .filter-tab { min-height: 43px; padding-inline: 2px; border-bottom-width: 2px; }
.settings-users-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; align-items: start; gap: 18px; }
.settings-users-card { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.settings-users-toolbar { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(190px, 240px) 132px auto; align-items: center; gap: 9px; padding: 14px; border-bottom: 1px solid var(--line); }
.settings-users-toolbar > div { display: grid; gap: 3px; }
.settings-users-toolbar h3 { margin: 0; font-size: 16px; line-height: 22px; font-weight: var(--weight-semibold); }
.settings-users-toolbar p { margin: 0; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.settings-user-search { width: 100%; }
.settings-user-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.settings-user-filter { position: relative; display: block; }
.settings-user-filter select { width: 100%; min-height: 38px; padding: 0 31px 0 10px; appearance: none; font-size: 11px; line-height: 16px; }
.settings-user-filter svg { position: absolute; top: 11px; right: 9px; width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.7; pointer-events: none; }
.settings-add-user { min-height: 38px; border-color: var(--purple-line); color: var(--purple); white-space: nowrap; }
.settings-personal-notice { display: grid; grid-template-columns: 20px minmax(0, 1fr) 28px; align-items: start; gap: 9px; margin: 12px 14px; padding: 12px; border: 1px solid #e5ddff; border-radius: 7px; background: #faf8ff; }
.settings-personal-notice > svg { width: 17px; height: 17px; margin-top: 1px; fill: var(--purple); stroke: none; }
.settings-personal-notice > div { display: grid; gap: 2px; }
.settings-personal-notice strong { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.settings-personal-notice p { margin: 0; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.settings-personal-notice .icon-only { width: 28px; height: 28px; }
.settings-user-head,
.settings-user-row { display: grid; grid-template-columns: minmax(185px, 1.35fr) 112px minmax(130px, .95fr) minmax(170px, 1.15fr) 92px 36px; align-items: center; gap: 10px; }
.settings-user-head { min-height: 40px; padding: 0 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #faf9fc; color: var(--muted); }
.settings-user-head span { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.settings-user-row { min-height: 86px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.settings-user-row:last-of-type { border-bottom: 0; }
.settings-user-row:hover { background: #fdfcfe; }
.settings-user-row .directory-user { gap: 9px; }
.settings-user-row .directory-user .avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #fff0da; color: #784f20; font-size: 11px; line-height: 1; }
.settings-user-row .directory-user .avatar.tone-1 { background: #e8f3ff; color: #315f80; }
.settings-user-row .directory-user .avatar.tone-2 { background: #f2ecff; color: #6645a3; }
.settings-user-row .directory-user .avatar.tone-3 { background: #f3f1f7; color: #5c5868; }
.settings-user-row .directory-user strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.settings-user-row .directory-user span { font-size: 11px; line-height: 16px; }
.settings-role-select,
.settings-status-select { width: 100%; min-height: 32px; padding: 0 8px; font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.settings-role-select { border-color: var(--purple-line); background: var(--purple-soft); color: var(--purple); }
.settings-status-select { border-color: #cfe8de; background: var(--green-soft); color: var(--green); }
.settings-project-access { display: flex; min-width: 0; flex-wrap: wrap; gap: 4px; }
.settings-project-access span,
.settings-project-access b { padding: 3px 6px; border-radius: 4px; background: #f5f4f7; color: var(--ink-soft); font-size: 11px; line-height: 15px; font-weight: var(--weight-regular); }
.settings-project-access b { background: var(--purple-soft); color: var(--purple); }
.settings-permission-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.settings-permission-list li { position: relative; padding-left: 13px; overflow: hidden; font-size: 11px; line-height: 15px; text-overflow: ellipsis; white-space: nowrap; }
.settings-permission-list li::before { position: absolute; top: 5px; left: 1px; width: 5px; height: 5px; border: 1px solid var(--purple); border-radius: 50%; content: ""; }
.settings-user-actions { position: relative; }
.settings-user-actions summary { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 6px; color: var(--muted); cursor: pointer; list-style: none; }
.settings-user-actions summary::-webkit-details-marker { display: none; }
.settings-user-actions summary svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.settings-user-actions > div { position: absolute; z-index: 9; top: 32px; right: 0; display: grid; width: 190px; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: var(--shadow-md); }
.settings-user-actions > div span { color: var(--muted); font-size: 11px; line-height: 16px; }
.settings-user-empty { padding: 28px 15px; color: var(--muted); font-size: 12px; line-height: 18px; text-align: center; }
.settings-user-footer { display: flex; min-height: 49px; align-items: center; justify-content: flex-end; gap: 14px; padding: 0 14px; border-top: 1px solid var(--line); color: var(--muted); }
.settings-user-footer > span { margin-right: auto; font-size: 11px; line-height: 16px; }
.settings-user-footer nav { display: flex; gap: 3px; }
.settings-user-footer nav button { display: grid; width: 28px; height: 28px; place-items: center; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; }
.settings-user-footer nav button.active { border: 1px solid var(--purple); background: #fff; color: var(--purple); }
.settings-user-footer select { min-height: 30px; padding: 0 8px; color: var(--ink-soft); font-size: 11px; opacity: 1; }
.settings-governance-details { border-top: 1px solid var(--line); }
.settings-governance-details > summary { display: flex; min-height: 47px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; color: var(--purple); cursor: pointer; list-style: none; }
.settings-governance-details > summary::-webkit-details-marker { display: none; }
.settings-governance-details > summary span,
.settings-governance-details > summary b { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.settings-governance-details > summary b { color: var(--muted); font-weight: var(--weight-regular); }
.settings-governance-grid { display: grid; gap: 16px; padding: 14px; border-top: 1px solid var(--line); background: #faf9fc; }
.settings-governance-grid > section { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.settings-invitation-list { display: grid; }
.settings-invitation-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.settings-invitation-row:last-child { border-bottom: 0; }
.settings-invitation-icon { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 7px; background: var(--purple-soft); color: var(--purple); font-size: 11px; line-height: 1; font-weight: var(--weight-semibold); }
.settings-invitation-row > div { display: grid; min-width: 0; gap: 2px; }
.settings-invitation-row strong { font-size: 12px; line-height: 17px; }
.settings-invitation-row small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 16px; text-overflow: ellipsis; white-space: nowrap; }
.settings-invite-dialog { width: min(670px, calc(100vw - 32px)); }
.settings-invite-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 16px; }
.settings-invite-fields label:last-child { grid-column: 1 / -1; }

.settings-users-sidebar { display: grid; min-width: 0; gap: 13px; }
.settings-role-card,
.settings-help-card,
.settings-access-card { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.settings-role-card > header { padding: 14px; border-bottom: 1px solid var(--line); }
.settings-role-card h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.settings-role-card header p { margin: 5px 0 0; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.settings-role-card > div { display: grid; gap: 8px; padding: 11px; }
.settings-role-card article { padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.settings-role-card article strong { color: var(--purple); font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }
.settings-role-card article p { margin: 4px 0 0; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.settings-help-card { padding: 13px; background: #faf8ff; }
.settings-help-card > div { display: flex; align-items: center; gap: 7px; }
.settings-help-card svg,
.settings-access-card > svg { width: 17px; height: 17px; fill: none; stroke: var(--purple); stroke-width: 1.7; }
.settings-help-card strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.settings-help-card p { margin: 7px 0 11px; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.settings-help-card .secondary-button { min-height: 35px; justify-content: space-between; border-color: var(--purple-line); color: var(--purple); }
.settings-access-card { display: flex; align-items: flex-start; gap: 9px; padding: 13px; }
.settings-access-card > svg { flex: 0 0 auto; }
.settings-access-card > div { display: grid; gap: 3px; }
.settings-access-card strong { font-size: 12px; line-height: 17px; }
.settings-access-card p { margin: 0; color: var(--muted); font-size: 11px !important; line-height: 17px !important; }

@media (max-width: 1180px) {
  .settings-users-layout { grid-template-columns: minmax(0, 1fr) 255px; }
  .settings-users-toolbar { grid-template-columns: 1fr 1fr 130px; }
  .settings-users-toolbar > div { grid-column: 1 / -1; }
  .settings-user-head,
  .settings-user-row { grid-template-columns: minmax(165px, 1.25fr) 105px minmax(115px, .9fr) minmax(150px, 1fr) 86px 32px; gap: 7px; }
}

@media (max-width: 900px) {
  .settings-users-layout { grid-template-columns: 1fr; }
  .settings-users-sidebar { grid-template-columns: 1fr 1fr; align-items: start; }
  .settings-access-card { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .settings-tabs { gap: 17px; }
  .settings-users-toolbar { grid-template-columns: 1fr; }
  .settings-users-toolbar > div,
  .settings-user-search { grid-column: auto; }
  .settings-user-head { display: none; }
  .settings-user-row { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 13px; }
  .settings-user-row .directory-user { grid-column: 1; }
  .settings-status-select { grid-column: 2; grid-row: 1; width: 105px; }
  .settings-role-select,
  .settings-project-access,
  .settings-permission-list { grid-column: 1 / -1; }
  .settings-role-select { width: 145px; }
  .settings-project-access::before { width: 100%; color: var(--muted); font-size: 11px; line-height: 16px; content: "Accesso progetti"; }
  .settings-permission-list::before { color: var(--muted); font-size: 11px; line-height: 16px; content: "Permessi principali"; }
  .settings-user-actions { grid-column: 2; grid-row: 4; }
  .settings-user-footer { flex-wrap: wrap; justify-content: space-between; padding-block: 9px; }
  .settings-user-footer > span { width: 100%; margin: 0; }
  .settings-governance-details > summary { align-items: flex-start; flex-direction: column; justify-content: center; padding-block: 9px; }
  .settings-invitation-row { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .settings-invitation-row > .secondary-button { grid-column: 1 / -1; width: 100%; }
  .settings-users-sidebar { grid-template-columns: 1fr; }
  .settings-access-card { grid-column: auto; }
  .settings-invite-fields { grid-template-columns: 1fr; }
  .settings-invite-fields label:last-child { grid-column: auto; }
}

/* UX-08 — Aiuto */

.ux-help-page { min-width: 0; }
.help-page-header { align-items: center; margin-bottom: 17px; }
.help-page-header h2 { margin: 0 0 2px; letter-spacing: -.025em; }
.help-page-header p { margin: 0; }
.help-wiki-button { gap: 8px; background: #fff; }
.help-wiki-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.help-page-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 16px; }
.help-main-column,
.help-side-column { display: grid; min-width: 0; gap: 14px; }

.help-search-panel,
.help-surface,
.help-side-card,
.help-reference { border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow-sm); }
.help-search-panel { display: grid; min-height: 132px; grid-template-columns: minmax(0, 1fr) 190px; align-items: center; gap: 22px; padding: 18px 22px; overflow: hidden; background: linear-gradient(105deg, #fff, #fcfbff 74%, #f7f3ff); }
.help-search-panel > div:first-child { display: grid; gap: 9px; }
.help-search-panel h3,
.help-surface > header h3,
.help-side-card h3 { margin: 0; font-size: 14px; line-height: 20px; font-weight: var(--weight-semibold); }
.help-search-panel small { color: var(--muted); font-size: 11px; line-height: 16px; }
.help-search { display: flex; width: 100%; align-items: center; gap: 8px; margin: 0; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; box-shadow: none; color: var(--muted); }
.help-search svg { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; }
.help-search input { width: 100%; height: 40px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 13px !important; line-height: 18px; }
.help-life { position: relative; display: grid; min-height: 90px; place-items: center; }
.help-life > span { position: relative; display: block; width: 82px; height: 82px; border: 1px solid #d8d0fa; border-radius: 50%; background: conic-gradient(#7254e9 0 12%, #fff 12% 25%, #7254e9 25% 37%, #fff 37% 50%, #7254e9 50% 62%, #fff 62% 75%, #7254e9 75% 87%, #fff 87%); box-shadow: 0 8px 18px rgb(70 49 150 / 14%); transform: rotate(14deg); }
.help-life > span::after { position: absolute; inset: 22px; border: 1px solid #d8d0fa; border-radius: 50%; background: #fbfaff; content: ""; }
.help-life > i { position: absolute; right: 25px; top: 19px; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--purple-line); border-radius: 50%; background: #fff; color: var(--purple); font-size: 13px; line-height: 1; font-style: normal; font-weight: var(--weight-semibold); box-shadow: var(--shadow-sm); }

.help-surface { overflow: hidden; }
.help-surface > header { min-height: 43px; padding: 12px 15px 7px; }
.help-guide-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding: 0 15px 15px; }
.help-guide-card { position: relative; display: grid; min-height: 142px; grid-template-rows: 36px auto 1fr; align-content: start; justify-items: start; gap: 7px; padding: 12px; border-radius: 7px; box-shadow: none; }
.help-guide-card > span { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 7px; background: #faf8ff; color: var(--purple); }
.help-guide-card > span svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.help-guide-card > i { position: absolute; right: 12px; top: 14px; color: var(--ink); font-size: 18px; line-height: 18px; font-style: normal; }
.help-guide-card strong { margin: 0; font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.help-guide-card small { color: var(--muted); font-size: 11px; line-height: 16px; }

.help-faq-surface > header { border-bottom: 1px solid var(--line); }
.help-faq-list { gap: 0; }
.help-faq-list details { padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.help-faq-list details:last-child { border-bottom: 0; }
.help-faq-list summary { position: relative; min-height: 43px; padding: 12px 38px 10px 15px; font-size: 12px !important; line-height: 18px; font-weight: var(--weight-medium); list-style: none; }
.help-faq-list summary::-webkit-details-marker { display: none; }
.help-faq-list summary::after { position: absolute; right: 16px; top: 12px; color: var(--muted); font-size: 16px; line-height: 18px; content: "⌄"; transition: transform .15s ease; }
.help-faq-list details[open] summary::after { transform: rotate(180deg); }
.help-faq-list p { margin: 0; padding: 0 42px 13px 15px; color: var(--muted); font-size: 12px !important; line-height: 18px !important; }
.help-all-faq { display: flex; min-height: 40px; align-items: center; gap: 7px; margin: 0 auto; }
.help-empty-result { margin: 0; padding: 18px; border: 1px dashed var(--purple-line); border-radius: 8px; background: #faf8ff; color: var(--muted); text-align: center; }
.help-reference { margin: 0; padding: 0; overflow: hidden; }
.help-reference > summary { display: flex; min-height: 45px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.help-reference > summary::-webkit-details-marker { display: none; }
.help-reference > summary span { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.help-reference > summary small { color: var(--muted); font-size: 11px; line-height: 16px; }
.help-reference .mockup-grid { padding: 0 14px 14px; }
.help-request-footer { color: var(--muted); font-size: 11px; line-height: 16px; text-align: center; }
.help-request-footer .text-button { display: inline; padding: 0; font-size: 11px !important; }

.help-side-card { overflow: hidden; padding: 15px; }
.help-side-card > p { margin: 5px 0 10px; color: var(--muted); font-size: 11px !important; line-height: 16px !important; }
.help-support-card > button { display: grid; width: 100%; min-height: 52px; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.help-support-card > button > span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 7px; background: var(--purple-soft); color: var(--purple); }
.help-support-card > button svg,
.help-channel-disabled > svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.help-support-card > button > div { display: grid; min-width: 0; gap: 1px; }
.help-support-card > button strong,
.help-channel-disabled strong { font-size: 12px; line-height: 17px; font-weight: var(--weight-semibold); }
.help-support-card > button small,
.help-channel-disabled small { color: var(--muted); font-size: 11px; line-height: 16px; }
.help-support-card > button > b { color: var(--muted); font-size: 18px; line-height: 18px; font-weight: var(--weight-regular); }
.help-channel-disabled { display: grid; min-height: 52px; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); }
.help-channel-disabled > svg { margin-left: 7px; }
.help-channel-disabled > span { display: grid; }

.help-service-card > header,
.help-updates-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.help-service-card > header .text-button { padding: 0; font-size: 11px !important; }
.help-service-row { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 9px; border-top: 1px solid var(--line); }
.help-service-row span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; line-height: 16px; }
.help-service-row i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--green); }
.help-service-row i.warning-dot { background: #d4962e; }
.help-service-row i.blocked-dot { background: var(--danger); }
.help-service-row strong { font-size: 11px; line-height: 16px; font-weight: var(--weight-semibold); }

.help-updates-card > header > span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 11px; line-height: 1; font-weight: var(--weight-semibold); }
.help-updates-card ol { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.help-updates-card li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.help-updates-card time { color: var(--muted); font-size: 11px; line-height: 16px; }
.help-updates-card li p { margin: 0; font-size: 11px !important; line-height: 16px !important; }
.help-updates-card > .text-button { display: flex; min-height: 32px; align-items: center; gap: 6px; margin: 2px auto -6px; font-size: 11px !important; }

@media (max-width: 1180px) {
  .help-page-layout { grid-template-columns: minmax(0, 1fr) 270px; }
  .help-guide-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 940px) {
  .help-page-layout { grid-template-columns: 1fr; }
  .help-side-column { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
}

@media (max-width: 700px) {
  .help-page-header { align-items: flex-start; flex-direction: column; }
  .help-wiki-button { width: 100%; }
  .help-search-panel { grid-template-columns: 1fr; padding: 16px; }
  .help-life { display: none; }
  .help-guide-grid { grid-template-columns: 1fr; }
  .help-guide-card { min-height: 116px; }
  .help-side-column { grid-template-columns: 1fr; }
  .help-updates-card li { grid-template-columns: 68px minmax(0, 1fr); }
  .help-reference > summary { align-items: flex-start; flex-direction: column; }
}
