:root {
  color-scheme: light;
  --ink: #251d19;
  --ink-soft: #625751;
  --ink-faint: #8d827b;
  --paper: #f6f1ea;
  --paper-deep: #eee6dd;
  --card: #fffdf9;
  --line: #ded5cc;
  --line-strong: #cfc3b9;
  --coral: #f35b35;
  --coral-dark: #d94322;
  --coral-soft: #ffe0d6;
  --brown: #2e211c;
  --brown-soft: #493832;
  --green: #28765b;
  --green-soft: #dff2e9;
  --amber: #a76119;
  --amber-soft: #fff0d5;
  --red: #b83d34;
  --red-soft: #fde7e3;
  --shadow-sm: 0 1px 2px rgba(52, 37, 28, 0.05), 0 8px 24px rgba(52, 37, 28, 0.04);
  --shadow-md: 0 24px 70px rgba(52, 37, 28, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --max-width: 1540px;
  --symbol-column-width: 118px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 89% 11%, rgba(243, 91, 53, 0.075), transparent 23rem),
    linear-gradient(180deg, #f9f5ef 0, var(--paper) 46rem, #f2ece5 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
a,
input,
select,
[tabindex="0"] {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(243, 91, 53, 0.33);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

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

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 76px;
  padding: 12px max(24px, calc((100vw - var(--max-width)) / 2));
  border-bottom: 1px solid rgba(207, 195, 185, 0.82);
  background: rgba(249, 245, 239, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: max-content;
  color: var(--ink);
  text-decoration: none;
}

.brand-logo {
  display: block;
  width: auto;
  height: 36px;
  object-fit: contain;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.7);
}

.topnav a {
  padding: 7px 13px;
  border-radius: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.topnav a:hover,
.topnav a.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(52, 37, 28, 0.08);
}

.topbar-status {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.78);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.status-dot {
  width: 8px;
  height: 8px;
  border: 2px solid #f8e9be;
  border-radius: 50%;
  background: #d5962c;
  box-shadow: 0 0 0 3px rgba(213, 150, 44, 0.12);
}

.topbar-status.connected .status-dot {
  border-color: #c9eedf;
  background: #2f9370;
  box-shadow: 0 0 0 3px rgba(47, 147, 112, 0.12);
}

.topbar-status.running .status-dot {
  border-color: #ffd4c6;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.12);
  animation: status-pulse 1.35s ease infinite;
}

.topbar-status.offline .status-dot {
  border-color: #f4c9c4;
  background: var(--red);
}

main {
  width: 100%;
  max-width: calc(var(--max-width) + 48px);
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  padding: 32px 24px 58px;
}

.alert-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: var(--max-width);
  margin: 0 auto 18px;
  padding: 12px 14px;
  border: 1px solid #efbbb2;
  border-radius: 12px;
  background: var(--red-soft);
  color: #832a24;
  font-size: 13px;
  font-weight: 590;
}

.alert-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.alert-banner .icon-button {
  margin-left: auto;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: currentColor;
  font-size: 22px;
}

.icon-button:hover {
  background: rgba(131, 42, 36, 0.1);
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 348px;
  align-items: start;
  gap: 22px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.workspace {
  min-width: 0;
}

.search-hero {
  position: relative;
  padding: clamp(34px, 4.2vw, 64px) clamp(26px, 4vw, 62px) 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0.68), transparent 52%),
    #eee8e3;
  box-shadow: var(--shadow-sm);
}

.search-hero::after {
  position: absolute;
  top: -105px;
  right: -125px;
  width: 360px;
  height: 300px;
  border: 60px solid rgba(243, 91, 53, 0.07);
  border-radius: 48% 52% 45% 55%;
  content: "";
  pointer-events: none;
  transform: rotate(-12deg);
}

.eyebrow,
.card-kicker {
  margin: 0;
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.eyebrow span {
  width: 24px;
  height: 2px;
  background: var(--coral);
}

.search-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 750px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(43px, 5.2vw, 76px);
  font-weight: 500;
  line-height: 0.97;
  letter-spacing: -0.055em;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 22px 0 30px;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.65;
}

.search-form {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 8px 8px 8px 18px;
  border: 1px solid #cfc4ba;
  border-radius: 16px;
  background: #fffdf9;
  box-shadow: 0 12px 35px rgba(62, 43, 34, 0.09), inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-form:focus-within {
  border-color: var(--coral);
  box-shadow: 0 14px 38px rgba(62, 43, 34, 0.1), 0 0 0 4px rgba(243, 91, 53, 0.1);
}

.search-glyph {
  position: relative;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border: 2px solid #83766e;
  border-radius: 50%;
}

.search-glyph::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  border-radius: 2px;
  background: #83766e;
  content: "";
  transform: rotate(45deg);
}

.search-form input {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 0 4px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-form input::placeholder {
  color: #958981;
  opacity: 1;
}

.search-form input::-webkit-search-cancel-button {
  display: none;
}

.clear-search {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: #eee7e0;
  color: #786b64;
  font-size: 19px;
  line-height: 1;
}

.clear-search:hover {
  background: #e5dbd3;
  color: var(--ink);
}

.tell-me-button,
.primary-button,
.secondary-button,
.outline-button,
.page-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-weight: 720;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.tell-me-button {
  min-width: 116px;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--coral);
  background: var(--coral);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(121, 37, 17, 0.18);
}

.tell-me-button:hover,
.primary-button:hover {
  background: var(--coral-dark);
  transform: translateY(-1px);
}

.tell-me-button.loading .spark,
.secondary-button.loading .download-icon {
  animation: spin 900ms linear infinite;
}

.spark {
  font-size: 16px;
}

.search-support {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-top: 11px;
}

.search-instructions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 16px;
  margin-top: 11px;
  color: var(--ink-soft);
  font-size: 11px;
}

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

.search-instructions i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.7);
  color: var(--coral-dark);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.search-instructions strong {
  color: var(--ink);
  font-weight: 760;
}

.search-helper {
  min-height: 20px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.search-helper.error {
  color: var(--red);
}

.search-helper.success {
  color: var(--green);
}

.model-chip {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid #d6ccc4;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.67);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.03em;
}

.prompt-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 24px;
}

.prompt-row > span {
  margin-right: 2px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prompt-chip {
  padding: 7px 10px;
  border: 1px solid #d9cec6;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.66);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 620;
}

.prompt-chip:hover {
  border-color: #bdafa4;
  background: #fffdf9;
  color: var(--ink);
}

.results-card {
  position: relative;
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.results-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 320px;
  padding: 42px;
  text-align: left;
}

.results-empty.compact {
  min-height: 250px;
}

.results-empty h2 {
  margin: 0 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.results-empty p {
  max-width: 460px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.6;
}

.empty-visual {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  border: 1px solid #e4d9d0;
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(215, 204, 195, 0.42) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(215, 204, 195, 0.42) 50%, transparent 51%),
    #faf6f1;
}

.bar {
  position: absolute;
  bottom: 31px;
  width: 8px;
  border-radius: 4px 4px 1px 1px;
  background: var(--coral);
}

.bar-one {
  left: 31px;
  height: 21px;
  opacity: 0.48;
}

.bar-two {
  left: 48px;
  height: 35px;
  opacity: 0.72;
}

.bar-three {
  left: 65px;
  height: 51px;
}

.empty-line {
  position: absolute;
  top: 28px;
  left: 24px;
  width: 60px;
  height: 40px;
  border-top: 2px solid #4f413b;
  border-radius: 50%;
  transform: rotate(-22deg);
}

.empty-dot {
  position: absolute;
  top: 28px;
  right: 20px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4f413b;
}

.inline-loader {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border: 3px solid var(--coral-soft);
  border-top-color: var(--coral);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.guidance-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: 1px solid #dfd3ca;
  border-radius: 15px;
  background: #f3ece6;
  color: var(--coral-dark);
  font-family: Georgia, serif;
  font-size: 18px;
  font-style: italic;
}

.guidance-icon.zero {
  color: var(--ink-faint);
  font-style: normal;
}

.results-view {
  min-width: 0;
}

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 21px 22px 17px;
  border-bottom: 1px solid var(--line);
}

