@font-face {
  font-family: "Bai Jamjuree";
  src: url("/assets/BaiJamjuree-Regular.ttf") format("truetype");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Bai Jamjuree";
  src: url("/assets/BaiJamjuree-Bold.ttf") format("truetype");
  font-weight: 700 900;
  font-display: swap;
}
@font-face {
  font-family: "Genos";
  src: url("/assets/Genos-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #10110e;
  --surface: #171814;
  --surface-2: #1d1f1a;
  --line: #2b2d26;
  --text: #f5f4ee;
  --muted: #92958a;
  --accent: #f7e313;
  --twitch: #a970ff;
  --kick: #53fc18;
  font-family: "Bai Jamjuree", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 75% 0%, rgba(247, 227, 19, .055), transparent 28rem),
  var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px 20px; border-right: 1px solid var(--line); background: rgba(15,16,13,.92); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; padding: 0 8px 26px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #111; background: var(--accent); font-weight: 900; font-size: 22px; transform: skew(-8deg); box-shadow: 6px 6px 0 #33351c; }
.brand-mark.large { width: 54px; height: 54px; font-size: 34px; margin: 0 auto 24px; }
.brand strong { display: block; font-size: 18px; letter-spacing: .08em; }
.brand small { display: block; color: var(--muted); font: 500 9px/1.2 "Genos", monospace; letter-spacing: .18em; }
.nav { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; text-align: left; font-weight: 600; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--text); background: var(--surface-2); border-color: var(--line); }
.nav-item.active::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: auto; }
.nav-icon { width: 20px; font-size: 16px; text-align: center; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 18px; }
.event-mini { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.event-mini strong, .event-mini span { display: block; }
.event-mini strong { margin: 5px 0; font-size: 13px; }
.event-mini > span:last-child { color: var(--muted); font-size: 11px; }
.connection-mini { display: flex; gap: 10px; align-items: center; padding: 0 6px; }
.connection-mini strong, .connection-mini small { display: block; }
.connection-mini strong { font-size: 11px; }
.connection-mini small { color: var(--muted); font-size: 9px; }
.pulse, .live-count i, .live-pill i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #6ee7a3; box-shadow: 0 0 0 5px rgba(110,231,163,.08); }

.main { min-width: 0; padding: 0 38px 48px; }
.topbar { min-height: 98px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 3px 0 0; font-size: 21px; letter-spacing: -.03em; }
.eyebrow { margin: 0; color: var(--muted); font: 500 9px/1.2 "Genos", monospace; letter-spacing: .18em; }
.top-actions { display: flex; align-items: center; gap: 20px; }
.clock { min-width: 122px; text-align: right; }
.clock strong, .clock span { display: block; }
.clock strong { font: 500 20px/1 "Genos", monospace; }
.clock span { margin-top: 5px; color: var(--muted); font-size: 10px; text-transform: capitalize; }
.page { display: none; }
.page.active { display: block; animation: page-in .25s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }

.live-hero { position: relative; display: flex; justify-content: space-between; align-items: flex-end; min-height: 255px; padding: 44px 0 35px; overflow: hidden; }
.live-hero::after { content: "LIVE"; position: absolute; z-index: -1; right: 18%; bottom: -38px; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.035); font-size: 180px; font-weight: 900; line-height: 1; }
.live-pill { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 15px; color: var(--accent); font: 500 9px "Genos", monospace; letter-spacing: .14em; }
.live-pill i { background: var(--accent); box-shadow: 0 0 16px rgba(247,227,19,.6); }
.live-hero h2 { margin: 0; font-size: clamp(40px, 5vw, 68px); line-height: .98; letter-spacing: -.065em; }
.live-hero h2 em { color: var(--accent); font-style: normal; }
.live-hero p { margin: 18px 0 0; color: var(--muted); font-size: 13px; }
.platform-stack { display: grid; gap: 8px; width: 260px; margin-bottom: 4px; }
.platform-status { display: flex; align-items: center; gap: 11px; min-height: 54px; padding: 10px 13px; border: 1px solid var(--line); background: rgba(23,24,20,.86); border-radius: 8px; }
.platform-logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; color: #111; font-weight: 900; }
.platform-logo.twitch { background: var(--twitch); color: white; }
.platform-logo.kick { background: var(--kick); }
.platform-status div:nth-child(2) { min-width: 0; flex: 1; }
.platform-status strong, .platform-status small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.platform-status strong { font-size: 11px; }
.platform-status small { color: var(--muted); font-size: 9px; margin-top: 2px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #555; }
.status-dot.online { background: #6ee7a3; box-shadow: 0 0 8px #6ee7a3; }

.stats-grid { display: grid; grid-template-columns: 1.35fr .8fr .8fr 1fr; gap: 10px; margin-bottom: 10px; }
.stat-card { min-height: 147px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.stat-card > div:not(.progress) { display: flex; align-items: baseline; gap: 7px; margin-top: 22px; }
.stat-card strong { font: 500 34px/1 "Genos", monospace; letter-spacing: -.06em; }
.stat-card small { color: var(--muted); font-size: 10px; }
.stat-card p { margin: 10px 0 0; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-total { background: var(--accent); color: #14150f; border-color: var(--accent); }
.stat-total .stat-label, .stat-total p, .stat-total small { color: rgba(20,21,15,.62); }
.stat-total > div:not(.progress) { margin-top: 15px; }
.stat-total .progress { height: 3px; margin-top: 15px; background: rgba(20,21,15,.16); }
.stat-total .progress i { display: block; width: 0; height: 100%; background: #14150f; transition: width .5s ease; }
.stat-label, .platform-tag { font: 500 9px "Genos", monospace; letter-spacing: .15em; color: var(--muted); }
.platform-tag { padding: 4px 7px; border-radius: 4px; color: white; }
.platform-tag.twitch { background: var(--twitch); }
.platform-tag.kick { background: var(--kick); color: #111; }
.next-card { border-left: 2px solid var(--accent); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(310px, .75fr); gap: 10px; }
.panel { border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.panel-header { display: flex; justify-content: space-between; align-items: center; min-height: 72px; padding: 16px 19px; border-bottom: 1px solid var(--line); }
.panel-header h3 { margin: 4px 0 0; font-size: 15px; letter-spacing: -.02em; }
.live-count { display: flex; align-items: center; gap: 8px; color: #6ee7a3; font: 500 8px "Genos", monospace; letter-spacing: .12em; }
.live-count i { width: 5px; height: 5px; box-shadow: none; }
.icon-button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); color: var(--muted); cursor: pointer; font-size: 10px; }
.chat-columns { display: grid; grid-template-columns: 1fr 1fr; height: 455px; }
.chat-column + .chat-column { border-left: 1px solid var(--line); }
.chat-title { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 15px; border-bottom: 1px solid var(--line); }
.chat-title strong { font-size: 11px; }
.chat-title small { margin-left: auto; color: var(--muted); font-size: 8px; }
.platform-dot { width: 7px; height: 7px; border-radius: 2px; }
.platform-dot.twitch { background: var(--twitch); }
.platform-dot.kick { background: var(--kick); }
.chat-list { height: calc(100% - 44px); padding: 8px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3b3d35 transparent; }
.chat-message { padding: 8px 14px; border-left: 2px solid transparent; font-size: 11px; line-height: 1.5; animation: item-in .25s ease; }
.chat-message:hover { background: rgba(255,255,255,.025); border-left-color: var(--user-color, var(--accent)); }
.chat-message header { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.chat-message strong { color: var(--user-color); font-size: 10px; }
.chat-message time { margin-left: auto; color: #62645c; font: 8px "Genos", monospace; }
.chat-message p { margin: 0; color: #d2d3cb; overflow-wrap: anywhere; }
.empty-state { display: grid; place-items: center; height: 100%; padding: 30px; color: var(--muted); text-align: center; font-size: 10px; line-height: 1.6; }

.activity-list { height: 455px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3b3d35 transparent; }
.activity-item { display: grid; grid-template-columns: 35px 1fr auto; gap: 10px; align-items: center; min-height: 70px; padding: 11px 15px; border-bottom: 1px solid var(--line); animation: item-in .3s ease; }
@keyframes item-in { from { opacity: 0; transform: translateY(-4px); } }
.activity-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; font-size: 12px; }
.activity-icon.twitch { color: var(--twitch); }
.activity-icon.kick { color: var(--kick); }
.activity-item strong, .activity-item small { display: block; }
.activity-item strong { font-size: 10px; }
.activity-item small { margin-top: 3px; color: var(--muted); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.activity-item time { color: #62645c; font: 8px "Genos", monospace; }
.streamlabs-panel { margin-top: 10px; }
.shopify-panel { margin-top: 10px; }
.shopify-panel iframe { display: block; width: 100%; height: 220px; border: 0; background: #0b0c0a; }
.external-link { color: var(--accent); font-size: 9px; text-decoration: none; }
.external-link:hover { text-decoration: underline; }
.embed-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: 10px; padding: 10px; }
.embed-grid iframe { width: 100%; height: 180px; border: 1px solid var(--line); border-radius: 7px; background: #000; }
.muted { color: var(--muted); font-size: 9px; }

.settings-heading { display: flex; align-items: flex-end; justify-content: space-between; padding: 42px 0 28px; }
.settings-heading h2 { margin: 7px 0 6px; font-size: 34px; letter-spacing: -.05em; }
.settings-heading p, .settings-card p { margin: 0; color: var(--muted); font-size: 11px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; align-items: start; }
.settings-main { display: grid; gap: 12px; }
.settings-card { padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.settings-card > header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.settings-card > header .secondary-button { margin-left: auto; }
.settings-card h3 { margin: 0 0 4px; font-size: 14px; }
.step { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px; color: var(--accent); font: 500 9px "Genos", monospace; }
.primary-button, .secondary-button { border-radius: 7px; cursor: pointer; font-weight: 700; font-size: 10px; }
.primary-button { padding: 11px 18px; border: 1px solid var(--accent); background: var(--accent); color: #111; }
.primary-button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.secondary-button { padding: 8px 11px; border: 1px solid var(--line); background: var(--surface-2); }
.full { width: 100%; }
.connections-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.connection-card { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.connection-card .platform-logo { width: 38px; height: 38px; }
.connection-card > div:nth-child(2) { min-width: 0; flex: 1; }
.connection-card strong, .connection-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-card strong { font-size: 11px; }
.connection-card small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.connect-button { padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; background: #292b24; cursor: pointer; font-size: 8px; text-decoration: none; color: var(--text); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-grid.compact { margin-top: 16px; }
label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 600; }
input, select { width: 100%; height: 39px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: #11120f; color: var(--text); font-size: 11px; }
input[type="color"] { padding: 5px; }
.toggle-row { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; }
.toggle { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { position: relative; width: 30px; height: 17px; border-radius: 999px; background: #34362f; transition: .2s; }
.toggle i::after { content: ""; position: absolute; width: 11px; height: 11px; top: 3px; left: 3px; border-radius: 50%; background: #8d9085; transition: .2s; }
.toggle input:checked + i { background: var(--accent); }
.toggle input:checked + i::after { left: 16px; background: #111; }
.toggle span { margin: 0; color: var(--text); }
.goals-editor { display: grid; gap: 7px; }
.goal-row { display: grid; grid-template-columns: 24px 82px 1fr 31px; gap: 8px; align-items: center; }
.goal-handle { color: #5c5f55; text-align: center; cursor: grab; }
.goal-row input { height: 36px; }
.goal-delete { width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 6px; background: transparent; color: #c36d6d; cursor: pointer; }
.link-stack { display: grid; gap: 13px; }
.copy-field { display: flex; }
.copy-field input { border-radius: 6px 0 0 6px; color: #aeb0a6; font-family: "Genos", monospace; font-size: 9px; }
.copy-field button { padding: 0 13px; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: var(--surface-2); cursor: pointer; font-size: 9px; }
.settings-side label { display: block; margin-top: 15px; }
.sticky-card { position: sticky; top: 16px; }
.sticky-card > p { line-height: 1.6; margin-bottom: 6px; }
.integration-status { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.6; }

.toast { position: fixed; z-index: 20; right: 24px; bottom: 24px; max-width: 360px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 7px; background: #24261f; box-shadow: 0 16px 50px rgba(0,0,0,.35); font-size: 10px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: none; }
.login-body { display: grid; place-items: center; padding: 24px; }
.login-card { width: min(390px, 100%); padding: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.login-card h1 { margin: 7px 0; font-size: 27px; letter-spacing: -.05em; }
.login-card > p:not(.eyebrow) { margin: 0 0 25px; color: var(--muted); font-size: 11px; }
.login-card label { text-align: left; }
.login-card .primary-button { margin-top: 12px; }
.form-error { display: block; min-height: 15px; margin-top: 12px; color: #ef8b8b; font-size: 10px; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .workspace-grid { grid-template-columns: 1fr; }
  .activity-list { height: 340px; }
  .settings-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 10; top: auto; bottom: 0; width: 100%; height: 67px; flex-direction: row; align-items: center; padding: 8px 14px; border: 0; border-top: 1px solid var(--line); }
  .brand { padding: 0; }
  .brand > span:last-child, .sidebar-bottom { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .nav { display: flex; margin-left: auto; }
  .nav-item { width: auto; }
  .nav-item.active::after { display: none; }
  .main { padding: 0 16px 90px; }
  .topbar { min-height: 78px; }
  .clock span { display: none; }
  .clock { min-width: 48px; }
  .live-hero { display: block; padding-top: 34px; }
  .platform-stack { width: 100%; grid-template-columns: 1fr 1fr; margin-top: 28px; }
  .stats-grid, .connections-grid, .form-grid { grid-template-columns: 1fr 1fr; }
  .chat-columns { grid-template-columns: 1fr; height: auto; }
  .chat-column { height: 360px; }
  .chat-column + .chat-column { border-left: 0; border-top: 1px solid var(--line); }
  .settings-heading { align-items: center; }
  .settings-heading h2 { font-size: 27px; }
}
@media (max-width: 480px) {
  .stats-grid, .connections-grid, .form-grid, .platform-stack { grid-template-columns: 1fr; }
  .stats-grid { gap: 7px; }
  .stat-card { min-height: 125px; }
  .live-hero h2 { font-size: 42px; }
  .topbar h1 { font-size: 17px; }
  .goal-row { grid-template-columns: 20px 65px 1fr 31px; }
}
