:root {
  color-scheme: dark;
  --bg: #101315;
  --surface: #171c20;
  --surface-2: #20272d;
  --line: #303a42;
  --text: #eef4f6;
  --muted: #91a0a9;
  --accent: #2dd4bf;
  --accent-2: #f6c453;
  --danger: #ff6b6b;
  --ok: #82e093;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 8%, rgba(45, 212, 191, 0.18), transparent 24rem),
    linear-gradient(135deg, #0f1314 0%, #15181c 45%, #111417 100%);
  color: var(--text);
  display: grid;
  grid-template-columns: 280px 1fr;
}

body.auth-locked {
  overflow: hidden;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 50% 20%, rgba(45, 212, 191, 0.22), transparent 30rem),
    rgba(8, 11, 12, 0.94);
  backdrop-filter: blur(18px);
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  width: min(460px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 28, 32, 0.96);
  box-shadow: var(--shadow);
  padding: 24px;
}

.auth-brand {
  margin-bottom: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.auth-tab {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111619;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.auth-tab.active {
  color: #06100f;
  background: var(--accent);
  border-color: var(--accent);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-note {
  color: var(--muted);
  margin: 16px 0 0;
  line-height: 1.4;
}

.account-btn {
  width: 100%;
  margin-top: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

a {
  color: inherit;
  overflow-wrap: anywhere;
}

.sidebar {
  min-height: 100vh;
  padding: 28px;
  border-right: 1px solid var(--line);
  background: rgba(14, 17, 19, 0.78);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #4f8cff);
  color: #081010;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-note p,
.eyebrow,
td,
textarea::placeholder,
input::placeholder {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
}

.nav a.active,
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.sidebar-note {
  margin-top: 34px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.mobile-dock {
  display: none;
}

.sidebar-note span,
.status-pill {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.app {
  padding: 30px;
  display: grid;
  gap: 22px;
}

.topbar,
.panel-header,
.metrics,
.workspace,
.tracker-form,
.market-form,
.jarvis-controls,
.trend-form,
.trend-grid {
  display: grid;
  gap: 16px;
}

.topbar,
.panel-header {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.topbar .primary-btn,
.panel-header .secondary-btn {
  justify-self: end;
}

.eyebrow {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(34px, 5vw, 58px);
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.primary-btn,
.secondary-btn {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 800;
}

.primary-btn {
  background: var(--accent);
  color: #07110f;
}

.secondary-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metrics article,
.panel {
  border: 1px solid var(--line);
  background: rgba(23, 28, 32, 0.88);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metrics article {
  padding: 18px;
}

.metrics span {
  color: var(--muted);
  display: block;
  margin-bottom: 10px;
}

.metrics strong {
  font-size: 30px;
}

.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  align-items: start;
}

.panel {
  padding: 22px;
  min-width: 0;
  overflow: hidden;
}

.tracker-form {
  grid-template-columns: 180px minmax(280px, 1fr) 140px 140px;
  grid-template-areas:
    "market url current target"
    "checks checks submit submit";
  margin: 20px 0;
  align-items: end;
}

.tracker-form label:nth-of-type(1) {
  grid-area: market;
}

.tracker-form label:nth-of-type(2) {
  grid-area: url;
}

.tracker-form label:nth-of-type(3) {
  grid-area: current;
}

.tracker-form label:nth-of-type(4) {
  grid-area: target;
}

.tracker-form label:nth-of-type(5) {
  grid-area: checks;
}

.tracker-form .primary-btn {
  grid-area: submit;
  width: 100%;
}

.market-form {
  grid-template-columns: 150px minmax(180px, 1fr) 150px 150px 170px auto;
  margin: 20px 0;
  align-items: end;
}

.market-form .primary-btn {
  width: 100%;
}

.asset-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.asset-card {
  min-height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111619;
  color: var(--text);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}

.asset-card:hover {
  border-color: var(--accent);
}

.asset-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.asset-card strong,
.asset-card b {
  overflow-wrap: anywhere;
}

.asset-card small {
  color: var(--muted);
}

.forex-advisor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111619;
  padding: 18px;
  margin: 0 0 18px;
}

.jarvis-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #06100f;
  font-size: 24px;
  font-weight: 1000;
  cursor: pointer;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.42);
}

.jarvis-drawer {
  position: fixed;
  right: 24px;
  bottom: 92px;
  z-index: 29;
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 130px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 22, 25, 0.98);
  box-shadow: var(--shadow);
  padding: 18px;
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.jarvis-drawer.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.compact-header {
  margin-bottom: 14px;
}

.forex-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.advice-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface);
}

.advice-result p {
  color: var(--muted);
  margin: 8px 0;
}

.advice-result > small {
  color: var(--accent-2);
  display: block;
  margin-top: 12px;
  font-weight: 900;
}

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.advice-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #0f1417;
}

.advice-grid span,
.advice-grid small {
  color: var(--muted);
}

.advice-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.advice-grid p {
  margin: 8px 0;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  min-width: 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111619;
  color: var(--text);
  padding: 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--text);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status.waiting {
  background: rgba(246, 196, 83, 0.16);
  color: var(--accent-2);
}

.status.hit {
  background: rgba(130, 224, 147, 0.15);
  color: var(--ok);
}

.status.high {
  background: rgba(255, 107, 107, 0.13);
  color: var(--danger);
}

.status.scanning {
  background: rgba(79, 140, 255, 0.15);
  color: #8cb7ff;
}

.jarvis-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 8px;
  background: #111619;
  border: 1px solid var(--line);
}

.jarvis-result p:last-child {
  margin-bottom: 0;
}

.jarvis-controls {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 18px 0 14px;
}

.product-link,
.best-link,
.card-link,
.result-list a {
  color: var(--accent);
  text-decoration: none;
}

.product-link:hover,
.best-link:hover,
.card-link:hover,
.result-list a:hover {
  text-decoration: underline;
}

.inline-price {
  width: 118px;
  min-height: 38px;
  padding: 8px 10px;
}

td small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
  font-size: 12px;
}

.scan-plan {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.11);
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
}