.results-heading-row {
  display: flex;
  align-items: center;
  gap: 9px;
}

.results-toolbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.results-toolbar p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.results-toolbar .row-action-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  color: var(--coral-dark);
  font-size: 9px;
  font-weight: 680;
}

.row-action-hint span {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--coral-soft);
}

.table-scroll-hint {
  display: none;
}

.style-guide {
  max-width: 720px;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 9px;
}

.style-guide summary {
  width: max-content;
  cursor: pointer;
  color: #49627f;
  font-weight: 750;
  letter-spacing: 0.015em;
}

.style-guide p {
  max-width: 680px;
  margin-top: 5px;
  line-height: 1.55;
}

.result-count {
  display: inline-flex;
  align-items: center;
  min-width: 25px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 10px;
  font-weight: 800;
}

.results-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.secondary-button,
.outline-button,
.page-button {
  border: 1px solid var(--line-strong);
  background: #fffdf9;
  color: var(--ink);
}

.secondary-button {
  min-height: 38px;
  padding: 0 13px;
  font-size: 11px;
}

.secondary-button:hover,
.outline-button:hover,
.page-button:hover:not(:disabled) {
  border-color: #a99a8f;
  background: #f7f1eb;
  transform: translateY(-1px);
}

.download-icon {
  font-size: 16px;
  line-height: 1;
}

.reorder-icon {
  color: var(--coral-dark);
  font-size: 16px;
  line-height: 1;
}

.table-frame {
  position: relative;
  width: 100%;
  min-height: 395px;
  overflow: auto;
  overscroll-behavior-inline: contain;
  scrollbar-color: #cbbdb2 transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.table-frame::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.table-frame::-webkit-scrollbar-track {
  background: #f5efe9;
}

.table-frame::-webkit-scrollbar-thumb {
  border: 3px solid #f5efe9;
  border-radius: 10px;
  background: #b9aaa0;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

th,
td {
  height: 52px;
  padding: 10px 14px;
  border-right: 1px solid #ede5de;
  border-bottom: 1px solid #ede5de;
  background: var(--card);
  text-align: right;
  white-space: nowrap;
}

th:last-child,
td:last-child {
  border-right: 0;
}

th {
  position: sticky;
  z-index: 4;
  top: 0;
  height: 46px;
  padding-block: 8px;
  background: #f2ebe5;
  color: #70635b;
  font-size: 9px;
  font-weight: 790;
  letter-spacing: 0.045em;
  line-height: 1.25;
  text-transform: uppercase;
}

th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

th button:hover {
  color: var(--ink);
}

.sort-indicator {
  min-width: 8px;
  color: #a99a91;
  font-size: 9px;
}

th[aria-sort="ascending"] .sort-indicator,
th[aria-sort="descending"] .sort-indicator {
  color: var(--coral-dark);
}

tbody tr:hover td {
  background: #fffaf5;
}

td {
  color: #453a35;
  font-weight: 520;
}

td.text-cell,
th.text-cell {
  text-align: left;
}

th.investment-style-column,
td.investment-style-cell {
  min-width: 130px;
  text-align: left;
}

.investment-style-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.025em;
  line-height: 1;
  white-space: nowrap;
}

.investment-style-badge.style-value {
  border-color: #b8c9e2;
  background: #e8eff9;
  color: #294f82;
}

.investment-style-badge.style-growth {
  border-color: #b7d9cb;
  background: #e2f3ec;
  color: #22684f;
}

.investment-style-badge.style-blend {
  border-color: #d1c1e5;
  background: #f0eafa;
  color: #684b8c;
}

.investment-style-badge.style-data-limited {
  border-color: #d4ccc5;
  background: #f1ece7;
  color: #6f625b;
}

td.company-cell {
  width: 240px;
  max-width: 240px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 650;
  text-overflow: ellipsis;
}

td.symbol-cell {
  width: var(--symbol-column-width);
  max-width: var(--symbol-column-width);
  overflow: hidden;
  color: var(--coral-dark);
  font-weight: 800;
  letter-spacing: 0.015em;
}

.sticky-one {
  position: sticky;
  z-index: 2;
  left: 0;
  width: var(--symbol-column-width);
  min-width: var(--symbol-column-width);
  max-width: var(--symbol-column-width);
  background: var(--card);
}

.sticky-two {
  position: sticky;
  z-index: 2;
  left: var(--symbol-column-width);
  width: 240px;
  min-width: 240px;
  max-width: 240px;
  background: var(--card);
  box-shadow: 8px 0 12px -12px rgba(42, 29, 23, 0.45);
}

th.sticky-one,
th.sticky-two {
  z-index: 6;
  background: #ece4dd;
}

tbody tr:hover td.sticky-one,
tbody tr:hover td.sticky-two {
  background: #fffaf5;
}

.value-positive {
  color: var(--green);
  font-weight: 720;
}

.value-negative {
  color: var(--red);
  font-weight: 720;
}

.value-null {
  color: #b2a79f;
}

.boolean-pill,
.exchange-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.boolean-pill.yes {
  background: var(--green-soft);
  color: var(--green);
}

.boolean-pill.no {
  background: var(--red-soft);
  color: var(--red);
}

.exchange-pill {
  background: #eee8f8;
  color: #6e5596;
}

.json-cell {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 61px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 11px;
}

.column-order-overlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.column-order-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(35, 27, 23, 0.64);
  cursor: default;
  backdrop-filter: blur(9px);
}

.column-order-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(620px, 100%);
  max-height: calc(100vh - 40px);
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 22px;
  outline: 0;
  background: #fffaf5;
  box-shadow: var(--shadow-md);
  flex-direction: column;
}

