:root {
  color-scheme: dark;
  --bg: #070812;
  --panel: rgba(19, 22, 39, 0.82);
  --panel-strong: #12162a;
  --line: rgba(255, 255, 255, 0.11);
  --text: #f7f7fb;
  --muted: #a7adc4;
  --body-bg:
    radial-gradient(circle at 18% 8%, rgba(155, 92, 255, 0.22), transparent 26rem),
    radial-gradient(circle at 82% 3%, rgba(55, 213, 255, 0.14), transparent 22rem),
    linear-gradient(135deg, #050815 0%, #081026 58%, #030712 100%);
  --subtitle: #d5d8e8;
  --control-bg: rgba(5, 7, 16, 0.7);
  --dropdown-bg: #0d1020;
  --soft-text: #cfd3e7;
  --chip-text: #e8ddff;
  --ticker-bg:
    linear-gradient(90deg, rgba(7, 8, 18, 0.98), rgba(14, 16, 32, 0.82)),
    rgba(13, 16, 32, 0.82);
  --ticker-edge: #080a15;
  --score-inner: #111426;
  --violet: #9b5cff;
  --violet-2: #c084fc;
  --cyan: #37d5ff;
  --green: #36d399;
  --amber: #fbbf24;
  --red: #fb5b6b;
  --dark-red: #7f1d1d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.12);
  --text: #0f172a;
  --muted: #0f172a;
  --body-bg: #ffffff;
  --subtitle: #0f172a;
  --control-bg: rgba(248, 250, 252, 0.96);
  --dropdown-bg: #ffffff;
  --soft-text: #0f172a;
  --chip-text: #4c1d95;
  --ticker-bg: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
  --ticker-edge: #ffffff;
  --score-inner: #ffffff;
  --violet: #7c3aed;
  --violet-2: #6d28d9;
  --cyan: #0891b2;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--body-bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 58px;
}

.header-actions {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.kraken-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-width: 330px;
  border: 1px solid rgba(103, 232, 249, 0.45);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(103, 232, 249, 0.12));
  color: var(--text);
  padding: 8px 12px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.partner-cta {
  flex: 0 1 330px;
}

.kraken-cta:hover,
.kraken-cta:focus {
  border-color: rgba(103, 232, 249, 0.8);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.34), rgba(103, 232, 249, 0.18));
}

.brand {
  display: inline-flex;
  gap: 14px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand strong {
  display: block;
  font-size: 1.32rem;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.language-switcher {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.language-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 72px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--control-bg);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 8px 10px;
}

.theme-toggle {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--control-bg);
  color: var(--text);
  padding: 0;
}

.theme-toggle:hover,
.theme-toggle:focus {
  border-color: rgba(192, 132, 252, 0.65);
}

.theme-icon {
  display: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:root[data-theme="dark"] .theme-icon-sun,
:root[data-theme="light"] .theme-icon-moon {
  display: block;
}

.language-button:hover,
.language-button:focus {
  border-color: rgba(192, 132, 252, 0.65);
  color: var(--text);
}

.language-button.active {
  border-color: rgba(155, 92, 255, 0.85);
  background: rgba(155, 92, 255, 0.18);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(155, 92, 255, 0.18);
}

.language-button:disabled,
.language-button.is-locked {
  cursor: not-allowed;
  opacity: 0.48;
}

.flag {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 16px;
  overflow: hidden;
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}

.flag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero {
  display: grid;
  gap: 28px;
  min-height: 68vh;
  align-content: center;
  justify-items: center;
}

.hero-copy {
  max-width: 860px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 100%;
  margin-bottom: 18px;
  font-size: clamp(1.8rem, 2.9vw, 2.25rem);
  line-height: 1.05;
  letter-spacing: 0;
  white-space: nowrap;
}

.hero-subtitle {
  max-width: 760px;
  margin-inline: auto;
  color: var(--subtitle);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.search-panel,
.loading-card,
.error-box,
.project-card,
.chart-card,
.score-card,
.risk-panel,
.criteria-card,
.list-card,
.description-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.search-panel {
  position: relative;
  z-index: 30;
  width: min(100%, 860px);
  padding: 16px;
}

.search-box {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  background: var(--control-bg);
  padding: 10px 10px 10px 16px;
}

.search-box svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--violet-2);
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box button,
.back-button,
.error-box button {
  border: 1px solid rgba(103, 232, 249, 0.45);
  border-radius: 0;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(103, 232, 249, 0.12));
  color: var(--text);
  font-weight: 800;
  padding: 12px 18px;
}

