:root {
  --navy-950: #071126;
  --navy-900: #0b1734;
  --navy-850: #101f42;
  --navy-800: #16284d;
  --blue-700: #1e58c7;
  --blue-600: #2869e8;
  --blue-500: #4b82ee;
  --blue-100: #eaf1ff;
  --blue-50: #f4f7ff;
  --ink-950: #111827;
  --ink-800: #26334a;
  --ink-700: #3e4b61;
  --ink-500: #718096;
  --ink-400: #95a0b2;
  --line: #e4e8ef;
  --line-soft: #edf0f5;
  --surface: #ffffff;
  --canvas: #f5f6f9;
  --green: #15966a;
  --green-soft: #e8f7f1;
  --amber: #ae7412;
  --amber-soft: #fff4db;
  --red: #c94747;
  --red-soft: #fff0ef;
  --gold: #cba461;
  --gold-soft: #f7edda;
  --map-series-1: #2869e8;
  --map-series-2: #15966a;
  --map-series-3: #b7791f;
  --map-series-4: #805ad5;
  --map-series-5: #d05278;
  --map-series-6: #0f8c9d;
  --map-series-7: #d76432;
  --map-series-8: #60718c;
  --sidebar-width: 252px;
  --topbar-height: 82px;
  --shadow-xs: 0 1px 2px rgba(10, 24, 53, 0.05);
  --shadow-sm: 0 8px 30px rgba(21, 34, 58, 0.08);
  --shadow-lg: 0 28px 70px rgba(8, 20, 44, 0.16);
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink-950);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink-950);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(40, 105, 232, 0.26);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.is-hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

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

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 11px;
  font-family: "PT Serif", Georgia, serif;
  font-size: 15px;
  letter-spacing: -0.5px;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand strong {
  font-family: "PT Serif", Georgia, serif;
  font-size: 20px;
  line-height: 1;
  letter-spacing: -0.2px;
}

.brand small {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 4px;
  line-height: 1.2;
}

.brand--light {
  color: #fff;
}

.eyebrow {
  display: inline-block;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #8db2ff;
}

/* Phone authentication */

.auth-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(480px, 1.1fr) minmax(440px, 0.9fr);
  background: var(--surface);
}

.auth-story {
  position: relative;
  display: flex;
  min-height: 100vh;
  padding: 42px clamp(48px, 6vw, 100px);
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 12%, rgba(68, 116, 218, 0.23), transparent 27%),
    radial-gradient(circle at 6% 84%, rgba(23, 65, 141, 0.34), transparent 32%),
    linear-gradient(145deg, #08142d 0%, #0c1c3d 55%, #102750 100%);
  color: #fff;
}

.auth-story::before,
.auth-story::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.auth-story::before {
  width: 620px;
  height: 620px;
  right: -380px;
  top: 18%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.025), 0 0 0 160px rgba(255, 255, 255, 0.018);
}

.auth-story::after {
  inset: 0;
  opacity: 0.35;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, black 35%, black 70%, transparent);
}

.auth-story > * {
  position: relative;
  z-index: 1;
}

.auth-story__content {
  width: min(620px, 100%);
  margin: auto 0;
  padding: 70px 0 60px;
}

.auth-story__content h1 {
  margin: 20px 0 22px;
  font-family: "PT Serif", Georgia, serif;
  font-size: clamp(42px, 4.3vw, 66px);
  font-weight: 700;
  letter-spacing: -2.1px;
  line-height: 1.04;
}

.auth-story__content > p {
  max-width: 570px;
  margin: 0;
  color: #b8c4d9;
  font-size: 16px;
  line-height: 1.8;
}

.auth-features {
  display: grid;
  max-width: 560px;
  margin-top: 52px;
  gap: 9px;
}

.auth-features article {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(6px);
}

.auth-features__icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 9px;
  background: rgba(77, 129, 238, 0.18);
  color: #9bbcff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
}

.auth-features div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.auth-features strong {
  font-size: 13px;
  font-weight: 700;
}

.auth-features small {
  color: #99a9c3;
  font-size: 11px;
}

.auth-story__foot {
  margin: 0;
  color: #667795;
  font-size: 9px;
  letter-spacing: 0.2px;
}

.auth-panel {
  display: grid;
  min-height: 100vh;
  padding: 40px clamp(42px, 7vw, 112px);
  place-items: center;
  background: #fbfbfc;
}

.auth-card {
  width: min(410px, 100%);
}

.auth-card__mobile-brand {
  display: none;
}

.auth-card h2 {
  margin: 14px 0 12px;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 38px;
  letter-spacing: -0.8px;
  line-height: 1.12;
}

.auth-card__lead {
  margin: 0 0 35px;
  color: var(--ink-500);
  font-size: 13px;
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-form label {
  color: var(--ink-800);
  font-size: 11px;
  font-weight: 700;
}

.phone-field {
  display: flex;
  min-height: 54px;
  align-items: center;
  border: 1px solid #d7dce6;
  border-radius: 9px;
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.phone-field:focus-within {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(40, 105, 232, 0.1);
}

.phone-field__flag {
  display: grid;
  width: 53px;
  height: 28px;
  place-items: center;
  border-right: 1px solid var(--line);
  font-size: 17px;
}

.phone-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  padding: 0 15px;
  background: transparent;
  color: var(--ink-950);
  font-size: 14px;
}

.phone-field input::placeholder {
  color: #a7afbd;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.button--wide {
  width: 100%;
  min-height: 52px;
  margin-top: 5px;
}

.button--primary {
  background: var(--blue-600);
  box-shadow: 0 8px 18px rgba(40, 105, 232, 0.19);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue-700);
  box-shadow: 0 10px 24px rgba(40, 105, 232, 0.25);
}

