/* Texis AI console.
   Brand values match the Texis Helpdesk tokens, which were lifted from
   texishq.com, so the two internal tools read as one family. */

:root {
  color-scheme: light;
  --brand-900: #2d0049;
  --brand-800: #3a0164;
  --brand-700: #4a017d;
  --brand-600: #63018f;
  --brand-500: #7f3fb4;
  --brand-300: #c298e0;
  --brand-100: #ede0f6;
  --brand-50:  #f7f1fb;
  --magenta:   #c70148;

  --ink-900: #18181d;
  --ink-800: #27272e;
  --ink-700: #3f3f49;
  --ink-600: #52525e;
  --ink-500: #71717f;
  --ink-400: #9d9dab;
  --ink-300: #d2d2dd;
  --ink-200: #e5e5ec;
  --ink-100: #f1f1f5;
  --ink-50:  #f8f8fa;

  --ok: #047857;        --ok-soft: #ecfdf5;
  --warn: #b45309;      --warn-soft: #fffbeb;
  --danger: #c70148;    --danger-soft: #fdf2f6;
  --info: #1d4ed8;      --info-soft: #eff6ff;

  --page: var(--ink-50);
  --surface: #ffffff;
  --surface-2: var(--ink-50);
  --line: var(--ink-200);
  --line-strong: var(--ink-300);
  --text: var(--ink-800);
  --text-soft: var(--ink-500);
  --grid-surface: #f3f3f7;
  --grid-header: #e9e9f0;
  --grid-row: #ffffff;
  --grid-row-alt: #f8f8fb;
  --grid-row-hover: #f6f0fa;
  --grid-editable: rgba(74, 1, 125, .035);
  --grid-editable-hover: rgba(127, 63, 180, .1);
  --brand-accent: var(--brand-700);
  --log-bg: var(--ink-900);
  --shadow: 0 1px 2px rgba(24, 24, 29, .06), 0 8px 24px -12px rgba(24, 24, 29, .18);

  --radius: 12px;
  --radius-sm: 8px;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #131318;
    --surface: #1c1c22;
    --surface-2: #232329;
    --line: #2f2f38;
    --line-strong: #3d3d47;
    --text: #e8e8ee;
    --text-soft: #9d9dab;
    --grid-surface: #17171c;
    --grid-header: #2a2a32;
    --grid-row: #202027;
    --grid-row-alt: #24242c;
    --grid-row-hover: #2a2330;
    --grid-editable: rgba(255, 255, 255, .025);
    --grid-editable-hover: rgba(160, 104, 205, .13);
    --brand-accent: var(--brand-300);
    --log-bg: #0e0e12;
    --brand-50: #24132f;
    --brand-100: #2f1740;
    --brand-300: #a068cd;
    --ok-soft: #06251c;
    --warn-soft: #2a1c06;
    --danger-soft: #2c0a1a;
    --info-soft: #101c33;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }

/* Class rules below set `display`, which would otherwise win over the `hidden`
   attribute and leave dialogs and badges on screen. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -.011em; }
h1 { font-size: 21px; }
h2 { font-size: 16px; }
h3 { font-size: 14px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--mono); }

.muted { color: var(--text-soft); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.right { text-align: right; }
.grow { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }

/* --------------------------------------------------------------- sign in */

.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 50% -10%, var(--brand-100), transparent 60%),
    var(--page);
}
.signin-card {
  width: 100%; max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.signin-mark, .brand-mark {
  display: grid; place-items: center;
  overflow: hidden;
  background: linear-gradient(150deg, var(--brand-700), var(--brand-900));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.signin-mark img, .brand-mark img { display: block; width: 82%; height: 82%; object-fit: contain; }
.signin-mark { width: 52px; height: 44px; border-radius: 11px; margin: 0 auto 4px; }
.signin-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text-soft); }
.signin-card h1 { font-size: 19px; text-align: center; margin-bottom: 8px; }
.signin-password-field { position: relative; display: block; }
.signin-password-field input { padding-right: 42px; }
.signin-password-toggle {
  position: absolute; top: 50%; right: 5px; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 34px; height: 34px; padding: 0;
  color: var(--text-soft); background: transparent; border: 0; border-radius: 7px;
  cursor: pointer;
}
.signin-password-toggle:hover { color: var(--text); background: var(--surface-2); }
.signin-password-toggle:focus-visible { outline-offset: 0; }
.password-eye { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.password-eye-hide { display: none; }
.signin-password-toggle.revealed .password-eye-show { display: none; }
.signin-password-toggle.revealed .password-eye-hide { display: block; }
.form-error { color: var(--danger); font-size: 12px; }

input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 1px;
}

