:root {
  --kft-bg: #06090f;
  --kft-bg-2: #0a0f18;
  --kft-panel: #0f1622;
  --kft-panel-2: #141d2b;
  --kft-line: #2a3547;
  --kft-line-soft: rgba(255, 255, 255, 0.08);
  --kft-text: #e6edf7;
  --kft-muted: #94a3b8;
  --kft-dim: #5f6f85;
  --kft-green: #23c483;
  --kft-red: #ff5c6c;
  --kft-yellow: #f2b84b;
  --kft-blue: #58a6ff;
  --kft-violet: #8b7cf6;
  --kft-cyan: #28d7d0;
  --kft-font: Inter, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--kft-bg);
}

body.kft-page {
  margin: 0;
  min-width: 320px;
  background: var(--kft-bg);
  color: var(--kft-text);
  font-family: var(--kft-font);
  letter-spacing: 0;
}

.kft-page a {
  color: inherit;
}

.kft-shell {
  min-height: 100vh;
  background: #06090f;
}

.kft-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px 18px 16px;
  border-bottom: 1px solid var(--kft-line);
  background:
    linear-gradient(90deg, rgba(6, 9, 15, 0.96) 0%, rgba(6, 9, 15, 0.86) 54%, rgba(6, 9, 15, 0.42) 100%),
    url("/wp-content/uploads/2026/06/coin-finance-terminal-001-bitcoin-market-terminal.jpg") center right / cover no-repeat;
}

.kft-eyebrow {
  margin: 0 0 8px;
  color: var(--kft-cyan);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.kft-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 4vw, 62px);
  line-height: 1.02;
  letter-spacing: 0;
}

.kft-hero h1 .highlight {
  color: var(--kft-yellow);
}

.kft-hero-lead {
  max-width: 980px;
  margin: 14px 0 0;
  color: var(--kft-muted);
  font-size: 16px;
  line-height: 1.75;
}

.kft-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.kft-hero-status {
  display: grid;
  gap: 10px;
}

.kft-hero-status > div {
  padding: 14px;
  background: rgba(15, 22, 34, 0.86);
  border: 1px solid var(--kft-line);
  border-radius: 8px;
}

.kft-hero-status span {
  display: block;
  color: var(--kft-dim);
  font-size: 11px;
  font-weight: 800;
}

.kft-hero-status strong {
  display: block;
  margin-top: 5px;
  color: #fff;
  font-size: 14px;
}

.kft-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--kft-line);
  border-radius: 6px;
  background: #121b29;
  color: var(--kft-text);
  font: 800 12px var(--kft-font);
  text-decoration: none;
  cursor: pointer;
}

.kft-btn:hover,
.kft-global-nav button:hover,
.kft-tabs button:hover {
  border-color: var(--kft-blue);
  color: #fff;
}

.kft-btn-primary {
  border-color: rgba(35, 196, 131, 0.7);
  background: linear-gradient(180deg, #1aa875, #127b58);
  color: #06120d;
}

.kft-terminal {
  max-width: 1920px;
  margin: 0 auto;
  border-top: 1px solid var(--kft-line-soft);
}

.kft-topbar {
  display: grid;
  grid-template-columns: auto auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  background: #05070b;
  border-bottom: 1px solid var(--kft-line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.kft-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.kft-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #f2b84b;
  color: #0a0f18;
  font-size: 11px;
}

.kft-global-nav {
  display: flex;
  gap: 4px;
}

.kft-global-nav button,
.kft-tabs button,
.kft-command button,
.kft-ai-button,
.kft-widget header button,
.kft-range-row button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--kft-muted);
  font: 800 11px var(--kft-font);
  cursor: pointer;
}

.kft-global-nav button {
  height: 30px;
  padding: 0 9px;
  border-radius: 5px;
}

.kft-command {
  display: grid;
  grid-template-columns: 1fr 32px;
  min-width: 0;
  border: 1px solid var(--kft-line);
  border-radius: 6px;
  background: #0c111a;
}

.kft-command input,
.kft-inline-controls input,
.kft-inline-controls select,
.kft-widget textarea,
.kft-order-form input,
.kft-order-form select,
.kft-chart-widget select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--kft-line);
  border-radius: 5px;
  background: #070b11;
  color: var(--kft-text);
  font: 700 12px var(--kft-font);
  outline: none;
}

.kft-command input {
  height: 32px;
  border: 0;
  padding: 0 10px;
  background: transparent;
}

