:root {
  color-scheme: light;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e1e7f0;
  --text: #111827;
  --muted: #64748b;
  --indigo: #4f46e5;
  --indigo-2: #eef2ff;
  --green: #11845b;
  --green-2: #e9f8f1;
  --yellow: #a16207;
  --yellow-2: #fff7df;
  --red: #b42318;
  --red-2: #fff1f0;
  --blue: #175cd3;
  --blue-2: #eff8ff;
  --orange: #f97316;
  --orange-2: #fff4e6;
  --dark-bg: #0b0f17;
  --dark-surface: #111827;
  --dark-surface-2: #171c26;
  --shadow: 0 18px 44px rgba(15, 23, 42, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

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

button {
  border: 0;
  cursor: pointer;
}

.mini-link {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff8ff;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.mini-link:hover {
  background: #dbeafe;
}

noscript {
  display: block;
  padding: 16px;
  background: var(--red-2);
  color: var(--red);
}

#app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: #fbfcff;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 12px;
}

.brand img,
.brand-logo {
  width: 42px;
  height: 42px;
}

.brand-logo {
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 138, 0, 0.16), transparent 58%),
    #050506 url("/icon.svg") center / 72% no-repeat;
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand span,
.sidebar footer,
.muted,
.panel-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.mode-card,
.panel,
.highlight {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.mode-card {
  padding: 13px;
}

.mode-row,
.metric,
.task,
.request > div {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mode-row {
  margin-bottom: 10px;
}

.mode-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.mode-actions button {
  min-width: 0;
  min-height: 30px;
  padding: 5px 6px;
  border: 1px solid #dbe4f0;
  border-radius: 7px;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.nav {
  overflow: auto;
  padding-right: 2px;
}

.nav-group {
  margin-bottom: 16px;
}

.nav-group > span {
  display: block;
  margin: 0 0 6px 8px;
  color: #98a2b3;
  font-size: 11px;
  font-weight: 800;
}

.nav-item {
  width: 100%;
  min-height: 38px;
  margin: 2px 0;
  padding: 7px 10px;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 7px;
  background: transparent;
  color: #344054;
  text-align: left;
}

.nav-item b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
}

.nav-item em {
  min-width: 0;
  font-style: normal;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.nav-item.active {
  background: var(--indigo-2);
  color: var(--indigo);
}

.nav-item.active b {
  background: var(--indigo);
  color: #ffffff;
}

.nav-symbol {
  display: inline-grid;
  width: 1.1em;
  height: 1.1em;
  min-width: 1.1em;
  place-items: center;
  line-height: 1;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.sidebar footer {
  margin-top: auto;
  text-align: center;
}

main {
  min-width: 0;
  padding: 26px 28px 44px;
}

.topbar {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.topbar > div {
  min-width: 0;
}

.topbar p {
  margin: 0 0 4px;
  color: var(--indigo);
  font-size: 12px;
  font-weight: 850;
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.2;
}

.topbar span {
  display: block;
  max-width: 100%;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
}

.top-actions {
  max-width: 54%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-strip article {
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.status-strip .chip {
  width: 100%;
}

.status-strip article > span,
.metric span,
.task span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.status-strip article > span {
  display: block;
  margin-bottom: 8px;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #fedf89;
  background: var(--yellow-2);
  color: var(--yellow);
  font-size: 13px;
}

.notice.danger {
  border-color: #fecdca;
  background: var(--red-2);
  color: var(--red);
}

.page {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.health-rail,
.highlight-rail {
  display: grid;
  gap: 10px;
}

.health-rail {
  grid-template-columns: repeat(8, minmax(112px, 1fr));
}

.health-pill {
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.health-pill strong,
.health-pill span {
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.health-pill > span:last-child {
  color: var(--muted);
}

.highlight-rail {
  grid-template-columns: repeat(7, minmax(116px, 1fr));
}

.highlight {
  min-width: 0;
  min-height: 128px;
  padding: 13px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: hidden;
}

.highlight i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--indigo-2);
  color: var(--indigo);
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.highlight strong {
  min-width: 0;
  max-width: 100%;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.highlight small {
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.grid {
  min-width: 0;
  display: grid;
  gap: 16px;
}

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

.grid.tight {
  gap: 10px;
}

.panel {
  min-width: 0;
  max-width: 100%;
  padding: 16px;
}

.panel-head {
  min-height: 28px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-head h2 {
  min-width: 0;
  margin: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 25px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
  line-height: 1.25;
}

.chip-good {
  border-color: #abefc6;
  background: var(--green-2);
  color: var(--green);
}

.chip-warn {
  border-color: #fedf89;
  background: var(--yellow-2);
  color: var(--yellow);
}

.chip-danger {
  border-color: #fecdca;
  background: var(--red-2);
  color: var(--red);
}

.chip-info {
  border-color: #b2ddff;
  background: var(--blue-2);
  color: var(--blue);
}

.clock-chip {
  min-width: 132px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
}

.status-dot-good {
  background: var(--green);
}

.status-dot-warn {
  background: #f59e0b;
}

.status-dot-danger {
  background: var(--red);
}

.status-dot-info {
  background: var(--blue);
}

.metrics,
.task-list {
  display: grid;
  gap: 9px;
}

.metric,
.task {
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.metric .chip,
.task .chip {
  max-width: min(100%, 220px);
}

.metric-long {
  grid-template-columns: minmax(96px, 0.36fr) minmax(0, 1fr);
}

.machine-chip {
  min-width: 0;
  max-width: 100%;
  min-height: 25px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: #344054;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.machine-value {
  display: block;
  min-width: 0;
  max-width: 100%;
  color: inherit;
  font: inherit;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.advisor-avatar-row,
.advisor-avatar-wide {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.advisor-avatar-wide {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.advisor-avatar {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--indigo);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(79, 70, 229, 0.22);
  font-weight: 900;
}

.advisor-avatar-row p,
.advisor-avatar-wide p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.chat-preview,
.chat-log {
  display: grid;
  gap: 10px;
}

.bubble,
.message {
  max-width: 86%;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.bubble.user,
.message.user {
  justify-self: end;
  background: var(--indigo);
  color: #ffffff;
}

.bubble.advisor,
.message.advisor {
  justify-self: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.actions {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.actions button,
.chat-form button,
.control-form button,
.suggestions button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  background: var(--indigo);
  color: #ffffff;
  font-weight: 850;
  white-space: nowrap;
}

.actions button:last-child {
  background: #111827;
}

.fresh-grid,
.market-pulse,
.feature-grid,
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fresh-grid > div,
.pulse-card,
.feature-grid article,
.health-grid article,
.company-brief,
.request,
.timeline article,
.decision-grid article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.fresh-grid strong,
.fresh-grid small {
  display: block;
}

.fresh-grid small {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.pulse-card {
  min-height: 124px;
  display: grid;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.premium-pulse .pulse-card {
  min-height: 150px;
  background:
    radial-gradient(circle at 78% 18%, rgba(249, 115, 22, 0.14), transparent 32%),
    linear-gradient(180deg, #151b26 0%, #101620 100%);
  border-color: #344052;
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.03);
}

.premium-pulse .pulse-card-live {
  border-color: rgba(249, 115, 22, 0.48);
}

.pulse-card-warn {
  border-color: rgba(249, 115, 22, 0.62);
  background:
    repeating-linear-gradient(90deg, rgba(249, 115, 22, 0.08), rgba(249, 115, 22, 0.08) 10px, transparent 10px, transparent 22px),
    linear-gradient(180deg, #18140d 0%, #111418 100%);
}

.pulse-card-blocked {
  opacity: 0.92;
  border-color: rgba(148, 163, 184, 0.36);
  background:
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.07), rgba(148, 163, 184, 0.07) 10px, transparent 10px, transparent 22px),
    linear-gradient(180deg, #141821 0%, #0f141c 100%);
}

.pulse-card-dimmed {
  border-style: dashed;
}

.pulse-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pulse-card strong,
.feature-grid strong {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pulse-card strong,
.pulse-card b {
  color: #f8fafc;
}

.pulse-card span,
.pulse-card small,
.feature-grid p,
.health-grid p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.pulse-card b {
  font-size: 18px;
  text-align: right;
  overflow-wrap: anywhere;
}

.pulse-value {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pulse-chart {
  min-height: 42px;
  padding: 2px 0;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(249, 115, 22, 0.14), rgba(249, 115, 22, 0.03));
  overflow: hidden;
}

.pulse-card small {
  text-align: right;
  font-weight: 850;
}

.pulse-card small.up {
  color: var(--green);
}

.pulse-card small.down {
  color: var(--red);
}

.pulse-card footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.pulse-card footer small {
  flex: 1 1 100%;
  text-align: right;
  overflow-wrap: anywhere;
}

.sparkline {
  width: 100%;
  height: 38px;
}

.sparkline-empty {
  border-radius: 6px;
  background: repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.18) 8px, rgba(148, 163, 184, 0.055) 8px, rgba(148, 163, 184, 0.055) 16px);
}

.sparkline-dimmed {
  opacity: 0.48;
  filter: grayscale(0.45);
}

.sparkline polyline {
  fill: none;
  stroke: var(--orange);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.portfolio-rings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.ring {
  min-height: 112px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: radial-gradient(circle at center, #ffffff 0 52%, var(--green-2) 53%);
}

.ring.accent {
  background: radial-gradient(circle at center, #ffffff 0 52%, var(--indigo-2) 53%);
}

.ring b {
  font-size: 22px;
  overflow-wrap: anywhere;
}

.ring span {
  color: var(--muted);
  font-size: 12px;
}

.portfolio-visual {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 12px;
}

.portfolio-donut {
  width: 158px;
  height: 158px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #ffffff 0 48%, transparent 49%), var(--portfolio-conic, conic-gradient(#16a34a 0 100%));
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.36);
}

.portfolio-donut b {
  font-size: 26px;
  line-height: 1;
}

.portfolio-donut span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.portfolio-legend {
  display: grid;
  gap: 8px;
}

.portfolio-legend div {
  min-width: 0;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.portfolio-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.portfolio-legend .legend-cash {
  background: #16a34a;
}

.portfolio-legend .legend-equity {
  background: var(--indigo);
}

.portfolio-legend span,
.portfolio-legend small {
  color: var(--muted);
  font-size: 12px;
}

.portfolio-legend strong {
  font-size: 13px;
}

.holding-preview {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.holding-preview article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcff;
}

.holding-preview strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.holding-preview span {
  color: var(--muted);
  font-size: 12px;
}

.advisor-panel {
  min-height: 640px;
}

.chat-log {
  min-height: 360px;
  align-content: start;
  padding: 14px;
  border-radius: 8px;
  background: #fbfcff;
  border: 1px solid var(--line);
}

.message p {
  margin: 0;
}

.chat-form,
.control-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.chat-form {
  grid-template-columns: minmax(0, 1fr) auto;
}

.chat-form input,
.control-form input,
.control-form textarea,
.control-form select {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
}

.control-form label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 850;
}

.control-form textarea {
  min-height: 96px;
  resize: vertical;
}

.suggestions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestions button {
  background: var(--surface-2);
  color: #344054;
  border: 1px solid var(--line);
}

.request-list,
.timeline,
.decision-grid {
  display: grid;
  gap: 10px;
}

.request p,
.decision-grid p,
.company-brief p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.request small,
.request span,
.timeline time {
  color: var(--muted);
  font-size: 12px;
}

.company-brief {
  margin-top: 14px;
}

.company-brief header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.company-brief header div {
  min-width: 0;
}

.company-brief header strong,
.company-brief header span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.company-brief header span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

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

.brief-columns section {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.brief-columns h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.brief-columns p {
  margin: 7px 0;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  color: var(--muted);
  font-size: 12px;
}

td strong,
td span,
td small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

td span,
td small {
  margin-top: 4px;
  color: var(--muted);
}

.num {
  text-align: right;
}

.progress {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9edf5;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.progress-accent {
  background: var(--indigo);
}

.bottom-nav {
  display: none;
}

@media (max-width: 1240px) {
  #app {
    grid-template-columns: 220px minmax(0, 1fr);
  }

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

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

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

@media (max-width: 860px) {
  :root {
    --bg: #0b0f17;
    --surface: #111827;
    --surface-2: #171c26;
    --line: #273244;
    --text: #f8fafc;
    --muted: #9ca3af;
    --indigo: #8b7cff;
    --indigo-2: rgba(139, 124, 255, 0.16);
    --green-2: rgba(17, 132, 91, 0.17);
    --yellow-2: rgba(249, 115, 22, 0.16);
    --red-2: rgba(180, 35, 24, 0.17);
    --blue-2: rgba(23, 92, 211, 0.18);
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  }

  #app {
    display: block;
  }

  .sidebar {
    display: none;
  }

  main {
    padding: 18px 14px 88px;
  }

  .topbar {
    display: grid;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .top-actions {
    max-width: none;
    justify-content: flex-start;
  }

  .status-strip,
  .highlight-rail,
  .health-rail {
    display: flex;
    max-width: 100%;
    overflow: auto;
    padding-bottom: 4px;
  }

  .status-strip article,
  .highlight,
  .health-pill {
    min-width: 136px;
  }

  .premium-pulse .pulse-card {
    min-height: 156px;
    border-color: #354052;
    background:
      radial-gradient(circle at 82% 18%, rgba(249, 115, 22, 0.16), transparent 30%),
      linear-gradient(180deg, #151b26 0%, #101620 100%);
  }

  .pulse-card-warn {
    border-color: rgba(249, 115, 22, 0.72);
    background:
      repeating-linear-gradient(90deg, rgba(249, 115, 22, 0.11), rgba(249, 115, 22, 0.11) 10px, transparent 10px, transparent 22px),
      #18140d;
  }

  .pulse-card strong,
  .pulse-card b {
    color: #f8fafc;
  }

  .pulse-chart {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.14), rgba(249, 115, 22, 0.03));
  }

  .metric,
  .task {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .metric .chip,
  .task .chip {
    justify-self: start;
    max-width: 100%;
  }

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

  .machine-chip {
    justify-self: start;
    background: #111827;
    color: #f8fafc;
    border-color: #344052;
  }

  .grid.two,
  .fresh-grid,
  .market-pulse,
  .feature-grid,
  .health-grid,
  .portfolio-rings,
  .portfolio-visual,
  .brief-columns {
    grid-template-columns: 1fr;
  }

  .portfolio-donut {
    width: 136px;
    height: 136px;
  }

  .portfolio-legend div,
  .holding-preview article {
    grid-template-columns: 10px minmax(0, 1fr) auto;
  }

  .portfolio-legend small {
    grid-column: 2 / -1;
  }

  .panel {
    padding: 14px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .bubble,
  .message {
    max-width: 94%;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(11, 15, 23, 0.96);
    backdrop-filter: blur(16px);
  }

  .bottom-nav button {
    min-height: 48px;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 2px;
  }

  .bottom-nav b,
  .bottom-nav span {
    display: block;
  }

  .bottom-nav b {
    font-size: 12px;
  }

  .bottom-nav span {
    font-size: 11px;
    font-weight: 850;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .bottom-nav .active {
    background: rgba(249, 115, 22, 0.18);
    color: #ffb86b;
  }
}

.lock-body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  background: #0a0a0c;
  color: #f1f5f9;
}

.lock-shell {
  width: min(100%, 448px);
}

.lock-card {
  border: 1px solid #27272a;
  border-radius: 24px;
  background: #141417;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 36px 24px 28px;
  text-align: center;
  color: #f1f5f9;
}

.lock-logo {
  width: 84px;
  height: 84px;
  margin: 12px auto 0;
  border-radius: 22px;
  background: #ffffff;
  color: #000000;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 1;
}

.lock-card .eyebrow {
  margin-top: 28px;
  color: #64748b;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.lock-card h1 {
  margin: 8px 0 12px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #f1f5f9;
}

.lock-copy,
.lock-note,
.setup-panel p {
  color: var(--muted);
  line-height: 1.6;
}

.lock-status {
  margin: 20px 0 0;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 500;
  font-size: 13px;
  background: #1e1e24;
  color: #94a3b8;
  text-align: center;
}

.lock-status[data-tone="good"] {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
}

.lock-status[data-tone="warn"] {
  border-color: rgba(245, 184, 74, 0.35);
  background: rgba(245, 184, 74, 0.10);
  color: #F5B84A;
}

.lock-status[data-tone="danger"] {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.setup-panel {
  margin-bottom: 14px;
}

.setup-panel.hidden {
  display: none;
}

.setup-panel label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.setup-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 12px;
}

.lock-actions {
  display: grid;
  gap: 12px;
  margin: 28px 0 20px;
}

.lock-actions button {
  min-height: 52px;
  padding: 15px 18px;
  border-radius: 24px;
  font-weight: 500;
  font-size: 14px;
  background: #FF7A1F;
  color: #101114;
  box-shadow: 0 12px 30px -10px rgba(255, 122, 31, 0.5);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lock-actions button:not(.secondary):hover,
.lock-actions button:not(.secondary):active {
  background: #FFA55C;
}

.lock-actions .secondary {
  color: #f1f5f9;
  background: #1e1e24;
  border: 1px solid #27272a;
}

.device-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.device-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.device-row span,
.device-row small {
  color: var(--muted);
  font-weight: 750;
}

@media (max-width: 720px) {
  .device-row {
    grid-template-columns: 1fr;
  }
}

/* v0.4.11a broker-grade black/orange UI layer.
   This layer is intentionally last so existing route/state logic stays intact. */
:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-2: #090909;
  --surface: #0d0d0f;
  --surface-2: #151518;
  --surface-3: #1d1d21;
  --soft: #121216;
  --line: #2a2a30;
  --line-strong: #3a3a42;
  --ink: #f5f5f4;
  --text: #f5f5f4;
  --muted: #a1a1aa;
  --muted-2: #71717a;
  --indigo: #ff8a00;
  --indigo-2: #4a2606;
  --orange: #ff8a00;
  --orange-soft: rgba(255, 138, 0, 0.16);
  --green: #22c55e;
  --red: #ff5b5b;
  --blue: #60a5fa;
  --yellow: #fbbf24;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
}

body,
.lock-body {
  background: #0a0a0c;
  color: #f1f5f9;
}

main,
.page,
.sidebar {
  background: transparent;
}

.sidebar,
.panel,
.mode-card,
.metric,
.metric-value,
.task-list article,
.fresh-grid > div,
.timeline article,
.holding-preview article,
.company-brief,
.device-row,
.lock-card {
  background: #141417;
  border-color: #27272a;
  color: #f1f5f9;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.panel h1,
.panel h2,
.panel h3,
.sidebar strong,
.metric strong,
.metric-value strong,
.message p,
.pulse-card strong,
.pulse-card b,
.company-brief strong {
  color: var(--text);
}

.muted,
.panel-copy,
.metric span,
.metric-value span,
.pulse-card span,
.pulse-card small,
.device-row span,
.device-row small,
.lock-copy,
.lock-note,
.setup-panel p {
  color: var(--muted);
}

.nav-item,
.sidebar button,
.suggestions button,
.actions button,
.chat-form button,
.lock-actions button {
  border-color: #ffffff;
}

.nav-item.active,
.bottom-nav .active,
.actions button:first-child,
.chat-form button {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.lock-actions button {
  background: #FF7A1F;
  color: #101114;
  border-color: #FF7A1F;
  box-shadow: 0 12px 30px -10px rgba(255, 122, 31, 0.5);
}

.actions button:not(:first-child),
.suggestions button,
.lock-actions .secondary {
  background: #1e1e24;
  color: #f1f5f9;
  border: 1px solid #27272a;
  box-shadow: none;
}

.chip {
  border-color: var(--line-strong);
  background: #111115;
  color: var(--text);
}

.chip-good {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.42);
  color: #86efac;
}

.chip-warn {
  background: rgba(251, 191, 36, 0.14);
  border-color: rgba(251, 191, 36, 0.45);
  color: #facc15;
}

.chip-danger {
  background: rgba(255, 91, 91, 0.14);
  border-color: rgba(255, 91, 91, 0.45);
  color: #fca5a5;
}

.chip-info,
.chip-neutral {
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.34);
  color: #bfdbfe;
}

.pulse-card {
  background: linear-gradient(180deg, #111113, #09090a);
  border-color: #2c2c31;
}

.pulse-card:not(.pulse-card-warn) {
  border-color: rgba(255, 138, 0, 0.3);
}

.pulse-card-warn {
  background: linear-gradient(180deg, rgba(42, 28, 8, 0.96), rgba(18, 15, 10, 0.96));
  border-color: rgba(251, 191, 36, 0.44);
}

.sparkline {
  background: linear-gradient(180deg, rgba(255, 138, 0, 0.05), rgba(255, 138, 0, 0.01));
}

.sparkline polyline {
  stroke: #ff8a80;
  stroke-width: 2.2;
}

.sparkline-area {
  fill: rgba(255, 138, 128, 0.2);
}

.sparkline-baseline {
  stroke: rgba(255, 255, 255, 0.2);
  stroke-dasharray: 2 3;
}

.sparkline-down polyline {
  stroke: #60a5fa;
}

.sparkline-down .sparkline-area {
  fill: rgba(96, 165, 250, 0.18);
}

.sparkline-empty {
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 16px);
}

.portfolio-donut {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle, #0b0b0d 0 45%, transparent 46%),
    conic-gradient(from -90deg, var(--portfolio-conic, #ff8a00 0deg, #60a5fa 360deg));
  box-shadow: inset 0 0 0 10px rgba(255, 255, 255, 0.04), 0 18px 42px rgba(0, 0, 0, 0.28);
}

.portfolio-donut b,
.portfolio-donut span {
  color: #fff;
  text-shadow: 0 2px 12px #000;
}

.portfolio-legend i,
.holding-preview i {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.message {
  color: var(--text);
  border-color: var(--line);
}

.message.user {
  background: linear-gradient(180deg, #ff9d26, #c95f00);
  color: #111;
}

.message.user p {
  color: #111;
}

.message.advisor {
  background: #111115;
}

.chat-form input,
.chat-form textarea,
.setup-panel input,
input,
select,
textarea {
  background: #f8fafc;
  color: #111827;
  border: 2px solid rgba(255, 138, 0, 0.55);
  caret-color: #0b63ce;
}

.chat-form input::placeholder,
.chat-form textarea::placeholder,
input::placeholder,
textarea::placeholder {
  color: #6b7280;
  opacity: 1;
}

.bottom-nav {
  background: rgba(5, 5, 5, 0.97);
  border-top-color: var(--line-strong);
}

.bottom-nav button {
  color: #b8b8c0;
}

.bottom-nav .active {
  color: #ffbd73;
}

.lock-status {
  background: #1e1e24;
  border-color: #27272a;
  color: #94a3b8;
}

.lock-status[data-tone="good"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
  color: #f1f5f9;
}

.lock-status[data-tone="warn"] {
  background: rgba(245, 184, 74, 0.10);
  border-color: rgba(245, 184, 74, 0.35);
  color: #F5B84A;
}

.lock-status[data-tone="danger"] {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  color: #ef4444;
}

code,
pre,
.technical-token,
.api-token {
  overflow-wrap: anywhere;
}

.mode-card .metric,
.sidebar .metric {
  grid-template-columns: minmax(76px, auto) minmax(0, 1fr);
  gap: 10px;
}

.mode-card .metric {
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.mode-card .metric span,
.sidebar .metric span {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  line-height: 1.35;
}

.mode-card .metric .chip,
.sidebar .metric .chip,
.mode-card .metric .mini-link,
.sidebar .metric .mini-link {
  min-width: 0;
  justify-self: end;
  white-space: nowrap;
}

.mode-card .metric .chip,
.mode-card .metric .mini-link {
  justify-self: start;
  max-width: 100%;
}

@media (max-width: 720px) {
  html,
  body,
  #app,
  main,
  .page,
  .panel,
  .card {
    max-width: 100%;
    overflow-x: hidden;
  }

  main {
    width: 100%;
    box-sizing: border-box;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .topbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .topbar span {
    max-width: calc(100vw - 28px);
  }

  .top-actions {
    max-width: 100%;
    justify-content: flex-start;
  }

  .page {
    gap: 14px;
  }

  .panel {
    border-radius: 8px;
  }

  .chat-form input {
    min-height: 52px;
    font-size: 16px;
  }

  .topbar p,
  .topbar span,
  .advisor-avatar-row p,
  .advisor-avatar-wide p,
  .bubble,
  .message,
  .panel,
  .card {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .status-strip,
  .highlight-rail,
  .health-rail {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
  }

  .advisor-avatar-row,
  .advisor-avatar-wide {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .advisor-avatar {
    width: 46px;
    height: 46px;
  }

  .actions,
  .quick-actions,
  .control-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .actions button,
  .quick-actions button,
  .control-quick button {
    min-width: 0;
    flex: 1 1 132px;
  }

  .bottom-nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .bottom-nav button {
    min-width: 0;
  }

  .bottom-nav span {
    font-size: 10px;
    white-space: normal;
    line-height: 1.15;
  }
}

.health-rail {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.health-pill {
  border-radius: 10px;
  min-height: 48px;
  grid-template-columns: 10px minmax(132px, 1fr) auto;
}

.health-pill strong,
.health-pill span {
  overflow-wrap: normal;
  word-break: keep-all;
}

.health-pill strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-pill > span:last-child {
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .health-rail {
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  }

  .health-pill {
    grid-template-columns: 10px minmax(108px, 1fr) auto;
  }
}

@media (max-width: 720px) {
  .health-rail {
    grid-template-columns: 1fr;
  }
}

/* UI human-review hotfix layer: visual-only fixes, no trading logic. */
.lock-card .eyebrow {
  color: #64748b;
}

.lock-logo {
  border: 0;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.lock-card h1 {
  word-break: keep-all;
  overflow-wrap: normal;
}

.advisor-panel {
  background: linear-gradient(180deg, rgba(18, 18, 21, 0.98), rgba(8, 8, 10, 0.98));
}

.advisor-avatar-wide {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(24, 24, 28, 0.98), rgba(14, 14, 17, 0.98));
}

.advisor-panel .chat-log {
  min-height: 280px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    radial-gradient(circle at 82% 12%, rgba(255, 138, 0, 0.08), transparent 30%),
    #08090d;
}

.bubble.advisor,
.message.advisor {
  background: #111115;
  border-color: #2c2c31;
  color: #f8fafc;
}

.bubble.advisor p,
.message.advisor p {
  color: #f8fafc;
}

.chat-form input,
.chat-form textarea {
  background: #ffffff;
  color: #08111f;
  border-color: rgba(255, 138, 0, 0.78);
  font-weight: 760;
}

.chat-form input::placeholder,
.chat-form textarea::placeholder {
  color: #334155;
  opacity: 1;
}

.market-pulse {
  gap: 12px;
}

.premium-pulse .pulse-card {
  border-radius: 12px;
  padding: 14px;
}

.pulse-head span {
  text-align: right;
  overflow-wrap: anywhere;
}

.portfolio-visual {
  gap: 14px;
}

.portfolio-legend div {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #111115;
}

@media (max-width: 720px) {
  .status-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }

  .status-strip article {
    min-width: 0;
    min-height: 68px;
  }

  .status-strip .chip {
    min-width: 0;
    white-space: normal;
  }

  .advisor-panel .chat-log {
    min-height: 240px;
  }

  .market-pulse {
    gap: 10px;
  }
}

@media (max-width: 390px) {
  .status-strip {
    grid-template-columns: 1fr;
  }

  .lock-card h1 {
    font-size: 22px;
  }
}

/* v0.4.11a UI product polish layer: Korean wrapping and mobile product quality. */
.no-orphan-ko,
.label-nowrap,
.action-label,
.status-label,
.chip-label,
.tab-label,
.panel-head h2,
.mode-row strong,
.nav-item em,
.bottom-nav span,
.actions button,
.mode-actions button,
.mini-link,
.ghost-button,
.chat-form button,
.control-form button,
.suggestions button,
.lock-actions button {
  word-break: keep-all;
  overflow-wrap: normal;
  line-break: strict;
  text-wrap: balance;
}

.label-nowrap,
.action-label,
.chip-label,
.tab-label,
.mini-link,
.ghost-button {
  white-space: nowrap;
}

.status-label {
  white-space: normal;
}

.chip-label {
  min-width: max-content;
  max-width: 100%;
}

.task .chip-label,
.metric .chip-label,
.status-strip .chip-label {
  min-width: 0;
}

.task,
.metric,
.status-strip article,
.pulse-card,
.portfolio-legend div,
.holding-preview article {
  word-break: keep-all;
}

.panel-copy,
.muted,
.advisor-avatar-row p,
.advisor-avatar-wide p,
.message p,
.bubble,
.company-brief p,
.timeline p,
.decision-grid p {
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}

.lock-card {
  position: relative;
  overflow: hidden;
}

.lock-card::before {
  content: "";
  position: absolute;
  inset: -140px auto auto 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 122, 31, 0.13), transparent 66%);
  pointer-events: none;
}

.lock-logo {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  background: #ffffff;
  color: #000000;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

/* fpre.8-B: 잠금 배지 로봇(인라인 SVG · 가로 74%) · 중성 글로우 · 문안 색 — .lock-* 계열만 */
.lock-logo .lock-bot {
  width: 100%;
  height: 100%;
  display: block;
}
.lock-card::after {
  content: "";
  position: absolute;
  inset: auto -90px -90px auto;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 66%);
  pointer-events: none;
}
.lock-card > * {
  position: relative;
  z-index: 1;
}
.lock-copy,
.lock-note {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}
.lock-note {
  font-size: 12px;
  margin-top: 4px;
}

.advisor-panel .chat-log,
.chat-preview {
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 138, 0, 0.08), transparent 34%),
    linear-gradient(180deg, #08090d, #050608);
}

.advisor-panel .chat-form {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #08090d;
}

.advisor-panel .chat-form input,
.advisor-panel .chat-form textarea {
  min-height: 50px;
  border: 1px solid #31313a;
  background: #111115;
  color: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 138, 0, 0.08);
}

.advisor-panel .chat-form input::placeholder,
.advisor-panel .chat-form textarea::placeholder {
  color: #a1a1aa;
}

.advisor-panel .chat-form input:focus,
.advisor-panel .chat-form textarea:focus {
  outline: 2px solid rgba(255, 138, 0, 0.36);
  border-color: rgba(255, 138, 0, 0.78);
}

.message,
.bubble {
  border-radius: 14px;
}

.message.advisor,
.bubble.advisor {
  max-width: min(94%, 760px);
}

.market-pulse .pulse-card {
  gap: 9px;
}

.pulse-card footer {
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pulse-card footer small {
  flex-basis: 100%;
  text-align: right;
}

.portfolio-visual {
  grid-template-columns: minmax(148px, 180px) minmax(0, 1fr);
}

.portfolio-legend strong,
.portfolio-legend small,
.holding-preview strong,
.holding-preview span {
  white-space: nowrap;
}

.route-trends .page > .grid.two:first-child,
.route-portfolio .page,
.route-advisor .page,
.route-settings .page {
  gap: 14px;
}

@media (min-width: 861px) {
  .route-trends .status-strip-compact,
  .route-portfolio .status-strip-compact,
  .route-advisor .status-strip-compact,
  .route-settings .status-strip-compact {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .route-trends .status-strip-compact article,
  .route-portfolio .status-strip-compact article,
  .route-advisor .status-strip-compact article,
  .route-settings .status-strip-compact article {
    min-height: 54px;
    padding: 9px 10px;
  }
}

@media (max-width: 860px) {
  .status-strip-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-strip-compact article {
    min-height: 54px;
    padding: 8px 9px;
  }

  .route-trends .status-strip-compact article:nth-child(n+5),
  .route-portfolio .status-strip-compact article:nth-child(n+5),
  .route-advisor .status-strip-compact article:nth-child(n+5),
  .route-settings .status-strip-compact article:nth-child(n+5) {
    display: none;
  }

  .route-trends .topbar,
  .route-portfolio .topbar,
  .route-advisor .topbar,
  .route-settings .topbar {
    margin-bottom: 10px;
  }

  .route-trends .status-strip-compact,
  .route-portfolio .status-strip-compact,
  .route-advisor .status-strip-compact,
  .route-settings .status-strip-compact {
    margin-bottom: 12px;
  }

  .actions button,
  .control-quick button,
  .suggestions button {
    flex: 1 1 148px;
    min-height: 42px;
  }

  .mode-actions {
    grid-template-columns: 1fr;
  }

  .chip {
    font-size: 11px;
    padding-inline: 8px;
  }

  .bottom-nav span,
  .tab-label {
    white-space: nowrap;
    font-size: 10px;
  }

  .portfolio-visual {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar h1 {
    font-size: 21px;
  }

  .top-actions {
    gap: 6px;
  }

  .clock-chip {
    min-width: 0;
  }

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

  .status-strip article,
  .status-strip-compact article {
    min-height: 58px;
  }

  .status-strip .chip,
  .status-strip-compact .chip {
    max-width: 100%;
  }

  .market-pulse {
    grid-template-columns: 1fr;
  }

  .premium-pulse .pulse-card {
    min-height: 142px;
  }

  .advisor-panel .chat-log {
    min-height: 220px;
  }

  .advisor-panel .chat-form {
    padding: 8px;
  }

  .suggestions button {
    flex-basis: 100%;
  }
}

@media (max-width: 375px) {
  .actions button,
  .control-quick button,
  .mode-actions button {
    flex-basis: 100%;
    width: 100%;
  }

  .status-strip,
  .status-strip-compact {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    padding-left: 5px;
    padding-right: 5px;
  }

  .bottom-nav button {
    min-height: 46px;
    padding: 4px 2px;
  }

  .bottom-nav span,
  .tab-label {
    font-size: 9.5px;
  }
}

@media (max-width: 860px) {
  .highlight-rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  .highlight {
    min-width: 0;
  }
}

/* Institutional reliability hotfix: readable controls, company evidence cards, and dark advisor surfaces. */
.advisor-panel .chat-log,
.chat-log {
  background: #070a10;
  border-color: #252b37;
}

.chat-form,
.control-form {
  color: #f8fafc;
}

.chat-form input,
.control-form input,
.control-form textarea,
.control-form select {
  background: #080b12;
  color: #f8fafc;
  border-color: #303746;
  box-shadow: inset 0 0 0 1px rgba(255, 138, 0, 0.04);
}

.chat-form input::placeholder,
.control-form input::placeholder,
.control-form textarea::placeholder {
  color: #8994a8;
  opacity: 1;
}

.control-form label {
  color: #e5e7eb;
}

.control-form select option {
  background: #080b12;
  color: #f8fafc;
}

.control-quick .action-label {
  color: #f8fafc;
  border: 1px solid #2a3342;
  background: #10151f;
}

.actions.control-quick .action-label:not(.active),
.actions.control-quick .action-label:first-child:not(.active),
.control-quick .action-label[aria-pressed="false"] {
  color: #f8fafc !important;
  border-color: #2a3342 !important;
  background: #10151f !important;
  box-shadow: none !important;
}

.control-quick .action-label.active,
.control-quick .action-label[aria-pressed="true"],
.control-quick .action-label:focus-visible {
  color: #111827;
  border-color: #ff8a00;
  background: linear-gradient(135deg, #ff8a00, #f97316);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.22);
}

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

.company-data-tile {
  min-width: 0;
  padding: 10px;
  border: 1px solid #303746;
  border-radius: 7px;
  background: #0a0e16;
}

.company-data-tile span,
.company-data-tile small {
  display: block;
  min-width: 0;
  color: #9aa7bd;
  overflow-wrap: anywhere;
}

.company-data-tile strong {
  display: block;
  margin: 5px 0;
  color: #f8fafc;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.company-data-tile.blocked strong {
  color: #fbbf24;
}

.company-data-grid.empty-evidence .company-data-tile {
  border-color: rgba(251, 191, 36, 0.45);
  background: #12100a;
}

.sync-pending {
  color: #fbbf24 !important;
}

.explicit-empty {
  color: #f8fafc;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 7px;
  background: #12100a;
  padding: 12px;
}

.brief-columns section {
  background: #0a0e16;
  border-color: #303746;
}

.brief-columns h3 {
  color: #f8fafc;
}

.brief-columns p,
.request p,
.decision-grid p,
.company-brief p {
  color: #cbd5e1;
}

.timeline article {
  background: #0a0e16;
  border-color: #303746;
}

@media (max-width: 760px) {
  .company-data-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
