:root {
  --bg: #f2f6fb;
  --bg-deep: #e8f0fa;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --surface-muted: #f7f9fc;
  --surface-blue: #f1f6ff;
  --ink: #152238;
  --ink-2: #3e4e66;
  --ink-3: #718097;
  --line: rgba(40, 71, 112, 0.12);
  --line-strong: rgba(40, 71, 112, 0.2);
  --navy: #0c2b52;
  --navy-2: #143b6d;
  --blue: #2563d9;
  --blue-soft: #eaf1ff;
  --green: #16844b;
  --green-soft: #eaf8f0;
  --red: #bd3d46;
  --red-soft: #fff0f1;
  --amber: #b26a11;
  --amber-soft: #fff6e9;
  --shadow-sm: 0 1px 2px rgba(20, 42, 72, 0.04), 0 7px 20px rgba(32, 66, 110, 0.055);
  --shadow-md: 0 18px 50px rgba(38, 70, 110, 0.11), 0 2px 8px rgba(38, 70, 110, 0.05);
  --radius-sm: 10px;
  --radius-md: 15px;
  --radius-lg: 22px;
  --sidebar-width: 252px;
  --topbar-height: 72px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 11% -4%, rgba(93, 145, 222, 0.16), transparent 31rem),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.92), transparent 40rem),
    linear-gradient(145deg, #f8fafc 0%, var(--bg) 43%, #edf3fa 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(37, 99, 217, 0.24);
  outline-offset: 2px;
}
::selection { background: rgba(37, 99, 217, 0.18); }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  padding: 18px 14px 22px;
  overflow-y: auto;
  background: rgba(252, 253, 255, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}