.kft-command button {
  color: var(--kft-blue);
}

.kft-ai-button {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  background: #242063;
  color: #fff;
  white-space: nowrap;
}

.kft-connection {
  min-width: 84px;
  color: var(--kft-green);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.kft-index-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(118px, 1fr));
  overflow-x: auto;
  background: #070a0f;
  border-bottom: 1px solid var(--kft-line);
}

.kft-strip-card {
  min-height: 58px;
  padding: 8px 10px;
  border-right: 1px solid var(--kft-line);
}

.kft-strip-card span,
.kft-strip-card em {
  display: block;
  color: var(--kft-dim);
  font-size: 10px;
  font-style: normal;
}

.kft-strip-card strong {
  display: block;
  margin: 3px 0;
  color: #fff;
  font-size: 14px;
}

.kft-strip-card.up em {
  color: var(--kft-green);
}

.kft-strip-card.down em {
  color: var(--kft-red);
}

.kft-tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 6px 8px;
  background: #080d14;
  border-bottom: 1px solid var(--kft-line);
}

.kft-tabs button {
  min-width: 72px;
  height: 30px;
  border-radius: 5px;
  background: #0f1622;
}

.kft-tabs button[aria-selected="true"] {
  color: #fff;
  border-color: var(--kft-blue);
  background: #162338;
}

.kft-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 320px) 7px minmax(360px, 1fr) 7px minmax(280px, 360px);
  min-height: 850px;
  height: min(1120px, calc(100vh + 320px));
  overflow: hidden;
}

.kft-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow: auto;
  background: var(--kft-bg-2);
}

.kft-center-panel {
  background: #080d14;
}

.kft-splitter {
  background: #04060a;
  border-left: 1px solid var(--kft-line);
  border-right: 1px solid var(--kft-line);
  cursor: col-resize;
}

.kft-widget,
.kft-tab-page {
  min-width: 230px;
  min-height: 108px;
  padding: 10px;
  border: 1px solid var(--kft-line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(20, 29, 43, 0.95), rgba(12, 17, 26, 0.96));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
  overflow: auto;
}

.kft-widget {
  resize: both;
}

.kft-widget.dragging {
  opacity: 0.55;
  outline: 1px solid var(--kft-cyan);
}

.kft-widget header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  margin-bottom: 8px;
  cursor: grab;
}

.kft-widget header h2,
.kft-tab-page h2,
.kft-doc-strip h2 {
  margin: 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
}

.kft-widget header span,
.kft-widget header button {
  flex: 0 0 auto;
  color: var(--kft-muted);
  font-size: 10px;
}

.kft-widget header button {
  padding: 5px 7px;
  border: 1px solid var(--kft-line);
  border-radius: 5px;
  background: #0b111a;
}

.kft-pulse-gauge {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  margin: 4px auto 12px;
  border: 10px solid rgba(35, 196, 131, 0.24);
  border-top-color: var(--kft-green);
  border-radius: 999px;
  color: var(--kft-green);
  font-weight: 900;
}

.kft-mini-bars {
  display: grid;
  gap: 6px;
}

.kft-mini-bar {
  display: grid;
  grid-template-columns: 88px 1fr 48px;
  align-items: center;
  gap: 8px;
  color: var(--kft-muted);
  font-size: 11px;
}

.kft-mini-bar i {
  display: block;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--kft-red), var(--kft-yellow), var(--kft-green));
}

.kft-inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.kft-inline-controls input,
.kft-inline-controls select,
.kft-chart-widget select {
  height: 30px;
  padding: 0 8px;
}

.kft-inline-controls button {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--kft-line);
  border-radius: 5px;
  background: #111927;
  color: var(--kft-text);
  font: 800 11px var(--kft-font);
  cursor: pointer;
}

.kft-widget textarea {
  display: block;
  width: 100%;
  padding: 8px;
  resize: vertical;
  line-height: 1.45;
}

.kft-watchlist,
.kft-market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.kft-market-tile,
.kft-list-item,
.kft-news-item {
  border: 1px solid var(--kft-line-soft);
  border-radius: 6px;
  background: rgba(5, 8, 13, 0.56);
}

.kft-market-tile {
  padding: 8px;
}

.kft-market-tile span,
.kft-list-item span,
.kft-news-item span {
  display: block;
  color: var(--kft-dim);
  font-size: 10px;
}

.kft-market-tile strong {
  display: block;
  margin: 5px 0;
  color: #fff;
  font-size: 15px;
}

