/* Delfos design tokens (react_delfos_backoffice: src/utils/DynamicStyles.ts, appShell.css). */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap; src: url("/static/vendor/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap; src: url("/static/vendor/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("/static/vendor/poppins-latin-600-normal.woff2") format("woff2"); }

:root {
  --primary: #263C7A;
  --primary-50: #253b791a;
  --primary-100: #D6E2F8;
  --primary-200: #AFC5F1;
  --primary-300: #7E9AD7;
  --primary-600: #1B2D68;
  --primary-700: #132157;
  --primary-800: #194AB4;
  --primary-900: #070F3A;
  --tertiary: #07153A;
  --secondary: #66B6FF;
  --secondary-50: #66B6FF1a;
  --secondary-100: #E0F6FF;
  --secondary-300: #A3DCFF;
  --secondary-600: #4A8EDB;
  --secondary-700: #336AB7;
  --secondary-900: #13337A;
  --bg-surface-0: #FFFFFF;
  --bg-surface-1: #FDFDFD;
  --bg-surface-2: #E7E9F0;
  --bg-page: #F8FAFC;
  --border: #EAEAEA;
  --text-dark: #131519;
  --text-medium: #6C6C6C;
  --text-disabled: #B5B5B5;
  --text-white: #FAFBFC;
  --grey-50: #9e9e9e1a;
  --grey-100: #f5f5f5;
  --grey-200: #eeeeee;
  --grey-300: #e0e0e0;
  --grey-400: #bdbdbd;
  --grey-600: #616161;
  --grey-900: #212121;
  --red-dark: #B00313; --red-medium: #FB3748; --red-light: #fb37481a;
  /* Focus ring and control boundary with 3:1 against white (WCAG 2.2: 2.4.7, 1.4.11), as in the Delivery Hub. */
  --focus: #1F71F1; --border-control: #858B94;
  --green-dark: #107434; --green-medium: #1AB752; --green-light: #1AB7521a;
  --yellow-dark: #723B13; --yellow-medium: #E3A008; --yellow-light: #E3A0081a;
  --radius: .5rem;
  /* Delivery Hub DESIGN.md: flat 12px panels with a 1px border; the only shadow is for popovers and menus. */
  --radius-card: 12px;
  --shadow-pop: 0 8px 24px rgba(19, 21, 24, .08);
  --topbar: 64px;
  --content-max: 90rem;
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: .875rem;
  line-height: 1.5;
  color: var(--text-dark);
  background: var(--bg-page);
}

h1, h2, h3, h4 { margin: 0; color: var(--grey-900); line-height: 1.25; }
h1 { font-size: 1.5rem; font-weight: 600; }
h2 { font-size: 1.125rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--secondary-700); text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: .8125rem; }
code { background: var(--grey-100); border-radius: .25rem; padding: .05rem .35rem; color: var(--primary-600); overflow-wrap: anywhere; }
td code { white-space: nowrap; overflow-wrap: normal; }
pre { margin: 0; padding: 1rem; background: var(--tertiary); color: #e0e7ff; border-radius: var(--radius); overflow-x: auto; }
pre code { background: none; padding: 0; color: inherit; word-break: normal; }
small { font-size: .75rem; }
.muted { color: var(--text-medium); }
.icon { width: 1rem; height: 1rem; flex: none; vertical-align: -.15em; }

/* App shell: sidebar + top bar (Delivery Hub AppShell with the Delfos tokens) */
::selection { background: var(--secondary-100); color: var(--primary-900); }
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .5rem .75rem;
  background: var(--bg-surface-0); border-radius: var(--radius); box-shadow: var(--shadow-pop); color: var(--primary);
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 248px; flex: none; display: flex; flex-direction: column;
  background: var(--bg-surface-0); border-right: 1px solid var(--border); overflow-x: hidden; overflow-y: auto; scrollbar-width: thin;
}
.side-logo { display: flex; align-items: center; height: 64px; padding: 0 20px; flex: none; }
.side-logo img { height: 36px; width: auto; display: block; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px 1.5rem; flex: 1; }
.side-section { margin: 1.25rem 0 .25rem; padding: 0 .75rem; font-size: .6875rem; font-weight: 500; color: var(--text-medium); }
.side-link {
  display: flex; align-items: center; gap: .75rem; height: 40px; padding: 0 .75rem; border-radius: var(--radius);
  color: var(--text-medium); font-size: .875rem; transition: background-color .15s ease-out, color .15s ease-out;
}
.side-link .icon { width: 1.125rem; height: 1.125rem; }
.side-link:hover { background: var(--grey-100); color: var(--text-dark); text-decoration: none; }
.side-link.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.side-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.side-foot { margin: 0; padding: 1rem 20px; font-size: .6875rem; color: var(--text-medium); border-top: 1px solid var(--border); }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: var(--topbar); padding: 0 max(2rem, calc((100% - var(--content-max)) / 2 + 2rem)); background: var(--bg-surface-0); border-bottom: 1px solid var(--border);
}
.crumbs { flex: 1; min-width: 0; overflow: hidden; }
.crumbs ol { display: flex; align-items: center; gap: .375rem; margin: 0; padding: 0; list-style: none; font-size: .8125rem; color: var(--text-medium); }
.crumbs li { display: flex; align-items: center; gap: .375rem; min-width: 0; flex: 0 1 auto; white-space: nowrap; }
.crumbs li:last-child { flex-shrink: 0; max-width: 60%; }
.crumbs li > a, .crumbs li > span { min-width: 2.5rem; overflow: hidden; text-overflow: ellipsis; }
.crumbs .icon { width: .875rem; height: .875rem; color: var(--text-disabled); }
.crumbs a { color: var(--text-medium); }
.crumbs a:hover { color: var(--primary); }
.crumbs [aria-current] { color: var(--text-dark); font-weight: 500; }
.topbar-right { display: flex; flex: none; align-items: center; gap: .75rem; }
.topbar .forminput .icon:first-child { width: 16px; height: 16px; color: var(--text-medium); }
.app-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px;
  background: var(--bg-surface-2); color: var(--text-medium); font-size: .75rem; font-weight: 500;
}

/* User menu (UserDropdown.tsx) */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; border-radius: 50%; }
.user-menu > summary::-webkit-details-marker { display: none; }
.avatar {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: var(--text-white); font-size: .75rem; font-weight: 500; user-select: none;
}
.user-menu > summary:hover .avatar, .user-menu > summary:focus-visible .avatar, .user-menu[open] .avatar { outline: 4px solid var(--primary-200); }
.user-menu > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 9999px; }
.menu-user {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 300px; padding: 1.25rem 1.25rem 1rem;
  background: var(--bg-surface-0); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop);
}
.menu-user-head { display: flex; align-items: center; gap: .75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); margin-bottom: .75rem; }
.menu-user-head strong { display: block; font-size: .875rem; font-weight: 500; }
.menu-user-head small { color: var(--text-medium); word-break: break-all; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; }
.menu-row-label { display: inline-flex; align-items: center; gap: .5rem; }
.lang-switch { display: inline-flex; gap: 4px; padding: 3px; background: var(--bg-surface-1); border: 1px solid var(--border); border-radius: var(--radius); margin: 0; }
.lang-switch button {
  height: 28px; padding: 0 12px; border: 1px solid transparent; border-radius: .375rem; background: transparent;
  font: inherit; font-size: .75rem; font-weight: 500; color: var(--text-medium); cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--bg-surface-0); border-color: var(--border); color: var(--primary-600); box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