/* --------------------------------------------------------------- chrome */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 54px; padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-start { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sidebar-toggle {
  width: 32px; height: 32px; justify-content: center; flex: none;
  padding: 0; font-size: 22px; line-height: 1;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.brand-mark { width: 34px; height: 28px; border-radius: 7px; }
.brand-text em { font-style: normal; color: var(--text-soft); font-weight: 500; }
.topbar-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.topbar-meta code { font-size: 11px; }
.theme-toggle {
  min-width: 72px; height: 34px; justify-content: center; flex: none;
  padding: 0 10px; font-size: 12px;
}
.theme-toggle > span:first-child { font-size: 16px; }
.who { font-weight: 600; overflow-wrap: anywhere; }

.shell {
  display: grid; grid-template-columns: 236px minmax(0, 1fr); align-items: start;
  transition: grid-template-columns .16s ease;
}
.sidebar {
  position: sticky; top: 54px;
  height: calc(100vh - 54px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}
.sidebar-account {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: auto;
  padding: 14px 8px 2px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.sidebar-account .who { padding: 0 2px; }
.sidebar-account .btn { justify-content: flex-start; }
.nav-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-soft); padding: 14px 8px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 520;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-50); color: var(--brand-accent); font-weight: 640; }
.nav-icon { color: var(--text-soft); font-size: 12px; }
.nav-item.active .nav-icon { color: inherit; }
.signout-icon { display: none; font-size: 16px; }

.sidebar-collapsed .shell { grid-template-columns: 62px minmax(0, 1fr); }
.sidebar-collapsed .sidebar { padding-inline: 8px; }
.sidebar-collapsed .nav-label,
.sidebar-collapsed .nav-text,
.sidebar-collapsed .sidebar-account .who,
.sidebar-collapsed .signout-text { display: none; }
.sidebar-collapsed .nav-item { justify-content: center; min-height: 34px; padding-inline: 7px; }
.sidebar-collapsed .nav-icon { font-size: 14px; }
.sidebar-collapsed .nav-item .dot { width: 9px; height: 9px; }
.sidebar-collapsed .sidebar-account { align-items: stretch; padding-inline: 0; }
.sidebar-collapsed .sidebar-account .btn { justify-content: center; padding-inline: 0; }
.sidebar-collapsed .signout-icon { display: inline; }

.view { width: 100%; min-width: 0; padding: 22px 26px 64px; max-width: 1180px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-soft); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; font-weight: 560; color: var(--text-soft); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }

/* --------------------------------------------------------------- surfaces */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.workspace-stats { gap: 18px; margin-bottom: 26px; }

.stat { padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat .n { font-size: 22px; font-weight: 680; letter-spacing: -.02em; }
.stat .k { font-size: 11px; color: var(--text-soft); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-soft); font-weight: 700; padding: 9px 16px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* --------------------------------------------------------------- atoms */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-weight: 580; line-height: 1;
  padding: 8px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-600); }
.btn.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-soft); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn.small { padding: 5px 9px; font-size: 12px; }
.btn.wide { justify-content: center; width: 100%; padding: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2.5px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 650; letter-spacing: .01em;
  border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text-soft);
}
.badge.ok      { background: var(--ok-soft);     color: var(--ok);     border-color: transparent; }
.badge.warn    { background: var(--warn-soft);   color: var(--warn);   border-color: transparent; }
.badge.danger  { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info    { background: var(--info-soft);   color: var(--info);   border-color: transparent; }
.badge.brand   { background: var(--brand-50);    color: var(--brand-accent); border-color: transparent; }

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-400); flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }
.dot.info { background: var(--info); }
.dot.live { background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

.pill {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--info-soft); color: var(--info);
  border-radius: 999px; padding: 1px 7px;
}

