/* Zobet AI — visual system modelled on commas.com
   Light, calm, product-first. Inter / Inter Display, near-black type on
   white and warm off-white surfaces, pale-blue app tint, blue gradient
   primary action, soft 12–20px radii, hairline borders. */

:root {
  --ink: #141414;
  --ink-2: #1a1a1a;
  --text: #141414;
  --muted: #6b6b6b;
  --muted-2: #9a9a9a;
  --bg: #ffffff;
  --bg-app: #f3f7fd;            /* pale blue app canvas (rgba(136,192,253,.1) on white) */
  --surface: #ffffff;
  --surface-2: #f6f5f3;          /* warm off-white panels */
  --line: #e6e5e2;
  --line-2: #dedddb;
  --blue: #2e78ef;
  --blue-2: #88c0fd;
  --blue-soft: #eaf3ff;
  --blue-text: #1f5fd0;
  --green: #1f9d55;
  --green-soft: #e6f6ec;
  --red: #d63b3b;
  --red-soft: #fdecec;
  --amber: #b7791f;
  --amber-soft: #fff5e0;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(0,0,0,.05);
  --shadow-2: 0 8px 24px rgba(20,20,20,.06);
  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Display", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-app);
  color: var(--text);
  font: 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01";
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ---- top bar ---------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255,255,255,.75);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  letter-spacing: -0.02em; color: var(--ink); text-decoration: none;
}
.brand .mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: linear-gradient(135deg, var(--blue-2), var(--blue));
  box-shadow: inset 1px 1px 1px rgba(255,255,255,.5), inset -1px -1px 1px rgba(28,72,143,.4);
  display: inline-block;
}
.brand b { font-weight: inherit; }
.brand span { color: var(--blue); font-weight: 500; }
.topright { display: flex; align-items: center; gap: 12px; }

/* ---- layout ------------------------------------------------------------ */
.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 28px 20px 40px; flex: 1; }
.narrow { max-width: 440px; margin: 40px auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-1);
}
.card.stale { opacity: .6; }

h1 {
  font-family: var(--font-display); font-weight: 500; font-size: 28px;
  letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 8px; color: var(--ink);
}
h2 { font-family: var(--font-display); font-weight: 500; font-size: 20px; letter-spacing: -0.02em; margin-bottom: 8px; }
p { color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }
.label {
  color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .02em;
  margin-bottom: 4px;
}
.big { font-family: var(--font-display); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-soft); color: var(--blue-text);
  border-radius: var(--radius-pill); padding: 4px 10px;
  font-size: 12.5px; font-weight: 500; margin-bottom: 12px;
}