.button--secondary {
  border: 1px solid #dce1e9;
  background: #fff;
  color: var(--ink-800);
}

.button--secondary:hover {
  border-color: #bdc6d6;
  background: #fafbfc;
}

.button--small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 11px;
}

.code-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.code-heading > div {
  display: grid;
  gap: 4px;
}

.code-heading small {
  color: var(--ink-500);
  font-size: 10px;
}

.text-button {
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 700;
}

.code-input {
  width: 100%;
  height: 58px;
  border: 1px solid #d7dce6;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: var(--navy-900);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 12px;
  text-align: center;
}

.code-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(40, 105, 232, 0.1);
}

.form-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 10px;
  line-height: 1.5;
}

.form-message.is-success {
  color: var(--green);
}

.auth-help {
  display: flex;
  gap: 11px;
  margin-top: 8px;
  padding: 13px 14px;
  border-radius: 8px;
  background: #f1f4f9;
  color: var(--ink-500);
}

.auth-help > span {
  display: grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
  border: 1px solid #aeb8c8;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
}

.auth-help p {
  margin: 0;
  font-size: 9.5px;
  line-height: 1.6;
}

.auth-legal {
  margin: 24px 0 0;
  color: #9aa3b2;
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
}

/* Main desktop shell */

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  padding: 26px 18px 18px;
  flex-direction: column;
  background:
    radial-gradient(circle at 25% 0%, rgba(47, 93, 184, 0.2), transparent 24%),
    linear-gradient(180deg, var(--navy-900), #08142d);
  box-shadow: 5px 0 25px rgba(8, 20, 44, 0.08);
  color: #fff;
}

.sidebar__top {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
}

.sidebar-close,
.menu-button {
  display: none;
}

.sidebar-nav {
  display: flex;
  margin-top: 34px;
  flex-direction: column;
  gap: 4px;
}

.sidebar-label {
  margin: 0 11px 9px;
  color: #60708e;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.35px;
  text-transform: uppercase;
}

.sidebar-label--spaced {
  margin-top: 22px;
}

.nav-item {
  display: grid;
  width: 100%;
  min-height: 45px;
  padding: 0 11px;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  background: transparent;
  color: #8898b4;
  font-size: 11px;
  font-weight: 600;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #d6deec;
}

.nav-item.is-active {
  background: linear-gradient(90deg, rgba(48, 104, 221, 0.3), rgba(48, 104, 221, 0.14));
  color: #fff;
  box-shadow: inset 2px 0 0 #4b82ee;
}

.nav-item__icon {
  display: grid;
  place-items: center;
}

.nav-item__icon svg {
  width: 17px;
  height: 17px;
}

.nav-count {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: #7f8da8;
  font-size: 8px;
  font-weight: 800;
  text-align: center;
}

.nav-item.is-active .nav-count {
  background: rgba(255, 255, 255, 0.1);
  color: #b7c9ec;
}

.nav-count--accent {
  color: #9ebafa;
}

.pro-badge {
  padding: 3px 6px;
  border: 1px solid rgba(219, 181, 112, 0.28);
  border-radius: 5px;
  background: rgba(203, 164, 97, 0.1);
  color: #d6b478;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.7px;
}

.sidebar__bottom {
  position: relative;
  display: grid;
  margin-top: auto;
  gap: 10px;
}

.data-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 8px 3px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #45ce9a;
  box-shadow: 0 0 0 4px rgba(69, 206, 154, 0.08);
}

.data-status div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.data-status strong {
  color: #aab6ca;
  font-size: 8.5px;
  font-weight: 700;
}

.data-status small {
  color: #5f708d;
  font-size: 7.5px;
}

.profile-card {
  display: grid;
  width: 100%;
  min-height: 54px;
  padding: 7px 9px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  text-align: left;
}

.profile-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.profile-card__avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(139, 174, 244, 0.2);
  border-radius: 9px;
  background: #182d58;
  color: #b8ccf6;
  font-size: 9px;
  font-weight: 800;
}

.profile-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.profile-card__copy strong,
.profile-card__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-card__copy strong {
  color: #dbe3f0;
  font-size: 9px;
  font-weight: 700;
}

.profile-card__copy small {
  color: #657694;
  font-size: 7.5px;
}

.profile-card__more {
  color: #60708c;
  font-size: 9px;
  letter-spacing: 1px;
}

.profile-menu {
  position: absolute;
  right: 0;
  bottom: 62px;
  left: 0;
  z-index: 3;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 9px;
  background: #122143;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
}

.profile-menu button {
  width: 100%;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: #d9e1ef;
  font-size: 9px;
  text-align: left;
}