.column-order-heading {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.column-order-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.column-order-dialog > p:not(.column-order-status) {
  flex: 0 0 auto;
  margin: 10px 0 18px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.column-order-list {
  min-height: 180px;
  padding: 6px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f4eee8;
  overscroll-behavior: contain;
}

.column-order-item {
  display: grid;
  grid-template-columns: 24px 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  margin-bottom: 5px;
  padding: 7px 8px 7px 10px;
  border: 1px solid #e1d7cf;
  border-radius: 11px;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(52, 37, 28, 0.04);
  cursor: grab;
}

.column-order-item:last-child {
  margin-bottom: 0;
}

.column-order-item.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.column-order-handle {
  color: #a1948b;
  font-size: 19px;
  line-height: 1;
  text-align: center;
}

.column-order-position {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.column-order-copy {
  min-width: 0;
}

.column-order-copy strong,
.column-order-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.column-order-copy strong {
  color: var(--ink);
  font-size: 12px;
}

.column-order-copy small {
  margin-top: 1px;
  color: var(--ink-faint);
  font-size: 9px;
}

.column-order-controls {
  display: flex;
  gap: 5px;
}

.column-order-controls button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  font-weight: 800;
}

.column-order-controls button:hover:not(:disabled) {
  border-color: var(--coral);
  background: var(--coral-soft);
  color: var(--coral-dark);
}

.column-order-status {
  min-height: 18px;
  flex: 0 0 auto;
  margin: 8px 2px 2px;
  color: var(--green);
  font-size: 10px;
  font-weight: 650;
}

.column-order-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.column-order-actions > div {
  display: flex;
  gap: 8px;
}

.column-order-actions .outline-button,
.column-order-actions .primary-button {
  min-height: 42px;
  padding: 0 15px;
}

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

.page-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
}

.pagination span {
  min-width: 78px;
  color: var(--ink-soft);
  font-weight: 660;
  text-align: center;
}

.control-room {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.control-card {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.sync-card {
  border-color: var(--brown);
  background:
    radial-gradient(circle at 100% 0, rgba(243, 91, 53, 0.22), transparent 12rem),
    var(--brown);
  color: #fffaf5;
}

.sync-card .card-kicker {
  color: #ff9f82;
}

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

.card-header.split {
  align-items: center;
}

.card-header h2 {
  margin: 6px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.database-icon {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 10px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
}

.database-icon i {
  display: block;
  height: 7px;
  margin-top: -2px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
}

.sync-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 24px 0 19px;
}

.sync-details div {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.sync-details dt {
  margin-bottom: 4px;
  color: #c7bab3;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sync-details dd {
  margin: 0;
  color: #fffdf9;
  font-size: 11px;
  font-weight: 620;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: normal;
}

.progress-block {
  margin: 5px 0 18px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #dfd4ce;
  font-size: 10px;
}

.progress-copy strong {
  color: #fff;
  font-size: 11px;
}

.progress-track,
.modal-progress {
  height: 6px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.progress-track span,
.modal-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--coral);
  transition: width 300ms ease;
}

.progress-block p {
  margin: 0;
  overflow: hidden;
  color: #b9aaa2;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  min-height: 47px;
  padding: 0 15px;
  border: 1px solid var(--coral);
  background: var(--coral);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(121, 37, 17, 0.18);
  font-size: 12px;
}

.button-arrow {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
}

.card-footnote {
  margin: 11px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.sync-card .card-footnote {
  color: #a99b94;
}

.schedule-card {
  background: #eee8e3;
}

.switch {
  position: relative;
  display: inline-flex;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.switch-track {
  position: relative;
  display: block;
  width: 43px;
  height: 24px;
  border: 1px solid #c5b8ae;
  border-radius: 999px;
  background: #d6cbc3;
  transition: background 160ms ease, border-color 160ms ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(38, 28, 23, 0.2);
  content: "";
  transition: transform 160ms ease;
}

.switch input:checked + .switch-track {
  border-color: var(--coral);
  background: var(--coral);
}

.switch input:checked + .switch-track::after {
  transform: translateX(19px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(243, 91, 53, 0.3);
  outline-offset: 3px;
}

.weekday-fieldset {
  min-width: 0;
  margin: 23px 0 17px;
  padding: 0;
  border: 0;
}

.weekday-fieldset legend,
.field-label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.weekday-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
}

.weekday-grid label {
  position: relative;
  min-width: 0;
}

.weekday-grid input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.weekday-grid span {
  display: grid;
  place-items: center;
  min-height: 35px;
  border: 1px solid #cfc2b8;
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.55);
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 750;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.weekday-grid span:hover {
  border-color: #aa9b90;
}

.weekday-grid input:checked + span {
  border-color: var(--brown);
  background: var(--brown);
  color: #fff;
}

.weekday-grid input:focus-visible + span {
  outline: 3px solid rgba(243, 91, 53, 0.3);
  outline-offset: 2px;
}

.time-field {
  display: flex;
  align-items: center;
  border: 1px solid #cfc2b8;
  border-radius: 10px;
  background: rgba(255, 253, 249, 0.72);
}

.time-field:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.time-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 690;
}

.time-field > span {
  margin-right: 11px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 9px;
  font-weight: 800;
}

.field-error {
  margin: 6px 0 0;
  color: var(--red);
  font-size: 10px;
  font-weight: 620;
}

.outline-button {
  width: 100%;
  min-height: 42px;
  margin-top: 16px;
  font-size: 11px;
}

.settings-card {
  background: #f8eae4;
}

.ai-mark {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 17px;
}

.settings-card .field-label {
  margin-top: 20px;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.select-wrap select {
  width: 100%;
  height: 43px;
  padding: 0 39px 0 12px;
  border: 1px solid #d3c4ba;
  border-radius: 10px;
  appearance: none;
  background: rgba(255, 253, 249, 0.78);
  color: var(--ink);
  font-size: 11px;
  font-weight: 670;
}

.select-wrap select:focus {
  border-color: var(--coral);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.telegram-admin {
  max-width: var(--max-width);
  margin: 26px auto 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.telegram-admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 26px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 96% 0, rgba(243, 91, 53, 0.09), transparent 18rem),
    #faf6f1;
}

.telegram-admin-header h2 {
  margin: 5px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.telegram-admin-header > div > p:last-child {
  max-width: 680px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.telegram-page-size {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid #ddd1c8;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 740;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.telegram-access {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 20px 26px;
  padding: 14px 15px;
  border: 1px solid #e0d4cb;
  border-radius: 13px;
  background: #faf6f1;
}

.telegram-access > div {
  min-width: 0;
  margin-right: auto;
}

.telegram-access #telegramAuthFeedback {
  margin: 4px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.telegram-access.error {
  border-color: #e5b7b0;
  background: var(--red-soft);
}

.telegram-access.error #telegramAuthFeedback {
  color: #8e352d;
}

.telegram-access.unlocked {
  border-color: #bcd8cc;
  background: var(--green-soft);
}

.telegram-access.unlocked #telegramAuthFeedback {
  color: #235f4c;
}

.telegram-unlock-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(390px, 48%);
}

.telegram-unlock-form input {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: 0;
  background: #fffdf9;
  color: var(--ink);
  font-size: 11px;
}

.telegram-unlock-form input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.telegram-unlock-form input[aria-invalid="true"] {
  border-color: var(--red);
}

.telegram-unlock-form .primary-button {
  width: auto;
  min-width: 84px;
  min-height: 40px;
  padding: 0 14px;
  flex: 0 0 auto;
}

.telegram-lock-button {
  width: auto;
  min-width: 76px;
  min-height: 38px;
  margin: 0;
  padding: 0 13px;
}

.telegram-admin-tools {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 13px;
  margin: 0 26px 18px;
}

.telegram-tool-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #e0d4cb;
  border-radius: 14px;
  background: #faf6f1;
}

.telegram-tool-card h3 {
  margin: 3px 0 5px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.telegram-tool-card p:not(.card-kicker):not(.telegram-maintenance-status) {
  margin: 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
}

.telegram-quota-tool {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.telegram-quota-tool > div {
  min-width: 0;
}

.telegram-reset-all {
  width: auto;
  min-width: 188px;
  min-height: 39px;
  margin: 0;
  padding: 0 13px;
  flex: 0 0 auto;
  font-size: 9px;
}

.telegram-maintenance-tool {
  transition: border-color 160ms ease, background 160ms ease;
}

.telegram-maintenance-tool.active {
  border-color: #e1b089;
  background: #fff4e8;
}

.telegram-maintenance-heading,
.telegram-maintenance-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.telegram-maintenance-status {
  margin: 9px 0 12px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.45;
}

.telegram-maintenance-tool.active .telegram-maintenance-status {
  color: #8b4b1d;
  font-weight: 680;
}

.telegram-maintenance-actions {
  min-height: 34px;
  padding-top: 10px;
  border-top: 1px solid rgba(188, 170, 158, 0.45);
  color: var(--ink-soft);
  font-size: 9px;
}

.telegram-maintenance-actions span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-maintenance-actions .outline-button {
  width: auto;
  min-width: 72px;
  min-height: 32px;
  margin: 0;
  padding: 0 10px;
  flex: 0 0 auto;
  font-size: 9px;
}

.telegram-tool-feedback {
  margin: -5px 26px 16px;
  padding: 9px 11px;
  border-radius: 9px;
  background: #f2ece6;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.telegram-tool-feedback.success {
  background: var(--green-soft);
  color: #235f4c;
}

.telegram-tool-feedback.warning {
  background: var(--amber-soft);
  color: #805018;
}

.telegram-tool-feedback.error {
  background: var(--red-soft);
  color: #8e352d;
}

.telegram-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(620px, calc(100% - 52px));
  min-height: 48px;
  margin: 20px 26px 0;
  padding: 5px 10px 5px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fffdf9;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.telegram-search:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.telegram-search-icon {
  position: relative;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 1.7px solid #887b73;
  border-radius: 50%;
}

.telegram-search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.7px;
  border-radius: 2px;
  background: #887b73;
  content: "";
  transform: rotate(45deg);
}

.telegram-search input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 3px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.telegram-search input::placeholder {
  color: #988c84;
}

.telegram-clear {
  width: 28px;
  height: 28px;
}

.telegram-search-help {
  margin: 6px 26px 17px;
  color: var(--ink-faint);
  font-size: 10px;
}

.telegram-search-help.error {
  color: var(--red);
  font-weight: 650;
}

.telegram-feedback {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 98px;
  margin: 0 26px 24px;
  padding: 18px;
  border: 1px dashed #d8ccc3;
  border-radius: 13px;
  background: #faf6f1;
}

.telegram-feedback-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border: 2px solid #dfd3ca;
  border-radius: 50%;
  color: var(--coral-dark);
  font-size: 13px;
  font-weight: 800;
}

.telegram-feedback.loading .telegram-feedback-icon {
  border-color: #dfd3ca;
  border-top-color: var(--coral);
  animation: spin 850ms linear infinite;
}

.telegram-feedback.error {
  border-color: #e5b7b0;
  background: var(--red-soft);
}

.telegram-feedback.error .telegram-feedback-icon {
  border-color: #d8847b;
  color: var(--red);
}

.telegram-feedback.empty .telegram-feedback-icon {
  border-color: #d8ccc3;
  color: var(--ink-faint);
}

.telegram-feedback strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.telegram-feedback p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.telegram-feedback .secondary-button {
  margin-left: auto;
  flex: 0 0 auto;
}

.telegram-table-frame {
  width: 100%;
  overflow: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  overscroll-behavior-inline: contain;
  scrollbar-color: #cbbdb2 transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.telegram-table {
  width: 100%;
  min-width: 1320px;
}

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

.telegram-table th:last-child,
.telegram-table td:last-child {
  text-align: center;
}

.telegram-table td {
  height: 78px;
  vertical-align: middle;
}

.telegram-user-code {
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 760;
}

.telegram-name {
  display: block;
  max-width: 220px;
  overflow: hidden;
  color: var(--ink);
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-username {
  color: var(--coral-dark);
  font-weight: 690;
}

.telegram-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.telegram-status-pill::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.telegram-status-pill.banned {
  background: var(--red-soft);
  color: var(--red);
}

.telegram-quota-cell {
  width: 236px;
  min-width: 236px;
  text-align: left;
  white-space: normal;
}

.telegram-quota-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 8px;
  width: 210px;
}

.telegram-quota-available {
  min-width: 0;
  color: var(--ink-faint);
  font-size: 9px;
  white-space: nowrap;
}

.telegram-quota-available strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
}

.telegram-quota-form {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}

.telegram-quota-form input {
  width: 55px;
  height: 31px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: #fffdf9;
  color: var(--ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.telegram-quota-form input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.telegram-quota-form input[aria-invalid="true"] {
  border-color: var(--red);
}

.telegram-quota-add {
  min-width: 43px;
  height: 31px;
  padding: 0 7px;
  border: 1px solid #d3a58f;
  border-radius: 8px;
  background: #fff5ef;
  color: var(--coral-dark);
  font-size: 8px;
  font-weight: 800;
}

.telegram-quota-add:hover:not(:disabled) {
  border-color: var(--coral);
  background: var(--coral-soft);
}

.telegram-quota-reset {
  grid-column: 1 / -1;
  width: max-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--coral-dark);
  font-size: 8px;
  font-weight: 740;
  text-decoration: underline;
  text-decoration-color: rgba(217, 67, 34, 0.35);
  text-underline-offset: 3px;
}

.telegram-quota-reset:hover:not(:disabled) {
  color: var(--ink);
}

.telegram-account-cell {
  min-width: 110px;
}

.telegram-date {
  color: var(--ink-soft);
  font-size: 10px;
}

.telegram-action-button {
  min-width: 84px;
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #dfada7;
  border-radius: 9px;
  background: #fff8f6;
  color: var(--red);
  font-size: 9px;
  font-weight: 780;
}

.telegram-action-button:hover:not(:disabled) {
  border-color: var(--red);
  background: var(--red-soft);
}

.telegram-action-button.reinstate {
  border-color: #a8cdbf;
  background: #f5fbf8;
  color: var(--green);
}

.telegram-action-button.reinstate:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--green-soft);
}

.telegram-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 65px;
  padding: 11px 20px;
  color: var(--ink-faint);
  font-size: 11px;
}