/* ---- forms --------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=file] {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  color: var(--text); padding: 11px 12px; font: 15px var(--font); width: 100%;
  box-shadow: var(--shadow-1); transition: border-color .12s, box-shadow .12s;
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(46,120,239,.18); }
input::placeholder { color: var(--muted-2); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 0 16px; height: 40px; font: 500 14.5px var(--font);
  cursor: pointer; box-shadow: var(--shadow-1); transition: background .12s, transform .05s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  color: #fff; border: 0;
  background-image: linear-gradient(180deg, var(--blue-2) 0%, var(--blue) 100%);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), inset -1px -1px 1px rgba(28,72,143,.5), inset 1px 1px 1px rgba(255,255,255,.5);
  font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.04); background-image: linear-gradient(180deg, var(--blue-2) 0%, var(--blue) 100%); }
.btn.danger { color: var(--red); border-color: #f3c9c9; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: rgba(255,255,255,.6); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---- status ------------------------------------------------------------- */
.status-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--radius-pill); font-weight: 600;
  font-size: 12.5px; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.LIVE { color: var(--green); background: var(--green-soft); border-color: #cdebd8; }
.pill.PAUSED, .pill.CONNECTING { color: var(--amber); background: var(--amber-soft); border-color: #f1dfb4; }
.pill.ERROR, .pill.KILLED { color: var(--red); background: var(--red-soft); border-color: #f3c9c9; }
.pill.DISCONNECTED { color: var(--muted); }

.error { color: var(--red); font-size: 13.5px; }
.ok { color: var(--green); font-size: 13.5px; }
.fieldnote { color: var(--muted); font-size: 12.5px; line-height: 1.45; font-weight: 400; }
.fieldnote.warn { color: var(--amber); font-weight: 500; }

.checklist { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.check {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 10px 12px 10px 36px; font-size: 13.5px; position: relative;
}
.check::before {
  content: ""; position: absolute; left: 12px; top: 13px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--blue-soft);
  background-image: linear-gradient(45deg, transparent 45%, var(--blue-text) 45%, var(--blue-text) 55%, transparent 55%);
}
.check::before { background-image: none; box-shadow: inset 0 0 0 2px var(--blue-2); }
.clickwrap { flex-direction: row; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 400; color: var(--muted); }
.clickwrap input { margin-top: 3px; width: auto; accent-color: var(--blue); }

/* ---- live window ------------------------------------------------------- */
.countdown-row { display: flex; align-items: center; gap: 10px; }
.countdown { font-family: var(--font-display); font-size: 30px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.phase {
  padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; letter-spacing: .03em;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.phase.OPEN { color: var(--green); background: var(--green-soft); border-color: #cdebd8; }
.phase.MID { color: var(--blue-text); background: var(--blue-soft); border-color: #cfe1fb; }
.phase.LATE { color: var(--amber); background: var(--amber-soft); border-color: #f1dfb4; }
.phase.NOTRADE { color: var(--red); background: var(--red-soft); border-color: #f3c9c9; }
.window-grid { margin-top: 14px; }
.window-grid .mono { font-size: 14px; font-weight: 500; }
.mono.BUY_UP { color: var(--green); }
.mono.BUY_DOWN { color: var(--red); }
.mono.NO_TRADE { color: var(--muted); }

/* ---- tiles + charts ---------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 720px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; min-height: 76px;
}
.tile-v { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; }

.chartwrap { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; }
.chartwrap svg { width: 100%; height: 200px; display: block; }
.daily-bars { display: flex; align-items: flex-end; gap: 4px; height: 76px; overflow-x: auto; padding: 8px 4px 0; }
.dbar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 18px; flex: 1; height: 100%; }
.dbar-fill { width: 100%; border-radius: 4px 4px 2px 2px; }
.dbar-fill.pos { background: var(--green); }
.dbar-fill.neg { background: var(--red); opacity: .85; }
.dbar-label { font-size: 9.5px; color: var(--muted-2); margin-top: 4px; white-space: nowrap; }

/* ---- activity tape ------------------------------------------------------ */
.tape { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.tape-row {
  display: flex; gap: 10px; padding: 8px 10px; background: var(--surface-2);
  border-radius: 10px; font-size: 13px; align-items: baseline;
}
.tape-row .t { color: var(--muted-2); white-space: nowrap; font-family: var(--mono); font-size: 12px; }
.tape-row .a { font-weight: 600; white-space: nowrap; font-size: 12px; }
.tape-row .a.BUY_UP { color: var(--green); }
.tape-row .a.BUY_DOWN { color: var(--red); }
.tape-row .a.NO_TRADE { color: var(--muted); }
.tape-row .r { color: var(--text); }
.tape-row.error .r { color: var(--red); }
.tape-row.order .r { color: var(--blue-text); font-weight: 500; }
.toggle { flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 400; }
.toggle input { width: auto; accent-color: var(--blue); }

.settings { margin-top: 14px; }
.settings summary { cursor: pointer; color: var(--blue-text); font-size: 13.5px; font-weight: 500; }

/* ---- tables --------------------------------------------------------------- */
.tablewrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--surface-2); }
tbody tr:hover td { background: #fafafa; }
td.dir.BUY_UP { color: var(--green); font-weight: 600; }
td.dir.BUY_DOWN { color: var(--red); font-weight: 600; }
td.res.WIN { color: var(--green); font-weight: 600; }
td.res.LOSS { color: var(--red); font-weight: 600; }
td.res.OPEN { color: var(--blue-text); }
td.res.FAILED, td.res.UNKNOWN { color: var(--muted); }

/* ---- footer ------------------------------------------------------------- */
.foot { padding: 20px 20px 28px; border-top: 1px solid var(--line); background: var(--surface); }
.disclaimer, .support { color: var(--muted); font-size: 12px; max-width: 880px; margin: 0 auto 6px; }