.profile-menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.workspace {
  min-width: 0;
  grid-column: 2;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  padding: 15px 30px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.topbar__title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar__title p {
  margin: 0 0 4px;
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.topbar__title h1 {
  margin: 0;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 20px;
  letter-spacing: -0.25px;
  line-height: 1.15;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-search {
  display: flex;
  width: clamp(280px, 30vw, 430px);
  height: 42px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid #e1e5ec;
  border-radius: 9px;
  background: #f8f9fb;
  color: var(--ink-400);
  transition: border-color 150ms ease, background 150ms ease;
}

.global-search:focus-within {
  border-color: #b7c7e8;
  background: #fff;
}

.global-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.global-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink-800);
  font-size: 10px;
}

.global-search input::placeholder {
  color: #9aa5b6;
}

.global-search kbd {
  padding: 3px 6px;
  border: 1px solid #dde2ea;
  border-radius: 5px;
  background: #fff;
  color: #a0a9b7;
  font-family: inherit;
  font-size: 7px;
  box-shadow: var(--shadow-xs);
}

.icon-button,
.menu-button {
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #e1e5ec;
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
  color: var(--ink-500);
}

.icon-button {
  display: grid;
}

.icon-button:hover,
.menu-button:hover {
  background: #f8f9fb;
  color: var(--blue-600);
}

.icon-button.is-spinning svg {
  animation: spin 700ms linear infinite;
}

.workspace-content {
  min-height: calc(100vh - var(--topbar-height));
  padding: 22px 30px 40px;
}

.loading-state {
  display: grid;
  min-height: 52vh;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--ink-500);
}

.loading-state p {
  margin: 0;
  font-size: 11px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #dbe3f0;
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 650ms linear infinite;
}

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

/* Reusable workspace components */

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

#view-content,
.catalog-layout > *,
.ratings-layout > *,
.panel {
  min-width: 0;
  max-width: 100%;
}

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

.stat-card {
  position: relative;
  min-height: 82px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.stat-card::after {
  position: absolute;
  width: 70px;
  height: 70px;
  right: -27px;
  bottom: -40px;
  border: 12px solid rgba(40, 105, 232, 0.035);
  border-radius: 50%;
  content: "";
}

.stat-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-500);
  font-size: 8.5px;
  font-weight: 600;
}

.stat-card__label svg {
  width: 14px;
  height: 14px;
  color: #a7b2c3;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 23px;
  line-height: 1;
}

.stat-card strong small {
  margin-left: 3px;
  color: var(--ink-500);
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 600;
}

.stat-card__trend {
  margin-left: 6px;
  color: var(--green);
  font-family: "Manrope", sans-serif;
  font-size: 8px;
  font-weight: 700;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}

.panel-heading {
  display: flex;
  min-height: 58px;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 16px;
}

.panel-heading p {
  margin: 3px 0 0;
  color: var(--ink-400);
  font-size: 8px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.filter-select {
  height: 34px;
  min-width: 110px;
  border: 1px solid #dfe4eb;
  border-radius: 7px;
  outline: 0;
  padding: 0 28px 0 10px;
  background: #fff;
  color: var(--ink-700);
  font-size: 9px;
  font-weight: 600;
}

.filter-select:focus {
  border-color: var(--blue-500);
}

.filter-reset {
  height: 34px;
  border: 0;
  padding: 0 9px;
  cursor: pointer;
  background: transparent;
  color: var(--blue-600);
  font-size: 8.5px;
  font-weight: 700;
}

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: 16px;
  align-items: start;
}

.catalog-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 840px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 0 10px;
  text-align: right;
  white-space: nowrap;
}

.data-table th:first-child,
.data-table td:first-child,
.data-table th:nth-child(2),
.data-table td:nth-child(2) {
  text-align: left;
}

.data-table th {
  height: 39px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
  color: #7d889a;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 120ms ease, box-shadow 120ms ease;
}

.data-table tbody tr:hover {
  background: #f8faff;
}

.data-table tbody tr.is-selected {
  background: var(--blue-50);
  box-shadow: inset 2px 0 0 var(--blue-600);
}

.data-table td {
  height: 55px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-700);
  font-size: 9px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.favorite-button {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  background: transparent;
  color: #bdc4cf;
}

.favorite-button:hover {
  background: #fff;
  color: var(--gold);
}

.favorite-button.is-active {
  color: var(--gold);
}

.favorite-button svg {
  width: 15px;
  height: 15px;
}

.favorite-button.is-active svg {
  fill: currentColor;
}

.instrument-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.instrument-logo {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 8px;
  background: #edf2fb;
  color: #526b9b;
  font-size: 8px;
  font-weight: 800;
}

.instrument-cell > div {
  min-width: 0;
}

.instrument-cell strong,
.instrument-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instrument-cell strong {
  color: var(--ink-950);
  font-size: 9px;
  font-weight: 700;
}

.instrument-cell small {
  margin-top: 3px;
  color: var(--ink-400);
  font-size: 7.5px;
}

.instrument-kind {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 5px;
  background: #f0f3f8;
  color: #6f7b8e;
  font-size: 7.5px;
  font-weight: 700;
}

.metric-positive {
  color: var(--green);
  font-weight: 700;
}

.metric-strong {
  color: var(--ink-950);
  font-weight: 700;
}

.quantity-input {
  width: 56px;
  height: 30px;
  border: 1px solid #dfe4eb;
  border-radius: 6px;
  outline: 0;
  background: #fff;
  color: var(--ink-800);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
}

.quantity-input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(40, 105, 232, 0.09);
}