.telegram-dialog-overlay {
  position: fixed;
  z-index: 125;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.telegram-dialog-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(35, 27, 23, 0.64);
  backdrop-filter: blur(9px);
}

.telegram-dialog {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 22px;
  outline: 0;
  background: #fffaf5;
  box-shadow: var(--shadow-md);
}

.telegram-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.telegram-dialog-heading h2 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.telegram-dialog > p {
  margin: 10px 0 21px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.telegram-datetime-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fffdf9;
}

.telegram-datetime-field:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.telegram-datetime-field:has(input[aria-invalid="true"]) {
  border-color: var(--red);
}

.telegram-datetime-field input {
  width: 100%;
  min-width: 0;
  height: 45px;
  padding: 0 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.telegram-datetime-field > span {
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 47px;
  border-left: 1px solid var(--line);
  background: #f3ece6;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 800;
}

.telegram-dialog-help {
  margin: 6px 0 18px;
  color: var(--ink-faint);
  font-size: 9px;
}

.telegram-message-sample {
  padding: 13px 14px;
  border: 1px solid #e1d4ca;
  border-radius: 11px;
  background: #f4ede7;
}

.telegram-message-sample strong {
  display: block;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.telegram-message-sample p {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.55;
}

.telegram-maintenance-confirm {
  text-align: center;
}

.telegram-confirm-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
}

.telegram-maintenance-confirm h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.telegram-maintenance-confirm > p {
  margin: 7px 0 16px;
  color: var(--ink-soft);
  font-size: 11px;
}

.telegram-maintenance-confirm dl {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fffdf9;
  text-align: left;
}

.telegram-maintenance-confirm dl > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 12px;
}