.menu-user-head small { display: block; }
/* Tenant selector: same look as components/ui/Select.tsx of the Delfos backoffice; each option submits the form. */
.tenant-switch { margin: 0; min-width: 170px; }
.fselect { position: relative; }
.fselect > summary { list-style: none; }
.fselect > summary::-webkit-details-marker { display: none; }
.forminput {
  display: flex; height: 40px; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem 1rem;
  border: 1px solid var(--border); background-color: var(--bg-surface-0); border-radius: .5rem; font-size: .875rem; color: var(--grey-900); cursor: pointer;
}
.forminput > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; color: var(--text-dark); }
.forminput .icon { width: 20px; height: 20px; transition: transform .15s ease-in-out; color: var(--text-dark); }
.fselect[open] > .forminput .icon { transform: rotate(180deg); }
.forminput-down {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 50; width: 100%; max-height: 16rem; overflow-y: auto;
  border: 1px solid var(--border); background-color: var(--bg-surface-0); border-radius: .5rem;
  box-shadow: var(--shadow-pop);
}
.forminput-down-item {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 1rem;
  border: 0; background: transparent; font: inherit; text-align: left; cursor: pointer;
}
.forminput-down-item span { font-size: .75rem; font-weight: 400; color: var(--text-dark); }
.forminput-down-item:hover { background: var(--grey-50); outline: none; }
.forminput-down-item:focus-visible { background: var(--grey-50); outline: 2px solid var(--focus); outline-offset: -2px; }
.forminput-down-item[aria-selected="true"] { background: var(--secondary-50); }
.forminput-down-item[aria-selected="true"] span { font-weight: 700; }
.forminput-down-item .icon { color: var(--secondary-600); }
.menu-user form.logout { margin: .5rem 0 0; }
.menu-user form.logout .btn { width: 100%; }

/* Layout: desktop only, 1024 px to 2560 px and wider (PRODUCT.md). */
.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 2rem 2rem 3rem; }
@media (min-width: 1920px) { :root { --content-max: 100rem; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-head p { margin: .25rem 0 0; color: var(--text-medium); max-width: 46rem; }
.page-head .brand-title { color: var(--secondary); }
.breadcrumb { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .8125rem; color: var(--text-medium); }
.breadcrumb a { display: inline-flex; align-items: center; gap: .35rem; color: var(--text-medium); }
.breadcrumb a:hover { color: var(--primary); }
.stack { display: flex; flex-direction: column; gap: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; }
.row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* Cards */
.card { background: var(--bg-surface-0); border: 1px solid var(--border); border-radius: var(--radius-card); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { display: inline-flex; align-items: center; gap: .5rem; }
.card-head p { margin: .15rem 0 0; color: var(--text-medium); font-size: .8125rem; }
.card-body { padding: 1.25rem; }
.card-body > :last-child { margin-bottom: 0; }
.card-table { overflow-x: auto; }
.card.danger { border-color: #fb374840; }
.card.danger .card-head h3 { color: var(--red-dark); }

/* Navy banner (SharePointSetupBanner.tsx) */
.banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-radius: var(--radius); flex-wrap: wrap;
  background: linear-gradient(90deg, var(--primary-900), var(--secondary-900)); border: 1px solid #263c7a40; color: #e0e0e0;
}
.banner-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 9999px; font-size: 11px; font-weight: 500;
  background: #263c7a26; color: var(--secondary);
}
.banner code { background: transparent; color: var(--text-white); font-size: .875rem; padding: 0; }
.banner .btn-ghost-light { color: var(--secondary); }

/* Buttons (DynamicStyles BOTONES) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.5rem; padding: .5rem 1rem;
  border: 1px solid transparent; border-radius: var(--radius); font: inherit; font-size: .875rem; font-weight: 400; line-height: 1;
  white-space: nowrap; cursor: pointer; text-decoration: none; transition: background-color .2s linear, color .2s linear, border-color .2s linear;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { cursor: not-allowed; }
.btn-sm { height: 2rem; padding: .5rem .75rem; }
.btn-xs { height: 1.5rem; padding: .25rem .5rem; border-radius: .25rem; font-size: .75rem; gap: .35rem; }
.btn-xs .icon { width: .75rem; height: .75rem; }
.btn-icon { width: 2rem; height: 2rem; padding: 0; }
.btn-icon.btn-xs { width: 1.75rem; height: 1.75rem; padding: 0; border-radius: .375rem; }
.btn-icon.btn-xs .icon { width: .9rem; height: .9rem; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--text-white); }
.btn-primary:hover { background: var(--primary-700); border-color: var(--primary-700); color: var(--text-white); }
.btn-primary:active { background: var(--primary-800); border-color: var(--primary-800); }
.btn-primary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-primary:disabled { background: var(--primary-300); border-color: var(--primary-300); color: var(--primary-100); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-50); border-color: var(--primary-700); color: var(--primary-700); }
.btn-outline:active { background: var(--primary-100); border-color: var(--primary-800); color: var(--primary-800); }
.btn-outline:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--text-white); }
.btn-secondary:hover { background: var(--secondary-600); border-color: var(--secondary-600); color: var(--text-white); }
.btn-secondary:active { background: var(--secondary-700); border-color: var(--secondary-700); }
.btn-secondary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-grey { background: var(--grey-100); border-color: var(--grey-100); color: var(--text-dark); }
.btn-grey:hover { background: var(--grey-300); border-color: var(--grey-300); color: var(--text-dark); }
.btn-grey:active { background: var(--grey-300); }
.btn-grey:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-grey-outline { background: transparent; border-color: var(--grey-400); color: var(--grey-900); }
.btn-grey-outline:hover { background: var(--grey-50); border-color: var(--grey-600); color: var(--grey-900); }
.btn-danger { background: transparent; border-color: var(--red-medium); color: var(--red-dark); }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-danger:disabled { background: transparent; border-color: var(--grey-300); color: var(--text-disabled); }
.btn-transparent { background: transparent; color: var(--text-dark); }
.btn-transparent:hover { background: var(--grey-100); color: var(--text-dark); }
.btn-group { display: inline-flex; gap: .5rem; flex-wrap: wrap; }
[aria-busy="true"] { cursor: progress; opacity: .7; }

/* Forms (DynamicStyles INPUT) */
form { margin: 0; }
.form-grid { display: grid; gap: 1rem; }
label, .label { display: flex; flex-direction: column; gap: .25rem; font-size: .75rem; font-weight: 600; color: var(--text-dark); }
label small.error { font-weight: 400; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; height: 40px; padding: .5rem 1rem; border: 1px solid var(--border-control); border-radius: var(--radius);
  background: var(--bg-surface-0); color: var(--grey-900); font: inherit; font-size: .875rem; font-weight: 400;
  transition: border-color .15s, outline-color .15s;
}
textarea { height: auto; min-height: 80px; padding: .75rem 1rem; line-height: 1.5em; resize: vertical; }
select { appearance: none; padding-right: 2.25rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236C6C6C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--red-dark); outline: 4px solid var(--red-light); }
input:disabled, select:disabled, textarea:disabled { background: var(--bg-surface-1); color: var(--text-disabled); }
::placeholder { color: var(--text-medium); font-style: italic; opacity: 1; }
fieldset { margin: 0; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); display: grid; gap: 1rem; }
fieldset.plain { border: 0; padding: 0; }
legend { padding: 0 .35rem; font-size: .75rem; font-weight: 600; color: var(--text-medium); text-transform: uppercase; letter-spacing: .05em; }
.hint { margin: 0; font-size: .75rem; font-weight: 400; color: var(--text-medium); }
.inline-form { display: flex; gap: .5rem; align-items: flex-start; }
.inline-form input { flex: 1; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }

/* Switch (Switch.tsx) */
.switch { flex-direction: row; align-items: center; gap: .75rem; font-size: .875rem; font-weight: 500; cursor: pointer; width: fit-content; }
.switch input { appearance: none; position: relative; width: 40px; height: 24px; margin: 0; border: 2px solid var(--grey-400); border-radius: 9999px; background: transparent; cursor: pointer; transition: background-color .2s, border-color .2s; }
.switch input::after { content: ""; position: absolute; top: 0; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--grey-400); border: 2px solid #fff; box-sizing: border-box; transition: transform .2s, background-color .2s; }
.switch input:checked { background: var(--secondary-600); border-color: var(--secondary-600); }
.switch input:checked::after { transform: translateX(16px); background: #fff; border-color: var(--secondary-600); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Disclosure ("New connection", "Advanced options") */
details.disclosure { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
details.disclosure > summary {
  display: flex; align-items: center; gap: .5rem; padding: .75rem 1rem; cursor: pointer; list-style: none; font-weight: 500; color: var(--primary);
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .icon:last-child { margin-left: auto; transition: transform .2s; color: var(--text-medium); }
details.disclosure[open] > summary .icon:last-child { transform: rotate(180deg); }
details.disclosure > .disclosure-body { padding: 0 1rem 1rem; display: grid; gap: 1rem; }

/* Tables (DynamicStyles TABLA) */
table { width: 100%; border-collapse: collapse; }
th, td { font-size: .75rem; font-weight: 400; color: var(--text-dark); text-align: left; vertical-align: middle; }
thead { background: var(--bg-surface-1); border-bottom: 1px solid var(--border); }
thead th { color: var(--text-medium); padding: .5rem .75rem; height: 2rem; line-height: 1.2; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background-color .2s linear; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: var(--grey-50); }
tbody td { padding: .6rem .75rem; white-space: nowrap; }
tbody td.wrap { white-space: normal; min-width: 10rem; }
tbody td.date { white-space: normal; min-width: 5.5rem; }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn-group { justify-content: flex-end; flex-wrap: nowrap; }
td a code { color: var(--primary); }
td .muted { font-size: .7rem; }
tr.editing:hover { background: transparent; }
tr.editing td { padding: 1rem 1.25rem; background: var(--bg-surface-1); }

/* Status chips: icon + label, never colour alone (DESIGN.md). The icon is a lucide SVG used as a mask in currentColor. */
.status { display: inline-flex; align-items: center; gap: .35rem; height: 24px; padding: 0 .6rem 0 .5rem; border-radius: 9999px; font-size: .75rem; font-weight: 500; white-space: nowrap; }
.status::before, .dot { content: ""; flex: none; width: 14px; height: 14px; background: currentColor; mask: var(--st-icon, url("/static/vendor/circle-dashed.svg")) center / contain no-repeat; }
.status-active, .status-tpl-published, .status-agent-available, .status-phase-completed, .status-task-done, .status-doc-validated, .status-ver-validated, .status-run-completed, .dot-completed { --st-icon: url("/static/vendor/circle-check.svg"); }
.status-phase-completed_externally, .status-task-done_externally, .dot-completed_externally { --st-icon: url("/static/vendor/circle-arrow-out-up-right.svg"); }
.status-phase-in_progress, .status-task-running, .status-run-starting, .status-run-running, .dot-in_progress { --st-icon: url("/static/vendor/loader-circle.svg"); }
.status-task-ready, .status-project-active { --st-icon: url("/static/vendor/circle-play.svg"); }
.status-task-blocked { --st-icon: url("/static/vendor/lock.svg"); }
.status-task-failed, .status-doc-rejected, .status-ver-rejected, .status-run-failed { --st-icon: url("/static/vendor/circle-x.svg"); }
.status-task-waiting_for_user, .status-run-waiting_for_user { --st-icon: url("/static/vendor/message-circle-question.svg"); }
.status-task-in_review, .status-doc-in_review, .status-ver-pending, .status-pending_auth { --st-icon: url("/static/vendor/clock.svg"); }
.status-needs_reauth, .status-run-needs_reauth { --st-icon: url("/static/vendor/key-round.svg"); }
.status-project-on_hold { --st-icon: url("/static/vendor/circle-pause.svg"); }
.status-agent-in_development { --st-icon: url("/static/vendor/wrench.svg"); }
.status-project-closed, .status-phase-skipped, .status-task-skipped, .status-tpl-deprecated, .status-agent-retired, .status-disabled, .status-ver-superseded, .status-ver-replaced, .status-run-cancelled, .dot-skipped { --st-icon: url("/static/vendor/circle-minus.svg"); }
.status-active { background: var(--green-light); color: var(--green-dark); }
.status-pending_auth { background: var(--yellow-light); color: var(--yellow-dark); }
.status-needs_reauth { background: var(--red-light); color: var(--red-dark); }
.status-disabled { background: var(--grey-50); color: var(--grey-600); }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 .55rem; border-radius: 9999px; font-size: .75rem; font-weight: 500; background: var(--primary-50); color: var(--primary); white-space: nowrap; }
.chip-grey { background: var(--grey-50); color: var(--grey-600); }
.count { display: inline-flex; align-items: center; justify-content: center; height: 18px; min-width: 18px; padding: 0 5px; border-radius: 9999px; background: var(--primary); color: #fff; font-size: .6875rem; font-weight: 500; font-variant-numeric: tabular-nums; }

/* Messages (snackbar) */
.ok, .error, .warning { font-size: .8125rem; }
p.ok, p.error, p.warning, div.ok, div.error, div.warning {
  display: flex; align-items: flex-start; gap: .5rem; margin: 0 0 1rem; padding: .6rem 1rem; border-radius: var(--radius); border: 1px solid;
}
p.ok, div.ok { background: var(--green-light); border-color: var(--green-medium); color: var(--green-dark); }
p.error, div.error { background: var(--red-light); border-color: var(--red-medium); color: var(--red-dark); }
p.warning, div.warning { background: var(--yellow-light); border-color: var(--yellow-medium); color: var(--yellow-dark); }
p.ok .icon, p.error .icon, p.warning .icon { margin-top: .15rem; }
small.error, span.error { color: var(--red-dark); }
[aria-live]:empty { display: none; }
[aria-live] > :last-child { margin-bottom: 0; }

/* Keys */
.key-cell { display: inline-flex; gap: .5rem; align-items: center; }
.key-value { user-select: all; word-break: break-all; }
.created-key { display: grid; gap: .5rem; padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--green-medium); border-radius: var(--radius); background: var(--green-light); color: var(--green-dark); }
.created-key p { margin: 0; }
.created-key .key-cell code { background: var(--bg-surface-0); color: var(--text-dark); padding: .35rem .5rem; }

/* Empty state (KnowledgeEmptyState.tsx) */
.empty { display: flex; flex-direction: column; align-items: center; gap: .75rem; padding: 2.5rem 1rem; text-align: center; }
.empty img { width: 96px; height: 96px; }
.empty h3 { font-size: 1.125rem; }
.empty p { margin: 0; color: var(--text-medium); max-width: 28rem; }
td.empty-cell { padding: 0; }
td.empty-cell:hover, tr:has(td.empty-cell):hover { background: transparent; }
.empty-row { padding: 1.25rem; text-align: center; color: var(--text-medium); font-style: italic; }

/* Definition list (credential, discovery) */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; margin: 0 0 1rem; }
.kv dt { color: var(--text-medium); font-size: .8125rem; }
.kv dd { margin: 0; font-size: .8125rem; word-break: break-word; }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 1.5rem; }
.login-card { width: 100%; max-width: 26rem; padding: 2.5rem 2rem 1.5rem; border-radius: 2.5rem; border: 1px solid rgb(226 232 240 / .8); background: var(--bg-surface-0); box-shadow: 0 14px 36px -18px rgba(15, 23, 42, .10); text-align: center; }
.login-card img { height: 56px; width: auto; margin: 0 auto 1.5rem; display: block; }
.login-card h1 { font-size: 1.25rem; letter-spacing: -.03em; margin-bottom: .35rem; }
.login-card h1 .brand-title { color: var(--secondary); }
.login-card > p { color: var(--text-medium); }
.login-card .btn { width: 100%; height: 3rem; margin-top: .5rem; font-weight: 500; }
.login-card .lang-switch { margin-top: 1.5rem; }
.login-card p.error { text-align: left; }