.empty { padding: 34px 16px; text-align: center; color: var(--text-soft); }

/* --------------------------------------------------------------- pieces */

.wf { display: flex; flex-direction: column; gap: 12px; }
.wf-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.swatches { display: flex; gap: 4px; }
.swatch { width: 15px; height: 15px; border-radius: 4px; border: 1px solid rgba(0,0,0,.14); }

.workstream-page { gap: 18px; }
.workstream-intro {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(120deg, var(--surface), var(--surface-2));
}
.workstream-copy { max-width: 690px; }
.workstream-copy .eyebrow {
  color: var(--brand-accent); font-size: 10.5px; font-weight: 720;
  letter-spacing: .07em; text-transform: uppercase;
}
.workstream-copy h2 { margin-top: 5px; font-size: 22px; }
.workstream-copy > p:last-child { margin-top: 5px; color: var(--text-soft); }
.workstream-actions { flex: none; }
.workstream-intro .badge { margin-left: 2px; }

.compact { gap: 8px; }
.definition-row {
  display: flex; align-items: center; gap: 11px; padding: 10px 11px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.definition-icon {
  display: grid; place-items: center; width: 32px; height: 32px; flex: none;
  border-radius: 8px; background: var(--brand-50); color: var(--brand-accent); font-size: 17px;
}
.role-list { max-height: 330px; overflow-y: auto; }
.role-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
}
.role-row:last-child { border-bottom: 0; }

.advanced-card > summary,
.structured-block > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 16px; cursor: pointer; list-style: none;
}
.advanced-card > summary::-webkit-details-marker,
.structured-block > summary::-webkit-details-marker { display: none; }
.advanced-card > summary > span:first-child,
.structured-block > summary > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.structured-block > summary > span:first-child { flex: 1; }
.advanced-card summary small,
.structured-block summary small { color: var(--text-soft); font-weight: 400; }
.advanced-card > summary::before,
.structured-block > summary::before { content: '›'; color: var(--text-soft); font-size: 18px; transition: transform .15s ease; }
.advanced-card[open] > summary::before,
.structured-block[open] > summary::before { transform: rotate(90deg); }
.shared-asset-groups { padding-left: 43px; }
.asset-group + .asset-group { padding-top: 18px; border-top: 1px solid var(--line); }
.asset-group-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.asset-group-head h3 { font-size: 15px; }
.credential-note { color: var(--warn); }

.structured-block { min-width: 0; }
.structured-block > summary {
  position: sticky; top: 54px; z-index: 20; min-height: 62px;
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 5px 14px -13px rgba(0, 0, 0, .8);
}
.structured-block:not([open]) > summary {
  border-radius: var(--radius);
  box-shadow: none;
}
.structured-block[open] > summary { border-bottom: 1px solid var(--line); }
.structured-save { min-width: 72px; justify-content: center; flex: none; }
.structured-save-meta { display: flex !important; flex: none !important; align-items: center; gap: 10px; }
.structured-saved-at { white-space: nowrap; }
.structured-save[data-save-state="saved"] {
  color: var(--ok); background: var(--ok-soft); border-color: transparent; opacity: 1;
}
.context-section { min-width: 0; padding: 18px 16px 18px 43px; border-bottom: 1px solid var(--line); }
.context-section-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 12px;
}
.context-section-head h3 { font-size: 15px; font-weight: 700; }
.context-section-head p { margin-top: 2px; color: var(--text-soft); font-size: 12px; }
.context-section-body { min-width: 0; max-width: 100%; }

