/* Shared operational surfaces. Rail and tab styles live in navigation.css. */
:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #fff;
  --text: #202b3a;
  --muted: #586575;
  --line: #d5dce5;
  --accent: #2457a7;
  --primary-hover: #1b4485;
  --focus: #427bc6;
  --sidebar: #202c3d;
  --control-border: #7d8b9e;
  --control-line: var(--control-border);
  --hover: #edf2f8;
  --selected: #e8f0fc;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
:where(button, .primary) { display: inline-block; border: 1px solid var(--control-line); background: var(--surface); border-radius: 5px; padding: 8px 13px; color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600; line-height: 1.5; }
:where(button:hover:not(:disabled)) { background: var(--hover); border-color: #627891; color: var(--text); }
:where(button:active:not(:disabled)) { background: #dfe7f1; }
.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; text-decoration: none; }
.primary:active:not(:disabled) { background: #15366a; border-color: #15366a; }
button:disabled { opacity: .5; cursor: not-allowed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.25; font-weight: 650; letter-spacing: -.025em; overflow-wrap: anywhere; }
h2 { font-size: 16px; font-weight: 650; }
p { color: var(--muted); max-width: 74ch; overflow-wrap: anywhere; }
code, pre { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
input, select, textarea { border: 1px solid var(--control-line); border-radius: 5px; background: var(--surface); padding: 9px 12px; color: var(--text); max-width: 100%; }
input::placeholder, textarea::placeholder { color: #657385; opacity: 1; }
:where(input, select, textarea):hover:not(:disabled) { border-color: #627891; }
:where(input, select, textarea):focus { border-color: var(--accent); }
:where(input, select, textarea):disabled { color: var(--muted); background: #edf0f4; cursor: not-allowed; }
:where(input, textarea)[readonly] { background: #f2f5f8; }
[aria-invalid="true"] { border-color: #b13c43; }
select { min-width: 240px; margin-top: 6px; }
.mark { font-size: 48px; font-weight: 750; letter-spacing: -7px; color: var(--text); line-height: 1; }
.mark span { color: var(--accent); }
.mark.small { font-size: 32px; letter-spacing: -5px; color: #fff; }
.mark.small span { color: #9dc1f4; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 48px 24px 96px; position: relative; background: var(--bg); }
.login form { width: min(460px, 100%); padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.login h1 { margin: 28px 0 12px; }
.login p { margin-bottom: 28px; }
.login label { display: block; margin-bottom: 8px; font-weight: 600; }
.login input { width: 100%; margin-bottom: 16px; }
.login button { width: 100%; display: flex; justify-content: space-between; padding: 11px 16px; }
.login small { display: block; text-align: center; color: var(--muted); margin-top: 20px; font-size: 12px; }
.login-note { position: absolute; bottom: 24px; left: 32px; right: 32px; display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 12px; }
#login-error { color: #a62b35; margin: 16px 0 0; }
#login-error:not(:empty) { background: #fff2f2; border: 1px solid #e3b5ba; border-radius: 5px; padding: 12px; }
.workspace-main { margin-left: 228px; min-width: 0; }
.workspace-main > header { min-height: 56px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--muted); }
.workspace-main > header > span { min-width: 0; overflow-wrap: anywhere; }
.workspace-main > header b { font-weight: 400; color: var(--muted); margin: 0 8px; }
.workspace-main > header > div { display: flex; flex-shrink: 0; align-items: center; gap: 14px; }
.workspace-main > header button { font-size: 13px; padding: 6px 12px; }
main { max-width: 1600px; margin: auto; padding: 28px 28px 40px; min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.page-heading p { margin-top: 7px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 24px; }
.kpis article { padding: 20px; border-right: 1px solid var(--line); min-width: 0; }
.kpis article:last-child { border-right: 0; }
.kpis span { font-size: 14px; color: var(--muted); }
.kpis strong { display: block; font-size: 30px; letter-spacing: -.03em; font-weight: 650; font-variant-numeric: tabular-nums; margin: 8px 0 6px; overflow-wrap: anywhere; }
.kpis small { font-size: 12px; color: var(--muted); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
.panel { min-width: 0; padding: 22px 24px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin-bottom: 24px; }
.section-title { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.badge { background: #f0f3f7; border: 1px solid var(--line); color: #4b5b70; font-size: 12px; padding: 3px 8px; border-radius: 4px; }
.subtle { font-size: 13px; }
.runtime dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 20px; margin: 22px 0; }
.runtime dt { color: var(--muted); }
.runtime dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.runtime p { border-top: 1px solid var(--line); padding-top: 16px; font-size: 13px; }
.empty { min-height: 180px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; gap: 8px; }
.empty strong { font-weight: 600; color: var(--text); font-size: 15px; }
.empty p { font-size: 14px; max-width: 48ch; }
.view > .empty { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); margin-bottom: 16px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 120px) minmax(0, 1fr) 50px; gap: 12px; align-items: center; font-size: 13px; margin-top: 20px; }
.bar-row > span { overflow-wrap: anywhere; }
.bar-track { height: 7px; background: #e8edf4; border-radius: 3px; overflow: hidden; }
.bar { height: 7px; background: #4876b8; border-radius: 3px; }
.bar-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { font-weight: 600; color: #4a596c; font-size: 13px; padding: 12px; border-bottom: 1px solid #bbc7d5; background: #f3f6f9; white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 500; }
td code { color: var(--muted); white-space: normal; }
tbody tr:hover { background: #f2f6fb; }
.method { font-size: 12px; color: #285c46; background: #eaf4ee; border: 1px solid #c3dccd; border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.search { width: min(420px, 100%); margin: 8px 0 24px; }
.search-label { display: block; font-size: 14px; color: var(--text); font-weight: 500; }
details summary { cursor: pointer; font-weight: 600; }
details summary:hover { color: var(--accent); }
details .steps { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 22px; }
.steps h3 { font-size: 13px; color: var(--muted); }
.step { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.step small { display: block; color: var(--muted); margin-top: 4px; }
.editor-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.editor-toolbar p { font-size: 13px; margin-top: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-label { display: block; background: #edf1f6; border: 1px solid var(--control-line); border-bottom: 0; padding: 10px 14px; font-size: 13px; border-radius: 5px 5px 0 0; color: var(--muted); }
textarea { display: block; width: 100%; min-height: 480px; resize: vertical; border-radius: 0 0 5px 5px; padding: 16px; font: 13px/1.7 ui-monospace, Consolas, monospace; tab-size: 2; }
#validation { padding: 14px 16px; margin: 16px 0 24px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; background: #edf3fc; color: #244773; border: 1px solid #bdcfe8; border-radius: 5px; }
#validation:empty { display: none; }
#notice { padding: 12px 16px; border: 1px solid #bdcfe8; background: #edf3fc; border-radius: 5px; margin-bottom: 20px; color: #244773; font-size: 14px; overflow-wrap: anywhere; }
#warnings { padding-left: 20px; color: var(--muted); font-size: 14px; }
#warnings li { margin-top: 10px; }
.workspace-main > footer { border-top: 1px solid var(--line); padding: 16px 28px; display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 12px; }
footer span:last-child { margin-left: auto; overflow-wrap: anywhere; }
.plugin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plugin-actions button { font-size: 13px; padding: 6px 10px; }
.log-retention-panel h2, .log-history-panel h2 { margin-bottom: 8px; }
.log-retention-panel .actions { align-items: center; }
.log-retention-panel .actions label { font-weight: 600; }
#log-retention { width: 100px; }
.log-history-panel > .actions { margin-bottom: 16px; }
.log-retention-panel > [role="status"]:not(:empty), .log-history-panel > [role="status"]:not(:empty) { margin: 16px 0; padding: 12px 16px; background: #edf3fc; color: #244773; border: 1px solid #bdcfe8; border-radius: 5px; }
.log-history-panel td details { min-width: 200px; }
.log-history-panel td details[open] { min-width: 320px; }
.log-history-panel td details > p { margin-top: 12px; }
.log-headers { margin: 16px 0; }
.log-headers h3 { font-size: 14px; margin: 0 0 8px; }
.log-headers table { margin-top: 0; }
.log-headers th, .log-headers td { padding: 8px; }
.capture-incomplete { color: #805000; background: #fff5df; border-color: #ddc58f; }
.flow-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.flow-canvas { background-color: #f5f7fa; background-image: radial-gradient(#d0d9e5 1px, transparent 1px); background-size: 18px 18px; padding: 28px; margin: 20px 0; border: 1px solid var(--line); border-radius: 6px; }
.flow-lane h3 { color: var(--muted); }
.flow-terminal { background: #eaf0f8; color: #345579; border: 1px solid #b9cbe0; padding: 10px 15px; border-radius: 6px; text-align: center; font-size: 13px; }
.flow-connector { text-align: center; color: #647995; padding: 4px; }
.policy-node { background: var(--surface); border: 1px solid var(--control-line); border-radius: 6px; padding: 12px 16px; }
.policy-node > code, .policy-node > small { display: block; color: var(--muted); margin-top: 4px; }
.policy-open { display: block; text-align: left; background: transparent; border: 0; padding: 0; font-weight: 600; width: 100%; }
.policy-open:hover:not(:disabled) { color: var(--accent); background: #edf3fc; }
.node-actions { display: flex; gap: 8px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.node-actions button { color: var(--text); }
.disabled-node { opacity: .55; }
#flow-designer > label { display: block; margin-top: 20px; }
#step-editor { margin: 20px 0; padding: 20px 0; border-top: 1px solid var(--line); }
#step-editor label { display: block; margin-bottom: 8px; }
#step-json { min-height: 230px; margin-bottom: 12px; }
#flow-feedback { margin-top: 16px; font-size: 14px; }
#flow-feedback:not(:empty) { padding: 12px 16px; border: 1px solid #bdcfe8; background: #edf3fc; color: #244773; border-radius: 5px; }
.context-toolbar { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.context-toolbar > div { min-width: 0; }
.context-toolbar label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.context-toolbar select { min-width: 180px; max-width: 100%; }
@media (max-width: 1100px) {
  .workspace-main { margin-left: 200px; }
  main { padding: 24px; }
  .kpis article { padding: 18px 16px; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 0; }
  .editor-toolbar { align-items: flex-start; flex-direction: column; }
}
@media (min-width: 701px) and (max-width: 1250px) {
  .has-api-context .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .has-api-context .kpis article:nth-child(2) { border-right: 0; }
  .has-api-context .kpis article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .has-api-context .dashboard-grid { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 700px) {
  .workspace-main { margin: 0; }
  .workspace-main > header { min-height: 52px; padding: 10px 16px; }
  #updated { display: none; }
  main { padding: 24px 16px; }
  .page-heading { align-items: flex-start; }
  .page-heading > .primary { display: none; }
  h1 { font-size: 25px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis article:nth-child(2) { border-right: 0; }
  .kpis article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .kpis strong { font-size: 27px; }
  .panel { padding: 18px 16px; }
  details .steps { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 80px minmax(0, 1fr) 40px; gap: 8px; }
  .workspace-main > footer { padding: 16px; gap: 12px; }
  footer > span:first-of-type { display: none; }
  .login form { padding: 28px 24px; }
  .login-note { left: 24px; right: 24px; font-size: 11px; }
  .flow-toolbar { align-items: stretch; flex-direction: column; margin-bottom: 16px; }
  .flow-toolbar .search { margin-bottom: 0; }
  .context-toolbar { align-items: stretch; }
  .context-toolbar > div { flex: 1 1 100%; }
  .context-toolbar select { width: 100%; min-width: 0; }
  .login input, .search, .context-toolbar select { font-size: 16px; }
}
