@import url("./glass-tokens.css");

:root {
  --af-gap-xs: 0.5rem;
  --af-gap-sm: 0.75rem;
  --af-gap-md: 1rem;
  --af-radius: 8px;
  --af-radius-sm: 6px;
  --af-line: rgba(255,255,255,0.08);
  --af-text: rgba(238,242,247,0.96);
  --af-muted: rgba(154,168,187,0.78);
  --af-dim: rgba(122,136,154,0.68);
}

body.hg-agent-front {
  --font-display: "Inter","Sora",sans-serif;
  --font-body: "Inter","Sora","Noto Sans JP",system-ui,sans-serif;
  --font-mono: "IBM Plex Mono","Cascadia Code",monospace;
  color: var(--af-text);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  background: #0b0f14;
  margin: 0;
}

body.hg-agent-front * { box-sizing: border-box; }
body.hg-agent-front a { color: inherit; text-decoration: none; }
body.hg-agent-front button { font: inherit; }

.af-topbar {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 0 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.af-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.af-brand-mark {
  width: 22px;
  height: 28px;
  display: inline-grid;
  place-items: center;
}

.af-brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.af-brand-wordmark {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: rgba(245,248,255,0.96);
}

.af-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.af-nav-link {
  position: relative;
  padding: 6px 0 8px;
  border: 0;
  background: transparent;
  color: rgba(164,174,192,0.82);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.af-nav-link::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  border-radius: 999px;
  background: #3b82f6;
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity 160ms ease, transform 160ms ease;
}

.af-nav-link:hover,
.af-nav-link.is-active {
  color: #ffffff;
}

.af-nav-link:hover::after,
.af-nav-link.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.af-ghost-button,
.af-primary-button {
  min-height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0f1319;
  color: rgba(235,240,248,0.92);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 12px;
}

.af-primary-button {
  border-color: transparent;
  background: linear-gradient(135deg, #2370ff 0%, #3a82ff 100%);
  box-shadow: 0 10px 20px rgba(35,112,255,0.24);
}

.af-shell {
  display: flex;
  flex-direction: column;
  gap: var(--af-gap-md);
  padding-top: 10px;
}

.af-hero {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: #101419;
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
}

.af-hero-copy h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.af-hero-copy p {
  margin: 8px 0 0;
  color: rgba(151,161,178,0.82);
  font-size: 13px;
  line-height: 1.5;
  max-width: 640px;
}

.af-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.af-category-row {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.af-category-row::-webkit-scrollbar { display: none; }

.af-category-chip {
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  background: #0f1318;
  color: rgba(151,161,178,0.76);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.af-category-chip.is-active {
  background: rgba(35,112,255,0.16);
  color: #ffffff;
  border-color: rgba(59,130,246,0.4);
}

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

.af-panel {
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: #101419;
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
  overflow: hidden;
}

.af-panel--watchlist { grid-column: span 7; }
.af-panel--sentiment { grid-column: span 5; }
.af-panel--signals { grid-column: span 6; }
.af-panel--suggestions { grid-column: span 6; }

.af-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.af-panel-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.af-status-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(109,205,168,0.14);
  color: #42d392;
  font-size: 11px;
  font-weight: 600;
}

.af-watchlist {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.af-watchlist-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--af-radius-sm);
  background: #0f1318;
}

.af-watchlist-row .af-commodity-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.af-watchlist-row .af-commodity-meta {
  font-size: 11px;
  color: var(--af-dim);
}

.af-watchlist-row .af-price {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--af-text);
}

.af-watchlist-row .af-change {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.af-change.is-up { color: rgba(109,205,168,0.94); }
.af-change.is-down { color: rgba(224,112,112,0.94); }

.af-sentiment-grid,
.af-signals-grid {
  display: grid;
  gap: 6px;
  padding: 8px;
}

.af-sentiment-card,
.af-signal-card {
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--af-radius-sm);
  background: #0f1318;
}

.af-sentiment-card strong,
.af-signal-card strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.af-sentiment-card span,
.af-signal-card span {
  font-size: 11px;
  color: var(--af-muted);
}

.af-suggestion-card {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--af-radius-sm);
  background: #0f1318;
}

.af-suggestion-card h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.af-suggestion-card p {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--af-muted);
  line-height: 1.45;
}

.af-suggestion-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--af-dim);
}

.af-suggestion-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(35,112,255,0.14);
  color: #8eb8ea;
  font-size: 11px;
  font-weight: 600;
}

.af-watchtower-panel {
  display: none;
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  background: #101419;
  box-shadow: 0 14px 34px rgba(0,0,0,0.22);
  padding: 14px;
  margin-top: 10px;
}

.af-watchtower-panel.is-open { display: block; }

.af-watchtower-form {
  display: grid;
  gap: 12px;
  max-width: 480px;
}

.af-field {
  display: grid;
  gap: 6px;
}

.af-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--af-muted);
}

.af-form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.af-form-status {
  font-size: 12px;
  color: var(--af-muted);
}

@media (max-width: 1100px) {
  .af-grid { grid-template-columns: 1fr; }
  .af-panel--watchlist,
  .af-panel--sentiment,
  .af-panel--signals,
  .af-panel--suggestions { grid-column: span 1; }
  .af-hero { grid-template-columns: 1fr; }
}