.workspace-shell {
  grid-column: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  background: rgba(247, 250, 253, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}
.main-content {
  flex: 1;
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: 24px 28px 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 3px 8px 18px;
}
.brand img { width: 37px; height: 37px; filter: drop-shadow(0 4px 8px rgba(24, 70, 132, 0.2)); }
.brand__text { min-width: 0; }
.brand__title { font-weight: 740; font-size: 14px; letter-spacing: -0.02em; line-height: 1.05; }
.brand__subtitle { margin-top: 3px; color: var(--ink-3); font-size: 10px; letter-spacing: 0.09em; text-transform: uppercase; }

.nav-section { margin: 10px 0 18px; }
.nav-section__label {
  padding: 0 10px 7px;
  color: #8a97a9;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.nav-list { display: grid; gap: 2px; }
.nav-button {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 540;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.nav-button:hover { background: rgba(39, 94, 174, 0.065); color: var(--ink); }
.nav-button:active { transform: scale(.985); }
.nav-button.is-active {
  color: #164a9e;
  background: linear-gradient(100deg, rgba(47, 108, 210, 0.14), rgba(47, 108, 210, 0.055));
  box-shadow: inset 0 0 0 1px rgba(47, 108, 210, 0.06);
}
.nav-icon { width: 16px; height: 16px; flex: 0 0 auto; stroke-width: 1.8; }
.nav-badge {
  margin-left: auto;
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background: #edf2f8;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 700;
}
.nav-button.is-active .nav-badge { color: #164a9e; background: #dbe8ff; }

.sidebar-profile {
  margin-top: 24px;
  padding: 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.72);
}
.avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #2d69c8, #123a70);
  color: #fff;
  font-size: 11px;
  font-weight: 740;
}
.profile-copy { min-width: 0; }
.profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 700; }
.profile-meta { margin-top: 2px; color: var(--ink-3); font-size: 9px; }

.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__company { min-width: 0; }
.topbar__title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 20px; letter-spacing: -0.03em; }
.topbar__meta { margin-top: 4px; color: var(--ink-3); font-size: 10px; }
.icon-button, .button, .text-button, .segmented__button, .chip, .tab-button {
  border: 0;
  cursor: pointer;
}
.icon-button {
  width: 37px;
  height: 37px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(20,42,72,.025);
}
.icon-button:hover { background: #fff; border-color: var(--line-strong); }
.button {
  min-height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 690;
  background: #fff;
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 2px rgba(20,42,72,.03);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.button:hover { background: #fbfcff; box-shadow: var(--shadow-sm); }
.button:active { transform: scale(.98); }
.button--primary { color: #fff; background: linear-gradient(145deg, #164b8d, #0d315d); border-color: transparent; box-shadow: 0 8px 18px rgba(12, 43, 82, 0.18); }
.button--primary:hover { background: linear-gradient(145deg, #1b58a2, #103968); }
.button--danger { color: var(--red); background: var(--red-soft); border-color: rgba(189,61,70,.18); }
.button--ghost { background: transparent; border-color: transparent; box-shadow: none; }
.button--small { min-height: 31px; padding: 6px 10px; font-size: 10px; }
.button svg, .icon-button svg, .text-button svg { width: 15px; height: 15px; }
.text-button { padding: 4px; color: var(--blue); background: transparent; font-size: 10px; font-weight: 650; white-space: nowrap; }
.text-button:hover { text-decoration: underline; }
.mobile-menu-button { display: none; }

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-heading h1 { margin: 0; font-size: 25px; letter-spacing: -0.035em; }
.page-heading p { max-width: 760px; margin: 6px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.55; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.grid { display: grid; gap: 14px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--dashboard-bottom { grid-template-columns: 1.2fr 1fr .9fr; }
.grid--valuation { grid-template-columns: 1.05fr .9fr 1.05fr; align-items: start; }
.grid--report { grid-template-columns: minmax(0,1fr) 230px; align-items: start; }
.grid--form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--form-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}
.card--padded { padding: 17px; }
.card--large { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}
.card__title { margin: 0; font-size: 11px; font-weight: 760; letter-spacing: .01em; text-transform: uppercase; }
.card__subtitle { margin: 4px 0 0; color: var(--ink-3); font-size: 10px; line-height: 1.45; }
.card__footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

.kpi-card { min-height: 174px; padding: 18px; }
.kpi-label { color: var(--ink-2); font-size: 10px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.kpi-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.kpi-value { font-size: clamp(27px, 2vw, 35px); font-weight: 760; letter-spacing: -0.045em; }
.kpi-value--green { color: var(--green); }
.kpi-value--red { color: var(--red); }
.kpi-subgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 16px; }
.kpi-subitem { padding-top: 10px; border-top: 1px solid var(--line); }
.kpi-subitem__label { color: var(--ink-3); font-size: 9px; }
.kpi-subitem__value { margin-top: 4px; font-size: 11px; font-weight: 700; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 730;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge--green { color: var(--green); background: var(--green-soft); }
.badge--blue { color: #215dbb; background: var(--blue-soft); }
.badge--amber { color: var(--amber); background: var(--amber-soft); }
.badge--red { color: var(--red); background: var(--red-soft); }
.badge--neutral { color: var(--ink-2); background: #edf2f7; }

.progress-card { margin-top: 14px; padding: 16px 18px 18px; }
.progress-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.progress-legend { display: flex; gap: 13px; color: var(--ink-3); font-size: 9px; }
.legend-dot { width: 7px; height: 7px; display: inline-block; margin-right: 4px; border-radius: 50%; }
.progress-steps { display: grid; grid-template-columns: repeat(8, minmax(0,1fr)); position: relative; }
.progress-steps::before { content: ""; position: absolute; top: 12px; left: 5.5%; right: 5.5%; height: 1px; background: #dce4ef; }
.progress-steps::after { content: ""; position: absolute; top: 12px; left: 5.5%; width: var(--progress-width, 0%); height: 1px; background: #52a978; transition: width .25s ease; }
.progress-step { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; }
.progress-step__dot {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid #c8d3e0;
  background: #fff;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 720;
}
.progress-step.is-complete .progress-step__dot { border-color: #59ad7c; color: var(--green); background: #f5fff8; }
.progress-step.is-current .progress-step__dot { border: 2px solid var(--blue); color: var(--blue); box-shadow: 0 0 0 5px rgba(37,99,217,.09); }
.progress-step__label { max-width: 90px; margin-top: 8px; color: var(--ink-2); font-size: 9px; line-height: 1.25; }

.data-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.7); }
.data-table { width: 100%; border-collapse: collapse; font-size: 10px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #f7f9fc; color: var(--ink-3); font-size: 8px; font-weight: 760; letter-spacing: .04em; text-transform: uppercase; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(38, 99, 217, 0.035); }
.data-table .is-total { font-weight: 760; background: #f8fafc; }
.data-table .cell-positive { color: var(--green); font-weight: 700; }
.data-table .cell-negative { color: var(--red); font-weight: 700; }
.table-input { width: 100%; min-width: 78px; padding: 6px 7px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.table-input:hover { border-color: var(--line); background: #fff; }
.table-input:focus { border-color: rgba(37,99,217,.35); background: #fff; }
.table-input--text { text-align: left; }

.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.list-item__icon { width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center; margin-top: 1px; border-radius: 50%; font-size: 9px; }
.list-item__icon--ok { color: var(--green); background: var(--green-soft); }
.list-item__icon--risk { color: var(--red); background: var(--red-soft); }
.list-item__icon--warn { color: var(--amber); background: var(--amber-soft); }
.list-item__body { min-width: 0; flex: 1; }
.list-item__title { font-size: 10px; font-weight: 650; line-height: 1.4; }
.list-item__meta { margin-top: 2px; color: var(--ink-3); font-size: 9px; line-height: 1.35; }

.form-section { margin-bottom: 16px; }
.form-section:last-child { margin-bottom: 0; }
.form-section__title { margin: 0 0 12px; font-size: 14px; letter-spacing: -0.015em; }
.field { min-width: 0; }
.field label, .field-label { display: block; margin-bottom: 6px; color: var(--ink-2); font-size: 9px; font-weight: 700; letter-spacing: .02em; }
.field-help { margin-top: 5px; color: var(--ink-3); font-size: 8px; line-height: 1.4; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(255,255,255,.86);
  color: var(--ink);
  box-shadow: inset 0 1px 1px rgba(20,42,72,.02);
}
.input, .select { min-height: 38px; padding: 8px 10px; font-size: 11px; }
.textarea { min-height: 100px; padding: 10px 11px; resize: vertical; font-size: 11px; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: #a5afbd; }
.input:disabled, .select:disabled, .textarea:disabled { background: #f2f5f8; color: #8c99a9; cursor: not-allowed; }
.input-group { position: relative; }
.input-group__prefix, .input-group__suffix { position: absolute; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 10px; pointer-events: none; }
.input-group__prefix { left: 10px; }
.input-group__suffix { right: 10px; }
.input-group .input.has-prefix { padding-left: 25px; }
.input-group .input.has-suffix { padding-right: 33px; }
.field-error { margin-top: 5px; color: var(--red); font-size: 8px; }

.tabs { display: flex; gap: 3px; padding: 3px; margin-bottom: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; background: rgba(240,244,249,.8); }
.tab-button { min-height: 31px; padding: 7px 11px; border-radius: 8px; color: var(--ink-3); background: transparent; font-size: 9px; font-weight: 690; white-space: nowrap; }
.tab-button.is-active { color: #1d58b2; background: #fff; box-shadow: 0 2px 8px rgba(28,60,100,.08); }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f1f4f8; }
.segmented__button { min-height: 29px; padding: 6px 10px; border-radius: 7px; color: var(--ink-3); background: transparent; font-size: 9px; font-weight: 680; }
.segmented__button.is-active { color: #1d58b2; background: #fff; box-shadow: 0 1px 5px rgba(20,42,72,.08); }

.callout { display: flex; align-items: flex-start; gap: 9px; padding: 11px 12px; border-radius: 10px; font-size: 9px; line-height: 1.5; }
.callout--info { color: #315e9e; background: #eef5ff; border: 1px solid rgba(37,99,217,.12); }
.callout--warning { color: #7b5119; background: var(--amber-soft); border: 1px solid rgba(178,106,17,.13); }
.callout--danger { color: #8e3038; background: var(--red-soft); border: 1px solid rgba(189,61,70,.13); }
.callout--success { color: #15683e; background: var(--green-soft); border: 1px solid rgba(22,132,75,.12); }

.metric-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.metric-row:last-child { border-bottom: 0; }
.metric-row__label { color: var(--ink-2); font-size: 10px; }
.metric-row__value { font-size: 11px; font-weight: 720; text-align: right; font-variant-numeric: tabular-nums; }

.rating-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rating-box { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.rating-box__label { color: var(--ink-3); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; font-weight: 750; }
.rating-box__value { margin-top: 8px; font-size: 24px; font-weight: 780; letter-spacing: -.03em; }
.rating-buy { color: var(--green); }
.rating-hold { color: var(--amber); }
.rating-sell { color: var(--red); }

.sensitivity-table td.is-base { background: #edf8f1; color: var(--green); font-weight: 760; }
.sensitivity-table th.is-base { background: #e5f4eb; color: var(--green); }

.weight-row { display: grid; grid-template-columns: minmax(0,1fr) 74px 34px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.weight-row:last-child { border-bottom: 0; }
.weight-track { height: 5px; border-radius: 999px; background: #e7edf5; overflow: hidden; }
.weight-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5c8fe7, #2966cf); }

.scenario-cards { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.scenario-card { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.74); }
.scenario-card.is-active { border-color: rgba(37,99,217,.34); box-shadow: 0 0 0 3px rgba(37,99,217,.08); }
.scenario-card__name { font-size: 10px; font-weight: 740; }
.scenario-card__value { margin-top: 10px; font-size: 20px; font-weight: 760; letter-spacing: -.03em; }
.scenario-card__upside { margin-top: 4px; font-size: 10px; font-weight: 700; }

.report-sheet { padding: 26px 29px; background: #fff; }
.report-header { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.report-title { margin: 0; font-size: 24px; letter-spacing: -.035em; }
.report-subtitle { margin-top: 5px; color: var(--ink-3); font-size: 9px; }
.report-rating { text-align: right; }
.report-rating__value { font-size: 28px; font-weight: 790; letter-spacing: -.03em; }
.report-kpis { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); margin: 18px 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.report-kpi { padding: 12px; border-right: 1px solid var(--line); }
.report-kpi:last-child { border-right: 0; }
.report-kpi__label { color: var(--ink-3); font-size: 8px; }
.report-kpi__value { margin-top: 5px; font-size: 12px; font-weight: 740; }
.report-section { margin-top: 22px; }
.report-section h2 { margin: 0 0 9px; font-size: 14px; }
.report-section p, .report-section li { color: var(--ink-2); font-size: 10px; line-height: 1.6; }
.report-section ul { margin: 0; padding-left: 18px; }
.report-disclaimer { margin-top: 24px; padding: 12px 14px; color: var(--ink-3); background: #f7f9fc; border: 1px solid var(--line); border-radius: 10px; font-size: 8px; line-height: 1.55; }
.report-side { position: sticky; top: calc(var(--topbar-height) + 18px); display: grid; gap: 12px; }

.company-list { display: grid; gap: 8px; }
.company-card { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.78); cursor: pointer; }
.company-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.company-card.is-active { border-color: rgba(37,99,217,.3); background: #f5f8ff; }
.company-symbol { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #2c6bc9, #173f78); font-weight: 760; font-size: 12px; }
.company-card__name { font-size: 11px; font-weight: 720; }
.company-card__meta { margin-top: 4px; color: var(--ink-3); font-size: 9px; }
.company-card__rating { font-size: 12px; font-weight: 780; }

.empty-state { padding: 42px 24px; text-align: center; }
.empty-state__icon { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 15px; color: #3569b7; background: #edf4ff; }
.empty-state h3 { margin: 0; font-size: 15px; }
.empty-state p { max-width: 440px; margin: 7px auto 15px; color: var(--ink-3); font-size: 10px; line-height: 1.55; }

.disclaimer-strip {
  min-height: 61px;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 28px;
  color: var(--ink-2);
  background: rgba(250,252,255,.85);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.disclaimer-strip__icon { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid #9cafc6; border-radius: 10px; color: #466586; font-weight: 800; }
.disclaimer-strip strong { display: block; font-size: 10px; }
.disclaimer-strip span { display: block; margin-top: 2px; color: var(--ink-3); font-size: 8px; line-height: 1.4; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(10,26,47,.42); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.modal { width: min(620px, 100%); max-height: min(84vh, 760px); overflow: auto; background: #fff; border: 1px solid rgba(255,255,255,.7); border-radius: 20px; box-shadow: 0 30px 90px rgba(10,26,47,.28); }
.modal__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 13px; border-bottom: 1px solid var(--line); }
.modal__header h2 { margin: 0; font-size: 18px; letter-spacing: -.025em; }
.modal__body { padding: 18px 20px; color: var(--ink-2); font-size: 11px; line-height: 1.65; }
.modal__body p:first-child { margin-top: 0; }
.modal__footer { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px 18px; }
.modal-form { display: grid; gap: 12px; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 360px; padding: 12px 14px; border-radius: 12px; color: #fff; background: rgba(14,42,76,.94); box-shadow: 0 15px 42px rgba(10,26,47,.25); font-size: 10px; line-height: 1.45; animation: toast-in .18s ease-out; }
.toast--error { background: rgba(145,42,51,.96); }
.toast--success { background: rgba(18,104,61,.96); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.mobile-nav { display: none; }
.mobile-only { display: none !important; }
.desktop-only { display: initial; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.muted { color: var(--ink-3); }
.positive { color: var(--green) !important; }
.negative { color: var(--red) !important; }
.warning { color: var(--amber) !important; }
.numeric { font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 14px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0 !important; }

@media (max-width: 1180px) {
  :root { --sidebar-width: 220px; }
  .main-content { padding-left: 20px; padding-right: 20px; }
  .topbar { padding-left: 20px; padding-right: 20px; }
  .grid--dashboard-bottom { grid-template-columns: 1fr 1fr; }
  .grid--dashboard-bottom > :last-child { grid-column: 1 / -1; }
  .grid--valuation { grid-template-columns: 1fr 1fr; }
  .grid--valuation > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  :root { --topbar-height: 64px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace-shell { min-height: 100vh; padding-bottom: 72px; }
  .topbar { padding: 0 15px; }
  .topbar__title { font-size: 16px; }
  .topbar__meta { font-size: 8px; }
  .topbar__right .button:not(.button--primary), .topbar__right .hide-mobile { display: none; }
  .mobile-menu-button { display: inline-grid; }
  .main-content { padding: 15px 13px 24px; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    height: calc(64px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 5px 7px env(safe-area-inset-bottom);
    background: rgba(252,253,255,.94);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
  }
  .mobile-nav__button { display: grid; justify-items: center; align-content: center; gap: 3px; padding: 3px; border: 0; background: transparent; color: var(--ink-3); font-size: 8px; font-weight: 600; cursor: pointer; }
  .mobile-nav__button svg { width: 18px; height: 18px; }
  .mobile-nav__button.is-active { color: #1d58b2; }
  .disclaimer-strip { display: none; }
  .grid--3, .grid--2, .grid--dashboard-bottom, .grid--valuation, .grid--report, .grid--form, .grid--form-3 { grid-template-columns: 1fr; }
  .grid--dashboard-bottom > :last-child, .grid--valuation > :last-child { grid-column: auto; }
  .page-heading { align-items: center; }
  .page-heading h1 { font-size: 20px; }
  .page-heading p { font-size: 10px; }
  .page-actions { display: none; }
  .kpi-card { min-height: auto; padding: 15px; }
  .kpi-value { font-size: 28px; }
  .progress-card { overflow: hidden; }
  .progress-steps { display: flex; gap: 15px; overflow-x: auto; padding: 4px 5px 8px; scroll-snap-type: x mandatory; }
  .progress-steps::before, .progress-steps::after { display: none; }
  .progress-step { min-width: 76px; scroll-snap-align: start; }
  .progress-legend { display: none; }
  .scenario-cards { grid-template-columns: 1fr; }
  .report-sheet { padding: 18px; }
  .report-header { grid-template-columns: 1fr auto; }
  .report-title { font-size: 20px; }
  .report-rating__value { font-size: 24px; }
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-kpi { border-bottom: 1px solid var(--line); }
  .report-kpi:nth-child(2n) { border-right: 0; }
  .report-kpi:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .report-side { position: static; }
  .mobile-only { display: initial !important; }
  .desktop-only { display: none !important; }
  .toast-region { left: 12px; right: 12px; bottom: 76px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 540px) {
  .topbar__right .button--primary { display: none; }
  .page-heading { margin-bottom: 12px; }
  .page-heading p { display: none; }
  .card--padded { padding: 14px; }
  .kpi-subgrid { gap: 7px; }
  .rating-panel { grid-template-columns: 1fr; }
  .grid { gap: 10px; }
  .report-header { grid-template-columns: 1fr; }
  .report-rating { text-align: left; }
  .report-kpis { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: 91vh; border-radius: 20px 20px 0 0; }
}

@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .mobile-nav, .disclaimer-strip, .report-side, .page-heading, .toast-region, .no-print { display: none !important; }
  .app-shell, .workspace-shell { display: block; }
  .main-content { width: 100%; max-width: none; margin: 0; padding: 0; }
  .grid--report { display: block; }
  .card { border: 0; box-shadow: none; }
  .report-sheet { padding: 0; }
  .report-disclaimer { break-inside: avoid; }
  .data-table th { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.callout > svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; }
.badge > svg { width: 12px; height: 12px; flex: 0 0 auto; }

/* v1.1 — full-white, restrained Apple/Zerodha-inspired visual system */
:root {
  --bg: #f7f8fa;
  --bg-deep: #f1f3f6;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-muted: #fafbfc;
  --surface-blue: #f5f8fd;
  --ink: #151a23;
  --ink-2: #3f4856;
  --ink-3: #7a8493;
  --line: #e7e9ed;
  --line-strong: #d9dde3;
  --navy: #172b4d;
  --navy-2: #203b68;
  --blue: #387ed1;
  --blue-soft: #edf4fd;
  --green: #17864a;
  --green-soft: #edf8f1;
  --red: #c94850;
  --red-soft: #fff2f3;
  --amber: #b56a13;
  --amber-soft: #fff7e8;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.025), 0 8px 24px rgba(17, 24, 39, 0.035);
  --shadow-md: 0 2px 5px rgba(17, 24, 39, 0.035), 0 20px 60px rgba(17, 24, 39, 0.07);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 238px;
  --topbar-height: 70px;
}

html { background: var(--bg); }
body {
  background: var(--bg);
  letter-spacing: -0.005em;
}

.sidebar {
  padding: 18px 12px 20px;
  background: #fff;
  border-right-color: var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.workspace-shell { background: var(--bg); }
.topbar {
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.main-content {
  width: min(1540px, 100%);
  padding: 22px 26px 34px;
}

.brand { padding: 2px 8px 17px; gap: 10px; }
.brand img { width: 34px; height: 34px; filter: none; }
.brand__title { font-size: 13px; font-weight: 720; }
.brand__subtitle { color: #969eaa; font-size: 8px; letter-spacing: .1em; }
.nav-section { margin: 8px 0 15px; }
.nav-section__label { padding: 0 9px 6px; color: #9aa2ae; font-size: 8px; }
.nav-list { gap: 1px; }
.nav-button {
  min-height: 35px;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  color: #4c5665;
  font-size: 11px;
  font-weight: 540;
}
.nav-button:hover { background: #f6f8fb; color: var(--ink); }
.nav-button.is-active {
  color: #2467b5;
  background: #eef4fc;
  box-shadow: none;
}
.nav-icon { width: 15px; height: 15px; }
.nav-badge { min-width: 18px; height: 18px; background: #f2f4f7; font-size: 8px; }
.nav-button.is-active .nav-badge { background: #dceaf9; color: #2467b5; }
.sidebar-profile {
  margin-top: 18px;
  padding: 9px;
  border-radius: 10px;
  background: #fff;
  box-shadow: none;
}
.avatar { width: 29px; height: 29px; background: #18365e; }

.topbar__title { font-size: 19px; font-weight: 710; }
.topbar__meta { margin-top: 3px; color: #8993a2; font-size: 9px; }
.topbar__right { gap: 8px; }
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #7d8795;
  background: #fafbfc;
  border: 1px solid var(--line);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.save-status svg { width: 12px; height: 12px; }
.save-status--saving svg { animation: save-spin .85s linear infinite; }
.save-status--error { color: var(--red); background: var(--red-soft); }
@keyframes save-spin { to { transform: rotate(360deg); } }

.icon-button {
  width: 35px;
  height: 35px;
  border-radius: 9px;
  background: #fff;
  border-color: var(--line);
  box-shadow: none;
}
.icon-button:hover { background: #f8f9fb; }
.button {
  min-height: 35px;
  padding: 8px 12px;
  border-radius: 8px;
  border-color: var(--line-strong);
  box-shadow: none;
  font-size: 10px;
}
.button:hover { background: #f8f9fb; box-shadow: none; }
.button--primary {
  background: #387ed1;
  border-color: #387ed1;
  box-shadow: 0 5px 14px rgba(56, 126, 209, .16);
}
.button--primary:hover { background: #2f70c0; }
.text-button { color: #387ed1; font-size: 9px; }

.page-heading { margin-bottom: 15px; align-items: center; }
.page-heading h1 { font-size: 23px; font-weight: 720; }
.page-heading p { margin-top: 4px; color: #7f8998; font-size: 10px; }

.grid { gap: 12px; }
.dashboard-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.18fr .95fr 1.12fr;
  gap: 12px;
  align-items: stretch;
}
.grid--dashboard-bottom { grid-template-columns: 1.15fr 1fr .9fr; align-items: stretch; }
.grid--dashboard-bottom > .card { height: 100%; }
.grid--valuation {
  grid-template-columns: 1.05fr .92fr 1.12fr;
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.grid--valuation > .card,
.valuation-lower-grid > .card { height: 100%; }
.valuation-lower-grid { align-items: stretch; }
.grid--report { grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; }

.card {
  background: #fff;
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.card--padded { padding: 15px; }
.card--large { border-radius: 14px; box-shadow: var(--shadow-sm); }
.card__header { margin-bottom: 11px; }
.card__title { color: #252c37; font-size: 9px; font-weight: 760; letter-spacing: .025em; }
.card__subtitle { color: #8993a1; font-size: 9px; }

.kpi-card {
  min-height: 204px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.kpi-label { color: #4b5563; font-size: 8px; font-weight: 760; letter-spacing: .045em; }
.kpi-main { margin-top: 10px; }
.kpi-value { font-size: clamp(26px, 1.75vw, 32px); font-weight: 730; }
.kpi-value--status { font-size: 21px; letter-spacing: -.025em; }
.kpi-subgrid { margin-top: auto; padding-top: 13px; gap: 8px; }
.kpi-subitem { padding-top: 8px; }
.kpi-subitem__label { color: #8a94a3; font-size: 8px; }
.kpi-subitem__value { margin-top: 3px; font-size: 10px; }
.kpi-subitem__value--truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thesis-card .list { margin-top: auto; gap: 5px; }
.thesis-card .list-item { padding: 0; }
.thesis-card .list-item__title { font-size: 9px; }

.progress-summary-card .card__header { align-items: flex-start; }
.progress-summary__count { margin-top: 7px; color: #4d5867; font-size: 10px; font-weight: 650; }
.progress-summary__percent { color: #17864a; font-size: 12px; font-weight: 760; }
.progress-summary__track { margin-top: 2px; height: 4px; }
.progress-summary__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  margin-top: 13px;
}
.progress-summary__item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8b95a3;
  text-align: left;
  cursor: pointer;
}
.progress-summary__item span {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #d7dce3;
  border-radius: 50%;
  color: #7f8998;
  font-size: 7px;
  font-style: normal;
  font-weight: 700;
}
.progress-summary__item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 8px;
  font-style: normal;
}
.progress-summary__item.is-complete { color: #3f7658; }
.progress-summary__item.is-complete span { border-color: #90c7a7; color: #17864a; background: #f1faf5; }

.recent-analyses { padding-bottom: 13px; }
.recent-analyses__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.recent-analysis {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.recent-analysis:hover { background: #fafbfc; border-color: var(--line-strong); }
.recent-analysis.is-active { background: #f5f8fd; border-color: #cbdcf1; }
.recent-analysis__symbol { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #eef4fc; color: #2a67ac; font-size: 9px; font-weight: 760; }
.recent-analysis__copy { min-width: 0; }
.recent-analysis__copy strong,
.recent-analysis__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-analysis__copy strong { font-size: 9px; }
.recent-analysis__copy small { margin-top: 3px; color: #8b95a3; font-size: 7px; }
.recent-analysis__rating { font-size: 8px; font-weight: 760; }

.badge { min-height: 20px; padding: 3px 7px; font-size: 8px; }
.callout { border-radius: 9px; box-shadow: none; }
.callout--info { background: #f5f8fd; border-color: #dbe7f6; }

.data-table { font-variant-numeric: tabular-nums; }
.data-table thead th { color: #7e8897; background: #fafbfc; font-size: 7px; }
.data-table th, .data-table td { border-bottom-color: #eceef1; }
.data-table td { font-size: 9px; }
.data-table tbody tr:hover { background: #fbfcfd; }

.tabs { border-bottom-color: var(--line); }
.tab-button { color: #6f7987; }
.tab-button.is-active { color: #2e72c3; }
.segmented { background: #f5f6f8; border-color: #ebeef2; }
.segmented__button.is-active { color: #286cb9; background: #fff; box-shadow: 0 1px 4px rgba(17,24,39,.06); }
.input, .select, .textarea, .table-input {
  border-color: #e0e4e9;
  border-radius: 8px;
  background: #fff;
}
.input:hover, .select:hover, .textarea:hover { border-color: #cdd3db; }
.input:focus, .select:focus, .textarea:focus { border-color: #8ab4e4; box-shadow: 0 0 0 3px rgba(56,126,209,.1); }

.valuation-card {
  display: flex;
  flex-direction: column;
  min-height: 440px;
}
.valuation-card--result > .mt-16 { margin-top: auto; }
.valuation-card--sensitivity .data-table-wrap { margin-top: 3px; }
.valuation-card .field { margin-bottom: 10px; }
.valuation-card .grid--form { gap: 9px; }
.valuation-lower-grid { grid-auto-rows: 1fr; }
.valuation-lower-grid .rating-panel { margin-top: 4px; }
.weight-track { background: #edf0f3; }
.weight-fill { background: #2f8b59; }
.sensitivity-table td.is-base, .sensitivity-table th.is-base { background: #eef8f2; }

.report-sheet { padding: 22px; }
.report-header {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(360px, 1.6fr) minmax(110px, auto);
  align-items: center;
  gap: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.report-header__identity { min-width: 0; }
.report-title { font-size: 22px; font-weight: 720; }
.report-subtitle { color: #8a94a2; font-size: 8px; }
.report-header__facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-left: 1px solid var(--line);
}
.report-header__facts > div { min-width: 0; padding: 2px 13px; border-right: 1px solid var(--line); }
.report-header__facts span,
.report-header__facts strong { display: block; }
.report-header__facts span { color: #8b95a2; font-size: 7px; }
.report-header__facts strong { margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.report-rating { min-width: 98px; text-align: right; align-self: center; }
.report-rating__value { font-size: 25px; line-height: 1; }
.report-rating small { display: block; margin-top: 7px; color: #8a94a2; font-size: 7px; }
.report-kpis { margin: 14px 0 4px; background: #fafbfc; }
.report-section { margin-top: 20px; }
.report-side { top: calc(var(--topbar-height) + 14px); }

.disclaimer-strip {
  min-height: 56px;
  background: #fff;
  border-top-color: var(--line);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.disclaimer-strip__icon { border-radius: 8px; }
.mobile-nav { background: rgba(255,255,255,.96); }

@media (max-width: 1280px) {
  .dashboard-hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-analyses__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--valuation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--valuation > :last-child { grid-column: 1 / -1; }
  .valuation-card--sensitivity { min-height: auto; }
  .report-header { grid-template-columns: minmax(190px, 1fr) minmax(320px, 1.5fr) auto; }
}

@media (max-width: 920px) {
  .topbar { padding: 0 14px; }
  .main-content { padding: 14px 12px 24px; }
  .save-status { display: none; }
  .dashboard-hero-grid,
  .grid--valuation { grid-template-columns: 1fr; }
  .grid--valuation > :last-child { grid-column: auto; }
  .valuation-card { min-height: auto; }
  .recent-analyses__grid { grid-template-columns: 1fr 1fr; }
  .report-header { grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
  .report-header__facts { grid-column: 1 / -1; grid-row: 2; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
  .report-header__facts > div { padding: 9px; }
  .report-rating { grid-column: 2; grid-row: 1; }
}

@media (max-width: 540px) {
  body { background: #f6f7f9; }
  .topbar { background: rgba(255,255,255,.98); }
  .topbar__title { font-size: 15px; }
  .page-heading h1 { font-size: 18px; }
  .dashboard-hero-grid { gap: 9px; }
  .kpi-card { min-height: auto; padding: 14px; }
  .kpi-main { margin-top: 8px; }
  .kpi-value { font-size: 27px; }
  .kpi-subgrid { margin-top: 12px; padding-top: 0; }
  .progress-summary__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent-analyses__grid { grid-template-columns: 1fr; }
  .recent-analyses { display: none; }
  .grid--dashboard-bottom > :first-child { order: 2; }
  .grid--dashboard-bottom > :nth-child(2) { order: 1; }
  .grid--dashboard-bottom > :last-child { order: 3; }
  .report-sheet { padding: 14px; }
  .report-header { grid-template-columns: minmax(0,1fr) auto; }
  .report-header__facts { grid-template-columns: repeat(2, 1fr); }
  .report-header__facts > div:nth-child(2) { border-right: 0; }
  .report-header__facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .report-rating__value { font-size: 22px; }
}

@media print {
  .report-header { grid-template-columns: 1.2fr 1.5fr auto; }
  .report-header__facts { border-left: 1px solid #ddd; }
}

/* Final responsive refinements */
@media (min-width: 1281px) {
  .valuation-card { min-height: 360px; }
}

@media (max-width: 920px) {
  .grid--dashboard-bottom { grid-template-columns: 1fr; }
  .grid--dashboard-bottom > :last-child { grid-column: auto; }
  .valuation-lower-grid { grid-auto-rows: auto; }
  .valuation-lower-grid > .card { height: auto; }
}

/* Verdict v1.3: company-led creation flow and topbar alignment */
.topbar__right { align-items: center; }
.topbar__right > .save-status,
.topbar__right > .badge,
.topbar__right > .button,
.topbar__right > .icon-button {
  min-height: 36px;
  height: 36px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
}
.topbar__right > .save-status { padding: 0 12px; border-radius: 9px; }
.topbar__right > .badge { padding: 0 12px; border-radius: 9px; gap: 7px; }
.topbar__right > .button { padding-top: 0; padding-bottom: 0; }
.topbar__right > .icon-button { width: 36px; padding: 0; }
.topbar__right > .badge svg { width: 14px; height: 14px; }

.new-analysis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 14px;
  align-items: start;
}
.company-search-card,
.new-analysis-summary { min-height: 470px; }
.company-search-card .input-group__prefix svg { width: 15px; height: 15px; }
.company-search-empty,
.new-analysis-placeholder {
  display: grid;
  place-items: center;
  min-height: 250px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--ink-3);
  background: #fafbfc;
  text-align: center;
  font-size: 11px;
  line-height: 1.6;
}
.company-suggestions {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  max-height: 370px;
  overflow: auto;
  padding-right: 3px;
}
.company-search-count {
  margin-top: 12px;
  color: var(--ink-3);
  font-size: 9px;
  font-weight: 650;
}
.company-suggestion {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 11px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.company-suggestion:hover,
.company-suggestion:focus-visible {
  background: #f5f8fc;
  border-color: #e0e8f2;
  outline: none;
}
.company-suggestion__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #245f9f;
  background: #eaf2fb;
  font-size: 10px;
  font-weight: 760;
}
.company-suggestion__copy { min-width: 0; }
.company-suggestion__copy strong,
.company-suggestion__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company-suggestion__copy strong { font-size: 11px; font-weight: 700; }
.company-suggestion__copy small { margin-top: 4px; color: var(--ink-3); font-size: 9px; }
.company-suggestion > svg { width: 15px; height: 15px; color: #a0a9b5; }
.selected-company { display: grid; gap: 16px; }
.selected-company__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}
.selected-company__identity .company-suggestion__mark { width: 42px; height: 42px; border-radius: 12px; font-size: 12px; }
.selected-company__identity h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.selected-company__identity p { margin: 5px 0 0; color: var(--ink-3); font-size: 9px; }
.selected-company__facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.selected-company__facts > div { padding: 10px; border-radius: 10px; background: #f8fafc; border: 1px solid #eef1f5; }
.selected-company__facts span,
.selected-company__facts strong { display: block; }
.selected-company__facts span { color: var(--ink-3); font-size: 8px; }
.selected-company__facts strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 10px; }
.company-data-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid #dbe5f1;
  border-radius: 10px;
  color: #536273;
  background: #f7fafe;
  font-size: 9px;
  line-height: 1.5;
}
.company-data-status svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 1px; }
.company-data-status.ok { color: #257547; background: #f2faf5; border-color: #d6ecde; }
.company-data-status.warn { color: #8c651e; background: #fffaf0; border-color: #f0dfb9; }
.company-data-status:not(.ok):not(.warn) svg { animation: save-spin .85s linear infinite; }
.framework-rules { display: grid; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.framework-rules > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 12px; background: #fff; }
.framework-rules > div + div { border-top: 1px solid var(--line); }
.framework-rules span { color: var(--ink-3); font-size: 10px; }
.framework-rules strong { text-align: right; font-size: 10px; }

@media (max-width: 980px) {
  .new-analysis-layout { grid-template-columns: 1fr; }
  .company-search-card,
  .new-analysis-summary { min-height: 0; }
}

@media (max-width: 720px) {
  .new-analysis-layout { gap: 10px; }
  .company-search-empty,
  .new-analysis-placeholder { min-height: 170px; }
  .company-suggestions { max-height: 330px; }
  .selected-company__facts { grid-template-columns: 1fr; }
  .page-actions [data-action="cancel-new-analysis"] { display: none; }
}

/* Modal interaction hardening: keep actions in a dedicated, non-overlapping footer. */
.modal {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__header,
.modal__footer { flex: 0 0 auto; }
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
.modal__footer {
  position: relative;
  z-index: 2;
  background: #fff;
  border-top: 1px solid var(--line);
}

/* Preserve responsive visibility after the v1.3 topbar sizing rules. */
@media (max-width: 920px) {
  .topbar__right > .save-status,
  .topbar__right > .badge.hide-mobile { display: none; }
}
@media (max-width: 540px) {
  .topbar__right > .button--primary { display: none; }
}

.connection-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  color: var(--ink-3);
  font-size: 10px;
}
.connection-status strong { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); font-size: 10px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #aeb7c3; box-shadow: 0 0 0 3px rgba(174,183,195,.16); }
.status-dot--ok { background: var(--green); box-shadow: 0 0 0 3px rgba(28,139,80,.13); }
.status-dot--warn { background: var(--amber); box-shadow: 0 0 0 3px rgba(197,132,32,.13); }

/* v1.3.3 visible build marker */
.footer-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 12px; }
.build-version { color: #8a94a3; font-size: 9px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
@media (max-width: 720px) { .footer-actions { gap: 7px; } .build-version { display: none; } }

/* Verdict v1.3.3: make the company search an unambiguous interactive control. */
.company-search-card .input-group { position: relative; z-index: 2; }
#company-master-search { position: relative; z-index: 2; pointer-events: auto; cursor: text; }
.company-search-card label[for="company-master-search"] { cursor: text; }