.telegram-maintenance-confirm dl > div + div {
  border-top: 1px solid var(--line);
}

.telegram-maintenance-confirm dt {
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.telegram-maintenance-confirm dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.45;
}

.telegram-dialog-feedback {
  margin: 14px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--red-soft);
  color: #8e352d;
  font-size: 10px;
  line-height: 1.45;
}

.telegram-dialog-feedback.pending {
  background: var(--coral-soft);
  color: #7f2b17;
}

.telegram-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.telegram-dialog-actions .outline-button,
.telegram-dialog-actions .primary-button {
  width: auto;
  min-height: 44px;
  margin: 0;
  flex: 1 1 0;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 22px 24px 30px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
}

.site-footer > :last-child {
  text-align: right;
}

.site-footer p {
  margin: 0;
}

tbody tr.clickable-row {
  cursor: pointer;
}

tbody tr.clickable-row:focus-visible {
  outline: 0;
}

tbody tr.clickable-row:focus-visible td {
  border-top: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  background: #fff7f0;
}

tbody tr.clickable-row:focus-visible td:first-child {
  border-left: 2px solid var(--coral);
}

tbody tr.clickable-row:focus-visible td:last-child {
  border-right: 2px solid var(--coral);
}

.stock-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  margin: -5px -7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--coral-dark);
  font-size: inherit;
  font-weight: 820;
  letter-spacing: 0.015em;
}

.stock-link span {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--coral-soft);
  font-size: 10px;
  transition: transform 140ms ease, background 140ms ease;
}

.stock-link:hover {
  background: #fff0e9;
}

.stock-link:hover span {
  background: var(--coral);
  color: #fff;
  transform: translateX(2px);
}

.insights-overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  justify-content: flex-end;
}

.insights-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(37, 29, 25, 0.53);
  cursor: default;
  backdrop-filter: blur(6px);
  animation: insights-fade-in 180ms ease both;
}

.insights-drawer {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(820px, calc(100vw - 48px));
  height: 100%;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.65);
  background: var(--paper);
  box-shadow: -32px 0 80px rgba(37, 29, 25, 0.22);
  flex-direction: column;
  animation: insights-slide-in 240ms cubic-bezier(0.22, 0.8, 0.24, 1) both;
}

.insights-header {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 92% 8%, rgba(243, 91, 53, 0.13), transparent 13rem),
    rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(18px);
}

.insights-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.insights-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 24px;
  margin-bottom: 7px;
}

.stock-code-badge,
.insights-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 820;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

.stock-code-badge {
  background: var(--coral);
  color: #fff;
}

.insights-status-badge {
  border: 1px solid #d8ccc3;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
}

.insights-status-badge.partial {
  border-color: #e6bd7d;
  background: var(--amber-soft);
  color: var(--amber);
}

.insights-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.insights-header #insightsDescription {
  max-width: 590px;
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.drawer-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0 0 2px;
  border: 1px solid #d8ccc3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 25px;
  font-weight: 350;
  line-height: 1;
}

.drawer-close:hover {
  border-color: #b7a89d;
  background: #fff;
  transform: rotate(3deg);
}

.insights-quote {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2px 18px;
  margin-top: 19px;
  padding-top: 15px;
  border-top: 1px solid #e7ded7;
}

.insights-quote > span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insights-quote strong {
  grid-row: span 2;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.insights-quote small {
  color: var(--ink-faint);
  font-size: 9px;
}

.insights-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c8b9af transparent;
  scrollbar-width: thin;
}

.insights-loading,
.insights-message {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 174px);
  padding: 50px 34px;
  text-align: center;
  flex-direction: column;
}

.insights-loading h3,
.insights-message h3 {
  margin: 9px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.insights-loading > p:not(.card-kicker),
.insights-message > p:not(.card-kicker) {
  max-width: 460px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.65;
}

.signal-loader {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 5px;
  width: 78px;
  height: 78px;
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid #dfd4cb;
  border-radius: 50%;
  background: #fffaf5;
}

.signal-loader::after {
  position: absolute;
  inset: -7px;
  border: 2px solid transparent;
  border-top-color: var(--coral);
  border-right-color: var(--coral-soft);
  border-radius: 50%;
  content: "";
  animation: spin 1s linear infinite;
}

.signal-loader i {
  display: block;
  width: 7px;
  border-radius: 5px 5px 1px 1px;
  background: var(--coral);
  animation: signal-bars 900ms ease-in-out infinite alternate;
}

.signal-loader i:nth-child(1) {
  height: 14px;
}

.signal-loader i:nth-child(2) {
  height: 29px;
  animation-delay: 180ms;
}

.signal-loader i:nth-child(3) {
  height: 21px;
  animation-delay: 360ms;
}

.loading-steps {
  display: flex;
  gap: 6px;
  margin-top: 24px;
}

.loading-steps span {
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: #ddd1c8;
  animation: loading-step 1.2s ease infinite;
}

.loading-steps span:nth-child(2) {
  animation-delay: 200ms;
}

.loading-steps span:nth-child(3) {
  animation-delay: 400ms;
}

.message-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  border: 1px solid #dfd2c8;
  border-radius: 20px;
  background: #fffaf5;
  color: var(--coral-dark);
  font-family: Georgia, serif;
  font-size: 28px;
  font-style: italic;
}

.message-retry {
  width: auto;
  min-width: 130px;
  margin-top: 20px;
  padding-inline: 18px;
}

.insights-content {
  padding: 20px 24px 40px;
}

.insights-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid #e6bd7d;
  border-radius: 11px;
  background: var(--amber-soft);
  color: #7c4b18;
}

.insights-notice > span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 12px;
  font-style: italic;
}

.insights-notice p {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.55;
}

.insights-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.insights-section + .insights-section {
  margin-top: 14px;
}

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

