:root {
  --gulf-ink: #12233f;
  --palm: #1f8a70;
  --noon-gold: #f5c542;
  --market-blue: #2563eb;
  --coral-risk: #e25555;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --line: #d9e2ef;
  --text: #162033;
  --muted: #65758b;
  --shadow: 0 18px 45px rgba(18, 35, 63, 0.10);
  --display: "Aptos Display", "Segoe UI", Tahoma, Arial, sans-serif;
  --body: "Aptos", "Segoe UI", Tahoma, Arial, sans-serif;
  --mono: Consolas, "SFMono-Regular", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--noon-gold);
  outline-offset: 3px;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(217, 226, 239, 0.72) 1px, transparent 1px),
    linear-gradient(0deg, rgba(217, 226, 239, 0.58) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

.login-card {
  display: grid;
  align-self: center;
  gap: 20px;
  margin: clamp(22px, 5vw, 64px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 38px);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
}

.login-form {
  display: grid;
  gap: 15px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.9rem;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--market-blue);
}

.login-error {
  min-height: 22px;
  margin: 0;
  color: var(--coral-risk);
  font-size: 0.9rem;
  font-weight: 700;
}

.demo-credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 6px;
  padding: 11px 12px;
  background: #f4f8ff;
}

.demo-credential span {
  color: var(--muted);
  font-size: 0.82rem;
}

.demo-credential b {
  color: var(--gulf-ink);
  font-family: var(--mono);
  font-size: 0.84rem;
}

.login-insight {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  min-width: 0;
  padding: clamp(34px, 6vw, 76px);
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #13243d;
  background-size: 54px 54px;
}

.login-insight .eyebrow {
  color: var(--noon-gold);
}

.login-insight h2 {
  max-width: 700px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1.02;
}

.login-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 760px;
}

.login-metric-grid article {
  min-height: 142px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
}

.login-metric-grid span,
.login-metric-grid small {
  display: block;
  color: rgba(255, 255, 255, 0.7);
}

.login-metric-grid span {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.login-metric-grid strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--noon-gold);
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: 400px minmax(0, 1fr);
  min-height: 100vh;
}

.control-panel {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  padding: 32px;
  color: var(--text);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 12px 0 32px rgba(18, 35, 63, 0.04);
}

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

.brand-mark {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 2px solid rgba(245, 197, 66, 0.92);
  border-radius: 8px;
  color: transparent;
  background: #fff5c7 url("debug.ico") center / 78% 78% no-repeat;
  font-family: var(--display);
  font-size: 1.8rem;
  font-weight: 700;
  overflow: hidden;
  user-select: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--market-blue);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.control-panel .eyebrow {
  color: var(--market-blue);
}

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

h1,
.topbar-copy h2 {
  margin-bottom: 0;
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.08;
}

h1 {
  font-size: 2.05rem;
}

.topbar-copy h2 {
  font-size: 1.8rem;
}

.intro {
  margin: 0;
  color: var(--muted);
}

.signal-stack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.signal-stack span {
  border: 1px solid #dce6f4;
  border-radius: 6px;
  padding: 8px 9px;
  color: var(--gulf-ink);
  background: #f7faff;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
}

.market-switch {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(18, 35, 63, 0.05);
}

.market-switch > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.market-switch span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.market-switch b {
  color: var(--gulf-ink);
  font-size: 0.9rem;
}

.market-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.market-options button {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid #d8e2f0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--gulf-ink);
  background: #f8fbff;
  font-weight: 800;
}

