/* ЛАНС interface */
:root {
  color-scheme: light;
  --navy: #0f2d69;
  --blue: #254b9b;
  --sky: #249fd8;
  --blue-soft: #d2ddf1;
  --blue-pale: #eef3fb;
  --ink: #111827;
  --ink-2: #273349;
  --muted: #667085;
  --muted-2: #929292;
  --line: #dfe3ea;
  --line-dark: #cad1dc;
  --surface: #ffffff;
  --surface-2: #f5f6f8;
  --surface-3: #eceff3;
  --green: #229c66;
  --green-soft: #d8e6bd;
  --orange: #ea6621;
  --orange-soft: #fedb97;
  --violet: #75539a;
  --violet-soft: #dccee5;
  --red: #bd1b47;
  --red-soft: #f8c4b1;
  --yellow: #f9b932;
  --yellow-soft: #f9ee89;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .05), 0 2px 8px rgb(16 24 40 / .04);
  --shadow-md: 0 12px 34px rgb(15 45 105 / .10), 0 2px 8px rgb(16 24 40 / .05);
  --shadow-lg: 0 28px 80px rgb(15 45 105 / .18);
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --font: "HSE Sans", Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { max-width: 100%; scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; min-width: 320px; max-width: 100%; overflow-x: clip; background: var(--surface-2); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
body[data-mode="workspace"], body[data-mode="moderation"] { overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
p, h1, h2, h3, h4, dl, dd, ol, ul, pre { margin: 0; }
button { border: 0; background: none; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
::selection { background: var(--blue-soft); color: var(--navy); }
:focus-visible { outline: 3px solid rgb(36 159 216 / .35); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; z-index: 9999; left: 16px; top: -60px; padding: 12px 18px; background: #fff; color: var(--navy); box-shadow: var(--shadow-md); border-radius: 0 0 8px 8px; transition: top .2s; }
.skip-link:focus { top: 0; }
.icon { flex: 0 0 auto; }
.mono, code { font-family: var(--mono); }
.eyebrow { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .15em; line-height: 1.4; text-transform: uppercase; }
.eyebrow--light { color: #a9c8ff; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px; line-height: 1; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease; position: relative; isolation: isolate; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button--primary { background: var(--blue); color: #fff; box-shadow: 0 5px 14px rgb(37 75 155 / .18); }
.button--primary:hover:not(:disabled) { background: var(--navy); box-shadow: 0 8px 22px rgb(15 45 105 / .25); }
.button--navy { background: var(--navy); color: #fff; }
.button--navy:hover:not(:disabled) { background: #0a2254; }
.button--secondary { background: #fff; color: var(--ink-2); border-color: var(--line-dark); }
.button--secondary:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.button--white { background: #fff; color: var(--navy); }
.button--white:hover:not(:disabled) { box-shadow: 0 10px 26px rgb(0 0 0 / .15); }
.button--ghost-light { color: #fff; border-color: rgb(255 255 255 / .35); }
.button--ghost-light:hover:not(:disabled) { background: rgb(255 255 255 / .08); border-color: #fff; }
.button--success { background: var(--green); color: #fff; }
.button--warning { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.button--danger { background: var(--red); color: #fff; }
.button--compact { min-height: 34px; padding: 0 12px; font-size: 12px; gap: 7px; }
.button--large { min-height: 50px; padding: 0 23px; font-size: 15px; }
.button--full { width: 100%; }
.button.is-loading::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; }
.button.is-loading::before { content: ""; position: absolute; z-index: 2; width: 16px; height: 16px; border: 2px solid rgb(255 255 255 / .45); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: #fff; transition: .16s ease; position: relative; }
.icon-button:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }
.icon-button--primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.icon-button--dark { background: transparent; color: #c8d4ed; border-color: rgb(255 255 255 / .12); }
.icon-button--dark:hover { color: #fff; border-color: rgb(255 255 255 / .35); background: rgb(255 255 255 / .07); }
.text-link { color: var(--blue); font-size: 13px; font-weight: 700; }
.text-danger { color: var(--red); font-size: 13px; font-weight: 700; padding: 8px 0; }
.arrow-link { display: inline-flex; align-items: center; gap: 9px; color: var(--blue); font-weight: 750; font-size: 14px; }
.arrow-link:hover svg { transform: translateX(3px); }
.arrow-link svg { transition: transform .18s ease; }

.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: linear-gradient(145deg, var(--blue), var(--navy)); color: #fff; font-weight: 800; letter-spacing: -.02em; border: 2px solid #fff; box-shadow: 0 0 0 1px rgb(15 45 105 / .08); }
.avatar--xs { width: 26px; height: 26px; font-size: 11px; border-width: 1px; }
.avatar--sm { width: 34px; height: 34px; font-size: 11px; }
.avatar--md { width: 42px; height: 42px; font-size: 13px; }
.avatar--lg { width: 58px; height: 58px; font-size: 18px; }
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar + .avatar { margin-left: -9px; }

.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; padding: 7px 10px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status--compact { padding: 5px 8px; font-size: 11px; }
.status--blue { color: #1d4ed8; background: #eaf1ff; }
.status--green { color: #177a51; background: #e7f6ee; }
.status--orange { color: #a8430d; background: #fff1e8; }
.status--violet { color: #68428b; background: #f1ebf7; }
.status--red { color: #a3153c; background: #fdeaf0; }
.status--gray { color: #667085; background: #eef0f3; }
.live-dot { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.live-dot i, .presence-dot { width: 7px; height: 7px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 3px rgb(34 156 102 / .12); }

.field { display: grid; gap: 8px; }
.field > span { font-size: 12px; font-weight: 750; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.field input, .field textarea, .field select, .slug-field { width: 100%; border: 1px solid var(--line-dark); background: #fff; color: var(--ink); border-radius: 7px; min-height: 43px; padding: 10px 12px; outline: none; transition: border .15s, box-shadow .15s; }
.field textarea { resize: vertical; line-height: 1.55; min-height: 90px; }
.field input:focus, .field textarea:focus, .field select:focus, .slug-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .11); }
.field input::placeholder, .field textarea::placeholder { color: #a3aab6; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-field button { position: absolute; right: 4px; top: 4px; width: 35px; height: 35px; display: grid; place-items: center; color: var(--muted); }
.password-field button.is-active { color: var(--blue); }
.slug-field { display: flex; align-items: center; padding: 0; overflow: hidden; }
.slug-field i { min-height: 41px; display: flex; align-items: center; padding: 0 0 0 12px; color: var(--muted); font-style: normal; font-family: var(--mono); font-size: 12px; background: var(--surface-2); border-right: 1px solid var(--line); }
.slug-field input { border: 0; box-shadow: none !important; border-radius: 0; min-height: 41px; }
.form-stack { display: grid; gap: 18px; }
.form-row { display: flex; gap: 16px; align-items: center; }
.form-row--two > * { flex: 1 1 0; min-width: 0; }
.form-row--between { justify-content: space-between; }
.checkbox { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.45; cursor: pointer; }
.checkbox input { margin: 2px 0 0; accent-color: var(--blue); }
.checkbox--boxed { padding: 13px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.checkbox--boxed span { display: grid; gap: 3px; }
.checkbox--boxed b { color: var(--ink-2); }
.checkbox--boxed small { color: var(--muted); }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.segmented button { padding: 7px 11px; border-radius: 5px; font-size: 11px; color: var(--muted); }
.segmented button.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); font-weight: 700; }

.modal-backdrop { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgb(8 20 49 / .66); backdrop-filter: blur(5px); animation: fadeIn .16s ease; }
.modal { width: min(620px, 100%); max-height: min(90vh, 880px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; animation: modalIn .2s ease; }
.modal--wide { width: min(980px, 100%); }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 25px 28px 20px; border-bottom: 1px solid var(--line); }
.modal__header h2 { margin-top: 5px; color: var(--navy); font-size: 25px; line-height: 1.15; letter-spacing: -.03em; }
.modal__header p:not(.eyebrow) { margin-top: 7px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.modal__body { padding: 24px 28px 28px; overflow-y: auto; }
.modal__actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 7px; }
.modal__actions--between { justify-content: space-between; }
.modal__actions--between > div { display: flex; gap: 10px; }

#toast-root { position: fixed; z-index: 3000; right: 22px; bottom: 22px; display: grid; gap: 10px; pointer-events: none; }
.toast { min-width: 280px; max-width: 430px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; background: #fff; color: var(--ink-2); box-shadow: var(--shadow-md); font-size: 13px; line-height: 1.4; pointer-events: auto; animation: toastIn .22s ease; }
.toast--success { border-left-color: var(--green); }
.toast--success > svg { color: var(--green); }
.toast--error { border-left-color: var(--red); }
.toast--error > svg { color: var(--red); }
.toast button { color: var(--muted); padding: 3px; }
.toast--leaving { animation: toastOut .18s ease forwards; }

.boot-screen, .route-loading { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--surface-2); color: var(--navy); }
.boot-screen { grid-auto-flow: column; align-items: center; }
.boot-screen strong { display: block; font-size: 22px; }
.boot-screen small { color: var(--muted); }
.boot-mark { width: 58px; height: 58px; position: relative; }
.boot-mark span { position: absolute; border: 5px solid var(--blue); border-radius: 50%; }
.boot-mark span:nth-child(1) { width: 58px; height: 58px; }
.boot-mark span:nth-child(2) { width: 37px; height: 37px; right: 0; bottom: 0; border-color: var(--sky); }
.boot-mark span:nth-child(3) { width: 13px; height: 13px; right: 2px; top: 2px; border: 0; background: var(--navy); }
.route-loading__mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; animation: pulseSoft 1.5s ease infinite; }
.route-loading > div { display: flex; gap: 5px; }
.route-loading > div i { width: 22px; height: 3px; background: var(--blue-soft); animation: loader 1s ease infinite; }
.route-loading > div i:nth-child(2) { animation-delay: .12s; }
.route-loading > div i:nth-child(3) { animation-delay: .24s; }
.route-loading p { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.empty-state { min-height: 210px; padding: 34px 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--line-dark); border-radius: var(--radius); background: #fff; }
.empty-state__icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-pale); }
.empty-state h3 { margin-top: 14px; font-size: 17px; color: var(--navy); }
.empty-state p { margin: 7px 0 16px; max-width: 390px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.inline-empty { padding: 22px; color: var(--muted); font-size: 12px; text-align: center; }
.error-page, .fatal-error { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; text-align: center; background: #fff; }
.error-page .error-code { font-size: 110px; font-weight: 900; color: var(--blue-soft); line-height: .85; }
.error-page h1, .fatal-error h1 { margin-top: 22px; max-width: 720px; color: var(--navy); font-size: 34px; letter-spacing: -.04em; }
.error-page p, .fatal-error p { margin: 12px 0 25px; color: var(--muted); }
.error-page > div:last-child { display: flex; gap: 10px; }

/* Public shell */
.public-header { height: 68px; display: grid; grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr); align-items: center; gap: 24px; padding: 0 clamp(24px, 4vw, 64px); background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.wordmark { display: inline-flex; align-items: center; gap: 12px; justify-self: start; }
.wordmark__shape { width: 37px; height: 37px; position: relative; display: block; }
.wordmark__shape i { position: absolute; border-radius: 50%; border: 4px solid var(--navy); }
.wordmark__shape i:first-child { inset: 0; }
.wordmark__shape i:last-child { width: 20px; height: 20px; right: 0; bottom: 0; border-color: var(--sky); background: #fff; }
.wordmark > span:last-child { display: grid; line-height: 1; }
.wordmark strong { color: var(--navy); font-size: 18px; letter-spacing: -.02em; }
.wordmark small { margin-top: 5px; color: var(--muted); font-size: 11px; letter-spacing: .09em; text-transform: uppercase; }
.public-nav { display: flex; align-items: center; gap: 34px; height: 100%; }
.public-nav a { height: 100%; display: flex; align-items: center; color: #414b5e; font-size: 13px; font-weight: 650; position: relative; }
.public-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--blue); transform: scaleX(0); transition: transform .18s; }
.public-nav a:hover, .public-nav a.is-active { color: var(--navy); }
.public-nav a.is-active::after { transform: scaleX(1); }
.public-header__actions { justify-self: end; display: flex; align-items: center; gap: 16px; }
.header-user { display: flex; align-items: center; gap: 9px; }
.header-user > span:last-child { display: grid; }
.header-user b { font-size: 11px; color: var(--ink-2); }
.header-user small { margin-top: 3px; font-size: 11px; color: var(--muted); }
.mobile-menu { position: relative; display: none; }
.public-footer { background: #091d45; color: #fff; padding: 52px clamp(24px, 6vw, 88px) 22px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 46px 64px; position: relative; overflow: hidden; }
.public-footer__brand { position: relative; z-index: 1; }
.public-footer__brand h2 { margin-top: 12px; max-width: 680px; font-size: clamp(28px, 3.5vw, 46px); line-height: 1.05; letter-spacing: -.05em; }
.footer-orbit { position: absolute; width: 380px; height: 380px; border: 55px solid rgb(36 159 216 / .12); border-radius: 50%; left: -160px; top: -160px; }
.public-footer__links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 45px; position: relative; z-index: 1; }
.public-footer__links > div { display: flex; flex-direction: column; gap: 12px; }
.public-footer__links b { margin-bottom: 8px; color: #a9c8ff; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.public-footer__links a { color: #dce6fb; font-size: 13px; }
.public-footer__links a:hover { color: #fff; }
.public-footer__bottom { grid-column: 1 / -1; display: flex; justify-content: space-between; padding-top: 20px; border-top: 1px solid rgb(255 255 255 / .12); color: #8fa5cf; font-size: 11px; letter-spacing: .05em; }
.breadcrumbs { max-width: 1440px; margin: 0 auto; padding: 17px clamp(24px, 5vw, 72px); display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.breadcrumbs a:hover { color: var(--blue); }

/* Landing */
.hero { min-height: 520px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 340px); color: #fff; background: var(--navy); position: relative; overflow: hidden; }
.hero__content { padding: clamp(52px, 6vw, 76px) clamp(28px, 6vw, 88px); position: relative; z-index: 2; }
.hero h1 { margin-top: 14px; font-size: clamp(50px, 6vw, 82px); line-height: .92; letter-spacing: -.06em; font-weight: 760; }
.hero h1 em { color: #7fc7ec; font-style: normal; font-weight: 500; }
.hero__lead { margin-top: 20px; max-width: 650px; color: #c8d8f5; font-size: clamp(15px, 1.3vw, 18px); line-height: 1.5; }
.hero-search { margin-top: 26px; width: min(680px, 100%); min-height: 52px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 5px 6px 5px 16px; background: #fff; color: var(--navy); box-shadow: 0 14px 38px rgb(0 0 0 / .18); }
.hero-search input { min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 14px; }
.hero-search button { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 17px; background: var(--blue); color: #fff; font-weight: 750; }
.hero__actions { margin-top: 20px; display: flex; gap: 10px; }
.hero__side { display: flex; flex-direction: column; background: #0b255a; border-left: 1px solid rgb(255 255 255 / .12); position: relative; z-index: 2; }
.hero-stat { min-height: 0; flex: 1 1 0; padding: 20px 25px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgb(255 255 255 / .1); }
.hero-stat--primary { background: var(--blue); }
.hero-stat strong { font-size: 44px; line-height: 1; letter-spacing: -.06em; }
.hero-stat span { margin-top: 0; color: #c5d3ef; font-size: 11px; line-height: 1.4; letter-spacing: .07em; text-align: right; text-transform: uppercase; }
.hero-side-note { padding: 22px 25px; display: flex; gap: 18px; align-items: flex-start; }
.hero-side-note span { color: #7fc7ec; font-family: var(--mono); font-size: 11px; }
.hero-side-note p { color: #c8d8f5; font-size: 13px; line-height: 1.65; }
.hero__geometry { position: absolute; inset: 0; pointer-events: none; }
.hero-ring { position: absolute; border-radius: 50%; border: clamp(50px, 7vw, 110px) solid rgb(36 159 216 / .12); }
.hero-ring--one { width: 720px; height: 720px; left: -250px; top: -330px; }
.hero-ring--two { width: 350px; height: 350px; left: 45%; bottom: -220px; border-color: rgb(255 255 255 / .055); }
.hero-dot { position: absolute; width: 110px; height: 110px; border-radius: 50%; background: rgb(37 75 155 / .5); left: 54%; top: 19%; }
.hero-cross::before, .hero-cross::after { content: ""; position: absolute; background: rgb(255 255 255 / .08); }
.hero-cross::before { width: 1px; height: 340px; left: 61%; top: 0; }
.hero-cross::after { width: 360px; height: 1px; left: 44%; top: 49%; }
.section-block { padding: clamp(54px, 5.5vw, 78px) clamp(24px, 7vw, 96px); background: #fff; }
.section-block--latest { display: grid; grid-template-columns: minmax(240px, .48fr) minmax(0, 1.52fr); gap: clamp(30px, 5vw, 72px); align-items: start; background: var(--surface-2); }
.section-heading { width: 100%; max-width: 1440px; margin: 0 auto 30px; display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: 42px; }
.section-heading h2 { margin-top: 8px; color: var(--navy); font-size: clamp(34px, 3.5vw, 48px); line-height: 1; letter-spacing: -.05em; }
.section-heading > p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.section-heading--row { grid-template-columns: 1fr auto; align-items: end; }
.section-block--latest .section-heading { margin: 0; grid-template-columns: 1fr; align-content: start; gap: 22px; }
.category-grid { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.category-card { min-height: 275px; padding: 20px 21px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; position: relative; overflow: hidden; transition: background .2s, transform .2s, box-shadow .2s; }
.category-card:hover { z-index: 2; background: var(--blue-pale); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.category-card__number { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.category-card h3 { margin-top: auto; color: var(--navy); font-size: 19px; letter-spacing: -.03em; }
.category-card p { margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.category-card__arrow { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; color: var(--blue); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.material-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.material-grid--home { width: 100%; max-width: 1440px; margin: 0 auto; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); }
.material-card { min-height: 350px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 2px; position: relative; overflow: hidden; transition: transform .2s, box-shadow .2s, border .2s; }
.material-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #b8c4da; }
.material-card__click { position: absolute; inset: 0; z-index: 1; }
.material-card__top { min-height: 48px; padding: 15px 18px 0; display: flex; justify-content: space-between; align-items: flex-start; position: relative; z-index: 2; pointer-events: none; }
.catalog-type { display: inline-flex; padding: 5px 8px; color: var(--blue); background: var(--blue-pale); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.material-card__files { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.material-card__body { padding: 20px 18px 0; }
.material-card__body h2,
.material-card__body h3 { color: var(--navy); font-size: 19px; line-height: 1.22; letter-spacing: -.025em; }
.material-card__body p { margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.62; }
.material-card__tags { margin-top: auto; padding: 16px 18px 0; display: flex; flex-wrap: wrap; gap: 5px; }
.material-card__tags span { padding: 4px 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-family: var(--mono); font-size: 11px; }
.material-card footer { margin: 16px 18px 0; padding: 14px 0 17px; display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.material-card footer span:last-child { display: flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 700; }
.material-grid--home > .material-card:only-child { min-height: 280px; display: grid; grid-template-columns: minmax(230px, .75fr) minmax(0, 1.25fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
.material-grid--home > .material-card:only-child .material-card__top { grid-column: 2; }
.material-grid--home > .material-card:only-child .material-card__body,
.material-grid--home > .material-card:only-child .material-card__tags,
.material-grid--home > .material-card:only-child footer { grid-column: 2; }
.workflow-section { display: grid; grid-template-columns: .75fr 1.25fr; background: var(--navy); color: #fff; }
.workflow-intro { padding: clamp(52px, 5.5vw, 72px) clamp(28px, 6vw, 80px); border-right: 1px solid rgb(255 255 255 / .12); }
.workflow-intro h2 { margin-top: 12px; font-size: clamp(36px, 3.8vw, 50px); line-height: 1; letter-spacing: -.05em; }
.workflow-intro > p:not(.eyebrow) { margin: 20px 0 24px; max-width: 520px; color: #bdcceb; font-size: 14px; line-height: 1.6; }
.workflow-steps { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; }
.workflow-steps li { min-height: 210px; padding: 24px 28px; display: flex; gap: 20px; border-right: 1px solid rgb(255 255 255 / .12); border-bottom: 1px solid rgb(255 255 255 / .12); }
.workflow-steps li > span { color: #7fc7ec; font-family: var(--mono); font-size: 11px; }
.workflow-steps li > div { margin-top: auto; }
.workflow-steps svg { color: #7fc7ec; }
.workflow-steps h3 { margin-top: 14px; font-size: 20px; }
.workflow-steps p { margin-top: 9px; color: #bdcceb; font-size: 12px; line-height: 1.65; }
.lab-teaser { min-height: 420px; display: grid; grid-template-columns: .85fr 1.15fr; background: #fff; }
.lab-teaser__art { min-height: 420px; background: var(--blue-pale); position: relative; overflow: hidden; }
.lab-teaser__art span { position: absolute; display: block; }
.lab-teaser__art span:nth-child(1) { width: 300px; height: 300px; border: 50px solid var(--blue); border-radius: 50%; left: 11%; top: 10%; }
.lab-teaser__art span:nth-child(2) { width: 180px; height: 180px; border: 34px solid var(--sky); border-radius: 50%; right: 7%; bottom: -40px; background: var(--blue-pale); }
.lab-teaser__art span:nth-child(3) { width: 130px; height: 34px; background: var(--navy); left: 40%; top: 44%; transform: rotate(-38deg); }
.lab-teaser__art span:nth-child(4) { width: 34px; height: 34px; background: var(--orange); border-radius: 50%; right: 20%; top: 17%; }
.lab-teaser__content { padding: clamp(48px, 5vw, 68px) clamp(30px, 6vw, 82px); display: flex; flex-direction: column; justify-content: center; }
.lab-teaser__content h2 { margin-top: 11px; color: var(--navy); font-size: clamp(36px, 3.8vw, 50px); line-height: 1; letter-spacing: -.05em; }
.lab-teaser__content > p:not(.eyebrow) { margin-top: 18px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.feature-line { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feature-line span { display: inline-flex; align-items: center; gap: 8px; padding: 9px 11px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 700; }
.feature-line svg { color: var(--blue); }

/* Catalog and public item */
.catalog-page { background: var(--surface-2); min-height: 70vh; }
.catalog-hero { min-height: 220px; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 42px clamp(24px, 7vw, 96px); background: var(--navy); color: #fff; overflow: hidden; }
.catalog-hero h1 { margin-top: 8px; font-size: clamp(42px, 4.8vw, 64px); letter-spacing: -.055em; }
.catalog-hero p:not(.eyebrow) { margin-top: 13px; max-width: 650px; color: #c4d4f1; font-size: 15px; }
.catalog-hero__symbol { width: 260px; height: 150px; position: relative; opacity: .9; }
.catalog-hero__symbol i { position: absolute; border: 18px solid rgb(255 255 255 / .2); border-radius: 50%; }
.catalog-hero__symbol i:nth-child(1) { width: 145px; height: 145px; right: 45px; top: 0; }
.catalog-hero__symbol i:nth-child(2) { width: 90px; height: 90px; right: 0; bottom: -12px; border-color: var(--sky); }
.catalog-hero__symbol i:nth-child(3) { width: 35px; height: 35px; left: 25px; top: 50px; border: 0; background: var(--blue); }
.catalog-layout { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: 230px 1fr; gap: 30px; padding: 32px clamp(24px, 5vw, 72px) 68px; }
.catalog-filters__sticky { position: sticky; top: 24px; display: flex; flex-direction: column; }
.filter-title { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--navy); font-size: 12px; }
.catalog-filters a { min-height: 46px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.catalog-filters a:hover, .catalog-filters a.is-active { color: var(--navy); background: #fff; }
.catalog-filters a.is-active { border-left: 3px solid var(--blue); font-weight: 750; }
.catalog-filters a i { font-style: normal; font-size: 11px; }
.filter-help { margin-top: 28px; padding: 15px; display: flex; gap: 10px; background: var(--blue-pale); color: var(--blue); }
.filter-help p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.filter-help b { color: var(--navy); }
.catalog-search { min-height: 50px; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 5px 6px 5px 14px; background: #fff; border: 1px solid var(--line-dark); }
.catalog-search input { border: 0; outline: 0; min-width: 0; font-size: 13px; }
.clear-search { width: 30px; height: 30px; display: grid; place-items: center; color: var(--muted); }
.results-heading { margin: 32px 0 20px; display: flex; align-items: end; justify-content: space-between; }
.results-heading h2 { color: var(--navy); font-size: 29px; letter-spacing: -.035em; }
.results-heading p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.sort-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.sort-label select { border: 1px solid var(--line); padding: 7px; background: #fff; color: var(--ink-2); }
.item-page { background: #fff; min-height: 70vh; }
.item-head { max-width: 1440px; margin: 0 auto; padding: 45px clamp(24px, 5vw, 72px) 60px; display: grid; grid-template-columns: 1fr 340px; gap: 75px; align-items: start; }
.item-head__main h1 { margin-top: 18px; max-width: 920px; color: var(--navy); font-size: clamp(42px, 5vw, 72px); line-height: .99; letter-spacing: -.057em; }
.item-head__main > p { margin-top: 22px; max-width: 790px; color: var(--muted); font-size: 16px; line-height: 1.68; }
.item-author { margin-top: 30px; display: flex; align-items: center; gap: 11px; }
.item-author > span:last-child { display: grid; }
.item-author b { font-size: 12px; color: var(--ink-2); }
.item-author small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.download-card { padding: 25px; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.download-card__mark { display: flex; align-items: center; justify-content: space-between; color: var(--blue); }
.download-card__mark span { padding: 5px 7px; background: var(--blue); color: #fff; font-family: var(--mono); font-size: 11px; }
.download-card h2 { margin-top: 17px; color: var(--navy); font-size: 16px; word-break: break-word; }
.download-card dl { margin: 20px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.download-card dl div { display: grid; gap: 4px; }
.download-card dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.download-card dd { color: var(--ink-2); font-size: 12px; font-weight: 700; }
.download-card > p { margin-top: 11px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11px; }
.item-content { padding: 62px clamp(24px, 5vw, 72px) 100px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; background: var(--surface-2); }
.file-browser-card, .item-meta-card { border: 1px solid var(--line); background: #fff; }
.file-browser-card > header { min-height: 86px; padding: 19px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.file-browser-card h2 { margin-top: 4px; color: var(--navy); font-size: 21px; }
.hash-chip { display: inline-flex; align-items: center; gap: 5px; padding: 7px 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-family: var(--mono); font-size: 11px; }
.hash-chip button { color: var(--blue); }
.public-file-grid { min-height: 520px; display: grid; grid-template-columns: 300px 1fr; }
.public-file-list { border-right: 1px solid var(--line); overflow-y: auto; max-height: 600px; }
.public-file-list button { width: 100%; min-height: 47px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--muted); text-align: left; }
.public-file-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.public-file-list button small { font-size: 11px; }
.public-file-list button:hover, .public-file-list button.is-active { background: var(--blue-pale); color: var(--blue); }
.public-file-list button.is-active { box-shadow: inset 3px 0 var(--blue); }
.public-preview { min-width: 0; display: flex; flex-direction: column; }
.public-preview > header { min-height: 45px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; background: #f8f9fb; border-bottom: 1px solid var(--line); color: var(--ink-2); font-family: var(--mono); font-size: 11px; }
.public-preview > header small { color: var(--muted); }
.public-preview pre { flex: 1; padding: 20px; overflow: auto; background: #fbfcfe; color: #25314a; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.item-meta-card { align-self: start; padding: 22px; }
.item-meta-card h3 { color: var(--navy); font-size: 17px; }
.item-meta-card dl { margin-top: 18px; }
.item-meta-card dl div { padding: 13px 0; border-bottom: 1px solid var(--line); }
.item-meta-card dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.item-meta-card dd { margin-top: 5px; color: var(--ink-2); font-size: 11px; line-height: 1.5; word-break: break-all; }
.meta-note { margin-top: 22px; padding: 13px; display: flex; gap: 9px; background: var(--blue-pale); color: var(--blue); }
.meta-note p { color: var(--muted); font-size: 11px; line-height: 1.5; }

/* Auth and about */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: .92fr 1.08fr; background: #fff; position: relative; }
.auth-back { position: fixed; z-index: 5; left: 26px; top: 22px; display: flex; align-items: center; gap: 8px; color: #fff; font-size: 11px; }
.auth-form-panel { min-height: 100vh; display: grid; place-items: center; padding: 70px 40px; overflow-y: auto; }
.auth-form-wrap { width: min(560px, 100%); }
.auth-heading h2 { margin-top: 7px; color: var(--navy); font-size: 38px; letter-spacing: -.045em; }
.auth-heading > p:last-child { margin: 10px 0 28px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.form-alt { color: var(--muted); text-align: center; font-size: 12px; }
.form-alt a { color: var(--blue); font-weight: 750; }
.muted-link { color: #98a0ad; font-size: 11px; cursor: help; }
.auth-success { text-align: center; }
.auth-success__icon { width: 78px; height: 78px; margin: 0 auto 23px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-pale); color: var(--blue); }
.auth-success h2 { margin-top: 8px; color: var(--navy); font-size: 34px; line-height: 1.1; letter-spacing: -.045em; }
.auth-success > p:not(.eyebrow) { margin: 16px 0 25px; color: var(--muted); line-height: 1.65; }
.approval-timeline { margin-bottom: 26px; display: grid; gap: 10px; text-align: left; }
.approval-timeline span { display: flex; align-items: center; gap: 11px; padding: 11px; background: var(--surface-2); color: var(--muted); font-size: 12px; }
.approval-timeline i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: var(--muted); font-style: normal; }
.approval-timeline .is-done { color: var(--green); }
.approval-timeline .is-done i { background: var(--green); color: #fff; border-color: var(--green); }
.about-hero { min-height: 520px; padding: clamp(58px, 6vw, 82px) clamp(24px, 7vw, 96px); background: var(--navy); color: #fff; }
.about-hero h1 { margin-top: 13px; font-size: clamp(54px, 6.4vw, 84px); line-height: .92; letter-spacing: -.065em; }
.about-hero h1 em { color: #7fc7ec; font-style: normal; font-weight: 450; }
.about-hero > p:not(.eyebrow) { margin-top: 27px; max-width: 800px; color: #c4d4f1; font-size: 17px; line-height: 1.7; }
.about-hero__diagram { margin-top: 40px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 16px; }
.about-hero__diagram > div { min-height: 112px; padding: 18px; border: 1px solid rgb(255 255 255 / .2); background: rgb(255 255 255 / .045); display: flex; flex-direction: column; }
.about-hero__diagram span { color: #7fc7ec; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.about-hero__diagram b { margin-top: auto; font-size: 25px; }
.about-hero__diagram small { margin-top: 7px; color: #9eb2db; }
.about-principles { padding: 70px clamp(24px, 7vw, 96px); background: #fff; }
.principle-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.principle-grid article { min-height: 310px; padding: 24px; display: flex; flex-direction: column; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-grid article > span { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.principle-grid svg { margin-top: 48px; color: var(--blue); }
.principle-grid h3 { margin-top: auto; color: var(--navy); font-size: 21px; }
.principle-grid p { margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.62; }
.about-roadmap { display: grid; grid-template-columns: .7fr 1.3fr; background: var(--surface-2); }
.about-roadmap > div { padding: 66px clamp(24px, 6vw, 80px); background: var(--blue); color: #fff; }
.about-roadmap h2 { margin-top: 13px; font-size: 46px; letter-spacing: -.05em; }
.about-roadmap ol { list-style: none; padding: 0; }
.about-roadmap li { min-height: 108px; padding: 22px 32px; display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); background: #fff; }
.about-roadmap li > b { color: var(--blue); font-family: var(--mono); font-size: 11px; }
.about-roadmap li span { display: grid; gap: 8px; }
.about-roadmap strong { color: var(--navy); font-size: 19px; }
.about-roadmap small { color: var(--muted); line-height: 1.55; }

/* --------------------------------------------------------------------------
   Author cabinet and moderation
   -------------------------------------------------------------------------- */
.cabinet-page, .submission-detail-page { min-height: 100vh; background: var(--surface-2); }
.cabinet-head { padding: 46px clamp(24px, 7vw, 96px) 38px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.cabinet-head::after { content: ""; position: absolute; width: 360px; height: 360px; right: 8%; top: -245px; border: 58px solid rgb(36 159 216 / .15); border-radius: 50%; }
.cabinet-head > div, .cabinet-head > button { position: relative; z-index: 1; }
.cabinet-head h1 { margin-top: 9px; font-size: clamp(40px, 4.4vw, 56px); line-height: .97; letter-spacing: -.05em; }
.cabinet-head p:not(.eyebrow) { margin-top: 15px; max-width: 680px; color: #b9c9e6; font-size: 14px; line-height: 1.65; }
.cabinet-stats { padding: 0 clamp(24px, 7vw, 96px); transform: translateY(-14px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) 1.35fr; gap: 1px; }
.cabinet-stats > article { min-height: 92px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); margin-right: -1px; display: flex; align-items: center; gap: 13px; box-shadow: var(--shadow-sm); }
.cabinet-stats > article > span:not(.avatar) { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--blue-pale); color: var(--blue); }
.cabinet-stats article strong { display: block; color: var(--navy); font-size: 29px; line-height: 1; letter-spacing: -.035em; }
.cabinet-stats article small { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.cabinet-profile-card { background: var(--blue) !important; border-color: var(--blue) !important; color: #fff; }
.cabinet-profile-card b { display: block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.cabinet-profile-card small { color: #c8d6f2 !important; }
.cabinet-profile-card span:last-child { display: inline-flex; margin-top: 8px; padding: 4px 7px; border-radius: 99px; background: rgb(255 255 255 / .12); color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.cabinet-content { padding: 28px clamp(24px, 7vw, 96px) 24px; }
.cabinet-content > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.cabinet-content h2 { margin-top: 6px; color: var(--navy); font-size: 31px; letter-spacing: -.04em; }
.submission-list { border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); }
.submission-list__head, .submission-row { display: grid; grid-template-columns: minmax(300px, 1fr) 200px 145px 32px; align-items: center; gap: 18px; }
.submission-list__head { padding: 11px 21px 11px 78px; background: var(--surface-2); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
.submission-row { min-height: 85px; padding: 13px 20px; border-bottom: 1px solid var(--line); transition: background .16s, transform .16s; }
.submission-row:last-child { border-bottom: 0; }
.submission-row:hover { background: var(--blue-pale); }
.submission-row__icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-pale); color: var(--blue); position: absolute; }
.submission-row__main { min-width: 0; padding-left: 58px; display: grid; gap: 6px; }
.submission-row__main strong { color: var(--ink-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.submission-row__main small, .submission-row__meta small, .submission-row__owner small { color: var(--muted); font-size: 11px; }
.submission-row__owner { display: flex; align-items: center; gap: 9px; min-width: 0; }
.submission-row__owner > span { min-width: 0; display: grid; gap: 3px; }
.submission-row__owner > span > span, .submission-row__owner b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 11px; font-weight: 700; }
.submission-row__meta { display: grid; gap: 5px; }
.submission-row__meta b { font-size: 11px; color: var(--ink-2); }
.submission-row__arrow { color: var(--muted); transition: transform .16s, color .16s; }
.submission-row:hover .submission-row__arrow { color: var(--blue); transform: translateX(3px); }
.cabinet-guide { margin: 0 clamp(24px, 7vw, 110px) 70px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--sky); }
.cabinet-guide > div { display: flex; align-items: center; gap: 17px; color: var(--blue); }
.cabinet-guide span { display: grid; gap: 5px; }
.cabinet-guide b { color: var(--ink-2); font-size: 13px; }
.cabinet-guide p { color: var(--muted); font-size: 11px; line-height: 1.55; }

.archive-form { display: grid; gap: 18px; }
.dropzone { min-height: 205px; padding: 28px; display: grid; place-items: center; text-align: center; border: 1.5px dashed var(--blue-soft); border-radius: 10px; background: var(--blue-pale); transition: .18s; position: relative; }
.dropzone:hover, .dropzone.is-over { border-color: var(--blue); background: #e7eefb; }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone__icon { width: 60px; height: 60px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--blue); box-shadow: var(--shadow-sm); }
.dropzone b { color: var(--navy); font-size: 15px; }
.dropzone p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.dropzone small { display: block; margin-top: 10px; color: var(--blue); font-family: var(--mono); }
.archive-safety { padding: 13px 14px; display: flex; gap: 11px; align-items: flex-start; background: #f0f7f4; border: 1px solid #c7e6d7; border-radius: 8px; color: #277255; font-size: 11px; line-height: 1.55; }
.archive-safety svg { margin-top: 1px; }

.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.breadcrumbs a:hover { color: var(--blue); }
.submission-detail-head { padding: 44px clamp(24px, 6vw, 88px) 36px; display: flex; align-items: flex-start; justify-content: space-between; gap: 36px; background: #fff; border-bottom: 1px solid var(--line); }
.submission-detail-head > div:first-child { min-width: 0; flex: 1; }
.submission-title-line { margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.submission-title-line > span:last-child { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.submission-detail-head h1 { max-width: 860px; color: var(--navy); font-size: clamp(35px, 4vw, 55px); line-height: 1.02; letter-spacing: -.052em; }
.submission-detail-head > div > p { margin-top: 14px; max-width: 800px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.submission-head-actions { display: flex; gap: 9px; flex-wrap: wrap; padding-top: 35px; }
.status-timeline { margin-top: 28px; display: flex; align-items: flex-start; max-width: 730px; }
.status-timeline > span { min-width: 0; flex: 1; position: relative; display: grid; justify-items: start; gap: 7px; color: var(--muted); font-size: 11px; }
.status-timeline > span::before { content: ""; width: 25px; height: 25px; border: 1px solid var(--line-dark); border-radius: 50%; background: #fff; position: relative; z-index: 2; }
.status-timeline > span::after { content: ""; position: absolute; left: 25px; right: 0; top: 12px; height: 1px; background: var(--line); }
.status-timeline > span:last-child::after { display: none; }
.status-timeline > span.is-done { color: var(--green); font-weight: 700; }
.status-timeline > span.is-done::before { border: 6px solid var(--green); }
.status-timeline > span.is-active { color: var(--blue); font-weight: 800; }
.status-timeline > span.is-active::before { border: 6px solid var(--blue); box-shadow: 0 0 0 4px var(--blue-pale); }
.status-timeline > span.is-done::after { background: var(--green); }
.submission-detail-grid { padding: 28px clamp(24px, 6vw, 88px) 70px; display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; align-items: start; }
.submission-main-column, .submission-side-column { display: grid; gap: 18px; }
.content-card, .side-card { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.content-card { padding: 24px; }
.content-card__head, .side-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 19px; }
.content-card__head h2, .side-card h3 { margin-top: 5px; color: var(--navy); font-size: 21px; letter-spacing: -.025em; }
.public-file-list > button { min-height: 52px; padding: 10px 13px; display: grid; grid-template-columns: 22px minmax(0,1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); text-align: left; background: #fff; }
.public-file-list > button:last-child { border-bottom: 0; }
.public-file-list > button:hover, .public-file-list > button.is-active { background: var(--blue-pale); color: var(--blue); }
.public-file-list button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 11px; }
.public-file-list button small { color: var(--muted); font-size: 11px; }
.public-file-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 380px; border: 1px solid var(--line); }
.public-file-list { border-right: 1px solid var(--line); max-height: 540px; overflow: auto; }
.public-preview { min-width: 0; background: #fbfcfe; overflow: auto; }
.public-preview pre { min-height: 100%; padding: 21px; color: #28364e; font: 11px/1.7 var(--mono); white-space: pre-wrap; word-break: break-word; }
.submission-chat, .inspector-chat__messages, .project-chat-messages, .dm-messages { display: grid; gap: 12px; overflow-y: auto; }
.submission-chat { max-height: 380px; padding: 4px; }
.chat-message { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: start; }
.chat-message > div { min-width: 0; padding: 10px 12px; border-radius: 3px 10px 10px 10px; background: var(--surface-2); }
.chat-message.is-own > div { background: var(--blue-pale); }
.chat-message header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.chat-message b { color: var(--ink-2); font-size: 11px; }
.chat-message header span { color: var(--muted); font-size: 11px; line-height: 1.3; text-align: right; }
.chat-message time, .chat-message small { color: var(--muted); font-size: 11px; }
.chat-message p { color: #3e495b; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-composer { margin-top: 15px; display: flex; align-items: flex-end; gap: 9px; padding-top: 15px; border-top: 1px solid var(--line); }
.chat-composer textarea { flex: 1; min-width: 0; min-height: 43px; max-height: 140px; padding: 11px; resize: vertical; border: 1px solid var(--line-dark); border-radius: 7px; outline: 0; }
.chat-composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .1); }
.side-card { padding: 18px; }
.side-card--meta dl { display: grid; gap: 12px; }
.side-card--meta dl > div { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.side-card--meta dl > div:last-child { border: 0; padding-bottom: 0; }
.side-card dt { color: var(--muted); font-size: 11px; }
.side-card dd { color: var(--ink-2); font-size: 11px; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.issue-list, .version-list { display: grid; gap: 9px; }
.issue-card { padding: 12px; display: grid; gap: 7px; border: 1px solid var(--line); border-left: 3px solid var(--orange); background: #fffaf7; }
.issue-card > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.issue-card b, .version-item b { color: var(--ink-2); font: 10px/1.4 var(--mono); overflow-wrap: anywhere; }
.issue-card p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.issue-severity { padding: 3px 6px; border-radius: 99px; background: var(--orange-soft); color: #8d3d12; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.version-item { padding: 10px 11px; display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; border: 1px solid var(--line); }
.version-item > span:first-child { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-family: var(--mono); font-size: 11px; }
.version-item > span:nth-child(2) { display: grid; gap: 3px; min-width: 0; }
.version-item small { color: var(--muted); font-size: 11px; }
.attention-banner { padding: 15px 17px; display: flex; align-items: flex-start; gap: 12px; border: 1px solid #f3c98c; background: #fff9ef; color: #87440c; font-size: 11px; line-height: 1.55; }
.attention-banner--green { border-color: #a8d8bd; background: #eff9f3; color: #176340; }
.attention-banner--orange { border-color: #f3c98c; background: #fff9ef; color: #87440c; }

.moderation-shell { height: 100vh; display: grid; grid-template-rows: 58px minmax(0, 1fr); background: var(--surface-2); }
.moderation-topbar { padding: 0 18px; display: grid; grid-template-columns: 260px 1fr auto; align-items: center; background: var(--navy); color: #fff; }
.moderation-topbar > a { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.moderation-topbar__title { justify-self: start; display: flex; align-items: center; gap: 14px; }
.moderation-topbar__title .live-dot { color: #a7b9dc; }
.moderation-topbar__right { display: flex; align-items: center; gap: 10px; }
.moderation-topbar__right .text-link { color: #bcd0f3; margin-right: 8px; }
.moderation-topbar__right > span:last-child { display: grid; gap: 2px; }
.moderation-topbar__right b { font-size: 11px; }
.moderation-topbar__right small { color: #93a8d0; font-size: 11px; }
.moderation-layout { min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 310px; }
.moderation-queue { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); }
.moderation-queue > header { padding: 18px; border-bottom: 1px solid var(--line); }
.moderation-queue > header h2 { color: var(--navy); font-size: 20px; }
.queue-search { margin-top: 13px; display: flex; align-items: center; gap: 8px; padding: 0 10px; min-height: 38px; border: 1px solid var(--line); background: var(--surface-2); }
.queue-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 11px; }
.queue-filters { padding: 10px 13px; display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.queue-filters a { padding: 6px 9px; flex: 0 0 auto; border-radius: 99px; color: var(--muted); font-size: 11px; }
.queue-filters a.is-active { background: var(--navy); color: #fff; }
.queue-items { min-height: 0; overflow-y: auto; }
.queue-item { min-height: 105px; padding: 15px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; border-bottom: 1px solid var(--line); background: #fff; }
.queue-item:hover, .queue-item.is-active { background: var(--blue-pale); }
.queue-item h3 { color: var(--ink-2); font-size: 12px; line-height: 1.35; }
.queue-item p { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.4; }
.queue-item footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; }
.queue-status { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 3px rgb(234 102 33 / .12); }
.moderation-review { min-width: 0; min-height: 0; overflow-y: auto; background: var(--surface-2); }
.review-titlebar { padding: 19px 23px; display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; background: #fff; border-bottom: 1px solid var(--line); }
.review-titlebar h1 { margin-top: 5px; color: var(--navy); font-size: 24px; letter-spacing: -.035em; }
.review-titlebar p { margin-top: 7px; color: var(--muted); font-size: 11px; }
.review-browser { margin: 17px; min-height: 420px; display: grid; grid-template-columns: 230px minmax(0,1fr); border: 1px solid var(--line); background: #fff; }
.review-files { min-height: 0; max-height: 560px; overflow-y: auto; border-right: 1px solid var(--line); }
.review-files > header, .review-preview > header { min-height: 43px; padding: 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.review-files > header b, .review-preview > header b { color: var(--ink-2); font-size: 11px; }
.review-files > button { width: 100%; min-height: 45px; padding: 8px 10px; display: grid; grid-template-columns: 18px minmax(0,1fr) auto; gap: 8px; align-items: center; text-align: left; border-bottom: 1px solid var(--line); }
.review-files > button:hover, .review-files > button.is-active { background: var(--blue-pale); color: var(--blue); }
.review-files button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 9px/1.3 var(--mono); }
.review-files button i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); }
.review-preview { min-width: 0; min-height: 0; display: grid; grid-template-rows: 43px minmax(0,1fr); }
.review-preview pre { min-width: 0; max-height: 517px; padding: 18px; overflow: auto; background: #fbfcfd; color: #314057; font: 10px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; }
.moderation-issues { margin: 0 17px 18px; padding: 17px; background: #fff; border: 1px solid var(--line); }
.moderation-issues > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.moderation-issues h3 { margin-top: 4px; color: var(--navy); font-size: 17px; }
.moderation-issue-list { display: grid; gap: 8px; }
.moderation-issue { padding: 11px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 11px; align-items: start; border: 1px solid var(--line); border-left: 3px solid var(--orange); }
.moderation-issue.is-closed { opacity: .62; border-left-color: var(--green); }
.moderation-issue > div:nth-child(2) { min-width: 0; }
.moderation-issue b { font: 9px/1.4 var(--mono); color: var(--ink-2); overflow-wrap: anywhere; }
.moderation-issue p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.moderation-issue small { display: block; margin-top: 6px; color: #9aa2ae; font-size: 11px; }
.issue-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.issue-actions button { height: 25px; padding: 0 8px; display: inline-flex; align-items: center; white-space: nowrap; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 10px; font-weight: 700; }
.issue-actions button:hover { color: var(--blue); border-color: var(--blue); }
.moderation-inspector { min-width: 0; min-height: 0; overflow-y: auto; padding: 16px; background: #fff; border-left: 1px solid var(--line); }
.moderation-inspector > section { padding: 15px 0; border-bottom: 1px solid var(--line); }
.moderation-inspector > section:first-child { padding-top: 0; }
.inspector-author { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 10px; }
.inspector-author > div { min-width: 0; display: grid; gap: 3px; }
.inspector-author b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.inspector-author small { color: var(--muted); font-size: 11px; }
.inspector-meta { display: grid; gap: 10px; }
.inspector-meta div { display: flex; justify-content: space-between; gap: 10px; }
.inspector-meta span { color: var(--muted); font-size: 11px; }
.inspector-meta b { max-width: 150px; color: var(--ink-2); font: 9px/1.4 var(--mono); text-align: right; overflow-wrap: anywhere; }
.ai-check-placeholder { padding: 13px !important; border: 1px dashed var(--violet) !important; background: #faf7fd; }
.ai-check-placeholder header { display: flex; align-items: center; gap: 10px; color: var(--violet); }
.ai-check-placeholder p { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.inspector-chat h3, .moderation-actions h3 { margin-top: 5px; color: var(--navy); font-size: 16px; }
.inspector-chat__messages { margin-top: 12px; max-height: 250px; }
.inspector-chat__form { margin-top: 10px; display: grid; gap: 7px; }
.inspector-chat__form textarea { min-height: 68px; padding: 9px; resize: vertical; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; }
.moderation-actions > div { margin-top: 11px; display: grid; gap: 8px; }
.moderation-empty { grid-column: 2 / -1; min-height: 0; display: grid; place-items: center; }
.publish-summary { padding: 14px; display: grid; gap: 5px; border: 1px solid var(--line); background: var(--surface-2); }
.publish-summary b { color: var(--navy); font-size: 12px; }
.publish-summary small { color: var(--muted); line-height: 1.5; }

/* --------------------------------------------------------------------------
   Internal workspace shell and project overview
   -------------------------------------------------------------------------- */
.workspace-shell { height: 100vh; display: grid; grid-template-columns: 248px minmax(0,1fr); background: var(--surface-2); }
.workspace-backdrop { display: none; }
.workspace-sidebar { min-height: 0; display: flex; flex-direction: column; background: var(--navy); color: #fff; overflow: hidden; position: relative; z-index: 40; }
.workspace-brand { height: 66px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgb(255 255 255 / .09); }
.workspace-brand > a { display: flex; align-items: center; gap: 10px; }
.workspace-brand__shape { width: 29px; height: 29px; display: block; position: relative; }
.workspace-brand__shape i { position: absolute; display: block; background: #fff; }
.workspace-brand__shape i:first-child { width: 19px; height: 19px; left: 0; top: 0; }
.workspace-brand__shape i:last-child { width: 15px; height: 15px; right: 0; bottom: 0; background: var(--sky); }
.workspace-brand b { display: block; font-size: 13px; letter-spacing: -.02em; }
.workspace-brand small { display: block; color: #91a7d1; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.workspace-sidebar__close { display: none; }
.workspace-main-nav { padding: 13px 10px; display: grid; gap: 3px; border-bottom: 1px solid rgb(255 255 255 / .08); }
.workspace-nav-item { min-height: 39px; padding: 0 10px; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: 9px; align-items: center; border-radius: 6px; color: #aebddd; font-size: 11px; }
.workspace-nav-item:hover { background: rgb(255 255 255 / .06); color: #fff; }
.workspace-nav-item.is-active { background: #fff; color: var(--navy); font-weight: 750; }
.workspace-nav-item > i { min-width: 20px; padding: 3px 5px; border-radius: 99px; background: rgb(255 255 255 / .09); color: inherit; font-style: normal; font-size: 11px; text-align: center; }
.workspace-nav-item.is-active > i { background: var(--blue-pale); color: var(--blue); }
.workspace-sidebar-section { min-height: 0; padding: 14px 10px 4px; display: flex; flex-direction: column; }
.workspace-sidebar-section > header { min-height: 26px; padding: 0 7px; display: flex; align-items: center; justify-content: space-between; color: #8298c2; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.workspace-sidebar-section > header button { color: #91a7d1; }
.project-nav-list, .dm-nav-list { display: grid; gap: 3px; }
.project-nav-item, .dm-nav-item { min-height: 50px; padding: 7px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 8px; align-items: center; border-radius: 6px; color: #b9c7e2; }
.project-nav-item:hover, .dm-nav-item:hover, .project-nav-item.is-active, .dm-nav-item.is-active { background: rgb(255 255 255 / .07); color: #fff; }
.project-nav-item > span:nth-child(2), .dm-nav-item > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.project-nav-item b, .dm-nav-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.project-nav-item small, .dm-nav-item small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #8da1c8; font-size: 11px; }
.project-symbol { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; background: #d9e4f7; color: var(--blue); font-size: 11px; font-weight: 900; }
.project-symbol--1 { background: #dce9fb; color: #245aa6; }
.project-symbol--2 { background: var(--violet-soft); color: #68428b; }
.project-symbol--3 { background: var(--orange-soft); color: #9c4b13; }
.project-symbol--4 { background: var(--green-soft); color: #276e4f; }
.project-symbol--5 { background: var(--yellow-soft); color: #765e0a; }
.project-symbol--large { width: 52px; height: 52px; border-radius: 10px; font-size: 18px; }
.pulse-count { width: 19px; height: 19px; display: grid; place-items: center; border-radius: 50%; background: var(--violet); color: #fff; font-style: normal; font-size: 11px; box-shadow: 0 0 0 4px rgb(117 83 154 / .18); }
.sidebar-empty { padding: 9px; color: #7087b5; font-size: 11px; }
.workspace-sidebar-section--dm { flex: 1; min-height: 110px; overflow-y: auto; }
.workspace-user { min-height: 67px; margin-top: auto; padding: 11px 13px; display: grid; grid-template-columns: 35px minmax(0,1fr) auto; gap: 8px; align-items: center; border-top: 1px solid rgb(255 255 255 / .09); background: rgb(0 0 0 / .08); }
.workspace-user > span { min-width: 0; display: grid; gap: 3px; }
.workspace-user b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.workspace-user small { color: #8fa3c9; font-size: 11px; }
.workspace-user button { color: #91a7d1; }
.workspace-stage { min-width: 0; min-height: 0; display: grid; grid-template-rows: 58px minmax(0,1fr); }
.workspace-topbar { padding: 0 18px; display: grid; grid-template-columns: minmax(200px,1fr) minmax(220px, 480px) minmax(200px,1fr); align-items: center; gap: 20px; background: #fff; border-bottom: 1px solid var(--line); }
.workspace-topbar__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.workspace-topbar__left > div { min-width: 0; display: grid; gap: 2px; }
.workspace-topbar__left small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.workspace-topbar__left b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 12px; }
.workspace-menu-button { display: none; }
.workspace-global-search { min-height: 34px; padding: 0 9px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.workspace-global-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: 12px; }
.workspace-global-search kbd { padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: #8a93a2; font: 7px var(--mono); }
.workspace-topbar__actions { justify-self: end; display: flex; align-items: center; gap: 7px; }
.notification-dot { position: absolute; right: 7px; top: 7px; width: 6px; height: 6px; border: 1px solid #fff; border-radius: 50%; background: var(--orange); }
.workspace-content { min-width: 0; min-height: 0; overflow-y: auto; }
.workspace-welcome { min-height: 188px; padding: 30px clamp(25px, 3.5vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--navy); color: #fff; overflow: hidden; position: relative; }
.workspace-welcome h1 { margin-top: 7px; font-size: clamp(34px, 4vw, 48px); line-height: .98; letter-spacing: -.05em; }
.workspace-welcome h1 em { color: #82c6ea; font-style: normal; font-weight: 450; }
.workspace-welcome p:not(.eyebrow) { margin-top: 11px; max-width: 620px; color: #b9c9e7; font-size: 13px; line-height: 1.5; }
.welcome-orbit { width: 155px; height: 155px; flex: 0 0 auto; position: relative; }
.welcome-orbit i { position: absolute; inset: 50%; border: 1px solid rgb(255 255 255 / .16); border-radius: 50%; transform: translate(-50%,-50%); }
.welcome-orbit i:nth-child(1) { width: 56px; height: 56px; }
.welcome-orbit i:nth-child(2) { width: 100px; height: 100px; }
.welcome-orbit i:nth-child(3) { width: 148px; height: 148px; border-color: rgb(36 159 216 / .28); }
.welcome-orbit span { position: absolute; inset: 50%; width: 48px; height: 48px; display: grid; place-items: center; transform: translate(-50%,-50%); border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 10px rgb(36 159 216 / .1); }
.workspace-metrics { margin: -15px clamp(20px, 3.2vw, 44px) 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; position: relative; z-index: 2; }
.workspace-metrics article { min-height: 78px; padding: 12px 14px; display: grid; grid-template-columns: 36px 1fr; gap: 11px; align-items: center; background: #fff; border: 1px solid var(--line); margin-right: -1px; box-shadow: var(--shadow-sm); }
.workspace-metrics article > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-pale); color: var(--blue); }
.workspace-metrics strong { display: block; color: var(--navy); font-size: 22px; line-height: 1; }
.workspace-metrics small { color: var(--muted); font-size: 11px; }
.workspace-metrics article > i { grid-column: 2; margin-top: -8px; color: var(--green); font-style: normal; font-size: 11px; }
.workspace-dashboard-grid { padding: 24px clamp(20px, 3.2vw, 44px) 42px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.workspace-panel-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.workspace-panel-heading h2 { margin-top: 4px; color: var(--navy); font-size: 24px; letter-spacing: -.035em; }
.workspace-panel-heading > div > p:last-child { margin-top: 6px; color: var(--muted); font-size: 11px; }
.project-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.workspace-project-card { min-height: 188px; padding: 16px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); transition: .18s; }
.workspace-project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--blue-soft); }
.workspace-project-card > header { display: flex; align-items: center; justify-content: space-between; }
.project-card-menu { color: var(--muted); }
.workspace-project-card h3 { margin-top: 12px; color: var(--navy); font-size: 17px; }
.workspace-project-card > p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.project-progress { margin-top: auto; display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: center; }
.project-progress > span { height: 4px; overflow: hidden; background: var(--surface-3); }
.project-progress > span i { display: block; height: 100%; background: var(--blue); }
.project-progress small { color: var(--muted); font-size: 11px; }
.workspace-project-card footer { margin-top: 12px; padding-top: 10px; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.workspace-project-card footer > span { display: flex; align-items: center; gap: 5px; }
.workspace-project-card footer .agent-live { margin-left: auto; color: var(--violet); }
.dashboard-activity { background: #fff; border: 1px solid var(--line); }
.dashboard-activity > header { padding: 17px; border-bottom: 1px solid var(--line); }
.dashboard-activity h2 { margin-top: 4px; color: var(--navy); font-size: 21px; }
.dashboard-activity > a { min-height: 72px; padding: 12px 15px; display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.dashboard-activity > a:hover { background: var(--surface-2); }
.dashboard-activity > a > div { min-width: 0; display: grid; gap: 4px; }
.dashboard-activity b { color: var(--ink-2); font-size: 12px; }
.dashboard-activity small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.quick-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 7px; }
.quick-icon--violet { background: #f2ebf8; color: var(--violet); }
.quick-icon--orange { background: #fff1e8; color: var(--orange); }
.quick-icon--blue { background: var(--blue-pale); color: var(--blue); }
.dashboard-tip { margin: 15px; padding: 14px; display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: var(--navy); color: #c5d3ec; }
.dashboard-tip > span { font: 8px var(--mono); color: #7fc7ec; }
.dashboard-tip p { font-size: 11px; line-height: 1.55; }
.dashboard-tip b { color: #fff; }

.project-header { background: #fff; border-bottom: 1px solid var(--line); }
.project-header__top { padding: 24px clamp(20px, 3.4vw, 48px) 19px; display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.project-title { min-width: 0; display: flex; align-items: flex-start; gap: 14px; }
.project-title > div { min-width: 0; }
.project-title__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font: 8px var(--mono); }
.visibility-chip { padding: 4px 6px; display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-family: var(--font); }
.project-title h1 { margin-top: 6px; color: var(--navy); font-size: 28px; letter-spacing: -.042em; }
.project-title p { margin-top: 6px; max-width: 680px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.project-header__people { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; }
.project-tabs { padding: 0 clamp(20px, 3.4vw, 48px); display: flex; gap: 2px; overflow-x: auto; }
.project-tabs a { min-height: 43px; padding: 0 13px; display: flex; align-items: center; gap: 7px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; white-space: nowrap; }
.project-tabs a:hover { color: var(--blue); }
.project-tabs a.is-active { border-color: var(--blue); color: var(--blue); font-weight: 800; }
.project-tabs a i { padding: 2px 5px; border-radius: 99px; background: var(--surface-2); font-style: normal; font-size: 11px; }
.project-tab-content { padding: 24px clamp(20px, 3.4vw, 48px) 50px; }
.project-overview-grid { display: grid; grid-template-columns: minmax(0,1fr) 285px; gap: 18px; align-items: start; }
.project-overview-main, .project-overview-side { display: grid; gap: 15px; }
.overview-summary-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.overview-summary-cards article { min-height: 95px; padding: 14px; display: grid; grid-template-columns: 38px 1fr; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); }
.metric-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 7px; }
.metric-icon--blue { background: var(--blue-pale); color: var(--blue); }
.metric-icon--green { background: #eaf6ef; color: var(--green); }
.metric-icon--orange { background: #fff1e8; color: var(--orange); }
.metric-icon--violet { background: #f2ebf8; color: var(--violet); }
.overview-summary-cards strong { display: block; color: var(--navy); font-size: 20px; }
.overview-summary-cards small { color: var(--muted); font-size: 11px; }
.overview-summary-cards a { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; color: var(--blue); font-size: 11px; font-weight: 700; }
.overview-card { padding: 17px; background: #fff; border: 1px solid var(--line); }
.overview-card > header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.overview-card h2 { margin-top: 4px; color: var(--navy); font-size: 17px; }
.overview-card header > strong { color: var(--blue); font-size: 26px; }
.overview-card header > a { color: var(--blue); font-size: 11px; font-weight: 700; }
.big-progress { height: 7px; overflow: hidden; background: var(--surface-3); }
.big-progress i { display: block; height: 100%; background: linear-gradient(90deg,var(--blue),var(--sky)); }
.status-breakdown { margin: 13px 0; display: flex; flex-wrap: wrap; gap: 9px; }
.status-breakdown span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.status-breakdown b { color: var(--ink-2); }
.task-dot { width: 7px; height: 7px; display: inline-block; flex: 0 0 auto; border-radius: 50%; background: var(--muted); }
.task-dot--backlog { background: #98a2b3; }
.task-dot--ready { background: var(--blue); }
.task-dot--in_progress { background: var(--orange); }
.task-dot--review { background: var(--violet); }
.task-dot--done { background: var(--green); }
.overview-task-list { border-top: 1px solid var(--line); }
.overview-task-list a { min-height: 48px; display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 9px; align-items: center; border-bottom: 1px solid var(--line); }
.overview-task-list a > div { min-width: 0; display: grid; gap: 4px; }
.overview-task-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.overview-task-list small { color: var(--muted); font-size: 11px; }
.compact-commit-list { display: grid; }
.compact-commit-list a { min-height: 51px; display: grid; grid-template-columns: 28px minmax(0,1fr) auto; gap: 9px; align-items: center; border-top: 1px solid var(--line); }
.compact-commit-list a > div { min-width: 0; display: grid; gap: 4px; }
.compact-commit-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.compact-commit-list small { color: var(--muted); font-size: 11px; }
.compact-commit-list code { color: var(--blue); font-size: 11px; }
.commit-node { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.commit-node.is-head { background: var(--blue-pale); color: var(--blue); }
.team-card > div { display: grid; }
.team-card article { min-height: 47px; display: grid; grid-template-columns: 35px minmax(0,1fr) 8px; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.team-card article > span { min-width: 0; display: grid; gap: 3px; }
.team-card article b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.team-card article small { color: var(--muted); font-size: 11px; }
.activity-message { padding: 9px 0; display: grid; grid-template-columns: 35px minmax(0,1fr); gap: 8px; border-top: 1px solid var(--line); }
.activity-message > div { min-width: 0; }
.activity-message b { color: var(--ink-2); font-size: 11px; }
.activity-message p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.activity-message small { color: #a0a7b1; font-size: 11px; }
.agent-mini-card { min-height: 210px; background: var(--violet); color: #fff; border: 0; overflow: hidden; position: relative; }
.agent-mini-card__art { position: absolute; right: -18px; top: -24px; width: 120px; height: 120px; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / .16); border-radius: 50%; color: #fff; }
.agent-mini-card h3 { margin-top: 23px; max-width: 190px; font-size: 19px; line-height: 1.15; }
.agent-mini-card > p:not(.eyebrow) { margin: 9px 0 17px; max-width: 215px; color: #e0d6ea; font-size: 11px; line-height: 1.5; }
.inline-empty { padding: 19px 0; color: var(--muted); font-size: 11px; text-align: center; }

/* --------------------------------------------------------------------------
   Repository
   -------------------------------------------------------------------------- */
.repository-toolbar { min-height: 53px; padding: 8px 11px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-bottom: 0; }
.branch-select { min-height: 34px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); font-size: 11px; }
.branch-select select { max-width: 120px; border: 0; outline: 0; color: inherit; font-weight: 700; }
.repo-path { min-width: 0; display: flex; align-items: center; gap: 5px; overflow: hidden; color: var(--muted); font: 8px var(--mono); }
.repo-path span { color: var(--blue); font-weight: 800; }
.repo-path b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.repo-toolbar-actions { display: flex; gap: 7px; }
.repository-layout { min-height: 590px; display: grid; grid-template-columns: 225px minmax(0,1fr) 260px; border: 1px solid var(--line); background: #fff; }
.repo-tree-pane, .repo-history-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #fbfcfd; }
.repo-tree-pane { border-right: 1px solid var(--line); }
.repo-history-pane { border-left: 1px solid var(--line); }
.repo-tree-pane > header, .repo-history-pane > header { min-height: 42px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.repo-tree-pane header b, .repo-history-pane header b { color: var(--ink-2); font-size: 11px; }
.repo-tree-pane header span, .repo-history-pane header span { color: var(--muted); font-size: 11px; }
.repo-tree, .repo-commit-list { min-height: 0; overflow-y: auto; }
.repo-tree-folder > div { min-height: 34px; padding-left: calc(9px + var(--depth,0) * 13px); display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.repo-tree-file { width: 100%; min-height: 36px; padding: 0 8px 0 calc(9px + var(--depth,0) * 13px); display: grid; grid-template-columns: 17px minmax(0,1fr) auto; gap: 6px; align-items: center; text-align: left; color: var(--ink-2); }
.repo-tree-file:hover, .repo-tree-file.is-active { background: var(--blue-pale); color: var(--blue); }
.repo-tree-file span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 8px var(--mono); }
.repo-tree-file small { color: var(--muted); font-size: 11px; }
.repo-editor-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.file-editor-head { min-height: 42px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.file-editor-head > div { min-width: 0; display: flex; align-items: center; gap: 8px; }
.file-editor-head b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 9px var(--mono); color: var(--ink-2); }
.file-editor-head span { color: var(--muted); font-size: 11px; }
.code-view { min-width: 0; min-height: 548px; display: grid; grid-template-columns: auto minmax(0,1fr); overflow: auto; background: #fbfcfe; }
.line-numbers { padding: 15px 9px; display: grid; align-content: start; gap: 0; background: #f0f2f5; border-right: 1px solid var(--line); color: #9aa2af; font: 9px/1.65 var(--mono); text-align: right; user-select: none; }
.code-view pre { min-width: max-content; padding: 15px; color: #26364e; font: 9px/1.65 var(--mono); white-space: pre; }
.code-editor { width: 100%; min-height: 548px; padding: 15px; resize: vertical; border: 0; outline: 0; background: #fbfcfe; color: #26364e; font: 10px/1.65 var(--mono); tab-size: 2; }
.repo-commit-list > a { min-height: 70px; padding: 10px 8px; display: grid; grid-template-columns: 18px minmax(0,1fr); gap: 7px; border-bottom: 1px solid var(--line); }
.repo-commit-list > a:hover, .repo-commit-list > a.is-active { background: var(--blue-pale); }
.history-node { display: grid; justify-items: center; position: relative; }
.history-node::after { content: ""; width: 1px; background: var(--line-dark); position: absolute; top: 14px; bottom: -55px; }
.repo-commit-list > a:last-child .history-node::after { display: none; }
.history-node i { width: 8px; height: 8px; margin-top: 4px; border: 2px solid #fff; border-radius: 50%; background: #98a2b3; box-shadow: 0 0 0 1px #98a2b3; position: relative; z-index: 1; }
.history-node.is-head i { background: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.repo-commit-list a > div { min-width: 0; display: grid; align-content: start; gap: 5px; }
.repo-commit-list b { color: var(--ink-2); font-size: 11px; line-height: 1.35; }
.repo-commit-list small { color: var(--muted); font-size: 11px; }
.repo-commit-list code { color: var(--blue); font-size: 11px; }
.commit-detail-head { padding: 13px; border-bottom: 1px solid var(--line); background: #fff; }
.commit-detail-head h3 { color: var(--navy); font-size: 14px; line-height: 1.35; }
.commit-detail-head p { margin-top: 5px; color: var(--muted); font-size: 11px; }
.diff-view { overflow: auto; background: #fcfcfd; }
.diff-view pre { min-width: max-content; padding: 14px; color: #344054; font: 9px/1.6 var(--mono); white-space: pre; }

/* --------------------------------------------------------------------------
   Kanban, chat, board and agents
   -------------------------------------------------------------------------- */
.kanban-toolbar, .board-toolbar, .agents-toolbar { margin-bottom: 13px; display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.kanban-toolbar h2, .board-toolbar h2, .agents-toolbar h2 { margin-top: 4px; color: var(--navy); font-size: 23px; }
.kanban-toolbar > div > p:last-child, .board-toolbar > div > p:last-child, .agents-toolbar > div > p:last-child { margin-top: 6px; color: var(--muted); font-size: 11px; }
.kanban-hint, .board-help { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.kanban-board { display: grid; grid-template-columns: repeat(5, minmax(215px,1fr)); gap: 10px; overflow-x: auto; padding-bottom: 10px; }
.kanban-column { min-height: 520px; display: flex; flex-direction: column; background: #eef0f4; border-top: 3px solid var(--muted); }
.kanban-column[data-status="ready"] { border-top-color: var(--blue); }
.kanban-column[data-status="in_progress"] { border-top-color: var(--orange); }
.kanban-column[data-status="review"] { border-top-color: var(--violet); }
.kanban-column[data-status="done"] { border-top-color: var(--green); }
.kanban-column > header { min-height: 48px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; }
.kanban-column header > div { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.kanban-column header i { min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 99px; background: #fff; color: var(--muted); font-style: normal; font-size: 11px; }
.kanban-dropzone { min-height: 460px; padding: 0 8px 9px; display: grid; align-content: start; gap: 8px; border: 1px dashed transparent; }
.kanban-dropzone.is-over { background: var(--blue-pale); border-color: var(--blue); }
.kanban-card { min-height: 126px; padding: 12px; background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 2px rgb(16 24 40 / .04); cursor: grab; }
.kanban-card:hover { border-color: var(--blue-soft); box-shadow: var(--shadow-sm); }
.kanban-card.is-dragging { opacity: .48; transform: rotate(1deg); }
.kanban-card__top { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
/* Имена классов совпадают со значениями приоритета: low | medium | high | critical. */
.priority { padding: 3px 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.priority--low { background: var(--surface-2); color: var(--muted); }
.priority--medium { background: var(--blue-pale); color: var(--blue); }
.priority--high { background: #fff1e8; color: #a8430d; }
.priority--critical { background: #fdeaf0; color: var(--red); }
.kanban-card h3 { margin-top: 11px; color: var(--ink-2); font-size: 11px; line-height: 1.4; }
.kanban-card > p { margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.kanban-card footer { margin-top: 13px; padding-top: 9px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.kanban-column-empty { padding: 18px 10px; color: #9aa2af; font-size: 11px; text-align: center; }

.project-chat-layout { min-height: 585px; display: grid; grid-template-columns: minmax(0,1fr) 270px; background: #fff; border: 1px solid var(--line); }
.project-chat-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: 51px minmax(0,1fr) auto; }
.project-chat-main > header, .dm-chat > header { padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.chat-channel-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 7px; background: var(--blue-pale); color: var(--blue); }
.project-chat-main > header > div, .dm-chat > header > div { display: flex; align-items: center; gap: 9px; }
.project-chat-main h2, .dm-chat h2 { color: var(--navy); font-size: 14px; }
.project-chat-messages { padding: 18px; max-height: 500px; }
.chat-day { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.chat-day::before, .chat-day::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.workspace-message { display: grid; grid-template-columns: 35px minmax(0,1fr); gap: 10px; align-items: start; }
.workspace-message > div { min-width: 0; }
.workspace-message header { display: flex; align-items: center; gap: 7px; }
.workspace-message b { color: var(--ink-2); font-size: 11px; }
.workspace-message time { color: var(--muted); font-size: 11px; }
.workspace-message p { margin-top: 5px; color: #3d4758; font-size: 11px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.project-chat-composer { padding: 12px 16px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; border-top: 1px solid var(--line); }
.project-chat-composer textarea { min-height: 44px; max-height: 130px; padding: 11px; resize: vertical; border: 1px solid var(--line); border-radius: 7px; outline: 0; font-size: 11px; }
.project-chat-composer textarea:focus { border-color: var(--blue); }
.project-chat-info, .dm-info { padding: 17px; border-left: 1px solid var(--line); background: #fbfcfd; }
.project-chat-info h3, .dm-info h3 { margin-top: 5px; color: var(--navy); font-size: 15px; }
.project-chat-info > p:not(.eyebrow), .dm-info > p:not(.eyebrow) { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.chat-context-note { margin-top: 18px; padding: 13px; display: flex; gap: 9px; background: var(--blue-pale); color: var(--blue); }
.chat-context-note p { color: var(--muted); font-size: 11px; line-height: 1.5; }
.chat-context-note b { color: var(--navy); }

.board-toolbar { align-items: center; }
.board-legend { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.tone-dot { width: 9px; height: 9px; display: inline-block; border-radius: 50%; }
.tone-dot--yellow { background: var(--yellow); }
.tone-dot--blue { background: var(--sky); }
.tone-dot--green { background: var(--green); }
.idea-board { height: 610px; overflow: hidden; border: 1px solid var(--line); background-color: #f8f9fb; background-image: radial-gradient(#cbd2dd 1px, transparent 1px); background-size: 18px 18px; position: relative; }
.board-note { width: 220px; min-height: 125px; padding: 13px; position: absolute; left: calc(var(--x,0) * 1px); top: calc(var(--y,0) * 1px); background: var(--yellow-soft); border: 1px solid rgb(170 132 0 / .18); box-shadow: 0 7px 18px rgb(15 45 105 / .08); cursor: grab; user-select: none; }
.board-note[data-tone="blue"] { background: #dceafa; border-color: #9bbce6; }
.board-note[data-tone="green"] { background: #e1f0e7; border-color: #a2d1b9; }
.board-note[data-tone="violet"] { background: #eee6f4; border-color: #c7b0da; }
.board-note.is-dragging { cursor: grabbing; z-index: 10; box-shadow: var(--shadow-lg); }
.board-note header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.board-note header span { font: 7px var(--mono); color: rgb(0 0 0 / .45); }
.board-note p { margin-top: 13px; color: #263342; font-size: 11px; line-height: 1.48; white-space: pre-wrap; }
.board-note footer { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; color: rgb(0 0 0 / .45); font-size: 11px; }
.tone-picker { display: flex; gap: 7px; }
.tone-picker label { cursor: pointer; }
.tone-picker input { position: absolute; opacity: 0; }
.tone-picker span { width: 26px; height: 26px; display: block; border: 3px solid #fff; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 1px var(--line); }
.tone-picker label:nth-child(2) span { background: var(--sky); }
.tone-picker label:nth-child(3) span { background: var(--green); }
.tone-picker label:nth-child(4) span { background: var(--violet); }
.tone-picker input:checked + span { box-shadow: 0 0 0 2px var(--navy); }

.agents-layout { display: grid; grid-template-columns: minmax(0,1fr) 315px; gap: 15px; align-items: start; }
.agent-run-form, .agent-run-list, .agent-run-detail, .agent-context-panel { background: #fff; border: 1px solid var(--line); }
.agent-run-form { padding: 19px; }
.agent-run-form > header { margin-bottom: 17px; }
.agent-run-form h2, .agent-run-list h2, .agent-run-detail h2 { margin-top: 5px; color: var(--navy); font-size: 18px; }
.agent-form-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; }
.agent-form-grid .field--full { grid-column: 1 / -1; }
.agent-library-picker { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.agent-library-picker > section { padding: 13px; border: 1px solid var(--line); background: var(--surface-2); }
.agent-library-picker header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.agent-library-picker h3 { color: var(--ink-2); font-size: 11px; }
.agent-library-picker small { color: var(--muted); font-size: 11px; }
.agent-safety-line { grid-column: 1 / -1; padding: 11px; display: flex; gap: 9px; background: #eff8f3; color: #287154; font-size: 11px; line-height: 1.45; }
.agent-context-panel { padding: 15px; }
.agent-context-panel h3 { margin-top: 5px; color: var(--navy); font-size: 16px; }
.agent-context-stat { margin-top: 12px; display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.agent-context-stat div { padding: 10px; background: var(--surface-2); }
.agent-context-stat b { display: block; color: var(--navy); font-size: 16px; }
.agent-context-stat small { color: var(--muted); font-size: 11px; }
.agent-context-note { margin-top: 12px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.agent-run-list { margin-top: 15px; }
.agent-run-list > header { padding: 14px 17px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.agent-run-list > div { display: grid; }
.agent-run-list article, .agent-run-list a { min-height: 70px; padding: 12px 16px; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.agent-run-list article:hover, .agent-run-list a:hover { background: var(--surface-2); }
.agent-run-list article > div, .agent-run-list a > div { min-width: 0; display: grid; gap: 4px; }
.agent-run-list b { color: var(--ink-2); font-size: 11px; }
.agent-run-list p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.agent-run-list small { color: #9aa2ae; font-size: 11px; }
.run-status { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.run-status--running { background: #f2ebf8; color: var(--violet); }
.run-status--completed { background: #eaf6ef; color: var(--green); }
.run-status--failed { background: #fdeaf0; color: var(--red); }
.agent-spinner { animation: spin 1s linear infinite; }
.agent-run-detail { min-height: 470px; }
.agent-run-detail > header { padding: 17px; border-bottom: 1px solid var(--line); }
.agent-run-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 11px; }
.agent-run-body { padding: 17px; display: grid; gap: 13px; }
.agent-terminal { max-height: 250px; overflow: auto; padding: 13px; background: #101c35; color: #b9d3c6; font: 8px/1.65 var(--mono); white-space: pre-wrap; }
.agent-result { padding: 14px; background: var(--surface-2); border-left: 3px solid var(--green); }
.agent-result h3 { color: var(--navy); font-size: 12px; }
.agent-result p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.agent-working { min-height: 250px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.agent-live { color: var(--violet); }
.agent-error { padding: 13px; background: #fdeaf0; color: var(--red); font-size: 11px; line-height: 1.5; }

/* --------------------------------------------------------------------------
   DMs, project settings, shared library and administration
   -------------------------------------------------------------------------- */
.dm-page { min-height: calc(100vh - 58px); padding: 24px clamp(20px, 3.4vw, 48px); }
.dm-page > header { margin-bottom: 14px; }
.dm-page h1 { margin-top: 4px; color: var(--navy); font-size: 28px; }
.dm-chat { min-height: 600px; display: grid; grid-template-columns: minmax(0,1fr) 260px; grid-template-rows: 52px minmax(0,1fr) auto; background: #fff; border: 1px solid var(--line); }
.dm-chat > header { grid-column: 1; }
.dm-messages { grid-column: 1; padding: 18px; max-height: 490px; }
.dm-chat .project-chat-composer { grid-column: 1; }
.dm-info { grid-column: 2; grid-row: 1 / -1; }
.member-picker { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.member-picker label { padding: 8px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); cursor: pointer; }
.member-picker label:hover { background: var(--surface-2); }
.member-picker span { display: grid; gap: 2px; }
.member-picker b { color: var(--ink-2); font-size: 11px; }
.member-picker small { color: var(--muted); font-size: 11px; }

.project-settings-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 16px; align-items: start; }
.project-settings-main, .project-settings-side { display: grid; gap: 14px; }
.settings-form-card { padding: 18px; background: #fff; border: 1px solid var(--line); }
.settings-form-card > header { margin-bottom: 2px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.settings-form-card h2 { margin-top: 5px; color: var(--navy); font-size: 18px; }
.member-table { background: #fff; border: 1px solid var(--line); }
.member-table__head, .member-table > article { display: grid; grid-template-columns: minmax(220px,1fr) 150px 120px; gap: 12px; align-items: center; }
.member-table__head { padding: 10px 13px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.member-table > article { min-height: 62px; padding: 10px 13px; border-top: 1px solid var(--line); }
.member-table article > div:first-child { min-width: 0; display: flex; align-items: center; gap: 9px; }
.member-table article span { min-width: 0; display: grid; gap: 3px; }
.member-table b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.member-table small { color: var(--muted); font-size: 11px; }
.profile-security, .settings-warning { padding: 14px; display: flex; align-items: flex-start; gap: 9px; background: #fff8ed; border: 1px solid #f0cea1; color: #885019; }
.profile-security p, .settings-warning p { font-size: 11px; line-height: 1.5; }

.library-hero { min-height: 220px; padding: 34px clamp(20px, 3.5vw, 52px); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: var(--navy); color: #fff; }
.library-hero h1 { margin-top: 7px; font-size: clamp(35px,4vw,55px); letter-spacing: -.055em; }
.library-hero > div > p:not(.eyebrow) { margin-top: 12px; max-width: 630px; color: #aebfe0; font-size: 11px; line-height: 1.6; }
.library-hero__stats { display: grid; grid-template-columns: repeat(3,90px); gap: 1px; }
.library-hero__stats div { min-height: 85px; padding: 12px; display: grid; align-content: center; background: rgb(255 255 255 / .07); border: 1px solid rgb(255 255 255 / .12); }
.library-hero__stats strong { font-size: 24px; }
.library-hero__stats small { margin-top: 5px; color: #95aad2; font-size: 11px; }
.library-layout { padding: 24px clamp(20px, 3.5vw, 52px) 50px; display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 19px; align-items: start; }
.library-main, .library-layout > aside { display: grid; gap: 17px; }
.library-section { padding: 18px; background: #fff; border: 1px solid var(--line); }
.library-section > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 14px; }
.library-section h2 { margin-top: 4px; color: var(--navy); font-size: 19px; }
.library-card-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.library-card { min-height: 165px; padding: 14px; display: flex; flex-direction: column; border: 1px solid var(--line); background: #fff; }
.library-card:hover { border-color: var(--blue-soft); box-shadow: var(--shadow-sm); }
.library-card--skill { border-top: 3px solid var(--violet); }
.library-card__top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.library-card h3 { margin-top: 16px; color: var(--navy); font-size: 14px; }
.library-card > p { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.library-card footer { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.profile-card { padding: 16px; background: #fff; border: 1px solid var(--line); }
.profile-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-card h3 { margin-top: 5px; color: var(--navy); font-size: 16px; }
.profile-provider { margin-top: 12px; padding: 12px; background: var(--surface-2); }
.profile-provider b { display: block; color: var(--ink-2); font-size: 11px; }
.profile-provider small { display: block; margin-top: 4px; color: var(--muted); font: 7px var(--mono); }

.admin-header { padding: 25px clamp(20px, 3.5vw, 52px) 0; background: #fff; border-bottom: 1px solid var(--line); }
.admin-header > div:first-child { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.admin-header h1 { margin-top: 5px; color: var(--navy); font-size: 32px; letter-spacing: -.045em; }
.admin-header > div:first-child > p, .admin-header > div:first-child > div > p:last-child { margin-top: 7px; color: var(--muted); font-size: 11px; }
.admin-tabs { margin-top: 23px; display: flex; gap: 3px; overflow-x: auto; }
.admin-tabs a { min-height: 43px; padding: 0 14px; display: flex; align-items: center; gap: 7px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; white-space: nowrap; }
.admin-tabs a.is-active { border-color: var(--blue); color: var(--blue); font-weight: 800; }
.admin-content { padding: 24px clamp(20px, 3.5vw, 52px) 52px; }
.admin-summary-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 9px; margin-bottom: 18px; }
.admin-summary-cards article { min-height: 90px; padding: 14px; display: flex; align-items: center; gap: 11px; background: #fff; border: 1px solid var(--line); }
.admin-summary-cards strong { display: block; color: var(--navy); font-size: 21px; }
.admin-summary-cards small { color: var(--muted); font-size: 11px; }
.pending-users { margin-bottom: 18px; }
.pending-users > header, .admin-table-card > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.pending-users h2, .admin-table-card h2, .sections-admin h2 { margin-top: 4px; color: var(--navy); font-size: 20px; }
.pending-user-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.user-decision-card { padding: 15px; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 10px; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--orange); }
.user-decision-card > div { min-width: 0; display: grid; gap: 4px; }
.user-decision-card b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.user-decision-card small { color: var(--muted); font-size: 11px; }
.user-decision-card p { grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.45; }
.user-decision-card footer { grid-column: 1 / -1; display: flex; gap: 7px; }
.admin-table-card { padding: 17px; background: #fff; border: 1px solid var(--line); }
.table-search { min-height: 35px; padding: 0 9px; display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface-2); }
.table-search input { border: 0; outline: 0; background: transparent; font-size: 11px; }
.admin-user-table { overflow-x: auto; }
.admin-user-table__head, .admin-user-table > article { min-width: 1010px; display: grid; grid-template-columns: 46px minmax(170px,1.2fr) minmax(130px,1fr) 108px 140px 84px 104px 150px; gap: 11px; align-items: center; }
.admin-user-table__actions { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.admin-user-table__actions .button { justify-content: center; }
.admin-user-table__head { min-height: 36px; padding: 0 8px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.admin-user-table > article { min-height: 62px; padding: 8px; border-bottom: 1px solid var(--line); }
.admin-user-table article > div,
.admin-user-table > article > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.admin-user-table b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.admin-user-table small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.admin-user-table select { width: 100%; max-width: none; min-height: 31px; padding: 0 7px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 11px; }
.admin-settings-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
.admin-settings-grid > form { padding: 19px; display: grid; gap: 16px; background: #fff; border: 1px solid var(--line); }
.admin-settings-side { display: grid; gap: 11px; }
.admin-settings-side > section { padding: 15px; background: #fff; border: 1px solid var(--line); }
.admin-settings-side h3 { margin-top: 5px; color: var(--navy); font-size: 15px; }
.admin-settings-side p { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.admin-settings-side a { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 11px; font-weight: 700; }
.mini-profile { min-height: 44px; margin-top: 8px; padding-top: 8px; display: grid; grid-template-columns: 29px minmax(0,1fr) 8px; gap: 8px; align-items: center; border-top: 1px solid var(--line); }
.mini-profile > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; background: var(--violet-soft); color: var(--violet); font-size: 11px; font-weight: 800; }
.mini-profile > div { min-width: 0; display: grid; gap: 3px; }
.mini-profile b { color: var(--ink-2); font-size: 11px; }
.mini-profile small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 7px var(--mono); }
.settings-separator { margin: 4px 0 0; display: flex; align-items: center; gap: 10px; color: var(--navy); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.settings-separator::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.setting-status { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.sections-admin > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-admin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 11px; }
.section-admin-card { min-height: 260px; display: grid; grid-template-rows: 105px 1fr; background: #fff; border: 1px solid var(--line); }
.section-admin-card.is-disabled { opacity: .58; }
.section-admin-card__visual { overflow: hidden; background: var(--blue); color: #fff; position: relative; }
.section-admin-card__visual--2 { background: var(--violet); }
.section-admin-card__visual--3 { background: var(--green); }
.section-admin-card__visual--4 { background: var(--orange); }
.section-admin-card__visual span { position: absolute; left: 14px; top: 13px; font: 8px var(--mono); }
.section-admin-card__visual i { position: absolute; width: 95px; height: 95px; border: 18px solid rgb(255 255 255 / .17); border-radius: 50%; }
.section-admin-card__visual i:nth-child(2) { right: -25px; top: -25px; }
.section-admin-card__visual i:nth-child(3) { right: 55px; bottom: -67px; }
.section-admin-card > div:last-child { padding: 14px; }
.section-admin-card h3 { margin-top: 10px; color: var(--navy); font-size: 16px; }
.section-admin-card code { display: block; margin-top: 5px; color: var(--blue); font-size: 11px; }
.section-admin-card p { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.section-admin-card footer { margin-top: 13px; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.section-admin-card footer button { display: flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 700; }
.logs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.log-card { min-width: 0; padding: 17px; background: #fff; border: 1px solid var(--line); }
.log-card > header { margin-bottom: 11px; }
.log-card h2 { margin-top: 4px; color: var(--navy); font-size: 18px; }
.audit-list, .mail-log-list { display: grid; }
.audit-list article, .mail-log-list article { min-height: 61px; padding: 9px 0; display: grid; grid-template-columns: 31px minmax(0,1fr) auto; gap: 9px; align-items: center; border-top: 1px solid var(--line); }
.audit-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 6px; background: var(--blue-pale); color: var(--blue); }
.audit-list article > div, .mail-log-list article > div { min-width: 0; display: grid; gap: 3px; }
.audit-list b, .mail-log-list b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.audit-list small, .mail-log-list small { color: var(--muted); font-size: 11px; }
.audit-list code { color: var(--blue); font-size: 11px; }
.mail-status { padding: 4px 6px; border-radius: 99px; background: #eaf6ef; color: var(--green); font-size: 11px; font-weight: 800; }

/* --------------------------------------------------------------------------
   Shared empty/error/loading states
   -------------------------------------------------------------------------- */
.empty-state { min-height: 210px; padding: 30px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-state__icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 50%; background: var(--blue-pale); color: var(--blue); }
.empty-state h2, .empty-state h3 { margin-top: 14px; color: var(--navy); font-size: 18px; }
.empty-state p { margin-top: 7px; max-width: 360px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.empty-state .button { margin-top: 17px; }
.route-loading, .fatal-error, .error-page { min-height: 100vh; display: grid; place-items: center; align-content: center; padding: 30px; text-align: center; background: var(--surface-2); }
.route-loading__mark { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; }
.route-loading > div { margin-top: 18px; display: flex; gap: 5px; }
.route-loading > div i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); animation: loadingDots 1s infinite ease-in-out; }
.route-loading > div i:nth-child(2) { animation-delay: .15s; }
.route-loading > div i:nth-child(3) { animation-delay: .3s; }
.route-loading p { margin-top: 9px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.fatal-error span, .error-page > span { color: var(--red); }
.fatal-error h1, .error-page h1 { margin-top: 15px; color: var(--navy); font-size: 31px; }
.fatal-error p, .error-page p { margin: 10px auto 19px; max-width: 480px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.error-code { color: var(--blue); font: 10px var(--mono); }
.skeleton-stack { display: grid; gap: 8px; }
.skeleton-row { height: 44px; background: linear-gradient(90deg,var(--surface-2),#fff,var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

/* --------------------------------------------------------------------------
   Responsive behavior
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .cabinet-stats { grid-template-columns: repeat(4,1fr); }
  .cabinet-profile-card { grid-column: 1 / -1; }
  .moderation-layout { grid-template-columns: 270px minmax(0,1fr); }
  .moderation-inspector { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; border-left: 0; border-top: 1px solid var(--line); }
  .moderation-inspector > section { border-bottom: 0; border-right: 1px solid var(--line); padding: 0 14px 0 0; }
  .moderation-inspector > section:last-child { border-right: 0; }
  .moderation-layout { overflow-y: auto; }
  .moderation-queue { position: sticky; top: 0; height: calc(100vh - 58px); }
  .moderation-review { overflow: visible; }
  .repository-layout { grid-template-columns: 210px minmax(0,1fr); }
  .repo-history-pane { grid-column: 1 / -1; min-height: 240px; border-left: 0; border-top: 1px solid var(--line); }
  .repo-commit-list { display: grid; grid-template-columns: repeat(3,1fr); }
  .repo-commit-list > a { border-right: 1px solid var(--line); }
  .history-node::after { display: none; }
  .workspace-dashboard-grid, .project-overview-grid { grid-template-columns: minmax(0,1fr) 260px; }
  .pending-user-grid, .section-admin-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 960px) {
  body[data-mode="workspace"] { overflow: auto; }
  .workspace-shell { grid-template-columns: 1fr; }
  .workspace-sidebar { width: min(330px, 88vw); position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .workspace-menu-open .workspace-sidebar { transform: translateX(0); }
  .workspace-backdrop { display: none; position: fixed; z-index: 35; inset: 0; background: rgb(8 20 49 / .55); }
  .workspace-menu-open .workspace-backdrop { display: block; }
  .workspace-sidebar__close, .workspace-menu-button { display: inline-grid; }
  .workspace-stage { height: 100vh; }
  .workspace-topbar { grid-template-columns: 1fr auto; }
  .workspace-global-search { display: none; }
  .workspace-welcome { min-height: 235px; }
  .workspace-metrics { grid-template-columns: repeat(2,1fr); }
  .workspace-dashboard-grid, .project-overview-grid, .agents-layout, .library-layout, .admin-settings-grid, .project-settings-layout { grid-template-columns: 1fr; }
  .dashboard-activity, .project-overview-side, .agents-layout > aside, .library-layout > aside, .admin-settings-side, .project-settings-side { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; background: transparent; border: 0; }
  .dashboard-activity > header { grid-column: 1 / -1; background: #fff; border: 1px solid var(--line); }
  .dashboard-activity > a, .dashboard-tip { margin: 0; background-color: #fff; border: 1px solid var(--line); }
  .dashboard-tip { background: var(--navy); }
  .project-overview-side > *, .agents-layout > aside > *, .library-layout > aside > *, .admin-settings-side > *, .project-settings-side > * { min-width: 0; }
  .submission-detail-grid { grid-template-columns: 1fr; }
  .submission-side-column { grid-template-columns: repeat(2,1fr); }
  .about-hero__diagram { grid-template-columns: 1fr; }
  .about-hero__diagram > svg { transform: rotate(90deg); justify-self: center; }
  .principle-grid { grid-template-columns: repeat(2,1fr); }
  .about-roadmap { grid-template-columns: 1fr; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-filters__sticky { position: static; }
  .auth-page { grid-template-columns: 1fr; }
  .moderation-layout { grid-template-columns: 240px minmax(0,1fr); }
  .moderation-topbar { grid-template-columns: auto 1fr auto; }
  .moderation-topbar__title b { display: none; }
  .review-browser { grid-template-columns: 190px minmax(0,1fr); }
  .logs-grid { grid-template-columns: 1fr; }
  .admin-summary-cards { grid-template-columns: repeat(2,1fr); }
  .project-chat-layout { grid-template-columns: 1fr; }
  .project-chat-info { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 720px) {
  body[data-mode="moderation"] { overflow: auto; }
  .public-header { height: 70px; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding-inline: 16px; }
  .wordmark { min-width: 0; }
  .public-header__actions { min-width: 0; gap: 6px; }
  .public-header__actions > .text-link { display: none; }
  .public-header__actions .button--compact { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; }
  .public-header__actions .button--compact > span { display: none; }
  .public-nav { display: none; }
  .public-nav.is-open { position: absolute; top: 100%; left: 0; right: 0; height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 7px 16px 14px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
  .public-nav.is-open a { height: 44px; padding-inline: 4px; border-bottom: 1px solid var(--line); }
  .public-nav.is-open a:last-child { border-bottom: 0; }
  .public-nav.is-open a::after { display: none; }
  .mobile-menu { width: 40px; height: 40px; display: inline-grid; flex: 0 0 40px; place-items: center; }
  .hero { min-height: auto; max-width: 100%; padding: 54px 20px 44px; grid-template-columns: minmax(0,1fr); overflow: hidden; }
  .hero__content { padding: 0; }
  .hero__side { display: none; }
  .hero__content h1 { font-size: clamp(44px,14vw,64px); }
  .hero-search { margin-top: 22px; }
  .section-block { padding: 46px 20px; }
  .section-block--latest { display: block; }
  .section-block--latest .section-heading { margin-bottom: 26px; }
  .category-grid, .material-grid, .principle-grid { grid-template-columns: minmax(0,1fr); }
  .category-card { min-height: 230px; }
  .material-card { min-width: 0; max-width: 100%; }
  .material-grid--home > .material-card:only-child { min-height: 340px; display: flex; }
  .workflow-section { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); overflow: hidden; }
  .workflow-intro { width: 100%; min-width: 0; position: static; padding: 46px 20px 38px; border-right: 0; border-bottom: 1px solid rgb(255 255 255 / .12); }
  .workflow-intro h2 { overflow-wrap: anywhere; }
  .workflow-steps { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); }
  .workflow-steps li { width: 100%; min-width: 0; min-height: 170px; padding: 24px 20px; border-right: 0; }
  .lab-teaser { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); overflow: hidden; }
  .lab-teaser__art, .lab-teaser__content { min-width: 0; max-width: 100%; overflow: hidden; }
  .lab-teaser__art { min-height: 280px; }
  .lab-teaser__content { padding: 44px 20px; }
  .public-footer { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); gap: 34px; padding: 44px 20px 22px; }
  .public-footer__brand, .public-footer__links, .public-footer__bottom { width: 100%; min-width: 0; }
  .public-footer__links { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 28px; }
  .public-footer__bottom { grid-column: 1; display: grid; justify-content: stretch; gap: 8px; }
  .catalog-hero { padding-inline: 20px; }
  .catalog-results { padding: 20px; }
  .item-head, .item-content { padding-inline: 20px; }
  .item-head { grid-template-columns: 1fr; }
  .public-file-grid { grid-template-columns: 1fr; }
  .public-file-list { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-form-panel { min-height: 100vh; padding: 50px 20px; }
  .about-hero, .about-principles, .about-roadmap > div { padding-inline: 20px; }
  .about-hero h1 { font-size: clamp(50px,16vw,78px); }
  .cabinet-head { padding: 50px 20px 38px; display: grid; }
  .cabinet-stats { margin: 0; padding: 16px 20px 0; transform: none; grid-template-columns: repeat(2,1fr); }
  .cabinet-stats > article { min-height: 90px; }
  .cabinet-profile-card { grid-column: 1 / -1; }
  .cabinet-content { padding: 28px 20px 20px; }
  .submission-list__head { display: none; }
  .submission-row { grid-template-columns: minmax(0,1fr) auto; gap: 9px; }
  .submission-row__owner, .submission-row__meta { grid-column: 1; margin-left: 58px; }
  .submission-row .status { grid-column: 2; grid-row: 1; align-self: start; }
  .submission-row__arrow { grid-column: 2; grid-row: 2 / span 2; align-self: center; }
  .cabinet-guide { margin: 0 20px 45px; display: grid; }
  .submission-detail-head { padding: 30px 20px; display: grid; }
  .submission-head-actions { padding-top: 0; }
  .status-timeline { overflow-x: auto; padding-bottom: 8px; }
  .status-timeline > span { min-width: 105px; }
  .submission-detail-grid { padding: 20px; }
  .submission-side-column { grid-template-columns: 1fr; }
  .moderation-shell { height: auto; min-height: 100vh; display: block; }
  .moderation-topbar { height: 58px; position: sticky; top: 0; z-index: 20; }
  .moderation-topbar__right > span, .moderation-topbar__right .text-link { display: none; }
  .moderation-layout { display: block; }
  .moderation-queue { position: static; height: auto; max-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .moderation-review { overflow: visible; }
  .review-titlebar { padding: 16px; }
  .review-browser { margin: 12px; grid-template-columns: 1fr; }
  .review-files { max-height: 210px; border-right: 0; border-bottom: 1px solid var(--line); }
  .moderation-inspector { display: block; padding: 16px; }
  .moderation-inspector > section { padding: 15px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .moderation-empty { min-height: 500px; }
  .workspace-welcome { min-height: 170px; padding: 28px 20px; }
  .welcome-orbit { display: none; }
  .workspace-metrics { margin-inline: 12px; grid-template-columns: 1fr 1fr; }
  .workspace-dashboard-grid, .project-tab-content, .dm-page, .library-layout, .admin-content { padding-inline: 14px; }
  .project-card-grid, .overview-summary-cards, .library-card-grid, .pending-user-grid, .section-admin-grid { grid-template-columns: 1fr; }
  .dashboard-activity, .project-overview-side, .agents-layout > aside, .library-layout > aside, .admin-settings-side, .project-settings-side { grid-template-columns: 1fr; }
  .project-header__top { padding-inline: 16px; align-items: flex-start; }
  .project-header__people > span, .project-header__people .avatar-stack { display: none; }
  .project-tabs { padding-inline: 7px; }
  .repository-toolbar { grid-template-columns: 1fr auto; }
  .repo-path { grid-column: 1 / -1; grid-row: 2; }
  .repo-toolbar-actions .button--secondary { min-height: 34px; padding-inline: 10px; }
  .repository-layout { grid-template-columns: 1fr; }
  .repo-tree-pane { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .repo-history-pane { grid-column: auto; }
  .repo-commit-list { grid-template-columns: 1fr; }
  .kanban-board { margin-right: -14px; }
  .kanban-toolbar, .board-toolbar, .agents-toolbar { align-items: flex-start; flex-direction: column; }
  .project-chat-layout { min-height: 520px; }
  .project-chat-info { display: none; }
  .dm-chat { grid-template-columns: 1fr; }
  .dm-info { display: none; }
  .dm-chat > header, .dm-messages, .dm-chat .project-chat-composer { grid-column: 1; }
  .agent-form-grid, .agent-library-picker { grid-template-columns: 1fr; }
  .agent-form-grid .field--full, .agent-library-picker, .agent-safety-line { grid-column: 1; }
  .library-hero { padding: 32px 20px; display: grid; }
  .library-hero__stats { grid-template-columns: repeat(3,1fr); }
  .admin-header { padding-inline: 16px; }
  .admin-summary-cards { grid-template-columns: 1fr 1fr; }
  .member-table__head { display: none; }
  .member-table > article { grid-template-columns: 1fr auto; }
  .member-table > article > *:nth-child(3) { grid-column: 1 / -1; }
  .logs-grid { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .wordmark small, .header-user > span { display: none; }
  .wordmark strong { font-size: 16px; }
  .wordmark__shape { width: 34px; height: 34px; }
  .hero__actions, .submission-head-actions { display: grid; }
  .hero__actions .button, .submission-head-actions .button { width: 100%; }
  .cabinet-stats, .admin-summary-cards { grid-template-columns: 1fr; }
  .workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row--two { display: grid; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
  .submission-row .status { display: none; }
  .submission-row__arrow { grid-column: 2; grid-row: 1 / -1; }
  .workspace-topbar { padding-inline: 10px; }
  .workspace-topbar__actions .icon-button { display: none; }
  .project-header__people { display: none; }
  .project-title h1 { font-size: 23px; }
  .library-hero__stats { grid-template-columns: 1fr; }
  .public-footer__links { grid-template-columns: 1fr; }
}

/* Researcher cabinet and file-chat workflow */
.nav-alert { min-width: 20px; height: 20px; display: inline-grid; place-items: center; margin-left: 5px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-style: normal; line-height: 1; }
.mobile-menu__badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid #fff; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-style: normal; font-weight: 800; line-height: 1; }
.cabinet-page--simple { max-width: 1440px; margin: 0 auto; padding-bottom: 54px; }
.cabinet-head--simple { padding-bottom: 34px; }
.cabinet-dialog-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: 20px; padding: 0 34px; }
.cabinet-dialog-grid .cabinet-content { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.cabinet-dialog-grid .panel-heading { min-height: 80px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-count { min-width: 30px; height: 30px; display: grid; place-items: center; border-radius: 15px; background: var(--blue-pale); color: var(--blue); font-size: 12px; font-weight: 800; }
.submission-list--dialogs .submission-row { grid-template-columns: auto minmax(0,1fr) auto auto auto; padding: 14px 18px; }
.researcher-thread-list { display: grid; }
.researcher-thread-list > a { min-height: 68px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.researcher-thread-list > a:last-child { border-bottom: 0; }
.researcher-thread-list > a:hover { background: var(--blue-pale); }
.researcher-thread-list span { min-width: 0; display: grid; gap: 4px; }
.researcher-thread-list b, .researcher-thread-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.researcher-thread-list small, .researcher-thread-list time { color: var(--muted); font-size: 12px; }

.send-files-page, .researcher-dm-page { max-width: 1080px; min-height: 70vh; margin: 0 auto; padding: 24px 28px 64px; }
.send-files-card, .researcher-dm-card { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.send-files-card > header { padding: 30px 34px 20px; }
.send-files-card > header h1 { margin: 6px 0 8px; font-size: clamp(30px,4vw,48px); color: var(--navy); }
.send-files-card > header p:last-child { color: var(--muted); }
.send-files-card form { padding: 0 34px 34px; }
.send-files-drop { min-height: 230px; display: grid; place-items: center; align-content: center; gap: 8px; border: 2px dashed var(--line-dark); border-radius: var(--radius); color: var(--blue); background: var(--blue-pale); cursor: pointer; transition: .18s ease; }
.send-files-drop input, .send-files-more input, .composer-file input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.send-files-drop > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); }
.send-files-drop b { font-size: 18px; }
.send-files-drop small { color: var(--muted); }
.send-files-drop:hover, .send-files-drop.is-dragging { border-color: var(--blue); background: #e5edfa; }
.send-files-drop.is-compact { min-height: 78px; margin-bottom: 14px; grid-template-columns: auto auto; }
.send-files-drop.is-compact > span { width: 34px; height: 34px; }
.send-files-drop.is-compact small { display: none; }
.send-files-ready { display: grid; gap: 14px; }
.send-file-list { display: grid; gap: 7px; }
.send-file-list article { min-height: 56px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; }
.send-file-list article span { min-width: 0; display: grid; gap: 3px; }
.send-file-list article b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-file-list article small { color: var(--muted); }
.send-files-more, .composer-file, .composer-anonymous { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); font-size: 13px; font-weight: 700; cursor: pointer; }
.send-files-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 6px; }
.send-files-actions > span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }

.researcher-chat-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; padding: 18px 34px 50px; }
.researcher-chat-card { min-height: 620px; display: grid; grid-template-rows: auto minmax(320px,1fr) auto; }
.submission-detail-head--compact { padding-bottom: 24px; }
.chat-composer--files { display: grid; }
.chat-composer--files > div { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.chat-composer--files .composer-file { margin-right: auto; }
.composer-anonymous { color: var(--muted); font-weight: 600; }
.chat-attachments { display: grid; gap: 7px; margin-top: 10px; }
.chat-attachment { width: min(100%, 380px); min-height: 54px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 11px; text-align: left; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; background: #fff; }
.chat-attachment:hover { box-shadow: var(--shadow-sm); }
.chat-attachment span { min-width: 0; display: grid; gap: 3px; }
.chat-attachment b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-attachment small { color: var(--muted); font-size: 11px; }
.chat-attachment--safe { border-left-color: var(--green); }
.chat-attachment--pending { border-left-color: var(--yellow); }
.chat-attachment--issues { border-left-color: var(--red); }
.attachment-status { width: 10px; height: 10px; display: inline-block; border-radius: 50%; background: var(--muted-2); }
.attachment-status--safe { background: var(--green); }
.attachment-status--pending { background: var(--yellow); }
.attachment-status--issues { background: var(--red); }
.dialog-file-list { display: grid; gap: 8px; }
.dialog-file-list .chat-attachment { width: 100%; }
.legacy-archive-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; }
.legacy-archive-card span { min-width: 0; display: grid; gap: 3px; }
.legacy-archive-card small, .side-muted { color: var(--muted); font-size: 12px; }

.researcher-dm-card { min-height: 650px; display: grid; grid-template-rows: auto 1fr auto; }
.researcher-dm-card > header { min-height: 82px; display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.researcher-dm-card > header h1 { font-size: 21px; }
.researcher-dm-card > header p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.researcher-dm-card > header > div:nth-child(2) { min-width: 0; flex: 1; }
.researcher-dm-card > header > .icon-button { flex: 0 0 auto; color: var(--muted); }
.researcher-dm-card > header > .icon-button:hover { color: var(--red); background: #fff1f4; }
.researcher-dm-card .submission-chat { max-height: none; padding: 22px 24px; }
.researcher-dm-card .chat-composer { margin: 0; border-top: 1px solid var(--line); }

.moderation-file-section { margin: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.moderation-file-section > header { margin-bottom: 12px; }
.moderation-file-section h3 { margin-top: 3px; }
.moderation-file-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.moderation-file-grid .chat-attachment { width: 100%; }
.attachment-analysis-panel { padding: 16px !important; background: #fffaf3; border: 1px solid var(--orange-soft) !important; border-radius: 8px; }
.attachment-analysis-panel header { display: flex; align-items: center; gap: 9px; }
.attachment-analysis-panel header div { display: grid; gap: 3px; }
.attachment-analysis-panel header small { color: var(--muted); }
.attachment-analysis-panel p { margin: 12px 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; }

@media (max-width: 900px) {
  .cabinet-dialog-grid, .researcher-chat-layout { grid-template-columns: 1fr; }
  .cabinet-dialog-grid { padding-inline: 20px; }
  .researcher-chat-layout { padding-inline: 20px; }
  .moderation-file-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .send-files-page, .researcher-dm-page { padding: 18px 16px 44px; }
  .send-files-card > header, .send-files-card form { padding-inline: 18px; }
  .send-files-actions { align-items: stretch; flex-direction: column; }
  .send-files-actions .button { width: 100%; }
  .submission-list--dialogs .submission-row { grid-template-columns: auto minmax(0,1fr) auto; }
  .submission-list--dialogs .submission-row__meta { display: none; }
  .chat-composer--files > div { flex-wrap: wrap; }
}

/* Shared file system */
.files-workspace-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 32px 34px 24px; }
.files-workspace-head h1 { margin: 5px 0 7px; color: var(--navy); font-size: clamp(30px,4vw,44px); }
.files-workspace-head p:last-child { max-width: 680px; color: var(--muted); line-height: 1.5; }
.files-category-tabs { display: flex; gap: 5px; padding: 0 34px 14px; overflow-x: auto; }
.files-category-tabs a { flex: 0 0 auto; min-height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; }
.files-category-tabs a.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.files-manager { margin: 0 34px 40px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); overflow: hidden; }
.files-manager-toolbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.files-manager-toolbar > label, .files-manager-toolbar > div { display: flex; align-items: center; gap: 9px; }
.files-manager-toolbar > label { color: var(--muted); font-size: 12px; font-weight: 700; }
.files-table__head, .files-table article { display: grid; grid-template-columns: 28px minmax(230px,1.5fr) minmax(130px,.7fr) minmax(140px,.8fr) 90px 120px 64px; align-items: center; gap: 12px; padding: 0 16px; }
.files-table__head { min-height: 36px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.files-table article { min-height: 64px; border-top: 1px solid var(--line); font-size: 12px; }
.files-table article:hover { background: var(--blue-pale); }
.files-name { min-width: 0; display: flex; align-items: center; gap: 9px; }
.files-name > span { min-width: 0; display: grid; gap: 3px; }
.files-name b, .files-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files-name small { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.files-row-actions { display: flex; gap: 4px; }
.files-row-actions a, .files-row-actions button { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); }
.files-row-actions a:hover, .files-row-actions button:hover { background: #fff; color: var(--blue); }

@media (max-width: 1000px) {
  .files-table { overflow-x: auto; }
  .files-table__head, .files-table article { min-width: 950px; }
}
@media (max-width: 620px) {
  .files-workspace-head { align-items: stretch; flex-direction: column; padding: 24px 16px 18px; }
  .files-category-tabs { padding-inline: 16px; }
  .files-manager { margin-inline: 14px; }
  .files-manager-toolbar { align-items: stretch; flex-direction: column; }
  .files-manager-toolbar > div { flex-wrap: wrap; }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes loadingDots { 0%,80%,100% { transform: scale(.6); opacity: .45; } 40% { transform: scale(1); opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* Compact LANS interface */
.avatar--photo { overflow: hidden; background: var(--surface-3); }
.avatar--photo img { width: 100%; height: 100%; object-fit: cover; }
.public-header { height: 60px; grid-template-columns: 1fr auto 1fr; padding-inline: clamp(18px, 3.5vw, 48px); }
.wordmark { gap: 9px; }
.wordmark__shape { width: 31px; height: 31px; }
.wordmark__shape i { border-width: 3px; }
.wordmark__shape i:last-child { width: 17px; height: 17px; }
.wordmark strong { font-size: 17px; letter-spacing: .05em; }
.public-footer--compact { min-height: 48px; padding: 14px clamp(18px, 3.5vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 20px; color: #b9c7e2; font-size: 11px; }
.public-footer--compact a { color: #fff; font-weight: 700; }
.catalog-layout { gap: 20px; padding: 20px clamp(18px, 3.5vw, 48px) 38px; }
.catalog-results { padding: 0; }
.catalog-filters__sticky { top: 14px; }
.results-heading { margin: 16px 0 12px; }

.workspace-shell { grid-template-columns: 236px minmax(0,1fr); }
.workspace-brand { height: 58px; }
.workspace-brand b { font-size: 14px; letter-spacing: .08em; }
.workspace-sidebar-section--projects { flex: 1; overflow: hidden; }
.workspace-sidebar-section--projects > header > div { display: flex; gap: 8px; }
.workspace-sidebar-section--projects [data-toggle-projects] svg { transform: rotate(-90deg); transition: transform .16s ease; }
.workspace-sidebar-section--projects.is-collapsed [data-toggle-projects] svg { transform: rotate(90deg); }
.workspace-sidebar-section--projects.is-collapsed .project-nav-list { display: none; }
.project-nav-list { min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.workspace-user { grid-template-columns: minmax(0,1fr) auto; }
.workspace-user__account { min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 8px; align-items: center; }
.workspace-user__account > span:last-child { min-width: 0; display: grid; gap: 3px; }
.workspace-user__account b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-stage { grid-template-rows: 50px minmax(0,1fr); }
.workspace-topbar { grid-template-columns: minmax(0, 680px); justify-content: center; gap: 10px; padding: 7px 18px; }
.workspace-global-search { width: 100%; min-height: 34px; display: flex; }
.workspace-global-search button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 5px; color: var(--blue); }
.workspace-global-search button:hover { background: var(--blue-pale); }
.compact-page-head { min-height: 64px; padding: 16px clamp(18px, 3vw, 34px); display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: #fff; }
.compact-page-head h1 { color: var(--navy); font-size: clamp(22px, 2.5vw, 30px); letter-spacing: -.04em; }
.compact-page-head p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.compact-counts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.compact-counts span { padding: 5px 8px; border-radius: 99px; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 700; }
.workspace-metrics { margin: 14px clamp(18px, 3vw, 34px) 0; gap: 8px; }
.workspace-metrics article { min-height: 64px; padding: 10px 12px; box-shadow: none; border-radius: var(--radius-sm); }
.workspace-metrics strong { font-size: 20px; }
.dashboard-projects--full { padding: 14px clamp(18px, 3vw, 34px) 32px; }
.dashboard-projects--full .project-card-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
.workspace-project-card { min-height: 146px; padding: 13px; display: flex; position: relative; }
.workspace-project-card:hover { transform: translateY(-1px); }
.workspace-project-card > a { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.workspace-project-card > a h3 { margin-top: 11px; color: var(--navy); font-size: 15px; }
.workspace-project-card > a p { margin-top: 6px; min-height: 32px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.workspace-project-card > a footer { margin-top: auto; padding-top: 9px; flex-wrap: wrap; gap: 9px; font-size: 11px; }
.project-select { width: 26px; height: 26px; cursor: pointer; }
.project-select input { position: absolute; opacity: 0; pointer-events: none; }
.project-select span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 5px; color: transparent; background: #fff; }
.project-select input:checked + span { border-color: var(--blue); background: var(--blue); color: #fff; }
.project-selection-bar { position: sticky; z-index: 8; bottom: 14px; max-width: 520px; margin: 14px auto 0; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line-dark); border-radius: 8px; background: #fff; box-shadow: var(--shadow-md); color: var(--ink-2); font-size: 12px; font-weight: 700; }

.messages-index, .workspace-search-results { margin: 16px clamp(18px, 3vw, 34px) 36px; border: 1px solid var(--line); background: #fff; }
.messages-index > a { min-height: 66px; padding: 10px 14px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto 20px; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.messages-index > a:hover, .workspace-search-results > a:hover { background: var(--blue-pale); }
.messages-index > a > span { min-width: 0; display: grid; gap: 5px; }
.messages-index b, .messages-index small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages-index b { color: var(--ink-2); font-size: 12px; }
.messages-index small, .messages-index time { color: var(--muted); font-size: 11px; }
.workspace-search-results > a { min-height: 74px; padding: 10px 14px; display: grid; grid-template-columns: 34px minmax(0,1fr) 20px; gap: 10px; align-items: center; border-bottom: 1px solid var(--line); }
.search-result-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--blue-pale); color: var(--blue); }
.workspace-search-results > a > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.workspace-search-results b { color: var(--ink-2); font: 11px var(--mono); overflow-wrap: anywhere; }
.workspace-search-results small { color: var(--muted); font-size: 11px; }
.workspace-search-results code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font-size: 11px; }
.account-settings { max-width: 760px; margin: 18px clamp(18px, 3vw, 34px); display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 12px; align-items: start; }
.account-photo-card, .account-form { padding: 17px; border: 1px solid var(--line); background: #fff; }
.account-photo-card { display: flex; align-items: center; gap: 14px; }
.account-photo-card > div:last-child { display: grid; gap: 7px; }
.account-photo-card b { color: var(--ink-2); font-size: 12px; }
.account-photo-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.account-form { display: grid; gap: 15px; }
.account-form footer { display: flex; justify-content: flex-end; }

.library-layout { padding: 16px clamp(18px, 3vw, 34px) 34px; grid-template-columns: minmax(0,1fr) 270px; gap: 12px; }
.library-main, .library-layout > aside { gap: 12px; }
.library-section { padding: 14px; }
.library-section > header { align-items: center; margin-bottom: 11px; }
.library-section > header > div { display: flex; align-items: center; gap: 9px; }
.library-card { min-width: 0; min-height: 150px; padding: 12px; overflow: hidden; }
.library-card h3 { margin-top: 11px; }
.library-card > p { min-height: 25px; font-size: 11px; }
.library-card pre { min-width: 0; max-height: 62px; margin: 9px 0; padding: 8px; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); color: var(--ink-2); font: 9px/1.45 var(--mono); }
.library-card__top > div { min-width: 0; display: flex; gap: 4px; overflow: hidden; }
.library-card__top i { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 5px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font: 7px var(--font); }
.profile-panel { min-width: 0; padding: 14px; border: 1px solid var(--line); background: #fff; }
.profile-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-panel h2 { color: var(--navy); font-size: 17px; }
.profile-panel > div { margin-top: 11px; display: grid; gap: 8px; }
.profile-card { min-width: 0; padding: 12px; overflow: hidden; }
.profile-card > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.profile-card p { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.profile-card dl { margin: 9px 0; min-width: 0; display: grid; gap: 5px; }
.profile-card dl div { min-width: 0; display: grid; grid-template-columns: 60px minmax(0,1fr); gap: 7px; font-size: 11px; }
.profile-card dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.files-category-tabs { padding: 12px clamp(18px, 3vw, 34px) 10px; }
.files-manager { margin: 0 clamp(18px, 3vw, 34px) 32px; border-radius: 7px; }
.files-manager-toolbar { min-height: 50px; }
.files-table article { min-height: 56px; }
.legacy-file-mark { width: 8px; height: 8px; justify-self: center; border-radius: 50%; background: var(--green); }
.readonly-chip { padding: 5px 8px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; }

.admin-tabs { margin: 0; padding: 0 clamp(18px, 3vw, 34px); background: #fff; border-bottom: 1px solid var(--line); }
.admin-tabs a { min-height: 38px; }
.admin-content { padding: 14px clamp(18px, 3vw, 34px) 34px; }
.admin-summary-cards { grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 13px; }
.admin-summary-cards article { min-height: 68px; padding: 10px; }
.admin-user-table > article > span:nth-child(3) { color: var(--ink-2); font-size: 11px; line-height: 1.35; }
.admin-user-table > article time { color: var(--muted); font-size: 11px; }
.pending-user-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.pending-user-grid > article { min-width: 0; padding: 13px; display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--orange); background: #fff; }
.pending-user-grid > article > div { min-width: 0; display: grid; gap: 3px; }
.pending-user-grid > article h3 { color: var(--navy); font-size: 14px; }
.pending-user-grid > article p, .pending-user-grid > article a, .pending-user-grid > article small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.pending-user-grid > article footer { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 7px; }
.section-admin-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
.section-admin-card { min-height: 150px; display: block; }
.section-admin-card > div:last-child { padding: 14px; }

.moderation-layout--workspace { height: 100%; min-height: 0; grid-template-columns: 245px minmax(0,1fr) 320px; }
.moderation-layout--workspace .moderation-queue > header { padding: 13px; }
.moderation-layout--workspace .moderation-queue > header h1 { margin-top: 3px; color: var(--navy); font-size: 22px; }
.moderation-layout--workspace .queue-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; overflow: visible; }
.moderation-layout--workspace .queue-filters a { display: flex; justify-content: space-between; padding: 6px 7px; }
.moderation-layout--workspace .queue-item { min-height: 88px; padding: 11px; }
.moderation-layout--workspace .review-titlebar { padding: 14px 16px; }
.moderation-layout--workspace .review-titlebar h2 { margin-top: 4px; color: var(--navy); font-size: 19px; }
.moderation-layout--workspace .ai-check-placeholder { margin: 10px; padding: 10px !important; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.moderation-layout--workspace .ai-check-placeholder > div { display: flex; align-items: center; gap: 8px; }
.moderation-layout--workspace .ai-check-placeholder b, .moderation-layout--workspace .ai-check-placeholder small { display: block; }
.moderation-layout--workspace .ai-check-placeholder small { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.moderation-layout--workspace .inspector-author { display: block; }
.moderation-layout--workspace .inspector-author > .eyebrow { margin-bottom: 8px; }
.moderation-layout--workspace .inspector-author > div { display: flex; align-items: center; gap: 9px; }
.moderation-layout--workspace .inspector-author > div > span { min-width: 0; display: grid; gap: 3px; }
.moderation-layout--workspace .inspector-author > p:last-child { margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.moderation-layout--workspace .inspector-meta dl { display: grid; gap: 7px; }
.moderation-layout--workspace .inspector-meta dl div { display: grid; grid-template-columns: 72px minmax(0,1fr); gap: 8px; }
.moderation-layout--workspace .inspector-meta dt { color: var(--muted); font-size: 11px; }
.moderation-layout--workspace .inspector-meta dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font: 9px var(--mono); text-align: right; }

@media (max-width: 1120px) {
  .dashboard-projects--full .project-card-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .moderation-layout--workspace { grid-template-columns: 230px minmax(0,1fr); }
  .moderation-layout--workspace .moderation-inspector { grid-column: 2; border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .public-header { grid-template-columns: 1fr auto; }
  .public-nav { display: none; }
  .header-user { display: none; }
  .catalog-layout { grid-template-columns: 1fr; padding-inline: 14px; }
  .catalog-filters { overflow-x: auto; }
  .catalog-filters__sticky { display: flex; gap: 5px; position: static; }
  .catalog-filters .filter-title, .catalog-filters .filter-help { display: none; }
  .catalog-filters a { flex: 0 0 auto; }
  .workspace-shell { grid-template-columns: 1fr; }
  .workspace-stage { grid-template-rows: 50px minmax(0,1fr); }
  .workspace-topbar { grid-template-columns: 38px minmax(0,1fr); padding-inline: 8px; }
  .workspace-menu-button { display: grid; }
  .workspace-global-search kbd { display: none; }
  .dashboard-projects--full .project-card-grid { grid-template-columns: 1fr; }
  .workspace-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .messages-index > a { grid-template-columns: 42px minmax(0,1fr) 18px; }
  .messages-index time { display: none; }
  .account-settings, .library-layout { grid-template-columns: 1fr; }
  .library-card-grid, .pending-user-grid, .section-admin-grid { grid-template-columns: 1fr; }
  .compact-page-head { min-height: 58px; padding-inline: 14px; }
  .compact-counts { display: none; }
  .moderation-layout--workspace { height: auto; display: block; }
  .moderation-layout--workspace .moderation-queue { max-height: 310px; }
  .moderation-layout--workspace .moderation-inspector { display: block; }
}

/* --------------------------------------------------------------------------
   Conversation-first inboxes
   -------------------------------------------------------------------------- */
.dm-inbox {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  background: #fff;
}
.dm-inbox__rail {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}
.dm-inbox__rail > header {
  min-height: 72px;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.dm-inbox__rail > header > div { display: flex; align-items: baseline; gap: 8px; }
.dm-inbox__rail h1 { color: var(--navy); font-size: 20px; letter-spacing: -.03em; }
.dm-inbox__rail > header > div > span {
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.dm-new-button {
  min-height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  background: #fff;
}
.dm-new-button:hover { border-color: var(--blue); background: var(--blue-pale); }
.dm-thread-search {
  min-height: 36px;
  margin: 10px 12px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
}
.dm-thread-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .08); }
.dm-thread-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 11px; }
.dm-thread-list { min-height: 0; overflow-y: auto; padding: 0 8px 10px; }
.dm-thread-list > a {
  min-height: 72px;
  padding: 9px 8px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border-radius: 7px;
  border-left: 3px solid transparent;
}
.dm-thread-list > a:hover { background: var(--surface-2); }
.dm-thread-list > a.is-active { border-left-color: var(--blue); background: var(--blue-pale); }
.dm-thread-list > a > span:nth-child(2) { min-width: 0; display: grid; gap: 5px; }
.dm-thread-list b, .dm-thread-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dm-thread-list b { color: var(--ink-2); font-size: 11px; }
.dm-thread-list small, .dm-thread-list time { color: var(--muted); font-size: 11px; }
.dm-thread-list__empty { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.dm-thread-list__empty b { color: var(--ink-2); font-size: 12px; }
.dm-thread-list__empty span { font-size: 11px; }
.dm-conversation { min-width: 0; min-height: 0; display: grid; grid-template-rows: 72px minmax(0, 1fr) auto; background: #fff; }
.dm-conversation__head {
  padding: 0 20px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.dm-conversation__head > div:nth-child(3) { min-width: 0; display: grid; gap: 4px; }
.dm-conversation__head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 17px; letter-spacing: -.02em; }
.dm-conversation__head p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.dm-private { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.dm-conversation__messages { min-height: 0; padding: 22px clamp(18px, 3vw, 36px); display: grid; align-content: start; gap: 15px; overflow-y: auto; background: #f8fafc; }
.dm-conversation__messages .chat-day { margin: 5px 0; font-size: 11px; }
.dm-conversation__messages .workspace-message { width: min(78%, 680px); grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
.dm-conversation__messages .workspace-message > div { padding: 11px 13px; border: 1px solid var(--line); border-radius: 3px 11px 11px; background: #fff; }
.dm-conversation__messages .workspace-message--mine { margin-left: auto; }
.dm-conversation__messages .workspace-message--mine > div { border-color: #cdd9ef; background: var(--blue-pale); }
.dm-conversation__messages .workspace-message header { justify-content: space-between; }
.dm-conversation__messages .workspace-message b { font-size: 11px; }
.dm-conversation__messages .workspace-message header span { color: var(--muted); font-size: 11px; }
.dm-conversation__messages .workspace-message p { margin-top: 6px; font-size: 12px; line-height: 1.55; }
.dm-compose { padding: 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; border-top: 1px solid var(--line); background: #fff; }
.dm-compose textarea { min-height: 43px; max-height: 120px; padding: 12px 13px; resize: vertical; border: 1px solid var(--line-dark); border-radius: 8px; outline: 0; font-size: 12px; }
.dm-compose textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .08); }
.dm-compose .button { align-self: end; min-height: 43px; }
.dm-conversation--empty { place-items: center; color: var(--muted); text-align: center; background: var(--surface-2); }
.dm-conversation--empty > div { display: grid; justify-items: center; gap: 8px; }
.dm-conversation--empty h2 { color: var(--navy); font-size: 18px; }
.dm-conversation--empty p { font-size: 11px; }

/* --------------------------------------------------------------------------
   Moderation as a conversation workspace
   -------------------------------------------------------------------------- */
.moderation-inbox { height: 100%; min-height: 0; display: grid; grid-template-columns: 286px minmax(0, 1fr); background: #fff; }
.moderation-inbox .moderation-queue { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.moderation-inbox .moderation-queue > header { min-height: 72px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; }
.moderation-inbox .moderation-queue > header h1 { color: var(--navy); font-size: 20px; letter-spacing: -.03em; }
.moderation-inbox .moderation-queue > header p { margin-top: 4px; color: var(--muted); font-size: 11px; }
.moderation-inbox .moderation-queue > header > span {
  min-width: 27px;
  height: 27px;
  padding-inline: 7px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}
.moderation-inbox .queue-filters { padding: 8px 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; overflow: visible; }
.moderation-inbox .queue-filters a { min-width: 0; padding: 6px 7px; display: flex; justify-content: space-between; border-radius: 5px; }
.moderation-inbox .queue-filters a:not(.is-active):hover { background: var(--surface-2); color: var(--ink-2); }
.moderation-inbox .queue-search { margin: 9px 11px; border-radius: 7px; background: #fff; }
.moderation-inbox .queue-item { min-height: 92px; padding: 11px 12px; display: block; border-left: 3px solid transparent; }
.moderation-inbox .queue-item.is-active { border-left-color: var(--blue); }
.moderation-inbox .queue-item > div { display: grid; grid-template-columns: 9px minmax(0, 1fr); column-gap: 7px; row-gap: 4px; }
.moderation-inbox .queue-item > div .queue-status { grid-row: 1; align-self: center; }
.moderation-inbox .queue-item > div b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.moderation-inbox .queue-item > div small { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.moderation-inbox .queue-item footer { margin-top: 9px; }
.moderation-thread { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface-2); }
.moderation-thread__head { min-height: 118px; padding: 14px 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); background: #fff; }
.moderation-thread__title { min-width: 0; }
.moderation-thread__title > div:first-child { display: flex; align-items: center; gap: 8px; }
.moderation-thread__title > div:first-child > small { color: var(--muted); font-size: 11px; }
.moderation-thread__title h2 { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 19px; letter-spacing: -.025em; }
.moderation-thread__title > p { margin-top: 5px; max-width: 680px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.moderation-thread__author { margin-top: 9px; display: flex; align-items: center; gap: 8px; }
.moderation-thread__author > span { min-width: 0; display: flex; align-items: center; gap: 6px; }
.moderation-thread__author b { color: var(--ink-2); font-size: 11px; }
.moderation-thread__author small { color: var(--muted); font-size: 11px; }
.moderation-thread__tools { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 7px; }
.moderation-meta-popover { position: relative; }
.moderation-meta-popover > summary { min-height: 32px; padding: 0 9px; display: flex; align-items: center; gap: 5px; list-style: none; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.moderation-meta-popover > summary::-webkit-details-marker { display: none; }
.moderation-meta-popover[open] > summary { border-color: var(--blue); color: var(--blue); }
.moderation-meta-popover dl { width: 285px; padding: 12px; position: absolute; z-index: 10; top: 39px; right: 0; display: grid; gap: 9px; border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; box-shadow: var(--shadow-md); }
.moderation-meta-popover dl div { min-width: 0; display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; }
.moderation-meta-popover dt { color: var(--muted); font-size: 11px; }
.moderation-meta-popover dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; text-align: right; }
.moderation-thread__scroll { min-height: 0; padding: 14px; overflow-y: auto; display: grid; align-content: start; gap: 11px; }
.moderation-files-panel, .moderation-dialog-panel, .moderation-thread__scroll > .moderation-issues { margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.moderation-files-panel > header, .moderation-dialog-panel > header, .moderation-thread__scroll > .moderation-issues > header { margin-bottom: 11px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.moderation-files-panel h3, .moderation-dialog-panel h3, .moderation-thread__scroll > .moderation-issues h3 { color: var(--navy); font-size: 14px; }
.moderation-files-panel h3 span, .moderation-dialog-panel h3 + span, .moderation-thread__scroll > .moderation-issues h3 span { color: var(--blue); }
.moderation-files-panel header p { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.file-legend { width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; }
.file-legend:first-child { margin-left: 0; }
.file-legend--safe { background: var(--green); }
.file-legend--pending { background: var(--yellow); }
.file-legend--issues { background: var(--red); }
.moderation-files-panel .moderation-file-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.moderation-files-panel .chat-attachment { min-height: 50px; border-radius: 6px; }
.moderation-thread__scroll > .attachment-analysis-panel { padding: 14px !important; }
.moderation-workbench { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.moderation-workbench > summary { min-height: 46px; padding: 0 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; list-style: none; color: var(--navy); font-size: 11px; font-weight: 800; cursor: pointer; }
.moderation-workbench > summary::-webkit-details-marker { display: none; }
.moderation-workbench > summary small { color: var(--muted); font-size: 11px; font-weight: 500; }
.moderation-workbench[open] > summary > svg:last-child { transform: rotate(90deg); }
.moderation-workbench .review-browser { margin: 0; min-height: 360px; border: 0; border-top: 1px solid var(--line); }
.moderation-dialog-panel > header > div { display: flex; align-items: center; gap: 7px; }
.moderation-dialog-panel > header > div > span { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: 99px; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 800; }
.moderation-dialog-panel > header > small { color: var(--muted); font-size: 11px; }
.moderation-chat-messages { min-height: 180px; display: grid; align-content: start; gap: 13px; }
.moderation-chat-messages .chat-message { width: min(82%, 680px); }
.moderation-chat-messages .chat-message--mine { margin-left: auto; }
.chat-message--mine > div { border-color: #cdd9ef; background: var(--blue-pale); }
.moderation-chat-messages .chat-message > div { padding: 11px 13px; border: 1px solid var(--line); }
.moderation-chat-messages .chat-message b { font-size: 11px; }
.moderation-chat-messages .chat-message header span { font-size: 11px; }
.moderation-chat-messages .chat-message p { font-size: 12px; }
.moderation-thread__scroll > .moderation-issues .moderation-issue-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.moderation-issues__empty { padding: 12px; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-size: 11px; text-align: center; }
.moderation-thread__dock { padding: 10px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; align-items: end; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 24px rgb(18 42 89 / .04); }
.moderation-thread__dock .chat-composer { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.moderation-thread__dock .chat-composer textarea { min-height: 40px; max-height: 96px; font-size: 11px; }
.moderation-thread__dock .chat-composer > div { grid-column: 2; align-self: end; display: flex; flex-wrap: nowrap; gap: 8px; }
.moderation-thread__dock .composer-file, .moderation-thread__dock .composer-anonymous { font-size: 11px; white-space: nowrap; }
.moderation-decision-bar { display: flex; align-items: center; justify-content: flex-start; gap: 6px; }
.moderation-decision-bar .text-danger { padding: 7px; font-size: 11px; }

@media (max-width: 1100px) {
  .moderation-inbox { grid-template-columns: 250px minmax(0, 1fr); }
  .moderation-files-panel .moderation-file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moderation-thread__dock { grid-template-columns: 1fr; }
  .moderation-decision-bar { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .dm-inbox { height: auto; min-height: calc(100vh - 50px); display: block; }
  .dm-inbox__rail { max-height: 270px; border-right: 0; border-bottom: 1px solid var(--line); }
  .dm-inbox__rail > header { min-height: 58px; }
  .dm-thread-list { max-height: 142px; }
  .dm-conversation { min-height: 560px; grid-template-rows: 62px minmax(0, 1fr) auto; }
  .dm-conversation__head { padding-inline: 12px; }
  .dm-private span, .dm-private { font-size: 0; }
  .dm-conversation__messages { padding: 15px 12px; }
  .dm-conversation__messages .workspace-message { width: 94%; }
  .dm-compose { padding: 9px; }
  .dm-compose .button { min-width: 44px; padding-inline: 11px; font-size: 0; }
  .moderation-inbox { height: auto; min-height: calc(100vh - 50px); display: block; }
  .moderation-inbox .moderation-queue { max-height: 330px; border-right: 0; border-bottom: 1px solid var(--line); }
  .moderation-inbox .queue-items { max-height: 150px; }
  .moderation-thread { min-height: 720px; display: block; }
  .moderation-thread__head { min-height: 0; padding: 13px; }
  .moderation-thread__title h2 { white-space: normal; font-size: 17px; }
  .moderation-thread__title > p { display: none; }
  .moderation-thread__author small { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .moderation-meta-popover > summary span { display: none; }
  .moderation-meta-popover dl { width: min(285px, calc(100vw - 28px)); }
  .moderation-thread__scroll { padding: 9px; overflow: visible; }
  .moderation-files-panel .moderation-file-grid, .moderation-thread__scroll > .moderation-issues .moderation-issue-list { grid-template-columns: 1fr; }
  .moderation-dialog-panel > header > small { display: none; }
  .moderation-chat-messages .chat-message { width: 96%; }
  .moderation-thread__dock { position: static; padding: 10px; }
  .moderation-thread__dock .chat-composer { grid-template-columns: 1fr; }
  .moderation-thread__dock .chat-composer > div { grid-column: 1; flex-wrap: wrap; }
  .moderation-decision-bar { flex-wrap: wrap; }
}

/* --------------------------------------------------------------------------
   Responsive workspace, shared conversations, canvas board and agent tasks
   -------------------------------------------------------------------------- */
.project-chat-layout.unified-chat {
  min-height: 0;
  display: block;
  padding: 14px clamp(14px, 2vw, 24px) 24px;
  border: 0;
  background: var(--surface-2);
}
.unified-chat .project-chat-main {
  height: min(680px, calc(100vh - 180px));
  min-height: 500px;
  grid-template-rows: 58px minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.project-chat-messages,
.dm-conversation__messages,
.moderation-chat-messages {
  min-height: 0;
  padding: 20px clamp(14px, 3vw, 34px);
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  background: #f8fafc;
}
.project-chat-messages .chat-message,
.dm-conversation__messages .chat-message,
.moderation-chat-messages .chat-message {
  width: min(82%, 680px);
}
.project-chat-messages .chat-message--mine,
.dm-conversation__messages .chat-message--mine,
.moderation-chat-messages .chat-message--mine { margin-left: auto; }
.chat-message > div { border: 1px solid var(--line); background: #fff; }
.chat-message--mine > div { border-color: #cdd9ef; background: var(--blue-pale); }
.chat-attachment--plain { border-left: 3px solid var(--blue); color: var(--ink-2); }
.unified-chat-composer {
  min-width: 0;
  margin: 0;
  padding: 10px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.unified-chat-composer textarea {
  min-height: 42px;
  max-height: 110px;
  font-size: 12px;
}
.unified-chat-composer > div {
  grid-column: 2;
  align-self: end;
  flex-wrap: nowrap;
  gap: 7px;
}
.unified-chat-composer .composer-file { white-space: nowrap; }
.dm-conversation__actions { display: flex; align-items: center; gap: 8px; }
.dm-conversation__actions .icon-button { width: 30px; height: 30px; color: var(--muted); }
.dm-conversation__actions .icon-button:hover { color: var(--red); background: #fff1f4; }

.board-toolbar--canvas {
  min-height: 62px;
  padding: 10px clamp(14px, 2vw, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.board-toolbar--canvas > div:first-child { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.board-toolbar--canvas h2 { color: var(--navy); font-size: 18px; }
.board-toolbar--canvas > div:first-child span { color: var(--muted); font-size: 11px; }
.board-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.board-tool-group { display: inline-flex; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; }
.board-tool-group button {
  min-height: 31px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}
.board-tool-group button:last-child { border-right: 0; }
.board-tool-group button:hover, .board-tool-group button.is-active { background: var(--blue-pale); color: var(--blue); }
.board-clear { min-height: 31px; padding: 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.board-clear:hover { color: var(--red); }
.idea-board {
  height: clamp(520px, calc(100vh - 182px), 760px);
  position: relative;
  overflow: hidden;
  border: 0;
  background: #edf1f6;
  touch-action: none;
}
.idea-board[data-tool="pan"] { cursor: grab; }
.idea-board[data-tool="pan"]:active { cursor: grabbing; }
.idea-board[data-tool="draw"] { cursor: crosshair; }
.board-world {
  width: 1600px;
  height: 1000px;
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  background: #f9fafc;
  box-shadow: 0 6px 28px rgb(17 38 76 / .12);
}
.board-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#c7cfdb 1.2px, transparent 1.2px);
  background-size: 24px 24px;
}
.board-drawing { width: 1600px; height: 1000px; position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.board-stroke { fill: none; stroke: var(--blue); stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.board-stroke--navy { stroke: var(--navy); }
.board-stroke--red { stroke: var(--red); }
.board-stroke--green { stroke: var(--green); }
.board-stroke.is-new { opacity: .72; }
.board-note { overflow: hidden; border-radius: 2px; }
.board-note--blue { background: #dceafa; border-color: #9bbce6; }
.board-note--green { background: #e1f0e7; border-color: #a2d1b9; }
.board-note--orange { background: #ffeadc; border-color: #e9b991; }
.board-note--violet { background: #eee6f4; border-color: #c7b0da; }
.board-note--red { background: #fde7ec; border-color: #eab0bf; }
.board-note--yellow { background: var(--yellow-soft); }
.board-hint {
  padding: 7px 10px;
  position: absolute;
  left: 12px;
  bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgb(255 255 255 / .92);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.agents-toolbar {
  min-height: 62px;
  padding: 10px clamp(14px, 2vw, 22px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.agents-toolbar > div { display: flex; align-items: baseline; gap: 9px; }
.agents-toolbar h2 { color: var(--navy); font-size: 18px; }
.agents-toolbar p { color: var(--muted); font-size: 11px; }
.agents-layout--simple {
  min-height: 570px;
  padding: 14px clamp(14px, 2vw, 22px) 24px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  background: var(--surface-2);
}
.agents-layout--simple.is-empty { min-height: 0; grid-template-columns: 1fr; }
.agents-layout--simple.is-empty .agent-run-detail { min-height: 0; display: block; border: 0; background: transparent; }
.agents-layout--simple.is-empty .empty-state { min-height: 210px; }
.agents-layout--simple .agent-run-list,
.agents-layout--simple .agent-run-detail { min-height: 0; margin: 0; border-radius: 7px; overflow: hidden; }
.agents-layout--simple .agent-run-list > header { min-height: 49px; padding: 0 13px; }
.agents-layout--simple .agent-run-list > a {
  min-height: 66px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  border-left: 3px solid transparent;
}
.agents-layout--simple .agent-run-list > a.is-active { border-left-color: var(--blue); background: var(--blue-pale); }
.agents-layout--simple .agent-run-list > a > span { min-width: 0; display: grid; gap: 5px; }
.agents-layout--simple .agent-run-list .run-status { width: 12px; height: 12px; padding: 0; overflow: hidden; font-size: 0; }
.agents-layout--simple .agent-run-list .run-status i { margin: 0; }
.agent-run-detail > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; }
.agent-run-detail > header > div:first-child { min-width: 0; }
.agent-run-detail > header h2 { margin-top: 8px; }
.agent-run-detail > header p { margin-top: 7px; max-width: 760px; color: var(--muted); font-size: 11px; line-height: 1.5; white-space: pre-wrap; }
.agent-detail-status { display: flex; align-items: center; gap: 8px; }
.agent-detail-status small { color: var(--muted); font-size: 11px; }
.agent-log-list { padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.agent-log-list h3 { margin-bottom: 11px; color: var(--navy); font-size: 12px; }
.agent-log-list > div { min-height: 38px; display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 9px; }
.agent-log-list > div > i { width: 8px; height: 8px; margin-top: 3px; border: 2px solid var(--blue); border-radius: 50%; background: #fff; }
.agent-log-list > div > span { padding-bottom: 11px; display: grid; gap: 3px; border-left: 1px solid var(--line); padding-left: 12px; transform: translateX(-14px); }
.agent-log-list b { color: var(--ink-2); font-size: 11px; font-weight: 600; }
.agent-log-list time { color: var(--muted); font-size: 11px; }
.agent-log-list > p { color: var(--muted); font-size: 11px; }
.agent-result { border: 1px solid var(--line); border-left: 3px solid var(--green); border-radius: 6px; background: #fff; }
.agent-result > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-result pre { margin-top: 10px; max-height: 300px; overflow: auto; color: var(--ink-2); font: 10px/1.55 var(--mono); white-space: pre-wrap; }
.agent-run-form--simple { border: 0; }
.agent-advanced { border: 1px solid var(--line); border-radius: 7px; }
.agent-advanced > summary { min-height: 45px; padding: 0 12px; display: flex; align-items: center; gap: 7px; list-style: none; color: var(--ink-2); font-size: 11px; font-weight: 750; cursor: pointer; }
.agent-advanced > summary::-webkit-details-marker { display: none; }
.agent-advanced > summary span { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 500; }
.agent-advanced .agent-library-picker { padding: 0 12px 12px; }
.agent-advanced .agent-library-picker > section { max-height: 210px; overflow-y: auto; }
.agent-custom-instructions { margin: 0 12px 12px; }
.agent-branch-note { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }

@media (max-width: 1100px) {
  .project-header__top { align-items: flex-start; }
  .project-header__people { flex-wrap: wrap; justify-content: flex-end; }
  .project-tabs { overflow-x: auto; scrollbar-width: thin; }
  .project-tabs > a { flex: 0 0 auto; }
  .moderation-thread__head { min-height: 96px; }
  .moderation-thread__title > p { max-width: 420px; }
  .board-toolbar--canvas { align-items: flex-start; }
  .board-tools { flex-wrap: wrap; }
}

/* Late override: the compact desktop rules previously reintroduced a 236px
   grid column after the responsive breakpoint, collapsing 4:3 windows. */
@media (max-width: 960px) {
  .workspace-shell { width: 100%; grid-template-columns: minmax(0, 1fr); }
  .workspace-stage { width: 100%; max-width: 100vw; grid-column: 1; grid-template-rows: 50px minmax(0, 1fr); }
  .workspace-topbar { grid-template-columns: 38px minmax(0, 680px); justify-content: start; padding-inline: 10px; }
  .workspace-menu-button { display: grid; }
  .workspace-global-search { display: flex; }
  .workspace-content { width: 100%; max-width: 100vw; }
  .project-settings-layout { grid-template-columns: 1fr; }
  .project-settings-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .project-settings-side > * { min-width: 0; }
  .project-title > span { width: 52px; height: 52px; }
  .project-title p { display: none; }
  .project-header__top { padding-block: 12px; }
  .project-header__people > span { display: none; }
  .unified-chat .project-chat-main { height: calc(100vh - 250px); min-height: 400px; }
  .dashboard-projects--full .project-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents-layout--simple { grid-template-columns: 230px minmax(0, 1fr); }
  .agents-layout--simple > aside { display: block; background: #fff; border: 1px solid var(--line); }
  .moderation-inbox { grid-template-columns: 230px minmax(0, 1fr); }
  .moderation-thread__head { padding: 12px 14px; }
  .moderation-thread__title > p { display: none; }
  .moderation-files-panel .moderation-file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-page, .project-body { min-width: 0; }
  .admin-table-wrap, .member-table { max-width: 100%; overflow-x: auto; }
}

@media (max-width: 760px) {
  .workspace-topbar { grid-template-columns: 38px minmax(0, 1fr); }
  .workspace-global-search { display: flex; }
  .project-header__top { display: block; }
  .project-header__people { margin-top: 12px; justify-content: flex-start; }
  .project-chat-layout.unified-chat { padding: 0; }
  .unified-chat .project-chat-main { height: calc(100vh - 160px); min-height: 520px; border-inline: 0; border-radius: 0; }
  .project-chat-messages .chat-message,
  .dm-conversation__messages .chat-message,
  .moderation-chat-messages .chat-message { width: 95%; }
  .unified-chat-composer { grid-template-columns: 1fr; padding: 9px; }
  .unified-chat-composer > div { grid-column: 1; }
  .dm-conversation__actions .dm-private { display: none; }
  .board-toolbar--canvas { display: grid; }
  .board-toolbar--canvas > div:first-child { justify-content: space-between; }
  .board-tools { justify-content: flex-start; }
  .board-tool-group:first-child button { font-size: 0; }
  .board-tool-group:first-child button::after { font-size: 11px; }
  .board-tool-group:first-child button[data-board-tool="select"]::after { content: "Выбор"; }
  .board-tool-group:first-child button[data-board-tool="pan"]::after { content: "Двигать"; }
  .board-tool-group:first-child button[data-board-tool="draw"]::after { content: "Рисовать"; }
  .idea-board { height: 620px; }
  .agents-layout--simple { display: block; padding: 8px; }
  .agents-layout--simple .agent-run-list { max-height: 245px; margin-bottom: 8px; overflow-y: auto; }
  .agent-run-detail > header { grid-template-columns: 1fr; }
  .agent-run-form--simple .modal__actions { align-items: flex-start; }
  .agent-branch-note { margin-bottom: 8px; }
  .agent-advanced .agent-library-picker { grid-template-columns: 1fr; }
}

/* Final responsive and interaction pass. Keep dense work areas useful on 4:3. */
.public-nav .public-nav__mobile-only,
.dm-mobile-back,
.moderation-mobile-back,
.mobile-conversation-back { display: none; }


.queue-search-empty { padding: 24px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.composer-selected-files { grid-column: 1 / -1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.composer-selected-files > span { max-width: min(100%, 300px); min-height: 30px; padding: 4px 6px 4px 8px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.composer-selected-files b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 11px; }
.composer-selected-files small { color: var(--muted); font-size: 11px; }
.composer-selected-files button { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; color: var(--muted); }
.composer-selected-files button:hover { color: var(--red); background: #fff1f4; }
.composer-actions { min-width: 0; }
.composer-shortcut { color: var(--muted); font-size: 11px; white-space: nowrap; }

.member-table__head,
.member-table > article { grid-template-columns: minmax(190px, 1.2fr) minmax(110px, .8fr) 140px 105px 136px; }
.member-table select { width: 100%; min-height: 34px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 6px; background: #fff; }
.member-actions { display: flex !important; grid-auto-flow: column; align-items: center; justify-content: end; gap: 5px !important; }

.kanban-card__move { display: flex; align-items: center; gap: 3px; }
.kanban-card__move button { width: 25px; height: 25px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: #fff; }
.kanban-card__move button:hover { border-color: var(--blue); color: var(--blue); }

.board-color-picker { display: flex; align-items: center; gap: 5px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.board-color { width: 20px; height: 20px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-dark); }
.board-color.is-active { box-shadow: 0 0 0 2px var(--blue); }
.board-color--blue { background: var(--blue); }
.board-color--navy { background: var(--navy); }
.board-color--red { background: var(--red); }
.board-color--green { background: var(--green); }
.idea-board[data-tool="erase"] { cursor: cell; }
.idea-board[data-tool="erase"] .board-drawing { pointer-events: stroke; }
.idea-board[data-tool="erase"] .board-stroke { pointer-events: stroke; cursor: pointer; }
.idea-board[data-tool="erase"] .board-stroke:hover { opacity: .45; stroke-width: 8; }

.library-card pre { max-height: 120px; overflow: auto; font: 11px/1.5 var(--mono); }
.library-card__top i { font-size: 11px; }
.profile-provider small { font: 11px/1.45 var(--mono); overflow-wrap: anywhere; }
.agent-result pre { font: 11px/1.55 var(--mono); }

.modal__body { min-height: 0; }
.modal__actions { flex-wrap: wrap; }
.moderation-thread__dock .unified-chat-composer { padding: 0; }
.moderation-thread__dock .unified-chat-composer > .composer-actions { grid-column: 2; }
.moderation-thread__dock .composer-selected-files { grid-column: 1 / -1; }

@media (max-width: 1100px) {
  body[data-mode="workspace"] { overflow: hidden; }
  .workspace-shell { grid-template-columns: minmax(0, 1fr); }
  .workspace-sidebar { width: min(330px, 88vw); position: fixed; inset: 0 auto 0 0; transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); }
  .workspace-menu-open .workspace-sidebar { transform: translateX(0); }
  .workspace-backdrop { display: none; position: fixed; z-index: 35; inset: 0; background: rgb(8 20 49 / .55); }
  .workspace-menu-open .workspace-backdrop { display: block; }
  .workspace-sidebar__close,
  .workspace-menu-button { display: inline-grid; }
  .workspace-stage { width: 100%; max-width: 100vw; grid-column: 1; }
  .workspace-topbar { grid-template-columns: 38px minmax(0, 680px); justify-content: start; padding-inline: 10px; }
  .workspace-content { width: 100%; max-width: 100vw; }
  .dashboard-projects--full .project-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-tabs { scrollbar-width: thin; }
  .catalog-layout { grid-template-columns: 1fr; }
  .catalog-filters__sticky { position: static; display: flex; flex-direction: row; gap: 5px; overflow-x: auto; padding-bottom: 4px; }
  .filter-title { display: none; }
  .catalog-filters a { min-height: 36px; flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
  .catalog-filters a { gap: 8px; }
  .catalog-filters a i { font-style: normal; }
  .catalog-filters a.is-active { border-left-width: 1px; border-color: var(--blue); background: var(--blue); color: #fff; }
  .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .researcher-chat-layout { grid-template-columns: minmax(0, 1fr) 260px; }
  .project-settings-layout { grid-template-columns: minmax(0, 1fr); }
  .project-settings-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .project-settings-side > * { min-width: 0; }
}

@media (max-width: 1100px) and (max-height: 800px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-back { position: absolute; color: var(--blue); }
  .auth-form-panel { min-height: 100vh; padding: 58px 28px 28px; }
}

@media (max-width: 820px) {
  .workspace-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-projects--full .project-card-grid,
  .material-grid { grid-template-columns: 1fr; }
  .project-header__top { padding-inline: 14px; }
  .project-tabs { padding-inline: 8px; }
  .project-tab-content { padding: 12px 14px 24px; }
  .repository-layout { grid-template-columns: minmax(180px, 32%) minmax(0, 1fr); }
  .repo-history-pane { display: none; }
  .researcher-chat-layout { grid-template-columns: 1fr; padding-inline: 14px; }
  .submission-side-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .library-layout { grid-template-columns: 1fr; }
  .library-layout > aside { grid-template-columns: 1fr; }
  .agents-layout--simple { grid-template-columns: 210px minmax(0, 1fr); }
  .pending-user-grid,
  .section-admin-grid { grid-template-columns: 1fr; }

  .files-table { overflow: visible; }
  .files-table__head { display: none; }
  .files-table article { min-width: 0; min-height: 0; margin: 8px; padding: 12px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 9px 10px; border: 1px solid var(--line); border-radius: 7px; }
  .files-table article > .files-name { grid-column: 2; }
  .files-table article > [data-label] { grid-column: 2; display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; color: var(--ink-2); }
  .files-table article > [data-label]::before { content: attr(data-label); color: var(--muted); font-size: 11px; }
  .files-table article > .status { grid-column: 2; justify-self: start; }
  .files-row-actions { grid-column: 3; grid-row: 1 / span 5; align-self: start; }

  .admin-user-table { overflow: visible; }
  .admin-user-table__head { display: none; }
  .admin-user-table > article { min-width: 0; min-height: 0; margin-top: 8px; padding: 12px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px 10px; border: 1px solid var(--line); border-radius: 7px; }
  .admin-user-table > article > .avatar { grid-row: 1 / span 2; }
  .admin-user-table > article > span:nth-child(2) { grid-column: 2; }
  .admin-user-table > article > span:nth-child(3) { grid-column: 2; }
  .admin-user-table > article > .status { grid-column: 3; grid-row: 1; }
  .admin-user-table > article > label { grid-column: 2 / -1; }
  .admin-user-table > article select { width: 100%; max-width: none; min-height: 38px; }
  .admin-user-table > article > .table-number::before { content: "Материалы: "; color: var(--muted); }
  .admin-user-table > article > .table-number { grid-column: 2; }
  .admin-user-table > article > time { grid-column: 2 / -1; }
  .admin-user-table > article > time::before { content: "Последний вход: "; color: var(--muted); }
  .admin-user-table > article > .admin-user-table__actions { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; }

  .member-table { overflow: visible; }
  .member-table__head { display: none; }
  .member-table > article { min-width: 0; margin-top: 8px; padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; border: 1px solid var(--line); }
  .member-table > article > * { grid-column: 1 / -1; }
  .member-table > article > span:nth-child(2)::before { content: "Организация: "; color: var(--muted); }
  .member-table > article > time::before { content: "Добавлен: "; color: var(--muted); }
  .member-actions { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .public-header { grid-template-columns: 1fr auto; }
  .public-nav .public-nav__mobile-only { display: flex; }
  .public-header__actions > .button,
  .public-header__actions > .text-link,
  .public-header__actions > .header-user { display: none; }
  .public-nav { height: auto; }
  .public-nav a { width: 100%; min-height: 44px; height: auto; padding: 0 14px; }
  .public-nav a::after { display: none; }
  .mobile-menu { display: block; }
  .catalog-layout { padding: 14px; }
  .catalog-filters__sticky { flex-direction: row; }
  .catalog-search { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .material-card { min-height: 280px; }

  .dm-inbox { height: 100%; min-height: 0; }
  .dm-inbox--conversation .dm-inbox__rail { display: none; }
  .dm-inbox:not(.dm-inbox--conversation) .dm-conversation { display: none; }
  .dm-inbox__rail { max-height: none; height: 100%; border-bottom: 0; }
  .dm-thread-list { max-height: none; }
  .dm-mobile-back,
  .moderation-mobile-back,
  .mobile-conversation-back { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; color: var(--blue); background: #fff; }
  .dm-conversation { height: 100%; min-height: 0; grid-template-rows: 62px minmax(0, 1fr) auto; }
  .dm-conversation__head { grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 7px; padding-inline: 9px; }
  .dm-conversation__head .avatar-stack { max-width: 54px; }

  .moderation-inbox { height: 100%; min-height: 0; }
  .moderation-inbox.has-selection .moderation-queue { display: none; }
  .moderation-inbox:not(.has-selection) .moderation-thread,
  .moderation-inbox:not(.has-selection) .moderation-empty { display: none; }
  .moderation-inbox .moderation-queue { max-height: none; height: 100%; border-bottom: 0; }
  .moderation-inbox .queue-items { max-height: none; }
  .moderation-thread { height: 100%; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
  .moderation-thread__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .moderation-thread__title { min-width: 0; }
  .moderation-thread__scroll { min-height: 0; overflow-y: auto; }
  .moderation-thread__dock { position: relative; padding: 8px; }
  .moderation-thread__dock .unified-chat-composer { grid-template-columns: 1fr; }
  .moderation-thread__dock .unified-chat-composer > .composer-actions { grid-column: 1; flex-wrap: wrap; }
  .moderation-decision-bar { overflow-x: auto; flex-wrap: nowrap; }
  .moderation-decision-bar > * { flex: 0 0 auto; }
  .moderation-thread__scroll > .moderation-issues .moderation-issue-list { grid-template-columns: 1fr; }

  .submission-detail-head { padding: 18px 14px; }
  .submission-detail-head h1 { font-size: 25px; }
  .submission-side-column { grid-template-columns: 1fr; }
  .researcher-chat-card { min-height: calc(100dvh - 160px); }
  .researcher-dm-page { min-height: calc(100dvh - 60px); padding: 0; }
  .researcher-dm-page > .breadcrumbs { display: none; }
  .researcher-dm-card { min-height: calc(100dvh - 60px); margin: 0; border: 0; border-radius: 0; }
  .researcher-dm-card > header { min-height: 62px; padding: 10px 12px; }
  .researcher-dm-card > header > div:nth-child(3) { min-width: 0; flex: 1; }
  .researcher-dm-card > header h1,
  .researcher-dm-card > header p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .files-manager-toolbar > .table-search { width: 100%; }
  .files-manager-toolbar > .table-search input { width: 100%; min-width: 0; }
  .files-manager-toolbar > div { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .files-manager-toolbar > div .button { width: 100%; white-space: normal; }
  .admin-tabs { overflow-x: auto; }
  .admin-tabs a { flex: 0 0 auto; }
  .admin-table-card > header { align-items: stretch; flex-direction: column; }
  .admin-table-card .table-search { width: 100%; }
  .admin-table-card .table-search input { min-width: 0; flex: 1; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100dvh - 16px); border-radius: 10px; }
  .modal__header { padding: 18px 16px 14px; }
  .modal__body { padding: 16px; }
  .modal__actions--between { align-items: stretch; flex-direction: column-reverse; }
  .modal__actions--between > div { flex-wrap: wrap; }
  .board-tools { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
  .board-tools > * { flex: 0 0 auto; }
  .board-tool-group button { min-height: 38px; }
  .kanban-hint { display: none; }
}

@media (max-width: 460px) {
  .workspace-metrics { grid-template-columns: 1fr; }
  .compact-page-head { align-items: flex-start; }
  .compact-counts { justify-content: flex-start; }
  .form-row--two { flex-direction: column; align-items: stretch; }
  .composer-shortcut { display: none; }
  .unified-chat-composer > .composer-actions { grid-column: 1; flex-wrap: wrap; }
  .unified-chat-composer .button { margin-left: auto; }
  .send-files-drop { min-height: 160px; }
  .files-manager-toolbar > div { grid-template-columns: 1fr; }
  .pending-user-grid > article { grid-template-columns: 38px minmax(0, 1fr); }
  #toast-root { left: 10px; right: 10px; bottom: 10px; }
  .toast { min-width: 0; width: 100%; }
}

/* Researcher pages use the same compact, task-first rhythm as the workspace. */
.cabinet-head--simple {
  min-height: 96px;
  padding: 20px 34px;
  align-items: center;
  color: var(--navy);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.cabinet-head--simple::after { display: none; }
.cabinet-head--simple h1 { margin: 0; font-size: clamp(27px, 3vw, 36px); line-height: 1.08; }
.cabinet-dialog-grid { padding-top: 18px; }

.send-files-card > header { padding: 24px 34px 15px; }
.send-files-card > header h1 { font-size: clamp(28px, 3vw, 36px); }
.send-files-drop { min-height: 170px; }

.submission-detail-head--compact { padding: 20px 34px; align-items: center; }
.submission-detail-head--compact .submission-title-line { margin: 0 0 9px; }
.submission-detail-head--compact h1 { font-size: clamp(27px, 3vw, 36px); line-height: 1.08; }
.submission-detail-head--compact > div > p { margin-top: 8px; line-height: 1.45; }
.submission-detail-head--compact .submission-head-actions { padding-top: 0; }
.submission-detail-page--chat .researcher-chat-layout { padding-top: 14px; }
.submission-detail-page--chat .researcher-chat-card {
  height: clamp(440px, calc(100vh - 265px), 620px);
  min-height: 440px;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.submission-detail-page--chat .researcher-chat-card .submission-chat { min-height: 0; max-height: none; overflow-y: auto; }
.side-card .status-timeline {
  margin: 14px 0 18px;
  padding: 0;
  display: grid;
  list-style: none;
}
.side-card .status-timeline > li {
  min-width: 0;
  min-height: 38px;
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}
.side-card .status-timeline > li:not(:last-child)::after {
  content: "";
  width: 1px;
  position: absolute;
  left: 11px;
  top: 22px;
  bottom: 0;
  background: var(--line-dark);
}
.side-card .status-timeline i {
  width: 23px;
  height: 23px;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--muted);
  font-style: normal;
  background: #fff;
}
.side-card .status-timeline .is-done i { border-color: var(--green); color: #fff; background: var(--green); }
.side-card .status-timeline .is-current { color: var(--blue); font-weight: 750; }
.side-card .status-timeline .is-current i { border-color: var(--blue); color: #fff; background: var(--blue); }

@media (max-width: 760px) {
  .cabinet-head--simple { min-height: 0; padding: 16px 14px; display: flex; }
  .cabinet-head--simple h1 { font-size: 24px; }
  .cabinet-head--simple .button { width: auto; }
  .cabinet-dialog-grid { padding: 12px 10px; }
  .send-files-card > header { padding: 20px 18px 12px; }
  .send-files-card form { padding: 0 18px 20px; }
  .submission-detail-head--compact { padding: 14px; }
  .submission-detail-head--compact .submission-head-actions { padding-top: 0; }
  .submission-detail-page--chat .researcher-chat-card { height: calc(100dvh - 150px); min-height: 540px; }
}

/* Context-first workspace: navigation no longer carries an unrelated search. */
.workspace-stage { grid-template-rows: minmax(0, 1fr); }
.workspace-topbar { display: none; }
.page-head-actions { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.context-search {
  width: min(420px, 44vw);
  min-height: 36px;
  padding: 0 7px 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
}
.context-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .08); }
.context-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; font-size: 11px; }
.context-search button,
.dm-thread-search button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 5px; color: var(--blue); }
.context-search button:hover,
.dm-thread-search button:hover { background: var(--blue-pale); }
.context-search--wide { width: min(620px, 56vw); }
.dashboard-projects--full { padding-top: 16px; }

.dm-conversation--empty { height: 100%; min-height: 0; grid-template-rows: minmax(0, 1fr); place-items: center; }
.dm-search-result { grid-template-columns: 32px minmax(0, 1fr) !important; }
.dm-search-result > span:last-child { min-width: 0; display: grid; gap: 4px; }
.dm-search-result time { display: block; }

/* Moderation is one conversation plus a compact review column. */
.moderation-inbox .moderation-queue { grid-template-rows: auto auto minmax(0, 1fr); }
.moderation-thread__head { min-height: 88px; padding-block: 12px; align-items: center; }
.moderation-thread__author { margin-top: 7px; }
.moderation-thread__scroll {
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, .65fr);
  grid-template-areas:
    "chat files"
    "chat analysis"
    "chat issues"
    "chat preview";
  align-items: start;
}
.moderation-dialog-panel { grid-area: chat; min-height: 100%; }
.moderation-files-panel { grid-area: files; }
.moderation-thread__scroll > .attachment-analysis-panel { grid-area: analysis; }
.moderation-thread__scroll > .moderation-issues { grid-area: issues; }
.moderation-workbench { grid-area: preview; }
.moderation-files-panel .moderation-file-grid,
.moderation-thread__scroll > .moderation-issues .moderation-issue-list { grid-template-columns: 1fr; }
.moderation-thread__scroll .moderation-issue { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.moderation-thread__scroll .moderation-issue > span:first-child { grid-column: 1 / -1; justify-self: start; }
.moderation-thread__scroll .moderation-issue > div:nth-child(2) { grid-column: 1; min-width: 0; }
.moderation-thread__scroll .moderation-issue > .issue-actions { grid-column: 2; grid-row: 2; }
.moderation-thread__scroll .issue-actions button span { display: none; }
.moderation-chat-messages { min-height: 280px; }
.moderation-thread__dock { grid-template-columns: minmax(0, 1fr) auto; }
.moderation-decision-bar { align-self: end; justify-content: flex-end; }

.library-section > header > div > small,
.agents-toolbar > div > span { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 99px; color: var(--blue); background: var(--blue-pale); font-size: 11px; font-weight: 800; }
.library-card pre { max-height: 74px; overflow: hidden; }
.agents-layout--simple { min-height: 0; }

@media (max-width: 1100px) {
  .workspace-stage { grid-template-rows: 50px minmax(0, 1fr); }
  .workspace-topbar { padding: 7px 10px; display: flex; align-items: center; justify-content: flex-start; }
}

@media (max-width: 900px) {
  .moderation-thread__scroll { display: grid; grid-template-columns: 1fr; grid-template-areas: "files" "analysis" "chat" "issues" "preview"; }
  .moderation-dialog-panel { min-height: 0; }
  .moderation-thread__dock { grid-template-columns: 1fr; }
  .moderation-decision-bar { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .compact-page-head { align-items: stretch; flex-direction: column; }
  .page-head-actions { width: 100%; justify-content: stretch; }
  .context-search { width: 100%; }
  .page-head-actions .button { flex: 0 0 auto; }
  .moderation-thread__scroll { display: block; }
  .moderation-thread__scroll > * + * { margin-top: 9px; }
}

/* Hard-edged archival workspace. Moderation mirrors the regular chat layout. */
.moderation-inbox {
  grid-template-columns: 270px minmax(0, 1fr) 330px;
  overflow: hidden;
}
.moderation-inbox .moderation-queue {
  min-width: 0;
  min-height: 0;
  grid-template-rows: 72px auto minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}
.moderation-inbox .moderation-queue > header { min-height: 72px; border-bottom: 1px solid var(--line); }
.moderation-inbox .queue-filters { border-bottom: 1px solid var(--line); }
.moderation-inbox .queue-items { min-height: 0; overflow-y: auto; }
.moderation-inbox .queue-item { min-height: 76px; padding: 10px 12px; }
.moderation-inbox .queue-item footer { margin-top: 6px; }

.moderation-thread {
  min-width: 0;
  min-height: 0;
  grid-template-rows: 72px minmax(0, 1fr) auto;
  background: #fff;
}
.moderation-thread__head {
  min-height: 72px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.moderation-thread__title { min-width: 0; }
.moderation-thread__title h2 { margin: 0; font-size: 15px; }
.moderation-thread__title p { margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.moderation-thread__number { color: var(--muted); font: 11px var(--mono); }
.moderation-chat-messages {
  min-height: 0;
  padding: 20px clamp(15px, 2.5vw, 28px);
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  background: #f8fafc;
}
.moderation-chat-messages .chat-message { width: min(84%, 660px); }
.moderation-chat-messages .chat-message > div { background: #fff; }
.moderation-chat-messages .chat-message--mine > div { background: var(--blue-pale); }
.moderation-chat-messages .chat-message--file-event { margin-top: -5px; }
.moderation-thread__dock {
  min-width: 0;
  min-height: 72px;
  padding: 10px 12px;
  display: block;
  border-top: 1px solid var(--line);
  box-shadow: none;
}
.moderation-thread__dock .unified-chat-composer { width: 100%; }

.moderation-file-inspector {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: #fff;
}
.moderation-file-inspector > header {
  min-height: 72px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.moderation-file-inspector > header > div { display: flex; align-items: center; gap: 8px; }
.moderation-file-inspector > header h2 { color: var(--navy); font-size: 15px; }
.moderation-file-inspector > header > div > span { color: var(--blue); font-size: 11px; font-weight: 800; }
.moderation-file-inspector__scroll { min-height: 0; overflow-y: auto; }
.inspector-file-list { display: grid; border-bottom: 1px solid var(--line); }
.inspector-file-list .chat-attachment { width: 100%; min-height: 56px; border-width: 0 0 1px 5px; }
.moderation-file-inspector .attachment-analysis-panel { margin: 0; border-width: 0 0 1px; }
.moderation-inspector-section { margin: 0; padding: 12px; border: 0; border-bottom: 1px solid var(--line); }
.moderation-inspector-section > header { margin-bottom: 10px; }
.moderation-inspector-section > header h3 { font-size: 12px; }
.moderation-inspector-section .moderation-issue {
  padding: 9px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.moderation-inspector-section .moderation-issue > span:first-child {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: start;
}
.moderation-inspector-section .moderation-issue > div:nth-child(2) {
  grid-column: 1 / -1;
  grid-row: 2;
}
.moderation-inspector-section .moderation-issue > .issue-actions {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-content: flex-end;
}
.moderation-file-inspector .moderation-workbench { border-width: 0 0 1px; }
.moderation-file-inspector .moderation-workbench .review-browser { min-height: 0; grid-template-columns: 1fr; }
.moderation-file-inspector .moderation-workbench .review-files { max-height: 190px; border-right: 0; border-bottom: 1px solid var(--line); }
.moderation-file-inspector .moderation-workbench .review-preview { min-height: 230px; }
.moderation-inspector-meta { border-bottom: 1px solid var(--line); }
.moderation-inspector-meta > summary { padding: 12px 14px; color: var(--navy); font-size: 11px; font-weight: 800; cursor: pointer; }
.moderation-inspector-meta dl { padding: 0 14px 14px; display: grid; gap: 8px; }
.moderation-inspector-meta dl > div { min-width: 0; display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; }
.moderation-inspector-meta dt { color: var(--muted); font-size: 11px; }
.moderation-inspector-meta dd { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-size: 11px; }
.moderation-file-inspector > .moderation-decision-bar {
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.moderation-file-inspector > .moderation-decision-bar > * { width: 100%; justify-content: center; }

.chat-attachment--safe { border-left-color: var(--green); background: #edf8f2; }
.chat-attachment--pending { border-left-color: #d69b00; background: #fff8dc; }
.chat-attachment--issues { border-left-color: var(--red); background: #fff0f3; }
.chat-attachment--safe:hover,
.chat-attachment--pending:hover,
.chat-attachment--issues:hover { box-shadow: none; filter: brightness(.985); }

@media (max-width: 1180px) {
  .moderation-inbox { grid-template-columns: 240px minmax(0, 1fr) 300px; }
}

@media (max-width: 960px) {
  .moderation-inbox { grid-template-columns: minmax(0, 1fr) 285px; }
  .moderation-inbox:not(.has-selection) { display: block; }
  .moderation-inbox:not(.has-selection) .moderation-thread,
  .moderation-inbox:not(.has-selection) .moderation-file-inspector { display: none; }
  .moderation-inbox:not(.has-selection) .moderation-queue { height: 100%; }
  .moderation-inbox.has-selection .moderation-queue { display: none; }
  .moderation-inbox.has-selection .moderation-thread { grid-column: 1; }
  .moderation-inbox.has-selection .moderation-file-inspector { grid-column: 2; }
}

@media (max-width: 640px) {
  .moderation-inbox.has-selection { display: block; overflow-y: auto; }
  .moderation-inbox.has-selection .moderation-thread { height: calc(100dvh - 50px); }
  .moderation-inbox.has-selection .moderation-file-inspector { min-height: 520px; }
}

/* One geometry across the product: no rounded rectangles, chips or cards. */
:root {
  --radius-xs: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
}
*, *::before, *::after { border-radius: 0 !important; }

/* Dense project workspace: one project identity, full-height tools, quiet controls. */
:root { --project-workspace-offset: 125px; }

.project-header__top {
  min-height: 70px;
  padding: 10px clamp(16px, 2.4vw, 30px) 8px;
  display: block;
}
.project-title { align-items: center; gap: 11px; }
.project-title > .project-symbol { width: 44px; height: 44px; font-size: 14px; }
.project-title__meta { gap: 6px; font-size: 8px; }
.project-title h1 { margin-top: 3px; font-size: 21px; line-height: 1.12; }
.project-title p {
  max-width: min(760px, 70vw);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.project-header__people { display: none; }
.project-tabs { min-height: 42px; padding: 0 clamp(16px, 2.4vw, 30px); }
.project-tabs a { min-height: 41px; padding-inline: 11px; }
.project-tab-content { padding: 14px clamp(16px, 2.4vw, 30px) 28px; }

.project-overview-compact { display: grid; gap: 12px; }
.overview-stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #fff;
}
.overview-stat-strip > a {
  min-width: 0;
  min-height: 60px;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 32px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-right: 1px solid var(--line);
}
.overview-stat-strip > a:last-child { border-right: 0; }
.overview-stat-strip > a:hover { background: var(--surface-2); }
.overview-stat-strip .metric-icon { width: 31px; height: 31px; }
.overview-stat-strip strong { color: var(--navy); font-size: 18px; }
.overview-stat-strip small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.project-overview-workgrid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .85fr); gap: 12px; align-items: start; }
.project-overview-activity { min-width: 0; display: grid; gap: 12px; }
.project-overview-compact .overview-card { padding: 12px 14px; }
.project-overview-compact .overview-card > header { min-height: 28px; margin-bottom: 8px; justify-content: flex-start; }
.project-overview-compact .overview-card > header h2 { margin: 0; font-size: 14px; }
.project-overview-compact .overview-card > header a { margin-left: auto; }
.project-overview-compact .overview-card > header strong { margin-left: 6px; font-size: 19px; }
.project-overview-compact .status-breakdown { margin: 10px 0; gap: 7px 11px; }
.project-overview-compact .overview-task-list a,
.project-overview-compact .compact-commit-list a { min-height: 44px; }
.project-overview-compact .activity-message { padding-block: 7px; grid-template-columns: 30px minmax(0, 1fr); }
.project-overview-compact .activity-message p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.project-tab-content--kanban,
.project-tab-content--board,
.project-tab-content--chat {
  height: calc(100dvh - var(--project-workspace-offset));
  min-height: 0;
  overflow: hidden;
}
.project-tab-content--kanban,
.project-tab-content--board { padding: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.kanban-toolbar,
.board-toolbar--canvas {
  min-height: 48px;
  margin: 0;
  padding: 6px clamp(10px, 1.6vw, 18px);
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.kanban-toolbar > div,
.board-toolbar--canvas > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.kanban-toolbar h2,
.board-toolbar--canvas h2 { margin: 0; font-size: 16px; }
.kanban-toolbar > div > span,
.board-toolbar--canvas > div:first-child span { color: var(--muted); font-size: 11px; }
.kanban-board {
  min-height: 0;
  padding: 10px;
  grid-template-columns: repeat(5, minmax(174px, 1fr));
  gap: 7px;
  overflow: auto;
  background: var(--surface-2);
}
.kanban-column { min-height: 100%; }
.kanban-column > header { min-height: 40px; padding-inline: 9px; }
.kanban-dropzone { min-height: 100%; padding: 0 6px 7px; gap: 6px; }
.kanban-card { min-height: 94px; padding: 9px; box-shadow: none; }
.kanban-card h3 { margin-top: 7px; }
.kanban-card > p { margin-top: 4px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.kanban-card footer { margin-top: 8px; padding-top: 7px; }

.board-tools { gap: 4px; flex-wrap: nowrap; overflow-x: auto; }
.board-tool-group button { min-height: 30px; padding-inline: 8px; }
.board-color-picker { padding: 3px 5px; gap: 4px; }
.board-color { width: 18px; height: 18px; }
.idea-board {
  height: auto;
  min-height: 0;
  border: 0;
  background-color: #fbfcfe;
  background-image: radial-gradient(#c7cfdb 1px, transparent 1px);
  background-size: var(--board-grid-size, 24px) var(--board-grid-size, 24px);
  background-position: var(--board-grid-x, 0) var(--board-grid-y, 0);
}
.idea-board.is-space-pan { cursor: grab; }
.idea-board.is-space-pan:active { cursor: grabbing; }
.board-world { background: transparent; box-shadow: none; }
.board-grid { display: none; }
.board-drawing { width: 320000px; height: 200000px; left: -160000px; top: -100000px; right: auto; bottom: auto; }
.board-hint { display: none; }

.project-tab-content--chat { padding: 10px clamp(12px, 1.8vw, 20px) 0; }
.project-chat-layout.unified-chat { height: 100%; min-height: 0; padding: 0; background: transparent; }
.unified-chat .project-chat-main { height: 100%; min-height: 0; grid-template-rows: 50px minmax(0, 1fr) auto; }
.project-symbol--chat { width: 31px; height: 31px; font-size: 10px; }
.project-chat-main > header { padding-inline: 13px; }
.project-chat-main > header p { margin-top: 2px; color: var(--muted); font-size: 11px; }
.project-chat-messages,
.dm-conversation__messages,
.moderation-chat-messages { padding: 16px clamp(14px, 2.2vw, 24px); gap: 11px; }
.chat-message > div { padding: 9px 11px; }

.unified-chat-composer {
  min-height: 50px;
  padding: 6px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
}
.unified-chat-composer textarea {
  min-height: 36px;
  height: 36px;
  max-height: 84px;
  padding: 9px 10px;
  grid-column: 1;
  grid-row: 2;
  resize: none;
  line-height: 1.35;
}
.unified-chat-composer > .composer-actions,
.unified-chat-composer > div:last-child {
  min-height: 36px;
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 4px;
}
.unified-chat-composer .composer-selected-files { grid-column: 1 / -1; grid-row: 1; }
.composer-icon-action,
.chat-send-button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.composer-icon-action { color: var(--blue); cursor: pointer; }
.composer-icon-action:hover { background: var(--blue-pale); }
.chat-send-button { color: #fff; background: var(--blue); }
.chat-send-button:hover { background: var(--navy); }
.composer-shortcut { display: none; }
.composer-anonymous { min-height: 34px; padding-inline: 6px; }

/* Moderation keeps the chat, while filters and secondary decisions stay out of the way. */
.moderation-inbox { grid-template-columns: 230px minmax(0, 1fr) 300px; }
.moderation-inbox .moderation-queue { grid-template-rows: 54px 42px minmax(0, 1fr); }
.moderation-inbox .moderation-queue > header { min-height: 54px; padding: 0 12px; }
.moderation-queue-filter { padding: 6px 10px; display: block; border-bottom: 1px solid var(--line); }
.moderation-queue-filter select { width: 100%; min-height: 29px; padding: 0 8px; border: 1px solid var(--line-dark); color: var(--ink-2); background: #fff; font-size: 11px; }
.moderation-inbox .queue-item { min-height: 70px; padding: 9px 10px; }
.moderation-thread,
.moderation-file-inspector { grid-template-rows: 54px minmax(0, 1fr) auto; }
.moderation-thread__head,
.moderation-file-inspector > header { min-height: 54px; padding-inline: 12px; }
.moderation-thread__head { grid-template-columns: auto minmax(0, 1fr) auto; }
.moderation-thread__head .avatar { width: 32px; height: 32px; }
.moderation-thread__dock { min-height: 0; padding: 6px 8px; }
.moderation-thread__dock .unified-chat-composer textarea { min-height: 36px; height: 36px; }
.moderation-file-inspector > .moderation-decision-bar {
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 5px;
  position: relative;
}
.moderation-file-inspector > .moderation-decision-bar > .button,
.moderation-file-inspector > .moderation-decision-bar > a { width: 100%; }
.moderation-more-actions { position: relative; }
.moderation-more-actions > summary {
  width: 36px;
  height: 34px;
  display: grid;
  place-items: center;
  list-style: none;
  border: 1px solid var(--line-dark);
  color: var(--muted);
  cursor: pointer;
}
.moderation-more-actions > summary::-webkit-details-marker { display: none; }
.moderation-more-actions > div {
  width: 190px;
  padding: 5px;
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: 40px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line-dark);
  background: #fff;
  box-shadow: var(--shadow-md);
}
.moderation-more-actions button { min-height: 34px; padding: 0 8px; display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 11px; text-align: left; }
.moderation-more-actions button:hover { background: var(--surface-2); }

@media (max-width: 1180px) {
  .moderation-inbox { grid-template-columns: 220px minmax(0, 1fr) 285px; }
  .project-overview-workgrid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr); }
}

@media (max-width: 1100px) {
  :root { --project-workspace-offset: 175px; }
  .project-header__top { min-height: 68px; }
  .project-title p { max-width: 78vw; }
}

@media (max-width: 960px) {
  :root { --project-workspace-offset: 160px; }
  .project-overview-workgrid { grid-template-columns: 1fr; }
  .project-overview-activity { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moderation-inbox { grid-template-columns: minmax(0, 1fr) 285px; }
}

@media (max-width: 760px) {
  :root { --project-workspace-offset: 151px; }
  .project-header__top { min-height: 60px; padding: 7px 11px 6px; }
  .project-title > .project-symbol { width: 38px; height: 38px; }
  .project-title h1 { font-size: 18px; }
  .project-title p, .visibility-chip { display: none; }
  .project-tabs { padding-inline: 8px; }
  .project-tab-content { padding-inline: 10px; }
  .overview-stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-stat-strip > a:nth-child(2) { border-right: 0; }
  .overview-stat-strip > a:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .project-overview-activity { grid-template-columns: 1fr; }
  .project-tab-content--kanban,
  .project-tab-content--board { padding: 0; }
  .kanban-toolbar,
  .board-toolbar--canvas { padding-inline: 8px; }
  .board-toolbar--canvas > div:first-child span { display: none; }
  .board-tools { width: auto; }
  .project-tab-content--chat { padding: 0; }
  .unified-chat .project-chat-main { border-inline: 0; }
  .unified-chat-composer { grid-template-columns: minmax(0, 1fr) auto; padding: 6px; }
  .unified-chat-composer > .composer-actions,
  .unified-chat-composer > div:last-child { grid-column: 2; }
}

/* Conversation cleanup: one group mark, a focused thread and optional context. */
.dm-inbox,
.project-chat-layout.unified-chat { position: relative; overflow: hidden; }
.dm-inbox__rail > header > div > span,
.dm-private { display: none; }
.dm-conversation__head { min-height: 50px; padding-inline: 13px; }
.dm-conversation__head h2 { font-size: 14px; }
.dm-conversation__head > div:nth-child(3) { gap: 0; }
.dm-conversation__actions .icon-button:hover { color: var(--blue); background: var(--blue-pale); }
.dm-conversation__actions .icon-button--danger-hover:hover { color: var(--red); background: #fff1f4; }

.chat-context-panel {
  min-width: 0;
  min-height: 0;
  display: none;
  grid-template-rows: 50px minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: #fff;
}
.chat-context-panel > header {
  padding: 0 11px 0 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}
.chat-context-panel > header h3 { color: var(--navy); font-size: 13px; }
.chat-context-panel > header .icon-button { width: 30px; height: 30px; color: var(--muted); }
.chat-participant-list { min-height: 0; padding: 5px 0; overflow-y: auto; }
.chat-participant-list article {
  min-width: 0;
  min-height: 49px;
  padding: 7px 11px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid var(--line);
}
.chat-participant-list article:last-child { border-bottom: 0; }
.chat-participant-list article > span { min-width: 0; display: grid; gap: 2px; }
.chat-participant-list b,
.chat-participant-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-participant-list b { color: var(--ink-2); font-size: 11px; }
.chat-participant-list small { color: var(--muted); font-size: 10px; }

.dm-inbox.is-context-open { grid-template-columns: 296px minmax(0, 1fr) 250px; }
.dm-inbox.is-context-open .chat-context-panel { display: grid; }
.project-chat-layout.unified-chat { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; }
.project-chat-layout.unified-chat.is-context-open { grid-template-columns: minmax(0, 1fr) 250px; }
.project-chat-layout.is-context-open .chat-context-panel { display: grid; }
.project-chat-layout .project-chat-main { border: 1px solid var(--line); }
.project-chat-layout.is-context-open .project-chat-main { border-right: 0; }
.project-chat-main > header > .icon-button { width: 31px; height: 31px; color: var(--muted); }
.project-chat-main > header > .icon-button:hover { color: var(--blue); background: var(--blue-pale); }
.researcher-dm-layout { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.researcher-dm-layout.is-context-open { grid-template-columns: minmax(0, 1fr) 250px; }
.researcher-dm-layout.is-context-open .chat-context-panel { display: grid; }
.researcher-dm-layout .researcher-dm-card { min-width: 0; margin-top: 18px; }
.researcher-dm-layout.is-context-open .researcher-dm-card { border-right: 0; }
.researcher-dm-layout .chat-context-panel { margin-top: 18px; border: 1px solid var(--line); border-left: 0; }
.researcher-dm-card > header { min-height: 58px; padding: 10px 13px; gap: 9px; }
.researcher-dm-card > header > .avatar { flex: 0 0 auto; }
.researcher-dm-card__title { min-width: 0; flex: 1; }
.researcher-dm-card__title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px !important; }
.researcher-dm-card__actions { display: flex; align-items: center; gap: 3px; }
.researcher-dm-card__actions .icon-button { width: 30px; height: 30px; color: var(--muted); }
.researcher-dm-card__actions .icon-button:hover { color: var(--blue); background: var(--blue-pale); }
.researcher-dm-card__actions .icon-button--danger-hover:hover { color: var(--red); background: #fff1f4; }

.chat-message { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; }
.chat-message > .avatar { width: 30px; height: 30px; font-size: 9px; }
.chat-message header { margin-bottom: 3px; }
.chat-message p { line-height: 1.48; }
.project-chat-messages,
.dm-conversation__messages,
.moderation-chat-messages { padding-block: 12px; gap: 9px; }

.composer-anonymous--icon { width: 36px; height: 36px; min-height: 36px; padding: 0; position: relative; }
.composer-anonymous--icon input { position: absolute; opacity: 0; pointer-events: none; }
.composer-anonymous--icon > span { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-dark); color: var(--muted); background: #fff; }
.composer-anonymous--icon:hover > span,
.composer-anonymous--icon input:checked + span { border-color: var(--blue); color: var(--blue); background: var(--blue-pale); }

/* Moderation uses the same conversation frame; review opens only when needed. */
.moderation-inbox { grid-template-columns: 230px minmax(0, 1fr); }
.moderation-inbox.is-inspector-open { grid-template-columns: 230px minmax(0, 1fr) 300px; }
.moderation-file-inspector { display: none; }
.moderation-inbox.is-inspector-open .moderation-file-inspector { display: grid; }
.moderation-thread__head { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.moderation-inspector-toggle {
  min-width: 38px;
  width: auto;
  height: 32px;
  padding-inline: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--muted);
}
.moderation-inspector-toggle > span { color: var(--blue); font-size: 10px; font-weight: 800; }
.moderation-inspector-toggle:hover,
.moderation-inbox.is-inspector-open .moderation-inspector-toggle { color: var(--blue); background: var(--blue-pale); }
.moderation-inspector-actions { display: flex !important; align-items: center; gap: 3px !important; }
.moderation-inspector-actions .icon-button { width: 29px; height: 29px; color: var(--muted); }
.moderation-inspector-actions .icon-button:hover { color: var(--blue); background: var(--blue-pale); }
.moderation-inbox .queue-item footer { justify-content: flex-start; }
.moderation-inbox .queue-item footer > span { margin-left: 16px; }
.moderation-file-inspector__scroll > .attachment-analysis-panel[hidden] { display: none; }

@media (max-width: 1180px) {
  .moderation-inbox { grid-template-columns: 220px minmax(0, 1fr); }
  .moderation-inbox.is-inspector-open { grid-template-columns: 220px minmax(0, 1fr) 285px; }
}

@media (max-width: 960px) {
  .moderation-inbox.has-selection { grid-template-columns: minmax(0, 1fr); }
  .moderation-inbox.has-selection.is-inspector-open { grid-template-columns: minmax(0, 1fr) 285px; }
  .moderation-inbox.is-inspector-open { grid-template-columns: minmax(0, 1fr) 285px; }
  .moderation-inbox.is-inspector-open .moderation-queue { display: none; }
  .moderation-inbox.has-selection.is-inspector-open .moderation-thread { grid-column: 1; }
  .moderation-inbox.has-selection.is-inspector-open .moderation-file-inspector { grid-column: 2; }
}

@media (max-width: 760px) {
  .dm-inbox.is-context-open,
  .project-chat-layout.unified-chat.is-context-open { grid-template-columns: minmax(0, 1fr); }
  .dm-inbox.is-context-open .chat-context-panel,
  .project-chat-layout.is-context-open .chat-context-panel,
  .researcher-dm-layout.is-context-open .chat-context-panel {
    width: min(280px, 86vw);
    position: absolute;
    z-index: 15;
    top: 0;
    right: 0;
    bottom: 0;
    box-shadow: -12px 0 28px rgb(13 36 81 / .12);
  }
  .project-chat-layout .project-chat-main { border-inline: 0; }
  .researcher-dm-layout,
  .researcher-dm-layout.is-context-open { grid-template-columns: minmax(0, 1fr); }
  .researcher-dm-layout .chat-context-panel { margin-top: 18px; border-right: 0; }
  .moderation-thread__head { grid-template-columns: auto auto minmax(0, 1fr) auto; }
}

@media (max-width: 640px) {
  .moderation-inbox.has-selection,
  .moderation-inbox.has-selection.is-inspector-open { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
  .moderation-inbox.has-selection .moderation-thread { height: 100%; grid-column: 1; }
  .moderation-inbox.has-selection.is-inspector-open .moderation-file-inspector {
    width: min(300px, 88vw);
    min-height: 0;
    position: absolute;
    z-index: 18;
    top: 0;
    right: 0;
    bottom: 0;
    display: grid;
    box-shadow: -12px 0 28px rgb(13 36 81 / .14);
  }
}

/* Final workspace pass: compact home, file inspectors, libraries and 4:3 layouts. */
.workspace-home-stream {
  margin: 14px clamp(18px, 3vw, 34px) 0;
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(340px, 1.15fr);
  border: 1px solid var(--line);
  background: #fff;
}
.workspace-home-stream > section { min-width: 0; display: grid; grid-template-rows: 45px minmax(0, 1fr) auto; }
.workspace-home-stream > section + section { border-left: 1px solid var(--line); }
.workspace-home-stream > section > header { min-height: 45px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.workspace-home-stream h2, .workspace-projects-head h2 { color: var(--navy); font-size: 15px; }
.workspace-home-stream > section > header > span { color: var(--muted); font-size: 11px; }
.home-schedule > div, .home-announcement-list { min-height: 0; max-height: 260px; overflow-y: auto; }
.home-schedule article { min-height: 64px; padding: 8px 9px; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: start; gap: 9px; border-bottom: 1px solid var(--line); }
.home-schedule article > time { display: grid; gap: 2px; color: var(--blue); }
.home-schedule article > time b { font-size: 11px; text-transform: uppercase; }
.home-schedule article > time span, .home-schedule article small { color: var(--muted); font-size: 10px; }
.home-schedule article > div { min-width: 0; }
.home-schedule article h3 { color: var(--ink-2); font-size: 12px; }
.home-schedule article p { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.home-announcement-list article { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.home-announcement-list article > header { display: flex; justify-content: space-between; gap: 10px; }
.home-announcement-list b { color: var(--ink-2); font-size: 11px; }
.home-announcement-list time { color: var(--muted); font-size: 10px; }
.home-announcement-list p { margin-top: 5px; color: var(--ink-2); font-size: 11px; line-height: 1.48; }
.home-announcements > form { min-height: 46px; padding: 5px 7px; display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; border-top: 1px solid var(--line); }
.home-announcements > form textarea { min-height: 34px; max-height: 76px; padding: 8px 9px; resize: vertical; border: 1px solid var(--line-dark); font: inherit; }
.home-announcements > form .chat-send-button { width: 34px; height: 34px; }
.home-stream-empty { padding: 20px 12px; color: var(--muted); font-size: 11px; }
.workspace-projects-head { min-height: 52px; margin: 7px clamp(18px, 3vw, 34px) 0; display: flex; align-items: center; justify-content: space-between; }
.dashboard-projects--full { padding-top: 0; }

.library-tabs { min-height: 42px; padding: 0 clamp(18px, 3vw, 34px); display: flex; align-items: end; gap: 22px; border-bottom: 1px solid var(--line); background: #fff; }
.library-tabs a { height: 42px; display: flex; align-items: center; border-bottom: 2px solid transparent; color: var(--muted); font-size: 11px; font-weight: 750; }
.library-tabs a.is-active { border-bottom-color: var(--blue); color: var(--blue); }
.library-screen { padding: 14px clamp(18px, 3vw, 34px) 32px; }
.library-screen .library-card-grid, .profile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-grid { display: grid; gap: 10px; }
.profile-grid .profile-card { min-width: 0; border: 1px solid var(--line); background: #fff; }
.agent-resources { min-width: 0; padding: 10px; border: 1px solid var(--line-dark); }
.agent-resources > legend { padding-inline: 5px; color: var(--navy); font-size: 12px; font-weight: 800; }
.agent-resources > legend span { color: var(--muted); font-size: 10px; font-weight: 500; }
.agent-resources .agent-library-picker { margin: 0; }
.agent-resources .agent-library-picker > section { max-height: 190px; overflow-y: auto; }
.agent-resources .agent-library-picker > section > label {
  min-width: 0;
  padding: 7px 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.agent-resources .agent-library-picker > section > label > input { margin-top: 2px; }
.agent-resources .agent-library-picker > section > label > span { min-width: 0; display: grid; gap: 3px; }
.agent-resources .agent-library-picker > section > label b,
.agent-resources .agent-library-picker > section > label small {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.agent-resources .agent-library-picker > section > label b { color: var(--ink-2); font-size: 11px; }
.agent-resources .agent-library-picker > section > label small { display: block; color: var(--muted); font-size: 9px; }

.chat-file-panel {
  min-width: 0;
  min-height: 0;
  display: none;
  grid-template-rows: 50px minmax(0, 1fr);
  border-left: 1px solid var(--line);
  background: #fff;
}
.chat-file-panel > header { padding: 0 10px 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.chat-file-panel > header h3 { color: var(--navy); font-size: 13px; }
.chat-file-panel > [data-chat-file-content] { min-height: 0; padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; }
.chat-file-summary { min-width: 0; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; color: var(--blue); }
.chat-file-summary > div { min-width: 0; display: grid; gap: 4px; }
.chat-file-summary b { overflow-wrap: anywhere; color: var(--ink-2); font-size: 11px; }
.chat-file-summary small { color: var(--muted); font-size: 10px; }
.chat-file-meta div { display: grid; gap: 4px; }
.chat-file-meta dt { color: var(--muted); font-size: 10px; }
.chat-file-meta dd { overflow-wrap: anywhere; color: var(--ink-2); font-size: 9px; }
.chat-file-notes { display: grid; gap: 7px; }
.chat-file-notes > header { display: flex; justify-content: space-between; }
.chat-file-notes h4 { color: var(--navy); font-size: 12px; }
.chat-file-notes article { padding: 7px 0; border-top: 1px solid var(--line); }
.chat-file-notes article b, .chat-file-notes article time { font-size: 10px; }
.chat-file-notes article p { margin: 4px 0; color: var(--ink-2); font-size: 11px; line-height: 1.4; }
.chat-file-notes article time { color: var(--muted); }
.chat-file-notes form { display: grid; gap: 6px; }
.chat-file-notes textarea { min-height: 54px; padding: 7px; resize: vertical; border: 1px solid var(--line-dark); font: inherit; }
.chat-file-panel [data-chat-file-content] > footer { margin-top: auto; }
.dm-inbox.is-file-open { grid-template-columns: 296px minmax(0, 1fr) 280px; }
.dm-inbox.is-file-open .chat-file-panel,
.project-chat-layout.is-file-open .chat-file-panel,
.researcher-dm-layout.is-file-open .chat-file-panel { display: grid; }
.project-chat-layout.unified-chat.is-file-open,
.researcher-dm-layout.is-file-open { grid-template-columns: minmax(0, 1fr) 280px; }
.chat-participant-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--blue); font-size: 10px; }

.moderation-thread__head { grid-template-columns: auto auto minmax(0, 1fr); }
.moderation-decision-bar { grid-template-columns: 1fr !important; gap: 5px; }
.moderation-main-decisions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.moderation-main-decisions .button { width: 100%; }
.moderation-revision-action { min-height: 30px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 10px; }
.moderation-revision-action:hover { color: var(--orange); background: var(--orange-soft); }
.attachment-panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.attachment-panel-actions > * { flex: 1 1 auto; }
.issue-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.issue-actions button { min-height: 25px; padding: 0 6px; border: 1px solid var(--line-dark); color: var(--muted); background: #fff; font-size: 9px; }
.inspector-file-list .chat-attachment, .dialog-file-list .chat-attachment { width: 100%; text-align: left; }

.files-manager-toolbar > .table-search { min-width: 260px; flex: 1 1 300px; }
.files-manager-toolbar > .table-search input { width: 100%; min-width: 0; }
.pending-user-grid > article { grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; }
.pending-user-grid > article > .avatar--lg { width: 46px; height: 46px; font-size: 12px; }

.project-tab-content--view-repository { height: calc(100dvh - var(--project-workspace-offset)); min-height: 0; padding: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; }
.project-tab-content--view-repository .repository-toolbar { border-inline: 0; border-top: 0; }
.project-tab-content--view-repository .repository-layout { min-height: 0; height: 100%; border: 0; border-top: 1px solid var(--line); }
.project-tab-content--view-repository .code-view,
.project-tab-content--view-repository .code-editor { min-height: 0; height: 100%; }
.kanban-board { background: #f7f8fa; }
.kanban-column { border: 1px solid var(--line); border-top: 3px solid var(--line-dark); background: #f0f2f5; }
.kanban-column[data-kanban-column="ready"] { border-top-color: var(--blue); }
.kanban-column[data-kanban-column="in_progress"] { border-top-color: var(--orange); }
.kanban-column[data-kanban-column="review"] { border-top-color: var(--violet); }
.kanban-column[data-kanban-column="done"] { border-top-color: var(--green); }
.kanban-card { cursor: grab; }

@media (max-width: 1180px) {
  .library-screen .library-card-grid, .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moderation-inbox.has-selection { grid-template-columns: minmax(0, 1fr); }
  .moderation-inbox.has-selection .moderation-queue { display: none; }
  .moderation-inbox.has-selection.is-inspector-open { grid-template-columns: minmax(0, 1fr) 285px; }
  .moderation-inbox.is-inspector-open { grid-template-columns: minmax(0, 1fr) 285px; }
  .moderation-inbox.is-inspector-open .moderation-queue { display: none; }
  .dm-inbox--conversation.is-file-open { grid-template-columns: minmax(0, 1fr) 280px; }
  .dm-inbox--conversation.is-file-open .dm-inbox__rail { display: none; }
}

@media (max-width: 900px) {
  .workspace-home-stream { grid-template-columns: 1fr; }
  .workspace-home-stream > section + section { border-left: 0; border-top: 1px solid var(--line); }
  .project-tab-content--view-repository .repository-layout { grid-template-columns: 190px minmax(0, 1fr); }
  .project-tab-content--view-repository .repo-history-pane { display: none; }
}

@media (max-width: 760px) {
  .workspace-home-stream { margin-inline: 10px; }
  .workspace-projects-head { margin-inline: 12px; }
  .library-screen { padding-inline: 10px; }
  .library-screen .library-card-grid, .profile-grid { grid-template-columns: 1fr; }
  .page-head-actions { width: 100%; }
  .page-head-actions .context-search { flex: 1; }
  .dm-inbox.is-file-open,
  .project-chat-layout.unified-chat.is-file-open,
  .researcher-dm-layout.is-file-open { grid-template-columns: minmax(0, 1fr); }
  .dm-inbox.is-file-open .chat-file-panel,
  .project-chat-layout.is-file-open .chat-file-panel,
  .researcher-dm-layout.is-file-open .chat-file-panel {
    width: min(300px, 88vw);
    position: absolute;
    z-index: 18;
    top: 0;
    right: 0;
    bottom: 0;
    box-shadow: -12px 0 28px rgb(13 36 81 / .14);
  }
}

/* Minimal public flow: one clear action per screen, compact library rows. */
.public-header .button { border-radius: 2px; box-shadow: none; }
.public-header .button:hover:not(:disabled) { box-shadow: none; }

.public-home { min-height: calc(100dvh - 108px); background: #fff; }
.home-hero {
  min-height: 430px;
  padding: clamp(58px, 7vw, 94px) clamp(24px, 7vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 350px);
  align-items: center;
  gap: clamp(42px, 7vw, 100px);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.home-hero__content { max-width: 850px; position: relative; z-index: 1; }
.home-hero h1 {
  max-width: 830px;
  color: var(--navy);
  font-size: clamp(48px, 5.5vw, 78px);
  font-weight: 760;
  letter-spacing: -.058em;
  line-height: .98;
}
.home-hero__content > p { margin-top: 18px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.home-search {
  width: min(700px, 100%);
  min-height: 56px;
  margin-top: 30px;
  padding: 5px 5px 5px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: var(--muted);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.home-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .08); }
.home-search input { min-width: 0; border: 0; outline: 0; color: var(--ink); font-size: 14px; }
.home-search .button { min-height: 44px; border-radius: 2px; box-shadow: none; }
.home-index { width: 330px; height: 250px; justify-self: end; position: relative; }
.home-index i { position: absolute; width: 220px; height: 150px; border: 1px solid var(--blue-soft); }
.home-index i:nth-child(1) { right: 0; top: 0; }
.home-index i:nth-child(2) { right: 38px; top: 34px; border-color: #9eb4dc; }
.home-index i:nth-child(3) { right: 76px; top: 68px; border-color: var(--blue); }
.home-index span { position: absolute; width: 72px; height: 3px; right: 112px; top: 141px; background: var(--sky); }
.home-latest { max-width: 1440px; margin: 0 auto; padding: 42px clamp(24px, 7vw, 96px) 56px; }
.home-latest > header { margin-bottom: 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 24px; }
.home-latest h2 { color: var(--navy); font-size: 24px; letter-spacing: -.03em; }
.home-latest > header a { color: var(--blue); font-size: 12px; font-weight: 750; }

.material-grid,
.material-grid--home { width: 100%; max-width: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.material-card,
.material-grid--home > .material-card:only-child {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "top" "body" "meta" "footer";
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
  overflow: hidden;
  transition: border-color .16s ease, background .16s ease;
}
.material-card:hover { transform: none; border-color: var(--blue-soft); background: #fbfcff; box-shadow: none; }
.material-card > :not(.material-card__click) { position: relative; z-index: 2; pointer-events: none; }
.material-card__top,
.material-grid--home > .material-card:only-child .material-card__top {
  grid-area: top;
  min-height: 0;
  padding: 15px 18px 0;
  align-items: center;
}
.catalog-type { padding: 4px 7px; font-size: 10px; letter-spacing: .075em; }
.material-card__files { font-size: 10px; }
.material-card__body,
.material-grid--home > .material-card:only-child .material-card__body {
  grid-area: body;
  padding: 13px 18px 0;
}
.material-card__body h2,
.material-card__body h3 { color: var(--navy); font-size: 18px; line-height: 1.28; letter-spacing: -.025em; }
.material-card__body p { max-width: 900px; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.material-card__meta { grid-area: meta; padding: 12px 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 10px; }
.material-card__tags,
.material-grid--home > .material-card:only-child .material-card__tags { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; grid-column: auto; grid-row: auto; }
.material-card__tags span { padding: 3px 5px; background: var(--surface-2); border-color: var(--line); font-size: 9px; }
.material-card footer,
.material-grid--home > .material-card:only-child footer {
  grid-area: footer;
  grid-column: auto;
  grid-row: auto;
  margin: 12px 18px 0;
  padding: 11px 0 14px;
  align-items: center;
  border-top: 1px solid var(--line);
  font-size: 10px;
}
.material-card footer span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-card footer span:last-child { color: var(--blue); }

.catalog-page { min-height: calc(100dvh - 60px); background: #f7f8fa; }
.catalog-layout { max-width: 1440px; grid-template-columns: 210px minmax(0, 1fr); gap: 34px; padding: 28px clamp(24px, 4vw, 58px) 54px; }
.catalog-results { width: 100%; max-width: 1040px; padding: 0; }
.catalog-filters__sticky { top: 18px; }
.filter-title { margin: 0 0 10px; padding: 0 10px; min-height: 32px; }
.catalog-filters a { min-height: 42px; padding: 0 10px; background: transparent; }
.catalog-filters a:hover { background: #fff; }
.catalog-filters a.is-active { border-left-width: 2px; background: #fff; }
.catalog-search { min-height: 50px; border-radius: 0; box-shadow: none; }
.catalog-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .07); }
.catalog-search .button { border-radius: 2px; box-shadow: none; }
.results-heading { margin: 25px 0 14px; }
.results-heading h1 { color: var(--navy); font-size: 29px; letter-spacing: -.035em; }

.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr);
  background: #fff;
}
.auth-bar { min-height: 60px; padding: 0 clamp(18px, 3.5vw, 48px); display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.auth-bar .wordmark__shape { width: 31px; height: 31px; }
.auth-bar .wordmark__shape i { border-width: 3px; }
.auth-bar .wordmark__shape i:last-child { width: 17px; height: 17px; }
.auth-back { position: static; color: var(--blue); font-size: 12px; font-weight: 750; }
.auth-form-panel { min-height: 0; padding: clamp(48px, 8vh, 84px) 24px 48px; display: grid; place-items: start center; overflow: visible; }
.auth-form-wrap { width: min(560px, 100%); }
.auth-heading { margin-bottom: 28px; }
.auth-heading h1 { color: var(--navy); font-size: 38px; line-height: 1.08; letter-spacing: -.045em; }
.auth-heading > p:last-child { margin: 11px 0 0; max-width: 500px; }
.auth-form-panel .button { border-radius: 2px; box-shadow: none; }
.auth-form-panel .button:hover:not(:disabled) { box-shadow: none; }
.auth-success__icon { width: 58px; height: 58px; margin-bottom: 18px; }
.auth-success h1 { color: var(--navy); font-size: 34px; letter-spacing: -.04em; }
.auth-success > p { margin: 14px 0 24px; color: var(--muted); line-height: 1.6; }

.files-manager-actions { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.files-manager-actions > [data-library-bulk-actions] { display: flex; align-items: center; gap: 6px; }
.files-manager-actions [data-library-selected-count] { margin-right: 3px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }

@media (max-width: 1100px) {
  .home-hero { grid-template-columns: minmax(0, 1fr) 250px; gap: 42px; }
  .home-index { width: 250px; transform: scale(.8); transform-origin: right center; }
  .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .catalog-results { max-width: none; }
  .catalog-filters__sticky { position: static; display: flex; flex-direction: row; gap: 5px; overflow-x: auto; padding-bottom: 4px; }
  .catalog-filters .filter-title { display: none; }
  .catalog-filters a { min-height: 36px; flex: 0 0 auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
  .catalog-filters a.is-active { border-left-width: 1px; border-color: var(--blue); background: var(--blue); color: #fff; }
}

@media (max-width: 760px) {
  .public-header { height: 60px; padding-inline: 14px; }
  .home-hero { min-height: 0; padding: 54px 20px 50px; grid-template-columns: minmax(0, 1fr); }
  .home-hero h1 { font-size: clamp(38px, 10.2vw, 48px); }
  .home-hero__content > p { font-size: 14px; }
  .home-index { display: none; }
  .home-latest { padding: 32px 20px 42px; }
  .home-latest h2 { font-size: 21px; }
  .material-card,
  .material-grid--home > .material-card:only-child { min-height: 0; display: grid; }
  .catalog-layout { padding: 14px 14px 38px; }
  .catalog-search { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .results-heading h1 { font-size: 26px; }
  .auth-form-panel { min-height: 0; padding: 42px 20px; }
  .auth-heading h1 { font-size: 34px; }
  .files-manager-toolbar { align-items: stretch; flex-wrap: wrap; }
  .files-manager-toolbar > label:first-child { order: 1; }
  .files-manager-toolbar > .table-search { order: 2; min-width: 0; flex: 1 1 220px; }
  .files-manager-actions { order: 3; width: 100%; justify-content: flex-end; }
  .files-manager-actions > [data-library-bulk-actions] { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 520px) {
  .home-search { grid-template-columns: auto minmax(0, 1fr); padding: 11px 12px; }
  .home-search .button { grid-column: 1 / -1; width: 100%; margin-top: 2px; }
  .home-latest > header { align-items: center; }
  .material-card__top { align-items: flex-start; gap: 12px; }
  .material-card__meta { align-items: flex-end; }
  .catalog-search { grid-template-columns: auto minmax(0, 1fr) auto; }
  .catalog-search > .button { grid-column: 1 / -1; width: 100%; }
  .form-row--two { grid-template-columns: 1fr; }
  .auth-bar { padding-inline: 14px; }
}

/* ============================================================
   UI_FIXES_PLAN.md — правки по трём экранам.
   Блок идёт последним намеренно: перекрывает более ранние
   объявления тех же селекторов без гонки специфичности.
   ============================================================ */

/* 0.3 — серьёзность замечания определяет цвет, а не факт наличия.
   error → красный (блокирует), warning → оранжевый, info → синий. */
.chat-attachment--error { border-left-color: var(--red); background: #fff0f3; }
.chat-attachment--warning { border-left-color: var(--orange); background: #fff6ef; }
.chat-attachment--info { border-left-color: var(--blue); background: var(--blue-pale); }
.attachment-status--error { background: var(--red); }
.attachment-status--warning { background: var(--orange); }
.attachment-status--info { background: var(--blue); }

.issue-severity--error { background: #fdeaf0; color: var(--red); }
.issue-severity--warning { background: var(--orange-soft); color: #8d3d12; }
.issue-severity--info { background: var(--blue-pale); color: var(--blue); }

.moderation-issue--error { border-left-color: var(--red); }
.moderation-issue--warning { border-left-color: var(--orange); }
.moderation-issue--info { border-left-color: var(--blue); }
.moderation-issue.is-closed { border-left-color: var(--green); }

/* 2.5 — «Удалить» отличается от «Исправлено» и «Принять». */
.issue-actions button.issue-action-danger:hover,
.issue-actions button.issue-action-danger:focus-visible { border-color: var(--red); color: var(--red); }

/* 2.4 — заголовок «Замечания» получил кнопку добавления. */
.moderation-inspector-section.moderation-issues > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.moderation-inspector-section.moderation-issues > header .icon-button { width: 26px; height: 26px; color: var(--muted); }
.moderation-inspector-section.moderation-issues > header .icon-button:hover { color: var(--blue); background: var(--blue-pale); }

/* 2.6 — полоса решений принадлежит заявке, а не панели файлов. */
.moderation-file-inspector > .moderation-decision-bar { border-top: 1px solid var(--line-dark); background: var(--surface-2); }

/* 2.7 — фильтр очереди оформлен как остальные поля. */
.moderation-queue-filter select {
  border-radius: 5px;
  appearance: none;
  padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.moderation-queue-filter select:focus-visible { border-color: var(--blue); outline: none; box-shadow: 0 0 0 2px var(--blue-pale); }

/* 1.1 — чекбокс проекта появляется при наведении и остаётся при выборе. */
.workspace-project-card .project-select { opacity: 0; transition: opacity .12s ease; }
.workspace-project-card:hover .project-select,
.workspace-project-card:focus-within .project-select,
.workspace-project-card .project-select:has(input:checked) { opacity: 1; }

/* 1.2 — пустой блок не растягивает полосу. */
.home-stream-empty { padding: 12px; }

/* 1.6 — заголовок раздела не легче своей кнопки. */
.workspace-projects-head h2 { font-size: 17px; }

/* 2.1 — при открытой заявке очередь уступает ширину переписке. */
.moderation-inbox.has-selection { grid-template-columns: 200px minmax(0, 1fr); }
.moderation-inbox.has-selection.is-inspector-open { grid-template-columns: 200px minmax(0, 1fr) 300px; }

/* 3.1 — колонка по содержимому, а не во всю высоту экрана. */
.kanban-board { align-content: start; }
.kanban-column { min-height: 220px; }
.kanban-dropzone { flex: 1 1 auto; min-height: 0; }

/* 3.2 — подвал карточки в одну строку. */
.kanban-card { position: relative; }
.kanban-card footer { gap: 8px; }
.kanban-card footer > span:first-child { min-width: 0; flex: 1 1 auto; display: flex; align-items: center; gap: 5px; }
.kanban-card footer > span:first-child small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card footer > time { flex: 0 0 auto; white-space: nowrap; }

/* 3.3 — кнопки перемещения не занимают место в подвале. */
.kanban-card__move {
  position: absolute;
  right: 9px;
  bottom: 8px;
  padding-left: 8px;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.kanban-card:hover .kanban-card__move,
.kanban-card:focus-within .kanban-card__move { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce) {
  .workspace-project-card .project-select,
  .kanban-card__move { transition: none; }
}

@media (max-width: 1180px) {
  .moderation-inbox.has-selection { grid-template-columns: 180px minmax(0, 1fr); }
  .moderation-inbox.has-selection.is-inspector-open { grid-template-columns: 180px minmax(0, 1fr) 285px; }
}

@media (max-width: 900px) {
  .moderation-inbox.has-selection,
  .moderation-inbox.has-selection.is-inspector-open { grid-template-columns: minmax(0, 1fr) 285px; }
}

/* На узких экранах наведения нет — оставляем элементы видимыми. */
@media (hover: none) {
  .workspace-project-card .project-select,
  .kanban-card__move { opacity: 1; pointer-events: auto; }
  .kanban-card__move { position: static; padding-left: 0; background: none; }
}

/* ============================================================
   UNIFIED WORKSPACE GEOMETRY — 2026-08-26
   Home, moderation, kanban and project tools use one compact grid.
   ============================================================ */
:root {
  --workspace-header-height: 64px;
  --project-tabs-height: 42px;
  --project-workspace-offset: 106px;
}

.workspace-shell { grid-template-columns: var(--workspace-sidebar-width, 236px) minmax(0, 1fr); }

.public-header,
.auth-bar { height: var(--workspace-header-height); min-height: var(--workspace-header-height); }
.auth-page { grid-template-rows: var(--workspace-header-height) minmax(0, 1fr); }

.compact-page-head {
  height: var(--workspace-header-height);
  min-height: var(--workspace-header-height);
  padding: 0 clamp(18px, 3vw, 34px);
  flex-direction: row;
  align-items: center;
}
.compact-page-head h1 { font-size: 24px; }
.compact-page-head p { display: none; }

.dm-inbox__rail > header,
.dm-conversation__head,
.moderation-inbox .moderation-queue > header,
.moderation-thread__head,
.moderation-file-inspector > header {
  height: var(--workspace-header-height);
  min-height: var(--workspace-header-height);
  padding-top: 0;
  padding-bottom: 0;
}
.moderation-thread,
.moderation-file-inspector { grid-template-rows: var(--workspace-header-height) minmax(0, 1fr) auto; }
.moderation-inbox .moderation-queue { grid-template-rows: var(--workspace-header-height) 42px minmax(0, 1fr); }

.project-header__top {
  height: var(--workspace-header-height);
  min-height: var(--workspace-header-height);
  padding: 6px clamp(16px, 2.4vw, 30px);
  display: flex;
  align-items: center;
}
.project-title { min-width: 0; }
.project-title > .project-symbol { width: 40px; height: 40px; flex: 0 0 40px; font-size: 13px; }
.project-title h1 { margin-top: 2px; font-size: 19px; line-height: 1.08; }
.project-title p { display: none; }
.project-title__meta { font-size: 8px; }
.project-tabs { height: var(--project-tabs-height); min-height: var(--project-tabs-height); }
.project-tabs a { height: var(--project-tabs-height); min-height: var(--project-tabs-height); }

/* Home: two independent information panels, then a project-local search. */
.workspace-home-stream {
  margin: 12px clamp(18px, 3vw, 34px) 0;
  display: grid;
  grid-template-columns: minmax(260px, .8fr) minmax(360px, 1.2fr);
  gap: 12px;
  border: 0;
  background: transparent;
}
.workspace-home-stream > section {
  min-height: 154px;
  max-height: 252px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.workspace-home-stream > section + section { border-left: 1px solid var(--line); }
.home-schedule > div,
.home-announcement-list { max-height: 205px; }
.workspace-projects-head {
  min-height: 58px;
  margin: 8px clamp(18px, 3vw, 34px) 0;
  display: grid;
  grid-template-columns: auto minmax(280px, 440px) auto;
  align-items: center;
  gap: 12px;
}
.workspace-project-search { width: 100%; justify-self: center; }
.workspace-projects-head > .button { justify-self: end; }
.dashboard-projects--full { padding-top: 0; }

/* Resize handles stay quiet until the pointer reaches an edge. */
.workspace-sidebar,
.moderation-queue,
.moderation-file-inspector,
.dm-inbox__rail,
.chat-context-panel,
.chat-file-panel,
.repo-tree-pane,
.repo-history-pane { position: relative; }
.panel-resizer {
  width: 9px;
  min-width: 9px;
  height: auto;
  padding: 0;
  position: absolute;
  z-index: 70;
  top: 0;
  bottom: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}
.panel-resizer[data-edge="right"] { right: -5px; }
.panel-resizer[data-edge="left"] { left: -5px; }
.panel-resizer::after {
  content: "";
  width: 1px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 4px;
  background: transparent;
}
.panel-resizer:hover::after,
.panel-resizer:focus-visible::after,
body.is-resizing-panel .panel-resizer::after { background: var(--blue); }
.panel-resizer:focus-visible { outline: 0; }
body.is-resizing-panel { cursor: col-resize; user-select: none; }

/* Moderation: the inspector exists only for the file that was clicked. */
.moderation-inbox {
  grid-template-columns: var(--moderation-queue-width, 230px) minmax(0, 1fr);
}
.moderation-inbox.has-selection { grid-template-columns: var(--moderation-queue-width, 230px) minmax(0, 1fr); }
.moderation-inbox.is-inspector-open,
.moderation-inbox.has-selection.is-inspector-open {
  grid-template-columns: var(--moderation-queue-width, 230px) minmax(0, 1fr) var(--moderation-inspector-width, 340px);
}
.moderation-file-inspector { width: auto; }
.moderation-file-inspector > header { padding-inline: 13px 9px; }
.moderation-file-inspector > header h2 { font-size: 14px; }
.moderation-file-inspector__scroll {
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
}
.moderation-file-inspector .attachment-analysis-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.moderation-file-inspector .attachment-analysis-panel > header {
  padding: 11px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  background: var(--surface-2);
}
.moderation-file-inspector .attachment-analysis-panel > p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #fff;
}
.moderation-file-inspector .attachment-panel-actions {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.moderation-file-inspector .moderation-inspector-section {
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}
.moderation-file-inspector .moderation-inspector-section > header { margin-bottom: 8px; }
.moderation-file-inspector .moderation-inspector-section > header h3 span { color: var(--muted); }
.moderation-file-inspector > .moderation-decision-bar { padding: 9px; background: #fff; }
.moderation-main-decisions { gap: 7px; }

/* Chat and repository side panes use the same adjustable columns. */
.dm-inbox { grid-template-columns: var(--chat-rail-width, 296px) minmax(0, 1fr); }
.dm-inbox.is-context-open { grid-template-columns: var(--chat-rail-width, 296px) minmax(0, 1fr) var(--context-panel-width, 280px); }
.dm-inbox.is-file-open { grid-template-columns: var(--chat-rail-width, 296px) minmax(0, 1fr) var(--file-panel-width, 320px); }
.project-chat-layout.unified-chat.is-context-open,
.researcher-dm-layout.is-context-open { grid-template-columns: minmax(0, 1fr) var(--context-panel-width, 280px); }
.project-chat-layout.unified-chat.is-file-open,
.researcher-dm-layout.is-file-open { grid-template-columns: minmax(0, 1fr) var(--file-panel-width, 320px); }
.repository-layout { grid-template-columns: var(--repo-tree-width, 225px) minmax(0, 1fr) var(--repo-history-width, 260px); }

/* Project chat occupies the complete tool area, like the repository. */
.project-tab-content--chat {
  height: calc(100dvh - var(--project-workspace-offset));
  min-height: 0;
  padding: 0;
  display: grid;
  overflow: hidden;
}
.project-chat-layout.unified-chat {
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: #fff;
}
.project-chat-layout .project-chat-main,
.project-chat-layout.is-context-open .project-chat-main {
  min-width: 0;
  min-height: 0;
  border: 0;
}
.project-chat-layout .chat-context-panel,
.project-chat-layout .chat-file-panel { border-left: 1px solid var(--line); }

/* Kanban: compact, readable cards and drag-only movement. */
.project-tab-content--kanban { padding: 0; background: #fff; }
.kanban-toolbar {
  min-height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.kanban-toolbar h2 { font-size: 16px; }
.kanban-board {
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(5, minmax(270px, 340px));
  align-items: start;
  align-content: start;
  gap: 12px;
  overflow: auto;
  background: #fff;
}
.kanban-column {
  min-height: 148px;
  height: max-content;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-dark);
  background: #f6f7f9;
}
.kanban-column > header { min-height: 42px; padding: 0 10px 0 12px; border-bottom: 1px solid var(--line); }
.kanban-column > header b { color: var(--navy); font-size: 10px; letter-spacing: .06em; }
.kanban-column > header button { width: 28px; height: 28px; color: var(--muted); }
.kanban-column > header button:hover { color: var(--blue); background: var(--blue-pale); }
.kanban-column header i { display: none; }
.kanban-dropzone {
  min-height: 82px;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.kanban-card {
  min-height: 0;
  padding: 11px;
  border: 1px solid var(--line-dark);
  background: #fff;
  box-shadow: none;
  cursor: grab;
}
.kanban-card:hover,
.kanban-card:focus-within { border-color: var(--blue); box-shadow: none; }
.kanban-card:active { cursor: grabbing; }
.kanban-card.is-dragging { opacity: .48; transform: none; }
.kanban-column.is-over { background: var(--blue-pale); }
.kanban-card__top { min-height: 22px; }
.kanban-card__top > button { width: 24px; height: 24px; color: var(--muted); }
.kanban-card h3 { margin-top: 8px; color: var(--navy); font-size: 13px; line-height: 1.35; }
.kanban-card > p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.kanban-card footer {
  margin-top: 10px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  font-size: 10px;
}
.kanban-card footer > span:first-child { min-width: 0; display: flex; align-items: center; gap: 6px; }
.kanban-card footer > span:first-child small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card footer > time { white-space: nowrap; }
.kanban-card__move { display: none !important; }
.kanban-column-empty { padding: 20px 8px; color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
  .moderation-inbox.has-selection { grid-template-columns: minmax(0, 1fr); }
  .moderation-inbox.has-selection .moderation-queue { display: none; }
  .moderation-inbox.has-selection.is-inspector-open,
  .moderation-inbox.is-inspector-open {
    grid-template-columns: minmax(0, 1fr) var(--moderation-inspector-width, 320px);
  }
  .moderation-inbox.is-inspector-open .moderation-queue { display: none; }
  .dm-inbox--conversation.is-context-open { grid-template-columns: minmax(0, 1fr) var(--context-panel-width, 300px); }
  .dm-inbox--conversation.is-file-open { grid-template-columns: minmax(0, 1fr) var(--file-panel-width, 320px); }
  .dm-inbox--conversation.is-context-open .dm-inbox__rail,
  .dm-inbox--conversation.is-file-open .dm-inbox__rail { display: none; }
}

@media (max-width: 1100px) {
  :root { --project-workspace-offset: 156px; }
}

@media (max-width: 760px) {
  .panel-resizer { display: none; }
  .workspace-shell { grid-template-columns: minmax(0, 1fr); }
  .compact-page-head { height: var(--workspace-header-height); min-height: var(--workspace-header-height); padding-inline: 12px; }
  .workspace-home-stream { margin-inline: 10px; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .workspace-home-stream > section + section { border-top: 1px solid var(--line); }
  .workspace-projects-head {
    margin-inline: 10px;
    padding-block: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .workspace-project-search { grid-column: 1 / -1; grid-row: 2; }
  .workspace-projects-head > .button { grid-column: 2; grid-row: 1; }
  .moderation-inbox.has-selection.is-inspector-open,
  .moderation-inbox.is-inspector-open { grid-template-columns: minmax(0, 1fr); }
  .moderation-inbox.has-selection.is-inspector-open .moderation-file-inspector,
  .moderation-inbox.is-inspector-open .moderation-file-inspector {
    width: min(330px, 90vw);
    position: absolute;
    z-index: 18;
    top: 0;
    right: 0;
    bottom: 0;
  }
  .project-chat-layout.unified-chat.is-context-open,
  .project-chat-layout.unified-chat.is-file-open,
  .researcher-dm-layout.is-context-open,
  .researcher-dm-layout.is-file-open,
  .dm-inbox.is-context-open,
  .dm-inbox.is-file-open { grid-template-columns: minmax(0, 1fr); }
  .kanban-board { grid-template-columns: repeat(5, minmax(250px, 290px)); padding: 8px; gap: 8px; }
}

/* Home workspace — compact information strip and project directory. */
.workspace-home-stream {
  height: clamp(176px, 16vh, 210px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.workspace-home-stream > section {
  width: auto;
  min-height: 0;
  max-height: none;
  height: 100%;
  grid-template-rows: 42px minmax(0, 1fr) auto;
}
.workspace-home-stream > section > header { min-height: 42px; padding-inline: 14px 8px; }
.workspace-home-stream > section > header .icon-button { width: 30px; height: 30px; color: var(--muted); }
.workspace-home-stream > section > header .icon-button:hover { color: var(--blue); background: var(--blue-pale); }
.home-schedule > div,
.home-announcement-list { max-height: none; }
.home-stream-empty {
  min-height: 100%;
  padding: 12px 14px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.home-announcements > form {
  min-height: 44px;
  padding: 4px 6px;
  align-items: end;
}
.home-announcements > form textarea {
  height: 36px;
  min-height: 36px;
  max-height: 84px;
  padding: 8px 10px;
  resize: none;
  overflow-y: auto;
  line-height: 1.35;
}
.home-announcements > form .chat-send-button { align-self: end; }

.workspace-projects-head {
  min-height: 64px;
  margin: 10px clamp(18px, 3vw, 34px) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.workspace-projects-head h2 { flex: 0 0 auto; }
.workspace-project-actions {
  min-width: 0;
  width: min(720px, 72%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.workspace-project-search { min-width: 240px; width: min(520px, 100%); flex: 1 1 420px; }
.workspace-project-actions > .button { flex: 0 0 auto; white-space: nowrap; }
.dashboard-projects--full { padding: 0 clamp(18px, 3vw, 34px) 32px; }
.dashboard-projects--full .project-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  background: #fff;
}
.workspace-project-card {
  min-height: 76px;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  position: relative;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background .14s ease;
}
.workspace-project-card:last-child { border-bottom: 0; }
.workspace-project-card:hover { transform: none; border-color: var(--line); background: #f9fbff; box-shadow: none; }
.workspace-project-card > a.workspace-project-card__link {
  min-width: 0;
  min-height: 76px;
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}
.workspace-project-card__body { min-width: 0; }
.workspace-project-card > a.workspace-project-card__link h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
  font-size: 14px;
}
.workspace-project-card > a.workspace-project-card__link p {
  min-height: 0;
  margin: 5px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}
.workspace-project-card__stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.workspace-project-card__stats > * { display: inline-flex; align-items: center; gap: 5px; }
.workspace-project-card > .project-select {
  width: 50px;
  height: auto;
  align-self: stretch;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
}

@media (max-width: 980px) {
  .workspace-project-actions { width: min(620px, 76%); }
  .workspace-project-card > a.workspace-project-card__link { grid-template-columns: 40px minmax(0, 1fr); }
  .workspace-project-card__stats { grid-column: 2; justify-content: flex-start; margin-top: 3px; }
}

@media (max-width: 760px) {
  .workspace-home-stream { height: auto; grid-template-columns: minmax(0, 1fr); }
  .workspace-home-stream > section { height: 178px; }
  .workspace-projects-head { min-height: 0; padding: 10px 0; flex-direction: column; align-items: stretch; gap: 9px; }
  .workspace-project-actions { width: 100%; }
  .workspace-project-search { min-width: 0; }
  .workspace-project-card > a.workspace-project-card__link { padding-inline: 10px; gap: 10px; }
  .workspace-project-card__stats { gap: 9px; flex-wrap: wrap; }
  .workspace-project-card > .project-select { width: 42px; }
}

@media (max-width: 520px) {
  .workspace-project-actions { flex-wrap: wrap; }
  .workspace-project-actions > .button { width: 100%; }
  .workspace-project-card__stats time { display: none; }
}

/* Schedule calendar — time vertically, days horizontally. */
.workspace-home-stream {
  height: clamp(360px, 44vh, 500px);
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr);
}
.home-schedule--calendar { min-width: 0; overflow: hidden; }
.home-schedule-actions { display: flex; align-items: center; gap: 4px; }
.home-schedule-actions > [data-calendar-today] {
  min-height: 30px;
  padding: 0 8px;
  color: var(--blue);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
}
.home-schedule-actions > [data-calendar-today]:hover { background: var(--blue-pale); }
.home-calendar {
  min-width: 0;
  min-height: 0;
  height: auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: #fff;
}
.home-calendar__grid {
  min-height: 100%;
  display: grid;
  grid-template-columns: 58px repeat(var(--calendar-days), 132px);
  grid-template-rows: 42px auto;
  align-items: stretch;
  position: relative;
}
.home-calendar__corner,
.home-calendar__day-head {
  height: 42px;
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  place-content: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line-dark);
  background: #fff;
}
.home-calendar__corner {
  z-index: 7;
  left: 0;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.home-calendar__day-head { grid-row: 1; gap: 1px; text-align: center; }
.home-calendar__day-head span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.home-calendar__day-head b { color: var(--ink-2); font-size: 10px; }
.home-calendar__day-head.is-weekend { background: #fafbfc; }
.home-calendar__day-head.is-today { border-bottom-color: var(--blue); background: var(--blue-pale); }
.home-calendar__day-head.is-today span,
.home-calendar__day-head.is-today b { color: var(--blue); }
.home-calendar__hours {
  grid-column: 1;
  grid-row: 2;
  position: sticky;
  z-index: 4;
  left: 0;
  background: #fff;
  border-right: 1px solid var(--line-dark);
}
.home-calendar__hours time {
  padding: 5px 7px 0 0;
  display: block;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font: 8px var(--mono);
  text-align: right;
}
.home-calendar__day {
  grid-row: 2;
  position: relative;
  border-right: 1px solid var(--line);
  background-color: #fff;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 43px, var(--line) 43px, var(--line) 44px);
}
.home-calendar__day.is-weekend { background-color: #fbfcfd; }
.home-calendar__day.is-today { background-color: #f8fbff; }
.home-schedule .home-calendar-event {
  min-width: 0;
  min-height: 0;
  padding: 4px 5px;
  display: block;
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border: 1px solid #b6c7e5;
  border-left: 3px solid var(--blue);
  color: var(--ink-2);
  background: #edf3ff;
  text-align: left;
  cursor: default;
}
.home-schedule button.home-calendar-event { cursor: pointer; }
.home-schedule button.home-calendar-event:hover,
.home-schedule button.home-calendar-event:focus-visible { border-color: var(--blue); background: #e4edff; outline: 0; }
.home-calendar-event time,
.home-calendar-event b,
.home-calendar-event small {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-calendar-event time { color: var(--blue); font: 8px var(--mono); }
.home-calendar-event b { margin-top: 2px; font-size: 9px; line-height: 1.2; }
.home-calendar-event small { margin-top: 2px; color: var(--muted); font-size: 8px; }

@media (max-width: 1100px) {
  .workspace-home-stream { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); }
}

@media (max-width: 760px) {
  .workspace-home-stream { height: auto; grid-template-columns: minmax(0, 1fr); }
  .workspace-home-stream > .home-schedule--calendar { height: 380px; }
  .workspace-home-stream > .home-announcements { height: 260px; }
}

/* Personal agent workspace and human review flow. Reuse the existing LANS palette. */
.feature-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 0;flex-wrap:wrap}
.feature-toolbar h2{margin:0;font-size:21px}.feature-toolbar p{margin:8px 0 0;color:var(--text-muted,#64748b)}
.feature-list{border-right:1px solid var(--border,#dde3ec);background:var(--surface-soft,#f7f9fc);overflow:auto;min-width:0}
.feature-list>header{display:flex;justify-content:space-between;padding:20px;border-bottom:1px solid var(--border,#dde3ec)}
.feature-list>a{display:grid;gap:6px;padding:18px 20px;text-decoration:none;color:inherit;border-bottom:1px solid var(--border,#dde3ec)}
.feature-list>a:hover,.feature-list>a.is-active{background:#e8effb;box-shadow:inset 3px 0 #2355a0}
.feature-list span,.feature-list small{color:#61708a;font-size:12px;overflow-wrap:anywhere}.feature-list b{overflow-wrap:anywhere}
.feature-empty{padding:36px 24px;color:#61708a;line-height:1.7}.feature-empty h2,.feature-empty h3{color:#173158}
.feature-chips,.feature-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.feature-chips{margin:16px 0}.feature-chips>span,.feature-chips>code{padding:7px 10px;background:#edf2f8;border-radius:4px;font-size:12px}
.feature-muted{color:#61708a;font-size:13px;line-height:1.6}.preserve-text{white-space:pre-wrap;overflow-wrap:anywhere}
.mr-layout{display:grid;grid-template-columns:260px minmax(0,1fr);border:1px solid #dbe2ee;background:white;min-height:500px}
.mr-detail{padding:24px;min-width:0}.mr-detail>header h2{margin:8px 0;font-size:25px}.mr-diff{max-height:460px;overflow:auto;margin:24px 0}
.mr-reviews article{border-bottom:1px solid #dde3ec;padding:16px 0}.mr-reviews article header{display:flex;gap:12px;flex-wrap:wrap;font-size:12px}.mr-reviews article p{font-size:14px;line-height:1.6}.mr-review-form{margin-top:24px;padding:20px;background:#f7f9fc;border:1px solid #dde3ec}
.personal-agent-layout{display:grid;grid-template-columns:270px minmax(0,1fr);border:1px solid #dbe2ee;background:white;height:calc(100dvh - 172px);min-height:540px;max-height:950px}
.personal-agent-conversation{display:flex;flex-direction:column;min-height:0;min-width:0}.personal-agent-conversation>.feature-empty{margin:auto;max-width:620px;text-align:center}
.personal-agent-heading{padding:18px 24px;display:flex;gap:16px;align-items:center;justify-content:space-between;border-bottom:1px solid #dbe2ee}.personal-agent-heading h2{margin:0 0 6px;font-size:20px}.personal-agent-heading a{font-size:12px}.personal-agent-heading>div:last-child{display:grid;gap:8px;max-width:280px}.agent-connection{font-size:11px;color:#627289;line-height:1.5}
.personal-agent-messages{flex:1;overflow:auto;min-height:0;padding:24px;overflow-anchor:none}.agent-message{margin:0 auto 24px;max-width:860px;padding:18px 20px;border:1px solid #e0e6ef;border-radius:6px}.agent-message--user{background:#eff4fc;margin-left:40px;border-color:#d8e4f5}.agent-message--assistant{background:white;margin-right:20px}
.agent-message header{display:flex;gap:12px;align-items:center;font-size:12px;margin-bottom:12px}.agent-message header time{color:#78849a}.agent-message header button{margin-left:auto}.agent-message-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.8}.agent-message footer{display:flex;gap:16px;align-items:center;margin-top:16px;flex-wrap:wrap;font-size:12px}.agent-message footer a{display:flex;align-items:center;gap:6px}
.agent-chat-progress{display:flex;align-items:center;gap:16px;max-width:860px;margin:20px auto;padding:16px;background:#f2f5fa;font-size:13px}.agent-chat-progress small{display:block;margin-top:6px;color:#61708a}.agent-chat-progress button{margin-left:auto}
.agent-chat-composer{padding:16px 24px;border-top:1px solid #dde3ec;background:#fafbfd}.agent-chat-composer textarea{width:100%;resize:vertical;min-height:72px;max-height:200px;padding:14px;border:1px solid #b9c7dc;border-radius:6px;background:white;font:inherit;line-height:1.6}.agent-chat-composer footer{display:flex;justify-content:space-between;align-items:center;gap:16px;padding-top:10px}.agent-chat-composer footer small{font-size:11px;color:#61708a}.agent-chat-composer details{font-size:12px;padding-bottom:10px}.agent-chat-composer summary{cursor:pointer;color:#3d5880}.agent-context-picker{display:grid;grid-template-columns:1fr 1fr;gap:16px;padding:12px 0}.agent-context-picker label{display:grid;gap:6px}.agent-context-picker select{width:100%;min-height:70px}
.integration-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:20px;margin-bottom:24px}.integration-module{border:1px solid #dde3ec;padding:24px;background:white;min-width:0}.integration-module header{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.integration-module header>div{flex:1}.integration-module h2{font-size:19px;margin:0 0 8px}.integration-module header span{color:#61708a;font-size:12px}.integration-module p{line-height:1.7;font-size:14px;overflow-wrap:anywhere}.integration-module>.button{margin:6px 8px 6px 0}.integration-module input{max-width:100%}.campaign-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 0;border:0;border-bottom:1px solid #dde3ec;background:none;width:100%;text-align:left;font:inherit;cursor:pointer}.campaign-row span{font-size:12px;color:#61708a}.gitlab-binding{justify-content:flex-start}.gitlab-binding .field{min-width:220px}.gitlab-binding button{align-self:flex-end}
@media(max-width:1000px){.personal-agent-layout{grid-template-columns:220px minmax(0,1fr)}.personal-agent-heading{align-items:flex-start;flex-direction:column}.personal-agent-heading>div:last-child{display:flex;flex-wrap:wrap;max-width:none}.agent-message--user{margin-left:12px}.mr-layout{grid-template-columns:200px minmax(0,1fr)}}
@media(max-width:650px){.personal-agent-layout,.mr-layout{grid-template-columns:1fr;height:auto;min-height:0}.personal-agent-layout>.feature-list,.mr-layout>.feature-list{max-height:180px;border-right:0;border-bottom:1px solid #dde3ec}.personal-agent-layout>.feature-list>a{padding:12px 16px}.personal-agent-conversation{height:calc(100dvh - 145px);min-height:520px}.personal-agent-heading,.personal-agent-messages,.agent-chat-composer,.mr-detail{padding:16px}.agent-message{padding:14px;margin-left:0;margin-right:0}.agent-chat-composer footer{align-items:flex-start}.agent-chat-composer footer small{max-width:160px}.integration-module{padding:18px}.feature-toolbar{gap:12px}.campaign-row{align-items:flex-start;flex-direction:column}}
@media(prefers-reduced-motion:reduce){.personal-agent-messages{scroll-behavior:auto}}
/* Keep the existing off-canvas sidebar breakpoint aligned with the shell grid. */
@media(max-width:1100px){.workspace-shell{grid-template-columns:minmax(0,1fr)}}
.agent-page-head{height:auto;min-height:64px;flex-wrap:wrap;gap:12px}.agent-page-head .page-head-actions{flex-wrap:wrap;gap:8px}
.workspace-content>.integration-grid,.workspace-content>.integration-module{margin:24px}
@media(max-width:650px){.agent-page-head{height:auto;padding-block:16px}.agent-page-head .page-head-actions{width:100%;justify-content:flex-start}.workspace-content>.integration-grid,.workspace-content>.integration-module{margin:16px}}
@media(max-width:650px){
  .agent-page-head .page-head-actions .button{padding-inline:8px;font-size:10px}
  .personal-agent-layout>.feature-list{max-height:120px}
  .personal-agent-conversation{height:calc(100dvh - 300px);min-height:400px}
}

/* Project agents fill the actual available space, including the project header. */
.workspace-shell { height: 100dvh; grid-template-rows: minmax(0, 1fr); }
.workspace-stage { height: 100%; }
.workspace-content:has(> .project-tab-content--agents) { display: flex; flex-direction: column; overflow: hidden; }
.workspace-content:has(> .project-tab-content--agents) > .project-header { flex: 0 0 auto; }
.project-tab-content--agents { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 0; }
.project-tab-content--agents .agent-page-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.agent-page-head h2 { color: var(--navy); font-size: 17px; }
.agent-page-head small { color: var(--muted); font-size: 11px; }
.project-tab-content--agents .personal-agent-layout { flex: 1; height: auto; min-height: 0; max-height: none; border: 0; }
.project-tab-content--agents .personal-agent-conversation { height: auto; min-height: 0; }
.personal-agent-heading { flex: 0 0 auto; }
.agent-chat-composer { flex: 0 0 auto; max-height: 55%; overflow-y: auto; padding: 12px 20px; }
.agent-chat-composer textarea { min-height: 62px; max-height: 140px; resize: vertical; }
.agent-composer-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.agent-message-files { display: grid; gap: 8px; margin-top: 12px; }
.agent-file-link { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.agent-file-link > span { display: grid; gap: 4px; flex: 1; min-width: 0; }
.agent-file-link b { overflow-wrap: anywhere; font-size: 12px; }
.agent-file-link small { color: var(--muted); font-size: 10px; }
.agent-selected-files { display: flex; gap: 6px; flex-wrap: wrap; max-height: 78px; overflow-y: auto; }
.agent-file-draft { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; margin-top: 8px; padding: 3px 6px; border: 1px solid var(--line); background: #fff; }
.agent-file-draft b { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.agent-file-draft small { color: var(--muted); font-size: 10px; }
.agent-file-draft .icon-button { width: 24px; height: 24px; }
@media (max-width: 1100px) {
  .workspace-sidebar { position: fixed; inset: 0 auto 0 0; height: 100dvh; z-index: 80; }
}
@media (max-width: 650px) {
  .project-tab-content--agents .agent-page-head { padding: 8px 12px; gap: 6px; }
  .project-tab-content--agents .agent-page-head > div:first-child { display: none; }
  .project-tab-content--agents .agent-page-head .page-head-actions { width: 100%; gap: 6px; justify-content: flex-end; }
  .project-tab-content--agents .personal-agent-layout { grid-template-rows: auto minmax(0, 1fr); }
  .personal-agent-layout > .feature-list { display: flex; max-height: 82px; overflow-x: auto; overflow-y: hidden; }
  .personal-agent-layout > .feature-list > header { flex: 0 0 90px; display: grid; gap: 4px; padding: 12px; }
  .personal-agent-layout > .feature-list > a { flex: 0 0 200px; padding: 12px; border-bottom: 0; border-left: 1px solid var(--line); }
  .personal-agent-heading { padding: 10px 12px; gap: 6px; }
  .personal-agent-heading h2 { font-size: 16px; }
  .personal-agent-messages { padding: 12px; }
  .agent-chat-composer { padding: 10px 12px; }
  .agent-chat-composer footer { align-items: center; gap: 8px; }
  .agent-composer-tools small { display: none; }
  .agent-chat-composer footer > .button { padding-inline: 12px; }
}

/* --- Git, agents and modules (logic fixes, October 2026) --- */
.protected-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--blue-pale); color: var(--blue); white-space: nowrap; }
.button--danger-text { color: var(--red); }
.button--danger-text:hover { border-color: var(--red); }
.code-editor footer input[name="new_branch"] { flex: 0 1 240px; min-width: 160px; font-family: var(--mono); font-size: 12px; }
.mr-state { padding: 7px 10px; border-radius: 4px; font-size: 12px; background: #edf2f8; color: var(--ink-2); }
.mr-state--ok { background: #e6f4ec; color: #17633f; }
.mr-state--bad { background: #fdeaf0; color: var(--red); overflow-wrap: anywhere; }
.mr-files { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--line); background: #fff; max-height: 220px; overflow: auto; }
.mr-files li { display: flex; gap: 12px; align-items: baseline; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.mr-files li:last-child { border-bottom: 0; }
.mr-files li span { flex: 0 0 96px; color: var(--muted); }
.mr-files code { overflow-wrap: anywhere; }
.mr-delete-source { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.agent-branch-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agent-branch-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 4px; background: #edf2f8; font-family: var(--mono); font-size: 11px; color: var(--navy); }
.agent-branch-note { color: #627289; font-size: 11px; line-height: 1.5; }
.agent-message--system { background: #fff7f9; border-color: #f3c9d5; margin-right: 20px; }
.agent-message--system .agent-message-text { color: var(--red); font-size: 13px; }
.integration-problem { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: #fff5ea; color: #8a3a0c; font-size: 13px !important; line-height: 1.5 !important; }
.integration-problem svg { flex: 0 0 auto; margin-top: 2px; }
.account-newsletter { max-width: 760px; margin: 0 clamp(18px, 3vw, 34px) 18px; padding: 17px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.account-newsletter div { display: grid; gap: 4px; }
.account-newsletter small { color: var(--muted); font-size: 12px; }
@media (max-width: 650px) {
  .code-editor footer { flex-wrap: wrap; }
  .code-editor footer input[name="new_branch"] { flex-basis: 100%; }
  .account-newsletter { flex-direction: column; align-items: flex-start; }
}
/* The web editor form: the textarea fills the pane, the commit bar sits below it. */
form.code-editor { display: flex; flex-direction: column; flex: 1 1 auto; padding: 0; min-height: 0; resize: none; }
form.code-editor[hidden] { display: none; }
form.code-editor textarea { flex: 1 1 auto; width: 100%; min-height: 320px; padding: 15px; border: 0; outline: 0; resize: none; background: #fbfcfe; color: #26364e; font: 12px/1.65 var(--mono); tab-size: 4; white-space: pre; overflow: auto; }
form.code-editor footer { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
form.code-editor footer input { min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line-dark); background: #fff; color: var(--ink); font: 13px var(--font); }
form.code-editor footer input[name="message"] { flex: 1 1 auto; }
form.code-editor footer input:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }

/* --- Modules and project sections: toggle switches --- */
.switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; z-index: 1; }
.switch__track { position: relative; width: 40px; height: 22px; border-radius: 11px; background: var(--line-dark); transition: background .15s; }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(16 24 40 / .25); transition: transform .15s; }
.switch input:checked + .switch__track { background: var(--green); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch__track { opacity: .45; }
.integration-module header .switch { margin-left: auto; }
.module-group-title { margin: 24px 24px 12px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.module-preview-notice { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px clamp(16px, 4vw, 48px); background: #fff5ea; color: #8a3a0c; font-size: 13px; border-bottom: 1px solid #f5d9bd; }
.project-sections-card { padding: 17px; border: 1px solid var(--line); background: #fff; }
.project-sections-card .workspace-panel-heading { padding: 0; border: 0; min-height: 0; }
.project-sections-card .feature-muted { margin: 8px 0 12px; font-size: 12px; }
.project-sections-list { list-style: none; margin: 0; padding: 0; }
.project-sections-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.project-sections-list li div { display: grid; gap: 3px; min-width: 0; }
.project-sections-list li b { font-size: 14px; }
.project-sections-list li small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.project-sections-list li.is-off b { color: var(--muted); }
.project-settings-layout--sections { grid-template-columns: minmax(0, 1fr) 320px; }
@media (max-width: 1100px) { .project-settings-layout--sections { grid-template-columns: minmax(0, 1fr); } }
.project-sections-card .workspace-panel-heading h2 { font-size: 20px; }

/* --- Agent teams: list, builder canvas, inspector --- */
.teams-screen { padding: 18px clamp(18px, 3vw, 34px) 32px; }
.teams-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.teams-intro h2 { margin: 0 0 6px; font-size: 18px; }
.teams-intro p { margin: 0; max-width: 720px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.teams-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.team-card { position: relative; padding: 16px; border: 1px solid var(--line); background: #fff; display: grid; gap: 8px; align-content: start; }
.team-card:hover { border-color: var(--blue-soft); box-shadow: var(--shadow-sm); }
.team-card__link { position: absolute; inset: 0; z-index: 0; }
.team-card h3 { margin: 0; font-size: 15px; }
.team-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.team-card footer { display: grid; gap: 3px; color: var(--muted); font-size: 11px; }
.team-card .button { position: relative; z-index: 1; justify-self: start; }

.team-builder { height: 100dvh; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: #fff; }
.team-toolbar { display: flex; align-items: center; gap: 10px; padding: 10px clamp(12px, 2vw, 20px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.team-name { flex: 1 1 260px; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid transparent; background: transparent; font: 700 18px var(--font); color: var(--navy); }
.team-name:hover:not(:disabled), .team-name:focus { border-color: var(--line-dark); background: #fff; outline: none; }
.team-save-state { font-size: 12px; color: var(--muted); white-space: nowrap; }
.team-save-state[data-tone="ok"] { color: var(--green); }
.team-save-state[data-tone="error"] { color: var(--red); }
.team-toolbar__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.team-readonly-note { margin: 0; padding: 8px 20px; background: var(--blue-pale); color: var(--ink-2); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.team-workarea { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; }
.team-canvas-scroll { min-height: 0; overflow: auto; background: var(--surface-2); }
.team-canvas { position: relative; background-image: radial-gradient(#c7cfdb 1.2px, transparent 1.2px); background-size: 24px 24px; }
.team-edges { position: absolute; inset: 0; }
.team-edge__line { fill: none; stroke: #7c8aa3; stroke-width: 2; }
.team-edge__hit { fill: none; stroke: transparent; stroke-width: 16; cursor: pointer; pointer-events: stroke; }
.team-edge:hover .team-edge__line { stroke: var(--blue); }
.team-edge.is-selected .team-edge__line { stroke: var(--blue); stroke-width: 3; }
.team-edge__draft { fill: none; stroke: var(--blue); stroke-width: 2; stroke-dasharray: 6 5; }
.team-arrow-head { fill: #7c8aa3; }
.team-arrow-head--active { fill: var(--blue); }
.team-node { position: absolute; width: 240px; min-height: 104px; padding: 0; border: 1px solid #9bbce6; background: #dceafa; box-shadow: 0 7px 18px rgb(15 45 105 / .08); display: grid; grid-template-rows: auto 1fr auto; user-select: none; }
.team-node:focus-visible, .team-node.is-selected { outline: 2px solid var(--blue); outline-offset: 2px; }
.team-node.is-dragging { box-shadow: var(--shadow-lg); z-index: 5; }
.team-node header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px 6px; cursor: grab; }
.team-builder.is-readonly .team-node header { cursor: default; }
.team-node header b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-node p { margin: 0; padding: 0 12px; font-size: 11px; line-height: 1.45; color: #263342; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.team-node footer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px 9px; font-size: 10px; color: rgb(0 0 0 / .55); }
.team-node footer span { display: inline-flex; align-items: center; gap: 3px; }
.team-badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 99px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.team-badge--entry { background: var(--navy); color: #fff; }
.team-badge--write { background: rgb(34 156 102 / .15); color: #17633f; }
.team-node__port { position: absolute; top: calc(50% - 9px); width: 18px; height: 18px; border-radius: 0; border: 2px solid var(--blue); background: #fff; padding: 0; }
.team-node__port--output { right: -9px; cursor: crosshair; }
.team-node__port--output:hover { background: var(--blue); }
.team-node__port--input { left: -9px; border-color: var(--orange); }
.team-node__port--input:hover { background: var(--orange); }
.team-builder.is-readonly .team-node__port { cursor: default; }
.team-node--yellow { background: var(--yellow-soft); border-color: #e3cf62; }
.team-node--green { background: #e1f0e7; border-color: #a2d1b9; }
.team-node--pink { background: #fde7ec; border-color: #eab0bf; }
.team-node--violet { background: #eee6f4; border-color: #c7b0da; }
.team-node--gray { background: #eef0f3; border-color: #c9cfd8; }
.team-inspector { min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: #fff; }
.team-inspector__form { padding: 16px; display: grid; gap: 12px; align-content: start; }
.team-inspector__form > header { display: flex; align-items: center; justify-content: space-between; }
.team-inspector__form h3 { margin: 0; font-size: 15px; }
.team-inspector__form h4 { margin: 4px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.team-inspector__form p { margin: 0; font-size: 13px; line-height: 1.55; }
.team-inspector textarea[name="prompt"] { font: 12px/1.55 var(--mono); }
.team-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); cursor: pointer; }
.team-toggle input { margin-top: 3px; }
.team-toggle span { display: grid; gap: 2px; }
.team-toggle small { color: var(--muted); font-size: 11px; }
.team-tones { display: flex; gap: 8px; }
.team-tone { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer; background: #dceafa; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); }
.team-tone.is-active { border-color: var(--navy); }
.team-tone--yellow { background: var(--yellow-soft); } .team-tone--green { background: #e1f0e7; } .team-tone--pink { background: #fde7ec; } .team-tone--violet { background: #eee6f4; } .team-tone--gray { background: #eef0f3; }
.team-note { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: var(--blue-pale); font-size: 12px !important; }
.team-note--ok { background: #e6f4ec; color: #17633f; }
.team-links { display: grid; gap: 6px; }
.team-links span { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 8px; border: 1px solid var(--line); font-size: 12px; }
.team-links span button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px; }
.team-links small { color: var(--muted); font-size: 12px; }
.team-warnings ul, .team-help ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12px; line-height: 1.5; }
.team-warnings { padding: 10px 12px; background: #fff5ea; color: #8a3a0c; }
.team-help { color: var(--ink-2); }
.team-mode, .team-kind { display: inline-flex; border: 1px solid var(--line-dark); background: #fff; }
.team-mode button, .team-kind button { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 10px; border: 0; background: transparent; font: 600 12px var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.team-mode button + button, .team-kind button + button { border-left: 1px solid var(--line); }
.team-mode button.is-active, .team-kind button.is-active { background: var(--navy); color: #fff; }
.team-mode button:disabled { cursor: default; }
.team-mode button:disabled:not(.is-active) { color: var(--muted); }
.team-kind { display: flex; }
.team-kind button { flex: 1 1 0; justify-content: center; padding: 0 6px; }
.team-node p code, .team-inspector code { font: 11px var(--mono); background: rgb(0 0 0 / .06); padding: 0 3px; }
.team-node--lean, .team-node--program { border-style: dashed; border-width: 2px; }
.team-badge--check { background: rgb(0 0 0 / .08); color: var(--ink-2); }
.team-edge__label rect { fill: #fff; stroke: #7c8aa3; stroke-width: 1; }
.team-edge__label text { font: 600 11px var(--font); fill: var(--ink-2); pointer-events: none; }
.team-edge__label { cursor: pointer; }
.team-edge--passed .team-edge__line { stroke: #2e9a66; }
.team-edge--passed .team-edge__label rect { stroke: #2e9a66; fill: #ecf7f0; }
.team-edge--passed .team-edge__label text { fill: #17633f; }
.team-edge--failed .team-edge__line { stroke: #d0632b; stroke-dasharray: 7 4; }
.team-edge--failed .team-edge__label rect { stroke: #d0632b; fill: #fff3ea; }
.team-edge--failed .team-edge__label text { fill: #8a3a0c; }
.team-edge--contains .team-edge__label rect { stroke: #7c5cc4; fill: #f3eefb; }
.team-edge--contains .team-edge__label text { fill: #4b2f8f; }
.team-edge--otherwise .team-edge__line { stroke-dasharray: 3 4; }
.team-edge.is-selected .team-edge__line { stroke: var(--blue); }
.team-edge.is-selected .team-edge__label rect { stroke: var(--blue); stroke-width: 2; }
.team-link-edge { cursor: pointer; }
.team-link-edge small { margin-left: auto; }
.team-link-edge:hover { border-color: var(--blue-soft) !important; }
@media (max-width: 1000px) {
  .team-builder { height: auto; }
  .team-workarea { grid-template-columns: 1fr; }
  .team-canvas-scroll { height: 62vh; }
  .team-inspector { border-left: 0; border-top: 1px solid var(--line); }
}

/* --- Agent connections --- */
.library-subtitle { margin: 4px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.connections { margin-top: 28px; }
.connections > header h2 { margin: 0 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.connections > header p { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.connections-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.connection-card { padding: 16px; border: 1px solid var(--line); background: #fff; display: grid; gap: 12px; align-content: start; }
.connection-card h3 { margin: 0 0 6px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.connection-card header p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.connection-card footer { display: flex; gap: 8px; flex-wrap: wrap; }
.connection-list { list-style: none; margin: 0; padding: 0; display: grid; }
.connection-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.connection-list li > div { display: grid; gap: 4px; min-width: 0; }
.connection-list small { color: var(--muted); font-size: 11px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.connection-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.connection-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-dark); }
.connection-status.is-online { color: #17633f; }
.connection-status.is-online i { background: var(--green); }
.connection-agent { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-size: 11px; }
.connection-agent em { font-style: normal; color: var(--muted); font-size: 10px; }
.secret-field { display: flex; gap: 8px; }
.secret-field input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; }
.snippet { position: relative; }
.snippet pre { margin: 0; padding: 12px 40px 12px 12px; background: #0f1b33; color: #dce6f5; font: 12px/1.55 var(--mono); overflow: auto; }
.snippet .icon-button { position: absolute; top: 6px; right: 6px; background: #fff; }
.connection-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.55; }
.thread-modal-links { font-size: 12px; }

/* --- Agent run trace in chats --- */
.agent-who { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.agent-connection.is-online { color: #17633f; }
.agent-trace { margin-top: 12px; border-top: 1px dashed var(--line-dark); padding-top: 8px; font-size: 12px; }
.agent-trace summary { cursor: pointer; color: var(--muted); font-weight: 700; }
.agent-trace ol { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; max-height: 320px; overflow-y: auto; }
.agent-trace__item { display: grid; grid-template-columns: 92px auto minmax(0, 1fr); gap: 8px; align-items: baseline; padding-left: calc(var(--depth, 0) * 18px); }
.agent-trace__item span { color: var(--muted); font-size: 11px; }
.agent-trace__item b { font-size: 12px; white-space: nowrap; }
.agent-trace__item p { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.agent-trace__item--delegate span { color: var(--blue); }
.agent-trace__item--write span { color: var(--green); }
.agent-trace__item--error span, .agent-trace__item--error p { color: var(--red); }
.agent-chat-progress .agent-trace { margin-top: 6px; }
@media (max-width: 650px) { .agent-trace__item { grid-template-columns: 1fr; gap: 0; } .teams-intro { flex-direction: column; } }

/* GitLab: per-project connection */
.gitlab-connect { margin: 0 0 24px; padding: 24px; border: 1px solid #dde3ec; background: #fff; max-width: 880px; }
.gitlab-connect[hidden] { display: none; }
.gitlab-connect h3 { margin: 0; font-size: 17px; color: var(--navy); }
.gitlab-connect .feature-actions { margin-top: 4px; }
.gitlab-token-mode { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; align-content: start; }
.gitlab-token-mode legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ink, #172033); }
.gitlab-token-mode label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gitlab-connection { margin-bottom: 24px; display: grid; gap: 12px; }
.gitlab-connection > * { margin: 0; }
.gitlab-connection header .button { margin-left: 0; }
.integration-module--note { background: #f7f9fc; border-style: dashed; }
@media (max-width: 650px) { .gitlab-connect { padding: 16px; } .gitlab-connection header > div { flex: 1 1 calc(100% - 40px); } }

/* ---------------------------------------------------------------------------
   Project workspace: role, tabs from settings, code sub-views, settings pages
   --------------------------------------------------------------------------- */
.project-header__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.project-title { min-width: 0; }
.project-title > div { min-width: 0; }
.project-title p.project-description { display: block; color: var(--muted); font-size: 12px; }
.project-role-chip { position: relative; flex: 0 0 auto; }
.project-role-chip > summary { list-style: none; min-height: 30px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.project-role-chip > summary::-webkit-details-marker { display: none; }
.project-role-chip[open] > summary { border-color: var(--blue); color: var(--blue); }
.project-role-chip__panel { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(320px, 86vw); padding: 14px; display: grid; gap: 8px; border: 1px solid var(--line-dark); background: #fff; box-shadow: 0 12px 32px rgba(15, 35, 70, .14); font-size: 13px; line-height: 1.5; }
.project-role-chip__panel p { margin: 0; color: var(--ink-2); }
.project-role-chip__panel a { color: var(--blue); font-weight: 700; }
.project-tabs { position: relative; scrollbar-width: none; }
.project-tabs::-webkit-scrollbar { display: none; }
.project-tabs.has-overflow { mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.project-tabs a { font-size: 12px; }
.project-tabs .tab-count, .code-subnav em { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; background: var(--blue-pale); color: var(--blue); font-style: normal; font-size: 11px; font-weight: 800; }

.code-subnav { min-height: 44px; padding: 0 clamp(16px, 2.4vw, 30px); display: flex; align-items: center; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); background: #fbfcfe; scrollbar-width: none; }
.code-subnav a { min-height: 32px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 650; white-space: nowrap; }
.code-subnav a:hover { color: var(--blue); background: #fff; }
.code-subnav a.is-active { background: #fff; color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
.code-subnav .code-subnav__hint { margin-left: auto; color: var(--blue); font-weight: 700; }
.project-tab-content--view-merge-requests, .project-tab-content--view-gitlab { padding-top: 0; }
.project-tab-content--view-merge-requests > .code-subnav, .project-tab-content--view-gitlab > .code-subnav { margin: 0 calc(-1 * clamp(16px, 2.4vw, 30px)) 4px; }
.mr-block-reason { flex-basis: 100%; color: var(--muted); font-size: 12px; }

.section-off { max-width: 520px; margin: 48px auto; padding: 32px; display: grid; justify-items: center; gap: 12px; border: 1px solid var(--line); background: #fff; text-align: center; color: var(--ink-2); }
.section-off svg { color: var(--muted); }
.section-off h2 { margin: 0; font-size: 20px; color: var(--navy); }
.section-off p { margin: 0; line-height: 1.6; }

.project-settings-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-subnav { position: sticky; top: 12px; display: grid; gap: 2px; }
.settings-subnav a { min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 13px; font-weight: 650; border-left: 3px solid transparent; }
.settings-subnav a:hover { background: #fff; color: var(--blue); }
.settings-subnav a.is-active { background: #fff; color: var(--blue); border-left-color: var(--blue); }
.project-settings-body { min-width: 0; display: grid; gap: 16px; max-width: 980px; }
.settings-card { padding: 20px 22px; border: 1px solid var(--line); background: #fff; display: grid; gap: 12px; min-width: 0; }
.settings-card > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-card h2 { margin: 0; font-size: 17px; color: var(--navy); }
.settings-card h3 { margin: 0; font-size: 15px; color: var(--navy); }
.settings-card p { margin: 0; line-height: 1.6; font-size: 13px; }
.settings-card--danger { border-color: #f1c6c6; }
.settings-readonly { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px !important; }
.settings-card .member-table { border: 1px solid var(--line); }
.role-legend { margin: 0; display: grid; gap: 8px; }
.role-legend div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; font-size: 13px; }
.role-legend dt { font-weight: 800; color: var(--ink-2); }
.role-legend dd { margin: 0; color: var(--ink-2); line-height: 1.5; }
.section-order { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.section-order.is-saving { opacity: .6; pointer-events: none; }
.section-row { min-height: 58px; padding: 8px 10px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; border: 1px solid var(--line); background: #fff; }
.section-row.is-pinned { grid-template-columns: 26px minmax(0, 1fr); background: #f8f9fb; }
.section-row[draggable="true"] { cursor: grab; }
.section-row.is-dragging { opacity: .45; }
.section-row.is-drop-target { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.section-row.is-off b { color: var(--muted); }
.section-row__grip { display: grid; place-items: center; color: var(--muted); }
.section-row b { display: block; font-size: 14px; color: var(--ink); }
.section-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.section-row__move { display: inline-flex; gap: 2px; }
.section-row__move .icon-button { width: 30px; height: 30px; }
.section-order li:first-child + li .section-row__move [data-move-section="up"],
.section-order li:nth-last-child(2) .section-row__move [data-move-section="down"] { visibility: hidden; }
.choice-list { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.choice-list label { padding: 10px 12px; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line); cursor: pointer; }
.choice-list label:has(input:checked) { border-color: var(--blue); background: #f5f8ff; }
.choice-list b { display: block; font-size: 13px; }
.choice-list small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.gitlab-summary { padding: 12px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); background: #f8f9fb; }
.gitlab-summary > div { flex: 1; min-width: 0; }
.gitlab-summary b { display: block; font-size: 14px; }
.gitlab-summary small { color: var(--muted); font-size: 12px; }

.overview-attention .overview-task-list a, .overview-progress-card .overview-task-list a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.overview-start ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; line-height: 1.55; }
.overview-start a { color: var(--blue); font-weight: 700; }
.due-chip { padding: 1px 6px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); color: var(--ink-2); font-size: 11px; white-space: nowrap; }
.due-chip.is-today { border-color: #f0c36d; background: #fff8e8; }
.due-chip.is-overdue { border-color: #f1b3b3; background: #fff1f1; color: #a12a2a; }
.kanban-card__top { gap: 6px; }
.kanban-card__top > button { margin-left: auto; }
.kanban-count { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.chat-readonly { margin: 0; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .project-settings-shell { grid-template-columns: minmax(0, 1fr); }
  .settings-subnav { position: static; display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); }
  .settings-subnav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .settings-subnav a.is-active { border-bottom-color: var(--blue); }
}

@media (max-width: 760px) {
  .project-header__top { align-items: flex-start; }
  .project-title p.project-description { display: none; }
  .project-tab-content--view-repository { height: auto; overflow: visible; grid-template-rows: auto; }
  .project-tab-content--view-repository .repository-layout { grid-template-columns: minmax(0, 1fr) !important; height: auto; }
  .project-tab-content--view-repository .repo-tree-pane { max-height: 240px; overflow: auto; border-bottom: 1px solid var(--line); }
  .project-tab-content--view-repository .repo-editor-pane { min-height: 360px; }
  .project-tab-content--view-repository .repo-history-pane { display: block !important; max-height: 280px; overflow: auto; border-top: 1px solid var(--line); }
  .repository-toolbar { flex-wrap: wrap; }
  .repo-toolbar-actions { flex-wrap: wrap; }
  .section-row { grid-template-columns: 22px minmax(0, 1fr) auto; }
  .section-row .switch, .section-row .module-switch { grid-column: 3; grid-row: 1; }
  .section-row__move { grid-column: 2 / 4; justify-self: start; }
  .role-legend div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .settings-card { padding: 16px; }
  .settings-card .member-table { overflow-x: auto; }
}
.project-overview-main { min-width: 0; display: grid; gap: 12px; align-content: start; }

/* ---------------------------------------------------------------------------
   Project «Код»: files, history, branches, merge requests (one area)
   --------------------------------------------------------------------------- */
.code-subnav__spacer { flex: 1 1 auto; }
.code-subnav .code-subnav__gitlab { color: var(--ink-2); font-weight: 600; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.clone-menu { position: relative; flex: 0 0 auto; }
.clone-menu > summary { list-style: none; cursor: pointer; }
.clone-menu > summary::-webkit-details-marker { display: none; }
.clone-menu__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(420px, calc(100vw - 32px)); padding: 16px; display: grid; gap: 10px; background: #fff; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(15, 45, 105, .16); }
.clone-menu__panel p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.copy-field { display: flex; align-items: stretch; gap: 0; }
.copy-field input { flex: 1 1 auto; min-width: 0; font: 12.5px var(--mono); }
.copy-field .icon-button { flex: 0 0 auto; border: 1px solid var(--line); border-left: 0; }
.code-subnav { overflow: visible; }

.repository-layout.repository-layout--files { grid-template-columns: var(--repo-tree-width, 240px) minmax(0, 1fr); }
.repo-tree-file span { font: 13px var(--mono); }
.line-numbers { font: 13px/1.6 var(--mono); }
.code-view pre { font: 13px/1.6 var(--mono); }
form.code-editor textarea { font: 13px/1.6 var(--mono); }
.diff-view, .diff-view pre, pre.diff-view { font: 12.5px/1.55 var(--mono); }
pre.diff-view { margin: 0; padding: 0; white-space: pre; }
pre.diff-view > code { display: block; min-width: max-content; padding: 10px 0; }
.diff-line { display: block; padding: 0 16px; min-height: 1.55em; }
.diff-line--add { background: #e9f7ee; color: #14532d; }
.diff-line--del { background: #fdecec; color: #7f1d1d; }
.diff-line--hunk { background: #eef3fc; color: var(--blue); }
.diff-line--file { color: var(--navy); font-weight: 700; }
.file-editor-head > div:last-child { display: flex; align-items: center; gap: 8px; }

.project-tab-content--view-history { height: calc(100dvh - var(--project-workspace-offset)); min-height: 0; padding: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); overflow: hidden; }
.project-tab-content--view-history .repository-toolbar { border-inline: 0; border-top: 0; }
.history-layout { min-height: 0; display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); border-top: 1px solid var(--line); background: #fff; }
.history-list { min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); background: #fbfcfd; }
.history-list > a { padding: 10px 12px; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: start; border-bottom: 1px solid var(--line); }
.history-list > a:hover, .history-list > a.is-active { background: var(--blue-pale); }
.history-list b { display: block; color: var(--ink-2); font-size: 13px; line-height: 1.35; }
.history-list small { color: var(--muted); font-size: 12px; }
.history-list code { color: var(--blue); font-size: 12px; }
.history-detail { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.history-detail .commit-detail-head { padding: 14px 18px; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.history-detail .commit-detail-head h2 { margin: 4px 0; font-size: 16px; color: var(--navy); white-space: pre-wrap; }
.history-detail .commit-detail-head small, .history-detail .commit-detail-head p { color: var(--muted); font-size: 12.5px; }
.commit-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.history-detail .diff-view { flex: 1 1 auto; min-height: 0; overflow: auto; }
.history-clear { margin-left: 10px; color: var(--blue); font-size: 12px; }

.project-tab-content--view-branches { padding-top: 0; }
.project-tab-content--view-branches > .code-subnav { margin: 0 calc(-1 * clamp(16px, 2.4vw, 30px)) 14px; }
.branch-list { display: grid; border: 1px solid var(--line); background: #fff; }
.branch-row { min-height: 58px; padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.branch-row:last-child { border-bottom: 0; }
.branch-row__main { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.branch-row__main > a b { color: var(--navy); font: 600 13.5px var(--mono); }
.branch-row__main small { flex: 1 1 100%; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.branch-row__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.branch-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 700; }
.branch-badge--default { background: var(--blue-pale); color: var(--blue); }
.branch-badge--agent { background: #f3eefe; color: #5b3cc4; }
.branch-group-title { margin: 22px 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.project-tab-content--view-merge-requests > .code-subnav { margin: 0 calc(-1 * clamp(16px, 2.4vw, 30px)) 4px; }

/* Tasks */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; margin-left: 14px; }
.filter-chips a { padding: 5px 11px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.filter-chips a.is-active { border-color: var(--blue); background: var(--blue-pale); color: var(--blue); }
.kanban-card { cursor: pointer; }
.kanban-card[draggable="true"] { cursor: grab; }
.kanban-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.kanban-card > p { font-size: 12px; }
.kanban-column > header b { font-size: 11.5px; }
@media (min-width: 761px) { .kanban-board { grid-template-columns: repeat(5, minmax(200px, 1fr)); } }
.task-details .about-list { margin: 0; }
.overview-subtitle { margin: 14px 0 6px; color: var(--muted); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }

/* Settings */
.about-list { margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.about-list > div { padding: 10px 0; display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr); gap: 12px; border-bottom: 1px solid var(--line); }
.about-list dt { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.about-list dd { margin: 0; color: var(--ink); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.role-pill { display: inline-flex; padding: 3px 9px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.role-legend > div.is-current { background: var(--blue-pale); }
.gitlab-summary { margin: 12px 0; padding: 12px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 1px solid var(--line); background: #fbfcfe; }
.gitlab-summary > div { flex: 1 1 220px; min-width: 0; display: grid; gap: 3px; }
.gitlab-summary small { color: var(--muted); font-size: 12px; }
.gitlab-status { display: grid; gap: 12px; }
.gitlab-counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.gitlab-counter { padding: 12px 14px; display: grid; gap: 4px; border: 1px solid var(--line); background: #fff; }
.gitlab-counter:hover { border-color: var(--blue); }
.gitlab-counter strong { color: var(--navy); font-size: 20px; }
.gitlab-counter small { color: var(--muted); font-size: 12px; }
.pipeline-success { color: var(--green) !important; }
.pipeline-failed { color: var(--red) !important; }
.gitlab-mr-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; }
.gitlab-mr-list small { color: var(--muted); }
.gitlab-connect-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.gitlab-connect-form[hidden] { display: none; }

@media (max-width: 900px) {
  .history-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 40%) minmax(0, 1fr); }
  .history-list { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .project-tab-content--view-history { height: auto; overflow: visible; grid-template-rows: auto; }
  .history-layout { grid-template-rows: auto auto; }
  .history-list { max-height: 300px; }
  .history-detail { min-height: 360px; }
  .history-detail .commit-detail-head { flex-direction: column; }
  .branch-row { flex-direction: column; align-items: stretch; }
  .branch-row__actions { flex-wrap: wrap; }
  .gitlab-counters { grid-template-columns: 1fr; }
  .filter-chips { margin-left: 0; }
  .about-list > div { grid-template-columns: 1fr; gap: 4px; }
  .clone-menu__panel { position: fixed; left: 16px; right: 16px; top: auto; width: auto; }
  .code-subnav .code-subnav__gitlab { display: none; }
}

.repo-path { font: 12.5px var(--mono); }
.file-editor-head b { font: 600 13px var(--mono); }
.file-editor-head > div:first-child > span { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.file-editor-head small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.history-list .history-node::after { display: none; }

/* ---- Home: attention, week calendar, announcements ---- */
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check-row small { color: var(--muted); font-size: 12px; }
.home-attention { margin: 16px 24px 0; padding: 14px 16px; border: 1px solid var(--line); background: #fff; }
.home-attention h2 { margin: 0 0 10px; color: var(--navy); font-size: 15px; }
.home-attention > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.home-attention a { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; background: var(--surface); }
.home-attention a:hover { border-color: var(--blue); }
.home-attention a.is-overdue { border-color: var(--red); background: var(--red-soft); }
.home-attention a span { display: grid; gap: 2px; min-width: 0; }
.home-attention b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-attention small { color: var(--muted); font-size: 12px; }
.lab-home { margin: 16px 24px 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.lab-calendar, .lab-announcements { border: 1px solid var(--line); background: #fff; min-width: 0; }
.lab-calendar__toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.lab-calendar__nav, .lab-calendar__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lab-calendar__nav h2 { margin: 0 0 0 8px; color: var(--navy); font-size: 15px; }
/* --cal-hour matches the JS HOUR constant (set inline on .cal-week in home.js) so the hour grid
   lines, hour labels and event tiles stay aligned whatever the chosen height. */
.cal-week { --cal-cols: 52px repeat(7, minmax(0, 1fr)); --cal-hour: 30px; }
/* Header and all-day rows reserve the same scrollbar gutter as the scrolling body, so their columns
   line up with the day columns below even when the body shows a scrollbar. */
.cal-head { display: grid; grid-template-columns: var(--cal-cols); border-bottom: 1px solid var(--line); overflow: hidden; scrollbar-gutter: stable; }
.cal-head > div { padding: 6px 4px; text-align: center; display: grid; gap: 1px; border-left: 1px solid var(--line); }
.cal-head span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.cal-head b { color: var(--ink-2); font-size: 13px; }
.cal-head .is-today b { color: #fff; background: var(--blue); padding: 1px 8px; justify-self: center; }
.cal-allday { display: grid; grid-template-columns: var(--cal-cols); gap: 2px 0; padding: 4px 0; border-bottom: 1px solid var(--line); background: var(--surface); overflow: hidden; scrollbar-gutter: stable; }
.cal-allday__label { grid-column: 1; grid-row: 1; color: var(--muted); font-size: 10px; text-align: right; padding: 5px 6px 0 0; }
.cal-body { max-height: 351px; overflow-y: auto; scrollbar-gutter: stable; }
/* padding-top gives the first hour label (shifted up 6px) room so «00:00» is not clipped. */
.cal-grid { position: relative; display: grid; grid-template-columns: var(--cal-cols); padding-top: 6px; }
.cal-hours time { display: block; color: var(--muted); font-size: 11px; text-align: right; padding-right: 6px; transform: translateY(-6px); }
.cal-day { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--cal-hour) - 1px), var(--line) calc(var(--cal-hour) - 1px), var(--line) var(--cal-hour)); }
.cal-day.is-weekend { background-color: var(--surface); }
.cal-day.is-today { background-color: var(--blue-pale); }
.cal-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--red); pointer-events: none; z-index: 2; }
.cal-event { display: grid; align-content: start; gap: 0; padding: 1px 5px; overflow: hidden; border: 0; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--ink); text-align: left; font: inherit; font-size: 10px; cursor: pointer; text-decoration: none; }
.cal-day .cal-event { position: absolute; z-index: 1; }
.cal-event time { color: var(--muted); font-size: 9px; }
.cal-event b { font-size: 10px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.cal-event small { color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event:hover, .cal-event:focus-visible { filter: brightness(.96); outline: 2px solid var(--blue); outline-offset: -2px; }
.cal-event--bar { display: block; margin: 0 2px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 600; }
.cal-event--green { border-left-color: var(--green); background: var(--green-soft); }
.cal-event--violet { border-left-color: var(--violet); background: var(--violet-soft); }
.cal-event--orange { border-left-color: var(--orange); background: var(--orange-soft); }
.cal-event--pink { border-left-color: var(--red); background: var(--red-soft); }
.cal-event--gray { border-left-color: var(--muted); background: var(--surface-2); }
.cal-event--deadline { display: flex; gap: 4px; align-items: center; margin: 0 2px; border-left-color: var(--orange); background: var(--orange-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
.cal-agenda { display: none; }
.cal-agenda__day { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.cal-agenda__day.is-today h3 { color: var(--blue); }
.cal-agenda__day h3 { margin: 0 0 6px; font-size: 13px; color: var(--navy); }
.cal-agenda__day > p, .cal-agenda__empty { margin: 0; padding: 10px 12px; color: var(--muted); font-size: 13px; }
.cal-agenda__item { width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 8px; padding: 6px 0; border: 0; background: none; text-align: left; font: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.cal-agenda__item time { color: var(--blue); font-size: 12px; }
.cal-agenda__item--deadline time { color: var(--orange); }
.cal-agenda__item span { display: grid; gap: 2px; }
.cal-agenda__item b { font-size: 14px; }
.cal-agenda__item small { color: var(--muted); font-size: 12px; }
.lab-announcements > header { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lab-announcements > header h2 { margin: 0; color: var(--navy); font-size: 15px; }
.lab-announcements__list { max-height: 560px; overflow-y: auto; }
.announcement { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.announcement.is-pinned { background: var(--yellow-soft); }
.announcement--event > header svg { color: var(--blue); }
.announcement > header { display: flex; align-items: center; gap: 6px; min-width: 0; }
.announcement > header b { color: var(--ink-2); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.announcement > header time { flex: 0 0 auto; }
.announcement > header time { color: var(--muted); font-size: 12px; }
.announcement__pin { display: inline-flex; gap: 3px; align-items: center; color: var(--orange); font-size: 11px; }
.announcement__actions { margin-left: auto; display: flex; gap: 2px; opacity: .55; }
.announcement:hover .announcement__actions, .announcement:focus-within .announcement__actions { opacity: 1; }
.announcement__actions .icon-button { width: 26px; height: 26px; }
.announcement > p { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.announcement__link { display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--blue); }
.announcement__edit { margin-top: 6px; display: grid; gap: 6px; }
.announcement__edit textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line-dark); }
.announcement__edit > div { display: flex; justify-content: flex-end; gap: 6px; }
.lab-announcements > form { padding: 10px 12px; display: grid; gap: 8px; border-top: 1px solid var(--line); }
.lab-announcements > form textarea { width: 100%; min-height: 56px; padding: 8px 10px; resize: vertical; border: 1px solid var(--line-dark); font: inherit; font-size: 13px; }
.lab-announcements > form > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.event-details p { margin: 0; display: flex; gap: 6px; align-items: flex-start; }
.subscription-steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
@media (max-width: 1100px) { .lab-home { grid-template-columns: 1fr; } .lab-announcements__list { max-height: 360px; } }
@media (max-width: 760px) {
  .home-attention, .lab-home { margin: 10px 10px 0; }
  .cal-week { display: none; }
  .cal-agenda { display: block; }
  .lab-calendar__toolbar { padding: 8px 10px; }
  .lab-calendar__nav h2 { flex: 1 1 100%; margin: 4px 0 0; }
}
.modules-intro { margin: 0 0 8px; color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 900px; }
.calendar-sources { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.calendar-sources h3 { margin: 0; font-size: 15px; color: var(--navy); }
.calendar-sources ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.calendar-sources li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); }
.calendar-sources li.is-error { border-color: var(--red); background: var(--red-soft); }
.calendar-sources li > div { flex: 1 1 200px; display: grid; gap: 2px; min-width: 0; }
.calendar-sources li small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.source-dot { width: 10px; height: 10px; flex: 0 0 auto; background: var(--green); }
.source-dot--blue { background: var(--blue); } .source-dot--violet { background: var(--violet); } .source-dot--orange { background: var(--orange); } .source-dot--pink { background: var(--red); } .source-dot--gray { background: var(--muted); }
.calendar-source-form { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(220px, 2fr) 130px; gap: 8px 10px; align-items: end; }
.calendar-source-form .check-row, .calendar-source-form button { grid-column: auto; }
@media (max-width: 760px) { .calendar-source-form { grid-template-columns: 1fr; } }
#module-calendar.is-active { grid-column: 1 / -1; }
#module-calendar.is-active > p { max-width: 900px; }

/* Agents: library intro, executor choice, chat management */
.library-intro { margin: 14px clamp(18px, 3vw, 34px) 0; max-width: 860px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.executor-options { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.executor-options legend { margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.executor-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.executor-option:has(input:checked) { border-color: var(--blue, #2450a6); box-shadow: inset 3px 0 0 var(--blue, #2450a6); }
.executor-option input { margin-top: 3px; }
.executor-option__body { display: grid; gap: 3px; min-width: 0; }
.executor-option__body b { font-size: 14px; }
.executor-option__body small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.executor-option__state a { font-weight: 600; }
.executor-option__select select { width: 100%; margin-top: 6px; }
.executor-option:not(:has(input:checked)) .executor-option__select { display: none; }
.executor-option.is-unavailable { cursor: default; background: #f7f9fc; }
.executor-option.is-unavailable b { color: var(--muted); }
.agent-chat-actions { display: flex; gap: 6px; justify-content: flex-end; }
.agent-back-link { display: none; align-items: center; gap: 4px; font-size: 12px; margin-bottom: 4px; }
.agent-extension-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 10px 16px; background: #fff5ea; color: #8a3a0c; font-size: 13px; border-bottom: 1px solid #f1d9bf; }
.agent-extension-banner[hidden] { display: none; }
.agent-extension-banner p { display: flex; gap: 8px; align-items: center; margin: 0; }
.agent-extension-banner div { display: flex; gap: 8px; }
.feature-list__more { display: flex !important; align-items: center; gap: 6px; font-size: 12px; color: var(--muted) !important; }
.runner-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.runner-presets button { padding: 6px 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.runner-presets button.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
[data-runner-wait].is-ok { color: var(--green, #1f7a4d); font-weight: 600; }
.team-link-add select { width: 100%; margin: 6px 0 2px; }
.team-node__port, .team-node header[data-node-drag] { touch-action: none; }
@media (max-width: 650px) {
  .personal-agent-layout.has-chat > .feature-list { display: none; }
  .agent-back-link { display: inline-flex; }
  .personal-agent-heading { gap: 8px; }
}
.executor-option__select select { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 14px; }
.admin-archive { display: grid; gap: 14px; max-width: 900px; }
.admin-archive-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); background: #fff; }
.admin-archive-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; }
.admin-archive-list li + li { border-top: 1px solid var(--line); }
.admin-archive-list small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.cal-allday__label { white-space: normal; line-height: 1.15; padding: 3px 4px 0 2px; overflow-wrap: normal; }

/* --- Compute (student container jobs) --- */
.compute-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.compute-head h1 { margin: 0 0 4px; }
.compute-sub { color: var(--text-muted, var(--muted)); margin: 0 0 16px; font-size: 0.9em; }
.compute-form { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.compute-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.82em; color: var(--text-muted, var(--muted)); }
.compute-form input, .compute-form textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2, var(--surface)); color: var(--ink); }
.compute-form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.compute-form-row > label { flex: 1 1 120px; }
.compute-check { flex-direction: row !important; align-items: center; gap: 6px !important; }
.compute-form-actions { margin-top: 4px; }
.compute-jobs { margin-top: 16px; }
.compute-job-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.compute-job-row { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; color: var(--ink); }
.compute-job-row:hover { border-color: var(--blue); }
.compute-job-row.is-active { border-color: var(--blue); background: var(--blue-soft); }
.compute-job-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compute-job-meta { grid-column: 1 / -1; font-size: 0.78em; color: var(--text-muted, var(--muted)); }
.compute-chip { align-self: start; font-size: 0.74em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2, var(--surface)); color: var(--ink-2, var(--ink)); border: 1px solid var(--border); }
.compute-chip--blue { background: var(--blue-soft); color: var(--navy); border-color: transparent; }
.compute-chip--green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.compute-chip--red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.compute-chip--orange { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.compute-detail { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 16px; min-width: 0; }
.compute-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.compute-detail-head h2 { margin: 0; display: inline; font-size: 1.05em; }
.compute-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 0; }
.compute-meta dt { font-size: 0.74em; color: var(--text-muted, var(--muted)); }
.compute-meta dd { margin: 0; font-weight: 600; }
.compute-error { background: var(--red-soft); color: var(--red); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.85em; }
.compute-block { margin-top: 14px; }
.compute-block h3 { font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted, var(--muted)); margin: 0 0 6px; }
.compute-log { background: #0f1724; color: #d7e0f0; border-radius: var(--radius-sm); padding: 10px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.8em; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }
@media (max-width: 860px) { .compute-layout { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------------- */
/* «Код»: one bar — repository › views › branch … actions                    */
/* ------------------------------------------------------------------------- */
.code-bar { min-height: 50px; padding: 7px clamp(12px, 2vw, 22px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; background: #fbfcfe; border-bottom: 1px solid var(--line); position: relative; z-index: 6; }
.code-bar__repo { flex: 0 0 auto; display: flex; align-items: center; }
.code-bar__views { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 2px; padding-left: 10px; border-left: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.code-bar__views::-webkit-scrollbar { display: none; }
.code-bar__views a { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; border-radius: 6px; }
.code-bar__views a:hover { color: var(--blue); background: #fff; }
.code-bar__views a.is-active { color: var(--blue); background: #fff; box-shadow: inset 0 -2px 0 var(--blue), 0 0 0 1px var(--line); }
.code-bar__views em { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; background: var(--blue-pale); color: var(--blue); font-style: normal; font-size: 11px; font-weight: 800; border-radius: 9px; }
.code-bar__ref { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; padding-left: 10px; border-left: 1px solid var(--line); }
.code-bar__spacer { flex: 1 1 0; min-width: 0; }
.code-bar__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.code-bar__actions .button--compact { min-height: 34px; padding-inline: 11px; gap: 6px; }
.code-bar__gitlab { min-height: 34px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; font-weight: 650; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.code-bar__gitlab:hover { color: var(--blue); border-color: var(--blue-soft); }
.code-bar .branch-select { min-height: 34px; background: #fff; font-size: 12px; }
.code-bar .branch-select select { max-width: 210px; font-size: 12.5px; background: transparent; cursor: pointer; }
.branch-select__lock { display: inline-flex; color: var(--blue); }
.code-bar .clone-menu > summary { min-height: 34px; }
.code-note { margin: 12px 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

/* Repository switcher: same weight as the branch select, one level above it. */
.repo-switch { position: relative; }
.repo-switch > summary { min-height: 36px; max-width: 280px; padding: 0 10px 0 9px; display: flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; border: 1px solid var(--line-dark); border-radius: 7px; background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s; }
.repo-switch > summary::-webkit-details-marker { display: none; }
.repo-switch > summary:hover, .repo-switch[open] > summary { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .1); }
.repo-switch__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 800; }
.repo-switch > summary em { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--blue-pale); color: var(--blue); font-style: normal; font-size: 11px; font-weight: 800; }
.repo-switch > summary .icon:last-child { color: var(--muted); transition: transform .15s; }
.repo-switch[open] > summary .icon:last-child { transform: rotate(180deg); }
.repo-switch__panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 40; width: min(380px, calc(100vw - 24px)); padding: 6px; display: grid; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-md); animation: repo-switch-in .14s ease-out; }
@keyframes repo-switch-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.repo-switch__panel > header { padding: 6px 8px 4px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.repo-switch__item { padding: 8px; display: grid; grid-template-columns: 18px minmax(0, 1fr) 16px; gap: 9px; align-items: start; border-radius: 7px; color: var(--ink-2); }
.repo-switch__item > .icon:first-child { margin-top: 1px; color: var(--muted); }
.repo-switch__item b { display: block; color: var(--navy); font-size: 13px; }
.repo-switch__item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.repo-switch__item:hover { background: var(--blue-pale); }
.repo-switch__item.is-active { background: var(--blue-pale); }
.repo-switch__item.is-active > .icon { color: var(--blue); }
.repo-switch__empty { padding: 10px 8px; color: var(--muted); font-size: 12.5px; }
.repo-switch__panel > footer { margin-top: 4px; padding: 8px 6px 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
.repo-switch__panel > footer a { color: var(--blue); font-size: 12.5px; font-weight: 650; }

/* Views below the bar: one bar instead of two rows. */
.project-tab-content--view-repository, .project-tab-content--view-history { grid-template-rows: auto minmax(0, 1fr); }
.project-tab-content--view-repository > .section-off, .project-tab-content--view-history > .section-off { align-self: start; }
.project-tab-content--view-branches > .code-bar, .project-tab-content--view-merge-requests > .code-bar { margin: 0 calc(-1 * clamp(16px, 2.4vw, 30px)) 0; }
.project-tab-content--view-branches, .project-tab-content--view-merge-requests { padding-top: 0; }
.project-tab-content--view-merge-requests .mr-layout { margin-top: 2px; }
.history-list__head { position: sticky; top: 0; z-index: 1; padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #f4f6f9; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 650; }
.history-list__head span { min-width: 0; display: inline-flex; align-items: center; gap: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.history-list__head a { flex: 0 0 auto; color: var(--blue); }

@media (max-width: 1180px) {
  .code-bar__label { display: none; }
  .code-bar__actions .button--compact { padding-inline: 9px; }
}
@media (max-width: 900px) {
  .code-bar { gap: 6px; }
  .code-bar__views { order: 3; flex: 1 1 100%; padding-left: 0; border-left: 0; }
  .code-bar__ref { order: 2; padding-left: 0; border-left: 0; }
  .code-bar__spacer { order: 2; }
  .code-bar__actions { order: 2; }
  .repo-switch > summary { max-width: 200px; }
}
@media (max-width: 760px) {
  .code-bar__views a span { display: none; }
  .code-bar__views a.is-active span { display: inline; }
  .code-bar .branch-select select { max-width: 130px; }
}

/* Project creation: repository cards appear above the «add» button, which slides down. */
.repo-drafts { display: grid; gap: 0; }
.repo-drafts__list { display: grid; }
.repo-draft { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .32s cubic-bezier(.2, .8, .2, 1), opacity .25s ease, margin-bottom .32s cubic-bezier(.2, .8, .2, 1); margin-bottom: 10px; }
.repo-draft.is-entering { grid-template-rows: 0fr; opacity: 0; margin-bottom: 0; }
.repo-draft.is-leaving { animation: repo-draft-out .26s ease forwards; }
@keyframes repo-draft-out { from { opacity: 1; max-height: 260px; } to { opacity: 0; max-height: 0; margin-bottom: 0; } }
.repo-draft__inner { min-height: 0; overflow: hidden; transition: padding .32s cubic-bezier(.2, .8, .2, 1), border-width .32s; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--blue-soft); border-radius: 10px; background: linear-gradient(180deg, #f6f9fe, #fff 60%); }
.repo-draft.is-entering .repo-draft__inner { padding-block: 0; border-width: 0; }
.repo-draft__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-pale); color: var(--blue); }
.repo-draft__fields { min-width: 0; display: grid; gap: 8px; }
.repo-draft__fields > header { display: flex; align-items: center; gap: 8px; }
.repo-draft__fields > header b { color: var(--navy); font-size: 14px; }
.repo-draft__fields > header em { padding: 2px 7px; border-radius: 99px; background: var(--blue-pale); color: var(--blue); font-style: normal; font-size: 11px; font-weight: 800; }
.repo-draft__fields > header .icon-button { margin-left: auto; }
.repo-draft .field { gap: 4px; }
.repo-draft .field input, .repo-draft .slug-field { min-height: 38px; }
.repo-draft .slug-field i, .repo-draft .slug-field input { min-height: 36px; }
.repo-draft .slug-field i[data-repo-prefix] { flex: 0 1 auto; min-width: 0; max-width: 55%; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 36px; padding-right: 2px; }
.repo-draft .slug-field input { flex: 1 1 60px; min-width: 60px; }
.repo-draft .slug-field .slug-field__suffix { flex: 0 0 auto; padding: 0 12px 0 0; border-right: 0; border-left: 0; background: transparent; }
.repo-draft__note { color: var(--muted); font-size: 12px; line-height: 1.45; }
.repo-drafts__add { width: 100%; min-height: 62px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; text-align: left; border: 1.5px dashed var(--line-dark); border-radius: 10px; background: #fff; color: var(--blue); transition: border-color .15s, background .15s, transform .32s cubic-bezier(.2, .8, .2, 1); }
.repo-drafts__add:hover, .repo-drafts__add:focus-visible { border-color: var(--blue); background: var(--blue-pale); }
.repo-drafts__add > .icon { width: 34px; height: 34px; padding: 7px; border-radius: 9px; background: var(--blue-pale); }
.repo-drafts__add span { display: grid; gap: 2px; }
.repo-drafts__add b { color: var(--navy); font-size: 13.5px; }
.repo-drafts__add small { color: var(--muted); font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .repo-draft, .repo-drafts__add, .repo-switch__panel { transition: none; animation: none; } }

/* Settings → Репозитории */
.repo-table { display: grid; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.repo-row { padding: 12px 14px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.repo-row:last-child { border-bottom: 0; }
.repo-row.is-primary { background: #fafcff; }
.repo-row.is-archived { color: var(--muted); }
.repo-row__icon { color: var(--blue); align-self: start; margin-top: 2px; }
.repo-row__main { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.repo-row__main > b { color: var(--navy); font-size: 14px; }
.repo-row__main > b a:hover { color: var(--blue); }
.repo-row__main > small { flex: 1 1 100%; color: var(--muted); font-size: 12px; }
.repo-row__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.copy-field--inline { flex: 1 1 100%; max-width: 520px; }
.copy-field--inline input { min-height: 30px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px 0 0 6px; background: var(--surface-2); }
.copy-field--inline .icon-button { width: 32px; height: 30px; border-radius: 0 6px 6px 0; }
@media (max-width: 760px) { .repo-row { grid-template-columns: 22px minmax(0, 1fr); } .repo-row__actions { grid-column: 2; justify-content: flex-start; } }

/* Agent access (harness permissions) */
.access-fields { margin: 0; padding: 12px 14px 14px; display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; }
.access-fields legend { padding: 0 6px; color: var(--navy); font-size: 13px; font-weight: 800; }
.access-fields details > summary { cursor: pointer; color: var(--blue); font-size: 12.5px; font-weight: 700; }
.access-fields details[open] > summary { margin-bottom: 8px; }
.access-fields textarea { font-family: var(--mono); font-size: 12.5px; }
.agent-access-chip { min-height: 28px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink-2); font-size: 12px; font-weight: 700; white-space: nowrap; }
.agent-access-chip:hover { border-color: var(--blue); color: var(--blue); }
.agent-access-chip.is-read-only { background: var(--surface-2); }
.agent-access-chip.is-full { border-color: #f1c9a9; background: #fff6ef; color: #9a3f0b; }
.agent-trace__item--lean > span, .agent-trace__item--program > span { color: var(--violet); }

/* ------------------------------------------------------------------------- */
/* «Статьи»: files · editor · PDF in one full-height workspace                */
/* ------------------------------------------------------------------------- */
.workspace-content:has(> .project-tab-content--articles) { display: flex; flex-direction: column; overflow: hidden; }
.workspace-content:has(> .project-tab-content--articles) > .project-header { flex: 0 0 auto; }
.project-tab-content--articles { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; background: #fff; }
.project-tab-content--articles > .section-off { margin: 24px; }

.article-bar { flex: 0 0 auto; flex-wrap: nowrap; }
.article-bar__doc { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; padding-left: 10px; border-left: 1px solid var(--line); }
.article-bar__title, .article-bar__repo { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: var(--navy); font-size: 13px; }
.article-bar__title b, .article-bar__repo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-bar__title b { max-width: 340px; font-weight: 800; }
.article-bar__repo { padding: 0 2px; font-weight: 750; }
.article-bar__title > .icon, .article-bar__repo > .icon { color: var(--blue); }
.article-bar__select select { max-width: 300px; font-weight: 700; color: var(--navy); }
.article-bar .code-bar__ref { gap: 6px; }
.article-status__state > span { display: inline-flex; align-items: center; gap: 4px; }
.article-status__state code { color: var(--ink-2); font-size: 11px; }
.article-status__state .is-dirty { color: #a24a0f; font-weight: 700; }
.article-bar [data-article-save] em { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; background: #fff3e6; color: #a24a0f; font-style: normal; font-size: 11px; font-weight: 800; }
.article-bar .button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.article-bar .button.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid currentColor; border-color: var(--blue) transparent var(--blue) transparent; border-radius: 50% !important; animation: article-spin .7s linear infinite; }
.article-bar .button--primary.is-busy::after { border-color: #fff transparent #fff transparent; }
@keyframes article-spin { to { transform: rotate(360deg); } }
.article-more__panel { width: 260px; padding: 6px; gap: 2px; }
.article-more__panel [role=menuitem] { width: 100%; min-height: 34px; padding: 0 10px; display: flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-align: left; }
.article-more__panel [role=menuitem]:hover { background: var(--blue-pale); color: var(--blue); }
.article-more__panel [role=menuitem].is-danger { color: var(--red); }
.article-more__panel [role=menuitem].is-on::after { content: "вкл"; margin-left: auto; color: var(--blue); font-size: 11px; font-weight: 800; }
.article-more__panel [role=menuitem][disabled] { opacity: .45; pointer-events: none; }
.article-more > summary { list-style: none; }
.article-more > summary::-webkit-details-marker { display: none; }

.article-notice { flex: 0 0 auto; padding: 7px clamp(12px, 2vw, 22px); display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: var(--blue-pale); color: var(--navy); font-size: 12.5px; }
.article-notice > span { flex: 1; min-width: 0; line-height: 1.45; }
.article-notice--warn { background: #fff7ed; color: #7c2d12; }
.article-notice code { font-size: 11.5px; }

.article-workspace { --article-left: 220px; --article-right: 44%; position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: var(--article-left) 5px minmax(0, 1fr) 5px minmax(280px, var(--article-right)); grid-template-rows: minmax(0, 1fr); }
.article-workspace.is-side-collapsed { grid-template-columns: 0 0 minmax(0, 1fr) 5px minmax(280px, var(--article-right)); }
.article-workspace.is-side-collapsed .article-side { visibility: hidden; }
.article-workspace.is-resizing { cursor: col-resize; user-select: none; }
.article-workspace.is-resizing iframe, .article-workspace.is-resizing .article-pdf { pointer-events: none; }
.article-splitter { position: relative; z-index: 2; background: var(--line); cursor: col-resize; touch-action: none; transition: background .12s; }
.article-splitter::after { content: ""; position: absolute; inset: 0 -4px; }
.article-splitter:hover, .article-splitter:focus-visible, .is-resizing .article-splitter { background: var(--blue-soft); }
.article-workspace.is-side-collapsed [data-split=left] { pointer-events: none; background: transparent; }

.article-side { min-width: 0; min-height: 0; overflow-y: auto; background: #fbfcfe; }
.article-pane-head { position: sticky; top: 0; z-index: 1; min-height: 34px; padding: 0 8px 0 12px; display: flex; align-items: center; gap: 8px; background: #f4f6f9; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.article-pane-head b { font-weight: 800; }
.article-pane-head > span { color: var(--muted-2); font-weight: 700; }
.article-pane-head .icon-button { width: 26px; height: 26px; margin-left: auto; }
.article-files, .article-outline { margin: 0; padding: 4px 0 10px; list-style: none; }
.article-files button { width: 100%; min-height: 30px; padding: 0 10px 0 12px; display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 12.5px; text-align: left; }
.article-files button > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-files button > .icon { color: var(--muted); }
.article-files button small { color: var(--muted-2); font-size: 10.5px; font-weight: 700; }
.article-files button em { min-width: 16px; height: 16px; padding: 0 4px; display: inline-grid; place-items: center; background: #fdecef; color: var(--red); font-style: normal; font-size: 10.5px; font-weight: 800; }
.article-files button:hover { background: #eef2f8; }
.article-files button.is-active { background: var(--blue-pale); color: var(--navy); font-weight: 700; box-shadow: inset 2px 0 0 var(--blue); }
.article-files button.is-active > .icon { color: var(--blue); }
.article-files__empty { padding: 8px 12px; color: var(--muted); font-size: 12px; }
.article-tab__dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50% !important; background: transparent; }
.is-dirty > .article-tab__dot, .is-dirty .article-tab__dot { background: var(--orange); }

.article-outline button { width: 100%; min-height: 28px; padding: 3px 10px 3px 12px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; text-align: left; line-height: 1.35; }
.article-outline button:hover { background: #eef2f8; }
.article-outline__section button { color: var(--navy); font-weight: 750; }
.article-outline__section.depth-2 button { padding-left: 24px; font-weight: 650; }
.article-outline__section.depth-3 button { padding-left: 36px; font-weight: 600; color: var(--ink-2); }
.article-outline__statement button { padding-left: 24px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 6px; row-gap: 0; align-items: center; }
.article-outline__statement button > span { min-width: 0; color: var(--violet); font-weight: 650; }
.article-outline__statement small { grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 10.5px; }
.article-outline__statement .article-formal-dot { grid-column: 2; grid-row: 1; }
.article-outline .is-current > button { background: #f2f5fb; box-shadow: inset 2px 0 0 var(--blue-soft); }
.article-formal-dot { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50% !important; }
.article-formal-dot.is-done { background: #dcf3e8; color: var(--green); }
.article-formal-dot.is-sorry { background: #fff1e5; color: var(--orange); }

.article-editor { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #fff; }
.article-tabs { min-width: 0; display: flex; align-items: stretch; background: #f4f6f9; border-bottom: 1px solid var(--line); }
.article-side-toggle { width: 36px; flex: 0 0 auto; border-right: 1px solid var(--line); color: var(--muted); }
.article-tabs__list { min-width: 0; flex: 1; display: flex; overflow-x: auto; scrollbar-width: thin; }
.article-tab { flex: 0 0 auto; display: flex; align-items: center; border-right: 1px solid var(--line); background: #f4f6f9; }
.article-tab > button:first-child { min-height: 34px; padding: 0 10px 0 11px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.article-tab.is-active { background: #fff; box-shadow: inset 0 2px 0 var(--blue); }
.article-tab.is-active > button:first-child { color: var(--navy); }
.article-tab__errors { min-width: 16px; height: 16px; padding: 0 4px; display: inline-grid; place-items: center; background: #fdecef; color: var(--red); font-style: normal; font-size: 10.5px; font-weight: 800; }
.article-tab__close { width: 24px; height: 24px; margin-right: 4px; display: grid; place-items: center; color: var(--muted-2); }
.article-tab__close:hover { background: var(--surface-3); color: var(--ink); }
.article-editor__host { position: relative; min-height: 0; overflow: hidden; }
.article-editor__pane { position: absolute; inset: 0; }
.article-editor__pane .cm-editor { height: 100%; }
.article-editor__pane .cm-editor.cm-focused { outline: none; }
.article-loading { height: 100%; padding: 24px; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--muted); font-size: 13px; text-align: center; }
.article-loading > .icon { color: var(--blue-soft); }
.article-loading--error { color: var(--red); }
.article-image { height: 100%; padding: 20px; display: grid; place-content: center; justify-items: center; gap: 10px; overflow: auto; background: repeating-conic-gradient(#f4f6f9 0 25%, #fff 0 50%) 0 0 / 18px 18px; }
.article-image img { max-width: 100%; max-height: 70vh; border: 1px solid var(--line); background: #fff; }
.article-image p { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.article-status { min-height: 28px; padding: 0 10px; display: flex; align-items: center; gap: 14px; overflow: hidden; background: #f8f9fb; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.article-status button { display: inline-flex; gap: 8px; color: inherit; font-size: inherit; }
.article-status b { display: inline-flex; align-items: center; gap: 3px; font-weight: 750; }
.article-status .is-error { color: var(--red); }
.article-status .is-warn { color: #b45309; }
.article-status__spacer { flex: 1; }
.article-status kbd { padding: 0 4px; border: 1px solid var(--line-dark); background: #fff; font-family: var(--font); font-size: 10.5px; }

.article-preview { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #fff; }
.article-preview__tabs { min-width: 0; display: flex; align-items: stretch; background: #f4f6f9; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.article-preview__tabs::-webkit-scrollbar { display: none; }
.article-preview__tabs [data-preview-tab] { flex: 0 0 auto; min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; gap: 6px; border-right: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.article-preview__tabs [data-preview-tab]:hover { color: var(--blue); }
.article-preview__tabs [data-preview-tab].is-active { background: #fff; color: var(--navy); box-shadow: inset 0 2px 0 var(--blue); }
.article-preview__tabs em { min-width: 16px; height: 16px; padding: 0 4px; display: inline-grid; place-items: center; background: var(--surface-3); color: var(--ink-2); font-style: normal; font-size: 10.5px; font-weight: 800; }
.article-preview__tabs em.is-error { background: #fdecef; color: var(--red); }
.article-preview__tabs em.is-warn { background: #fff4e5; color: #b45309; }
.article-preview__tabs em.is-ok { background: #dcf3e8; color: var(--green); }
.article-preview__spacer { flex: 1; }
.article-zoom { flex: 0 0 auto; display: flex; align-items: center; gap: 2px; padding: 0 6px; }
.article-zoom .icon-button { width: 28px; height: 28px; font-size: 16px; font-weight: 700; color: var(--ink-2); }
.article-zoom__value { min-width: 48px; height: 28px; padding: 0 6px; color: var(--ink-2); font-size: 11.5px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.article-zoom__value.is-fit { color: var(--blue); }
.article-zoom__value:hover, .article-zoom .icon-button:hover { background: #fff; color: var(--blue); }
.article-preview__body { position: relative; min-height: 0; }
.article-preview__body > [data-pane] { position: absolute; inset: 0; overflow: auto; }
.article-pdf { background: #e7eaf0; }
.article-pdf__pages { min-height: 100%; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.article-pdf__page { position: relative; flex: 0 0 auto; display: grid; place-items: center; background: #fff; box-shadow: 0 1px 3px rgb(16 24 40 / .14), 0 8px 24px rgb(16 24 40 / .08); }
.article-pdf__page > span { color: var(--line-dark); font-size: 28px; font-weight: 800; }
.article-pdf__page canvas { display: block; }
.article-pdf__empty { align-self: stretch; margin: auto; max-width: 340px; padding: 40px 20px; display: grid; justify-items: center; gap: 8px; color: var(--muted); text-align: center; font-size: 13px; line-height: 1.5; }
.article-pdf__empty > .icon { color: #a8b3c7; }
.article-pdf__empty b { color: var(--ink-2); font-size: 14px; }

.article-log { padding: 0 0 20px; }
.article-log__head { position: sticky; top: 0; z-index: 1; min-height: 40px; padding: 6px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.article-log__head + .article-log__head { position: static; }
.article-log__head .button { margin-left: auto; }
.article-log__empty { padding: 18px 16px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.article-log__empty code { font-size: 12px; }
.article-pill { padding: 3px 8px; font-size: 11px; font-weight: 800; letter-spacing: .02em; background: var(--surface-3); color: var(--ink-2); }
.article-pill.is-ok { background: #dcf3e8; color: #13744a; }
.article-pill.is-warn { background: #fff4e5; color: #9a4b0b; }
.article-pill.is-error { background: #fdecef; color: var(--red); }
.article-pill.is-muted { background: var(--surface-3); color: var(--muted); }
.article-diagnostics { margin: 0; padding: 0; list-style: none; }
.article-diagnostics li { border-bottom: 1px solid #eef0f4; }
.article-diagnostics button { width: 100%; padding: 8px 14px 8px 12px; display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr); gap: 10px; text-align: left; font-size: 12.5px; line-height: 1.45; border-left: 3px solid transparent; }
.article-diagnostics button:not([disabled]):hover { background: #f6f8fc; }
.article-diagnostics button[disabled] { opacity: 1; cursor: default; }
.article-diagnostics .is-error button { border-left-color: var(--red); }
.article-diagnostics .is-warning button { border-left-color: var(--orange); }
.article-diagnostics .is-info button { border-left-color: var(--blue-soft); }
.article-diagnostics__where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.article-diagnostics__text { color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.article-log__raw { margin: 12px 14px 0; border: 1px solid var(--line); }
.article-log__raw summary { padding: 8px 10px; cursor: pointer; color: var(--ink-2); font-size: 12.5px; font-weight: 700; background: #f8f9fb; }
.article-log__raw pre, .article-log__output { margin: 0; padding: 10px; max-height: 60vh; overflow: auto; background: #0f1724; color: #d7e0f0; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.article-log__output { margin: 12px 14px 0; }

.article-graph { padding-bottom: 18px; }
.article-graph__scroll { overflow: auto; padding: 8px 0; }
.article-graph__svg { display: block; max-width: none; font-family: var(--font); }
.article-graph__svg .graph-col { fill: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.graph-node { cursor: pointer; }
.graph-node rect { fill: #fff; stroke: var(--line-dark); stroke-width: 1; }
.graph-node text { fill: var(--ink); font-size: 11.5px; font-weight: 700; }
.graph-node .graph-node__sub { fill: var(--muted); font-size: 9.5px; font-weight: 500; font-family: var(--mono); }
.graph-node--s rect { fill: #f5f2ea; stroke: #d9c9a3; }
.graph-node--t rect { fill: #f6f1fa; stroke: var(--violet-soft); }
.graph-node--t.is-formal rect { stroke: var(--green); stroke-width: 1.5; }
.graph-node--l rect { fill: #eef4ff; stroke: var(--blue-soft); }
.graph-node--l.is-sorry rect { stroke: var(--orange); stroke-dasharray: 4 3; }
.graph-node:hover rect, .graph-node:focus-visible rect { stroke: var(--blue); stroke-width: 2; }
.graph-node:focus { outline: none; }
.graph-edge { fill: none; stroke: #c3cad6; stroke-width: 1.3; }
.graph-edge.is-ref { stroke: var(--violet); stroke-dasharray: 3 3; }
.graph-edge.is-formal { stroke: var(--green); stroke-width: 1.6; }
.article-graph__svg marker path { fill: #7c8799; }
.article-graph__legend { padding: 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 11.5px; }
.article-graph__legend i { display: inline-block; width: 22px; height: 0; margin-right: -8px; border-top: 2px solid #c3cad6; vertical-align: middle; }
.article-graph__legend i.is-ref { border-top: 2px dashed var(--violet); }
.article-graph__legend i.is-formal { border-top-color: var(--green); }

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

/* Agent buttons and the progress panel of a team run (Статьи, custom tabs). */
.agent-bar { display: inline-flex; align-items: center; gap: 6px; }
.agent-button.is-busy .icon, .agent-card.is-busy .icon { animation: article-pulse 1.1s ease-in-out infinite; }
.article-agents { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; overflow-y: auto; }
.article-agents__intro { display: grid; gap: 10px; justify-items: start; }
.article-agents__intro > p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.article-agents__buttons { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.agent-card { min-height: 64px; padding: 10px 12px; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; text-align: left; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; font: inherit; }
.agent-card:hover:not(:disabled) { border-color: var(--blue-soft); background: var(--blue-pale); }
.agent-card:disabled { opacity: .55; cursor: not-allowed; }
.agent-card > .icon { color: var(--blue); margin-top: 1px; }
.agent-card span { display: grid; gap: 3px; min-width: 0; }
.agent-card b { color: var(--navy); font-size: 13px; }
.agent-card small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

.action-run { min-width: 0; border: 1px solid var(--line); background: #fff; display: grid; grid-template-columns: minmax(0, 1fr); }
.action-run > *, .action-change, .action-run__changes { min-width: 0; }
.action-run.is-running, .action-run.is-queued { border-color: var(--blue-soft); }
.action-run.is-failed { border-color: #f1b8c7; }
.action-run__head { padding: 9px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.action-run__title { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 13px; }
.action-run__title .icon { color: var(--blue); }
.action-run__team { color: var(--muted); font-size: 11.5px; }
.action-run__spacer { flex: 1; }
.action-run__context { margin: 0; padding: 8px 12px 0; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; }
.action-run__wait { margin: 0; padding: 12px; color: var(--muted); font-size: 12.5px; }
.action-run__error { margin: 8px 12px 0; padding: 8px 10px; display: flex; gap: 6px; align-items: flex-start; background: #fdecef; color: var(--red); font-size: 12.5px; line-height: 1.45; }
.action-run__summary { margin: 10px 12px 0; padding: 10px 12px; max-height: 240px; overflow: auto; white-space: pre-wrap; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.action-run__nochange { margin: 10px 12px 0; color: var(--muted); font-size: 12.5px; }
.action-run__applied { margin: 10px 12px 0; display: flex; align-items: center; gap: 6px; color: #13744a; font-size: 12.5px; font-weight: 700; }
.action-run__changes { padding: 10px 12px 0; display: grid; gap: 6px; }
.action-run__changes h4 { margin: 0 0 2px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.action-run__actions { margin-top: 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
.action-run > :last-child:not(.action-run__actions) { margin-bottom: 12px; }
.run-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; font-size: 11px; font-weight: 800; letter-spacing: .02em; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.run-chip--ok { background: #dcf3e8; color: #13744a; }
.run-chip--info { background: var(--blue-pale); color: var(--blue); }
.run-chip--error { background: #fdecef; color: var(--red); }
.run-chip--muted { background: var(--surface-3); color: var(--muted); }
.run-chip__pulse { width: 7px; height: 7px; border-radius: 50% !important; background: currentColor; animation: article-pulse 1.1s ease-in-out infinite; }
.action-steps { margin: 0; padding: 10px 12px 0; list-style: none; display: grid; gap: 2px; }
.action-steps__step { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; align-items: start; padding: 4px 0; }
.action-steps__step > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.action-steps__step b { color: var(--ink-2); font-size: 12.5px; }
.action-steps__step small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.action-steps__step.is-ok small { color: #13744a; }
.action-steps__step.is-error small { color: var(--red); }
.action-steps__step.is-active small { color: var(--blue); }
.action-steps__dot { width: 10px; height: 10px; margin-top: 4px; border-radius: 50% !important; background: #c3cad6; }
.action-steps__step.is-ok .action-steps__dot { background: var(--green); }
.action-steps__step.is-error .action-steps__dot { background: var(--red); }
.action-steps__step.is-active .action-steps__dot { background: var(--blue); animation: article-pulse 1.1s ease-in-out infinite; }
.action-steps__step details { flex: 1 1 100%; min-width: 0; }
.action-steps__step summary { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.action-steps__step ul { margin: 4px 0 2px; padding: 6px 8px; list-style: none; display: grid; gap: 3px; background: var(--surface-2); font-size: 11.5px; line-height: 1.45; color: var(--ink-2); max-height: 200px; overflow: auto; }
.action-steps__step ul em { font-style: normal; color: var(--muted); font-family: var(--mono); font-size: 10.5px; margin-right: 4px; }
.action-steps__route { padding: 0 0 0 3px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11.5px; }
.action-steps__route.is-finish { color: var(--ink-2); font-weight: 700; padding-top: 4px; }
.action-change { border: 1px solid var(--line); }
.action-change > summary { padding: 6px 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12px; background: #fbfcfe; }
.action-change > summary code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; color: var(--ink-2); }
.action-change > summary em { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 1px 6px; }
.action-change > summary em.is-new { background: #dcf3e8; color: #13744a; }
.action-change > summary em.is-del { background: #fdecef; color: var(--red); }
.action-change__stat { margin-left: auto; font-family: var(--mono); font-size: 11px; }
.action-change__stat b { color: #13744a; } .action-change__stat i { color: var(--red); font-style: normal; }
.action-change__pick { display: inline-flex; padding: 0 2px; }
.action-diff { margin: 0; max-height: 46vh; overflow: auto; padding: 4px 0; font: 11.5px/1.55 var(--mono); background: #fff; border-top: 1px solid var(--line); }
.action-diff .diff-line { padding: 0 10px 0 0; white-space: pre; min-width: max-content; }
.action-diff .diff-line i { display: inline-block; width: 3.4em; padding-right: 6px; text-align: right; color: #9aa2af; font-style: normal; user-select: none; }
.action-history { border-top: 1px solid var(--line); padding-top: 8px; }
.action-history summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700; }
.action-history ul { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.action-history button { width: 100%; padding: 6px 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; text-align: left; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.action-history button.is-active, .action-history button:hover { border-color: var(--blue-soft); background: var(--blue-pale); }
.action-history b { font-size: 12.5px; color: var(--ink-2); }
.action-history small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }

.buttons-editor__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.buttons-editor__row { padding: 10px; display: grid; grid-template-columns: 28px minmax(0, 1fr) 32px; gap: 8px; border: 1px solid var(--line); background: #fbfcfe; }
.buttons-editor__order { display: grid; align-content: start; gap: 2px; }
.buttons-editor__fields { display: grid; gap: 8px; min-width: 0; }
.buttons-editor__line { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 8px; }
.buttons-editor__empty { padding: 16px; color: var(--muted); text-align: center; border: 1px dashed var(--line); }
.buttons-editor__more { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.buttons-editor__more a { color: var(--blue); display: inline-flex; align-items: center; gap: 4px; }
.modal__spacer { flex: 1; }
@media (max-width: 640px) { .buttons-editor__line { grid-template-columns: minmax(0, 1fr); } }

.article-mobile-switch { display: none; }

.article-empty { flex: 1; min-height: 0; overflow-y: auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 3vw, 40px); display: grid; align-content: start; justify-items: center; gap: 18px; }
.article-empty .empty-state { max-width: 620px; }
.article-empty__others { color: var(--ink-2); font-size: 13px; }
.article-empty__others a { color: var(--blue); font-weight: 700; }
.article-empty__features { width: min(760px, 100%); margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; list-style: none; }
.article-empty__features li { padding: 14px; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; border: 1px solid var(--line); background: #fbfcfe; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.article-empty__features li > .icon { margin-top: 2px; color: var(--blue); }
.article-empty__features b { color: var(--navy); }

.article-check { align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); background: #fff; }
.article-check input { margin-top: 3px; }
.article-check > span { min-width: 0; display: grid; gap: 2px; }
.article-check b { color: var(--navy); font-size: 13px; font-weight: 700; word-break: break-all; }
.article-new__options, .article-save__files { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.article-save__files legend { margin-bottom: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.article-save__files { max-height: 260px; overflow-y: auto; }
.diff-add { color: var(--green); font-weight: 700; }
.diff-del { color: var(--red); font-weight: 700; }

/* Panes adapt to their own width (the splitters change it), not only to the window. */
.article-editor, .article-preview { container-type: inline-size; }
@container (max-width: 620px) {
  .article-status__keys { display: none; }
}
@container (max-width: 600px) {
  .article-preview__tabs [data-preview-tab]:not(.is-active) span { display: none; }
  .article-preview__tabs [data-preview-tab] { padding: 0 10px; }
}
@container (max-width: 380px) {
  .article-status__state { display: none; }
}
@media (max-width: 1180px) {
  .article-bar__title b { max-width: 220px; }
}
@media (max-width: 900px) {
  .article-bar { flex-wrap: wrap; }
  .article-bar__doc { order: 3; flex: 1 1 auto; padding-left: 0; border-left: 0; }
  .article-bar__select select { max-width: none; }
  .article-workspace, .article-workspace.is-side-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .article-workspace > .article-side, .article-workspace > .article-editor, .article-workspace > .article-preview { grid-column: 1; grid-row: 1; visibility: visible; }
  .article-splitter { display: none; }
  .article-workspace[data-mobile-pane=editor] > .article-side, .article-workspace[data-mobile-pane=editor] > .article-preview,
  .article-workspace[data-mobile-pane=side] > .article-editor, .article-workspace[data-mobile-pane=side] > .article-preview,
  .article-workspace[data-mobile-pane=preview] > .article-side, .article-workspace[data-mobile-pane=preview] > .article-editor { display: none; }
  .article-mobile-switch { grid-row: 2; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: #fbfcfe; }
  .article-mobile-switch button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
  .article-mobile-switch button.is-active { color: var(--blue); box-shadow: inset 0 2px 0 var(--blue); background: #fff; }
  .article-empty__features { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .article-formal__busy .icon, .article-bar .button.is-busy::after { animation: none; } }

/* ------------------------------------------------------------------------- */
/* «Агенты → Доступ / Программы»                                              */
/* ------------------------------------------------------------------------- */
.harness-screen { display: grid; gap: 16px; align-content: start; }
.harness-muted { color: var(--muted); }
.harness-sandbox { padding: 14px 16px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; border: 1px solid var(--line); background: #fff; }
.harness-sandbox.is-ok { border-left: 3px solid var(--green); }
.harness-sandbox.is-warn { border-left: 3px solid var(--orange); background: #fffaf3; }
.harness-sandbox__icon { width: 36px; height: 36px; display: grid; place-items: center; background: var(--blue-pale); color: var(--blue); }
.harness-sandbox.is-ok .harness-sandbox__icon { background: #dcf3e8; color: var(--green); }
.harness-sandbox.is-warn .harness-sandbox__icon { background: #ffedd5; color: var(--orange); }
.harness-sandbox b { color: var(--navy); font-size: 13.5px; }
.harness-sandbox p { margin-top: 3px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.harness-tools { margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; list-style: none; }
.harness-tools li { padding: 4px 8px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: 12px; }
.harness-tools li.is-on { background: #f1faf5; border-color: #bfe5cf; color: #13744a; }
.harness-tools small { color: var(--muted); font-size: 10.5px; font-family: var(--mono); }
.harness-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.harness-card { min-width: 0; display: grid; grid-template-rows: auto 1fr auto; border: 1px solid var(--line); background: #fff; }
.harness-card.is-locked { background: #fbfbfd; }
.harness-card > header { padding: 14px 16px 10px; display: flex; justify-content: space-between; gap: 10px; }
.harness-card h3 { color: var(--navy); font-size: 15px; }
.harness-card > header p { margin-top: 4px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.harness-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.harness-badges em, .harness-program em { padding: 2px 7px; display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); color: var(--muted); font-style: normal; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.harness-badges em.is-blue { background: var(--blue-pale); color: var(--blue); }
.harness-badges em.is-violet { background: #f1eaf8; color: var(--violet); }
.harness-program em.is-green { background: #dcf3e8; color: #13744a; }
.harness-program em.is-orange { background: #fff1e5; color: #9a4b0b; }
.harness-rules { margin: 0; padding: 0 16px 12px; display: grid; gap: 6px; }
.harness-rules > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; font-size: 12.5px; line-height: 1.5; }
.harness-rules dt { color: var(--muted); }
.harness-rules dd { margin: 0; min-width: 0; color: var(--ink-2); }
.harness-rules code { margin: 0 2px 2px 0; padding: 0 5px; display: inline-block; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--ink); }
.harness-card > footer { padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); background: #fbfcfe; font-size: 12px; }
.harness-programs { display: grid; border: 1px solid var(--line); background: #fff; }
.harness-program { padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; border-bottom: 1px solid var(--line); }
.harness-program:last-child { border-bottom: 0; }
.harness-program.is-off .harness-program__main { opacity: .7; }
.harness-program header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.harness-program h3 { color: var(--navy); font-size: 14px; }
.harness-program header code { color: var(--muted); font-size: 11.5px; }
.harness-program p { margin-top: 4px; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; }
.harness-program small { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.harness-command { margin: 8px 0 0; padding: 6px 9px; overflow-x: auto; background: #0f1724; color: #d7e0f0; font-family: var(--mono); font-size: 11.5px; white-space: pre; }
.harness-problem { display: flex; align-items: center; gap: 5px; color: #9a4b0b !important; }
.harness-program__actions { display: flex; align-items: center; gap: 6px; }
.harness-form textarea { font-family: var(--mono); font-size: 12px; }
.harness-fieldset { margin: 0; padding: 10px 12px; display: grid; gap: 8px; border: 1px solid var(--line); }
.harness-fieldset legend { padding: 0 4px; color: var(--ink-2); font-size: 12.5px; font-weight: 750; }
.harness-program-picks, .harness-checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
@media (max-width: 760px) {
  .harness-rules > div { grid-template-columns: 1fr; gap: 0; }
  .harness-program { grid-template-columns: 1fr; }
}
.article-pdf.is-building::before { content: ""; position: sticky; top: 0; z-index: 2; display: block; height: 3px; margin-bottom: -3px; background: linear-gradient(90deg, transparent, var(--blue), transparent) no-repeat; background-size: 40% 100%; animation: article-progress 1.1s linear infinite; }
.article-pdf.is-building .article-pdf__page canvas { opacity: .55; transition: opacity .2s; }
@keyframes article-progress { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.article-pdf__page[data-failed] > span::after { content: " · не удалось отрисовать"; font-size: 12px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .article-pdf.is-building::before { animation: none; background-size: 100% 100%; } }
.article-editor__pane .cm-scroller { overscroll-behavior: contain; }
.article-status__hint { display: inline-flex; align-items: center; gap: 4px; color: #9a4b0b; font-weight: 650; }
.article-run { min-width: 128px; justify-content: center; }
.article-more__panel [role=menuitem] > span { flex: 1; }

/* ------------------------------------------------------------------------- */
/* Project header: one row — tabs, then the role button with the project card */
/* ------------------------------------------------------------------------- */
:root { --project-workspace-offset: 42px; }
@media (max-width: 1100px) { :root { --project-workspace-offset: 92px; } }
.project-header { position: relative; z-index: 20; }
.project-header__bar { min-height: var(--project-tabs-height); display: flex; align-items: center; gap: 8px; padding-right: clamp(10px, 2vw, 22px); }
.project-header__bar > .project-tabs { flex: 1 1 auto; min-width: 0; }
.project-header__bar > .project-role-chip { flex: 0 0 auto; }
.project-role-chip > summary { min-height: 32px; gap: 6px; }
.project-role-chip > summary:hover { border-color: var(--blue-soft); color: var(--blue); }
.project-role-chip > summary .icon:last-child { color: var(--muted); transition: transform .15s; }
.project-role-chip[open] > summary .icon:last-child { transform: rotate(180deg); }
.project-role-chip__panel { top: calc(100% + 6px); width: min(380px, calc(100vw - 20px)); padding: 0; gap: 0; animation: repo-switch-in .14s ease-out; }
.project-role-chip__project { padding: 16px; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.project-role-chip__project .project-symbol { width: 48px; height: 48px; font-size: 15px; }
.project-role-chip__name { display: block; color: var(--navy); font-size: 17px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.project-role-chip__project .project-description { margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.project-role-chip__project .project-description.is-empty { font-style: italic; }
.project-role-chip__role { padding: 12px 16px 14px; display: grid; gap: 6px; }
.project-role-chip__role > b { color: var(--ink); }
.workspace-topbar__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 14px; font-weight: 800; }
@media (max-width: 1100px) { .workspace-topbar { gap: 8px; } }
@media (max-width: 760px) {
  .project-header__bar { padding-right: 8px; }
  .project-role-chip > summary { padding-inline: 8px; }
  .project-role-chip > summary > span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) { .project-role-chip > summary > span { display: none; } }

/* ---------------------------------------------------------------------------
   Custom project tabs (modules) and GitLab pipelines
   --------------------------------------------------------------------------- */
.section-row:has(> a.button) { grid-template-columns: 26px minmax(0, 1fr) auto auto auto; }
.section-order__footer { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.section-order__footer small { color: var(--muted); font-size: 12px; }

.custom-tab { padding: 14px clamp(12px, 2vw, 22px) 22px; display: grid; gap: 12px; align-content: start; }
.custom-tab__tools { display: flex; justify-content: flex-end; margin-bottom: -4px; }
.custom-tab .empty-state { margin: 6vh auto 0; }
.tab-builder-bar { position: sticky; top: 0; z-index: 4; padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border: 1px solid var(--blue-soft); background: var(--blue-pale); }
.tab-builder-bar__label { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-weight: 800; font-size: 13px; }
.tab-builder-bar input, .tab-builder-bar select { min-height: 32px; padding: 3px 8px; font-size: 13px; }
.tab-builder-bar input { width: min(240px, 50vw); font-weight: 700; }
.tab-builder-bar__spacer { flex: 1; }
.tab-palette { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tab-palette__label { display: inline-flex; align-items: center; gap: 5px; margin-right: 4px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.tab-palette button { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--blue-soft); background: #fff; color: var(--navy); cursor: pointer; font: inherit; font-size: 12.5px; }
.tab-palette button:hover { border-style: solid; border-color: var(--blue); background: var(--blue-pale); }
.tab-palette button > .icon { color: var(--blue); }

.tab-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; align-items: start; }
.tab-module { grid-column: span 3; min-width: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--line); background: #fff; }
.tab-module--third { grid-column: span 2; }
.tab-module--two-thirds { grid-column: span 4; }
.tab-module--full { grid-column: span 6; }
.tab-module.is-editing { border-style: dashed; border-color: var(--blue-soft); }
.tab-module__head { min-height: 40px; padding: 6px 8px 6px 12px; display: flex; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.tab-module__head > .icon { color: var(--blue); flex: 0 0 auto; }
.tab-module__head > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 13px; }
.tab-module__extra { margin-left: auto; min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.tab-module__link { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); white-space: nowrap; }
.tab-module__sub { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-module__edit { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--line); }
.tab-module__edit .icon-button { width: 28px; height: 28px; }
.tab-module__edit .icon-button.is-on { color: var(--blue); background: var(--blue-pale); }
.tab-module__edit select { height: 28px; padding: 0 4px; font-size: 12px; }
.tab-module__body { min-height: 0; max-height: 440px; overflow: auto; }
.tab-module--h-tall .tab-module__body { max-height: 720px; }
.tab-module--chat .tab-module__body, .tab-module--files .tab-module__body { height: 440px; overflow: hidden; }
.tab-module--chat.tab-module--h-tall .tab-module__body, .tab-module--files.tab-module--h-tall .tab-module__body { height: 720px; }
.tab-module--actions .tab-module__body, .tab-module--notes .tab-module__body { max-height: none; }
.tab-module__hint { margin: 0; padding: 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }

.tab-note { padding: 10px 14px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.tab-note p, .tab-note ul { margin: 0 0 8px; }
.tab-note h4 { margin: 4px 0 6px; color: var(--navy); font-size: 14px; }
.tab-note a { color: var(--blue); text-decoration: underline; }

.tab-actions { padding: 10px 12px; display: grid; gap: 10px; }
.tab-actions__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tab-actions__buttons { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.tab-actions .branch-select select { max-width: 180px; background: transparent; }
.command-forms { display: grid; gap: 24px; }
.command-form { display: grid; gap: 18px; max-width: 940px; padding: 8px 0; }
.command-form + .command-form { border-top: 1px solid var(--line); padding-top: 24px; }
.command-form h3 { margin: 0; color: var(--navy); font-size: 16px; }
.command-form__team { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 12px; }
.command-field { display: grid; gap: 8px; min-width: 0; }
.command-field__label, .command-field > span { display: flex; align-items: baseline; gap: 10px; color: var(--navy); font-size: 13px; font-weight: 700; }
.command-field em { font-size: 11px; font-style: normal; font-weight: 400; color: var(--muted); }
.command-field > small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.command-upload { position: relative; min-height: 150px; padding: 24px; display: grid; justify-items: center; align-content: center; gap: 9px; border: 1px dashed var(--blue-soft); background: #f8faff; text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.command-upload:hover, .command-upload.is-over { border-color: var(--blue); background: var(--blue-pale); }
.command-upload:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
.command-upload:has(input:disabled) { opacity: .65; cursor: default; }
.command-upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; }
.command-upload__icon { color: var(--blue); }
.command-upload b { font-size: 13px; color: var(--navy); line-height: 1.5; }
.command-upload u { text-underline-offset: 3px; color: var(--blue); }
.command-upload small { color: var(--muted); font-size: 11px; }
.command-files { list-style: none; display: grid; gap: 6px; padding: 0; margin: 0; }
.command-files:empty { display: none; }
.command-files li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); background: #fff; min-width: 0; }
.command-files li > .icon { color: var(--blue); flex: none; }
.command-files li > span { flex: 1; min-width: 0; display: grid; gap: 3px; }
.command-files b { color: var(--navy); font-size: 12px; overflow-wrap: anywhere; }
.command-files small { color: var(--muted); font-size: 11px; }
.command-form__footer { display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; }
.command-form__outputs { color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.command-form__error { padding: 10px 12px; margin: 0; color: var(--red); background: #fff1f3; font-size: 12.5px; line-height: 1.5; }
.command-advanced { border-top: 1px solid var(--line); padding-top: 10px; }
.command-advanced > summary, .command-publish > summary { font-size: 12px; color: var(--muted); cursor: pointer; }
.command-advanced > div { padding-top: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; color: var(--ink-2); font-size: 12px; }
.command-advanced .field { margin: 0; display: flex; align-items: center; gap: 10px; }
.command-advanced small { flex-basis: 100%; color: var(--muted); line-height: 1.5; }
.command-schema > section { display: grid; gap: 12px; }
.command-schema h3 { font-size: 15px; color: var(--navy); margin: 0; }
.command-schema__field { padding: 16px 0; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.command-schema__line { display: grid; grid-template-columns: minmax(0, 1fr) 190px 30px; align-items: end; gap: 12px; }
.command-schema__outputs { border: 1px solid var(--line); padding: 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; }
.command-schema__outputs legend { color: var(--navy); font-size: 13px; font-weight: 700; padding: 0 6px; }
.command-schema__outputs label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.command-contract { padding: 12px; border-left: 2px solid var(--blue); background: #f8faff; display: grid; gap: 7px; font-size: 12px; line-height: 1.5; }
.command-contract b { color: var(--navy); }
.command-contract small { color: var(--muted); }
.command-contract a { color: var(--blue); }
.command-run-sources { padding: 10px 12px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 12px; }
.command-run-sources > span { color: var(--muted); }
.command-run-sources a { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); overflow-wrap: anywhere; }
.command-results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 5px; }
.command-result-file { padding: 8px 12px; font-size: 12px; }
.command-result-file a { color: var(--blue); display: inline-flex; align-items: center; gap: 6px; }
.command-publish { border-top: 1px solid var(--line); margin-top: 12px; padding: 12px; }
.command-publish > .action-run__actions { padding: 12px 0 0; border: 0; }
@media (max-width: 600px) {
  .command-upload { padding: 18px 12px; }
  .command-form__footer > button { width: 100%; justify-content: center; }
  .command-schema__line { grid-template-columns: minmax(0, 1fr) 30px; }
  .command-schema__line > .field:nth-child(2) { grid-column: 1 / -1; }
  .command-schema__line > button { grid-column: 2; grid-row: 1; }
}

.tab-git { padding: 6px 12px 10px; }
.tab-git h5 { margin: 8px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tab-git ul { margin: 0; padding: 0; list-style: none; display: grid; }
.tab-git li { min-width: 0; padding: 5px 0; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--surface-3); font-size: 12.5px; }
.tab-git li > a { min-width: 0; display: flex; align-items: center; gap: 6px; color: var(--ink-2); flex: 1 1 auto; }
.tab-git li > a b, .tab-git li > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-git li > a:hover { color: var(--blue); }
.tab-git li small { flex: 0 0 auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
.tab-git__commits code { color: var(--blue); font-size: 11px; }

.tab-files { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.tab-files__bar { padding: 6px 10px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); min-width: 0; }
.tab-files__bar .branch-select select { max-width: 140px; background: transparent; }
.tab-files__crumbs { min-width: 0; display: flex; align-items: center; gap: 3px; overflow-x: auto; font-size: 12px; white-space: nowrap; }
.tab-files__crumbs button { border: 0; background: none; padding: 2px 3px; color: var(--blue); cursor: pointer; font: inherit; }
.tab-files__crumbs span { color: var(--muted); }
.tab-files__split { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.tab-files__split.has-file { grid-template-columns: minmax(150px, 34%) minmax(0, 1fr); }
.tab-files__list { margin: 0; padding: 4px 0; list-style: none; overflow-y: auto; border-right: 1px solid var(--line); }
.tab-files__list button { width: 100%; padding: 5px 10px; display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 7px; align-items: center; text-align: left; border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 12.5px; }
.tab-files__list button:hover, .tab-files__list button.is-active { background: var(--blue-pale); color: var(--navy); }
.tab-files__list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-files__list button small { color: var(--muted); font-size: 10.5px; }
.tab-files__list button > .icon { color: var(--muted); }
.tab-files__preview { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.tab-files__split:not(.has-file) .tab-files__preview { display: none; }
.tab-files__preview header { padding: 5px 8px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.tab-files__preview header code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.tab-files__preview header a { color: var(--blue); display: inline-flex; }
.tab-files__preview header .icon-button { width: 24px; height: 24px; }
.tab-files__code { margin: 0; overflow: auto; padding: 6px 0; font: 11.5px/1.55 var(--mono); color: #26364e; }
.tab-files__code span { display: block; white-space: pre; padding-right: 12px; min-width: max-content; }
.tab-files__code i { display: inline-block; width: 3.5em; padding-right: 10px; text-align: right; color: #9aa2af; font-style: normal; user-select: none; }
.tab-files__image { max-width: 100%; max-height: 100%; object-fit: contain; padding: 10px; }

.tab-chat { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.tab-chat__log { min-height: 0; overflow-y: auto; padding: 8px 12px; display: grid; align-content: start; gap: 8px; }
.tab-chat__msg { max-width: 92%; padding: 7px 10px; border: 1px solid var(--line); background: #fff; }
.tab-chat__msg.is-mine { justify-self: end; background: var(--blue-pale); border-color: var(--blue-soft); }
.tab-chat__msg--system { background: #fff8ec; border-color: #f2d7a8; }
.tab-chat__msg header { display: flex; gap: 8px; align-items: baseline; font-size: 11.5px; }
.tab-chat__msg header b { color: var(--navy); }
.tab-chat__msg header time { color: var(--muted); font-size: 10.5px; }
.tab-chat__msg p { margin: 3px 0 0; white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; }
.tab-chat__pending, .tab-chat__branch { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--blue); font-size: 12px; }
.tab-chat__pending .icon { animation: article-pulse 1.1s ease-in-out infinite; }
.tab-chat__branch a { color: var(--blue); font-weight: 700; }
.tab-chat__form { padding: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: end; border-top: 1px solid var(--line); }
.tab-chat__form textarea { min-height: 40px; max-height: 140px; resize: vertical; padding: 8px 10px; font-size: 13px; }

.tab-templates { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tab-template { position: relative; cursor: pointer; }
.tab-template input { position: absolute; opacity: 0; }
.tab-template span { height: 100%; padding: 12px; display: grid; gap: 4px; border: 1px solid var(--line); background: #fff; }
.tab-template span .icon { color: var(--blue); }
.tab-template b { color: var(--navy); font-size: 13px; }
.tab-template small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.tab-template input:checked + span { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); background: var(--blue-pale); }
.tab-template input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }

.pipelines { display: grid; gap: 8px; }
.project-tab-content--view-pipelines .pipelines { padding: 14px clamp(12px, 2vw, 22px); }
.pipelines--compact { padding: 8px 10px; }
.pipelines__loading, .pipelines__none, .pipelines__error { margin: 0; padding: 10px 2px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.pipelines__error { color: var(--red); }
.pipelines__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pipelines__bar .branch-select select { max-width: 180px; background: transparent; }
.pipelines__spacer { flex: 1; }
.pipeline-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pipeline-row { border: 1px solid var(--line); background: #fff; }
.pipeline-row.is-open { border-color: var(--blue-soft); }
.pipeline-row__main { width: 100%; padding: 7px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-align: left; border: 0; background: none; cursor: pointer; font: inherit; color: var(--ink-2); }
.pipeline-row__main:hover { background: #fbfcfe; }
.pipeline-row__main b { font-size: 12.5px; color: var(--navy); }
.pipeline-row__ref { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; }
.pipeline-row__main code { font-size: 11px; color: var(--muted); }
.pipeline-row__main small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.pipeline-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--surface-3); color: var(--muted); }
.pipeline-chip--ok { background: #dcf3e8; color: #13744a; }
.pipeline-chip--error { background: #fdecef; color: var(--red); }
.pipeline-chip--info { background: var(--blue-pale); color: var(--blue); }
.pipeline-chip--info .icon { animation: pipeline-spin 1.6s linear infinite; }
@keyframes pipeline-spin { to { transform: rotate(360deg); } }
a.pipeline-chip:hover { text-decoration: underline; }
.pipeline-detail { padding: 8px 10px 10px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.pipeline-detail__meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.pipeline-stages { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.pipeline-stage { flex: 0 0 auto; min-width: 150px; display: grid; gap: 4px; align-content: start; }
.pipeline-stage h5 { margin: 0 0 2px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pipeline-job { padding: 6px 8px; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 6px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; cursor: pointer; font: inherit; }
.pipeline-job span { font-size: 12.5px; color: var(--ink-2); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pipeline-job small { grid-column: 2; color: var(--muted); font-size: 11px; }
.pipeline-job:hover { border-color: var(--blue-soft); background: var(--blue-pale); }
.pipeline-job--ok > .icon { color: var(--green); }
.pipeline-job--error { border-color: #f1b8c7; }
.pipeline-job--error > .icon { color: var(--red); }
.pipeline-job--info > .icon { color: var(--blue); }
.pipeline-job--muted > .icon { color: var(--muted); }
.pipeline-detail__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.job-log { margin: 0; max-height: 64vh; overflow: auto; padding: 12px; background: #101c35; color: #d6e2f2; font: 12px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.pipelines-empty { padding: 20px; }

@media (max-width: 1100px) {
  .tab-module--third, .tab-module--half { grid-column: span 3; }
  .tab-module--two-thirds { grid-column: span 6; }
}
@media (max-width: 760px) {
  .tab-grid { grid-template-columns: minmax(0, 1fr); }
  .tab-module, .tab-module--third, .tab-module--half, .tab-module--two-thirds, .tab-module--full { grid-column: auto; }
  .tab-module--chat .tab-module__body, .tab-module--files .tab-module__body { height: 380px; }
  .tab-files__split.has-file { grid-template-columns: minmax(0, 1fr); }
  .tab-files__split.has-file .tab-files__list { display: none; }
  .tab-templates { grid-template-columns: minmax(0, 1fr); }
  .tab-module__edit select { max-width: 64px; }
}

/* Decluttered tabs: one header row per list, quiet empty states. */
.feature-list > header { align-items: center; gap: 8px; padding: 12px 14px 12px 20px; min-height: 58px; }
.feature-list__tools { display: inline-flex; align-items: center; gap: 6px; }
.feature-list__tools .icon-button { width: 32px; height: 32px; }
.overview-stat-strip { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.overview-clear { margin: 0; padding: 10px 14px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 12.5px; }
.overview-clear .icon { color: var(--green); }
.mr-none { padding: 6vh 16px; display: grid; justify-items: center; }
.mr-none .empty-state { max-width: 560px; }
.create-menu__panel { min-width: 230px; padding: 6px; display: grid; gap: 2px; }
.create-menu__panel [role=menuitem] { padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-2); text-align: left; }
.create-menu__panel [role=menuitem]:hover { background: var(--blue-pale); color: var(--navy); }
.create-menu .clone-menu__panel.create-menu__panel { width: 260px; padding: 6px; gap: 2px; }
.compute-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.compute-head h2 { margin: 0; font-size: 17px; color: var(--navy); }
.compute-head .compute-sub { margin: 0; font-size: 12.5px; }
.compute-layout.is-empty { grid-template-columns: minmax(0, 760px); }
.compute-layout .compute-detail[hidden] { display: none; }
.compute-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.compute-form > .compute-src-toggle, .compute-form > [data-src-dockerfile], .compute-form > .compute-form-row, .compute-form > .compute-form-actions { grid-column: 1 / -1; }
.compute-src-toggle { display: flex; gap: 16px; }
.compute-jobs:empty { display: none; }
@media (max-width: 760px) { .compute-form { grid-template-columns: minmax(0, 1fr); } }
.feature-list__tools .button { white-space: nowrap; }
.feature-list > header > b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-tab-content--view-pipelines { padding: 0; }
.project-tab-content--view-pipelines > .code-bar { margin: 0; }
@media (min-width: 901px) { .agent-bar .code-bar__label { display: inline; } }
.tab-git li > a.pipeline-chip { flex: 0 0 auto; color: inherit; }
.tab-git li > a.pipeline-chip--error { color: var(--red); }
.tab-git li > a.pipeline-chip--ok { color: #13744a; }
.tab-git li > a.pipeline-chip--info { color: var(--blue); }
.action-run__team { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-run__spacer { display: none; }

/* Agents → Models: default model, OpenAI account, personal and lab models. */
.models-screen { display: grid; gap: 18px; max-width: 1180px; }
.models-default { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); background: #fff; }
.models-default h2, .models-section h2 { margin: 0; color: var(--navy); font-size: 15px; }
.models-default p, .models-section header p { margin: 4px 0 0; max-width: 720px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.models-default select { flex: 0 0 300px; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--line-dark); background: #fff; font: inherit; font-size: 13px; }
.models-section { display: grid; gap: 10px; }
.models-section > header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.models-section > header .button { flex: 0 0 auto; }
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 10px; }
.model-grid > .empty-state { grid-column: 1 / -1; }
.model-card { min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); background: #fff; }
.model-card.is-disabled { background: var(--surface-2); }
.model-card.is-disabled h3, .model-card.is-disabled dd { color: var(--muted); }
.model-card header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.model-card h3 { margin: 4px 0 0; color: var(--navy); font-size: 15px; overflow-wrap: anywhere; }
.model-card > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.model-card dl { margin: 4px 0 0; display: grid; gap: 4px; }
.model-card dl div { min-width: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; font-size: 12px; }
.model-card dt { color: var(--muted); }
.model-card dd { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.model-card footer { margin-top: auto; padding-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.model-kind { padding: 2px 7px; border: 1px solid var(--line-dark); color: var(--ink-2); font-size: 10.5px; font-weight: 750; letter-spacing: .02em; text-transform: uppercase; }
.model-kind--openai_account { border-color: #9fd6bd; background: #eaf7f0; color: #13744a; }
.model-kind--mock { border-color: var(--violet-soft); background: #f6f1fa; color: var(--violet); }
.model-tag { padding: 2px 7px; background: var(--blue-pale); color: var(--blue); font-size: 11px; font-weight: 700; }
.model-tag--off { background: var(--surface-3); color: var(--muted); }
.account-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--line-dark); background: #fff; }
.account-card.is-connected { border-left-color: var(--green); }
.account-card.is-broken { border-left-color: var(--red); }
.account-card__icon { width: 34px; height: 34px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.account-card.is-connected .account-card__icon { background: #eaf7f0; color: var(--green); }
.account-card h3 { margin: 0; color: var(--navy); font-size: 15px; }
.account-card__main > p { margin: 4px 0 0; max-width: 720px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.account-card__main b { color: var(--ink-2); }
.account-card__error { color: var(--red) !important; display: inline-flex; align-items: center; gap: 6px; }
.account-card__actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.device-login { margin-top: 12px; padding: 12px 14px; display: grid; gap: 10px; border: 1px solid var(--blue-soft); background: var(--blue-pale); }
.device-login p { margin: 0; font-size: 12px; }
.device-steps { margin: 0; padding-left: 18px; display: grid; gap: 3px; color: var(--ink-2); font-size: 13px; }
.device-code { display: inline-flex; align-items: center; gap: 10px; justify-self: start; padding: 6px 8px 6px 14px; border: 1px solid var(--line-dark); background: #fff; }
.device-code strong { color: var(--navy); font: 700 22px/1.2 var(--mono); letter-spacing: .12em; }
.device-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.device-state { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.spinner-dot { width: 9px; height: 9px; flex: 0 0 auto; background: var(--blue); animation: lans-pulse 1.1s ease-in-out infinite; }
@keyframes lans-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.preset-picker { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.preset-picker legend { margin-bottom: 8px; padding: 0; color: var(--ink-2); font-size: 12px; font-weight: 750; }
.preset-picker label { position: relative; cursor: pointer; }
.preset-picker input { position: absolute; opacity: 0; }
.preset-picker span { display: block; padding: 7px 11px; border: 1px solid var(--line-dark); background: #fff; color: var(--ink-2); font-size: 12.5px; }
.preset-picker input:checked + span { border-color: var(--blue); background: var(--blue-pale); color: var(--navy); font-weight: 700; }
.preset-picker input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }
.model-more summary { cursor: pointer; color: var(--blue); font-size: 12.5px; font-weight: 700; }
.model-more[open] { display: grid; gap: 12px; }
.model-more[open] summary { margin-bottom: 2px; }
.model-test-result { margin: 0; padding: 8px 10px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; }
.model-test-result.is-ok { background: #eaf7f0; color: #13744a; }
.model-test-result.is-error { background: #fdeaf0; color: var(--red); }

/* Agents → Prompts and Skills */
.scope-filter { margin-bottom: 12px; display: flex; gap: 4px; }
.scope-filter a { padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12.5px; }
.scope-filter a small { color: var(--muted); font-size: 11px; }
.scope-filter a.is-active { border-color: var(--navy); background: var(--navy); color: #fff; }
.scope-filter a.is-active small { color: #c9d5ef; }
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.skill-grid > .empty-state { grid-column: 1 / -1; }
.skill-card { min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--line); border-top: 3px solid var(--violet); background: #fff; }
.skill-card.is-disabled { border-top-color: var(--line-dark); background: var(--surface-2); }
.skill-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.skill-card header code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 13.5px; font-weight: 700; }
.skill-card header > span { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.skill-card > p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.skill-card__meta { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 11.5px; }
.skill-card__meta li { display: inline-flex; align-items: center; gap: 4px; }
.skill-card footer { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.skill-card footer div { display: flex; gap: 10px; }
.skill-card footer button, .library-card footer button { color: var(--blue); font-weight: 700; font-size: 12px; }
.lib-badge { padding: 1px 6px; display: inline-flex; align-items: center; gap: 3px; border: 1px solid var(--line-dark); color: var(--ink-2); font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.lib-badge--mine { border-color: var(--blue-soft); background: var(--blue-pale); color: var(--blue); }
.library-card__top { justify-content: space-between; }
.scope-choice { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.scope-choice legend { margin-bottom: 8px; padding: 0; color: var(--ink-2); font-size: 12px; font-weight: 750; }
.scope-choice label { padding: 10px 12px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line-dark); background: #fff; cursor: pointer; }
.scope-choice label:has(input:checked) { border-color: var(--blue); background: var(--blue-pale); }
.scope-choice span { display: grid; gap: 2px; }
.scope-choice b { color: var(--ink-2); font-size: 13px; }
.scope-choice small { color: var(--muted); font-size: 11.5px; }
.mono-area { font: 12.5px/1.55 var(--mono) !important; }
.draft-files { display: grid; gap: 4px; }
.draft-files > b { color: var(--ink-2); font-size: 12px; }
.draft-files summary { cursor: pointer; display: flex; align-items: center; gap: 6px; font: 12.5px var(--mono); color: var(--ink-2); }
.draft-files summary small { color: var(--muted); font-family: var(--font); }
.draft-files pre { max-height: 220px; margin: 6px 0 0; padding: 10px; overflow: auto; background: var(--surface-2); font: 12px/1.5 var(--mono); white-space: pre-wrap; }
.modal--skill { width: min(1080px, calc(100vw - 32px)); max-width: none; }
.skill-editor { display: grid; gap: 12px; }
.skill-source { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: 12.5px; }
.skill-source a { color: var(--blue); overflow-wrap: anywhere; }
.skill-editor__layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.skill-files { position: sticky; top: 0; display: grid; gap: 2px; padding: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.skill-files button, .skill-files a { min-width: 0; padding: 7px 8px; display: flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--ink-2); font: 12.5px var(--mono); text-align: left; cursor: pointer; }
.skill-files button span { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-files button small { flex: 0 0 auto; white-space: nowrap; color: var(--muted); font: 10.5px var(--font); }
.skill-files button:hover, .skill-files a:hover { background: #fff; }
.skill-files button.is-active { background: #fff; color: var(--navy); box-shadow: inset 2px 0 0 var(--blue); font-weight: 700; }
.skill-files .skill-files__add, .skill-files .skill-files__download { margin-top: 4px; font-family: var(--font); color: var(--blue); font-weight: 700; }
.skill-files .skill-files__add { border-top: 1px solid var(--line); padding-top: 9px; }
.skill-pane { min-width: 0; }
.import-tabs { justify-self: start; }
.import-preview { display: grid; gap: 6px; max-height: 320px; overflow: auto; padding: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.import-preview > p { margin: 0 0 2px; font-size: 12px; }
.import-skill { padding: 9px 10px; display: flex; align-items: flex-start; gap: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.import-skill > span { min-width: 0; display: grid; gap: 3px; }
.import-skill b { color: var(--navy); font: 700 13px var(--mono); }
.import-skill em { justify-self: start; padding: 1px 6px; background: #fff4dc; color: #8a5a00; font-size: 11px; font-style: normal; font-weight: 700; }
.import-skill small { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.import-problems { padding: 8px 10px; border-left: 3px solid var(--orange); background: #fff; font-size: 12px; }
.import-problems p { margin: 4px 0 0; color: var(--ink-2); }
.agent-context-picker__hint { grid-column: 1 / -1; color: #61708a; font-size: 11px; }
.agent-trace__item--usage > span, .agent-trace__item--git > span, .agent-trace__item--skill > span { color: var(--violet); }
@media (max-width: 760px) {
  .models-default { flex-direction: column; align-items: stretch; }
  .models-default select { flex-basis: auto; width: 100%; }
  .models-section > header { flex-direction: column; align-items: stretch; }
  .models-section > header .button { justify-self: start; align-self: flex-start; }
  .account-card { grid-template-columns: auto minmax(0, 1fr); }
  .account-card__actions { grid-column: 1 / -1; justify-content: flex-start; }
  .skill-editor__layout { grid-template-columns: minmax(0, 1fr); }
  .skill-files { position: static; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
  .skill-files .skill-files__add { border-top: 0; padding-top: 7px; }
  .scope-choice { grid-template-columns: minmax(0, 1fr); }
  .scope-filter { overflow-x: auto; }
}
.compact-page-head.library-head { height: auto; min-height: var(--workspace-header-height); flex-wrap: wrap; row-gap: 8px; padding-block: 10px; }
.library-head .page-head-actions { flex-wrap: wrap; }
@media (max-width: 760px) {
  .compact-page-head.library-head { flex-direction: column; align-items: stretch; }
  .library-head .page-head-actions { justify-content: flex-start; gap: 6px; }
  .library-head .page-head-actions .context-search { flex: 1 1 100%; order: 5; }
  .library-head .page-head-actions .button { flex: 1 1 auto; }
}
.agent-who .icon, .agent-who svg { display: inline-block; vertical-align: -2px; }

/* ---- Review 2026-10-28: runner installer, logs and help ---- */
.connection-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.connection-problem { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--red); }
.runner-install .installer-steps { gap: 10px; }
.runner-install .installer-steps .button { display: inline-flex; gap: 8px; }
.installer-alt summary { cursor: pointer; font-size: 13px; color: var(--blue); margin-bottom: 8px; }
.runner-wait { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; background: var(--surface-2); border-left: 3px solid var(--line-dark); font-size: 13px; }
.runner-wait.is-ok { border-color: var(--green); background: #eaf7f0; color: #13744a; font-weight: 600; }
.runner-wait.is-warning { border-color: var(--orange); background: #fff4e8; color: #8a3a0c; }
.runner-wait.is-error { border-color: var(--red); background: #fdecef; color: var(--red); }
.runner-log { list-style: none; margin: 0; padding: 0; display: grid; max-height: 46vh; overflow: auto; border: 1px solid var(--line); font-size: 12px; }
.runner-log__item { display: grid; grid-template-columns: 150px auto 1fr auto; gap: 8px; align-items: baseline; padding: 6px 10px; border-top: 1px solid var(--line); }
.runner-log__item:first-child { border-top: 0; }
.runner-log__item time { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.runner-log__item small { color: var(--muted); }
.runner-log__item.is-error { background: #fdf3f5; }
.runner-log__item.is-warning { background: #fff9f0; }
.runner-log__item details { grid-column: 1 / -1; }
.runner-log__item pre { margin: 6px 0 0; white-space: pre-wrap; font: 11px/1.45 var(--mono); }
.runner-log-head { display: flex; align-items: center; gap: 10px; }
.runner-facts { font-size: 13px; }
.runner-agents { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.runner-agents small { display: block; color: var(--muted); font-size: 11px; }
.runner-help p, .runner-help li { font-size: 13px; line-height: 1.6; }
@media (max-width: 640px) { .runner-log__item { grid-template-columns: 1fr; } }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.data-table td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.data-table td small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.data-table td small.is-warning { color: var(--orange); }
.admin-runners { display: grid; gap: 14px; }
.admin-runners h3 { margin: 8px 0 0; font-size: 15px; }
.admin-runner-errors { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); background: #fff; }
.admin-runner-errors li { padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.admin-runner-errors li:first-child { border-top: 0; }
.admin-runner-errors time { color: var(--muted); font: 11px var(--mono); margin-right: 8px; }
.admin-runner-errors p { margin: 4px 0 0; color: var(--red); white-space: pre-wrap; }

/* ---- Review 2026-10-28: agent chat — steady scroll, fixed send button, pending messages, tiers ---- */
.agent-chat-composer { overflow: visible; max-height: none; }
.agent-composer-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.agent-chat-composer .agent-composer-box textarea { resize: none; min-height: 56px; max-height: 32vh; overflow-y: auto; }
.agent-send { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.agent-send.is-busy { opacity: .7; cursor: progress; }
.agent-composer-status { margin: 6px 0 0; min-height: 0; font-size: 12px; color: var(--muted); }
.agent-composer-status:empty { display: none; }
.agent-composer-status.is-error { color: var(--red); font-weight: 600; }
.agent-composer-status.is-ok { color: #13744a; }
.agent-composer-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compute-tiers { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line-dark); background: #fff; color: var(--muted); padding-left: 8px; }
.compute-tiers button { border: 0; border-left: 1px solid var(--line); background: transparent; padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink-2); }
.compute-tiers button:first-of-type { margin-left: 6px; }
.compute-tiers button.is-active { background: var(--navy); color: #fff; }
.compute-tiers button:disabled { opacity: .45; cursor: not-allowed; }
.agent-message.is-pending { border-style: dashed; opacity: .85; }
.agent-message__pending { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #8a3a0c; background: #fff4e8; padding: 2px 8px; }
.agent-message header .agent-message__pending + .icon-button { margin-left: 0; }
.agent-pending-banner { display: flex; align-items: center; gap: 10px; max-width: 860px; margin: 12px auto; padding: 10px 14px; background: #fff4e8; border-left: 3px solid var(--orange); font-size: 13px; }
.agent-pending-banner .button { margin-left: auto; }
.agent-artifacts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; }
.agent-artifacts > b { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.agent-artifacts a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.agent-artifacts a small { color: var(--muted); }
.agent-error-help { max-width: 860px; margin: 12px auto 0; padding: 12px 14px; background: #fff; border: 1px solid #f1c9d3; border-left: 3px solid var(--red); font-size: 13px; line-height: 1.55; color: var(--ink); }
.agent-error-help > b { display: flex; align-items: center; gap: 6px; }
.agent-error-help ol { margin: 6px 0; padding-left: 20px; }
.agent-error-help p { margin: 6px 0 0; }
.agent-runner-log { margin: 6px 0 0; padding-left: 18px; font: 12px/1.5 var(--mono); }
.agent-runner-log .is-error { color: var(--red); }
.agent-runner-log .is-warning { color: #8a3a0c; }
.team-chat-hint { font-size: 12px; padding-bottom: 8px; }
.team-chat-hint summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #3d5880; }
.team-chat-hint .button { margin-top: 6px; }
.team-brief { margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.team-brief p { margin: 0 0 6px; }
.team-brief dl, .team-chat-hint dl { display: grid; gap: 4px; margin: 6px 0; }
.team-brief dl div, .team-chat-hint dl div { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.team-brief dt, .team-chat-hint dt { color: var(--muted); }
.team-brief dd, .team-chat-hint dd { margin: 0; }
.team-first-task { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.team-first-task h3 { margin: 0; font-size: 14px; }
.team-first-task p { margin: 0; }
.agent-trace__item--inbox span { color: var(--blue); }
.agent-trace__item--skipped span { color: var(--orange); }
@media (max-width: 650px) { .agent-composer-box { grid-template-columns: 1fr auto; } .agent-send span { display: none; } }
.agent-chat-composer > details[open] { max-height: 28vh; overflow-y: auto; }
.executor-option__plan { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; }
.executor-option__plan small { color: var(--muted); }

/* ---- Review 2026-10-28: project journal (history and artifacts) ---- */
.journal { display: grid; gap: 12px; padding: 18px clamp(16px, 2.4vw, 30px); max-width: 1100px; }
.journal-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.journal-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; font-size: 13px; }
.journal-tabs a.is-active { border-color: var(--navy); color: var(--navy); font-weight: 600; }
.journal-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.journal-filters select, .journal-filters input { height: 32px; border: 1px solid var(--line-dark); background: #fff; font: inherit; font-size: 13px; padding: 0 8px; }
.journal-filters__search { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-dark); background: #fff; padding-left: 8px; color: var(--muted); }
.journal-filters__search input { border: 0; min-width: 200px; }
.journal-count { margin: 0; font-size: 12px; color: var(--muted); }
.journal-timeline { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); background: #fff; }
.journal-day { padding: 6px 12px; background: var(--surface-2); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-top: 1px solid var(--line); }
.journal-day:first-child { border-top: 0; }
.journal-event { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 9px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.journal-event p { margin: 0; line-height: 1.5; }
.journal-event small { display: block; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.journal-event time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.journal-event__icon { width: 26px; height: 26px; display: grid; place-items: center; background: var(--blue-pale); color: var(--blue); }
.artifact-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.artifact-upload { cursor: pointer; }
.artifact-quota { height: 6px; background: var(--surface-3); }
.artifact-quota span { display: block; height: 100%; background: var(--blue); }
.artifact-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--line); background: #fff; }
.artifact-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border-top: 1px solid var(--line); }
.artifact-list li:first-child { border-top: 0; }
.artifact-list li.is-pinned { background: #f6f9ff; }
.artifact-list a { color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.artifact-list small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.artifact-list p { margin: 4px 0 0; font-size: 13px; }
.artifact-list__icon { width: 28px; height: 28px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.artifact-list__actions { display: inline-flex; gap: 2px; }
.artifact-list__actions .is-active { color: var(--blue); }
@media (max-width: 640px) { .journal-event { grid-template-columns: 24px 1fr; } .journal-event time { grid-column: 2; } .journal-filters__search input { min-width: 0; } }

/* ---- Review 2026-10-28: who sees a section or a module ---- */
.visibility-fields { display: grid; gap: 6px; border: 1px solid var(--line); padding: 10px 12px; }
.visibility-fields legend { font-size: 12px; font-weight: 600; padding: 0 4px; }
.visibility-fields small { color: var(--muted); font-size: 11px; }
.visibility-fields details summary { cursor: pointer; font-size: 13px; color: var(--blue); }
.visibility-people { display: grid; gap: 4px; max-height: 200px; overflow: auto; padding: 6px 0; }
.visibility-people small { color: var(--muted); }
.section-row__access { font-size: 12px; white-space: nowrap; }
.section-row__access.is-restricted { color: var(--orange); }

/* ---- Review 2026-10-28: polls in chats ---- */
.chat-message--poll > div { min-width: min(420px, 100%); }
.poll-card { display: grid; gap: 8px; margin-top: 6px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; color: var(--ink); max-width: 560px; }
.poll-card.is-closed { background: var(--surface-2); }
.poll-card header { display: flex; align-items: center; gap: 8px; }
.poll-card header b { font-size: 14px; line-height: 1.4; }
.poll-card header .status { margin-left: auto; }
.poll-meta { color: var(--muted); font-size: 11px; }
.poll-body { display: grid; gap: 6px; }
.poll-option { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; }
.poll-option.is-chosen { border-color: var(--blue); background: var(--blue-pale); }
.poll-option__result { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.poll-option__voters { grid-column: 2; color: var(--muted); font-size: 11px; }
.poll-option--other { grid-template-columns: auto 1fr; }
.poll-option--other input { border: 1px solid var(--line-dark); padding: 4px 6px; font: inherit; font-size: 13px; }
.poll-bar { flex: 1; height: 6px; background: var(--surface-3); }
.poll-bar span { display: block; height: 100%; background: var(--blue); }
.poll-option__result em, .poll-scale-results em { font-style: normal; font-size: 11px; color: var(--muted); white-space: nowrap; }
.poll-scale { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.poll-scale label { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-dark); cursor: pointer; }
.poll-scale label input { position: absolute; opacity: 0; pointer-events: none; }
.poll-scale label.is-chosen, .poll-scale label:has(input:checked) { background: var(--navy); color: #fff; border-color: var(--navy); }
.poll-scale small { color: var(--muted); font-size: 11px; }
.poll-scale-results { display: grid; gap: 4px; font-size: 12px; }
.poll-scale-results div { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; }
.poll-scale-results small { grid-column: 2 / -1; color: var(--muted); }
.poll-card textarea { width: 100%; border: 1px solid var(--line-dark); padding: 8px; font: inherit; font-size: 13px; }
.poll-answers, .poll-others { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; }
.poll-answers small, .poll-others small { color: var(--muted); }
.poll-hint, .poll-my-text { margin: 0; font-size: 12px; color: var(--muted); }
.poll-card footer { display: flex; gap: 6px; flex-wrap: wrap; }
.poll-error { margin: 0; color: var(--red); font-size: 12px; }
.poll-create .poll-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; border: 0; padding: 0; }
.poll-create .poll-kinds legend { font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.poll-kind { display: flex; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); cursor: pointer; }
.poll-kind:has(input:checked) { border-color: var(--navy); background: var(--blue-pale); }
.poll-kind small { display: block; color: var(--muted); font-size: 11px; }
.poll-option-list { margin: 6px 0; padding-left: 20px; display: grid; gap: 6px; }
.poll-option-list li { display: flex; gap: 6px; align-items: center; }
.poll-option-list input { flex: 1; height: 32px; border: 1px solid var(--line-dark); padding: 0 8px; font: inherit; }
.poll-scale-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.poll-settings summary { cursor: pointer; color: var(--blue); font-size: 13px; }
.poll-settings { display: grid; gap: 6px; }
.field-label { font-size: 12px; font-weight: 600; }

/* ---- Review 2026-10-28: organisation sign-in ---- */
.auth-sso { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-methods { display: flex; border: 1px solid var(--line-dark); margin-bottom: 14px; }
.auth-methods button { flex: 1; padding: 9px 10px; border: 0; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.auth-methods button.is-active { background: var(--navy); color: #fff; }
.auth-error { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; background: #fdecef; color: var(--red); font-size: 13px; margin: 0 0 14px; }

/* ---- Review 2026-10-28: administration of SSO and compute tiers ---- */
.sso-admin, .tiers-admin { max-width: 980px; }
.sso-admin .settings-card header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sso-admin .settings-card h2 { display: inline-flex; align-items: center; gap: 8px; }
.sso-radio { border: 0; padding: 0; display: grid; gap: 8px; }
.sso-radio small, .sso-admin .check-row small { display: block; color: var(--muted); font-size: 11px; }
.sso-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.sso-groups textarea { min-height: 54px; }
.sso-test { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.sso-test input { height: 32px; border: 1px solid var(--line-dark); padding: 0 8px; font: inherit; }
.sso-test .is-ok { color: #13744a; } .sso-test .is-error { color: var(--red); }
.sso-redirect { font-size: 13px; margin: 0; }
.sso-redirect code { word-break: break-all; }
.form-row--three { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tier-row { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); background: #fff; margin-bottom: 10px; }
.tier-row header { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tier-row header input[name=label] { font-weight: 600; height: 32px; border: 1px solid var(--line-dark); padding: 0 8px; font-size: 14px; }
.tier-row header .icon-button { margin-left: auto; }
.tiers-admin__footer { display: flex; gap: 8px; align-items: center; }
.tiers-admin__footer [data-save-tiers] { margin-left: auto; }
.agent-demo-banner { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px; background: #fff4e8; border-bottom: 1px solid #f3d6b4; color: #8a3a0c; font-size: 13px; line-height: 1.5; }
.harness-note { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-2); background: var(--blue-pale); padding: 8px 10px; }
.harness-fieldset .check-row small { display: block; color: var(--muted); font-size: 11px; }
.installer-alt { margin-top: 6px; }
.chat-message--mine .poll-card { text-align: left; margin-left: auto; }

/* Merge 2026-10-29: how a user signs in, next to the e-mail in «Пользователи». */
.admin-user-table small.admin-user-signin { color: var(--blue); }
.field-help--note { padding: 8px 10px; border-left: 3px solid var(--blue); background: var(--surface-2); }

/* ==========================================================================
   Chats 2026-11: composer, reactions, ticks, files, viewer, rooms, polls
   ========================================================================== */
.msg-composer { min-width: 0; padding: 9px 12px 7px; display: grid; gap: 6px; border-top: 1px solid var(--line); background: #fff; }
.msg-composer__row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.msg-composer textarea { width: 100%; min-height: 42px; max-height: 180px; padding: 10px 12px; resize: none; overflow-y: auto; border: 1px solid var(--line-dark); border-radius: 8px; outline: 0; font: inherit; font-size: 13px; line-height: 1.45; }
.msg-composer textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(37 75 155 / .1); }
.msg-composer__actions { display: flex; align-items: center; gap: 4px; padding-bottom: 1px; }
.msg-composer__hint { overflow: hidden; color: var(--muted-2, var(--muted)); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.msg-composer .composer-selected-files { grid-column: auto; }
.composer-too-big { flex-basis: 100%; color: var(--red); font-size: 11px; font-style: normal; }
[data-chat-context-root].is-dropping .msg-composer { outline: 2px dashed var(--blue); outline-offset: -4px; background: var(--blue-pale); }
@media (pointer: coarse) { .msg-composer__hint { display: none; } }

.chat-message { position: relative; }
.chat-message .chat-bubble > header time { color: var(--muted); font-size: 11px; }
.chat-message p a { color: var(--blue); text-decoration: underline; overflow-wrap: anywhere; }
.chat-message__meta { min-height: 0; margin-top: 4px; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.chat-message__meta:has(.chat-reactions:empty):not(:has([data-ticks])) { display: none; }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
.chat-reactions:empty { display: none; }
.chat-reaction { min-height: 24px; padding: 0 7px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 13px; line-height: 1; }
.chat-reaction b { color: var(--ink-2); font-size: 11px; }
.chat-reaction.is-mine { border-color: var(--blue); background: var(--blue-pale); }
.chat-reaction:hover { border-color: var(--blue); }
.chat-react-button { position: absolute; top: 6px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-sm); }
.chat-message:not(.chat-message--mine) .chat-react-button { right: -34px; }
.chat-message--mine .chat-react-button { left: -34px; }
.chat-message:hover .chat-react-button, .chat-react-button:focus-visible { opacity: 1; }
.chat-react-button:hover { color: var(--blue); }
@media (hover: none) {
  .chat-react-button { top: -13px; opacity: 0; pointer-events: none; }
  .chat-message:not(.chat-message--mine) .chat-react-button, .chat-message--mine .chat-react-button { left: auto; right: 10px; }
  .chat-message.is-actions .chat-react-button { opacity: 1; pointer-events: auto; }
  .chat-message.is-actions > .chat-bubble { box-shadow: 0 0 0 2px var(--blue-soft); }
}
.chat-reaction-picker { position: fixed; z-index: 80; padding: 5px; display: grid; grid-template-columns: repeat(6, 34px); gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-md); }
.chat-reaction-picker button { width: 34px; height: 34px; border-radius: 8px; font-size: 19px; line-height: 1; }
.chat-reaction-picker button:hover, .chat-reaction-picker button:focus-visible { background: var(--blue-pale); outline: 0; }
.chat-ticks { display: inline-flex; align-items: center; gap: 1px; color: var(--muted); }
.chat-ticks.is-read { color: var(--blue); }
.chat-ticks small { font-size: 10px; font-weight: 700; }
.chat-message.is-pending > .chat-bubble { opacity: .7; }
.chat-message.is-failed > .chat-bubble { border-color: #f1b6c2; }
.chat-failed { margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--red); font-size: 11px; }
.chat-failed button { padding: 2px 6px; border: 1px solid currentColor; border-radius: 4px; font-size: 11px; }
.chat-message.is-highlighted > .chat-bubble { animation: chatHighlight 2.4s ease; }
@keyframes chatHighlight { 0%, 40% { box-shadow: 0 0 0 3px rgb(242 166 38 / .55); } 100% { box-shadow: none; } }
.chat-upload { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.chat-upload span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.chat-upload__label { display: flex; align-items: center; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 11px; }
.chat-upload__label button { color: var(--blue); font-size: 11px; text-decoration: underline; }
.chat-gallery { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chat-image { max-width: min(100%, 300px); overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.chat-image img { display: block; max-width: 100%; max-height: 240px; object-fit: contain; }
.chat-image[aria-expanded="true"], .chat-attachment[aria-expanded="true"] { outline: 2px solid var(--blue); outline-offset: 1px; }
.chat-load-earlier { justify-self: center; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--blue); font-size: 11px; font-weight: 700; }
.chat-unread-divider { display: flex; align-items: center; gap: 10px; color: var(--red); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chat-unread-divider::before, .chat-unread-divider::after { content: ""; height: 1px; flex: 1; background: #f1b6c2; }
.chat-new-pill { position: absolute; z-index: 5; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; box-shadow: var(--shadow-md); }
.chat-mute.is-muted { color: var(--orange) !important; }
.dm-unread { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--blue); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; }
.dm-unread.is-muted { background: var(--surface-3) !important; color: var(--muted) !important; }
.dm-thread-list > a.has-unread b { color: var(--navy); }
.dm-muted-mark { margin-left: 4px; display: inline-flex; vertical-align: -1px; color: var(--muted); font-style: normal; }
.dm-thread-list > a.is-muted b { color: var(--muted); }
.dm-conversation__head p { margin: 0; color: var(--muted); font-size: 11px; }

/* Rooms of a project chat */
.project-chat-layout.unified-chat.chat-with-rooms { position: relative; grid-template-columns: var(--chat-rooms-width, 228px) minmax(0, 1fr); }
.chat-with-rooms.is-context-open { grid-template-columns: var(--chat-rooms-width, 228px) minmax(0, 1fr) var(--context-panel-width, 250px) !important; }
.chat-with-rooms.is-file-open { grid-template-columns: var(--chat-rooms-width, 228px) minmax(0, 1fr) var(--file-panel-width, clamp(340px, 40%, 640px)) !important; }
.project-chat-layout .project-chat-messages { max-height: none; }
.chat-rooms { position: relative; }
.chat-with-rooms .project-chat-main { border-left: 0; }
.chat-rooms { min-width: 0; min-height: 0; display: grid; grid-template-rows: 51px minmax(0, 1fr); border: 1px solid var(--line); background: #fbfcfe; }
.chat-rooms > header { padding: 0 8px 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.chat-rooms h3 { color: var(--navy); font-size: 13px; }
.chat-rooms nav { min-height: 0; padding: 6px; overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.chat-room-link { min-width: 0; min-height: 46px; padding: 6px 8px; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; border-left: 3px solid transparent; border-radius: 6px; color: var(--ink-2); }
.chat-room-link:hover { background: var(--surface-2); }
.chat-room-link.is-active { border-left-color: var(--blue); background: var(--blue-pale); }
.chat-room-link__icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-weight: 800; }
.chat-room-link > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.chat-room-link b, .chat-room-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room-link b { font-size: 12px; }
.chat-room-link small { color: var(--muted); font-size: 10.5px; }
.chat-room-link.has-unread b { color: var(--navy); }
.chat-room-link.is-muted b { color: var(--muted); }
.project-chat-main > header .dm-conversation__actions .icon-button { width: 31px; height: 31px; }
.project-chat-sub { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.project-chat-main > header h2 + .project-chat-sub, .project-chat-main > header .chat-title-line + .project-chat-sub { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* File viewer in the right panel */
.dm-inbox.is-file-open { grid-template-columns: var(--chat-rail-width, 296px) minmax(0, 1fr) var(--file-panel-width, clamp(340px, 40%, 640px)); }
.project-chat-layout.unified-chat.is-file-open:not(.chat-with-rooms) { grid-template-columns: minmax(0, 1fr) var(--file-panel-width, clamp(340px, 40%, 640px)); }
.chat-viewer > header { gap: 6px; }
.chat-viewer > header h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-viewer__actions { display: flex; align-items: center; gap: 2px; }
.chat-viewer__actions .icon-button { width: 30px; height: 30px; color: var(--muted); }
.chat-viewer__actions .icon-button:hover { color: var(--blue); background: var(--blue-pale); }
.chat-viewer__preview { min-height: 0; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.chat-viewer__preview:empty { display: none; }
.chat-viewer__loading { padding: 30px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.chat-viewer__frame { display: block; width: 100%; height: min(72vh, 760px); border: 0; background: #fff; }
.chat-viewer__image { display: grid; place-items: center; padding: 8px; background: repeating-conic-gradient(#f1f3f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.chat-viewer__image img { max-width: 100%; max-height: 64vh; object-fit: contain; }
.chat-viewer__text { max-height: 64vh; margin: 0; padding: 10px 12px; overflow: auto; background: #fff; color: var(--ink); font-family: var(--mono); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-viewer__table { max-height: 64vh; overflow: auto; background: #fff; }
.chat-viewer__table table { border-collapse: collapse; font-size: 11.5px; }
.chat-viewer__table th, .chat-viewer__table td { padding: 4px 8px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.chat-viewer__table th { position: sticky; top: 0; background: var(--surface-2); }
.chat-viewer__media { display: block; width: 100%; max-height: 60vh; background: #000; }
audio.chat-viewer__media { background: transparent; padding: 10px; }
.chat-viewer__none { padding: 28px 14px; display: grid; justify-items: center; gap: 6px; color: var(--muted); font-size: 12px; text-align: center; }
.chat-viewer__none b { color: var(--ink-2); }
.chat-viewer__note { margin: 0; padding: 6px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.researcher-dm-layout.is-file-open { grid-template-columns: minmax(0, 1fr) var(--file-panel-width, clamp(320px, 40%, 600px)); }

/* Unread counters in the left menu */
.nav-unread { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--red); color: #fff; font-style: normal; font-size: 11px; font-weight: 800; line-height: 1; }
.workspace-nav-item > i.nav-unread { background: var(--red); padding: 0 6px; }
.project-nav-item { position: relative; }
.project-nav-item > i.nav-unread { margin-left: 4px; }
.project-tabs a > i.nav-unread { min-width: 17px; height: 17px; margin-left: 5px; padding: 0 5px; font-size: 10px; }

/* A new message note */
.toast--message { cursor: default; border-left-color: var(--navy); }
.toast--message > svg { color: var(--navy); }
.toast--message > a { min-width: 0; display: grid; gap: 2px; color: inherit; }
.toast--message > a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--navy); font-size: 12px; }
.toast--message > a span { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink-2); font-size: 12px; }

/* Poll creation */
.poll-create { display: grid; gap: 16px; }
.poll-create .field-label { display: block; margin-bottom: 6px; color: var(--ink-2); }
.poll-create__question textarea { width: 100%; min-height: 64px; padding: 10px 12px; resize: none; border: 1px solid var(--line-dark); border-radius: 8px; font: inherit; font-size: 15px; line-height: 1.4; }
.poll-create__question textarea:focus, .poll-option-list input:focus { border-color: var(--blue); outline: 0; box-shadow: 0 0 0 3px rgb(37 75 155 / .1); }
.poll-create__kinds { margin: 0; padding: 0; border: 0; }
.poll-segment { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; overflow: hidden; border: 1px solid var(--line-dark); border-radius: 8px; }
.poll-segment__item { position: relative; cursor: pointer; }
.poll-segment__item + .poll-segment__item { border-left: 1px solid var(--line-dark); }
.poll-segment__item input { position: absolute; opacity: 0; pointer-events: none; }
.poll-segment__item span { min-height: 40px; padding: 0 8px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 650; text-align: center; }
.poll-segment__item:hover span { background: var(--surface-2); }
.poll-segment__item input:checked + span { background: var(--navy); color: #fff; }
.poll-segment__item input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--blue); }
.poll-create__hint { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.poll-create__options-head { display: flex; align-items: baseline; justify-content: space-between; }
.poll-create__options-head small { color: var(--muted); font-size: 11px; }
.poll-create .poll-option-list { margin: 0 0 6px; padding: 0; list-style: none; counter-reset: option; display: grid; gap: 6px; }
.poll-create .poll-option-list li { counter-increment: option; display: grid; grid-template-columns: 24px minmax(0, 1fr) 38px; align-items: center; gap: 6px; }
.poll-create .poll-option-list li::before { content: counter(option); width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 800; }
.poll-create .poll-option-list input { height: 38px; padding: 0 10px; border: 1px solid var(--line-dark); border-radius: 7px; font: inherit; font-size: 14px; }
.poll-option-remove { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
.poll-option-remove:hover:not(:disabled) { color: var(--red); border-color: #f1b6c2; background: #fff1f4; }
.poll-option-remove:disabled { opacity: .35; }
.poll-add-option { margin-left: 30px; padding: 6px 4px; display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: 13px; font-weight: 700; }
.poll-add-option:disabled { color: var(--muted); }
.poll-create__max { margin: 8px 0 0 30px; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 13px; }
.poll-create__max input { width: 90px; height: 34px; padding: 0 8px; border: 1px solid var(--line-dark); border-radius: 7px; font: inherit; }
.poll-scale-preview { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.poll-scale-preview span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line-dark); border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.poll-scale-preview small { color: var(--muted); font-size: 11px; }
.poll-create__settings { padding-top: 12px; border-top: 1px solid var(--line); }
.poll-switches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.poll-switches > [hidden] { display: none; }
.poll-switch { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: start; gap: 9px; cursor: pointer; }
.poll-switch input { position: absolute; opacity: 0; pointer-events: none; }
.poll-switch__track { position: relative; width: 36px; height: 20px; margin-top: 1px; border-radius: 99px; background: var(--line-dark); transition: background .15s; }
.poll-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .15s; }
.poll-switch input:checked + .poll-switch__track { background: var(--blue); }
.poll-switch input:checked + .poll-switch__track::after { transform: translateX(16px); }
.poll-switch input:focus-visible + .poll-switch__track { box-shadow: 0 0 0 3px rgb(37 75 155 / .25); }
.poll-switch input:disabled ~ * { opacity: .5; cursor: not-allowed; }
.poll-switch b { display: block; color: var(--ink-2); font-size: 13px; }
.poll-switch small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.poll-create__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.poll-create .modal__actions .button--primary { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 640px) {
  .poll-segment { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .poll-segment__item:nth-child(3) { border-left: 0; }
  .poll-segment__item:nth-child(n + 3) { border-top: 1px solid var(--line-dark); }
  .poll-switches, .poll-create__row { grid-template-columns: minmax(0, 1fr); }
}

/* Room settings */
.room-form__access, .room-form__people { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.radio-card { padding: 9px 11px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 9px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--blue); background: var(--blue-pale); }
.radio-card b { display: block; color: var(--ink-2); font-size: 13px; }
.radio-card small { color: var(--muted); font-size: 12px; }
.room-form__list { max-height: 260px; overflow-y: auto; display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.room-form__person { padding: 5px 6px; border-radius: 6px; }
.room-form__person:hover { background: var(--surface-2); }
.room-form__person span { display: grid; }
.room-form__delete { margin-right: auto; color: var(--red); }

/* Account and admin settings */
.account-notifications { margin-top: 16px; padding: 16px; display: grid; gap: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.account-notifications > header { display: grid; gap: 3px; }
.account-notifications > header small { color: var(--muted); font-size: 12px; }
.account-notifications [data-notification-settings] { display: grid; gap: 12px; justify-items: start; }
.account-notifications [data-pref-sound-test] { margin: -4px 0 0 45px; }
.digest-card__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.digest-card__scopes { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; }
.digest-card footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }

@media (max-width: 960px) {
  .project-chat-layout.unified-chat.chat-with-rooms { grid-template-columns: 190px minmax(0, 1fr); }
  .chat-with-rooms.is-context-open, .chat-with-rooms.is-file-open { grid-template-columns: 190px minmax(0, 1fr) !important; }
  .dm-inbox.is-file-open { grid-template-columns: var(--chat-rail-width, 296px) minmax(0, 1fr); }
  .chat-file-panel.chat-viewer { position: absolute; z-index: 20; top: 0; right: 0; bottom: 0; width: min(480px, 92vw); box-shadow: -12px 0 28px rgb(13 36 81 / .14); }
  .dm-inbox, .project-chat-layout.unified-chat { position: relative; }
}
@media (max-width: 760px) {
  .project-chat-layout.unified-chat.chat-with-rooms, .chat-with-rooms.is-context-open, .chat-with-rooms.is-file-open { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: auto minmax(0, 1fr); }
  .chat-rooms { grid-template-rows: auto; grid-template-columns: auto minmax(0, 1fr); border-bottom: 0; }
  .chat-rooms > header { min-height: 44px; padding: 0 4px 0 10px; border-bottom: 0; border-right: 1px solid var(--line); gap: 4px; }
  .chat-rooms nav { padding: 5px; display: flex; gap: 4px; overflow-x: auto; overflow-y: hidden; }
  .chat-room-link { min-height: 34px; padding: 4px 9px; flex: 0 0 auto; grid-template-columns: auto auto auto; border-left: 0; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
  .chat-room-link small { display: none; }
  .chat-room-link.is-active { border-color: var(--blue); }
  .chat-room-link__icon { width: 18px; height: 18px; }
  .chat-with-rooms .project-chat-main { border-left: 1px solid var(--line); }
  .chat-file-panel.chat-viewer { width: 100vw; max-width: 100%; }
  .chat-new-pill { bottom: 84px; }
  .digest-card__row { grid-template-columns: minmax(0, 1fr); }
}
.chat-viewer__pdf-host { background: #e9edf3; }
.chat-viewer__pdf { max-height: 72vh; padding: 8px; overflow-y: auto; display: grid; gap: 8px; }
.chat-viewer__page { width: 100%; display: grid; place-items: center; background: #fff; box-shadow: 0 1px 3px rgb(13 36 81 / .18); color: var(--muted); font-size: 12px; }
.chat-viewer__page canvas { display: block; }
/* The digest card sits under the main settings; the side panel stays on the right. */
@media (min-width: 961px) {
  .admin-settings-grid > .digest-card { grid-column: 1; }
  .admin-settings-grid > .admin-settings-side { grid-column: 2; grid-row: 1 / span 2; }
}
.digest-card header p { margin-top: 6px; max-width: 70ch; }
.admin-settings-side .setting-status { display: grid; justify-items: start; gap: 6px; }
.admin-settings-side .setting-status small { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; line-height: 1.45; }

/* ==========================================================================
   «Агенты»: the tabs are the top bar; intro, filters, buttons and search sit under them
   ========================================================================== */
.library-bar { padding: 14px clamp(18px, 3vw, 34px) 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 24px; }
.library-bar__intro { flex: 1 1 460px; max-width: 900px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.library-bar__tools { min-width: 0; margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.library-bar__tools--row { flex: 1 1 100%; margin-left: 0; }
.library-bar__tools .scope-filter { margin: 0; }
.library-bar__actions { min-width: 0; margin-left: auto; flex: 1 1 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.library-bar__actions .context-search { width: min(360px, 100%); min-width: 220px; flex: 0 1 360px; }
.library-bar + .library-screen, .library-bar + .teams-screen, .library-bar + section { padding-top: 14px; }
.library-intro { display: none; }
@media (max-width: 760px) {
  .library-bar__tools { flex-direction: column; align-items: stretch; }
  .library-bar__actions { margin-left: 0; justify-content: flex-start; }
  .library-bar__actions .button { flex: 1 1 auto; }
  .library-bar__actions .context-search { flex: 1 1 100%; width: 100%; min-width: 0; order: -1; }
}

/* Agent runs: «Продолжить с сохранёнными файлами» / «Заново», a stuck run, a continued run's origin (2026-11). */
.action-run__lineage { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; white-space: nowrap; }
.action-run__resume { margin: 10px 12px 0; padding: 11px 12px; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 16px; border: 1px solid var(--blue-soft); background: #f4f7fd; }
.action-run__resume-text { flex: 1 1 280px; min-width: 0; display: grid; gap: 4px; }
.action-run__resume-text > b { color: var(--navy); font-size: 13px; }
.action-run__resume-text > small { color: var(--ink-2); font-size: 12px; line-height: 1.45; }
.action-run__resume-actions { flex: 0 1 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.action-run__saved { margin-top: 2px; font-size: 12px; }
.action-run__saved summary { width: max-content; max-width: 100%; color: var(--blue); cursor: pointer; }
.action-run__saved ul { margin: 6px 0; padding: 0; list-style: none; display: grid; gap: 3px; max-height: 160px; overflow: auto; }
.action-run__saved li code { font-size: 11.5px; overflow-wrap: anywhere; }
.action-run__saved p { margin: 0 0 6px; color: var(--muted); }
.action-run__saved a { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-weight: 700; }
.action-run__again { margin: 10px 12px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; color: var(--muted); font-size: 12px; }
.action-run__again > span { margin-right: 4px; }
.action-run__stalled { margin: 8px 12px 0; padding: 9px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; background: #fff7e0; border: 1px solid #f3d68a; color: #6b4a00; font-size: 12.5px; line-height: 1.45; }
.action-run__stalled > .icon { flex: 0 0 auto; color: #b07800; }
.action-run__stalled > span { flex: 1 1 240px; min-width: 0; }
@media (max-width: 760px) {
  .action-run__resume-actions, .action-run__resume-actions .button { flex: 1 1 100%; }
  .action-run__resume-actions .button { justify-content: center; }
}

/* External calendars: which events are shown (rules + live preview), 2026-11. */
.calendar-source__filters { justify-self: start; max-width: 100%; min-width: 0; padding: 0; display: inline-flex; align-items: flex-start; gap: 5px; border: 0; background: none; color: var(--blue); font-size: 12px; line-height: 1.4; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.calendar-source__filters .icon { margin-top: 2px; }
.calendar-source__filters:hover { text-decoration: underline; }
.calendar-source__filters .icon { flex: 0 0 auto; }
.calendar-filters { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 18px 22px; align-items: start; }
.calendar-filters > .modal__actions { grid-column: 1 / -1; }
.calendar-filters__rules { display: grid; gap: 12px; min-width: 0; }
.calendar-filters__mode { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }
.calendar-filters__mode .radio-card small { display: block; color: var(--muted); font-size: 12px; }
.calendar-filters textarea { min-height: 72px; resize: vertical; }
.calendar-filters__checks { display: grid; gap: 6px; font-size: 13px; }
.calendar-filters__marks { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
.calendar-filters__marks:empty { display: none; }
.calendar-filters__marks .link-button { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; }
.calendar-filters__preview { min-width: 0; display: grid; gap: 8px; border: 1px solid var(--line); padding: 10px; background: #fbfcfe; }
.calendar-filters__preview > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.calendar-filters__preview > header b { color: var(--navy); font-size: 13px; }
.calendar-filters__preview .segmented button[aria-selected="true"] { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); font-weight: 700; }
.calendar-filters__search { width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; }
.calendar-filters__list { margin: 0; padding: 0; list-style: none; display: grid; align-content: start; max-height: min(52vh, 460px); overflow: auto; background: #fff; border: 1px solid var(--line); }
.calendar-filters__list li { padding: 6px 8px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; border-bottom: 1px solid var(--line); }
.calendar-filters__list li:last-child { border-bottom: 0; }
.calendar-filters__list li.is-hidden .calendar-filters__event { opacity: .55; }
.calendar-filters__list li.is-hidden .calendar-filters__event b { text-decoration: line-through; text-decoration-color: rgba(0,0,0,.35); }
.calendar-filters__toggle { width: 30px; height: 30px; }
.calendar-filters__list li.is-hidden .calendar-filters__toggle { color: var(--muted); }
.calendar-filters__event { min-width: 0; display: grid; gap: 1px; }
.calendar-filters__event b { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.calendar-filters__event small { color: var(--muted); font-size: 11.5px; }
.calendar-filters__reason { max-width: 180px; padding: 2px 7px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-filters__reason.is-mark { background: var(--blue-pale); color: var(--blue); }
.calendar-filters__empty, .calendar-filters__more { display: block !important; color: var(--muted); font-size: 12.5px; text-align: center; padding: 14px 8px !important; }
.event-details__visibility { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.event-details__visibility > span { flex: 1 1 100%; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .calendar-filters { grid-template-columns: minmax(0, 1fr); }
  .calendar-filters__list { max-height: 50vh; }
  .calendar-filters__list li { grid-template-columns: auto minmax(0, 1fr); }
  .calendar-filters__reason { grid-column: 2; justify-self: start; max-width: 100%; }
}
.command-advanced > summary .icon, .command-publish > summary .icon { display: inline-block; vertical-align: -2px; margin-right: 4px; }

/* Kanban 2026-11: several assignees, big tasks with subtasks, lanes «По большим задачам». */
.kanban-toolbar__view { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.kanban-group { padding: 2px; border-radius: 0; }
.kanban-group a { padding: 5px 10px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.kanban-group a.is-active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.kanban-epic select { height: 32px; max-width: 260px; padding: 0 28px 0 9px; border: 1px solid var(--line); background-color: #fff; font: inherit; font-size: 12.5px; color: var(--ink-2); }
.kanban-card__parent { margin: -2px 0 6px; max-width: 100%; display: flex; align-items: center; gap: 4px; color: var(--blue); font-size: 11px; font-weight: 600; }
.kanban-card__parent > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kanban-card--parent { box-shadow: 3px 3px 0 -1px #fff, 3px 3px 0 0 var(--line); }
.kanban-card--parent:hover { box-shadow: 3px 3px 0 -1px #fff, 3px 3px 0 0 var(--blue-soft), var(--shadow-sm); }
.kanban-card__subtasks { margin-top: 8px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 11px; font-weight: 600; }
.kanban-card__subtasks .task-progress { margin-left: auto; }
.task-progress { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.task-progress > i { width: 54px; height: 5px; display: block; overflow: hidden; background: #e4e7ec; border-radius: 99px; }
.task-progress > i > b { height: 100%; display: block; background: var(--green); border-radius: 99px; }
.kanban-card__people .avatar-stack { flex: 0 0 auto; }
.avatar-stack__more { width: 26px; height: 26px; margin-left: -9px; display: grid; place-items: center; border: 1px solid #fff; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 10px; font-style: normal; font-weight: 700; }

.kanban-lanes { min-height: 0; padding: 10px; display: grid; align-content: start; gap: 10px; overflow: auto; background: var(--surface-2); }
.kanban-lane { min-width: 0; border: 1px solid var(--line); background: #fff; }
.kanban-lane__head { padding: 9px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; cursor: pointer; list-style: none; }
.kanban-lane__head::-webkit-details-marker { display: none; }
.kanban-lane__head:hover { background: #fbfcfe; }
.kanban-lane__chevron { display: grid; place-items: center; color: var(--muted); transition: transform .12s ease; }
.kanban-lane:not([open]) .kanban-lane__chevron { transform: rotate(-90deg); }
.kanban-lane__title { flex: 1 1 240px; min-width: 0; display: grid; gap: 1px; }
.kanban-lane__title b { color: var(--navy); font-size: 14px; overflow-wrap: anywhere; }
.kanban-lane__title small { color: var(--muted); font-size: 11.5px; }
.kanban-lane__actions { display: flex; gap: 4px; }
.kanban-lane__actions .icon-button { width: 30px; height: 30px; }
.kanban-lane--rest { background: #fbfcfe; }
.kanban-lane__columns { padding: 0 10px 10px; display: grid; grid-template-columns: repeat(5, minmax(174px, 1fr)); gap: 7px; overflow-x: auto; }
.kanban-column--lane { min-height: 0 !important; }
.kanban-column--lane > header { min-height: 32px; }
.kanban-column--lane .kanban-dropzone { min-height: 52px; }
.kanban-lanes__empty { margin: 0; padding: 14px; display: flex; align-items: center; gap: 8px; border: 1px dashed var(--line-dark); background: #fff; color: var(--muted); font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .kanban-lane__chevron { transition: none; } }

.task-form .assignee-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.assignee-picker legend { margin-bottom: 6px; }
.assignee-picker legend small { margin-left: 6px; color: var(--muted); font-weight: 500; }
.assignee-picker > div { display: flex; flex-wrap: wrap; gap: 6px; }
.assignee-chip { position: relative; padding: 3px 11px 3px 3px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--ink-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.assignee-chip input { position: absolute; opacity: 0; pointer-events: none; }
.assignee-chip:hover { border-color: var(--blue-soft); }
.assignee-chip:has(input:checked) { border-color: var(--blue); background: var(--blue-pale); color: var(--navy); font-weight: 700; }
.assignee-chip:has(input:checked)::after { content: "✓"; color: var(--blue); font-weight: 800; }
.assignee-chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.task-parent-link { justify-self: start; max-width: 100%; padding: 0; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; color: var(--blue); font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; }
.task-parent-link:hover { text-decoration: underline; }
.task-subtasks { padding: 10px 12px; display: grid; gap: 8px; border: 1px solid var(--line); background: #fbfcfe; }
.task-subtasks > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.task-subtasks > header b { color: var(--navy); font-size: 13px; }
.task-subtasks > header small { flex: 1 1 100%; color: var(--muted); font-size: 12px; }
.task-subtasks ul { margin: 0; padding: 0; list-style: none; display: grid; }
.task-subtasks li { min-height: 36px; padding: 4px 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.task-subtasks li:last-child { border-bottom: 0; }
.task-subtasks li > button { min-width: 0; padding: 0; border: 0; background: none; color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.task-subtasks li > button:hover { color: var(--blue); text-decoration: underline; }
.task-subtasks li.is-done > button { color: var(--muted); text-decoration: line-through; }
.task-subtasks li > em { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-style: normal; }
.task-subtasks li > small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.task-subtasks__add { display: flex; gap: 8px; }
.task-subtasks__add input { flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; }
.task-delete { padding: 10px 12px; display: grid; gap: 8px; border: 1px solid #f1b8c7; background: #fdf3f5; font-size: 13px; }
.task-delete p { margin: 0; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.task-delete > div { display: flex; flex-wrap: wrap; gap: 8px; }
.task-delete small { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .kanban-toolbar__view { width: 100%; }
  .kanban-epic, .kanban-epic select { flex: 1 1 100%; max-width: none; width: 100%; }
  .kanban-lane__head .task-progress { margin-left: 22px; }
  .task-subtasks li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .task-subtasks li > small, .task-subtasks li > em { display: none; }
  .task-subtasks__add { flex-wrap: wrap; }
  .task-subtasks__add .button { flex: 1 1 100%; justify-content: center; }
}
.kanban-dropzone { grid-template-columns: minmax(0, 1fr); }
.kanban-card__people .avatar-stack .avatar, .kanban-lane__head .avatar-stack .avatar, .task-subtasks .avatar-stack .avatar { box-shadow: 0 0 0 2px #fff; }
.kanban-card__people .avatar-stack .avatar + .avatar, .kanban-lane__head .avatar-stack .avatar + .avatar, .task-subtasks .avatar-stack .avatar + .avatar { margin-left: -5px; }
.chat-title-line { min-width: 0; display: flex; align-items: center; gap: 4px; }
.chat-title-line h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-rename { width: 26px; height: 26px; flex: 0 0 auto; border-color: transparent; color: var(--muted); opacity: .7; }
.chat-title-line:hover .chat-rename, .chat-rename:focus-visible { opacity: 1; }
.chat-rename-form { min-width: 0; display: flex; align-items: center; gap: 4px; }
.chat-rename-form input { width: min(320px, 52vw); height: 30px; padding: 0 8px; border: 1px solid var(--blue); background: #fff; color: var(--navy); font: inherit; font-size: 14px; font-weight: 700; }
.chat-rename-form .icon-button { width: 28px; height: 28px; }

/* Tasks and chats 2026-11: task discussions, «#N» links, «Сделать задачей». */
.chat-rooms__group { margin: 8px 6px 2px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.chat-room-link--task .chat-room-link__icon { background: #fff; border: 1px solid var(--line); }
.chat-room-link--task .task-dot { width: 8px; height: 8px; }
.chat-room-link.is-done b { color: var(--muted); }
.project-symbol--task { color: var(--blue); }
.task-chat-head { min-width: 0; }
.task-chat-head__meta { max-width: none !important; display: flex !important; flex-wrap: wrap; align-items: center; gap: 4px 10px; white-space: normal !important; }
.task-chat-head__meta > span, .task-chat-head__meta > a { display: inline-flex; align-items: center; gap: 4px; }
.task-chat-head__meta a { color: var(--blue); font-weight: 600; }
.task-chat-head__status { padding: 1px 7px; background: var(--surface-2); color: var(--ink-2); font-weight: 700; }
.task-chat-head__status.is-done { background: #e7f6ee; color: #13744a; }
.task-chat-head__meta .avatar-stack .avatar { width: 20px; height: 20px; font-size: 9px; box-shadow: 0 0 0 2px #fff; }
.task-chat-head__meta .avatar-stack .avatar + .avatar { margin-left: -4px; }
.task-chat-head__note { color: var(--muted); }
.chat-readonly { display: flex; align-items: center; gap: 8px; }
.task-ref { max-width: 100%; margin: 0 1px; padding: 0 6px 0 5px; display: inline-flex; align-items: baseline; gap: 4px; vertical-align: baseline; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink-2) !important; font-size: .95em; line-height: 1.45; text-decoration: none !important; }
.task-ref:hover { border-color: var(--blue); color: var(--blue) !important; }
.task-ref > i { width: 7px; height: 7px; flex: 0 0 auto; align-self: center; border-radius: 50%; background: #98a2b3; }
.task-ref.is-ready > i { background: var(--blue); }
.task-ref.is-in_progress > i { background: var(--orange); }
.task-ref.is-review > i { background: var(--violet); }
.task-ref.is-done > i { background: var(--green); }
.task-ref.is-done > span { text-decoration: line-through; text-decoration-color: rgb(0 0 0 / .3); }
.task-ref > b { color: var(--blue); font-weight: 700; }
.task-ref > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-ref > .icon { align-self: center; color: var(--blue); }
.task-ref > em { color: var(--muted); font-style: normal; }
.chat-message--mine .task-ref { background: rgb(255 255 255 / .85); }
.chat-made-tasks { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.chat-made-tasks .task-ref { font-size: 12px; }
.chat-task-button { position: absolute; top: 40px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-sm); }
.chat-message:not(.chat-message--mine) .chat-task-button { right: -34px; }
.chat-message--mine .chat-task-button { left: -34px; }
.chat-message:hover .chat-task-button, .chat-task-button:focus-visible { opacity: 1; }
.chat-task-button:hover { color: var(--blue); }
.chat-edit-button { position: absolute; top: 74px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-sm); }
.chat-message:not(.chat-message--mine) .chat-edit-button { right: -34px; }
.chat-message--mine .chat-edit-button { left: -34px; }
.chat-message:hover .chat-edit-button, .chat-edit-button:focus-visible { opacity: 1; }
.chat-edit-button:hover { color: var(--blue); }
.chat-history-button { position: absolute; top: 108px; width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--muted); opacity: 0; transition: opacity .12s; box-shadow: var(--shadow-sm); }
.chat-message:not(.chat-message--mine) .chat-history-button { right: -34px; }
.chat-message--mine .chat-history-button { left: -34px; }
.chat-message:hover .chat-history-button, .chat-history-button:focus-visible { opacity: 1; }
.chat-history-button:hover { color: var(--blue); }
.chat-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 60vh; overflow: auto; }
.chat-history__item { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.chat-history__item--current { border-color: var(--blue); }
.chat-history__item header { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.chat-history__item p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message__edited { color: var(--muted); font-size: 11.5px; white-space: nowrap; cursor: default; }
.chat-edit { margin: 6px 0 0; display: grid; gap: 6px; min-width: min(320px, 70vw); }
.chat-edit textarea { width: 100%; resize: vertical; font: inherit; padding: 6px 8px; border: 1px solid var(--line); }
.chat-edit__actions { display: flex; justify-content: flex-end; gap: 6px; }
.msg-composer { position: relative; }
.task-mention-list { position: absolute; left: 12px; bottom: calc(100% - 4px); z-index: 30; width: min(460px, calc(100% - 24px)); max-height: 300px; overflow-y: auto; display: grid; border: 1px solid var(--line-dark); background: #fff; box-shadow: 0 10px 30px rgb(16 24 40 / .16); }
.task-mention-list > header { position: sticky; top: 0; padding: 6px 10px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); background: #fbfcfe; color: var(--navy); font-size: 11.5px; font-weight: 800; }
.task-mention-list > header small { color: var(--muted); font-weight: 500; }
.task-mention-list button { min-height: 38px; padding: 6px 10px; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.task-mention-list button:last-child { border-bottom: 0; }
.task-mention-list button.is-active, .task-mention-list button:hover { background: var(--blue-pale); }
.task-mention-list button b { color: var(--blue); }
.task-mention-list button span { min-width: 0; display: grid; overflow: hidden; }
.task-mention-list button span, .task-mention-list button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-mention-list button small { color: var(--muted); font-size: 11px; }
.task-mention-list button em { color: var(--muted); font-size: 11px; font-style: normal; white-space: nowrap; }
.kanban-card__chat { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; padding: 1px 5px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 10.5px; font-weight: 700; }
.kanban-card__chat.has-unread { background: var(--blue); color: #fff; }
.task-discussion { padding: 10px 12px; display: grid; gap: 8px; border: 1px solid var(--line); background: #fff; }
.task-discussion > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.task-discussion > header b { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 13px; }
.task-discussion > header small { color: var(--muted); font-size: 12px; }
.task-discussion > p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.task-discussion__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.task-discussion__source { justify-self: start; display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: 12.5px; font-weight: 600; }
.task-discussion__mentions { display: grid; gap: 6px; font-size: 12.5px; }
.task-discussion__mentions:empty { display: none; }
.task-discussion__mentions b { color: var(--ink-2); font-size: 12px; }
.task-discussion__mentions ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.task-discussion__mentions a { padding: 6px 8px; display: grid; gap: 2px; border: 1px solid var(--line); color: var(--ink-2); }
.task-discussion__mentions a:hover { border-color: var(--blue-soft); background: var(--blue-pale); }
.task-discussion__mentions span { color: var(--muted); font-size: 11.5px; }
.task-discussion__mentions q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; quotes: none; }
.task-source-note { margin: 0; padding: 8px 10px; display: flex; align-items: center; gap: 6px; background: var(--blue-pale); color: var(--navy); font-size: 12.5px; }
@media (max-width: 760px) {
  .chat-task-button { top: -13px; opacity: 0; pointer-events: none; }
  .chat-message:not(.chat-message--mine) .chat-task-button, .chat-message--mine .chat-task-button { left: auto; right: 44px; }
  .chat-message.is-actions .chat-task-button { opacity: 1; pointer-events: auto; }
  .chat-edit-button { top: -13px; opacity: 0; pointer-events: none; }
  .chat-message:not(.chat-message--mine) .chat-edit-button, .chat-message--mine .chat-edit-button { left: auto; right: 80px; }
  .chat-message.is-actions .chat-edit-button { opacity: 1; pointer-events: auto; }
  .chat-history-button { top: -13px; opacity: 0; pointer-events: none; }
  .chat-message:not(.chat-message--mine) .chat-history-button, .chat-message--mine .chat-history-button { left: auto; right: 116px; }
  .chat-message.is-actions .chat-history-button { opacity: 1; pointer-events: auto; }
  .chat-rooms__group { margin: 0 2px; flex: 0 0 auto; align-self: center; }
  .task-chat-head__note { display: none !important; }
  .task-mention-list { left: 6px; width: calc(100% - 12px); }
}
.project-chat-main > header > div:first-child { min-width: 0; flex: 1 1 auto; }
.project-chat-main > header > div:first-child > div { min-width: 0; }
.project-chat-main > header > .dm-conversation__actions { flex: 0 0 auto; }
.project-chat-main { grid-template-columns: minmax(0, 1fr); }
.project-chat-main > header { min-width: 0; }

/* Tasks and agents 2026-11: «Поручить агенту», merge requests of a task. */
.link-button { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 12.5px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-button:hover { color: var(--navy); }
.kanban-card__agent { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; padding: 1px 5px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 10.5px; font-weight: 700; }
.kanban-card__agent.is-working { background: #fff4e5; color: #b05a00; animation: agent-pulse 1.6s ease-in-out infinite; }
.kanban-card__agent.is-merged { background: #e7f6ee; color: #13744a; }
@keyframes agent-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .kanban-card__agent.is-working { animation: none; } }
.task-agents { padding: 10px 12px; display: grid; gap: 8px; border: 1px solid var(--line); background: #fff; }
.task-agents > header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.task-agents > header b { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 13px; }
.task-agents__working { padding: 1px 8px; background: #fff4e5; color: #b05a00; font-size: 11.5px; font-weight: 700; }
.task-agents > p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.task-agents ul { margin: 0; padding: 0; list-style: none; display: grid; }
.task-agents li { min-height: 34px; padding: 4px 0; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.task-agents li:last-child { border-bottom: 0; }
.task-agents li > a { min-width: 0; flex: 1 1 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.task-agents li > a span, .task-agents li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-agents li > a:hover { color: var(--blue); }
.task-agents li.is-muted { color: var(--muted); }
.task-agents li > small { flex: 0 0 auto; color: var(--muted); font-size: 11.5px; }
.task-agents li > small.is-working { color: #b05a00; font-weight: 700; }
.mr-chip { padding: 1px 7px; background: var(--surface-2); color: var(--ink-2) !important; font-weight: 700; }
.mr-chip.is-open { background: var(--blue-pale); color: var(--blue) !important; }
.mr-chip.is-merged { background: #e7f6ee; color: #13744a !important; }
.task-agents__offer, .mr-task__offer { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; background: #e7f6ee; color: #0f5c3a; font-size: 12.5px; }
.task-agents__offer > span { flex: 1 1 200px; }
.task-agents__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mr-task { margin: 6px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--ink-2); font-size: 13px; }
.mr-task > .icon { color: var(--muted); }
.mr-task__label { color: var(--muted); font-weight: 600; }
.mr-task__none { color: var(--muted); }
.mr-task select { max-width: min(460px, 100%); height: 32px; padding: 0 8px; border: 1px solid var(--line-dark); background: #fff; font: inherit; font-size: 13px; }
.mr-task__offer { flex: 1 1 100%; }
.agent-task-ref { margin: 2px 0 4px; font-size: 12px; }
.agent-chat-task { color: var(--blue); font-weight: 800; }
.task-source-note { display: block; line-height: 1.5; }
.task-source-note > .icon { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.task-source-note code { font-size: .95em; white-space: nowrap; }

/* Agents helping with tasks 2026-11: «Разбить с помощью агента» and agent reports in a task's discussion. */
.task-subtasks__add .task-subtasks__assist { color: var(--violet); }
.task-subtasks__add .task-subtasks__assist:hover { background: #f6f1fb; color: #5d3f80; }
.task-assist { padding: 12px; display: grid; gap: 10px; border: 1px solid #d9cbe8; border-top: 3px solid var(--violet); background: #fbf9fe; }
.task-assist[hidden] { display: none; }
.task-assist > header { display: flex; align-items: center; gap: 8px; }
.task-assist > header b { display: inline-flex; align-items: center; gap: 6px; color: #4f3470; font-size: 13px; }
.task-assist > header small { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.task-assist > header .icon-button { margin-left: auto; }
.task-assist > p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.task-assist__setup { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 10px; align-items: start; }
.task-assist__setup .field small { color: var(--muted); font-weight: 500; }
.task-assist__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-assist__wait { display: flex; align-items: center; gap: 9px; color: #4f3470 !important; font-weight: 600; }
.task-assist__wait .spinner-dot { background: var(--violet); }
.task-assist__demo { padding: 8px 10px; display: flex; align-items: flex-start; gap: 8px; background: #fff4e5; color: #8a4b00 !important; font-size: 12.5px !important; }
.task-assist__demo .icon { flex: 0 0 auto; margin-top: 2px; }
.task-assist__demo a { color: inherit; text-decoration: underline; }
.task-proposals { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; counter-reset: proposal; }
.task-proposal { padding: 8px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; border: 1px solid var(--line); background: #fff; transition: opacity .15s ease; }
.task-proposal > input[type=checkbox] { width: 18px; height: 18px; margin: 8px 0 0; accent-color: var(--violet); }
.task-proposal.is-off { opacity: .55; }
.task-proposal.is-off .task-proposal__title { text-decoration: line-through; }
.task-proposal__body { min-width: 0; display: grid; gap: 6px; }
.task-proposal__body input[type=text], .task-proposal__body textarea, .task-proposal__body select { width: 100%; min-width: 0; padding: 6px 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 13px; }
.task-proposal__body textarea.task-proposal__title { min-height: 34px; resize: none; field-sizing: content; color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.4; }
.task-proposal__body textarea { min-height: 52px; resize: vertical; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.task-proposal__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.task-proposal__meta select { width: auto !important; height: 32px; padding: 0 8px !important; }
.task-proposal__people { min-width: 0; flex: 1 1 200px; }
.task-proposal__people > summary { min-height: 32px; padding: 0 9px; display: inline-flex; max-width: 100%; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: 12.5px; cursor: pointer; list-style: none; }
.task-proposal__people > summary::-webkit-details-marker { display: none; }
.task-proposal__people > summary > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-proposal__people > summary .avatar-stack .avatar + .avatar { margin-left: -5px; }
.task-proposal__people > summary .avatar-stack .avatar { box-shadow: 0 0 0 2px #fff; }
.task-proposal__people[open] > summary { border-color: var(--blue-soft); }
.task-proposal__people > div { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 720px) {
  .task-assist__setup { grid-template-columns: minmax(0, 1fr); }
  .task-assist__actions .button { flex: 1 1 100%; justify-content: center; }
  .task-proposal { padding: 8px; gap: 8px; }
}

.chat-message--agent > .chat-bubble { border-color: #d9cbe8; border-left: 3px solid var(--violet); background: #fbf9fe; }
.chat-agent-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: #efe7f7; color: var(--violet); }
.chat-message .chat-agent-badge { padding: 0 6px; border-radius: 99px; background: #efe7f7; color: #5d3f80; font-size: 10.5px; font-weight: 700; }
.chat-message--agent .chat-bubble > header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chat-message--agent .chat-bubble > header time { margin-left: auto; }
.chat-message--agent p.chat-agent-report__title { color: #4f3470; font-weight: 700; }
.chat-message--agent p + p { margin-top: 4px; }
@media (max-width: 720px) { .chat-agent-avatar { width: 30px; height: 30px; } }

.check-row--wide { align-items: flex-start; gap: 10px; }
.check-row--wide > input { margin-top: 3px; }
.check-row--wide > span { display: grid; gap: 2px; }
.check-row--wide b { color: var(--ink); font-size: 13px; }
.agent-task-line { margin: 2px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.agent-task-line .agent-task-ref { margin: 0; }
.agent-task-report { margin: 0; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; cursor: pointer; }
.agent-task-report input { accent-color: var(--violet); }

/* Task window 2026-11 (pipeline): two columns on a wide screen — the work on the left, its state and links on the right. */
.task-form:not(.task-form--split) .task-form__main,
.task-form:not(.task-form--split) .task-form__side,
.task-form:not(.task-form--split) .task-form__fields { display: contents; }
.task-form--split { grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); align-items: start; gap: 18px 26px; }
.task-form--split > .task-delete, .task-form--split > .modal__actions { grid-column: 1 / -1; }
.task-form__main, .task-form__side, .task-form__fields { min-width: 0; display: grid; gap: 14px; align-content: start; }
.task-form__side { gap: 12px; }
.task-form__side .task-form__fields { gap: 12px; }
.task-form--split .task-form__place { flex-direction: column; align-items: stretch; gap: 12px; }
.task-form__place select { text-overflow: ellipsis; }
.task-form--split .assignee-picker > div { gap: 5px; }
.task-card { padding: 10px 12px; display: grid; gap: 7px; border: 1px solid var(--line); background: #fff; }
.task-card > header { min-height: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.task-card > header b { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 13px; }
.task-card > header .button { flex: 0 0 auto; }
.task-card > p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.task-card__hint { color: var(--muted) !important; }
.task-card__hint code, .task-agents__branch code { font-size: 11.5px; }
.task-card__more { justify-self: start; font-size: 12px; }
.task-card .link-button { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.task-card .link-button:hover { text-decoration: underline; }
.task-agents li.task-agents__branch { flex-wrap: wrap; row-gap: 2px; }
.task-agents li.task-agents__branch > span { white-space: normal; color: var(--ink-2); font-size: 12.5px; }
.task-agents li.task-agents__branch .link-button { margin-left: auto; font-size: 12.5px; }
@media (max-width: 900px) {
  .task-form--split { grid-template-columns: minmax(0, 1fr); }
  /* One column on a phone: the fields first, then subtasks, discussion and agents. */
  .task-form--split .task-form__main, .task-form--split .task-form__side { display: contents; }
  .task-form--split .task-form__fields { order: 1; }
  .task-form--split .task-form__fields--side { order: 2; }
  .task-form--split .task-subtasks { order: 3; }
  .task-form--split .task-assist { order: 4; }
  .task-form--split .task-discussion { order: 5; }
  .task-form--split .task-agents { order: 6; }
  .task-form--split > .task-delete { order: 7; }
  .task-form--split > .modal__actions { order: 8; }
  .task-form--split .task-form__place { flex-direction: row; }
}
@media (max-width: 560px) { .task-form--split .task-form__place { flex-direction: column; align-items: stretch; } }

.access-collapsed { border: 1px solid var(--line); background: #fbfcfe; }
.access-collapsed > summary { min-height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.access-collapsed > summary b { color: var(--navy); }
.access-collapsed[open] > summary { border-bottom: 1px solid var(--line); }
.access-collapsed > .access-fields { margin: 0; border: 0; }
.access-collapsed > .access-fields > legend { display: none; }
/* Card footer: people, then the agent / discussion badges and the time in one line. */
.kanban-card footer { grid-template-columns: minmax(0, 1fr); grid-auto-flow: column; grid-auto-columns: max-content; gap: 6px; }
.task-open-warning { margin: 0; padding: 8px 10px; display: flex; align-items: center; gap: 7px; background: #fff4e5; color: #8a4b00; font-size: 13px; }
.task-agents li.task-agents__branch { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 6px; }
.task-agents li.task-agents__branch > .icon { margin-top: 2px; }
.task-agents li.task-agents__branch .link-button { grid-column: 2; justify-self: start; margin: 0; }

/* A review that went wrong: where the merge request of a task stands, and the way back to «Проверка». */
.mr-chip.is-review-changes_requested { background: #fff4e5; color: #8a4b00 !important; }
.mr-chip.is-review-updated { background: var(--blue-pale); color: var(--blue) !important; }
.mr-chip.is-review-approved { background: #e7f6ee; color: #13744a !important; }
.task-agents__offer--rework, .mr-task__offer--rework { background: var(--blue-pale); color: var(--navy); }
.mr-task__offer--rework { padding: 8px 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 12.5px; }
.task-card .task-card__more { font-size: 12px; text-decoration: none; }
.task-card .task-card__more:hover { text-decoration: underline; }

/* Agreements (account page + admin users) + kanban subtasks toggle — 2026.11.05 */
.account-agreements{margin-top:16px;padding:16px;display:grid;gap:12px;border:1px solid var(--line);border-radius:8px;background:#fff;}
.account-agreements > header{display:grid;gap:3px;}
.account-agreements > header small{color:var(--muted);font-size:12px;}
.account-agreements .agreement-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-top:1px solid #e2e5ea;}
.account-agreements .agreement-row:first-child{border-top:none;}
.account-agreements .agreement-name{text-decoration:none;}
.account-agreements .agreement-name.is-unsigned{color:#c62828;font-weight:600;}
.account-agreements .agreement-name.is-unsigned:hover{text-decoration:underline;}
.account-agreements .agreement-name.is-signed{color:var(--ink,#1f2430);}
.agreement-signed{display:inline-flex;align-items:center;gap:4px;color:#2e7d32;font-size:.85rem;white-space:nowrap;}
.account-agreements .agreement-actions{display:inline-flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end;}
.agreement-upload{cursor:pointer;}
.agreement-scan{display:inline-flex;align-items:center;gap:4px;font-size:.82rem;color:var(--blue);text-decoration:none;}
.agreement-scan:hover{text-decoration:underline;}
.agreement-chip-link{text-decoration:none;}
.agreement-chip-link:hover .agreement-chip.is-signed{border-color:#2e7d32;}
/* Consent gate — blocks the system until every agreement is signed */
.consent-gate{position:fixed;inset:0;z-index:1200;display:grid;place-items:center;padding:24px;background:var(--bg,#eef1f5);overflow:auto;}
.consent-gate__card{width:min(560px,100%);background:#fff;border:1px solid var(--line);border-radius:12px;padding:28px;box-shadow:0 18px 48px rgb(17 24 39 / .12);}
.consent-gate__card > header{display:flex;align-items:center;gap:10px;color:var(--blue);margin-bottom:10px;}
.consent-gate__card > header h1{font-size:1.3rem;margin:0;}
.consent-gate__card > p{color:var(--muted);margin:0 0 18px;}
.consent-gate__list{list-style:none;margin:0 0 18px;padding:0;display:grid;gap:10px;}
.consent-gate__item{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;border:1px solid var(--line);border-radius:10px;background:#fafbfc;}
.consent-gate__doc{display:grid;gap:4px;}
.consent-gate__doc b{color:#c62828;}
.consent-gate__doc a{display:inline-flex;align-items:center;gap:4px;font-size:.85rem;color:var(--blue);text-decoration:none;}
.consent-gate__doc a:hover{text-decoration:underline;}
.consent-gate__card > footer{display:flex;justify-content:flex-end;border-top:1px solid var(--line);padding-top:14px;}
@media (max-width:560px){.consent-gate__item{flex-direction:column;align-items:stretch;}}
.admin-user-agreements{display:block;margin-top:2px;}
.admin-user-agreements__title{display:block;margin-top:5px;font-size:11px;font-weight:700;color:var(--muted);}
.agreement-review-cols{display:flex;flex-wrap:wrap;gap:16px;margin-top:5px;align-items:flex-start;}
.agreement-review-col{display:flex;flex-direction:column;gap:5px;min-width:150px;}
.agreement-review-col > .agreement-chip{align-self:flex-start;margin-bottom:1px;}
.agreement-review-list{display:grid;gap:8px;}
.agreement-review-item{flex-wrap:wrap;gap:8px 12px;}
.agreement-review-actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;}
.agreement-chip{display:inline-block;font-size:.72rem;padding:0 5px;border-radius:6px;margin-right:4px;border:1px solid transparent;}
.agreement-chip.is-signed{color:#2e7d32;background:#e8f5e9;border-color:#c8e6c9;}
.agreement-chip.is-unsigned{color:#b26a00;background:#fff4e5;border-color:#ffe0b2;}
.agreement-chip.is-review{color:#7a5b00;background:#fff4d6;border-color:#e8c766;}
.agreement-chip.is-revoked{color:#c62828;background:#fdecea;border-color:#f5c6cb;}
.agreement-chip .agreement-chip-link{text-decoration:none;color:inherit;}
.consent-gate__banner{display:flex;align-items:center;gap:8px;margin:0 0 14px;padding:10px 14px;background:#fff4d6;color:#7a5b00;border:1px solid #e8c766;border-radius:10px;font-weight:600;}
.consent-gate__status{display:inline-flex;align-items:center;gap:5px;font-size:.82rem;font-weight:600;padding:4px 10px;border-radius:8px;}
.consent-gate__status--review{color:#7a5b00;background:#fff4d6;border:1px solid #e8c766;}
.consent-gate__status--ok{color:#2e7d32;background:#e8f5e9;border:1px solid #c8e6c9;}
.consent-gate__status--revoked{color:#c62828;background:#fdecea;border:1px solid #f5c6cb;}
.kanban-subtasks{display:inline-flex;align-items:center;gap:5px;font-size:.85rem;white-space:nowrap;cursor:pointer;}

/* Роль «Администратор ИБ» — значок в таблице пользователей. Консоль «Безопасность ИИ» собственных
   правил не имеет: вкладка оформлена общими классами (settings-card, field, status, audit-list…). */
.role-badge{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:600;padding:2px 7px;border-radius:999px;margin-top:4px}
.role-badge--security{background:#eef1f7;color:#2457b5;border:1px solid #c9cedb}
@media (prefers-color-scheme: dark){
  .role-badge--security{background:#1c2740;color:#8fb4ff;border-color:#2b3a5c}
}