.rating-badge {
  display: inline-flex;
  min-width: 38px;
  height: 21px;
  padding: 0 7px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 7.5px;
  font-weight: 800;
}

.rating-badge--medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.rating-badge--muted {
  background: #eff1f5;
  color: #778397;
}

.table-footer {
  display: flex;
  min-height: 47px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-400);
  font-size: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
}

.pagination button {
  min-width: 27px;
  height: 27px;
  border: 1px solid #e0e4eb;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  color: var(--ink-500);
  font-size: 8px;
}

.pagination button.is-active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
}

.detail-panel {
  position: sticky;
  top: calc(var(--topbar-height) + 22px);
  overflow: hidden;
}

.detail-hero {
  padding: 19px 18px 16px;
  border-bottom: 1px solid var(--line-soft);
}

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

.detail-hero__issuer {
  margin: 0;
  color: var(--ink-400);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.55px;
  text-transform: uppercase;
}

.detail-hero h2 {
  margin: 7px 0 5px;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 18px;
  line-height: 1.25;
}

.detail-hero__isin {
  margin: 0;
  color: var(--ink-400);
  font-size: 8px;
}

.detail-tags {
  display: flex;
  margin-top: 13px;
  flex-wrap: wrap;
  gap: 5px;
}

.detail-tag {
  padding: 4px 7px;
  border-radius: 5px;
  background: #f2f4f8;
  color: var(--ink-500);
  font-size: 7px;
  font-weight: 700;
}