.scan-note {
  color: var(--muted);
  max-width: 180px;
}

.analysis-note {
  max-width: 260px;
  line-height: 1.35;
}

.positive {
  color: var(--ok);
}

.negative {
  color: var(--danger);
}

.actions {
  white-space: nowrap;
}

.mini-btn {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  padding: 0 10px;
  cursor: pointer;
  margin-right: 6px;
}

.empty-row {
  text-align: center;
  padding: 34px 12px;
}

.best-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(45, 212, 191, 0.38);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.09);
  margin: 8px 0 14px;
  font-weight: 900;
}

.result-list,
.product-result-list {
  display: grid;
  gap: 8px;
}

.query-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 12px;
}

.query-chips span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.result-list a,
.product-result-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-result-card span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.product-result-card strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.product-result-card small {
  color: var(--muted);
}

.product-result-card b {
  color: var(--accent);
  white-space: nowrap;
}

.dropshipping {
  margin-bottom: 24px;
}

.markets {
  margin-bottom: 0;
}

.trend-form {
  grid-template-columns: minmax(220px, 1fr) 180px 220px;
  margin-top: 18px;
}

.trend-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.trend-card {
  padding: 18px;
  border-radius: 8px;
  background: #111619;
  border: 1px solid var(--line);
}

.trend-card strong {
  display: block;
  margin-bottom: 10px;
}

.trend-card > small {
  display: block;
  min-height: 38px;
  color: var(--muted);
  line-height: 1.45;
}

.trend-card dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin: 16px 0 0;
}

.trend-card dt {
  color: var(--muted);
}

.trend-card dd {
  margin: 0;
  font-weight: 800;
}

.card-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-top: 18px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.28);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 92px;
  bottom: 24px;
  background: var(--accent);
  color: #06100f;
  border-radius: 8px;
  padding: 14px 18px;
  font-weight: 900;
  transform: translateY(120px);
  transition: 220ms ease;
}

.toast.show {
  transform: translateY(0);
}

