* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #070b14;
  color: #e7edf8;
  line-height: 1.4;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: rgba(8, 12, 19, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #f0b90b, #ff6b57);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.8rem;
  color: rgba(231, 237, 250, 0.7);
  margin-top: 0.1rem;
}

.topnav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-left: 2rem;
}

.nav-item {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  color: rgba(231, 237, 250, 0.75);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.status .label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(231, 237, 250, 0.7);
}

.main-container {
  display: grid;
  gap: 1.25rem;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.layout {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.25rem;
}

.panel {
  display: grid;
  gap: 1.25rem;
}

.side {
  display: grid;
  gap: 1.25rem;
}

.panel-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.025);
  min-height: 160px;
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  color: rgba(231, 237, 250, 0.7);
}

.panel-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.panel-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s ease;
  cursor: pointer;
}

.panel-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.panel-item span {
  font-size: 0.85rem;
}

.panel-item .symbol {
  font-weight: 700;
  font-size: 0.95rem;
}

.panel-item .value {
  font-weight: 600;
  color: rgba(231, 237, 250, 0.85);
}

.table-header {
  margin-top: 1rem;
}

.table-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.table-sub {
  font-size: 0.85rem;
  color: rgba(231, 237, 250, 0.65);
  margin-bottom: 1rem;
}

.search-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.search-row input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.3);
  color: #e7edf8;
}

.search-row input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
}

.table-wrapper {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}

.coin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 720px;
}

.coin-table thead {
  background: rgba(255, 255, 255, 0.06);
}

.coin-table th,
.coin-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.coin-table th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: rgba(231, 237, 250, 0.7);
  letter-spacing: 0.08em;
  text-align: left;
}

.coin-table td {
  color: rgba(231, 237, 250, 0.9);
}

.coin-table tr:hover {
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.coin-table tr.active {
  background: rgba(34, 194, 129, 0.15);
}

.coin-table td.right {
  text-align: right;
}

.coin-table td.name {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.coin-table td.name .icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.status-buy {
  background: rgba(34, 194, 129, 0.15);
  color: #21e88f;
  border: 1px solid rgba(34, 194, 129, 0.35);
}

.status-sell {
  background: rgba(248, 115, 115, 0.15);
  color: #ff7070;
  border: 1px solid rgba(248, 115, 115, 0.35);
}

.status-hold {
  background: rgba(255, 229, 89, 0.18);
  color: #ffe16b;
  border: 1px solid rgba(255, 229, 89, 0.35);
}

.chart-container {
  position: relative;
  height: 260px;
  width: 100%;
}

pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  max-height: 250px;
  overflow: auto;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feed {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.feed li {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.3;
}

.feed li:last-child {
  border-bottom: none;
}

.confidence {
  margin: 0.3rem 0 0;
  color: rgba(231, 237, 250, 0.7);
  font-size: 0.9rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-top: 0.75rem;
}

.ai-toggle {
  display: flex;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .topnav {
    display: none;
  }

  .main-container {
    padding: 1rem;
  }
}

.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  z-index: 80;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(980px, 95vw);
  max-height: 90vh;
  border-radius: 18px;
  background: rgba(10, 14, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal .chart-container {
  flex: 1;
  min-height: 320px;
}

.modal .pill {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.label {
  margin: 0;
  color: rgba(231, 237, 250, 0.65);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#symbol,
#price,
#change,
#signal {
  font-size: 1.6rem;
  margin: 0.35rem 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.status-buy {
  background: rgba(34, 194, 129, 0.15);
  color: #21e88f;
  border: 1px solid rgba(34, 194, 129, 0.35);
}

.status-sell {
  background: rgba(248, 115, 115, 0.15);
  color: #ff7070;
  border: 1px solid rgba(248, 115, 115, 0.35);
}

.status-hold {
  background: rgba(255, 229, 89, 0.18);
  color: #ffe16b;
  border: 1px solid rgba(255, 229, 89, 0.35);
}

#advice {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

pre {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  max-height: 250px;
  overflow: auto;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.feed {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.feed li {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  line-height: 1.3;
}

.feed li:last-child {
  border-bottom: none;
}

.confidence {
  margin: 0.3rem 0 0;
  color: rgba(231, 237, 250, 0.7);
  font-size: 0.9rem;
}

@media (max-width: 680px) {
  main {
    padding: 1rem 1rem 2rem;
  }

  .discover-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .discover-row input,
  .discover-row button {
    width: 100%;
  }
}

.discover-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.discover-meta {
  margin: 0.15rem 0 0;
  color: rgba(231, 237, 250, 0.6);
  font-size: 0.85rem;
}

.chart-container {
  width: 100%;
  max-width: 900px;
  height: 260px;
  margin: 0 auto;
}

#priceChart {
  width: 100% !important;
  height: 100% !important;
  max-height: 320px;
}

.discover-desc {
  margin: 0.35rem 0 0;
  color: rgba(231, 237, 250, 0.65);
  font-size: 0.9rem;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(231, 237, 250, 0.75);
  font-weight: 600;
}

tbody tr {
  cursor: pointer;
  transition: background 0.2s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.05);
}

tbody tr.active {
  background: rgba(47, 143, 255, 0.15);
}

td {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

input {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: #e7edf8;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

button {
  border: none;
  cursor: pointer;
  background: rgba(47, 143, 255, 0.18);
  color: #e7edf8;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.2s ease;
}

button:hover {
  background: rgba(47, 143, 255, 0.28);
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(47, 143, 255, 0.18);
  color: rgba(47, 143, 255, 0.9);
  margin-left: 0.5rem;
}

.discover-add {
  background: rgba(34, 194, 129, 0.18);
  border: 1px solid rgba(34, 194, 129, 0.35);
  border-radius: 10px;
  color: #21e88f;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

.discover-add:hover {
  background: rgba(34, 194, 129, 0.26);
}

.discover-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.discover-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(231, 237, 250, 0.9);
}

.discover-row button {
  padding: 0.6rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(47, 143, 255, 0.18);
  color: rgba(231, 237, 250, 0.95);
  cursor: pointer;
  font-weight: 600;
}

.discover-row button:hover {
  background: rgba(47, 143, 255, 0.26);
}

.help {
  margin: 0 0 0.75rem;
  color: rgba(231, 237, 250, 0.65);
  font-size: 0.9rem;
}