.section-heading h3 {
  margin: 5px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.section-note {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.score-card {
  --score: 0;
  --score-color: var(--coral);
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid #e4dad2;
  border-radius: 14px;
  background: #faf6f1;
}

.management-score-card {
  --score-color: #2f8a73;
}

.moat-score-card {
  --score-color: #c77b27;
}

.sentiment-score-card {
  --score-color: var(--coral);
}

.score-gauge {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: conic-gradient(var(--score-color) calc(var(--score) * 1%), #e8ded6 0);
}

.score-gauge::before {
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #faf6f1;
  content: "";
}

.score-gauge > span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
}

.score-gauge strong {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.score-gauge small {
  color: var(--ink-faint);
  font-size: 7px;
}

.score-copy {
  min-width: 0;
}

.score-copy p,
.sector-rank-card p {
  margin: 0 0 2px;
  color: var(--ink-faint);
  font-size: 8px;
  font-weight: 790;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.score-copy h4,
.sector-rank-card h4 {
  margin: 0 0 5px;
  font-size: 12px;
  line-height: 1.3;
}

.score-copy > span,
.sector-rank-card > div > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.score-evidence {
  grid-column: 1 / -1;
  min-width: 0;
  padding-top: 11px;
  border-top: 1px solid #e7ddd5;
}

.confidence-chip {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  margin-bottom: 8px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 740;
}

.component-bars {
  display: grid;
  gap: 6px;
}

.no-components {
  color: var(--ink-faint);
  font-size: 8px;
  font-style: italic;
}

.component-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 23px;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
  font-size: 8px;
}

.component-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.component-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4d9d1;
}

.component-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--score-color);
}

.component-row strong {
  color: var(--ink-soft);
  font-size: 8px;
  text-align: right;
}

.component-row.unavailable {
  opacity: 0.62;
}

.component-row.unavailable .component-track {
  background: repeating-linear-gradient(135deg, #e4d9d1 0 4px, #eee6df 4px 8px);
}

.position-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr 1fr;
  gap: 10px;
}

.sector-rank-card,
.performance-card {
  min-width: 0;
  min-height: 115px;
  padding: 15px;
  border: 1px solid #e4dad2;
  border-radius: 13px;
  background: #faf6f1;
}

.sector-rank-card {
  display: flex;
  align-items: center;
  gap: 13px;
}

.rank-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  border: 1px solid #dbcfc6;
  border-radius: 50%;
  background: #fffdf9;
  color: var(--coral-dark);
  font-family: Georgia, serif;
  font-size: 15px;
}

.rank-orbit::after {
  position: absolute;
  top: -4px;
  right: 8px;
  width: 9px;
  height: 9px;
  border: 3px solid #faf6f1;
  border-radius: 50%;
  background: var(--coral);
  content: "";
}

.rank-orbit strong {
  font-size: 24px;
  font-weight: 500;
}

.performance-card {
  display: flex;
  justify-content: center;
  flex-direction: column;
}

.performance-topline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 9px;
  font-weight: 730;
  text-transform: uppercase;
}

.performance-topline strong {
  color: var(--ink);
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.performance-topline strong.positive {
  color: var(--green);
}

.performance-topline strong.negative {
  color: var(--red);
}

.performance-track {
  position: relative;
  height: 7px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #eed2cf 0 49.5%, #e9e0d8 49.5% 50.5%, #dcebe4 50.5%);
}

.performance-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--ink-soft);
  opacity: 0.45;
}

.performance-track span {
  position: absolute;
  top: 1px;
  left: 50%;
  width: 0;
  height: 5px;
  border-radius: 999px;
  background: var(--green);
  transform-origin: left center;
}

.performance-card > p {
  margin: 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-chart {
  display: grid;
  gap: 10px;
}

.order-row {
  display: grid;
  grid-template-columns: 58px minmax(100px, 1fr) minmax(92px, auto);
  align-items: center;
  gap: 11px;
}

.order-year {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 760;
}

.order-year small {
  display: block;
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.order-track {
  height: 25px;
  overflow: hidden;
  border-radius: 7px;
  background: #eee5de;
}

.order-track span {
  display: block;
  min-width: 3px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brown-soft), var(--coral));
  opacity: 0.86;
}

.order-row.upcoming .order-track span {
  background: repeating-linear-gradient(135deg, #e19a73 0 7px, #f2b697 7px 14px);
}

.order-value {
  min-width: 0;
  text-align: right;
}

.order-value strong {
  display: block;
  color: var(--ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.order-value span,
.order-value a {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-value a {
  text-decoration-color: #cbbeb4;
  text-underline-offset: 2px;
}

.order-value a:hover {
  color: var(--coral-dark);
}

.no-evidence-inline {
  padding: 16px;
  border: 1px dashed #d8cbc1;
  border-radius: 11px;
  background: #faf6f1;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.tender-list {
  display: grid;
  gap: 8px;
}

.tender-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  padding: 13px;
  border: 1px solid #e5dbd3;
  border-radius: 11px;
  background: #faf6f1;
}

.tender-item.empty {
  border-style: dashed;
  background: #fcf9f5;
}

.tender-item h4 {
  margin: 0 0 3px;
  font-size: 11px;
  line-height: 1.4;
}

.tender-item h4 a {
  color: var(--ink);
  text-decoration-color: #cbbeb4;
  text-underline-offset: 3px;
}

.tender-item h4 a:hover {
  color: var(--coral-dark);
}

.tender-item p {
  margin: 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.45;
}

.tender-value {
  color: var(--ink);
  font-size: 11px;
  font-weight: 760;
  text-align: right;
}

.tender-value small {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 7px;
  font-weight: 650;
}

.tender-status {
  display: inline-flex;
  width: max-content;
  min-height: 19px;
  align-items: center;
  margin-top: 7px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 7px;
  font-weight: 780;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.news-disclaimer {
  margin: -7px 0 16px;
  padding: 9px 11px;
  border-left: 3px solid #d5a361;
  background: var(--amber-soft);
  color: #704719;
  font-size: 9px;
  line-height: 1.5;
}

.news-state {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  border: 1px dashed #d8cbc1;
  border-radius: 11px;
  background: #faf6f1;
}

.news-state.error {
  border-color: #e4b2aa;
  background: var(--red-soft);
}

.news-state-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 2px solid #ded2c9;
  border-radius: 50%;
  color: var(--coral-dark);
  font-size: 11px;
  font-weight: 800;
}

.news-state.loading .news-state-icon {
  border-top-color: var(--coral);
  animation: spin 850ms linear infinite;
}

.news-state.error .news-state-icon {
  border-color: #da887e;
  color: var(--red);
}

.news-state strong {
  display: block;
  font-size: 11px;
}

.news-state p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
}

.news-state .secondary-button {
  min-height: 34px;
  margin-left: auto;
  flex: 0 0 auto;
  padding-inline: 11px;
  font-size: 9px;
}

.news-state + .news-grid {
  margin-top: 10px;
}

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

.news-column {
  min-width: 0;
  padding: 13px;
  border: 1px solid #e4dad2;
  border-radius: 13px;
  background: #faf6f1;
}

.news-column-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.news-column-heading h4 {
  margin: 0;
  font-size: 10px;
  font-weight: 790;
  letter-spacing: 0.025em;
}

.news-column-heading > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eee4dc;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 800;
}

.news-list {
  display: grid;
  gap: 8px;
}

.news-item {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e7ddd5;
  border-radius: 10px;
  background: #fffdf9;
}

.news-item-topline,
.news-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.news-discovery-badge {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #87551d;
  font-size: 7px;
  font-weight: 820;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.news-item time {
  color: var(--ink-faint);
  font-size: 7px;
  white-space: nowrap;
}

.news-item h5 {
  margin: 8px 0 7px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.45;
}

.news-item-category,
.news-publisher {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-item-footer {
  padding-top: 7px;
  border-top: 1px solid #eee6df;
}

.news-source-link {
  flex: 0 0 auto;
  color: var(--coral-dark);
  font-size: 8px;
  font-weight: 760;
  text-decoration-color: #e7a18d;
  text-underline-offset: 2px;
}

.news-source-link:hover {
  color: #aa3018;
}

.news-source-missing {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-size: 7px;
}

.news-column-empty {
  padding: 16px 11px;
  border: 1px dashed #d8cbc1;
  border-radius: 9px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.news-column-empty.error {
  border-color: #e0aaa2;
  background: var(--red-soft);
  color: #8e352d;
}

.insights-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 5px 0;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.5;
}

.insights-footer p {
  max-width: 510px;
  margin: 0;
}

.insights-footer span {
  flex: 0 0 auto;
  text-align: right;
}

.refresh-password-overlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 27, 23, 0.64);
  backdrop-filter: blur(10px);
}

.refresh-password-modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  padding: 30px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
  outline: 0;
  background: #fffaf5;
  box-shadow: var(--shadow-md);
}