.market-options button.is-active {
  border-color: var(--market-blue);
  color: #ffffff;
  background: var(--market-blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.market-options small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.market-options button.is-active small {
  color: rgba(255, 255, 255, 0.78);
}

.analysis-form {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(18, 35, 63, 0.06);
}

.form-heading {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.form-heading span {
  color: var(--market-blue);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.form-heading b {
  color: var(--gulf-ink);
  font-size: 0.98rem;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d8e2f0;
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--text);
  background: #fbfdff;
  transition: border-color 140ms ease, background 140ms ease;
}

input:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.7);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #93a2b7;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.ghost-button,
.icon-button,
.tabs button {
  border-radius: 6px;
  border: 1px solid transparent;
  min-height: 42px;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  color: var(--gulf-ink);
  background: var(--noon-gold);
  box-shadow: 0 10px 24px rgba(245, 197, 66, 0.18);
}

.ghost-button {
  color: var(--gulf-ink);
  border-color: var(--line);
  background: #f8fbff;
}

.primary-button span,
.ghost-button span,
.icon-button span:first-child {
  margin-right: 8px;
}

.status-line {
  margin-top: auto;
  border-left: 4px solid var(--market-blue);
  padding: 10px 12px;
  color: var(--muted);
  background: #f1f6ff;
}

.report-shell {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 18px;
  padding: 30px clamp(22px, 3vw, 42px);
}

.report-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.compact {
  flex-wrap: nowrap;
}

.icon-button {
  color: var(--gulf-ink);
  border-color: var(--line);
  background: var(--surface);
}

.session-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 4px 4px 12px;
  color: var(--gulf-ink);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 700;
}

.session-chip span {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-chip button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  padding: 0 10px;
  color: var(--market-blue);
  background: #eef4ff;
  font-weight: 800;
}

.topbar-copy p:last-child {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
}

.summary-area {
  min-height: 250px;
}

.leaderboard-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 12px 30px rgba(16, 47, 43, 0.08);
}

.leaderboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.leaderboard-head h2 {
  margin: 0;
  color: var(--gulf-ink);
  font-family: var(--display);
  font-size: 1.5rem;
}

.leaderboard-head p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
}

.leaderboard-status {
  margin: 12px 0;
  border-left: 4px solid var(--market-blue);
  padding: 8px 10px;
  color: var(--muted);
  background: #f1fbfa;
  font-size: 0.88rem;
}

.leaderboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.category-strip button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(47, 154, 160, 0.22);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--gulf-ink);
  background: rgba(47, 154, 160, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
}

.category-strip button.is-active {
  color: #ffffff;
  border-color: var(--market-blue);
  background: var(--market-blue);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.category-strip button.is-active small {
  color: rgba(255, 255, 255, 0.78);
}

.category-strip button.is-failed {
  color: #7b341f;
  border-color: rgba(216, 86, 60, 0.28);
  background: #fff1df;
}

.category-strip small {
  color: var(--muted);
  font-family: var(--mono);
}

.hot-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 4px;
}

.hot-card {
  display: grid;
  grid-template-columns: 46px 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 160ms ease, transform 160ms ease;
}

.hot-card[role="button"],
.product-sample[role="button"] {
  cursor: pointer;
}

.hot-card[role="button"]:hover,
.product-sample[role="button"]:hover {
  border-color: rgba(37, 99, 235, 0.48);
  transform: translateY(-1px);
}

.hot-card[role="button"]:focus-visible,
.product-sample[role="button"]:focus-visible {
  outline: 3px solid var(--noon-gold);
  outline-offset: 3px;
}

.hot-rank {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 6px;
  color: var(--gulf-ink);
  background: var(--noon-gold);
  font-family: var(--mono);
  font-weight: 800;
}

.hot-card img,
.hot-card .sample-placeholder {
  width: 72px;
  height: 72px;
}

.hot-card img {
  border-radius: 6px;
  object-fit: cover;
  background: #eff5ed;
}

.hot-card-main {
  min-width: 0;
}

.hot-card-top,
.hot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.hot-card-top {
  justify-content: space-between;
}

.hot-card-top span,
.hot-meta span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.hot-card-top b {
  color: var(--market-blue);
  font-family: var(--mono);
}

.hot-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 4px 0;
  color: var(--gulf-ink);
  font-size: 0.95rem;
  line-height: 1.28;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hot-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.detail-hint {
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
  color: var(--market-blue);
  font-size: 0.75rem;
  font-weight: 800;
}

.notice {
  display: inline-flex;
  margin-bottom: 10px;
  border: 1px solid rgba(216, 86, 60, 0.28);
  border-radius: 6px;
  padding: 6px 10px;
  color: #7b341f;
  background: #fff1df;
  font-size: 0.86rem;
}

.mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  border: 1px solid rgba(47, 154, 160, 0.24);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.74);
}

.mode-banner > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mode-banner p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 6px;
  padding: 0 9px;
  color: #063d42;
  background: rgba(47, 154, 160, 0.16);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.mode-pill.is-warm {
  color: #5d3f00;
  background: rgba(245, 197, 66, 0.28);
}

.mode-pill.is-muted {
  color: var(--muted);
  background: rgba(98, 115, 106, 0.12);
}

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

.metric,
.decision-block,
.copy-grid article,
.copy-columns article,
.opportunity,
.radar-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
}

.metric {
  position: relative;
  min-height: 124px;
  overflow: hidden;
  padding: 16px;
  overflow-wrap: anywhere;
}

.metric::after {
  position: absolute;
  right: 10px;
  bottom: -36px;
  width: 76px;
  height: 76px;
  border: 1px solid rgba(47, 154, 160, 0.18);
  border-radius: 50%;
  content: "";
}

.metric span,
.metric-kicker,
.decision-block span,
.copy-grid span,
.copy-columns span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--gulf-ink);
  font-family: var(--display);
  font-size: 1.7rem;
  line-height: 1.1;
}

.metric small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.workflow-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.workflow-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.step-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 6px;
  color: var(--gulf-ink);
  background: var(--noon-gold);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 700;
}

.workflow-step b {
  display: block;
  color: var(--gulf-ink);
  font-size: 0.92rem;
}

.workflow-step small {
  display: inline-flex;
  margin: 4px 0;
  color: var(--market-blue);
  font-weight: 800;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.tabs {
  display: flex;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.56);
}

.tabs button {
  color: var(--muted);
  flex: 1 1 0;
  border-color: transparent;
  border-radius: 6px;
  background: transparent;
}

.tabs button.is-active {
  color: var(--gulf-ink);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(16, 47, 43, 0.08);
}

.report-panel {
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 2.2vw, 26px);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading span {
  color: var(--market-blue);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.section-heading h2,
.minor-title {
  margin: 0;
  color: var(--gulf-ink);
  font-family: var(--display);
}

.compact-heading {
  margin: 18px 0 10px;
}

.compact-heading h3 {
  margin: 0;
  color: var(--gulf-ink);
}

.market-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.radar-card {
  overflow: hidden;
}

.radar-card img {
  display: block;
  width: 100%;
  height: 196px;
  object-fit: cover;
  background: var(--gulf-ink);
}

.radar-card div {
  padding: 14px;
}

.radar-card b {
  display: block;
  color: var(--gulf-ink);
  font-size: 1.05rem;
}

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

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

.product-sample {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  transition: border-color 160ms ease, transform 160ms ease;
}

.product-sample img,
.sample-placeholder {
  width: 58px;
  height: 58px;
  border-radius: 6px;
  background: #eff5ed;
}

.product-sample img {
  object-fit: cover;
}

.sample-placeholder {
  display: grid;
  place-items: center;
  color: var(--gulf-ink);
  font-family: var(--display);
  font-weight: 700;
}

.product-sample b,
.product-sample p,
.product-sample small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-sample b {
  color: var(--gulf-ink);
}

.product-sample p {
  margin: 2px 0;
  color: var(--text);
  font-size: 0.86rem;
}

.product-sample small {
  color: var(--muted);
  font-size: 0.74rem;
}

.product-drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  display: grid;
  gap: 14px;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 70px rgba(18, 35, 63, 0.22);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h2 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--gulf-ink);
  font-size: 1.08rem;
  line-height: 1.35;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.drawer-close {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gulf-ink);
  background: var(--surface-soft);
  font-size: 1.35rem;
  line-height: 1;
}

.drawer-media img,
.drawer-image-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eff5ed;
}

.drawer-media img {
  object-fit: contain;
}

.drawer-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--gulf-ink);
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 800;
}

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

.drawer-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
  background: #eff5ed;
}

.drawer-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.drawer-actions .primary-button,
.drawer-actions .ghost-button {
  justify-content: center;
  min-height: 42px;
  text-align: center;
  text-decoration: none;
}