.search-box button:hover,
.search-box button:focus,
.back-button:hover,
.back-button:focus,
.error-box button:hover,
.error-box button:focus {
  border-color: rgba(103, 232, 249, 0.8);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.34), rgba(103, 232, 249, 0.18));
}

.search-box button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
}

.search-box button:disabled:hover,
.search-box button:disabled:focus {
  border-color: rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
}

.autocomplete {
  position: absolute;
  z-index: 40;
  top: 74px;
  right: 16px;
  left: 16px;
  max-height: min(48vh, 430px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--dropdown-bg);
}

.autocomplete::-webkit-scrollbar {
  width: 10px;
}

.autocomplete::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
}

.autocomplete::-webkit-scrollbar-thumb {
  border: 2px solid var(--dropdown-bg);
  background: linear-gradient(180deg, var(--violet), var(--cyan));
}

.autocomplete {
  scrollbar-color: var(--violet) rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
}

.suggestion {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 12px;
}

.suggestion:hover,
.suggestion:focus {
  background: rgba(155, 92, 255, 0.13);
}

.suggestion img,
.suggestion-icon,
.project-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.suggestion-icon {
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(155, 92, 255, 0.45);
  background: rgba(155, 92, 255, 0.14);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.suggestion-match {
  padding: 0;
  background: transparent;
  color: #67e8f9;
  font-weight: 900;
}

:root[data-theme="light"] .suggestion-match {
  background: transparent;
  color: #2563eb;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chips button {
  border: 1px solid rgba(155, 92, 255, 0.38);
  border-radius: 0;
  background: rgba(155, 92, 255, 0.1);
  color: var(--chip-text);
  padding: 8px 12px;
}

.market-ticker {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  overflow: hidden;
  border: 1px solid rgba(155, 92, 255, 0.28);
  border-radius: 0;
  background: var(--ticker-bg);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
}

.market-ticker.is-hidden {
  display: none;
}

.market-ticker::before,
.market-ticker::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 70px;
  pointer-events: none;
}

.market-ticker::before {
  left: 0;
  background: linear-gradient(90deg, var(--ticker-edge), transparent);
}

.market-ticker::after {
  right: 0;
  background: linear-gradient(270deg, var(--ticker-edge), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 10px;
  padding: 10px;
  animation: ticker-scroll 36s linear infinite;
}

.market-ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 12px;
  white-space: nowrap;
}

.ticker-item:hover,
.ticker-item:focus {
  border-color: rgba(192, 132, 252, 0.62);
  background: rgba(155, 92, 255, 0.14);
}

.ticker-name {
  color: var(--text);
  font-weight: 850;
}

.ticker-coin-icon {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
  flex: 0 0 auto;
}