.refresh-password-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.refresh-password-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 45px;
  height: 45px;
  border-radius: 13px;
  background: var(--coral-soft);
  color: var(--coral-dark);
  font-size: 20px;
  font-weight: 800;
}

.refresh-password-heading h2 {
  margin: 4px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.03em;
}

.refresh-password-modal > p {
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.refresh-password-modal .field-label {
  display: block;
  margin: 22px 0 7px;
}

.refresh-password-modal input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  outline: 0;
  background: #fffdf9;
  color: var(--ink);
  font-size: 13px;
}

.refresh-password-modal input:focus {
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(243, 91, 53, 0.1);
}

.refresh-password-modal input[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(184, 61, 52, 0.09);
}

.refresh-password-help,
.refresh-password-feedback {
  margin: 7px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.refresh-password-help {
  color: var(--ink-soft);
}

.refresh-password-feedback {
  padding: 9px 10px;
  border-radius: 8px;
  font-weight: 650;
}

.refresh-password-feedback.error {
  background: var(--red-soft);
  color: #8f2e28;
}

.refresh-password-feedback.warning {
  background: var(--amber-soft);
  color: #70410d;
}

.refresh-password-feedback.pending {
  background: var(--coral-soft);
  color: #7f2b17;
}

.refresh-dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.refresh-dialog-actions .outline-button,
.refresh-dialog-actions .primary-button {
  flex: 1 1 0;
  width: auto;
  min-height: 45px;
  margin: 0;
}

.refresh-dialog-actions .primary-button {
  background: #cf3d1d;
}

.refresh-submit-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.run-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(35, 27, 23, 0.64);
  backdrop-filter: blur(10px);
}

.run-modal {
  width: min(480px, 100%);
  padding: 36px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  background: #fffaf5;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.orbital-loader {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 24px;
  border: 1px solid #e6d9cf;
  border-radius: 50%;
  animation: spin 2.3s linear infinite;
}

.orbital-loader::before,
.orbital-loader::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.orbital-loader::before {
  inset: 11px;
  border: 1px dashed #dfc7bd;
}

.orbital-loader::after {
  top: -5px;
  left: 31px;
  width: 11px;
  height: 11px;
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(243, 91, 53, 0.12);
}

.orbital-loader span {
  position: absolute;
  inset: 25px;
  border-radius: 10px;
  background: var(--brown);
}

.orbital-loader i {
  position: absolute;
  right: 2px;
  bottom: 10px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d59742;
}

.run-modal h2 {
  margin: 8px 0 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.run-modal > p:not(.card-kicker):not(.modal-note) {
  min-height: 22px;
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 13px;
}

.modal-progress {
  height: 8px;
  margin: 0;
  background: #e9dfd7;
}

.modal-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 11px;
}

.modal-stats strong {
  color: var(--coral-dark);
}

