:root {
  color-scheme: light;
  --ink: #15171a;
  --muted: #687079;
  --line: #e2e6e9;
  --soft: #f4f6f7;
  --surface: #ffffff;
  --accent: #126e5b;
  --accent-soft: #e5f2ee;
  --warning: #9a6700;
  --warning-soft: #fff7d6;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 14px 42px rgba(23, 32, 38, 0.08);
}

* { box-sizing: border-box; }

html { min-width: 320px; }

body {
  min-height: 100vh;
  margin: 0;
  background: #eef1f2;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.52; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark, .avatar { display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; }
.brand-mark { width: 38px; height: 38px; border-radius: 8px; }
.brand > span:last-child, .rail-account > span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.brand small, .rail-account small { color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sync-state { color: var(--muted); font-size: 12px; }
.sync-state.is-error { color: var(--danger); }

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  line-height: 1;
}

.workspace { min-height: calc(100vh - 64px); display: grid; grid-template-columns: 230px minmax(0, 1fr); }

.rail {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: #f8f9f9;
}

.rail-button {
  min-height: 54px;
  display: grid;
  gap: 3px;
  align-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.rail-button span { font-size: 14px; font-weight: 720; }
.rail-button small { color: var(--muted); font-size: 11px; }
.rail-button:hover { background: var(--soft); }
.rail-button.is-active { border-color: #c9ded8; background: var(--accent-soft); color: #0b5546; }
.rail-button.is-active small { color: #47766d; }

.rail-account {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px 7px 3px;
  border-top: 1px solid var(--line);
}
.avatar { width: 38px; height: 38px; border-radius: 50%; font-size: 13px; }
.rail-account strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.content { min-width: 0; padding: 30px; }
.view { display: none; width: min(1440px, 100%); margin: 0 auto; }
.view.is-active { display: block; }

.view-heading, .surface-heading, .dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.view-heading { align-items: end; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.12em; }
h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 30px; line-height: 1.14; }
h2 { margin: 0; font-size: 16px; line-height: 1.3; }
.surface-heading { margin-bottom: 16px; }
.surface-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }

.primary-button, .secondary-button, .danger-button, .text-button, .small-button {
  min-height: 38px;
  border-radius: 6px;
  padding: 0 14px;
  font-weight: 720;
  line-height: 1.2;
}
.primary-button { border: 1px solid var(--accent); background: var(--accent); color: #fff; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.danger-button { border: 1px solid var(--danger); background: var(--danger); color: #fff; }
.text-button { min-height: 30px; border: 0; background: transparent; color: var(--accent); padding: 0 4px; }
.small-button { min-height: 30px; padding: 0 9px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 11px; }
.small-button.is-danger { border-color: #efb4ae; color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat-grid article {
  min-width: 0;
  min-height: 118px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.stat-grid span { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-grid strong { font-size: 28px; line-height: 1; }
.stat-grid small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stat-grid .stat-danger strong { color: var(--danger); }

.surface {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(24, 32, 37, 0.025);
}
.overview-grid, .risk-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.split-layout { display: grid; grid-template-columns: minmax(320px, 0.8fr) minmax(400px, 1.2fr); gap: 14px; }
.order-layout { display: grid; grid-template-columns: minmax(370px, 0.85fr) minmax(420px, 1.15fr); gap: 14px; margin-bottom: 14px; }

.compact-list, .connection-list, .intent-list, .breaker-list, .timeline { display: grid; gap: 8px; }
.compact-item, .connection-item, .intent-item, .breaker-item, .timeline-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.compact-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; }
.compact-item strong, .connection-item strong, .intent-item strong { font-size: 13px; }
.compact-item p, .connection-item p, .intent-item p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.connection-item { padding: 14px; cursor: pointer; }
.connection-item.is-selected { border-color: #98c6ba; box-shadow: inset 3px 0 0 var(--accent); }
.connection-item:hover { background: #fbfcfc; }
.connection-top, .intent-top, .breaker-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.connection-actions, .intent-actions, .table-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.connection-meta, .intent-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.connection-meta span, .intent-metrics span { padding: 7px 8px; background: var(--soft); color: var(--muted); font-size: 10px; }

.badge { display: inline-flex; align-items: center; min-height: 23px; border-radius: 5px; padding: 3px 7px; background: var(--soft); color: #525b64; font-size: 10px; font-weight: 780; text-transform: uppercase; }
.badge.is-ok { background: var(--accent-soft); color: #0b5b4a; }
.badge.is-warning { background: var(--warning-soft); color: var(--warning); }
.badge.is-danger { background: var(--danger-soft); color: var(--danger); }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-grid div { min-width: 0; padding: 10px; background: var(--soft); }
.detail-grid span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.detail-grid strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.subsection { margin-top: 18px; }
.subsection-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.subsection-heading h3 { margin: 0; font-size: 13px; }
.json-view { max-height: 260px; overflow: auto; margin: 0; padding: 12px; border: 1px solid var(--line); background: #fafbfb; color: #344047; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: var(--muted); font-size: 11px; font-weight: 680; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 8px 10px;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #75ad9f; box-shadow: 0 0 0 3px rgba(18, 110, 91, 0.09); }
.calculated-risk { min-height: 38px; display: flex; align-items: center; padding: 8px 10px; border-left: 3px solid #9db7b0; background: var(--soft); color: var(--muted); font-size: 11px; line-height: 1.5; }
.form-status { min-height: 17px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--accent); }

.toggle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.toggle-grid label, .check-row { display: flex; align-items: flex-start; gap: 8px; color: #3f474d; font-size: 11px; line-height: 1.5; }
.toggle-grid input, .check-row input { width: 16px; height: 16px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }

.intent-item { padding: 14px; }
.intent-item.is-rejected { border-color: #efc4c0; }
.risk-errors { margin: 10px 0 0; padding: 9px 10px; background: var(--danger-soft); color: var(--danger); font-size: 10px; line-height: 1.5; }
.risk-warnings { margin: 10px 0 0; padding: 9px 10px; background: var(--warning-soft); color: var(--warning); font-size: 10px; line-height: 1.5; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 11px; }
th { color: var(--muted); font-size: 10px; font-weight: 750; }
tbody tr:last-child td { border-bottom: 0; }
td strong { font-size: 12px; }
td small { display: block; margin-top: 3px; color: var(--muted); }
.positive { color: var(--accent); }
.negative { color: var(--danger); }
.mark-control { display: flex; gap: 5px; }
.mark-control input { width: 90px; height: 30px; border: 1px solid var(--line); border-radius: 5px; padding: 0 7px; }

.breaker-item { padding: 14px; }
.breaker-item.is-active { border-color: #e8a9a3; background: #fffafa; }
.breaker-item p { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.breaker-actions { margin-top: 10px; }

.timeline { max-height: 520px; overflow-y: auto; padding-right: 2px; }
.timeline-item { padding: 12px; }
.timeline-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.timeline-item strong { font-size: 12px; }
.timeline-item p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.timeline-item time { color: var(--muted); font-size: 9px; white-space: nowrap; }

.ticket-list { display: grid; gap: 10px; }
.ticket-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(260px, 1.2fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(248, 249, 250, 0.74);
  cursor: pointer;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.ticket-card:hover, .ticket-card:focus-visible { border-color: rgba(22, 135, 111, 0.34); background: #fff; transform: translateY(-1px); }
.ticket-card-main { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-symbol { min-width: 0; display: grid; gap: 4px; }
.ticket-symbol strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.ticket-symbol span { font-size: 11px; }
.ticket-card-badges { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.ticket-card-meta { min-width: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.ticket-card-meta span:not(:last-of-type)::after { content: "·"; margin-left: 8px; color: rgba(29, 29, 31, 0.28); }
.ticket-card-meta time { margin-left: auto; white-space: nowrap; }
.ticket-actions { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: nowrap; gap: 6px; margin: 0; white-space: nowrap; }
.history-footer { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.history-footer .small-button[hidden] { display: none; }

.ticket-detail-dialog { width: min(900px, calc(100vw - 28px)); }
.ticket-detail-body { display: grid; gap: 16px; }
.detail-loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.ticket-detail-hero { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ticket-detail-hero > div { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.ticket-detail-hero span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.ticket-detail-hero strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.ticket-detail-section { min-width: 0; }
.ticket-detail-section > h3 { margin: 0 0 9px; font-size: 13px; }
.ticket-related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.detail-timeline { display: grid; gap: 7px; max-height: 280px; overflow-y: auto; }
.detail-timeline article { padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: rgba(248, 249, 250, 0.72); }
.detail-timeline article > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-timeline strong { font-size: 11px; }
.detail-timeline time { color: var(--muted); font-size: 9px; white-space: nowrap; }
.detail-timeline p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ticket-detail-error { padding: 13px 14px; border: 1px solid #efb4ae; border-radius: 13px; background: var(--danger-soft); color: var(--danger); }
.ticket-detail-error strong { font-size: 11px; }
.ticket-detail-error p { margin: 5px 0 0; font-size: 11px; line-height: 1.55; }
.technical-detail { border: 1px solid var(--line); border-radius: 14px; background: rgba(248, 249, 250, 0.72); }
.technical-detail summary { padding: 12px 14px; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 700; }
.technical-detail > div { padding: 0 14px 14px; }
.technical-detail h4 { margin: 14px 0 7px; font-size: 11px; }

.empty-state { min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }

dialog { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 28px); overflow: auto; border: 0; border-radius: 8px; padding: 0; background: #fff; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(21, 26, 29, 0.48); backdrop-filter: blur(3px); }
.dialog-form { padding: 22px; }
.dialog-heading { margin-bottom: 20px; }
.dialog-heading h2 { font-size: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.order-ticket { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.order-ticket div { padding: 10px; background: var(--soft); }
.order-ticket span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.order-ticket strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.live-warning { margin: 14px 0; padding: 12px; border: 1px solid #e7c76c; border-radius: 6px; background: var(--warning-soft); color: #76520c; font-size: 11px; line-height: 1.55; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid #b9d5ce; border-radius: 7px; background: #f2fbf8; box-shadow: var(--shadow); color: #174f42; font-size: 12px; line-height: 1.45; animation: toast-in 180ms ease-out; }
.toast.is-error { border-color: #e6b0ab; background: #fff7f6; color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout, .order-layout, .risk-layout { grid-template-columns: 1fr; }
  .ticket-card { grid-template-columns: minmax(200px, 0.9fr) minmax(220px, 1fr); }
  .ticket-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 760px) {
  .topbar { padding: 9px 12px; }
  .sync-state { display: none; }
  .workspace { display: block; }
  .rail { position: sticky; top: 58px; z-index: 15; height: auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .rail-button { min-width: 72px; min-height: 40px; padding: 6px; text-align: center; }
  .rail-button small, .rail-account { display: none; }
  .content { padding: 18px 12px 34px; }
  .view-heading { align-items: flex-start; }
  h1 { font-size: 25px; }
  .overview-grid { grid-template-columns: 1fr; }
  .form-grid, .detail-grid, .order-ticket { grid-template-columns: 1fr; }
  .ticket-card { grid-template-columns: 1fr; gap: 11px; }
  .ticket-card-meta { flex-wrap: wrap; }
  .ticket-card-meta time { width: 100%; margin-left: 0; }
  .ticket-actions { grid-column: auto; overflow-x: auto; padding-bottom: 2px; }
  .ticket-detail-hero, .ticket-related-grid { grid-template-columns: 1fr; }
  .surface-heading { align-items: flex-start; }
  .field-wide { grid-column: auto; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid article { min-height: 94px; }
  .view-heading { flex-direction: column; }
  .view-heading .primary-button { width: 100%; }
  .toggle-grid { grid-template-columns: 1fr; }
  .surface { padding: 15px; }
}

/* Velora Agent Console · visual system v2 */
:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.1);
  --soft: #f5f5f7;
  --surface: rgba(255, 255, 255, 0.88);
  --accent: #16876f;
  --accent-strong: #0b6b58;
  --accent-soft: rgba(22, 135, 111, 0.1);
  --warning: #946200;
  --warning-soft: #fff8dd;
  --danger: #b42318;
  --danger-soft: #fff1ef;
  --shadow: 0 24px 70px rgba(20, 25, 30, 0.12);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 15px;
}

body {
  background:
    radial-gradient(circle at 84% -10%, rgba(48, 209, 88, 0.09), transparent 30%),
    linear-gradient(180deg, #eef1f1 0, #f5f5f7 360px, #f5f5f7 100%);
  letter-spacing: -0.012em;
}

.topbar {
  min-height: 72px;
  padding: 10px 24px;
  border-bottom-color: rgba(29, 29, 31, 0.08);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
}

.brand { gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(29, 29, 31, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
}
.brand-mark img { width: 38px; height: 38px; }
.brand strong { font-size: 15px; letter-spacing: -0.025em; }
.brand small { color: rgba(29, 29, 31, 0.48); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.topbar-actions { gap: 10px; }
.sync-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.68);
  color: rgba(29, 29, 31, 0.62);
}
.topbar .icon-button {
  border-color: rgba(29, 29, 31, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}
.topbar .icon-button:hover { border-color: rgba(29, 29, 31, 0.18); background: #fff; }

.workspace { min-height: calc(100vh - 72px); grid-template-columns: 270px minmax(0, 1fr); }
.rail {
  top: 72px;
  height: calc(100vh - 72px);
  gap: 7px;
  padding: 24px 18px 18px;
  border-right: 1px solid rgba(29, 29, 31, 0.08);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  backdrop-filter: blur(28px) saturate(155%);
}
.rail::before {
  content: "CONTROL SURFACE";
  margin: 0 11px 10px;
  color: rgba(29, 29, 31, 0.38);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}
.rail-button {
  min-height: 62px;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 10px 12px;
  border-radius: 15px;
  color: rgba(29, 29, 31, 0.72);
}
.rail-button .rail-icon {
  grid-row: 1 / 3;
  align-self: center;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 9px;
  color: rgba(29, 29, 31, 0.68);
  font-size: 14px;
}
.rail-button > span:not(.rail-icon), .rail-button small { grid-column: 2; }
.rail-button span { font-size: 13px; }
.rail-button small { color: rgba(29, 29, 31, 0.4); font-size: 10px; }
.rail-button:hover { background: rgba(29, 29, 31, 0.045); }
.rail-button.is-active {
  border-color: rgba(48, 209, 88, 0.24);
  background: linear-gradient(120deg, rgba(48, 209, 88, 0.15), rgba(100, 210, 255, 0.06));
  color: #0b5d4d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}
.rail-button.is-active .rail-icon { border-color: rgba(48, 209, 88, 0.3); background: rgba(48, 209, 88, 0.13); color: #6ee78b; }
.rail-button.is-active small { color: rgba(11, 93, 77, 0.58); }

.rail-account {
  width: 100%;
  border: 1px solid rgba(29, 29, 31, 0.08);
  border-radius: 17px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  transition: none;
}
.rail-account:hover { border-color: rgba(29, 29, 31, 0.08); background: rgba(255, 255, 255, 0.62); transform: none; }
.avatar { overflow: hidden; border: 1px solid rgba(29, 29, 31, 0.1); background: #fff; }
.avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.rail-account strong { color: var(--ink); }
.rail-account small { color: rgba(29, 29, 31, 0.46); }

.content { padding: 42px clamp(22px, 4vw, 58px) 70px; }
.view { width: min(1380px, 100%); }
.view-heading { margin-bottom: 28px; }
.view-heading::after {
  content: "";
  position: absolute;
  right: 5%;
  z-index: -1;
  width: 280px;
  height: 120px;
  border-radius: 50%;
  background: rgba(48, 209, 88, 0.08);
  filter: blur(42px);
}
.eyebrow { color: var(--accent); letter-spacing: 0.16em; }
h1 { font-size: clamp(30px, 4vw, 46px); font-weight: 720; letter-spacing: -0.045em; }
h2 { font-size: 17px; letter-spacing: -0.025em; }

.primary-button, .secondary-button, .danger-button, .small-button {
  border-radius: 999px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.primary-button { min-height: 42px; padding: 0 18px; background: #111416; border-color: #111416; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(17, 20, 22, 0.2); }
.secondary-button:hover, .small-button:hover { background: var(--soft); }

.stat-grid { gap: 16px; margin-bottom: 18px; }
.stat-grid article {
  min-height: 150px;
  gap: 10px;
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.82);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 55px rgba(24, 31, 35, 0.07), inset 0 1px 0 #fff;
  backdrop-filter: blur(24px) saturate(150%);
}
.stat-grid strong { font-size: 38px; letter-spacing: -0.045em; }

.surface {
  padding: 24px;
  border-color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(27, 34, 38, 0.065), inset 0 1px 0 #fff;
  backdrop-filter: blur(24px) saturate(145%);
}
.overview-grid, .risk-layout, .split-layout, .order-layout { gap: 18px; margin-bottom: 18px; }
.activity-view > .surface,
.activity-view > .overview-grid { margin-bottom: 22px; }
.activity-view > .overview-grid:last-child { margin-bottom: 0; }
.compact-item, .connection-item, .intent-item, .breaker-item, .timeline-item {
  border-color: rgba(29, 29, 31, 0.08);
  border-radius: var(--radius-md);
  background: rgba(248, 249, 250, 0.72);
}
.compact-item { padding: 15px; }
.connection-item, .intent-item, .breaker-item { padding: 17px; }
.connection-item.is-selected { border-color: rgba(22, 135, 111, 0.45); box-shadow: inset 4px 0 0 var(--accent); }
.connection-meta span, .intent-metrics span, .detail-grid div, .order-ticket div { border-radius: 11px; }
.badge { border-radius: 999px; padding-inline: 9px; }
.field input, .field select, .field textarea {
  min-height: 44px;
  border-color: rgba(29, 29, 31, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
}
.calculated-risk { border-radius: 0 12px 12px 0; }
table { min-width: 820px; }
th, td { padding-block: 14px; }
dialog { border-radius: 26px; }
.dialog-form { padding: 28px; }
.dialog-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.avatar-dialog { width: min(680px, calc(100vw - 28px)); }
.avatar-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.avatar-option {
  position: relative;
  min-height: 126px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: #f7f7f9;
  color: var(--ink);
  cursor: pointer;
}
.avatar-option:hover { border-color: rgba(22, 135, 111, 0.34); transform: translateY(-1px); }
.avatar-option.is-selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 135, 111, 0.11); }
.avatar-option img { width: 70px; height: 70px; border-radius: 22px; }
.avatar-option span { font-size: 11px; font-weight: 750; }
.avatar-option.is-selected::after {
  content: "✓";
  position: absolute;
  top: 9px;
  right: 9px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 92px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .rail::before, .rail-button > span:not(.rail-icon), .rail-button small, .rail-account > span:last-child { display: none; }
  .rail-button { min-height: 52px; display: grid; grid-template-columns: 1fr; place-items: center; padding: 8px; }
  .rail-button .rail-icon { grid-row: auto; grid-column: auto; }
  .rail-account { display: grid; grid-template-columns: 1fr; place-items: center; padding: 9px; }
}

@media (max-width: 760px) {
  .topbar { min-height: 64px; padding-inline: 12px; }
  .brand-mark { width: 40px; height: 40px; }
  .brand small, .sync-state { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar .icon-button { width: 36px; height: 36px; }
  .workspace { display: block; }
  .rail {
    top: 64px;
    height: auto;
    grid-template-columns: repeat(5, minmax(62px, 1fr));
    padding: 8px;
    border-bottom: 1px solid rgba(29, 29, 31, 0.08);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(22px);
  }
  .rail-button { min-width: 62px; min-height: 46px; border-radius: 12px; }
  .rail-button .rail-icon { width: 29px; height: 29px; }
  .rail-account { display: none; }
  .content { padding: 26px 12px 44px; }
  .activity-view > .surface,
  .activity-view > .overview-grid { margin-bottom: 16px; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .view-heading .primary-button { width: 100%; }
  h1 { font-size: 32px; }
  .stat-grid { grid-template-columns: 1fr; }
  .stat-grid article { min-height: 122px; }
  .avatar-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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