.kft-market-tile em {
  font-style: normal;
  font-size: 11px;
}

.kft-market-tile.up em {
  color: var(--kft-green);
}

.kft-market-tile.down em {
  color: var(--kft-red);
}

.kft-chart-widget {
  min-height: 520px;
}

.kft-range-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.kft-range-row button {
  min-width: 42px;
  height: 26px;
  border: 1px solid var(--kft-line);
  border-radius: 5px;
  background: #0b111a;
}

.kft-range-row button.active {
  color: #06120d;
  background: var(--kft-green);
}

.kft-chart-wrap {
  position: relative;
  min-height: 410px;
  border: 1px solid var(--kft-line-soft);
  border-radius: 8px;
  background: #05080d;
  overflow: hidden;
}

.kft-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 410px;
}

.kft-chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--kft-muted);
  background: rgba(5, 8, 13, 0.74);
  font-size: 13px;
}

.kft-chart-empty.is-hidden {
  display: none;
}

.kft-indicator-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.kft-indicator-row span {
  padding: 5px 7px;
  border: 1px solid var(--kft-line);
  border-radius: 5px;
  color: var(--kft-muted);
  font-size: 10px;
}

.kft-tab-page {
  display: none;
  resize: vertical;
}

.kft-tab-page.active {
  display: block;
}

.kft-tab-page p,
.kft-doc-strip p {
  margin: 8px 0 0;
  color: var(--kft-muted);
  font-size: 13px;
  line-height: 1.7;
}

.kft-order-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.kft-order-form label {
  display: grid;
  gap: 4px;
  color: var(--kft-muted);
  font-size: 10px;
}

.kft-order-form input,
.kft-order-form select {
  height: 30px;
  padding: 0 8px;
}

.kft-order-form button {
  grid-column: 1 / -1;
}

.kft-paper-badge {
  padding: 4px 7px;
  border-radius: 5px;
  background: rgba(242, 184, 75, 0.16);
  color: var(--kft-yellow) !important;
}

.kft-list,
.kft-news-list,
.kft-ai-output {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--kft-muted);
  font-size: 12px;
  line-height: 1.55;
}

.kft-list-item {
  padding: 8px;
}

.kft-list-item strong,
.kft-news-item strong {
  display: block;
  color: #fff;
  font-size: 12px;
}

.kft-news-item {
  padding: 9px;
}

.kft-news-item p {
  margin: 5px 0 0;
  color: var(--kft-muted);
  font-size: 11px;
  line-height: 1.55;
}

.kft-news-item a {
  display: inline-block;
  margin-top: 6px;
  color: var(--kft-blue);
  font-size: 11px;
  text-decoration: none;
}

.kft-ai-output {
  min-height: 88px;
  padding: 9px;
  border: 1px solid var(--kft-line-soft);
  border-radius: 6px;
  background: #05080d;
  white-space: pre-wrap;
}

.kft-doc-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 1680px;
  margin: 0 auto;
  padding: 14px 18px 28px;
}

.kft-doc-strip article {
  padding: 14px;
  border: 1px solid var(--kft-line);
  border-radius: 8px;
  background: rgba(15, 22, 34, 0.8);
}

.kft-big-mode .kft-right-panel {
  position: fixed;
  inset: 64px 18px 18px;
  z-index: 50;
  background: #06090f;
  border: 1px solid var(--kft-blue);
  border-radius: 8px;
}

.kft-big-mode .kft-right-panel [data-widget-id="portfolio"] {
  min-height: calc(100vh - 132px);
}

.kft-big-mode [data-kft-portfolio-chart] {
  width: 100%;
  height: 520px;
}

@media (max-width: 1180px) {
  .kft-hero {
    grid-template-columns: 1fr;
  }

  .kft-topbar {
    grid-template-columns: 1fr;
    position: relative;
  }

  .kft-global-nav,
  .kft-hero-actions {
    overflow-x: auto;
  }

  .kft-workspace {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .kft-splitter {
    display: none;
  }

  .kft-panel {
    max-height: none;
    overflow: visible;
  }

  .kft-doc-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kft-hero {
    padding: 18px 12px 12px;
  }

  .kft-hero h1 {
    font-size: 34px;
  }

  .kft-index-strip {
    grid-template-columns: repeat(8, 132px);
  }

  .kft-order-form,
  .kft-inline-controls {
    grid-template-columns: 1fr;
  }

  .kft-widget {
    resize: vertical;
  }
}