.modal-note {
  margin: 25px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 150;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 9px;
  width: min(370px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fffdf9;
  box-shadow: 0 12px 35px rgba(49, 34, 27, 0.16);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 570;
  animation: toast-in 220ms ease both;
}

.toast::before {
  display: block;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.toast.error::before {
  background: var(--red);
}

.toast.warning::before {
  background: var(--amber);
}

.toast.leaving {
  animation: toast-out 180ms ease both;
}

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

@keyframes status-pulse {
  50% { box-shadow: 0 0 0 6px rgba(243, 91, 53, 0.05); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

@keyframes insights-fade-in {
  from { opacity: 0; }
}

@keyframes insights-slide-in {
  from { opacity: 0.4; transform: translateX(35px); }
}

@keyframes signal-bars {
  to { height: 33px; opacity: 0.55; }
}

@keyframes loading-step {
  0%, 100% { background: #ddd1c8; }
  50% { background: var(--coral); }
}

@media (max-width: 1180px) {
  .dashboard {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .search-hero {
    padding-inline: 34px;
  }

  .prompt-row > span {
    width: 100%;
  }
}

@media (max-width: 940px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .topnav {
    display: none;
  }

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

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

  .sync-card {
    grid-row: span 2;
  }

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

  .score-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .telegram-access {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .telegram-access > div {
    flex: 1 1 360px;
  }

  .telegram-unlock-form {
    width: min(430px, 100%);
  }

  .telegram-admin-tools {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 660px) {
  .topbar {
    min-height: 66px;
    padding-inline: 15px;
  }

  .brand-logo {
    height: 28px;
  }

  .topbar-status {
    padding: 7px 9px;
  }

  main {
    padding: 18px 12px 40px;
  }

  .search-hero {
    padding: 32px 18px 23px;
    border-radius: 18px 18px 0 0;
  }

  .search-hero::after {
    width: 260px;
    height: 220px;
  }

  .search-hero h1 {
    font-size: clamp(39px, 13vw, 58px);
  }

  .hero-copy {
    margin-block: 17px 22px;
  }

  .search-form {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 8px 8px 8px 15px;
  }

  .tell-me-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-support {
    display: block;
  }

  .search-instructions {
    align-items: flex-start;
    flex-direction: column;
  }

  .model-chip {
    display: inline-flex;
    margin-top: 7px;
  }

  .prompt-row {
    align-items: stretch;
  }

  .prompt-chip {
    flex: 1 1 46%;
  }

  .results-card {
    border-radius: 0 0 18px 18px;
  }

  .results-empty {
    min-height: 300px;
    padding: 33px 22px;
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .results-empty.compact {
    min-height: 250px;
  }

  .results-toolbar {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 15px;
  }

  .results-toolbar > div:first-child {
    width: 100%;
  }

  .results-actions {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results-actions .secondary-button {
    flex: 0 0 auto;
    width: 100%;
    min-height: 44px;
    padding-inline: 10px;
  }

  .results-toolbar p {
    max-width: none;
  }

  .results-toolbar .table-scroll-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    max-width: none;
    color: var(--ink-soft);
    font-size: 9px;
    font-weight: 680;
  }

  .table-scroll-hint span {
    color: var(--coral-dark);
    font-size: 13px;
  }

  #resultsTable tbody td.sticky-one,
  #resultsTable tbody td.sticky-two {
    position: static;
    left: auto;
    box-shadow: none;
  }

  #resultsTable thead th.sticky-one,
  #resultsTable thead th.sticky-two {
    left: auto;
    box-shadow: none;
  }

  .table-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination {
    align-self: stretch;
    justify-content: space-between;
  }

  .control-room {
    grid-template-columns: 1fr;
  }

  .sync-card {
    grid-row: auto;
  }

  .telegram-admin {
    margin-top: 18px;
    border-radius: 18px;
  }

  .telegram-admin-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 21px 18px 17px;
  }

  .telegram-access {
    margin: 15px 16px;
  }

  .telegram-admin-tools {
    margin: 0 16px 15px;
  }

  .telegram-quota-tool {
    align-items: flex-start;
    flex-direction: column;
  }

  .telegram-reset-all {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .telegram-tool-feedback {
    margin: 0 16px 15px;
  }

  .telegram-search {
    width: calc(100% - 32px);
    margin: 16px 16px 0;
  }

  .telegram-search-help {
    margin-inline: 16px;
  }

  .telegram-feedback {
    align-items: flex-start;
    margin: 0 16px 18px;
    flex-wrap: wrap;
  }

  .telegram-feedback .secondary-button {
    width: 100%;
    margin-left: 0;
  }

  .telegram-table-frame {
    width: auto;
    margin: 0 12px 15px;
    overflow: visible;
    border: 0;
  }

  .telegram-table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .telegram-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .telegram-table tbody {
    display: grid;
    gap: 11px;
  }

  .telegram-table tbody tr {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--card);
    box-shadow: 0 5px 18px rgba(52, 37, 28, 0.04);
  }

  .telegram-table tbody td,
  .telegram-table tbody td:first-child,
  .telegram-table tbody td:nth-child(2),
  .telegram-table tbody td:nth-child(3),
  .telegram-table tbody td:last-child {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 43px;
    padding: 9px 12px;
    border-right: 0;
    text-align: left;
    white-space: normal;
  }

  .telegram-table tbody td::before {
    align-self: start;
    padding-top: 2px;
    color: var(--ink-faint);
    content: attr(data-label);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.045em;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .telegram-table tbody td.telegram-quota-cell {
    display: block;
    padding-block: 11px;
  }

  .telegram-table tbody td.telegram-quota-cell::before {
    display: block;
    margin-bottom: 7px;
  }

  .telegram-quota-control {
    width: 100%;
  }

  .telegram-quota-form input,
  .telegram-quota-add {
    height: 44px;
    min-height: 44px;
  }

  .telegram-quota-add {
    min-width: 48px;
  }

  .telegram-quota-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    min-height: 44px;
    padding: 0 10px;
    border-radius: 8px;
  }

  .telegram-name {
    max-width: 100%;
  }

  .telegram-account-cell .telegram-action-button {
    justify-self: start;
    min-width: 88px;
    min-height: 44px;
  }

  .telegram-maintenance-actions .outline-button {
    min-height: 44px;
  }

  .telegram-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .telegram-footer .pagination {
    align-self: stretch;
    justify-content: space-between;
  }

  .site-footer {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .site-footer > :last-child {
    text-align: center;
  }

  .run-modal {
    padding: 30px 22px;
  }

  .refresh-password-modal {
    padding: 26px 22px;
  }

  .column-order-overlay {
    align-items: end;
    padding: 12px;
  }

  .column-order-dialog {
    width: 100%;
    max-height: calc(100vh - 24px);
    padding: 23px 18px;
    border-radius: 20px;
  }

  .column-order-heading .drawer-close {
    width: 44px;
    height: 44px;
  }

  .column-order-controls button {
    width: 44px;
    height: 44px;
  }

  .insights-drawer {
    width: 100%;
    height: min(94vh, 920px);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.72);
    border-left: 0;
    border-radius: 22px 22px 0 0;
    animation-name: insights-sheet-in;
  }

  .insights-header {
    padding: 20px 18px 17px;
  }

  .insights-header h2 {
    font-size: 30px;
  }

  .insights-content {
    padding: 14px 12px 30px;
  }

  .insights-section {
    padding: 17px 14px;
  }

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

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

  .sector-rank-card {
    grid-column: 1 / -1;
  }

  .insights-footer {
    flex-direction: column;
    gap: 6px;
  }

  .insights-footer span {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .topbar-status #topbarStatusText {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .prompt-chip {
    flex-basis: 100%;
  }

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

  .column-order-dialog {
    padding-inline: 14px;
  }

  .column-order-heading h2 {
    font-size: 24px;
  }

  .column-order-item {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 7px;
    padding-left: 7px;
  }

  .column-order-position {
    display: none;
  }

  .column-order-copy small {
    max-width: 120px;
  }

  .column-order-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .column-order-actions > div {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .column-order-actions .column-order-reset {
    width: 100%;
  }

  .telegram-unlock-form {
    align-items: stretch;
    flex-direction: column;
  }

  .telegram-unlock-form .primary-button {
    width: 100%;
  }

  .telegram-maintenance-heading {
    align-items: flex-start;
  }

  .telegram-maintenance-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .telegram-maintenance-actions span {
    white-space: normal;
  }

  .telegram-maintenance-actions .outline-button {
    width: 100%;
  }

  .telegram-table tbody td,
  .telegram-table tbody td:first-child,
  .telegram-table tbody td:nth-child(2),
  .telegram-table tbody td:nth-child(3),
  .telegram-table tbody td:last-child {
    grid-template-columns: 96px minmax(0, 1fr);
    padding-inline: 10px;
  }

  .telegram-quota-control {
    grid-template-columns: 1fr;
  }

  .telegram-quota-form {
    width: 100%;
    justify-self: stretch;
  }

  .telegram-quota-form input {
    width: 100%;
    min-width: 0;
  }

  .telegram-dialog-overlay {
    padding: 12px;
  }

  .telegram-dialog {
    max-height: calc(100vh - 24px);
    padding: 23px 18px;
    border-radius: 18px;
  }

  .telegram-dialog-heading h2 {
    font-size: 24px;
  }

  .telegram-dialog-actions {
    flex-direction: column;
  }

  .telegram-maintenance-confirm dl > div {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .refresh-password-overlay {
    padding: 12px;
  }

  .refresh-password-modal {
    max-height: calc(100vh - 24px);
    padding: 23px 18px;
    border-radius: 18px;
  }

  .refresh-password-heading {
    align-items: flex-start;
  }

  .refresh-password-heading h2 {
    font-size: 24px;
  }

  .refresh-dialog-actions {
    flex-direction: column;
  }

  .sync-details {
    grid-template-columns: 1fr;
  }

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

  .sector-rank-card {
    grid-column: auto;
  }

  .score-card {
    grid-template-columns: 66px minmax(0, 1fr);
    padding: 12px;
  }

  .score-gauge {
    width: 66px;
    height: 66px;
  }

  .order-row {
    grid-template-columns: 49px minmax(72px, 1fr) minmax(72px, auto);
    gap: 7px;
  }

  .tender-item {
    grid-template-columns: 1fr;
  }

  .tender-value {
    text-align: left;
  }
}

@keyframes insights-sheet-in {
  from { opacity: 0.5; transform: translateY(35px); }
}

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