.ticker-coin-fallback {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px solid rgba(192, 132, 252, 0.42);
  border-radius: 50%;
  color: var(--violet-2);
  background: rgba(155, 92, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 900;
}

.ticker-item strong {
  color: var(--soft-text);
  font-size: 0.92rem;
}

.ticker-positive {
  color: var(--green);
  font-weight: 900;
}

.ticker-negative {
  color: var(--red);
  font-weight: 900;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.loading-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
}

.loading-card[hidden],
.error-box[hidden],
.results[hidden],
.autocomplete[hidden],
.hero[hidden] {
  display: none;
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.13);
  border-top-color: var(--violet-2);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-ring {
  to { transform: rotate(360deg); }
}

@keyframes loading-bar {
  0% { background-position: 180% 0; }
  100% { background-position: -40% 0; }
}

@keyframes loading-runner {
  0% {
    transform: translateX(-120%);
    opacity: 0;
  }
  18%,
  82% {
    opacity: 1;
  }
  100% {
    transform: translateX(260%);
    opacity: 0;
  }
}

@keyframes risk-scan {
  0%,
  100% {
    background-position: 160% 0, 0 0, 0 0;
    opacity: 0.52;
  }
  50% {
    background-position: -60% 0, 0 0, 0 0;
    opacity: 1;
  }
}

.steps {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.step {
  height: 7px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.12);
}

.step.active,
.step.done {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

.error-box {
  padding: 18px;
  border-color: rgba(251, 91, 107, 0.38);
}

.error-box p {
  color: #ffd6dc;
}

.results {
  display: grid;
  gap: 18px;
}

.results-toolbar {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  align-items: center;
}

.result-search-panel {
  position: relative;
  z-index: 32;
  width: min(100%, 380px);
  flex: 0 1 380px;
  min-width: 250px;
}

.result-search-box {
  min-height: 46px;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px 6px 6px 12px;
}

.result-search-box svg {
  width: 18px;
  height: 18px;
}

.result-search-box input {
  font-size: 0.92rem;
}

.result-search-box button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.88rem;
}

.result-autocomplete {
  top: calc(100% + 8px);
  right: 0;
  left: 0;
}

.back-button {
  justify-self: start;
}

.home-button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.project-logo {
  width: 68px;
  height: 68px;
}

.project-title {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: baseline;
}

.project-title h2 {
  margin: 0;
  font-size: 2rem;
}

.project-actions {
  position: relative;
  align-self: start;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.project-action-button,
.share-menu button {
  position: relative;
  border: 1px solid rgba(155, 92, 255, 0.42);
  border-radius: 0;
  background: rgba(155, 92, 255, 0.11);
  color: var(--text);
  font-weight: 800;
  padding: 0;
}

.project-action-button:hover,
.project-action-button:focus,
.share-menu button:hover,
.share-menu button:focus {
  border-color: rgba(192, 132, 252, 0.78);
  background: rgba(155, 92, 255, 0.2);
}

.project-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  background: rgba(148, 163, 184, 0.12);
  border-color: var(--line);
}

.icon-button,
.share-menu button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
}

.icon-button svg,
.share-menu button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-menu button[data-share-channel="facebook"] svg {
  fill: currentColor;
  stroke-width: 0;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 80;
  right: 50%;
  bottom: calc(100% + 9px);
  transform: translateX(50%) translateY(4px);
  width: max-content;
  max-width: 160px;
  border: 1px solid var(--line);
  background: var(--dropdown-bg);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  padding: 8px 9px;
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: nowrap;
}

[data-tooltip]::before {
  content: "";
  position: absolute;
  z-index: 81;
  right: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: var(--dropdown-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(50%) translateY(0);
}

.share-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  gap: 6px;
  width: max-content;
  border: 1px solid var(--line);
  background: var(--dropdown-bg);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.3);
  padding: 8px;
}

.share-menu[hidden] {
  display: none;
}

.share-menu button {
  flex: 0 0 auto;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.share-menu button:last-child {
  border-bottom: 1px solid var(--line);
}

.ticker,
.rank,
.category {
  border: 1px solid var(--line);
  border-radius: 0;
  color: #dfe2f7;
  padding: 4px 9px;
}

.project-links,
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.project-links a {
  border: 1px solid rgba(55, 213, 255, 0.28);
  border-radius: 0;
  color: #c7f4ff;
  padding: 8px 10px;
  text-decoration: none;
}

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

.stat-card {
  padding: 16px;
}

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

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.1rem;
}

.stat-positive {
  color: var(--green);
}

.stat-negative {
  color: var(--red);
}

.analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr);
  gap: 18px;
}

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

.summary-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: stretch;
}