/* Tables: whole rows open their item; filters apply on change (their button is only for no-script). */
tr[data-row-link] { cursor: pointer; }
tr.is-peeked, tr.is-peeked:hover { background: var(--primary-50); }
.js [data-filter-submit] { display: none; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.cell-form select { width: auto; min-width: 11rem; max-width: 16rem; height: 2rem; padding: .25rem 2rem .25rem .6rem; font-size: .75rem; background-position: right .5rem center; }
/* Phase triage: the task opens in a side sheet over the right of the page, the table stays in view. */
.peek:empty { display: none; }
.peek {
  position: fixed; top: calc(var(--topbar) + .75rem); right: .75rem; bottom: .75rem; z-index: 30; width: min(30rem, 42vw);
  display: flex; flex-direction: column; background: var(--bg-surface-0); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-pop);
}
.peek-panel { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.peek-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: 1rem 1rem .25rem 1.25rem; }
.peek-head h2 { font-size: 1.0625rem; padding-top: .35rem; }
.peek-head h2:focus { outline: none; }
.peek-head h2:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.peek-context { display: flex; align-items: center; gap: .35rem; margin: 0; padding: 0 1.25rem; font-size: .8125rem; }
.peek-body { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 1rem; padding: 1rem 1.25rem; }
.peek-desc { margin: 0; font-size: .875rem; line-height: 1.6; white-space: pre-line; max-width: 65ch; }
.peek-section { display: grid; gap: .35rem; }
.peek-section h3 { font-size: .875rem; }
.peek-section .task-list li, .peek .kv-stack .task-list li { padding: .35rem 0; }
.peek .kv-stack { display: grid; grid-template-columns: 1fr; gap: .25rem; margin: 0; }
.peek .kv-stack .inline-form select { flex: 1; min-width: 0; width: 100%; }
.peek-foot { display: flex; justify-content: flex-end; padding: .75rem 1.25rem; border-top: 1px solid var(--border); }