@media (max-width: 1500px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  }

  .tracker-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "market url"
      "current target"
      "checks submit";
  }

  .market-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .forex-form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) {
  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: 22px;
  }

  .sidebar-note {
    margin-top: 22px;
  }

  .workspace,
  .metrics,
  .trend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracker-form,
  .market-form,
  .forex-form,
  .trend-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tracker-form {
    grid-template-areas:
      "market url"
      "current target"
      "checks submit";
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 82px;
  }

  .app,
  .sidebar {
    padding: 18px;
  }

  .sidebar {
    display: block;
    padding-bottom: 12px;
  }

  .sidebar .nav {
    display: none;
  }

  .mobile-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(45, 212, 191, 0.24);
    border-radius: 14px;
    background: rgba(17, 22, 25, 0.96);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(16px);
  }

  .mobile-dock a {
    display: grid;
    min-height: 42px;
    place-items: center;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
  }

  .mobile-dock a:hover,
  .mobile-dock a:focus {
    background: rgba(45, 212, 191, 0.12);
    color: var(--accent);
  }

  .brand,
  .brand > div:last-child {
    min-width: 0;
  }

  .brand strong,
  .brand span {
    overflow-wrap: anywhere;
  }

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

  .nav a {
    min-height: 44px;
    display: grid;
    place-items: center;
    padding: 10px;
    text-align: center;
  }

  .topbar,
  .panel-header,
  .workspace,
  .trend-grid,
  .jarvis-controls,
  .trend-form,
  .market-form,
  .forex-form,
  .tracker-form {
    grid-template-columns: 1fr;
  }

  .topbar .primary-btn,
  .panel-header .secondary-btn {
    justify-self: stretch;
  }

  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 20px;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .metrics article,
  .panel {
    padding: 16px;
  }

  .status-pill {
    justify-self: start;
  }

  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .tracker-form {
    grid-template-areas:
      "market"
      "url"
      "current"
      "target"
      "checks"
      "submit";
  }

  .asset-picker {
    grid-template-columns: 1fr;
    max-height: 260px;
    padding-right: 0;
  }

  .asset-card,
  .result-list a,
  .product-result-card {
    grid-template-columns: 1fr;
  }

  .product-result-card b {
    white-space: normal;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #111619;
  }

  td {
    display: grid;
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  td:last-child {
    border-bottom: 0;
  }

  #alerts td:nth-child(1)::before { content: "Urun"; }
  #alerts td:nth-child(2)::before { content: "Pazar"; }
  #alerts td:nth-child(3)::before { content: "Fiyat"; }
  #alerts td:nth-child(4)::before { content: "Hedef"; }
  #alerts td:nth-child(5)::before { content: "Kontrol"; }
  #alerts td:nth-child(6)::before { content: "Durum"; }
  #alerts td:nth-child(7)::before { content: "Islem"; }

  #markets td:nth-child(1)::before { content: "Varlik"; }
  #markets td:nth-child(2)::before { content: "Tip"; }
  #markets td:nth-child(3)::before { content: "Fiyat"; }
  #markets td:nth-child(4)::before { content: "Alarm"; }
  #markets td:nth-child(5)::before { content: "Yon"; }
  #markets td:nth-child(6)::before { content: "Durum"; }
  #markets td:nth-child(7)::before { content: "Islem"; }

  td::before {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .empty-row {
    display: block;
    text-align: center;
  }

  .empty-row::before {
    content: "";
    display: none;
  }

  .inline-price {
    width: 100%;
  }

  .jarvis-float {
    right: 18px;
    bottom: 78px;
  }

  .jarvis-drawer {
    left: 12px;
    right: 12px;
    bottom: 148px;
    width: auto;
    max-height: calc(100vh - 176px);
    padding: 16px;
  }

  .toast {
    right: 18px;
    left: 18px;
    bottom: 148px;
  }
}

@media (max-width: 480px) {
  .app,
  .sidebar {
    padding: 14px;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-tabs,
  .nav,
  .metrics {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 32px;
  }

  .metrics strong {
    font-size: 26px;
  }

  .jarvis-float {
    right: 14px;
    bottom: 76px;
    width: 52px;
    height: 52px;
  }

  .jarvis-drawer {
    left: 10px;
    right: 10px;
    bottom: 144px;
  }

  .toast {
    left: 12px;
    right: 12px;
    bottom: 142px;
  }
}