.chart-card,
.score-card,
.risk-panel,
.criteria-card,
.list-card,
.description-card {
  padding: 20px;
}

.chart-card {
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.chart-card.is-updating::after {
  content: "A atualizar gráfico...";
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: #67e8f9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.86;
}

#priceChart {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 260px;
  cursor: crosshair;
  touch-action: none;
}

.card-heading {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-heading h2,
.score-card h2,
.list-card h2,
.description-card h2 {
  margin-bottom: 0;
}

.range-buttons {
  display: flex;
  gap: 6px;
}

.range-buttons button {
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 8px 10px;
}

.range-buttons button.active {
  border-color: rgba(192, 132, 252, 0.7);
  color: white;
  background: rgba(155, 92, 255, 0.2);
}

.score-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "ring title"
    "ring text"
    "ring risk";
  column-gap: 24px;
  row-gap: 8px;
  align-items: center;
  justify-items: start;
  text-align: left;
}

.score-ring {
  --score-color: var(--amber);
  grid-area: ring;
  display: grid;
  width: 176px;
  height: 176px;
  place-items: center;
  margin-bottom: 0;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) var(--score-angle), rgba(255, 255, 255, 0.09) 0);
  position: relative;
}

.score-ring.is-loading {
  --score-angle: 360deg;
  --score-color: var(--muted);
  background: rgba(255, 255, 255, 0.09);
}

.score-ring.is-loading span {
  color: var(--muted);
}

.score-ring.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(167, 173, 196, 0.18), rgba(155, 92, 255, 0.95), rgba(55, 213, 255, 0.72), rgba(167, 173, 196, 0.18));
  animation: loading-ring 1.55s linear infinite;
}

.score-card h2 {
  grid-area: title;
}

.score-card p {
  grid-area: text;
  margin: 0;
  max-width: 820px;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--score-inner);
  z-index: 1;
}

.score-ring span,
.score-ring small {
  position: relative;
  z-index: 2;
}

.score-ring span {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 2.45rem;
  font-weight: 900;
}

.score-ring small {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 800;
}

.risk-banner {
  grid-area: risk;
  width: 100%;
  margin-top: 14px;
  border-radius: 0;
  padding: 12px;
  color: white;
  text-align: left;
}

.risk-low { background: color-mix(in srgb, var(--green) 18%, transparent); border: 1px solid color-mix(in srgb, var(--green) 42%, transparent); }
.risk-medium { background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.42); }
.risk-high { background: rgba(251, 91, 107, 0.17); border: 1px solid rgba(251, 91, 107, 0.45); }
.risk-critical { background: rgba(127, 29, 29, 0.72); border: 1px solid rgba(248, 113, 113, 0.42); }

.risk-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  height: 100%;
}

.risk-panel.is-loading {
  position: relative;
  overflow: hidden;
}

.risk-panel.is-loading::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.12), transparent),
    radial-gradient(circle at 18% 28%, rgba(155, 92, 255, 0.24), transparent 9px),
    radial-gradient(circle at 74% 66%, rgba(55, 213, 255, 0.18), transparent 8px);
  background-size: 180% 100%, 100% 100%, 100% 100%;
  animation: risk-scan 1.8s ease-in-out infinite;
}

.risk-panel.is-loading .risk-word {
  color: var(--muted);
}

.risk-panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.risk-panel h2 {
  margin: 0;
}

.description-card.is-loading {
  position: relative;
  overflow: hidden;
}

.description-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.12), transparent),
    radial-gradient(circle at 18% 28%, rgba(155, 92, 255, 0.24), transparent 9px),
    radial-gradient(circle at 74% 66%, rgba(55, 213, 255, 0.18), transparent 8px);
  background-size: 180% 100%, 100% 100%, 100% 100%;
  animation: risk-scan 1.8s ease-in-out infinite;
}

.description-card.is-loading p {
  color: var(--muted);
}

.risk-panel p {
  margin: 0;
  color: var(--soft-text);
  line-height: 1.65;
  text-align: justify;
}

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