.detail-metrics {
  display: grid;
  padding: 4px 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-metric {
  min-width: 0;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
}

.detail-metric:nth-child(odd) {
  padding-right: 12px;
  border-right: 1px solid var(--line-soft);
}

.detail-metric:nth-child(even) {
  padding-left: 12px;
}

.detail-metric:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.detail-metric span,
.detail-metric strong {
  display: block;
}

.detail-metric span {
  margin-bottom: 5px;
  color: var(--ink-400);
  font-size: 7.5px;
}

.detail-metric strong {
  overflow: hidden;
  color: var(--ink-950);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-actions {
  display: grid;
  padding: 15px 18px 18px;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  background: #fafbfc;
}

.detail-actions .button:last-child {
  width: 39px;
  padding: 0;
}

.detail-empty {
  display: grid;
  min-height: 360px;
  padding: 28px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.detail-empty__icon,
.empty-state__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: var(--blue-50);
  color: var(--blue-500);
}

.detail-empty h3,
.empty-state h3 {
  margin: 15px 0 6px;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 15px;
}

.detail-empty p,
.empty-state p {
  max-width: 260px;
  margin: 0;
  color: var(--ink-400);
  font-size: 8.5px;
  line-height: 1.6;
}

.empty-state {
  display: grid;
  min-height: 330px;
  padding: 30px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.empty-state .button {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.section-heading h2 {
  margin: 0;
  color: var(--navy-900);
  font-family: "PT Serif", Georgia, serif;
  font-size: 19px;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 9px;
}

.portfolio-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portfolio-tab {
  height: 34px;
  border: 1px solid #dfe4eb;
  border-radius: 7px;
  padding: 0 12px;
  cursor: pointer;
  background: #fff;
  color: var(--ink-500);
  font-size: 8.5px;
  font-weight: 700;
}

.portfolio-tab.is-active {
  border-color: #bed0f2;
  background: var(--blue-100);
  color: var(--blue-700);
}

.portfolio-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(120px, 0.6fr));
  overflow: hidden;
}

.portfolio-value {
  padding: 22px;
  background: linear-gradient(135deg, #0d1e40, #152e5d);
  color: #fff;
}

.portfolio-value span,
.portfolio-metric span {
  display: block;
  margin-bottom: 8px;
  font-size: 8px;
  font-weight: 600;
}

.portfolio-value span {
  color: #8fa1be;
}

.portfolio-value strong {
  font-family: "PT Serif", Georgia, serif;
  font-size: 27px;
}

.portfolio-value small {
  display: block;
  margin-top: 9px;
  color: #7f92b1;
  font-size: 8px;
}

.portfolio-metric {
  padding: 22px 18px;
  border-right: 1px solid var(--line-soft);
}

.portfolio-metric:last-child {
  border-right: 0;
}

.portfolio-metric span {
  color: var(--ink-400);
}

.portfolio-metric strong {
  color: var(--navy-900);
  font-size: 16px;
}

.allocation-bar {
  display: flex;
  width: 100%;
  height: 5px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8ebf0;
}

.allocation-bar span:nth-child(1) { background: #2869e8; }
.allocation-bar span:nth-child(2) { background: #6d91db; }
.allocation-bar span:nth-child(3) { background: #c5d3ee; }

.ratings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.rating-list {
  display: grid;
}

.rating-row {
  display: grid;
  min-height: 61px;
  padding: 10px 16px;
  grid-template-columns: minmax(0, 1.4fr) 70px 74px 74px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 8.5px;
}

.rating-row:last-child {
  border-bottom: 0;
}

.rating-row__issuer strong,
.rating-row__issuer small {
  display: block;
}

.rating-row__issuer strong {
  color: var(--ink-950);
  font-size: 9px;
}

.rating-row__issuer small {
  margin-top: 4px;
  color: var(--ink-400);
  font-size: 7.5px;
}

.rating-distribution {
  display: grid;
  padding: 17px;
  gap: 14px;
}

.distribution-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 25px;
  align-items: center;
  gap: 9px;
  color: var(--ink-500);
  font-size: 8px;
}

.distribution-track {
  height: 5px;
  overflow: hidden;
  border-radius: 5px;
  background: #edf0f4;
}

.distribution-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-700), var(--blue-500));
}

.pro-hero {
  position: relative;
  min-height: 340px;
  padding: 48px;
  overflow: hidden;
  border: 1px solid #203962;
  border-radius: 13px;
  background:
    radial-gradient(circle at 77% 25%, rgba(203, 164, 97, 0.16), transparent 25%),
    linear-gradient(140deg, #09152d 0%, #10264c 100%);
  box-shadow: var(--shadow-sm);
  color: #fff;
}

.pro-hero::after {
  position: absolute;
  width: 370px;
  height: 370px;
  right: -100px;
  bottom: -190px;
  border: 1px solid rgba(218, 181, 111, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(218, 181, 111, 0.035), 0 0 0 110px rgba(218, 181, 111, 0.02);
  content: "";
}

.pro-hero > * {
  position: relative;
  z-index: 1;
}

.pro-hero__badge {
  display: inline-block;
  padding: 5px 8px;
  border: 1px solid rgba(218, 181, 111, 0.32);
  border-radius: 5px;
  background: rgba(218, 181, 111, 0.09);
  color: #dfbd80;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
}

.pro-hero h2 {
  max-width: 580px;
  margin: 19px 0 14px;
  font-family: "PT Serif", Georgia, serif;
  font-size: 35px;
  letter-spacing: -0.7px;
  line-height: 1.15;
}

.pro-hero p {
  max-width: 580px;
  margin: 0;
  color: #a9b6cb;
  font-size: 11px;
  line-height: 1.75;
}

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

.pro-feature {
  min-height: 100px;
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.pro-feature strong,
.pro-feature small {
  display: block;
}

.pro-feature strong {
  margin-bottom: 7px;
  color: #e7ebf3;
  font-size: 10px;
}

.pro-feature small {
  color: #8191ac;
  font-size: 8px;
  line-height: 1.5;
}

.notice-card {
  display: flex;
  padding: 16px 18px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #eadbbb;
  border-radius: 10px;
  background: #fffaf0;
}

.notice-card strong,
.notice-card small {
  display: block;
}

.notice-card strong {
  color: #725322;
  font-size: 10px;
}

.notice-card small {
  margin-top: 4px;
  color: #987a49;
  font-size: 8px;
}

/* Market maps */

.market-map-view {
  gap: 14px;
}

.market-map-toolbar {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.market-map-tabs {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px;
}

.market-map-tab {
  min-height: 40px;
  border: 1px solid #dfe4eb;
  border-radius: 8px;
  padding: 0 16px;
  cursor: pointer;
  background: #fff;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.market-map-tab:hover {
  border-color: #bdc9dc;
  color: var(--ink-800);
}

.market-map-tab.is-active {
  border-color: var(--blue-600);
  background: var(--blue-600);
  color: #fff;
  box-shadow: 0 6px 16px rgba(40, 105, 232, 0.18);
}

.market-map-filters {
  display: flex;
  min-width: 0;
  align-items: end;
  justify-content: flex-end;
  gap: 9px;
}

.market-map-filters label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.market-map-filters label > span {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 700;
}

.market-map-select {
  min-width: 150px;
}

.market-map-filters label:first-child .market-map-select {
  min-width: 260px;
}

.market-map-options {
  display: flex;
  min-height: 54px;
  padding: 8px 12px;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.market-metric-control,
.market-portfolio-select {
  display: flex;
  align-items: center;
  gap: 9px;
}

.market-metric-control > span,
.market-portfolio-select > span {
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 700;
}

.market-metric-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 7px;
  background: var(--canvas);
}

.market-metric-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  padding: 0 12px;
  cursor: pointer;
  background: transparent;
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 800;
}

.market-metric-switch button.is-active {
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  color: var(--blue-700);
}

.market-portfolio-toggle {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink-700);
  font-size: 12px;
  font-weight: 700;
}

.market-portfolio-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue-600);
}

.market-portfolio-select .filter-select {
  min-width: 190px;
}

.market-portfolio-hint {
  display: inline-flex;
  margin-left: auto;
  align-items: center;
  gap: 7px;
  color: var(--ink-500);
  font-size: 10px;
}

.market-portfolio-hint i,
.market-portfolio-legend {
  width: 11px !important;
  height: 11px !important;
  border: 2px solid var(--gold) !important;
  border-radius: 50%;
  background: transparent !important;
}

.market-map-panel {
  overflow: hidden;
}

.market-map-heading {
  min-height: 68px;
  padding-right: 20px;
  padding-left: 20px;
}

.market-map-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 10px;
  font-weight: 800;
}

.market-chart-wrap {
  position: relative;
  min-width: 0;
  padding: 6px 18px 18px;
}

.market-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 390px;
  overflow: visible;
}

.market-grid-line {
  stroke: #e9edf3;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.market-axis-line {
  stroke: #9da9ba;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.market-axis-tick {
  fill: #758196;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 600;
}