.drawer-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.drawer-metrics article {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px;
  background: var(--surface-soft);
}

.drawer-metrics span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.drawer-metrics strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--gulf-ink);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.drawer-analysis {
  border-left: 4px solid var(--market-blue);
  border-radius: 6px;
  padding: 12px;
  background: #f4f8ff;
}

.drawer-analysis span {
  color: var(--market-blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.drawer-analysis p {
  margin: 6px 0;
  color: var(--text);
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

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

th {
  color: var(--gulf-ink);
  background: #eff5ed;
  font-size: 0.82rem;
}

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

.risk-list,
.bullet-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.risk-list li,
.bullet-list li {
  border-left: 4px solid var(--noon-gold);
  padding: 10px 12px;
  background: #fffaf0;
}

.opportunity-list {
  display: grid;
  gap: 12px;
}

.opportunity {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 96px minmax(260px, 1.5fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  transition: transform 140ms ease, border-color 140ms ease;
}

.opportunity:hover {
  border-color: rgba(47, 154, 160, 0.5);
  transform: translateY(-1px);
}

.opportunity.is-blue {
  border-color: rgba(47, 154, 160, 0.58);
  background: #f1fbfa;
}

.tag {
  display: inline-block;
  margin-bottom: 8px;
  border-radius: 6px;
  padding: 3px 8px;
  color: #063d42;
  background: rgba(47, 154, 160, 0.16);
  font-size: 0.78rem;
  font-weight: 700;
}

.opportunity h3 {
  margin-bottom: 2px;
  color: var(--gulf-ink);
}

.arabic {
  font-family: Tahoma, Arial, sans-serif;
}

.score-ring {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #fff 72%, transparent 74%),
    conic-gradient(var(--market-blue) calc(var(--score) * 1%), #dce7e2 0);
}

.score-ring strong {
  margin-top: 12px;
  color: var(--gulf-ink);
}

.score-ring span {
  margin-top: -20px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
}

.decision-grid,
.copy-grid,
.copy-columns {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

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

.decision-block,
.copy-grid article,
.copy-columns article {
  padding: 16px;
}

.decision-block h3 {
  margin: 8px 0;
  color: var(--gulf-ink);
}

.decision-block ol {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.decision-block li small {
  display: block;
  color: var(--muted);
}

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

.copy-grid p,
.copy-columns p {
  margin: 8px 0 0;
}

.copy-columns {
  grid-template-columns: 1.2fr 1fr 1fr;
  margin-top: 16px;
}

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

  .login-insight {
    order: -1;
    min-height: 340px;
  }

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

  .control-panel {
    position: static;
    height: auto;
    min-height: auto;
  }

  .summary-grid,
  .workflow-rail,
  .copy-grid,
  .hot-list,
  .product-sample-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    font-size: 15px;
  }

  .login-shell {
    background-size: 32px 32px;
  }

  .login-card,
  .control-panel,
  .report-shell {
    padding: 20px;
  }

  .login-card {
    margin: 16px;
  }

  .login-insight {
    min-height: auto;
    padding: 28px 20px;
  }

  .login-insight h2 {
    font-size: 2rem;
  }

  .login-metric-grid {
    grid-template-columns: 1fr;
  }

  .demo-credential {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .workflow-rail,
  .market-layout,
  .decision-grid,
  .copy-grid,
  .copy-columns,
  .opportunity,
  .product-sample-grid {
    grid-template-columns: 1fr;
  }

  .mode-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-topbar,
  .leaderboard-head,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .leaderboard-metrics,
  .hot-list {
    grid-template-columns: 1fr;
  }

  .hot-card {
    grid-template-columns: 42px 62px minmax(0, 1fr);
  }

  .hot-card img,
  .hot-card .sample-placeholder {
    width: 62px;
    height: 62px;
  }

  .product-drawer {
    inset: 0;
    width: 100vw;
    max-height: 100vh;
    border-radius: 0;
  }

  .drawer-actions,
  .drawer-metrics {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .tabs button {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .tab-panel.is-active {
    animation: enter 160ms ease-out;
  }

  @keyframes enter {
    from {
      opacity: 0;
      transform: translateY(4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