.criteria-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.criteria-top h3 {
  margin: 0;
}

.criteria-score {
  font-weight: 900;
}

.criteria-score.score-good { color: var(--green); }
.criteria-score.score-mid { color: var(--amber); }
.criteria-score.score-bad { color: var(--red); }
.criteria-score.score-neutral { color: var(--violet-2); }
.criteria-score.score-loading { color: var(--muted); }

.score-bar {
  height: 9px;
  overflow: hidden;
  margin: 14px 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.1);
}

.score-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

.score-bar.score-good span {
  background: linear-gradient(90deg, var(--green), var(--green));
}

.score-bar.score-mid span {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.95), rgba(253, 224, 71, 0.95));
}

.score-bar.score-bad span {
  background: linear-gradient(90deg, rgba(251, 91, 107, 0.95), rgba(248, 113, 113, 0.95));
}

.score-bar.score-neutral span {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
}

.criteria-card.is-loading .score-bar,
.score-bar.score-loading {
  background: rgba(255, 255, 255, 0.08);
}

.criteria-card.is-loading .score-bar span,
.score-bar.score-loading span {
  position: relative;
  background: linear-gradient(90deg, rgba(167, 173, 196, 0.16), rgba(167, 173, 196, 0.36), rgba(167, 173, 196, 0.16));
  background-size: 220% 100%;
  animation: loading-bar 1.35s ease-in-out infinite;
}

.criteria-card.is-loading .score-bar span::after,
.score-bar.score-loading span::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(155, 92, 255, 0.7), rgba(55, 213, 255, 0.55), transparent);
  animation: loading-runner 1.35s ease-in-out infinite;
}

.risk-word {
  font-weight: 900;
}

.risk-word-low {
  color: var(--green);
}

.risk-word-medium {
  color: var(--amber);
}

.risk-word-high {
  color: var(--red);
}

.risk-criteria-card p {
  margin-top: 14px;
}

.criteria-card p,
.description-card p,
.score-card p,
.list-card li,
.disclaimer {
  color: var(--soft-text);
  line-height: 1.65;
}

.criteria-card p,
.description-card p,
.score-card p {
  text-align: justify;
}

.disclaimer {
  margin: 2px auto 0;
  padding: 0;
  color: #b45309;
  font-size: 0.94rem;
  text-align: center;
}

.coffee-support {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 34px auto 0;
  padding: 8px 12px 8px 10px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background:
    linear-gradient(135deg, rgba(103, 232, 249, 0.08), rgba(251, 191, 36, 0.06)),
    rgba(10, 12, 24, 0.34);
  color: var(--text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}

.coffee-support::before {
  content: "";
  position: absolute;
  left: -28px;
  right: -28px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.28), transparent);
  transform: translateY(-50%);
  z-index: -1;
}

.coffee-support:hover,
.coffee-support:focus-visible {
  border-color: rgba(103, 232, 249, 0.52);
  color: #67e8f9;
  transform: translateY(-1px);
}

.coffee-support-results {
  display: flex;
}

.coffee-cup {
  position: relative;
  width: 16px;
  height: 13px;
  border: 2px solid #fbbf24;
  border-top: 0;
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.18), rgba(103, 232, 249, 0.08));
}

.coffee-cup::before {
  content: "";
  position: absolute;
  right: -7px;
  top: 2px;
  width: 7px;
  height: 7px;
  border: 2px solid #fbbf24;
  border-left: 0;
}

.coffee-cup::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  bottom: -5px;
  height: 2px;
  background: #67e8f9;
  opacity: 0.8;
}

:root[data-theme="light"] .coffee-support {
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(180, 83, 9, 0.06)),
    rgba(255, 255, 255, 0.72);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .coffee-support::before {
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.22), transparent);
}

:root[data-theme="light"] .coffee-support:hover,
:root[data-theme="light"] .coffee-support:focus-visible {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.42);
}

.list-card ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 20px;
}

.list-card li::marker {
  color: var(--green);
}

.list-card.red li::marker {
  color: var(--red);
}