.market-axis-title {
  fill: var(--ink-700);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.market-chart text {
  stroke: none;
}

.market-point {
  cursor: pointer;
  outline: none;
}

.market-point .market-mark {
  stroke: var(--surface);
  stroke-width: 2.5;
  opacity: 0.88;
  vector-effect: non-scaling-stroke;
  transition: opacity 150ms ease, stroke-width 150ms ease;
}

.market-point:hover .market-mark,
.market-point:focus .market-mark {
  stroke: var(--navy-900);
  stroke-width: 3;
  opacity: 1;
}

.market-point.is-selected .market-mark {
  stroke: var(--navy-900);
  stroke-width: 4;
  opacity: 1;
}

.market-point-label {
  pointer-events: none;
}

.market-point-label div {
  overflow: hidden;
  padding: 4px 6px;
  border: 1px solid rgba(157, 169, 186, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 2px 7px rgba(10, 24, 53, 0.08);
  color: var(--ink-700);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 700;
  line-height: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-portfolio-ring {
  fill: rgba(203, 164, 97, 0.08);
  stroke: var(--gold);
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.map-series-0 .market-mark,
.market-legend .map-series-0 { fill: var(--map-series-1); background: var(--map-series-1); }
.map-series-1 .market-mark,
.market-legend .map-series-1 { fill: var(--map-series-2); background: var(--map-series-2); }
.map-series-2 .market-mark,
.market-legend .map-series-2 { fill: var(--map-series-3); background: var(--map-series-3); }
.map-series-3 .market-mark,
.market-legend .map-series-3 { fill: var(--map-series-4); background: var(--map-series-4); }
.map-series-4 .market-mark,
.market-legend .map-series-4 { fill: var(--map-series-5); background: var(--map-series-5); }
.map-series-5 .market-mark,
.market-legend .map-series-5 { fill: var(--map-series-6); background: var(--map-series-6); }
.map-series-6 .market-mark,
.market-legend .map-series-6 { fill: var(--map-series-7); background: var(--map-series-7); }
.map-series-7 .market-mark,
.market-legend .map-series-7 { fill: var(--map-series-8); background: var(--map-series-8); }

.market-legend {
  display: flex;
  padding: 3px 20px 0 56px;
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--ink-700);
  font-size: 10px;
}

.market-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.market-legend i {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
}

.market-legend small {
  color: var(--ink-400);
  font-size: 9px;
}

.market-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  width: max-content;
  max-width: 250px;
  padding: 10px 12px;
  transform: translate(-50%, -100%);
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: var(--navy-900);
  box-shadow: 0 12px 28px rgba(7, 17, 38, 0.22);
  color: #fff;
  font-size: 10px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.market-tooltip.is-visible {
  opacity: 1;
}

.market-tooltip strong,
.market-tooltip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-tooltip span {
  color: #aebbd0;
  font-size: 9px;
}

.market-selection {
  display: grid;
  min-height: 78px;
  padding: 13px 16px;
  grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(76px, 0.55fr)) auto;
  align-items: center;
  gap: 14px;
}

.market-selection__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.market-selection__identity > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.market-selection__identity strong,
.market-selection__identity span,
.market-selection__identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-selection__identity strong {
  color: var(--ink-950);
  font-size: 12px;
}

.market-selection__identity small,
.market-selection__identity span {
  color: var(--ink-400);
  font-size: 9px;
}

.market-selection__metric {
  display: grid;
  gap: 6px;
  border-left: 1px solid var(--line-soft);
  padding-left: 14px;
}

.market-selection__metric > span:first-child {
  color: var(--ink-400);
  font-size: 9px;
}

.market-selection__metric > strong {
  color: var(--ink-950);
  font-size: 12px;
}

.market-map-empty {
  min-height: 430px;
}

/* KBD comparison */

.kbd-view {
  gap: 14px;
}

.kbd-loading {
  display: flex;
  min-height: 180px;
  padding: 28px;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.kbd-loading h2,
.kbd-loading p {
  margin: 0;
}

.kbd-loading h2 {
  font-family: "PT Serif", Georgia, serif;
  font-size: 20px;
}

.kbd-loading p {
  margin-top: 4px;
  color: var(--ink-500);
  font-size: 12px;
}

.kbd-controls {
  display: grid;
  min-height: 92px;
  padding: 15px 18px;
  grid-template-columns: minmax(230px, 1fr) minmax(190px, 0.6fr) minmax(190px, 0.6fr) auto;
  align-items: center;
  gap: 18px;
}

.kbd-controls__intro {
  display: grid;
  gap: 3px;
}

.kbd-controls__intro > span {
  color: var(--blue-700);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kbd-controls__intro strong {
  color: var(--ink-950);
  font-family: "PT Serif", Georgia, serif;
  font-size: 18px;
}

.kbd-controls__intro small {
  max-width: 390px;
  color: var(--ink-500);
  font-size: 10px;
  line-height: 1.45;
}

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

.kbd-date-field > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 800;
}

.kbd-date-field i,
.kbd-legend i {
  width: 19px;
  height: 3px;
  flex: 0 0 19px;
  border-radius: 2px;
}

.kbd-date-field--a i,
.kbd-legend .kbd-series-1 {
  background: var(--blue-600);
}

.kbd-date-field--b i,
.kbd-legend .kbd-series-2 {
  background: var(--green);
}

.kbd-date-field .filter-select {
  width: 100%;
  min-width: 0;
  font-size: 12px;
}

.kbd-data-status {
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.kbd-data-status > div {
  display: grid;
  gap: 2px;
}

.kbd-data-status strong {
  color: var(--ink-800);
  font-size: 11px;
}

.kbd-data-status small {
  color: var(--ink-400);
  font-size: 9px;
}

.kbd-chart-panel {
  overflow: hidden;
}

.kbd-chart-heading {
  min-height: 68px;
  padding-right: 20px;
  padding-left: 20px;
}

.kbd-chart-wrap {
  position: relative;
  min-width: 0;
  padding: 4px 18px 0;
}

.kbd-legend {
  position: absolute;
  z-index: 2;
  top: 14px;
  right: 32px;
  display: flex;
  padding: 7px 9px;
  gap: 13px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-700);
  font-size: 10px;
  font-weight: 700;
}

.kbd-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kbd-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 390px;
  overflow: visible;
}

.kbd-grid-line {
  stroke: #e9edf3;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.kbd-axis-line {
  stroke: #9da9ba;
  stroke-width: 1.2;
  vector-effect: non-scaling-stroke;
}

.kbd-axis-tick,
.kbd-axis-title {
  stroke: none;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.kbd-axis-tick {
  fill: #758196;
  font-size: 12px;
  font-weight: 600;
}

.kbd-axis-title {
  fill: var(--ink-700);
  font-size: 13px;
  font-weight: 800;
}

.kbd-curve {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.kbd-curve.kbd-series-1,
.kbd-anchor.kbd-series-1 {
  stroke: var(--blue-600);
}

.kbd-curve.kbd-series-2,
.kbd-anchor.kbd-series-2 {
  stroke: var(--green);
}

.kbd-anchor {
  fill: var(--surface);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.kbd-source {
  margin: -3px 26px 17px 72px;
  color: var(--ink-400);
  font-size: 9px;
  line-height: 1.45;
}

.kbd-comparison .table-wrap {
  overflow-x: auto;
}

.kbd-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.kbd-table th,
.kbd-table td {
  height: 44px;
  padding: 0 18px;
  border-top: 1px solid var(--line-soft);
  text-align: right;
  font-size: 11px;
}

.kbd-table th {
  height: 38px;
  color: var(--ink-400);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kbd-table th:first-child,
.kbd-table td:first-child {
  text-align: left;
}

.kbd-delta--up {
  color: var(--red);
  font-weight: 800;
}

.kbd-delta--down {
  color: var(--green);
  font-weight: 800;
}

/* Desktop legibility */

.sidebar-label { font-size: 9px; }
.nav-item { font-size: 13px; }
.nav-count { font-size: 10px; }
.pro-badge { font-size: 8px; }
.data-status strong { font-size: 10px; }
.data-status small { font-size: 9px; }
.profile-card__copy strong { font-size: 11px; }
.profile-card__copy small { font-size: 9px; }
.topbar__title p { font-size: 10px; }
.topbar__title h1 { font-size: 24px; }
.global-search input { font-size: 12px; }
.global-search kbd { font-size: 9px; }
.loading-state p { font-size: 13px; }
.stat-card__label { font-size: 10px; }
.stat-card strong { font-size: 27px; }
.stat-card strong small { font-size: 11px; }
.panel-heading h2 { font-size: 19px; }
.panel-heading p { font-size: 10px; }
.filter-select { font-size: 11px; }
.filter-reset { font-size: 10px; }
.data-table th { font-size: 9px; }
.data-table td { font-size: 11px; }
.instrument-logo { font-size: 10px; }
.instrument-cell strong { font-size: 11px; }
.instrument-cell small { font-size: 9px; }
.instrument-kind,
.rating-badge { font-size: 9px; }
.quantity-input { font-size: 11px; }
.table-footer,
.pagination button { font-size: 10px; }
.detail-hero__issuer,
.detail-hero__isin { font-size: 10px; }
.detail-hero h2 { font-size: 21px; }
.detail-tag { font-size: 9px; }
.detail-metric span { font-size: 9px; }
.detail-metric strong { font-size: 12px; }
.detail-empty h3,
.empty-state h3 { font-size: 18px; }
.detail-empty p,
.empty-state p { font-size: 10px; }
.section-heading h2 { font-size: 23px; }
.section-heading p { font-size: 11px; }
.portfolio-tab { font-size: 10px; }
.rating-row,
.distribution-item { font-size: 10px; }
.rating-row__issuer strong { font-size: 11px; }
.rating-row__issuer small { font-size: 9px; }
.portfolio-value span,
.portfolio-metric span { font-size: 10px; }
.portfolio-value small { font-size: 10px; }
.notice-card strong { font-size: 12px; }
.notice-card small { font-size: 10px; }
.button { font-size: 13px; }
.button--small { font-size: 11px; }

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  transform: translateY(20px);
  border-radius: 8px;
  background: var(--navy-900);
  box-shadow: var(--shadow-lg);
  color: #fff;
  font-size: 9px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 1180px) {
  :root { --sidebar-width: 224px; }

  .catalog-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
  }

  .topbar,
  .workspace-content {
    padding-right: 22px;
    padding-left: 22px;
  }

  .global-search {
    width: 300px;
  }

  .portfolio-summary {
    grid-template-columns: 1.3fr repeat(3, 0.7fr);
  }

  .market-selection {
    grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(68px, 0.5fr));
  }

  .market-selection > .button {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 980px) {
  .auth-screen {
    grid-template-columns: minmax(370px, 0.9fr) minmax(390px, 1.1fr);
  }

  .auth-story {
    padding: 35px;
  }

  .auth-features {
    margin-top: 35px;
  }

  .auth-panel {
    padding: 35px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: 252px;
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    color: #a8b5ca;
    font-size: 20px;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 45;
    inset: 0;
    display: block !important;
    background: rgba(4, 12, 28, 0.46);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .sidebar-scrim.is-visible {
    opacity: 1;
    pointer-events: auto;
  }

  .workspace {
    grid-column: 1;
  }

  .menu-button {
    display: grid;
  }

  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

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

  .portfolio-summary {
    grid-template-columns: repeat(3, 1fr);
  }

  .portfolio-value {
    grid-column: 1 / -1;
  }

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

  .kbd-controls__intro,
  .kbd-data-status {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    display: block;
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    padding: 30px 22px;
  }

  .auth-card__mobile-brand {
    display: flex;
    margin-bottom: 55px;
    align-items: center;
    gap: 10px;
    color: var(--navy-900);
  }

  .auth-card__mobile-brand .brand__mark {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .auth-card__mobile-brand strong {
    font-family: "PT Serif", Georgia, serif;
    font-size: 18px;
  }

  .topbar {
    min-height: 70px;
    padding: 11px 15px;
  }

  .topbar__title h1 {
    font-size: 17px;
  }

  .topbar__title p,
  .global-search kbd,
  .icon-button {
    display: none;
  }

  .global-search {
    width: 42px;
    height: 42px;
    cursor: pointer;
    overflow: hidden;
  }

  .global-search:focus-within {
    position: absolute;
    right: 15px;
    left: 15px;
    z-index: 5;
    width: auto;
  }

  .workspace-content {
    padding: 15px 15px 32px;
  }

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

  .stat-card {
    min-height: 78px;
    padding: 14px;
  }

  .catalog-layout,
  .ratings-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-heading {
    padding: 14px;
  }

  .toolbar {
    width: 100%;
  }

  .filter-select {
    min-width: 0;
    flex: 1;
  }

  .data-table {
    min-width: 760px;
  }

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

  .portfolio-value {
    grid-column: auto;
  }

  .portfolio-metric {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .rating-row {
    grid-template-columns: minmax(0, 1fr) 52px 58px;
  }

  .rating-row > :last-child {
    display: none;
  }

  .pro-hero {
    padding: 30px 23px;
  }

  .pro-hero h2 {
    font-size: 28px;
  }

  .pro-feature-grid {
    grid-template-columns: 1fr;
  }

  .notice-card {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .market-map-tabs {
    width: 100%;
  }

  .market-map-tab {
    min-width: 0;
    flex: 1;
    padding-right: 10px;
    padding-left: 10px;
  }

  .market-map-filters {
    width: 100%;
    justify-content: stretch;
  }

  .market-map-filters label {
    flex: 1;
  }

  .market-map-select,
  .market-map-filters label:first-child .market-map-select {
    width: 100%;
    min-width: 0;
  }

  .market-map-options {
    align-items: stretch;
  }

  .market-portfolio-hint {
    width: 100%;
    margin-left: 0;
  }

  .market-chart-wrap {
    padding-right: 8px;
    padding-left: 8px;
  }

  .market-chart {
    min-height: 290px;
  }

  .market-legend {
    padding-right: 10px;
    padding-left: 44px;
  }

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

  .market-selection__identity,
  .market-selection > .button {
    grid-column: 1 / -1;
  }

  .market-selection > .button {
    width: 100%;
  }

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

  .kbd-controls__intro,
  .kbd-data-status {
    grid-column: 1 / -1;
  }

  .kbd-chart-wrap {
    padding-right: 6px;
    padding-left: 6px;
  }

  .kbd-chart {
    min-height: 300px;
  }

  .kbd-legend {
    position: static;
    margin: 4px 12px -8px 58px;
    flex-wrap: wrap;
  }

  .kbd-source {
    margin-right: 15px;
    margin-left: 46px;
  }
}

@media (max-width: 440px) {
  .auth-card h2 {
    font-size: 33px;
  }

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

  .sidebar {
    width: min(88vw, 300px);
  }

  .toast {
    right: 14px;
    bottom: 14px;
    left: 14px;
    max-width: none;
  }

  .market-map-tabs,
  .market-map-filters {
    display: grid;
    grid-template-columns: 1fr;
  }

  .market-map-tab {
    width: 100%;
  }

  .market-map-options,
  .market-metric-control,
  .market-portfolio-select {
    align-items: stretch;
    flex-direction: column;
  }

  .market-metric-switch,
  .market-metric-switch button,
  .market-portfolio-select .filter-select {
    width: 100%;
  }

  .market-metric-switch button {
    flex: 1;
  }

  .market-chart {
    min-height: 250px;
  }

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

  .market-selection__identity,
  .market-selection > .button {
    grid-column: auto;
  }

  .kbd-controls {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .kbd-controls__intro,
  .kbd-data-status {
    grid-column: auto;
  }

  .kbd-chart {
    min-height: 250px;
  }

  .kbd-legend {
    margin-left: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