.field-label {
  display: flex; flex-direction: column; gap: 5px;
  color: var(--text-soft); font-size: 11px; font-weight: 650;
}
.field-label input, .field-label textarea { color: var(--text); font-size: 13px; font-weight: 400; resize: vertical; }
.narrative-textarea {
  min-height: 260px; padding: 13px 14px; color: var(--text);
  font-size: 13px; line-height: 1.6; resize: vertical;
}
.context-rows { display: flex; flex-direction: column; gap: 10px; }
.context-row {
  position: relative; padding: 13px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2);
}
.context-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-right: 58px; }
.context-fields .field-label:has(textarea) { grid-column: 1 / -1; }
.context-remove { position: absolute; top: 11px; right: 10px; }
.context-add { align-self: flex-start; }
.context-table-wrap {
  width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--grid-surface); box-shadow: 0 4px 16px -12px rgba(0, 0, 0, .45);
}
.context-table { min-width: 840px; table-layout: fixed; }
.context-table th { padding: 10px 11px; background: var(--grid-header); border-bottom-color: var(--line-strong); }
.context-table td {
  position: relative; padding: 0; vertical-align: top;
  background: var(--grid-row); border-bottom-color: var(--line-strong);
}
.context-table tbody tr:nth-child(even) td { background: var(--grid-row-alt); }
.context-table tbody td:has(.context-cell-editor):hover { background: var(--grid-row-hover); }
.context-table tbody td:focus-within {
  z-index: 1; background: var(--grid-row-hover);
  box-shadow: inset 0 0 0 2px var(--brand-500);
}
.context-table th + th, .context-table td + td { border-left: 1px solid var(--line); }
.context-cell-stack { display: flex; min-height: 100%; flex-direction: column; gap: 0; }
.context-cell-field {
  display: flex; min-width: 0; min-height: 52px; flex: 1; flex-direction: column; gap: 0;
}
.context-cell-field + .context-cell-field { border-top: 1px solid var(--line); }
.context-cell-field > span {
  padding: 8px 12px 0; color: var(--text-soft); font-size: 10px; font-weight: 680;
  text-transform: uppercase; letter-spacing: .045em;
}
.context-cell-editor {
  min-height: 52px; padding: 12px 14px; flex: 1; border: 0;
  border-radius: 0; color: var(--text); font-size: 12.5px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; background: transparent;
}
.context-cell-editor:focus {
  outline: 0; background: transparent;
}
.context-cell-editor:empty::before { content: attr(data-placeholder); color: var(--text-soft); pointer-events: none; }
.context-table-action-cell { padding-right: 38px !important; }
.context-table--feature_vocabulary .context-table-action-cell { padding: 0 38px 0 0 !important; text-align: center; }
.context-table .context-remove {
  top: 8px; right: 7px; width: 27px; height: 27px; justify-content: center;
  padding: 0; font-size: 17px; line-height: 1;
}
.context-table--feature_vocabulary .context-remove { position: absolute; margin: 0; }
.context-table-footer { padding-top: 10px; }
.preview-body { background: #fff; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.guide-preview { display: block; width: 100%; height: 660px; border: 0; background: #fff; }
.evidence-warning { margin-top: 12px; color: var(--warn); }
.advanced-card > summary { min-height: 58px; }
.advanced-card .wf-actions { padding-top: 16px; border-top: 1px solid var(--line); }

.planned-card {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start;
  padding: 28px; box-shadow: none; border-style: dashed;
}
.planned-mark {
  display: grid; place-items: center; width: 44px; height: 44px;
  border-radius: 12px; background: var(--brand-50); color: var(--brand-700); font-size: 23px;
}
.planned-card p { margin-top: 5px; }
.planned-card ul { margin: 14px 0 0; padding-left: 19px; color: var(--text-soft); }
.planned-card li + li { margin-top: 5px; }

.brand-guidance-textarea { min-height: 220px; }
.asset-file-link { display: inline-flex; align-items: center; gap: 12px; color: var(--text); }
.asset-preview {
  display: grid; place-items: center; flex: none; width: 46px; height: 38px;
  overflow: hidden; border: 1px solid var(--line-strong); border-radius: 7px;
  background-color: #3b3b43;
  background-image: linear-gradient(45deg, rgba(255,255,255,.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.06) 75%);
  background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0;
}
.asset-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }

.documentation-table--non_functional_requirements .context-table-action-cell { padding: 13px 10px !important; text-align: center; }
.documentation-table--non_functional_requirements .context-remove { position: static; margin: 0 auto; }
.credential-table { min-width: 640px; }
.setup-subsection + .setup-subsection { padding-top: 24px; border-top: 1px solid var(--line); }
.setup-subsection-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.setup-subsection-head h3 { font-size: 16px; }
.setup-subsection-head p { margin-top: 4px; }
.platform-table { min-width: 760px; }
.platform-table td.context-cell-editor {
  min-height: 64px; padding: 16px 18px; line-height: 1.5;
}
.platform-file-cell {
  min-height: 58px; padding: 0 !important; color: var(--text-soft);
}
.platform-file-cell > div { min-height: 64px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.platform-table .credential-action-cell { padding: 14px 12px; vertical-align: middle; }
.platform-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credential-select-cell { padding: 9px 10px !important; vertical-align: middle !important; }
.credential-select-cell select {
  width: 100%; min-height: 40px; padding: 8px 30px 8px 10px; border: 1px solid var(--line-strong);
  border-radius: 7px; background: var(--surface-2); color: var(--text); font: inherit;
}
.credential-select-cell select:focus { outline: 2px solid var(--brand-500); outline-offset: 1px; }
.credential-select-cell select:disabled { opacity: .72; cursor: default; }
.credential-table td.context-cell-editor { min-height: 58px; padding: 13px 14px; }
.credential-table td.context-cell-editor[contenteditable="true"]:hover { background: var(--grid-row-hover); }
.credential-table td.context-cell-editor:focus { background: var(--grid-row-hover); box-shadow: inset 0 0 0 2px var(--brand-500); }
.credential-table .context-cell-editor[contenteditable="false"] { cursor: default; }
.credential-table .context-cell-editor[contenteditable="false"]:hover { background: transparent; }
.credential-action-cell { text-align: center; }
.cred-comment td { font-size: 12px; color: var(--text-soft); padding-block: 8px; }

.log {
  margin: 0; padding: 16px 18px;
  background: var(--log-bg); color: #e6e6ee;
  font-size: 12px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  overflow-y: auto; flex: 1;
}

/* --------------------------------------------------------------- drawer */

.drawer { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(20, 18, 28, .45); backdrop-filter: blur(2px); }
.drawer-panel {
  position: relative; display: flex; flex-direction: column;
  width: min(760px, 96vw); height: 100%;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -18px 0 48px -24px rgba(0,0,0,.5);
  animation: slide .18s cubic-bezier(.16, 1, .3, 1);
}
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.drawer-actions { display: flex; gap: 6px; }

/* --------------------------------------------------------------- toasts */

.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 80; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: flex-start; gap: 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  padding: 10px 14px; max-width: 400px; font-size: 13px;
  animation: rise .16s ease-out;
}
@keyframes rise { from { transform: translateY(6px); opacity: 0; } }
.toast.error { background: var(--danger-soft); }
.toast.ok { background: var(--ok-soft); }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-collapsed .shell { grid-template-columns: 1fr; }
  .sidebar-collapsed .sidebar { display: none; }
  .sidebar-account { flex-direction: row; align-items: center; justify-content: space-between; margin-top: 12px; }
  .view { padding: 18px 16px 48px; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workstream-intro { align-items: flex-start; flex-direction: column; }
  .workstream-actions { width: 100%; }
  .guide-preview { height: 520px; }
  .context-fields { grid-template-columns: 1fr; padding-right: 0; padding-top: 30px; }
  .context-fields .field-label:has(textarea) { grid-column: auto; }
}

@media (max-width: 520px) {
  .grid.four { grid-template-columns: 1fr; }
  .shared-asset-groups { padding-left: 16px; }
  .context-section { padding-left: 16px; }
  .planned-card { grid-template-columns: 1fr; }
}

.guide-index { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.guide-index > summary {
  padding: 9px 13px; cursor: pointer; font-weight: 600; font-size: 13px;
  list-style: none; display: flex; align-items: center; gap: 7px;
}
.guide-index > summary::before { content: '▸'; color: var(--text-soft); font-size: 11px; }
.guide-index[open] > summary::before { content: '▾'; }
.guide-index > summary::-webkit-details-marker { display: none; }
.guide-index > summary:hover { color: var(--brand-700); }
.guide-index .table-wrap { border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 var(--radius-sm) var(--radius-sm); max-height: 340px; overflow-y: auto; }
.guide-index th { position: sticky; top: 0; z-index: 1; }
.guide-index td, .guide-index th { padding: 7px 13px; }