:root[data-theme="light"] .search-panel,
:root[data-theme="light"] .loading-card,
:root[data-theme="light"] .error-box,
:root[data-theme="light"] .project-card,
:root[data-theme="light"] .chart-card,
:root[data-theme="light"] .score-card,
:root[data-theme="light"] .risk-panel,
:root[data-theme="light"] .criteria-card,
:root[data-theme="light"] .list-card,
:root[data-theme="light"] .description-card,
:root[data-theme="light"] .stat-card {
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .search-box button,
:root[data-theme="light"] .back-button,
:root[data-theme="light"] .error-box button {
  color: #0f172a;
}

:root[data-theme="light"] .chips button {
  background: rgba(124, 58, 237, 0.08);
  border-color: rgba(124, 58, 237, 0.22);
}

:root[data-theme="light"] .ticker-item {
  background: rgba(15, 23, 42, 0.035);
  border-color: rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .ticker-item:hover,
:root[data-theme="light"] .ticker-item:focus {
  background: rgba(124, 58, 237, 0.08);
}

:root[data-theme="light"] .project-links a {
  color: #0369a1;
  border-color: rgba(8, 145, 178, 0.28);
}

:root[data-theme="light"] .ticker,
:root[data-theme="light"] .rank,
:root[data-theme="light"] .category {
  color: #334155;
}

:root[data-theme="light"] .range-buttons button {
  background: rgba(15, 23, 42, 0.035);
}

:root[data-theme="light"] .range-buttons button.active {
  color: #0f172a;
  background: rgba(124, 58, 237, 0.12);
}

:root[data-theme="light"] .brand small,
:root[data-theme="light"] .stat-card small,
:root[data-theme="light"] .suggestion small,
:root[data-theme="light"] .range-buttons button,
:root[data-theme="light"] .score-ring small,
:root[data-theme="light"] .criteria-score.score-loading,
:root[data-theme="light"] .score-ring.is-loading span,
:root[data-theme="light"] .risk-panel.is-loading .risk-word,
:root[data-theme="light"] .description-card.is-loading p,
:root[data-theme="light"] .ticker-item strong,
:root[data-theme="light"] .criteria-card p,
:root[data-theme="light"] .description-card p,
:root[data-theme="light"] .score-card p,
:root[data-theme="light"] .list-card li,
:root[data-theme="light"] .risk-panel p {
  color: #0f172a;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 14px 0 36px;
  }

  .site-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 28px;
    justify-items: stretch;
  }

  .header-actions {
    width: 100%;
    gap: 8px;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .kraken-cta {
    flex: 1 1 100%;
    max-width: none;
  }

  .language-switcher {
    flex: 1 1 auto;
    justify-content: stretch;
  }

  .language-button {
    flex: 1 1 0;
    min-width: 66px;
    min-height: 34px;
    padding: 7px 8px;
  }

  .theme-toggle {
    flex: 0 0 40px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand strong {
    font-size: 1.16rem;
  }

  .brand small {
    font-size: 0.84rem;
  }

  .hero {
    gap: 20px;
    min-height: auto;
    align-content: start;
    padding-bottom: 16px;
  }

  .hero-copy {
    width: 100%;
    padding-top: 4px;
  }

  .hero-subtitle {
    font-size: 1rem;
    line-height: 1.55;
  }

  .search-panel {
    width: 100%;
    padding: 12px;
  }

  .search-box,
  .project-card,
  .loading-card {
    grid-template-columns: 1fr;
  }

  .search-box {
    gap: 10px;
    padding: 12px;
  }

  .search-box svg {
    display: none;
  }

  .search-box input {
    min-height: 42px;
    text-align: center;
  }

  .search-box button {
    width: 100%;
    min-height: 46px;
  }

  .autocomplete {
    top: 78px;
    right: 12px;
    left: 12px;
    max-height: min(55vh, 360px);
    overflow-y: auto;
  }

  .chips {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chips button {
    min-height: 38px;
    padding: 9px 8px;
  }

  .market-ticker {
    width: 100%;
  }

  .ticker-track {
    gap: 8px;
    padding: 8px;
    animation-duration: 30s;
  }

  .ticker-item {
    min-width: 210px;
    padding: 9px 10px;
  }

  .loading-card,
  .error-box {
    width: 100%;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid,
  .criteria-grid,
  .analysis-layout,
  .insight-grid {
    grid-template-columns: 1fr;
  }

  .results {
    gap: 14px;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .result-search-panel {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  .home-button {
    width: 100%;
  }

  .project-card {
    justify-items: center;
    text-align: center;
    padding: 16px;
  }

  .project-info {
    min-width: 0;
    width: 100%;
  }

  .project-actions {
    width: 100%;
    justify-content: center;
  }

  .project-action-button {
    flex: 0 0 40px;
  }

  .share-menu {
    left: 0;
    right: auto;
    max-width: min(100%, 330px);
    overflow-x: auto;
  }

  .project-title {
    justify-content: center;
  }

  .project-title h2 {
    width: 100%;
    font-size: 1.55rem;
  }

  .project-links,
  .categories {
    justify-content: center;
  }

  .project-links a,
  .category,
  .ticker,
  .rank {
    font-size: 0.82rem;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 14px;
  }

  .stat-card strong {
    overflow-wrap: anywhere;
    font-size: 1rem;
  }

  .chart-card,
  .score-card,
  .risk-panel,
  .criteria-card,
  .list-card,
  .description-card {
    padding: 16px;
  }

  #priceChart {
    height: 230px;
  }

  .score-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "ring"
      "title"
      "text"
      "risk";
    justify-items: center;
    text-align: center;
  }

  .score-card p {
    text-align: justify;
  }

  .card-heading {
    display: grid;
  }

  .range-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .range-buttons button {
    padding: 9px 6px;
  }

  .risk-panel-top,
  .criteria-top {
    align-items: flex-start;
  }

  .score-ring {
    width: 148px;
    height: 148px;
  }

  .score-ring span {
    font-size: 2rem;
  }

  h1 {
    font-size: clamp(1.55rem, 8vw, 2.05rem);
    line-height: 1.08;
    white-space: normal;
  }
}

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

  .app-shell {
    width: min(100% - 16px, 1180px);
    padding-top: 10px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .kraken-cta {
    grid-column: 1 / -1;
    min-height: 38px;
    white-space: normal;
  }

  .language-button {
    min-width: 0;
    font-size: 0.78rem;
  }

  .flag {
    width: 22px;
    height: 15px;
  }

  .brand small {
    max-width: 220px;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 0.96rem;
  }

  .search-panel,
  .loading-card,
  .error-box,
  .project-card,
  .chart-card,
  .score-card,
  .risk-panel,
  .criteria-card,
  .list-card,
  .description-card,
  .stat-card {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
  }

  .chips {
    grid-template-columns: 1fr;
  }

  .ticker-item {
    min-width: 190px;
  }

  .card-heading {
    gap: 12px;
  }

  .project-links a {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .criteria-top {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .disclaimer {
    font-size: 0.86rem;
  }

  .coffee-support {
    max-width: min(100%, 310px);
    justify-content: center;
    text-align: center;
    font-size: 0.78rem;
  }

  .coffee-support::before {
    left: -10px;
    right: -10px;
  }
}

@media (min-width: 561px) and (max-width: 860px) {
  .score-card {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "ring title"
      "ring text"
      "ring risk";
    justify-items: start;
    text-align: left;
  }

  .summary-grid .score-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "ring"
      "title"
      "text"
      "risk";
    justify-items: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .score-ring.is-loading,
  .score-ring.is-loading::after,
  .criteria-card.is-loading .score-bar span,
  .score-bar.score-loading span,
  .criteria-card.is-loading .score-bar span::after,
  .score-bar.score-loading span::after,
  .risk-panel.is-loading::after,
  .description-card.is-loading::after {
    animation: none;
  }
}