/* Delfos Agentic Hub additions */
td.wrap code { white-space: normal; overflow-wrap: anywhere; }
.section-title { display: flex; align-items: center; gap: .5rem; margin: 0 0 .25rem; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: var(--primary-50); color: var(--primary); }
.empty-icon .icon { width: 28px; height: 28px; }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist li > .icon { width: 1.25rem; height: 1.25rem; color: var(--secondary-600); }
.checklist li.done > .icon { color: var(--green-medium); }
.checklist li.problem > .icon { color: var(--red-medium); }
.checklist strong { display: block; font-weight: 500; }
.checklist span { color: var(--text-medium); font-size: .8125rem; }
.menu-link { display: flex; align-items: center; gap: .5rem; padding: .5rem 0; color: var(--text-dark); }
.menu-link:hover { color: var(--primary); text-decoration: none; }
.tenants-note { display: flex; gap: .5rem; align-items: center; margin-top: 1rem; }
/* Catalog */
.status-tpl-draft, .status-agent-identified { background: var(--yellow-light); color: var(--yellow-dark); }
.status-tpl-published, .status-agent-available { background: var(--green-light); color: var(--green-dark); }
.status-tpl-deprecated, .status-agent-retired { background: var(--grey-50); color: var(--grey-600); }
.status-agent-in_development { background: var(--secondary-50); color: var(--secondary-900); }
.chip-warn { background: var(--yellow-light); color: var(--yellow-dark); }
.card-head > .muted { white-space: nowrap; }
.title-version { font-size: 1rem; font-weight: 500; }
.page-head .row { margin-top: .75rem; }
.phase-index {
  display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: var(--primary-50); color: var(--primary); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.mono, textarea.mono { font-family: var(--mono); font-size: .8125rem; }
.error-list { margin: .35rem 0 0; padding-left: 1.1rem; }
.error-list li { margin: .15rem 0; }
tr.link-row, tr.link-row:hover { background: transparent; border-bottom: 0; }
tr.link-row > td { padding: 0 .75rem; white-space: normal; }
tr.link-row > td:has(> div:not(:empty)) { padding: .25rem .75rem 1rem; }
.link-step { display: grid; gap: .75rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-1); }
.pick-list { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(18rem, 100%), 1fr)); }
.pick {
  flex-direction: row; align-items: flex-start; gap: .65rem; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface-0); font-size: .8125rem; font-weight: 400; cursor: pointer; transition: border-color .15s ease-out;
}
.pick:hover { border-color: var(--secondary); }
.pick:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.pick input { margin-top: .2rem; accent-color: var(--primary); }
.pick > span { display: grid; gap: .15rem; min-width: 0; }
.pick small { overflow-wrap: anywhere; }
button.pick { display: flex; width: 100%; text-align: left; color: var(--text-dark); font: inherit; font-size: .8125rem; }
button.pick > .icon { flex: none; width: 1rem; height: 1rem; margin-top: .1rem; color: var(--primary); }
button.pick small { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick.is-current { border-color: var(--primary); background: var(--primary-50); }
.pick-scroll { max-height: 21rem; overflow-y: auto; overscroll-behavior: contain; padding: .125rem; }
.link-step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .75rem; }
.pick-filter { width: min(100%, 16rem); }
.agent-picked-inline { display: inline-flex; align-items: center; gap: .4rem; font-size: .875rem; }
.agent-picked-inline > .icon { color: var(--primary); }
/* Projects */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.filters select { width: auto; min-width: 12rem; }
.status-project-active { background: var(--green-light); color: var(--green-dark); }
.status-project-on_hold { background: var(--yellow-light); color: var(--yellow-dark); }
.status-project-closed, .status-phase-skipped, .status-task-skipped { background: var(--grey-50); color: var(--grey-600); }
.status-phase-not_started, .status-task-not_started { background: var(--grey-100); color: var(--text-medium); }
.status-phase-in_progress, .status-task-ready, .status-task-running { background: var(--secondary-50); color: var(--secondary-900); }
.status-phase-completed, .status-task-done { background: var(--green-light); color: var(--green-dark); }
.status-phase-completed_externally, .status-task-done_externally { background: var(--primary-50); color: var(--primary); }
.status-task-blocked, .status-task-failed { background: var(--red-light); color: var(--red-dark); }
.status-task-waiting_for_user, .status-task-in_review { background: var(--yellow-light); color: var(--yellow-dark); }
.chip-cov-agent { background: var(--secondary-50); color: var(--secondary-900); }
.chip-cov-planned { background: var(--yellow-light); color: var(--yellow-dark); }
.chip-cov-manual, .chip-cov-upload, .chip-cov-external { background: var(--grey-50); color: var(--grey-600); }
.agent-card { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
.agent-card > .icon { flex: none; width: 1.25rem; height: 1.25rem; color: var(--primary); }
.agent-card > p { flex: 1; margin: 0; font-size: .8125rem; color: var(--text-medium); }
.agent-card.is-empty { border-style: dashed; }
.agent-card-meta { display: flex; flex-wrap: wrap; gap: .25rem 2rem; flex: 1; margin: 0; }
.agent-card-meta dt { font-size: .75rem; color: var(--text-medium); }
.agent-card-meta dd { margin: 0; font-size: .875rem; font-weight: 600; }
.agent-card-meta dd small { font-weight: 400; }
.count-red { background: var(--red-light); color: var(--red-dark); }
/* Phase bar: one segment per phase; done brand, current accent, pending border (DESIGN.md). Always with a text label. */
.phase-bar { display: flex; gap: 2px; width: 10rem; margin-bottom: .25rem; }
.seg { flex: 1; height: 4px; border-radius: 2px; background: var(--border); }
.seg-completed, .seg-completed_externally, .seg-skipped { background: var(--primary); }
.seg-skipped { background: var(--primary-300); }
.seg-in_progress, .seg-current { background: var(--secondary); }
/* Stepper of the project summary: the current phase is filled with the brand colour. */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(9rem, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .25rem; }
.step {
  display: grid; gap: .5rem; padding: .85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0);
  color: var(--text-dark); transition: border-color .15s ease-out;
}
.step:hover { border-color: var(--primary-300); text-decoration: none; }
.step-current { border-color: var(--primary); background: var(--primary); color: var(--text-white); }
.step-current:hover { border-color: var(--primary-700); background: var(--primary-700); color: var(--text-white); }
.step-current .step-name { color: var(--text-white); }
.step-current .phase-index { background: rgb(255 255 255 / .16); color: var(--text-white); }
.step-current .status { background: var(--bg-surface-0); }
.step-current .muted { color: var(--primary-100); }
.step-current .progress { background: rgb(255 255 255 / .22); }
.step-current .progress-bar { background: var(--secondary); }
.step-top { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.step-name { font-size: .8125rem; font-weight: 500; overflow-wrap: anywhere; }
.step-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.step-completed .phase-index { background: var(--green-light); color: var(--green-dark); }
.step-skipped .step-name, .step-completed_externally .step-name { color: var(--text-medium); }
.progress { display: block; height: 4px; border-radius: 2px; background: var(--grey-200); overflow: hidden; }
.progress-bar { display: block; height: 100%; width: 0; background: var(--primary); }
.progress-bar[data-pct="10"] { width: 10%; } .progress-bar[data-pct="20"] { width: 20%; } .progress-bar[data-pct="30"] { width: 30%; }
.progress-bar[data-pct="40"] { width: 40%; } .progress-bar[data-pct="50"] { width: 50%; } .progress-bar[data-pct="60"] { width: 60%; }
.progress-bar[data-pct="70"] { width: 70%; } .progress-bar[data-pct="80"] { width: 80%; } .progress-bar[data-pct="90"] { width: 90%; }
.progress-bar[data-pct="100"] { width: 100%; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1.5rem; align-items: start; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; padding: .65rem 1.25rem; border-top: 1px solid var(--border); font-size: .8125rem; }
.task-list li:first-child { border-top: 0; }
.card-body .task-list li { padding: .5rem 0; }
.task-list small { flex-basis: 100%; font-size: .75rem; }
.reasons { color: var(--text-medium); }
.reasons-blocked { color: var(--red-dark); }
/* Phase tabs. */
.tabs { display: flex; gap: .25rem; overflow-x: auto; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .85rem; border-bottom: 2px solid transparent; color: var(--text-medium); font-size: .8125rem; white-space: nowrap; }
.tab:hover { color: var(--text-dark); text-decoration: none; }
.tab.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.dot { width: 14px; height: 14px; color: var(--text-medium); }
.dot-in_progress { color: var(--secondary-700); }
.dot-completed, .dot-completed_externally { color: var(--green-dark); }
.override-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.override-form select, .override-form input { width: auto; }
.override-form input[name="reason"] { width: 15rem; }
tr.subtask td:nth-child(2) { padding-left: 2rem; }
td.num { color: var(--text-medium); font-variant-numeric: tabular-nums; }
.inline-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline-form select, .inline-form input { width: auto; min-width: 12rem; }
.checkbox-list { display: grid; gap: .35rem .75rem; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); max-height: 18rem; overflow-y: auto; margin: .25rem 0 0; }
.checkbox-list label { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; font-size: .8125rem; }
/* New project wizard. */
.wizard { display: grid; gap: 1.5rem; }
.adaptation { display: grid; gap: 1rem; margin-bottom: 1rem; }
.adaptation legend { padding: 0 .35rem; font-size: .875rem; font-weight: 500; }
.adapt-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.adapt-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(10rem, 13rem) minmax(0, 1fr); gap: .5rem; align-items: center; }
fieldset > .adapt-row { grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr); }
.adapt-name { font-size: .8125rem; overflow-wrap: anywhere; }
.adaptation fieldset:has(> .adapt-row option[value="applies"]:not(:checked)) .adapt-tasks { opacity: .55; }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; padding: .75rem 0; background: linear-gradient(to top, var(--bg-page) 70%, transparent); }
/* Sidebar project card and current phase (Delivery Hub sidebar). */
.side-card { display: grid; gap: .4rem; margin: .25rem 0 .75rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--bg-page); }
.side-card .phase-bar { width: 100%; margin: .15rem 0 0; }
.side-card > small { font-size: .75rem; line-height: 1.35; }
.side-card-name { display: block; min-width: 0; font-size: .875rem; font-weight: 600; color: var(--tertiary); overflow-wrap: anywhere; }
.side-card-path { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.side-card-path .chip, .step .status { height: auto; min-height: 22px; padding-block: .15rem; line-height: 1.3; white-space: normal; }
.side-switch > summary { list-style: none; }
.side-switch > summary::-webkit-details-marker { display: none; }
.side-switch-btn { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: -.25rem -.35rem; padding: .25rem .35rem; border-radius: .375rem; cursor: pointer; }
.side-switch-btn:hover { background: var(--grey-100); }
.side-switch-btn > .icon { color: var(--text-medium); }
.side-switch .forminput-down { width: 15rem; left: -.75rem; right: auto; }
.side-switch .forminput-down-item { color: var(--text-dark); }
.side-switch .forminput-down-item:hover { text-decoration: none; }
.side-switch-all { border-top: 1px solid var(--border); }
.side-switch-all span { font-weight: 500; color: var(--primary); }
.side-phase { margin: 1rem 0 0; border-top: 1px solid var(--border); padding-top: .75rem; }
.side-phase > summary { display: flex; align-items: center; gap: .4rem; padding: 0 .75rem .35rem; list-style: none; cursor: pointer; font-size: .75rem; font-weight: 600; color: var(--text-medium); }
.side-phase > summary::-webkit-details-marker { display: none; }
.side-phase > summary .icon { width: .875rem; height: .875rem; transition: transform .2s ease-out; }
.side-phase:not([open]) > summary .icon { transform: rotate(-90deg); }
.side-phase ul { list-style: none; margin: 0; padding: 0; }
.side-phase li a { display: flex; align-items: center; gap: .5rem; min-height: 32px; padding: .3rem .75rem; border-radius: .375rem; color: var(--text-dark); font-size: .8125rem; line-height: 1.3; }
.side-phase li a:hover { background: var(--grey-100); text-decoration: none; }
.side-phase .ti { flex: none; width: 16px; height: 16px; padding: 0; background: currentColor; mask: var(--st-icon, url("/static/vendor/circle-dashed.svg")) center / contain no-repeat; }
.side-phase .ti.status-task-not_started { color: var(--text-medium); }
.side-phase .ti.status-task-ready, .side-phase .ti.status-task-running { color: var(--secondary-700); }
.ti-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.side-phase-all { display: inline-flex; align-items: center; gap: .3rem; padding: .4rem .75rem 0; font-size: .75rem; font-weight: 500; }
.side-phase-all .icon { width: .875rem; height: .875rem; }
.side-phase li a[aria-current] { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.side-more > summary { padding: .3rem .75rem; list-style: none; cursor: pointer; color: var(--primary); font-size: .75rem; font-weight: 500; }
.side-more > summary::-webkit-details-marker { display: none; }
.side-more[open] > summary { display: none; }
.chat-busy { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
/* Platform admin demo (view as a member): always visible under the top bar. */
.viewas-bar { position: sticky; top: var(--topbar); z-index: 19; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 1rem; padding: .5rem 2rem; background: var(--yellow-light); border-bottom: 1px solid var(--yellow-medium); color: var(--yellow-dark); font-size: .8125rem; }
.viewas-bar > span { display: inline-flex; align-items: center; gap: .4rem; }
.viewas-bar .btn { background: var(--bg-surface-0); }
.role-form { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; }
.role-form > small { flex-basis: 100%; }
.role-set { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin: 0; padding: 0; border: 0; }
.chat-busy > .task-note { margin: 0; }
@media (prefers-reduced-motion: reduce) { .side-phase > summary .icon { transition: none; } }
/* Documents */
.status-doc-in_review, .status-ver-pending { background: var(--yellow-light); color: var(--yellow-dark); }
.status-doc-validated, .status-ver-validated { background: var(--green-light); color: var(--green-dark); }
.status-doc-rejected, .status-ver-rejected { background: var(--red-light); color: var(--red-dark); }
.status-ver-superseded, .status-ver-replaced { background: var(--grey-50); color: var(--grey-600); }
.chip-input-ready { background: var(--green-light); color: var(--green-dark); }
.chip-input-missing { background: var(--red-light); color: var(--red-dark); }
.chip-input-degraded { background: var(--yellow-light); color: var(--yellow-dark); }
.chip-input-waiting, .chip-input-upload { background: var(--grey-50); color: var(--grey-600); }
label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; font-size: .8125rem; }
.score-pills { gap: .75rem; }
.input-list, .version-list, .repo-docs, .attached { list-style: none; margin: 0; padding: 0; }
.input-row { display: grid; gap: .35rem; padding: .6rem 1.25rem; border-top: 1px solid var(--border); }
.input-row:first-child { border-top: 0; }
/* One line per input: name and source, state, what it holds, upload. */
.input-line { display: grid; grid-template-columns: minmax(10rem, 16rem) auto minmax(0, 1fr) auto; align-items: center; gap: .5rem 1rem; font-size: .8125rem; }
.input-name { display: grid; min-width: 0; line-height: 1.35; }
.input-name strong { font-weight: 500; overflow-wrap: anywhere; }
.input-name small { font-size: .75rem; }
.input-files { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; min-width: 0; }
.input-file { display: inline-flex; align-items: center; gap: .25rem; min-width: 0; overflow-wrap: anywhere; }
.input-upload { display: inline-flex; gap: .35rem; }
.input-more > summary { display: inline-flex; align-items: center; gap: .3rem; width: max-content; list-style: none; cursor: pointer; color: var(--primary); font-size: .75rem; font-weight: 500; }
.input-more > summary::-webkit-details-marker { display: none; }
.input-more > summary .icon { width: .875rem; height: .875rem; transform: rotate(-90deg); transition: transform .15s ease-out; }
.input-more[open] > summary .icon { transform: none; }
.input-more > form { margin-top: .5rem; }
@media (prefers-reduced-motion: reduce) { .input-more > summary .icon { transition: none; } }
/* File picker as a button: the native control (with the browser's own language) stays hidden but focusable. */
.file-btn { position: relative; flex-direction: row; align-self: flex-start; max-width: 100%; font-weight: 500; }
.file-btn > span { overflow: hidden; text-overflow: ellipsis; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-btn:has(.file-input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.js [data-nojs] { display: none; }
.input-head { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-size: .8125rem; }
.attached li { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; }
.version { display: grid; gap: .25rem; padding: .85rem 1.25rem; border-top: 1px solid var(--border); font-size: .8125rem; }
.version:first-child { border-top: 0; }
.version-current { background: var(--bg-surface-1); }
.version-head { display: flex; align-items: center; gap: .5rem; }
.version-head .btn { margin-left: auto; }
.version-note { margin: .25rem 0 0; }
.quote, .quote-danger { margin: .25rem 0 0; padding: .35rem .75rem; border-left: 3px solid var(--grey-300); color: var(--text-medium); }
.quote-danger { border-left-color: var(--red-medium); color: var(--red-dark); }
.repo-tree { display: grid; gap: .5rem; }
.repo-folder { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
.repo-folder .repo-folder { margin: 0 .75rem .5rem; }
.repo-folder > summary { display: flex; align-items: center; gap: .5rem; padding: .6rem .85rem; cursor: pointer; font-size: .8125rem; font-weight: 500; }
.repo-folder > summary small { margin-left: auto; font-weight: 400; }
.repo-docs li { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .6rem; padding: .45rem 1rem; border-top: 1px solid var(--border); font-size: .8125rem; }
.repo-docs li .btn { margin-left: auto; }
/* Agent runs */
.status-run-starting, .status-run-running { background: var(--secondary-50); color: var(--secondary-900); }
.status-run-waiting_for_user, .status-run-needs_reauth { background: var(--yellow-light); color: var(--yellow-dark); }
.status-run-completed { background: var(--green-light); color: var(--green-dark); }
.status-run-failed { background: var(--red-light); color: var(--red-dark); }
.status-run-cancelled { background: var(--grey-50); color: var(--grey-600); }
/* Task workspace: what to do, then inputs → agent → results; task management on the side. */
.task-owner { display: flex; align-items: center; gap: .4rem; margin: .6rem 0 0; color: var(--text-medium); font-size: .8125rem; }
.task-owner .icon { width: 1rem; height: 1rem; }
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1.5rem; align-items: start; }
.task-main { display: grid; gap: 1.25rem; min-width: 0; }
.task-main > p.ok, .task-main > div.error, .task-main > div.warning { margin: 0; }
.task-aside { position: sticky; top: calc(var(--topbar) + 1rem); max-height: calc(100vh - var(--topbar) - 2rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (max-width: 1023px) {
  .task-layout { grid-template-columns: minmax(0, 1fr); }
  .task-aside { position: static; max-height: none; }
}
.task-brief { display: grid; gap: .4rem; max-width: 72ch; }
.task-brief h2 { font-size: 1rem; }
.task-description { margin: 0; font-size: .9375rem; line-height: 1.6; color: var(--text-dark); white-space: pre-line; }
.task-note { display: flex; align-items: flex-start; gap: .45rem; font-size: .8125rem; }
.task-note .icon { flex: none; width: 1rem; height: 1rem; margin-top: .1rem; }
.task-alert { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 1px solid var(--yellow-medium); border-radius: var(--radius); background: var(--yellow-light); color: var(--yellow-dark); font-size: .875rem; transition: border-color .15s ease-out; }
.task-alert:hover { border-color: var(--yellow-dark); text-decoration: none; }
.task-alert > span { display: grid; flex: 1; gap: .1rem; }
.task-alert .icon { flex: none; width: 1.25rem; height: 1.25rem; }
.task-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.step-head { display: flex; align-items: flex-start; gap: .85rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.step-head h2 { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.0625rem; }
.step-head h2 .icon { color: var(--primary); }
.step-head p { margin: .2rem 0 0; max-width: 70ch; color: var(--text-medium); font-size: .8125rem; }
.step-no { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--primary); color: var(--text-white); font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.step-body { padding: 1rem 1.25rem; }
.step-body + .step-body { padding-top: 0; }
.count-ok { background: var(--green-dark); }
.task-aside .kv-stack { grid-template-columns: 1fr; gap: .25rem; margin: 0; }
.kv-stack dd { margin-bottom: .75rem; }
.kv-stack dd:last-child { margin-bottom: 0; }
.kv-stack .inline-form select, .kv-stack .inline-form input { flex: 1; min-width: 0; width: 100%; }
.aside-section { display: grid; gap: .6rem; border-top: 1px solid var(--border); }
.aside-section h3 { font-size: .875rem; }
.aside-section .task-list li { padding: .35rem 0; }
/* Agent */
.agent-body { display: grid; gap: 1rem; }
.agent-id { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.agent-id-text { display: grid; flex: 1; min-width: 10rem; }
.agent-id-text strong { font-size: .9375rem; }
.agent-avatar, .tl-avatar { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; background: var(--primary); color: var(--text-white); }
.agent-avatar { width: 2.5rem; height: 2.5rem; }
.agent-avatar .icon { width: 1.25rem; height: 1.25rem; }
.agent-about { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; padding: .85rem 1rem; border-radius: var(--radius); background: var(--primary-50); font-size: .8125rem; }
.agent-about dt { color: var(--primary); font-weight: 600; }
.agent-about dd { margin: 0; max-width: 70ch; }
.run-start > fieldset { display: grid; gap: 1rem; }
.run-start-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
.btn-lg { height: 2.75rem; padding: 0 1.25rem; font-size: .9375rem; font-weight: 500; }
/* Conversation with the agent (Delfos Cowork style): a fixed-height panel that scrolls inside, composer docked below. */
.chat { display: flex; flex-direction: column; height: clamp(20rem, calc(100dvh - 13rem), 48rem); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); overflow: hidden; }
.agent-timeline { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1.25rem 1.25rem 1rem; scrollbar-width: thin; scrollbar-color: var(--grey-400) transparent; }
.chat-foot { display: grid; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); background: var(--bg-page); }
.chat-foot > .task-note { margin: 0; padding: .35rem .25rem; }
.chat-msg:empty { display: none; }
.chat-msg > p { margin: 0; }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.tl > li { min-width: 0; }
.tl-divider { display: flex; align-items: center; gap: .75rem; color: var(--text-medium); font-size: .75rem; }
.tl-divider::before, .tl-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tl-user { justify-self: end; display: grid; justify-items: end; gap: .2rem; max-width: 85%; }
.tl-user p { margin: 0; padding: .6rem .9rem; border-radius: 14px 14px 4px 14px; background: var(--primary-50); font-size: .875rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-agent { display: flex; align-items: flex-start; gap: .75rem; }
.tl-avatar { width: 1.75rem; height: 1.75rem; }
.tl-avatar .icon { width: 1rem; height: 1rem; }
.tl-agent p { margin: 0; padding-top: .2rem; max-width: 75ch; font-size: .875rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-indent { margin-left: 2.5rem; }
.tl-activity { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); color: var(--text-medium); font-size: .8125rem; }
.tl-activity > summary { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; cursor: pointer; list-style: none; }
.tl-activity > summary::-webkit-details-marker { display: none; }
.tl-activity > summary .icon { flex: none; width: 1rem; height: 1rem; }
.tl-activity-last { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-activity-last::before { content: "· "; }
.tl-activity ul { display: grid; gap: .35rem; margin: 0; padding: .6rem .75rem .6rem 1.75rem; border-top: 1px solid var(--border); }
.tl-question { display: flex; gap: .75rem; padding: .9rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); font-size: .875rem; }
.tl-question > .icon { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .1rem; color: var(--text-medium); }
.tl-question-open { border-color: var(--yellow-medium); background: var(--yellow-light); }
.tl-question-open > .icon { color: var(--yellow-dark); }
.tl-question-body { display: grid; flex: 1; gap: .5rem; min-width: 0; }
.tl-question-body p, .tl-question-body ul { margin: 0; }
.tl-line { display: flex; align-items: center; gap: .4rem; margin: 0; color: var(--text-medium); font-size: .8125rem; }
.tl-line .icon { flex: none; width: 1rem; height: 1rem; }
.tl-line-end { justify-content: flex-end; }
.tl-status-completed { color: var(--green-dark); }
.tl-status-failed { color: var(--red-dark); }
.tl-status-needs_reauth { color: var(--yellow-dark); }
.tl-output { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); color: var(--text-dark); font-size: .875rem; transition: border-color .15s ease-out, background-color .15s ease-out; }
.tl-output > .icon:first-child { flex: none; width: 1.25rem; height: 1.25rem; color: var(--primary); }
.tl-output span { display: grid; flex: 1; min-width: 0; }
.tl-output:hover { border-color: var(--primary-300); background: var(--primary-50); text-decoration: none; }
.tl-working { display: flex; align-items: flex-start; gap: .6rem; color: var(--text-dark); font-size: .875rem; }
.tl-working small { display: block; }
.tl-elapsed { color: var(--text-medium); font-variant-numeric: tabular-nums; }
.tl-elapsed:not(:empty)::before { content: "· "; }
.reason-who { color: inherit; opacity: .85; }
.spinner { width: .9rem; height: .9rem; border: 2px solid var(--primary-100); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.composer { display: grid; grid-template-columns: 1fr auto; gap: .5rem; align-items: end; }
.composer textarea { min-height: 2.75rem; max-height: 12rem; resize: vertical; background: var(--bg-surface-0); }
.composer .btn { height: 2.75rem; }
/* Task results: one row per expected deliverable, loose agent files first. */
.results-msg:empty { display: none; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; font-size: .875rem; font-weight: 500; }
.back-link .icon { width: 1rem; height: 1rem; }
.results-msg { padding: 1rem 1.25rem 0; }
.results-msg > p { margin: 0; }
.loose { display: grid; gap: .5rem; padding: .85rem 1rem; border: 1px dashed var(--yellow-medium); border-radius: var(--radius); background: var(--yellow-light); }
.loose h3 { display: flex; align-items: center; gap: .5rem; font-size: .875rem; color: var(--yellow-dark); }
.loose h3 .icon { width: 1rem; height: 1rem; }
.loose > .hint { margin: 0; color: var(--yellow-dark); }
.loose .deliv { padding: .5rem 0; border-top-color: var(--yellow-medium); }
.slot-list, .deliv-list { list-style: none; margin: 0; padding: 0; }
.slot { padding: .75rem 1.25rem; border-top: 1px solid var(--border); }
.slot:first-child { border-top: 0; }
.slot-head { display: flex; align-items: center; gap: .6rem; font-size: .875rem; }
.slot-head > .icon { flex: none; width: 1.1rem; height: 1.1rem; color: var(--text-disabled); }
.slot-label { flex: 1; min-width: 0; font-weight: 500; }
.slot-state { font-size: .75rem; color: var(--text-medium); white-space: nowrap; }
.slot-validated .slot-head > .icon, .slot-validated .slot-state { color: var(--green-dark); }
.slot-in_review .slot-head > .icon, .slot-in_review .slot-state { color: var(--yellow-dark); }
.slot-rejected .slot-head > .icon, .slot-rejected .slot-state { color: var(--red-dark); }
.slot-missing .slot-state { color: var(--text-dark); font-weight: 500; }
.slot .deliv-list { margin: .35rem 0 0 1.7rem; }
.deliv { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; padding: .35rem 0; border-top: 1px solid var(--border); font-size: .8125rem; }
.deliv:first-child { border-top: 0; }
.deliv:target { margin: 0 -.5rem; padding-left: .5rem; padding-right: .5rem; border-radius: var(--radius); background: var(--primary-50); scroll-margin-top: 6rem; }
.deliv-main { display: grid; flex: 1; min-width: 12rem; gap: .1rem; overflow-wrap: anywhere; }
.deliv-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.deliv-incorporate select { min-width: 14rem; height: 2rem; font-size: .8125rem; }
.deliv-incorporate .deliv-other { min-width: 14rem; height: 2rem; font-size: .8125rem; }
.deliv-review { flex-basis: 100%; }
.deliv-review > summary { list-style: none; width: max-content; }
.deliv-review > summary::-webkit-details-marker { display: none; }
.deliv-review > summary .icon:last-child { transition: transform .15s ease-out; }
.deliv-review[open] > summary .icon:last-child { transform: rotate(180deg); }
.deliv-review-body { display: grid; gap: .75rem; margin-top: .6rem; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-page); }
.deliv-review-body > .hint { margin: 0; max-width: 70ch; }
.assistant-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.assistant-card { display: flex; flex-direction: column; }
.assistant-card .card-body { display: flex; flex: 1; flex-direction: column; gap: .5rem; }
.assistant-card .card-body > p { margin: 0; }
.assistant-card h2 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; }
.assistant-card .form-actions { margin-top: auto; justify-content: flex-start; }
/* Panel */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: var(--grey-100); }
.seg-btn { padding: .35rem .75rem; border-radius: .375rem; color: var(--text-medium); font-size: .8125rem; }
.seg-btn:hover { color: var(--text-dark); text-decoration: none; }
.seg-btn.active { background: var(--bg-surface-0); color: var(--primary); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.kpi-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.kpi { display: grid; gap: .35rem; padding: 1.1rem 1.25rem; align-content: start; }
.kpi h2 { font-size: .8125rem; font-weight: 500; color: var(--text-medium); }
.kpi-value { margin: 0; font-size: 2rem; font-weight: 600; color: var(--tertiary); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi a { font-size: .75rem; }
.bar-chart { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.bar-chart li { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr auto; gap: .75rem; align-items: center; font-size: .8125rem; }
.bar-chart .progress { height: 10px; border-radius: 5px; }
.bar-chart .progress-bar { background: var(--primary); }
.bar-label { overflow-wrap: anywhere; }
.bar-value { color: var(--text-medium); font-variant-numeric: tabular-nums; white-space: nowrap; }
.attention-list li > .icon { width: 1rem; height: 1rem; flex: none; }
.attention-blocked_task > .icon { color: var(--red-medium); }
.attention-agent_question > .icon, .attention-stale_review > .icon { color: var(--yellow-medium); }
/* Phase flow */
.flow-scroll { overflow: auto; max-height: 40rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-page); }
.flow { display: block; font-family: var(--font); }
.flow-node rect { fill: var(--bg-surface-0); stroke: var(--grey-300); stroke-width: 1.5; }
.flow-node:hover rect { stroke: var(--secondary); stroke-width: 2; }
a:focus-visible .flow-node rect { stroke: var(--focus); stroke-width: 2.5; }
.flow-sub rect { fill: var(--bg-surface-2); }
.flow-ghost rect { fill: transparent; stroke-dasharray: 5 4; }
.flow-status-blocked rect { stroke: var(--red-medium); }
.flow-status-done rect, .flow-status-done_externally rect { stroke: var(--green-medium); }
.flow-status-in_review rect, .flow-status-waiting_for_user rect { stroke: var(--yellow-medium); }
.flow-name { font-size: 12.5px; font-weight: 600; fill: var(--text-dark); }
.flow-meta { font-size: 11px; fill: var(--text-medium); }
.flow-edge { fill: none; stroke: var(--grey-400); stroke-width: 1.5; }
.flow-edge-input { stroke-dasharray: 5 4; }
.flow-edge-parent { stroke-dasharray: 2 3; }
.flow-edge-blocking { stroke: var(--red-medium); }
.flow-arrow { fill: var(--grey-400); }
.flow-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .5rem; }
.flow-move { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.flow-dragging { cursor: grabbing; }
.flow-dragging .flow-node rect { stroke: var(--primary); stroke-width: 2; }
.flow-mode-agent rect { stroke: var(--secondary); }
.flow-mode-planned rect { stroke: var(--yellow-medium); }
.lg-mode-agent, .lg-mode-planned { height: 12px; width: 16px; border: 1.5px solid var(--secondary); border-radius: 3px; }
.lg-mode-planned { border-color: var(--yellow-medium); }
.flow-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: .75rem 0 0; font-size: .75rem; color: var(--text-medium); }
.lg { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--grey-400); margin-left: .5rem; }
.lg-input { border-top-style: dashed; }
.lg-ghost { height: 12px; width: 16px; border: 1.5px dashed var(--grey-400); border-radius: 3px; }
.lg-blocking { border-top-color: var(--red-medium); }
/* Template editor */
.editor { display: grid; grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-top: 1rem; }
.editor-outline { display: grid; gap: 2px; padding: .75rem; position: sticky; top: calc(var(--topbar) + 1rem); max-height: calc(100vh - var(--topbar) - 2rem); overflow-y: auto; }
.ol-item { display: flex; align-items: center; gap: .4rem; padding: .4rem .55rem; border-radius: .375rem; color: var(--text-dark); font-size: .8125rem; overflow-wrap: anywhere; }
.ol-item:hover { background: var(--grey-100); text-decoration: none; }
.ol-item.active { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.ol-phase { font-weight: 500; margin-top: .35rem; }
.ol-phase .phase-index { width: 1.4rem; height: 1.4rem; font-size: .7rem; }
.ol-task { padding-left: 2.2rem; color: var(--text-medium); }
.ol-err { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; border-radius: 50%; background: var(--red-medium); color: #fff; font-size: .65rem; font-weight: 700; }
.ol-add { display: flex; gap: .35rem; margin-top: .5rem; }
.ol-add input { min-width: 0; }
.editor-main h2 { margin-bottom: 1rem; }
.editor-main hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }
.ed-slot { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface-0); }
.ed-slot + .ed-slot { margin-top: .5rem; }
.slot-summary { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; min-height: 2.75rem; padding: .4rem 3rem .4rem .6rem; cursor: pointer; list-style: none; font-size: .8125rem; }
.slot-summary::-webkit-details-marker { display: none; }
.slot-summary > .icon { flex: none; width: 1rem; height: 1rem; color: var(--primary); }
.slot-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; min-width: 0; }
.slot-title strong { overflow-wrap: anywhere; }
.slot-title code { font-size: .75rem; color: var(--text-medium); }
.slot-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; max-width: 22rem; }
.slot-chev { display: inline-flex; color: var(--grey-600); transition: transform .15s ease-out; transform: rotate(-90deg); }
.slot-chev .icon { width: 1rem; height: 1rem; }
details[open] > .slot-summary .slot-chev { transform: none; }
.slot-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .5rem .75rem; padding: .75rem; border-top: 1px dashed var(--border); }
.slot-checks { display: flex; flex-wrap: wrap; align-items: end; gap: .25rem 1rem; }
.slot-remove { position: absolute; top: .375rem; right: .375rem; background: transparent; border-color: transparent; color: var(--grey-600); }
.slot-remove:hover { background: var(--red-light); border-color: var(--red-medium); color: var(--red-dark); }
.slot-add { margin-top: .5rem; justify-self: start; }
.slot-view { margin: 0; padding: 0; list-style: none; }
.slot-view > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem .75rem; padding: .6rem 1rem; border-top: 1px solid var(--border); font-size: .8125rem; }
.slot-view > li .slot-title { flex: 1 1 14rem; }
@media (prefers-reduced-motion: reduce) { .slot-chev { transition: none; } }
@media (max-width: 1023px) { .editor { grid-template-columns: 1fr; } .editor-outline { position: static; max-height: none; } }
@media (max-width: 640px) {
  .checklist li { grid-template-columns: auto 1fr; }
  .checklist li > .btn { grid-column: 2; justify-self: start; }
  .adapt-row, fieldset > .adapt-row { grid-template-columns: 1fr; }
}

/* 1024–1279 px (last, so it wins over the component rules): the sidebar becomes an icon rail and pages keep their
   side panels; secondary table columns hide. */
@media (max-width: 1279px) {
  .sidebar { width: 72px; }
  .side-logo { justify-content: center; padding: 0; }
  .side-logo img { width: 26px; height: 40px; object-fit: cover; object-position: 8.5% 50%; }
  .side-nav { padding: 0 12px 1rem; }
  .side-link { justify-content: center; padding: 0; }
  .side-link > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .side-section { height: 1px; margin: .75rem .25rem; padding: 0; overflow: hidden; background: var(--border); color: transparent; }
  .side-foot, .side-card, .side-phase { display: none; }
  .col-2nd { display: none; }
  .stepper { grid-auto-columns: minmax(7rem, 1fr); gap: .5rem; }
  .step { padding: .7rem .75rem; }
  .input-line { grid-template-columns: minmax(8rem, 12rem) auto minmax(0, 1fr) auto; gap: .4rem .75rem; }
}
