:root {
  --accent: #0b74b8;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d232b;
  --muted: #67707c;
  --line: #e2e5ea;
  --ok: #2e9e5b;
  --warn: #c98a1c;
  --bad: #c0392b;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

button { font: inherit; cursor: pointer; }

/* ---------------------------------------------------------- top chrome */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 24px;
  background: #23272f;
  color: #fff;
}
.topbar .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: var(--accent);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.topbar .product { font-size: 16px; font-weight: 600; letter-spacing: .2px; }
.topbar .org { font-size: 12.5px; color: #aab2bd; }
.topbar .spacer { flex: 1; }
.topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #3a414c; color: #fff;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
}
.topbar .who { font-size: 13px; color: #d7dbe0; text-align: right; line-height: 1.25; }
.topbar .who small { color: #8d95a1; font-size: 11px; }

.tabs {
  display: flex; gap: 4px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.tabs button {
  border: 0; background: none;
  padding: 13px 16px 11px;
  font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------- workspace skin */
.content { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 18px 0 14px; }
.section-head h2 { font-size: 18px; font-weight: 600; }
.section-head .count { font-size: 12.5px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow .15s ease;
}
.tile:hover { box-shadow: 0 4px 16px rgba(29, 35, 43, .10); }
.tile .row { display: flex; align-items: center; gap: 12px; }
.tile .name { font-size: 15px; font-weight: 600; }
.tile .meta { font-size: 12px; color: var(--muted); }
.tile .state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.tile .state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.tile.maintenance .state::before { background: var(--warn); }
.tile .open-btn {
  margin-top: 2px;
  border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
  border-radius: 6px; padding: 8px 0;
  font-size: 13.5px; font-weight: 600;
}
.tile.maintenance .open-btn { background: #eef0f3; border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.tile .icon { flex: none; }

.appchip {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 16px;
}
.appchip .glyph {
  width: 36px; height: 36px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, #fff);
  color: var(--accent); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.appchip .name { font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------- finance skin */
.fin-layout { display: grid; grid-template-columns: 210px 1fr; min-height: calc(100vh - 56px); }
.fin-nav { background: #fff; border-right: 1px solid var(--line); padding: 18px 0; }
.fin-nav a {
  display: block; padding: 10px 22px;
  font-size: 13.5px; color: var(--muted); text-decoration: none;
}
.fin-nav a.active { color: var(--accent); font-weight: 600; border-right: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.fin-main { padding: 26px 28px 90px; max-width: 1100px; }
.fin-main h1 { font-size: 20px; margin-bottom: 4px; }
.fin-main .asof { font-size: 12.5px; color: var(--muted); margin-bottom: 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 26px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.card .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.card .v { font-size: 24px; font-weight: 650; margin-top: 6px; }
.card .d { font-size: 12px; margin-top: 4px; }
.card .d.up { color: var(--ok); }
.card .d.down { color: var(--bad); }
table.trades { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table.trades th, table.trades td { text-align: left; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
table.trades th { background: #fafbfc; color: var(--muted); font-weight: 600; font-size: 12px; }
table.trades tr:last-child td { border-bottom: 0; }
.side-buy { color: var(--ok); font-weight: 600; }
.side-sell { color: var(--bad); font-weight: 600; }

/* ---------------------------------------------------------- launch modal */
.overlay {
  position: fixed; inset: 0;
  background: rgba(20, 24, 30, .55);
  display: grid; place-items: center;
  z-index: 40;
}
.launch {
  width: 420px;
  background: #fff; border-radius: 12px;
  padding: 30px 34px;
  text-align: center;
}
.launch h3 { font-size: 16px; margin-bottom: 6px; }
.launch .sub { font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.launch .bar { height: 6px; border-radius: 3px; background: #edeff2; overflow: hidden; }
.launch .bar > div { height: 100%; width: 0%; background: var(--accent); transition: width .5s ease; }
.launch .step { margin-top: 12px; font-size: 12.5px; color: var(--muted); min-height: 17px; }

/* ---------------------------------------------------------- fake desktop */
.desktop {
  position: fixed; inset: 0; z-index: 50;
  background: linear-gradient(135deg, #0e3a5c 0%, #14547e 45%, #1b6ca0 100%);
  display: flex; flex-direction: column;
}
.viewer-bar {
  height: 34px;
  background: #171a1f; color: #cfd4da;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  font-size: 12.5px;
}
.viewer-bar .title { flex: 1; text-align: center; }
.viewer-bar button {
  background: none; border: 1px solid #3a414c; color: #cfd4da;
  border-radius: 5px; padding: 3px 10px; font-size: 12px;
}
.desk-body { flex: 1; position: relative; padding: 26px; }
.desk-icons { display: flex; flex-direction: column; gap: 22px; width: 92px; }
.desk-icon { text-align: center; color: #eaf2f8; font-size: 11.5px; cursor: default; }
.desk-icon .di {
  width: 46px; height: 46px; margin: 0 auto 6px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}
.taskbar {
  height: 44px;
  background: rgba(12, 15, 19, .92);
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  color: #d7dbe0;
}
.taskbar .start {
  width: 34px; height: 34px; border-radius: 7px;
  background: var(--accent);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
}
.taskbar .pin {
  width: 34px; height: 34px; border-radius: 7px;
  background: rgba(255, 255, 255, .07);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.taskbar .spacer { flex: 1; }
.taskbar .clock { font-size: 12.5px; text-align: right; line-height: 1.3; padding-right: 4px; }

/* ---------------------------------------------------------- evidence strip */
.evidence {
  position: fixed; right: 14px; bottom: 14px; z-index: 90;
  background: rgba(16, 19, 24, .88);
  color: #dfe3e8;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 7px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: .2px;
}
.evidence b { color: #fff; font-weight: 600; }
.ev-sep { color: #5b626c; }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.evidence.lost .ev-dot { background: var(--bad); }
.evidence.lost { color: #f2c7c2; }
body:has(.desktop) .evidence { bottom: 56px; }

.sim-label {
  position: fixed; top: 66px; right: 14px; z-index: 90;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px; letter-spacing: .6px;
  color: #8d95a1;
  background: rgba(16, 19, 24, .55);
  padding: 4px 8px; border-radius: 5px;
}
.desktop ~ .sim-label, .desktop .sim-label { color: #cfd4da; }
