/* =========================
   Base
========================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --bg: #0f0f0f;
  --panel: #212121;
  --panel2: #1e1e1e;
  --border: #272727;
  --border2: #363636;
  --text: #ffffff;
  --muted: #b0b0b0;
  --muted2: #999999;
  --accent: #e74c3c;
  --accent2: #c0392b;

  --matrix-bg: #0b0b10;
  --matrix-bg-2: #101019;
  --matrix-bg-3: #141420;
  --matrix-line: rgba(255,255,255,0.05);
  --matrix-line-soft: rgba(255,255,255,0.03);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =========================
   Header
========================= */

header {
  background: var(--panel);
  padding: 20px 0;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo i {
  color: var(--accent);
}

.logo a {
  color: var(--text);
  text-decoration: none;
  transition: color .2s;
}

.logo a:hover {
  color: var(--accent);
}

.home-page {
  background:
    radial-gradient(circle at 10% -10%, rgba(96,76,176,0.2), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(29,82,147,0.18), transparent 28%),
    #05070d;
}

.home-page header {
  background: rgba(5,7,13,0.86);
  border-bottom: 1px solid rgba(135,151,186,0.16);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.app-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(119,89,210,0.2);
  color: #c8b8ff;
  font-size: 12px;
  font-weight: 800;
}

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

.icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(135,151,186,0.22);
  border-radius: 10px;
  background: rgba(21,25,38,0.72);
  color: var(--text);
  cursor: pointer;
}

.notification-btn {
  position: relative;
}

.notification-btn span {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  pointer-events: none;
}

.account-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(135,151,186,0.32);
  border-radius: 999px;
  background: rgba(21,25,38,0.78);
  color: #f5f7ff;
  font-weight: 800;
  cursor: pointer;
}

.account-menu-wrap {
  position: relative;
  display: inline-flex;
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(320px, calc(100vw - 24px));
  display: none;
  overflow: hidden;
  border: 1px solid rgba(135,151,186,0.24);
  border-radius: 12px;
  background: rgba(10,14,24,0.98);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(0,0,0,0.4);
  backdrop-filter: blur(16px);
  z-index: 250;
}

.account-menu.show {
  display: block;
}

.account-menu-head {
  display: grid;
  gap: 3px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid rgba(135,151,186,0.16);
}

.account-menu-head b {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-head span,
.account-billing span {
  color: var(--muted);
  font-size: 12px;
}

.account-billing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 14px;
}

.account-billing > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(135,151,186,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
}

.account-billing b {
  font-size: 14px;
}

.is-expired {
  color: #ff8f8f !important;
}

.account-menu a,
.account-menu button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 0;
  border-top: 1px solid rgba(135,151,186,0.12);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}

.account-menu a:hover,
.account-menu button:hover {
  background: rgba(255,255,255,0.05);
}

/* =========================
   Prime header
========================= */

.home-page,
.project-page {
  min-height: 100vh;
}

.home-page header,
.project-page header {
  position: relative;
  top: auto;
  margin: 8px 8px 28px;
  padding: 0;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 4% 25%, rgba(231,76,60,0.07), transparent 24%),
    linear-gradient(120deg, rgba(9,14,25,0.96), rgba(7,11,20,0.94));
  box-shadow: 0 18px 60px rgba(0,0,0,0.26);
  backdrop-filter: blur(18px);
}

.home-page header .container,
.project-page header .container {
  width: 100%;
  max-width: none;
  padding: 0 22px;
}

.home-page .header-content,
.project-page .header-content {
  min-height: 164px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(520px, 690px);
  gap: 24px;
  align-items: center;
}

.home-page .logo,
.project-page .logo {
  font-size: 28px;
  gap: 14px;
}

.home-page .logo i,
.project-page .logo i {
  font-size: 34px;
}

.home-page .app-badge,
.project-page .app-badge {
  height: 31px;
  padding: 0 11px;
  border-radius: 8px;
  background: rgba(119,89,210,0.34);
  color: #d2c5ff;
  font-size: 16px;
}

.header-tools {
  justify-content: flex-end;
}

.account-console {
  width: min(100%, 690px);
  display: grid;
  gap: 14px;
}

.account-console-top {
  min-height: 74px;
  display: grid;
  grid-template-columns: 98px minmax(112px, 1fr) minmax(230px, 1.3fr) 64px;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 12px;
  background: rgba(8,12,22,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.account-console-pill {
  width: 86px;
  min-height: 52px;
  justify-content: space-between;
  padding: 0 14px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 28% 22%, rgba(255,255,255,0.08), transparent 36%),
    rgba(19,25,39,0.92);
}

.account-console-pill span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  font-size: 17px;
}

.account-identity {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding-right: 18px;
  border-right: 1px solid rgba(135,151,186,0.16);
}

.account-identity b {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  text-decoration: underline;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-identity span {
  color: rgba(225,230,242,0.68);
  font-size: 14px;
}

.account-console-billing {
  min-width: 0;
  display: grid;
  gap: 8px;
  padding-right: 18px;
  border-right: 1px solid rgba(135,151,186,0.16);
}

.account-console-billing > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(225,230,242,0.72);
  font-size: 14px;
}

.account-console-billing i {
  color: #8b5cf6;
  font-size: 10px;
}

.account-console-billing > div:nth-child(2) i {
  color: #00d98b;
}

.account-console-billing b {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-console-settings {
  display: flex;
  justify-content: flex-end;
}

.account-settings-btn {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 12px;
  background: rgba(19,25,39,0.86);
}

.account-console-actions {
  display: grid;
  grid-template-columns: minmax(136px, 1fr) minmax(150px, 1.15fr) minmax(210px, 1.55fr) minmax(112px, 0.85fr);
  gap: 12px;
}

.account-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid rgba(135,151,186,0.22);
  border-radius: 8px;
  background: rgba(17,22,34,0.72);
  color: rgba(245,247,255,0.9);
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

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

.account-action-telegram {
  border-color: rgba(139,92,246,0.75);
  background: linear-gradient(180deg, rgba(92,45,154,0.5), rgba(41,24,72,0.64));
  color: #d6c7ff;
  box-shadow: 0 0 22px rgba(139,92,246,0.12);
}

.account-action-phone {
  border-color: rgba(46,104,255,0.58);
  background: linear-gradient(180deg, rgba(21,57,143,0.42), rgba(12,28,70,0.62));
  color: #8fb2ff;
}

.account-action-theme {
  color: rgba(225,230,242,0.86);
}

.account-action-theme i:first-child {
  color: #f7d774;
}

.account-action-theme i:nth-child(2) {
  color: #c5c8d4;
}

.account-action-logout {
  border-color: rgba(255,75,62,0.68);
  color: #ff6e63;
}

/* =========================
   Buttons
========================= */

.btn {
  padding: 10px 16px;
  border: 1px solid #404040;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  border-color: #606060;
  background: #272727;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent2);
  border-color: var(--accent2);
}

.btn-danger {
  background: #b03a2e;
  color: #fff;
  border-color: #b03a2e;
}

.btn-danger:hover {
  background: #922b21;
  border-color: #922b21;
}

.btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* =========================
   Titles
========================= */

.section-title {
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 900px;
  margin: 34px auto 18px auto;
}

.section-title i {
  color: var(--accent);
}

/* =========================
   Alerts
========================= */

.alert {
  padding: 12px 16px;
  margin: 0 auto 20px auto;
  border-radius: 8px;
  display: none;
  font-size: 13px;
  border-left: 3px solid;
  max-width: 900px;
}

.alert.show {
  display: block;
}

.alert-success {
  background: #1a3a1a;
  color: #4cff4c;
  border-left-color: #4cff4c;
}

.alert-error {
  background: #3a1a1a;
  color: #ff4c4c;
  border-left-color: #ff4c4c;
}

/* =========================
   Cards / Forms
========================= */

.card,
.form-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 26px;
  max-width: 900px;
  margin: 0 auto 30px auto;
  width: 100%;
}

.manual-tools {
  max-width: 1200px;
  margin: 0 auto 30px auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.manual-tools .card {
  max-width: none;
  margin: 0;
}

.manual-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.manual-card-head h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
}

.manual-card-head i {
  color: var(--accent);
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
  color: #ddd;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: var(--panel2);
  color: var(--text);
}

input:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.12);
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.form-actions .btn {
  min-width: 180px;
}

/* =========================
   Results / Index blocks
========================= */

.result-box {
  margin-top: 16px;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  color: #ddd;
  font-size: 13px;
  display: none;
}

.manual-result {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.manual-result:last-child {
  border-bottom: 0;
}

.manual-summary,
.analytics-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}

.manual-summary span,
.summary-item {
  min-height: 122px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(128,98,222,0.08), transparent 52%),
    rgba(16,19,31,0.88);
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 12px;
  padding: 20px 22px;
  color: var(--muted);
  font-size: 12px;
  box-shadow: 0 18px 38px rgba(0,0,0,0.22);
}

.manual-summary b,
.summary-item b {
  display: block;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  margin: 10px 0 8px;
  letter-spacing: 0;
}

.summary-item span {
  color: rgba(225,230,242,0.7);
  font-size: 13px;
  font-weight: 700;
}

.summary-item em {
  font-style: normal;
  color: rgba(225,230,242,0.58);
  font-size: 12px;
  font-weight: 800;
}

.summary-item .metric-up {
  color: #6be68c;
}

.summary-item .metric-down {
  color: #ff6666;
}

.summary-item > i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(103,116,224,0.2);
  color: #9fb0ff;
}

.summary-item svg {
  width: 92px;
  height: 46px;
  overflow: visible;
}

.summary-item path {
  fill: none;
  stroke: #8c76ff;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(140,118,255,0.35));
}

.manual-results-list {
  display: flex;
  flex-direction: column;
}

.frequency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.frequency-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}

.frequency-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.frequency-table th,
.frequency-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: middle;
}

.frequency-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: rgba(255,255,255,0.03);
}

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

.frequency-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.manual-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.manual-keyword {
  font-weight: 800;
  font-size: 14px;
}

.manual-url {
  font-size: 12px;
  color: #9aa0a6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-url a {
  color: #9aa0a6;
  text-decoration: none;
  border-bottom: 1px dashed rgba(154,160,166,0.35);
}

.manual-url a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.35);
}

/* =========================
   Home dashboard
========================= */

.home-page .container {
  max-width: 1440px;
}

.home-panel {
  padding: 28px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(231,76,60,0.11), transparent 32%),
    linear-gradient(135deg, rgba(124,87,195,0.08), transparent 46%),
    rgba(12,16,27,0.86);
  box-shadow: 0 24px 80px rgba(0,0,0,0.32);
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.home-section-head .section-title,
.home-projects-head .section-title {
  margin: 0 0 6px;
}

.home-section-head p {
  color: rgba(225,230,242,0.62);
}

.home-page .manual-tools {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.home-page .manual-tools .card {
  max-width: none;
  min-width: 0;
  min-height: 420px;
  border-color: rgba(135,151,186,0.22);
  background:
    linear-gradient(135deg, rgba(231,76,60,0.08), transparent 40%),
    rgba(10,14,24,0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.home-page .manual-tools .card:nth-child(2) {
  background:
    linear-gradient(135deg, rgba(124,87,195,0.14), transparent 42%),
    rgba(10,14,24,0.74);
}

.home-page .manual-card-head {
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.home-page .manual-card-head span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(231,76,60,0.16);
  color: var(--accent);
}

.home-page .manual-card:nth-child(2) .manual-card-head span {
  background: rgba(124,87,195,0.22);
  color: #a78bff;
}

.home-page .manual-card-head h3 {
  margin: 0 0 4px;
}

.home-page .manual-card-head p {
  color: rgba(225,230,242,0.62);
  font-size: 13px;
}

.home-page .manual-card .btn {
  max-width: 100%;
  white-space: normal;
}

.home-page .result-box {
  overflow: hidden;
}

.home-page .manual-summary {
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}

.home-page .manual-summary span,
.home-page .summary-item {
  min-width: 0;
  padding: 16px;
}

.home-page .manual-summary b,
.home-page .summary-item b {
  font-size: clamp(22px, 3vw, 30px);
  overflow-wrap: anywhere;
}

.home-page .manual-result {
  grid-template-columns: minmax(0, 1fr) auto;
}

.home-page .badge {
  min-width: 92px;
  max-width: 132px;
  flex-wrap: wrap;
  padding: 8px 10px;
}

.home-page .frequency-actions {
  align-items: stretch;
}

.home-page .frequency-actions .btn {
  flex: 1 1 180px;
}

.input-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--panel2);
}

.input-icon input {
  border: 0;
  background: transparent;
  padding: 0;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.home-projects-head {
  align-items: center;
  margin-bottom: 14px;
  max-width: none;
}

.home-project-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.home-project-toolbar .matrix-search-wrap {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 9px;
  background: rgba(8,11,20,0.58);
  color: rgba(225,230,242,0.58);
  flex: 1;
}

.home-project-toolbar .matrix-search-wrap input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
}

.home-project-toolbar select {
  height: 42px;
  min-width: 170px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 9px;
  background: rgba(12,15,26,0.72);
  color: rgba(245,247,255,0.88);
  padding: 0 12px;
}

.home-page .projects-grid {
  display: block;
  margin-bottom: 28px;
}

.home-page .project-folder {
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 14px;
  padding: 18px;
  background: rgba(12,16,27,0.72);
}

.home-page .projects-grid-inner {
  gap: 12px;
}

.home-page .project-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(135,151,186,0.18);
  background:
    linear-gradient(135deg, rgba(34,77,119,0.12), transparent 42%),
    rgba(10,14,24,0.86);
}

.home-page .project-card h3,
.home-page .project-card p {
  max-width: min(100%, 28ch);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-page .project-card:hover {
  border-color: rgba(231,76,60,0.42);
}

.project-spark {
  position: absolute;
  right: 22px;
  top: 58px;
  width: 100px;
  height: 38px;
  pointer-events: none;
}

.project-spark path {
  fill: none;
  stroke: #8c76ff;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(140,118,255,0.35));
}

.home-footer {
  margin-top: 26px;
  padding: 26px 0;
  color: rgba(225,230,242,0.66);
}

.home-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================
   Prime dashboard
========================= */

.home-page {
  background:
    radial-gradient(circle at 9% 26%, rgba(231,76,60,0.12), transparent 22%),
    radial-gradient(circle at 82% 14%, rgba(43,91,173,0.1), transparent 28%),
    #050914;
}

.home-page .container {
  padding: 0 12px;
}

.home-page .manual-section {
  margin: 0 0 20px;
}

.home-panel {
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 8%, rgba(231,76,60,0.13), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(52,88,164,0.08), transparent 32%),
    linear-gradient(135deg, rgba(12,18,32,0.96), rgba(7,12,23,0.94));
}

.home-section-head {
  padding: 16px 18px 0;
}

.home-section-head .section-title {
  font-size: 28px;
}

.home-section-head .section-title i {
  font-size: 34px;
}

.home-section-head p {
  color: rgba(225,230,242,0.66);
  font-size: 16px;
}

.home-page .manual-tools {
  width: min(1220px, calc(100% - 120px));
  margin: 22px auto 4px;
  gap: 28px;
}

.home-page .manual-tools .card {
  min-height: 470px;
  padding: 24px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 0% 8%, rgba(231,76,60,0.07), transparent 30%),
    rgba(5,10,21,0.66);
  border-color: rgba(135,151,186,0.22);
}

.home-page .manual-tools .card:nth-child(2) {
  background:
    radial-gradient(circle at 0% 8%, rgba(139,92,246,0.1), transparent 30%),
    rgba(5,10,21,0.66);
}

.home-page .manual-card-head span {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.home-page .manual-card-head i {
  font-size: 20px;
}

.home-page .manual-card-head h3 {
  font-size: 20px;
}

.home-page .manual-card-head p {
  font-size: 14px;
}

.home-page label {
  color: rgba(245,247,255,0.88);
  font-size: 14px;
  font-weight: 650;
}

.home-page input[type="text"],
.home-page textarea,
.home-page select,
.home-page .input-icon {
  border-color: rgba(135,151,186,0.24);
  border-radius: 9px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025)),
    rgba(22,25,31,0.78);
  color: rgba(245,247,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.home-page .input-icon,
.home-page select {
  height: 48px;
}

.home-page textarea {
  min-height: 124px;
}

.home-page input::placeholder,
.home-page textarea::placeholder {
  color: rgba(225,230,242,0.56);
}

.home-page .form-actions {
  margin-top: 18px;
}

.home-page .btn-primary {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, #ff563f, #ff3d31);
  box-shadow: 0 10px 24px rgba(255,72,55,0.2);
}

.home-page .summary-item {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 10px;
  background:
    radial-gradient(circle at 88% 24%, rgba(117,104,255,0.12), transparent 26%),
    rgba(9,15,28,0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.home-page .summary-item div {
  display: grid;
  gap: 10px;
}

.home-page .summary-item span,
.home-page .summary-item em {
  color: rgba(225,230,242,0.66);
  font-size: 15px;
  font-style: normal;
}

.home-page .summary-item b {
  color: #fff;
  font-size: 36px;
  line-height: 1;
}

.home-page .summary-item > i {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(119,104,255,0.2);
  color: #8d8cff;
  font-size: 18px;
}

.home-page .summary-item svg {
  width: 118px;
  height: 46px;
}

.footer-status {
  display: inline-flex;
  gap: 9px;
  align-items: center;
}

.footer-status span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #58d66d;
  box-shadow: 0 0 12px rgba(88,214,109,0.55);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 0%, rgba(96,76,176,0.22), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(231,76,60,0.16), transparent 30%),
    #05070d;
}

.login-shell {
  width: min(440px, calc(100vw - 32px));
}

.login-card {
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid rgba(135,151,186,0.2);
  border-radius: 16px;
  background: rgba(12,16,27,0.9);
  box-shadow: 0 24px 80px rgba(0,0,0,0.36);
}

.login-card h1 {
  margin-top: 12px;
  font-size: 28px;
}

.login-card p {
  color: rgba(225,230,242,0.66);
}

.login-card input {
  height: 44px;
}

.login-error {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(231,76,60,0.14);
  color: #ff9b91;
  border: 1px solid rgba(231,76,60,0.24);
}

.admin-modal-content {
  width: min(1180px, calc(100vw - 40px));
  max-width: 1180px;
  max-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding: 22px;
}

.admin-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(520px, 1.35fr);
  gap: 18px;
}

.admin-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 12px;
  padding: 16px;
  background: rgba(10,14,24,0.58);
}

.admin-panel:nth-child(2) {
  grid-template-rows: auto auto minmax(0, 1fr);
}

.admin-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.admin-list,
.admin-access-projects {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.admin-user-row {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.admin-access-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}

.admin-user-row .admin-user-main,
.admin-access-row span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-user-row b,
.admin-access-row b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row span,
.admin-access-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-access-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.admin-access-main {
  min-width: 0;
}

.admin-access-main input,
.admin-edit-label input {
  flex: 0 0 auto;
}

.admin-access-main span {
  min-width: 0;
}

.admin-edit-label {
  justify-content: flex-start;
  white-space: nowrap;
  color: var(--muted);
}

.admin-edit-label span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-create-user {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(135,151,186,0.12);
}

.admin-create-user #admin-new-username,
.admin-create-user #admin-new-password,
.admin-create-user #admin-new-role,
.admin-create-user .btn {
  grid-column: 1 / -1;
}

.admin-create-user input,
.admin-create-user select {
  min-width: 0;
  height: 38px;
}

.admin-user-main {
  min-width: 0;
}

.admin-user-billing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.admin-user-billing > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(135,151,186,0.12);
  border-radius: 9px;
  background: rgba(255,255,255,0.025);
}

.admin-user-billing b,
.admin-user-billing em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-billing em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.admin-user-credentials {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(132px, auto);
  gap: 8px;
}

.admin-user-credentials input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
}

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

.admin-billing-input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
}

.admin-billing-input {
  grid-column: span 1;
}

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

.admin-panel-head h3 {
  margin: 0;
}

.admin-xml-panel {
  grid-column: 1 / -1;
}

.admin-xml-status {
  min-height: 108px;
}

.admin-xml-card {
  padding: 14px;
  border: 1px solid rgba(135,151,186,0.16);
  border-radius: 10px;
  background: rgba(8,12,22,0.46);
}

.admin-xml-card.ok {
  border-color: rgba(0,217,139,0.22);
}

.admin-xml-card.warn {
  border-color: rgba(255,193,7,0.30);
}

.admin-xml-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.admin-xml-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #ffc107;
  box-shadow: 0 0 0 4px rgba(255,193,7,0.10);
}

.admin-xml-card.ok .admin-xml-dot {
  background: #00d98b;
  box-shadow: 0 0 0 4px rgba(0,217,139,0.10);
}

.admin-xml-top b,
.admin-xml-top em {
  display: block;
}

.admin-xml-top em {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

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

.admin-xml-grid > div {
  padding: 10px;
  border: 1px solid rgba(135,151,186,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.025);
}

.admin-xml-grid span,
.admin-xml-grid b {
  display: block;
}

.admin-xml-grid span {
  color: var(--muted);
  font-size: 11px;
}

.admin-xml-grid b {
  margin-top: 4px;
  font-size: 14px;
}

/* =========================
   Projects grid
========================= */

.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto 20px auto;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
}

.project-folder {
  min-width: 0;
}

.folder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.folder-header h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
}

.folder-header i {
  color: var(--accent);
}

.folder-header span,
.folder-pill {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.projects-grid-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.project-card-top > div {
  min-width: 0;
  padding-right: 110px;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.project-stats span {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--muted);
  font-size: 12px;
}

.project-stats b {
  color: var(--text);
  font-size: 16px;
}

.move-btn span {
  font-size: 12px;
}

.project-card:hover {
  border-color: var(--accent);
  background: #252525;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.10);
}

.project-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text);
}

.project-card p {
  color: var(--muted2);
  font-size: 13px;
  margin-bottom: 12px;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #666;
}

.project-meta > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.project-meta .btn {
  min-height: 34px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 16px;
  color: #404040;
}

/* =========================
   Modal
========================= */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: var(--panel);
  padding: 30px;
  border-radius: 12px;
  max-width: 520px;
  width: 92%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.55);
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.close {
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  background: none;
  border: none;
  color: #999;
  padding: 0;
  line-height: 1;
}

.close:hover {
  color: #fff;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 22px;
}

/* =========================
   Results block
========================= */

.results {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  max-width: 900px;
  margin: 20px auto 40px auto;
  display: none;
}

.results.show {
  display: block;
}

.results-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 18px;
}

.result-item {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.result-keyword {
  font-weight: 700;
}

.result-position {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.position-top3 { background: rgba(76, 255, 76, 0.1); color: #4cff4c; }
.position-top10 { background: rgba(100, 200, 255, 0.1); color: #64c8ff; }
.position-top30 { background: rgba(255, 200, 0, 0.1); color: #ffc800; }
.position-top100 { background: rgba(255, 150, 0, 0.1); color: #ff9600; }
.position-not-found { background: rgba(255, 76, 76, 0.1); color: #ff4c4c; }

/* =========================
   Keywords table
========================= */

.keywords-table-wrapper {
  overflow-x: auto;
  border-radius: 10px;
}

.keywords-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  min-width: 600px;
}

.keywords-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  text-align: left;
}

.keywords-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.keywords-table tbody tr:hover {
  background: #1d1d1d;
}

/* =========================
   Project page only
========================= */

.project-page {
  background:
    radial-gradient(circle at 10% -10%, rgba(96,76,176,0.22), transparent 32%),
    radial-gradient(circle at 88% 0%, rgba(29,82,147,0.16), transparent 28%),
    #05070d;
}

.project-page .container {
  width: calc(100vw - 40px);
  max-width: none;
  margin-left: calc(50% - 50vw + 20px);
  margin-right: calc(50% - 50vw + 20px);
  padding: 0;
}

.project-page header {
  background: rgba(5,7,13,0.86);
  border-bottom: 1px solid rgba(135,151,186,0.16);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.25);
}

.project-page .header-content {
  min-height: 68px;
}

.project-page .logo {
  display: flex;
  gap: 10px;
  align-items: center;
}

.project-page .app-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(119,89,210,0.2);
  color: #c8b8ff;
  font-size: 12px;
  font-weight: 800;
}

.project-page .header-tools {
  display: flex;
  gap: 10px;
  align-items: center;
}

.project-page .account-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(135,151,186,0.32);
  border-radius: 999px;
  background: rgba(21,25,38,0.78);
  color: #f5f7ff;
  font-weight: 800;
  cursor: pointer;
}

.project-page .project-info {
  position: relative;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 260px;
  gap: 28px;
  align-items: start;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(124,87,195,0.12), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.014)),
    rgba(14,17,28,0.92);
  border: 1px solid rgba(130,104,205,0.45);
  border-radius: 16px;
  padding: 26px;
  width: 100%;
  max-width: none;
  margin: 0 auto 14px auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.36);
}

.project-page .project-info h2{
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
}

.project-page .project-info p{
  color: var(--muted);
  font-size: 14px;
  margin: 8px 0;
}

.project-page .project-info strong{
  color: var(--text);
  font-weight: 700;
}

.project-page .project-avatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(150,119,230,0.75);
  border-radius: 14px;
  background:
    radial-gradient(circle at 30% 20%, rgba(158,134,255,0.2), transparent 40%),
    rgba(35,31,54,0.74);
  color: rgba(255,255,255,0.72);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0;
}

.project-page .project-main {
  min-width: 0;
}

.project-page .project-title-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 6px;
}

.project-page .project-title-row h2 {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-page .icon-btn,
.project-page .inline-edit {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
}

.project-page .inline-edit {
  width: 26px;
  height: 26px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.58);
}

.project-page .icon-btn:hover,
.project-page .inline-edit:hover,
.project-page .schedule-days button.active {
  border-color: rgba(231,76,60,0.55);
  background: rgba(231,76,60,0.14);
}

.project-page .project-domain-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: rgba(220,226,240,0.78);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 18px;
}

.project-page .project-domain-link:hover {
  color: #fff;
}

.project-page .project-meta-row,
.project-page .project-access-row,
.project-page .project-update-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  color: rgba(221,226,239,0.78);
  font-size: 13px;
  margin-top: 10px;
}

.project-page .project-meta-row b {
  color: #f7f8ff;
}

.project-page .project-meta-row i,
.project-page .project-update-row i {
  color: rgba(150,127,235,0.95);
}

.project-page .project-access-row {
  gap: 8px;
}

.project-page .access-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.035);
  color: rgba(231,236,248,0.78);
  font-size: 12px;
  font-weight: 700;
}

.project-page .access-off i {
  color: #ff7373;
}

.project-page .access-on {
  border-color: rgba(76,211,117,0.24);
  background: rgba(76,211,117,0.09);
}

.project-page .access-on i {
  color: #6be68c;
}

.project-page .access-muted i {
  color: #c1a0ff;
}

.project-page .project-update-row {
  color: rgba(221,226,239,0.62);
  margin-top: 16px;
}

.project-page .project-status-side {
  position: relative;
  min-height: 150px;
}

.project-page .tracking-status {
  position: relative;
  z-index: 2;
  float: right;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(61,139,82,0.22);
  color: #74e292;
  font-size: 13px;
  font-weight: 800;
}

.project-page .tracking-status.tracking-muted {
  background: rgba(255,255,255,0.06);
  color: rgba(231,236,248,0.64);
}

.project-page .hero-wave {
  position: absolute;
  right: -28px;
  bottom: 8px;
  width: 260px;
  height: 86px;
  opacity: 0.8;
  background:
    linear-gradient(180deg, rgba(145,85,223,0.2), transparent),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 260 86' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 51 C18 19 39 18 58 50 S98 82 124 45 166 15 190 45 222 75 260 20' fill='none' stroke='%23815ad8' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.project-page .btn-compact {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
}

.project-page .project-info-actions,
.project-page .schedule-save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.project-page .project-info .project-info-actions {
  margin-top: 24px;
}

.project-page .schedule-panel {
  grid-column: 2 / 4;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.project-page .schedule-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.project-page .access-settings {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  background: rgba(255,255,255,0.025);
}

.project-page .access-settings .form-group {
  margin: 0;
}

.project-page .access-settings input[type="text"] {
  width: min(360px, 100%);
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
}

.project-page .switch-row {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}

.project-page .schedule-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-page .schedule-days button {
  min-width: 38px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
  cursor: pointer;
}

.project-page .schedule-save-row input[type="time"] {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
}

.project-page .schedule-status {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.project-page .schedule-panel.hidden,
.project-page .range-panel.hidden {
  display: none;
}

.project-page .project-actions {
  width: 100%;
  max-width: 50vw;
  margin: 0 auto 30px auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.project-page .project-actions .btn {
  min-height: 44px;
  padding: 10px 16px;
}

.project-page .semantics-panel {
  width: 100%;
  max-width: 50vw;
  margin: 0 auto 30px auto;
}

.project-page .hidden {
  display: none;
}

.project-page .loading {
  display: none;
  text-align: center;
  padding: 18px;
  width: 100%;
  max-width: 50vw;
  margin: 0 auto 20px auto;
}

.project-page .loading.show {
  display: block;
}

.project-page .spinner {
  border: 3px solid rgba(255,255,255,0.08);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  animation: spin 0.9s linear infinite;
  margin: 0 auto 16px;
}

.project-page .progress-wrap {
  width: min(420px, 100%);
  height: 10px;
  margin: 14px auto 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
}

.project-page .progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ff8a65);
  border-radius: inherit;
  transition: width 0.25s ease;
}

.project-page .progress-meta {
  color: var(--muted);
  font-size: 13px;
}

/* =========================
   Matrix section
========================= */

.project-page .matrix-section {
  width: 100%;
  margin-top: 40px;
  padding: 0 20px 40px;
}

.project-page .matrix-section .section-title {
  max-width: none;
  margin: 0 0 18px 0;
}

.project-page .matrix-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(circle at top left, rgba(231,76,60,0.05), transparent 22%),
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0.01)),
    var(--matrix-bg);
  box-shadow:
    0 18px 50px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.project-page .matrix-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
}

.project-page .matrix-search-wrap {
  flex: 1 1 260px;
  min-width: 220px;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 9px;
  background: rgba(8,11,20,0.58);
  color: rgba(225,230,242,0.58);
}

.project-page .matrix-search-wrap i {
  font-size: 13px;
}

.project-page .matrix-search-wrap .matrix-search {
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.project-page .matrix-toolbar .form-group {
  margin: 0;
}

.project-page .matrix-toolbar label {
  display: none;
}

.project-page .matrix-toolbar select,
.project-page .matrix-toolbar input[type="number"],
.project-page .matrix-toolbar .btn,
.project-page .matrix-filter-count {
  height: 42px;
  min-height: 42px;
  border-radius: 9px;
  border: 1px solid rgba(135,151,186,0.18);
  background: rgba(12,15,26,0.72);
  color: rgba(245,247,255,0.88);
  font-size: 13px;
}

.project-page .matrix-toolbar select,
.project-page .matrix-toolbar input[type="number"] {
  max-width: 150px;
  padding: 0 12px;
}

.project-page .matrix-toolbar .btn {
  padding: 0 14px;
}

.project-page .compare-panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.project-page .compare-panel .form-group {
  margin-bottom: 0;
}

.project-page .range-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  background: rgba(22,32,50,0.82);
}

.project-page .range-panel .form-group {
  margin-bottom: 0;
  min-width: 160px;
}

.project-page .range-panel input[type="date"] {
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel2);
  color: var(--text);
  padding: 0 10px;
}

.project-page .range-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-page .range-presets button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 8px;
  background: rgba(9,15,25,0.7);
  color: rgba(245,247,255,0.86);
  cursor: pointer;
}

.project-page .range-presets button:hover,
.project-page .range-presets button.active {
  border-color: rgba(231,76,60,0.45);
  background: rgba(231,76,60,0.12);
}

.project-page .range-calendar-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
}

.project-page .range-calendar {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
}

.project-page .calendar-month-title {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
}

.project-page .calendar-month-title span {
  color: rgba(225,230,242,0.62);
  margin-left: 8px;
}

.project-page .calendar-weekdays,
.project-page .calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.project-page .calendar-weekdays {
  color: rgba(225,230,242,0.62);
  font-size: 12px;
  margin-bottom: 6px;
}

.project-page .calendar-day {
  position: relative;
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.project-page .calendar-day.muted {
  cursor: default;
}

.project-page .calendar-day.has-check i,
.project-page .dot-check {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #3c9cff;
}

.project-page .calendar-day.has-check i {
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
}

.project-page .calendar-day.selected {
  background: rgba(60,156,255,0.22);
  color: #fff;
}

.project-page .range-side {
  display: grid;
  gap: 14px;
  align-content: start;
  border-left: 1px solid rgba(255,255,255,0.08);
  padding-left: 16px;
}

.project-page .range-legend {
  display: flex;
  gap: 16px;
  color: rgba(255,255,255,0.82);
  font-size: 13px;
}

.project-page .range-legend span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.project-page .compare-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-height: 40px;
}

.project-page .compare-summary span {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.project-page .matrix-search {
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #fff;
  margin-bottom: 10px;
  font-size: 14px;
}

.project-page .matrix-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}

.project-page .matrix-filters .form-group {
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.project-page .matrix-filters label {
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  margin: 0;
  white-space: nowrap;
}

.project-page .matrix-filters select,
.project-page .matrix-filters input {
  height: 34px;
  max-width: 150px;
  border-radius: 8px;
  font-size: 12px;
  padding: 0 9px;
}

.project-page .matrix-filters .btn {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.project-page .matrix-filter-count {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.035);
  border-radius: 8px;
  padding: 0 12px;
  white-space: nowrap;
}

.project-page .matrix-search::placeholder {
  color: rgba(255,255,255,0.45);
}

.project-page .matrix-search:focus {
  outline: none;
  border-color: rgba(231,76,60,0.45);
  box-shadow: 0 0 0 3px rgba(231,76,60,0.08);
}

.project-page .matrix-shell {
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--matrix-line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0)),
    var(--matrix-bg-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.project-page .matrix-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 13px;
}

.project-page .matrix-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}

.project-page .matrix-table thead th.sortable::after {
  content: '⇅';
  font-size: 11px;
  margin-left: 8px;
  opacity: 0.35;
}

.project-page .matrix-table thead th.sort-asc::after {
  content: '↑';
  opacity: 0.95;
  color: #72ffb2;
}

.project-page .matrix-table thead th.sort-desc::after {
  content: '↓';
  opacity: 0.95;
  color: #ff8c8c;
}

.project-page .matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 9;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
    #0f1018;
  padding: 14px 12px;
  border-right: 1px solid var(--matrix-line);
  border-bottom: 1px solid var(--matrix-line);
  text-align: center;
  font-weight: 700;
  color: rgba(226,232,246,0.72);
  white-space: nowrap;
}

.project-page .matrix-table thead th span {
  display: inline-flex;
  align-items: center;
  min-height: 19px;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: rgba(226,232,246,0.58);
  font-size: 11px;
}

.project-page .matrix-table thead th.keyword-col {
  left: 0;
  z-index: 11;
  text-align: left;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    #11131d;
}

.project-page .matrix-table tbody td {
  padding: 13px 12px;
  border-right: 1px solid var(--matrix-line-soft);
  border-bottom: 1px solid var(--matrix-line-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.008), rgba(255,255,255,0)),
    #0c0d15;
  transition: background .18s ease, box-shadow .18s ease;
}

.project-page .matrix-table tbody tr:nth-child(odd) td {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0)),
    #0d0f18;
}

.project-page .matrix-table tbody tr:hover td {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.005)),
    #121522;
}

.project-page .keyword-col {
  position: sticky;
  left: 48px;
  z-index: 8;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    #10121b !important;
  box-shadow:
    14px 0 24px rgba(0,0,0,0.24),
    1px 0 0 rgba(255,255,255,0.03);
}

.project-page .select-col {
  width: 48px;
  min-width: 48px;
  text-align: center;
  position: sticky;
  left: 0;
  z-index: 10;
  background: #10121b !important;
}

.project-page .matrix-keyword {
  display: inline;
  line-height: 1.3;
  font-weight: 750;
  color: #f3f3f3;
}

.project-page .matrix-pos {
  position: relative;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  min-width: 132px;
  letter-spacing: -0.02em;
  color: #d7d7d7;
  text-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.project-page .matrix-pos.pos-good {
  color: #72ffb2;
  text-shadow:
    0 0 6px rgba(114,255,178,0.95),
    0 0 18px rgba(114,255,178,0.25);
}

.project-page .matrix-pos.pos-mid {
  color: #ffd86a;
  text-shadow:
    0 0 6px rgba(255,216,106,0.95),
    0 0 18px rgba(255,216,106,0.22);
}

.project-page .matrix-pos.pos-bad {
  color: #ff7878;
  text-shadow:
    0 0 6px rgba(255,120,120,0.95),
    0 0 18px rgba(255,120,120,0.24);
}

.project-page .matrix-pos.pos-neutral {
  color: #d0d0d0;
  text-shadow: none;
}

.project-page .delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  vertical-align: middle;
}

.project-page .delta-up {
  color: #79ffb7;
  background: rgba(40,255,140,0.09);
  border: 1px solid rgba(40,255,140,0.12);
}

.project-page .delta-down {
  color: #ff9a9a;
  background: rgba(255,70,70,0.09);
  border: 1px solid rgba(255,70,70,0.12);
}

.project-page .delta-same {
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

.project-page .matrix-empty {
  padding: 18px 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.64);
}

.project-page .matrix-shell::-webkit-scrollbar,
.project-page .keywords-table-wrapper::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.project-page .matrix-shell::-webkit-scrollbar-track,
.project-page .keywords-table-wrapper::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 20px;
}

.project-page .matrix-shell::-webkit-scrollbar-thumb,
.project-page .keywords-table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(231,76,60,0.45), rgba(192,57,43,0.28));
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.project-page .matrix-shell::-webkit-scrollbar-thumb:hover,
.project-page .keywords-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(231,76,60,0.56), rgba(192,57,43,0.36));
  background-clip: padding-box;
}

@media (max-width: 768px) {
  .project-page .matrix-section {
    padding: 0 10px 30px;
  }

  .project-page .matrix-table thead th.sticky-col,
  .project-page .matrix-table tbody td.sticky-col,
  .project-page .matrix-keyword {
    width: 20ch;
    min-width: 20ch;
    max-width: 20ch;
  }

  .project-page .matrix-pos {
    font-size: 22px;
    min-width: 102px;
  }
}

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

.project-page .sticky-col {
  position: sticky;
  left: 0;
  z-index: 8;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01)),
    #10121b !important;
  box-shadow:
    14px 0 24px rgba(0,0,0,0.24),
    1px 0 0 rgba(255,255,255,0.03);
}

.project-page .matrix-table tbody td.sticky-col {
  z-index: 7;
}

.project-page .matrix-keyword {
  width: 25ch;
  max-width: 25ch;
  min-width: 25ch;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.38;
  font-weight: 650;
  color: #f3f3f3;
}

.project-page .matrix-frequency-head,
.project-page .matrix-frequency {
  min-width: 128px;
  width: 128px;
  text-align: center;
}

.project-page .matrix-frequency-head {
  line-height: 1.25;
}

.project-page .matrix-frequency-head span {
  display: block;
}

.project-page .mini-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  margin-top: 5px;
  padding: 3px 8px;
  border: 1px solid rgba(231,76,60,0.45);
  border-radius: 7px;
  background: rgba(231,76,60,0.12);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.project-page .mini-action:hover {
  background: rgba(231,76,60,0.22);
}

.project-page .matrix-frequency {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 750;
  color: #f2f2f2;
}

.project-page .star-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  border: 0;
  background: transparent;
  color: rgba(225,230,242,0.48);
  cursor: pointer;
}

.project-page .star-btn:hover {
  color: #ffd86a;
}

.project-page .group-label {
  color: rgba(225,230,242,0.82);
  font-weight: 650;
}

.project-page .intent-badge,
.project-page .rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
}

.project-page .intent-nav {
  background: rgba(127,93,207,0.48);
}

.project-page .intent-info {
  background: rgba(38,151,170,0.48);
}

.project-page .intent-commercial {
  background: rgba(199,125,38,0.52);
}

.project-page .rank-badge.pos-good {
  background: rgba(56,145,50,0.46);
  color: #9af58b;
}

.project-page .rank-badge.pos-top10 {
  background: rgba(122,164,45,0.48);
  color: #d9ff91;
}

.project-page .rank-badge.pos-mid {
  background: rgba(165,117,24,0.5);
  color: #ffd86a;
}

.project-page .rank-badge.pos-bad {
  background: rgba(154,48,54,0.52);
  color: #ff8f8f;
}

.project-page .rank-badge.pos-neutral {
  background: rgba(255,255,255,0.06);
  color: rgba(225,230,242,0.64);
}

.project-page .rank-change {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  font-weight: 850;
  font-size: 12px;
}

.project-page .change-up {
  color: #68de81;
}

.project-page .change-down {
  color: #ff6868;
}

.project-page .change-muted {
  color: rgba(225,230,242,0.48);
}

.project-page .url-action {
  color: rgba(225,230,242,0.82);
}

.project-page .url-action:hover {
  color: #fff;
}

.project-page .matrix-pos-cell {
  min-width: 112px;
  text-align: center;
  white-space: nowrap;
}

.project-page .matrix-pos {
  position: relative;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  min-width: 132px;
  letter-spacing: -0.02em;
  color: #d7d7d7;
  text-shadow: 0 0 10px rgba(255,255,255,0.05);
}

.project-page .matrix-pos.pos-good {
  color: #72ffb2;
  text-shadow:
    0 0 6px rgba(114,255,178,0.95),
    0 0 18px rgba(114,255,178,0.25);
}

.project-page .matrix-pos.pos-mid {
  color: #ffd86a;
  text-shadow:
    0 0 6px rgba(255,216,106,0.95),
    0 0 18px rgba(255,216,106,0.22);
}

.project-page .matrix-pos.pos-bad {
  color: #ff7878;
  text-shadow:
    0 0 6px rgba(255,120,120,0.95),
    0 0 18px rgba(255,120,120,0.24);
}

.project-page .matrix-pos.pos-neutral {
  color: #d0d0d0;
  text-shadow: none;
}

.project-page .delta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  vertical-align: middle;
}

.project-page .delta-up {
  color: #79ffb7;
  background: rgba(40,255,140,0.09);
  border: 1px solid rgba(40,255,140,0.12);
}

.project-page .delta-down {
  color: #ff9a9a;
  background: rgba(255,70,70,0.09);
  border: 1px solid rgba(255,70,70,0.12);
}

.project-page .delta-same {
  color: rgba(255,255,255,0.72);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
}

.project-page .matrix-empty {
  padding: 18px 6px;
  font-size: 14px;
  color: rgba(255,255,255,0.64);
}

.project-page .matrix-shell::-webkit-scrollbar,
.project-page .keywords-table-wrapper::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.project-page .matrix-shell::-webkit-scrollbar-track,
.project-page .keywords-table-wrapper::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.02);
  border-radius: 20px;
}

.project-page .matrix-shell::-webkit-scrollbar-thumb,
.project-page .keywords-table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(231,76,60,0.45), rgba(192,57,43,0.28));
  border-radius: 20px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.project-page .matrix-shell::-webkit-scrollbar-thumb:hover,
.project-page .keywords-table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(231,76,60,0.56), rgba(192,57,43,0.36));
  background-clip: padding-box;
}

/* =========================
   Prime final overrides
========================= */

.home-page header,
.project-page header {
  position: relative;
  top: auto;
  margin: 8px 8px 28px;
  padding: 0;
  border: 1px solid rgba(135,151,186,0.18);
  border-radius: 12px;
  background:
    radial-gradient(circle at 4% 25%, rgba(231,76,60,0.07), transparent 24%),
    linear-gradient(120deg, rgba(9,14,25,0.96), rgba(7,11,20,0.94));
  box-shadow: 0 18px 60px rgba(0,0,0,0.26);
  backdrop-filter: blur(18px);
}

.home-page header .container,
.project-page header .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 22px;
}

.home-page .header-content,
.project-page .header-content {
  min-height: 164px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(520px, 690px);
  gap: 24px;
  align-items: center;
}

.home-page .logo,
.project-page .logo {
  font-size: 28px;
  gap: 14px;
}

.home-page .logo i,
.project-page .logo i {
  font-size: 34px;
}

.home-page .app-badge,
.project-page .app-badge {
  height: 31px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 16px;
}

.home-page .header-tools,
.project-page .header-tools {
  width: 100%;
  justify-content: flex-end;
}

.home-page .account-console,
.project-page .account-console {
  width: min(100%, 690px);
}

.home-page .account-console-pill,
.project-page .account-console-pill {
  width: 86px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 12px;
}

.account-console.no-settings .account-console-top {
  grid-template-columns: 98px minmax(112px, 1fr) minmax(230px, 1.3fr);
}

.account-console.no-settings .account-console-billing {
  border-right: 0;
  padding-right: 0;
}

.home-page .account-settings-btn,
.project-page .account-settings-btn {
  width: 50px;
  height: 50px;
  min-width: 50px;
}

.project-page .container {
  width: calc(100vw - 40px);
}

/* =========================
   Light theme
========================= */

body.theme-light {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel2: #f6f8fb;
  --border: #d9e2ec;
  --border2: #c6d3df;
  --text: #152033;
  --muted: #617086;
  --muted2: #76849a;
  --accent: #d94b3b;
  --accent2: #b93c2f;
  --matrix-bg: #f8fbff;
  --matrix-bg-2: #eef5fb;
  --matrix-bg-3: #e7f0f8;
  --matrix-line: rgba(31,49,72,0.09);
  --matrix-line-soft: rgba(31,49,72,0.055);
  background: var(--bg);
}

body.theme-light.home-page,
body.theme-light.project-page {
  background:
    radial-gradient(circle at 12% -8%, rgba(74,116,168,0.11), transparent 30%),
    radial-gradient(circle at 92% 4%, rgba(217,75,59,0.08), transparent 28%),
    #f8fafc;
}

body.theme-light header,
body.theme-light.home-page header,
body.theme-light.project-page header {
  background:
    radial-gradient(circle at 4% 25%, rgba(217,75,59,0.035), transparent 24%),
    rgba(255,255,255,0.96);
  border-color: rgba(86,112,143,0.16);
  box-shadow: 0 12px 34px rgba(35,55,82,0.1);
}

body.theme-light .app-badge {
  background: rgba(43,107,163,0.12);
  color: #2d638f;
}

body.theme-light .icon-btn,
body.theme-light .account-pill,
body.theme-light.project-page .icon-btn,
body.theme-light.project-page .account-pill,
body.theme-light.project-page .inline-edit {
  background: rgba(255,255,255,0.82);
  border-color: rgba(85,111,142,0.24);
  color: var(--text);
}

body.theme-light .account-console-top {
  background: rgba(255,255,255,0.78);
  border-color: rgba(86,112,143,0.15);
  box-shadow: 0 10px 28px rgba(35,55,82,0.06);
}

body.theme-light .account-console-pill {
  background: rgba(255,255,255,0.92);
  border-color: rgba(86,112,143,0.15);
}

body.theme-light .account-console-pill span {
  background: #f1f5f9;
}

body.theme-light .account-identity,
body.theme-light .account-console-billing {
  border-right-color: rgba(86,112,143,0.14);
}

body.theme-light .account-identity b,
body.theme-light .account-console-billing b {
  color: #101828;
}

body.theme-light .account-identity span,
body.theme-light .account-console-billing > div {
  color: #667085;
}

body.theme-light .account-action {
  background: rgba(255,255,255,0.84);
  border-color: rgba(86,112,143,0.18);
  color: #344054;
  box-shadow: 0 8px 22px rgba(35,55,82,0.05);
}

body.theme-light .account-action-telegram {
  border-color: rgba(124,87,195,0.48);
  background: rgba(255,255,255,0.9);
  color: #7142c7;
}

body.theme-light .account-action-phone {
  border-color: rgba(37,99,235,0.42);
  background: rgba(255,255,255,0.9);
  color: #2563eb;
}

body.theme-light .account-action-logout {
  border-color: rgba(255,75,62,0.48);
  color: #ef3f31;
}

body.theme-light .account-action-theme i:first-child {
  color: #344054;
}

body.theme-light .account-action-theme i:nth-child(2) {
  color: #667085;
}

body.theme-light .account-menu {
  background: rgba(255,255,255,0.98);
  border-color: rgba(85,111,142,0.22);
  box-shadow: 0 24px 70px rgba(35,55,82,0.16);
}

body.theme-light .account-billing > div,
body.theme-light .admin-panel,
body.theme-light .admin-user-row,
body.theme-light .admin-access-row,
body.theme-light .admin-user-billing > div,
body.theme-light .home-panel,
body.theme-light .home-page .project-folder,
body.theme-light .home-page .project-card,
body.theme-light .card {
  background: rgba(255,255,255,0.86);
  border-color: rgba(85,111,142,0.18);
  box-shadow: 0 18px 44px rgba(35,55,82,0.08);
}

body.theme-light .home-panel {
  background: rgba(255,255,255,0.92);
  border-color: rgba(86,112,143,0.16);
  box-shadow: 0 18px 48px rgba(35,55,82,0.08);
}

body.theme-light .home-page .manual-tools .card,
body.theme-light .home-page .manual-tools .card:nth-child(2) {
  background: rgba(255,255,255,0.72);
  border-color: rgba(86,112,143,0.16);
  box-shadow: 0 12px 32px rgba(35,55,82,0.06);
}

body.theme-light .home-page .manual-card-head span {
  background: rgba(255,75,62,0.08);
}

body.theme-light .home-page .manual-card:nth-child(2) .manual-card-head span {
  background: rgba(139,92,246,0.1);
}

body.theme-light .home-section-head p,
body.theme-light .home-page .manual-card-head p,
body.theme-light .home-page .summary-item span,
body.theme-light .home-page .summary-item em {
  color: #667085;
}

body.theme-light .home-page label {
  color: #101828;
}

body.theme-light .btn {
  background: #ffffff;
  border-color: rgba(85,111,142,0.24);
  color: var(--text);
}

body.theme-light .btn:hover,
body.theme-light .account-menu a:hover,
body.theme-light .account-menu button:hover {
  background: #eef5fb;
}

body.theme-light .btn-primary,
body.theme-light .btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

body.theme-light input[type="text"],
body.theme-light input[type="number"],
body.theme-light input[type="date"],
body.theme-light select,
body.theme-light textarea,
body.theme-light .admin-billing-input,
body.theme-light .input-icon,
body.theme-light .home-project-toolbar .matrix-search-wrap,
body.theme-light.project-page .matrix-search-wrap,
body.theme-light.project-page .matrix-toolbar select,
body.theme-light.project-page .matrix-toolbar input[type="number"],
body.theme-light.project-page .matrix-filter-count {
  background: rgba(255,255,255,0.96);
  border-color: rgba(85,111,142,0.16);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(16,24,40,0.03);
}

body.theme-light .home-page input::placeholder,
body.theme-light .home-page textarea::placeholder {
  color: #7d8899;
}

body.theme-light .home-page .summary-item {
  background: rgba(255,255,255,0.88);
  border-color: rgba(86,112,143,0.16);
}

body.theme-light .home-page .summary-item b {
  color: #0f172a;
}

body.theme-light .home-page .summary-item > i {
  background: rgba(139,92,246,0.1);
  color: #6d5dfc;
}

body.theme-light.home-page .home-panel {
  background: rgba(255,255,255,0.92);
  border-color: rgba(86,112,143,0.16);
  box-shadow: 0 18px 48px rgba(35,55,82,0.08);
}

body.theme-light.home-page .manual-tools .card,
body.theme-light.home-page .manual-tools .card:nth-child(2),
body.theme-light.home-page .project-folder,
body.theme-light.home-page .project-card {
  background: rgba(255,255,255,0.82);
  border-color: rgba(86,112,143,0.16);
  box-shadow: 0 12px 32px rgba(35,55,82,0.06);
}

body.theme-light.home-page .manual-card-head span {
  background: rgba(255,75,62,0.08);
}

body.theme-light.home-page .manual-card:nth-child(2) .manual-card-head span {
  background: rgba(139,92,246,0.1);
}

body.theme-light.home-page .home-section-head p,
body.theme-light.home-page .manual-card-head p,
body.theme-light.home-page .summary-item span,
body.theme-light.home-page .summary-item em,
body.theme-light.home-page .project-card p,
body.theme-light.home-page .folder-header span {
  color: #667085;
}

body.theme-light.home-page label,
body.theme-light.home-page .manual-card-head h3,
body.theme-light.home-page .project-card h3,
body.theme-light.home-page .folder-header h3 {
  color: #101828;
}

body.theme-light.home-page input[type="text"],
body.theme-light.home-page textarea,
body.theme-light.home-page select,
body.theme-light.home-page .input-icon,
body.theme-light.home-page .home-project-toolbar .matrix-search-wrap {
  background: rgba(255,255,255,0.96);
  border-color: rgba(86,112,143,0.16);
  color: #101828;
}

body.theme-light.home-page input::placeholder,
body.theme-light.home-page textarea::placeholder {
  color: #7d8899;
}

body.theme-light.home-page .summary-item {
  background: rgba(255,255,255,0.88);
  border-color: rgba(86,112,143,0.16);
}

body.theme-light.home-page .summary-item b,
body.theme-light.home-page .project-stats b {
  color: #0f172a;
}

body.theme-light.home-page .summary-item > i {
  background: rgba(139,92,246,0.1);
  color: #6d5dfc;
}

body.theme-light.home-page .project-stats span,
body.theme-light.home-page .folder-pill {
  background: rgba(241,245,249,0.84);
  border-color: rgba(86,112,143,0.12);
  color: #667085;
}

.modal .admin-modal-content {
  width: min(1180px, calc(100vw - 40px));
  max-width: 1180px;
  max-height: calc(100vh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

body.theme-light .admin-modal-content {
  background: rgba(255,255,255,0.96);
  border-color: rgba(86,112,143,0.16);
}

body.theme-light .admin-access-row,
body.theme-light .admin-user-row {
  background: rgba(248,250,252,0.82);
  border-color: rgba(86,112,143,0.14);
}

body.theme-light .admin-user-billing > div {
  background: rgba(255,255,255,0.86);
  border-color: rgba(86,112,143,0.14);
}

body.theme-light .admin-user-credentials input {
  background: rgba(255,255,255,0.96);
  border-color: rgba(86,112,143,0.16);
  color: #101828;
}

body.theme-light .admin-create-user {
  border-top-color: rgba(86,112,143,0.14);
}

body.theme-light .home-footer,
body.theme-light .login-card p {
  color: rgba(49,67,92,0.72);
}

body.theme-light.project-page .project-info {
  background:
    linear-gradient(135deg, rgba(56,117,170,0.12), transparent 36%),
    rgba(255,255,255,0.76);
  border-color: rgba(74,116,168,0.24);
  box-shadow: 0 24px 70px rgba(35,55,82,0.12);
}

body.theme-light.project-page .project-avatar {
  background:
    radial-gradient(circle at 30% 20%, rgba(56,117,170,0.18), transparent 42%),
    rgba(255,255,255,0.7);
  border-color: rgba(56,117,170,0.34);
  color: rgba(21,32,51,0.72);
}

body.theme-light.project-page .matrix-card {
  background:
    radial-gradient(circle at top left, rgba(217,75,59,0.05), transparent 24%),
    var(--matrix-bg);
  border-color: rgba(85,111,142,0.16);
  box-shadow: 0 20px 54px rgba(35,55,82,0.1);
}

body.theme-light.project-page .matrix-table th,
body.theme-light.project-page .matrix-table td,
body.theme-light .keywords-table thead th,
body.theme-light .keywords-table tbody td {
  border-color: rgba(85,111,142,0.13);
}

body.theme-light.project-page .sticky-col {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(247,251,255,0.92)),
    #f7fbff !important;
  box-shadow:
    14px 0 24px rgba(35,55,82,0.1),
    1px 0 0 rgba(85,111,142,0.14);
}

body.theme-light.project-page .matrix-keyword,
body.theme-light.project-page .matrix-frequency,
body.theme-light.project-page .matrix-pos.pos-neutral,
body.theme-light .result-keyword {
  color: var(--text);
}

body.theme-light.project-page .matrix-empty {
  color: rgba(49,67,92,0.72);
}

/* =========================
   Retro olive theme
========================= */

.project-table-shell {
  overflow: auto;
  border: 1px solid rgba(150,158,63,0.26);
  border-radius: 8px;
  background: #f2eed7;
}

.project-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  color: #11140c;
}

.project-table th {
  height: 44px;
  padding: 0 16px;
  border-right: 1px solid rgba(68,76,25,0.24);
  background: linear-gradient(180deg, #d9dfa4, #c6cc80);
  color: #1a210b;
  font-size: 12px;
  text-transform: uppercase;
  text-align: left;
}

.project-table td {
  height: 52px;
  padding: 8px 16px;
  border-right: 1px solid rgba(68,76,25,0.16);
  border-bottom: 1px solid rgba(68,76,25,0.13);
  background: rgba(252,248,224,0.92);
  font-size: 14px;
}

.project-table tbody tr {
  cursor: pointer;
}

.project-table tbody tr:nth-child(even) td {
  background: rgba(246,241,211,0.94);
}

.project-table tbody tr:hover td {
  background: #fff6cc;
}

.project-table a,
.matrix-site-cell a {
  color: #1356b8;
  text-decoration: none;
}

.project-row-index {
  width: 52px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.project-table-name {
  display: flex;
  align-items: center;
  gap: 12px;
}

.project-table-name > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #d9d6ba;
  color: #2b3118;
  font-weight: 800;
}

.project-table-name b,
.project-table-name em {
  display: block;
}

.project-table-name em {
  color: #4d5337;
  font-size: 12px;
  font-style: normal;
}

.project-position-badge {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: #efe29b;
  color: #19200b;
  font-weight: 800;
}

.project-table-actions {
  display: flex;
  gap: 8px;
}

.project-table-actions .icon-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 7px;
  background: rgba(255,255,255,0.52);
  border-color: rgba(68,76,25,0.18);
  color: #202513;
}

.project-page .matrix-positions-cell {
  min-width: 230px;
}

.project-page .matrix-history {
  display: inline-flex;
  gap: 6px;
  margin-left: 10px;
  vertical-align: middle;
}

.project-page .history-chip {
  min-width: 26px;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  color: rgba(225,230,242,0.74);
  font-size: 12px;
  font-weight: 750;
}

.matrix-sort-head {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.matrix-sort-head > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 850;
}

.matrix-sort-head em {
  min-width: 24px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: inherit;
  font-size: 11px;
  font-style: normal;
}

.matrix-sort-head select {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(179,186,84,0.24);
  border-radius: 7px;
  background: rgba(9,13,8,0.78);
  color: #f5f1cf;
  font-size: 12px;
  outline: none;
}

.project-index {
  width: 48px;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: #3f4528;
}

.project-name-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.project-name-cell b {
  display: block;
  max-width: 24ch;
  color: #15170f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-name-cell small {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 3px;
  color: #596039;
  font-size: 12px;
}

.project-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #e3dfbd, #cfc99d);
  color: #2b3118;
  font-weight: 850;
}

.avg-position {
  display: inline-flex;
  min-width: 34px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 7px;
  background: #efe29b;
  color: #19200b;
  font-weight: 850;
}

.project-table-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid rgba(68,76,25,0.18);
  color: #4a5031;
  background: #f7f0c9;
  font-size: 13px;
}

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

.project-pagination strong {
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: linear-gradient(180deg, #9bab28, #637019);
  color: #fffbd3;
}

.project-pagination .icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

body.theme-light {
  --bg: #0b0f09;
  --panel: #151a10;
  --panel2: #10150d;
  --border: rgba(179,186,84,0.22);
  --border2: rgba(179,186,84,0.28);
  --text: #f5f1cf;
  --muted: #c0ba8a;
  --muted2: #9c966e;
  --accent: #b6c632;
  --accent2: #88951f;
  --matrix-bg: #11170e;
  --matrix-bg-2: #0d120b;
  --matrix-bg-3: #1d2412;
  --matrix-line: rgba(95,101,44,0.34);
  --matrix-line-soft: rgba(95,101,44,0.18);
}

body.theme-light.home-page,
body.theme-light.project-page {
  background:
    radial-gradient(circle at 12% 12%, rgba(183,198,50,0.12), transparent 22%),
    radial-gradient(circle at 80% 4%, rgba(218,196,76,0.08), transparent 26%),
    linear-gradient(180deg, #10150c, #050805);
  color: var(--text);
}

body.theme-light header,
body.theme-light.home-page header,
body.theme-light.project-page header,
body.theme-light .home-panel,
body.theme-light.project-page .project-info,
body.theme-light.project-page .matrix-card,
body.theme-light .account-console-top,
body.theme-light .summary-item,
body.theme-light.home-page .summary-item,
body.theme-light.home-page .home-panel {
  border-color: rgba(179,186,84,0.24);
  background:
    radial-gradient(circle at 0% 0%, rgba(204,218,62,0.08), transparent 30%),
    linear-gradient(180deg, rgba(31,38,20,0.92), rgba(12,17,11,0.94));
  box-shadow:
    inset 0 1px 0 rgba(255,255,208,0.08),
    0 18px 50px rgba(0,0,0,0.32);
}

body.theme-light .logo a,
body.theme-light .account-identity b,
body.theme-light .account-console-billing b,
body.theme-light .home-page .summary-item b,
body.theme-light.home-page .summary-item b,
body.theme-light.project-page .project-info strong,
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light label,
body.theme-light .section-title,
body.theme-light.home-page label,
body.theme-light.home-page .manual-card-head h3,
body.theme-light.home-page .project-card h3,
body.theme-light.home-page .folder-header h3 {
  color: #fff9d7;
}

body.theme-light .app-badge,
body.theme-light .account-console-pill span,
body.theme-light .home-page .manual-card-head span,
body.theme-light.home-page .manual-card-head span,
body.theme-light.project-page .project-avatar {
  border: 1px solid rgba(183,198,50,0.42);
  background: linear-gradient(180deg, rgba(180,197,48,0.18), rgba(82,92,21,0.22));
  color: #f4f0a8;
  box-shadow: 0 0 18px rgba(177,197,48,0.16);
}

body.theme-light .account-action,
body.theme-light .btn,
body.theme-light .icon-btn,
body.theme-light .account-pill,
body.theme-light.project-page .icon-btn,
body.theme-light.project-page .inline-edit {
  border-color: rgba(179,186,84,0.26);
  background: linear-gradient(180deg, rgba(37,44,22,0.84), rgba(13,18,10,0.9));
  color: #f5f1cf;
}

body.theme-light .btn-primary,
body.theme-light .btn.active,
body.theme-light.home-page .btn-primary {
  border-color: rgba(204,218,62,0.48);
  background: linear-gradient(180deg, #7d8b20, #48540f);
  color: #fffbd3;
  box-shadow: 0 0 22px rgba(181,198,48,0.18);
}

body.theme-light .account-action-telegram,
body.theme-light .account-action-phone {
  color: #f5f1cf;
}

body.theme-light input[type="text"],
body.theme-light input[type="number"],
body.theme-light input[type="date"],
body.theme-light select,
body.theme-light textarea,
body.theme-light .input-icon,
body.theme-light.home-page input[type="text"],
body.theme-light.home-page textarea,
body.theme-light.home-page select,
body.theme-light.home-page .input-icon,
body.theme-light.project-page .matrix-search-wrap,
body.theme-light.project-page .matrix-toolbar select,
body.theme-light.project-page .matrix-toolbar input[type="number"] {
  background: rgba(9,13,8,0.84);
  border-color: rgba(179,186,84,0.26);
  color: #f5f1cf;
}

body.theme-light input::placeholder,
body.theme-light textarea::placeholder,
body.theme-light.home-page input::placeholder,
body.theme-light.home-page textarea::placeholder {
  color: rgba(222,216,156,0.56);
}

body.theme-light.home-page .manual-tools .card,
body.theme-light.home-page .manual-tools .card:nth-child(2),
body.theme-light.home-page .project-folder,
body.theme-light.home-page .project-card,
body.theme-light .card {
  border-color: rgba(179,186,84,0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(204,218,62,0.06), transparent 28%),
    linear-gradient(180deg, rgba(18,24,14,0.94), rgba(8,12,7,0.94));
  box-shadow: inset 0 1px 0 rgba(255,255,208,0.05);
}

body.theme-light.home-page .home-section-head p,
body.theme-light.home-page .manual-card-head p,
body.theme-light .account-identity span,
body.theme-light .account-console-billing > div,
body.theme-light.project-page .project-info p {
  color: #c0ba8a;
}

body.theme-light .home-stats {
  grid-template-columns: repeat(6, minmax(150px, 1fr));
}

body.theme-light .summary-item,
body.theme-light.home-page .summary-item {
  min-height: 76px;
  padding: 16px 18px;
}

body.theme-light .summary-item > i,
body.theme-light.home-page .summary-item > i {
  color: #b8ca33;
  background: rgba(177,197,48,0.14);
}

body.theme-light .summary-item span,
body.theme-light.home-page .summary-item span,
body.theme-light .summary-item em,
body.theme-light.home-page .summary-item em {
  color: #c0ba8a;
}

body.theme-light .summary-item b,
body.theme-light.home-page .summary-item b {
  font-size: 24px;
}

body.theme-light .projects-grid {
  display: block;
}

body.theme-light .home-project-toolbar {
  border-top: 1px solid rgba(179,186,84,0.14);
  padding-top: 16px;
}

body.theme-light .project-table-shell,
body.theme-light.project-page .matrix-shell {
  border-color: rgba(112,119,47,0.34);
  background: #f3efd7;
  box-shadow: 0 18px 50px rgba(0,0,0,0.26);
}

body.theme-light.project-page .matrix-shell {
  max-height: 72vh;
  overflow: auto;
}

body.theme-light.project-page .matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

/* Retro project-page repair layer */
body.theme-light.project-page .btn:hover,
body.theme-light.project-page .account-action:hover,
body.theme-light.project-page .icon-btn:hover,
body.theme-light.project-page .inline-edit:hover,
body.theme-light.project-page .range-presets button:hover,
body.theme-light.project-page .range-presets button.active {
  border-color: rgba(226,215,92,0.62);
  background: linear-gradient(180deg, rgba(95,106,24,0.98), rgba(38,47,14,0.98));
  color: #fffbd3;
  box-shadow:
    inset 0 1px 0 rgba(255,255,210,0.16),
    0 0 0 1px rgba(226,215,92,0.08),
    0 10px 26px rgba(0,0,0,0.26);
  transform: translateY(-1px);
}

body.theme-light.project-page .btn:focus-visible,
body.theme-light.project-page .account-action:focus-visible,
body.theme-light.project-page .range-presets button:focus-visible {
  outline: 2px solid rgba(226,215,92,0.7);
  outline-offset: 2px;
}

body.theme-light.project-page .project-actions .btn,
body.theme-light.project-page .matrix-toolbar .btn {
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

body.theme-light.project-page .analytics-summary {
  align-items: stretch;
}

body.theme-light.project-page .summary-item {
  min-width: 0;
  overflow: hidden;
  gap: 14px;
}

body.theme-light.project-page .summary-item > div {
  min-width: 0;
  position: relative;
  z-index: 1;
}

body.theme-light.project-page .summary-item span {
  max-width: 11ch;
  line-height: 1.2;
}

body.theme-light.project-page .summary-item b {
  white-space: nowrap;
}

body.theme-light.project-page .summary-item svg {
  width: clamp(72px, 7vw, 112px);
  min-width: 72px;
  max-width: 42%;
  opacity: .95;
}

body.theme-light.project-page .summary-item > i {
  flex: 0 0 auto;
}

body.theme-light.project-page .range-panel {
  padding: 18px;
  border-color: rgba(179,186,84,0.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(204,218,62,0.08), transparent 28%),
    linear-gradient(180deg, rgba(28,37,20,0.96), rgba(13,19,11,0.96));
  box-shadow:
    inset 0 1px 0 rgba(255,255,208,0.07),
    0 20px 44px rgba(0,0,0,0.28);
}

body.theme-light.project-page .range-presets {
  display: grid;
  grid-template-columns: repeat(6, minmax(112px, 1fr));
  gap: 10px;
}

body.theme-light.project-page .range-presets button {
  min-height: 42px;
  border-color: rgba(179,186,84,0.22);
  background: linear-gradient(180deg, rgba(23,31,18,0.94), rgba(9,14,8,0.96));
  color: #f5f1cf;
  font-size: 14px;
}

body.theme-light.project-page .range-calendar-shell {
  grid-template-columns: 1fr;
  gap: 14px;
}

body.theme-light.project-page .range-side {
  order: -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 240px)) minmax(160px, 220px);
  gap: 12px;
  align-items: end;
  padding: 12px;
  border-left: 0;
  border: 1px solid rgba(179,186,84,0.18);
  border-radius: 10px;
  background: rgba(8,13,7,0.55);
}

body.theme-light.project-page .range-side .form-group {
  min-width: 0;
}

body.theme-light.project-page .range-side label {
  display: block;
  margin-bottom: 6px;
  color: #d6d09a;
  font-size: 12px;
  line-height: 1.15;
}

body.theme-light.project-page .range-panel input[type="date"] {
  width: 100%;
  height: 42px;
  border-color: rgba(179,186,84,0.26);
  background: rgba(8,13,7,0.92);
  color: #fffbd3;
}

body.theme-light.project-page .range-side .btn {
  width: 100%;
  height: 42px;
}

body.theme-light.project-page .range-calendar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

body.theme-light.project-page .calendar-month {
  min-width: 0;
}

body.theme-light.project-page .calendar-month-title {
  color: #fff9d7;
  font-size: 19px;
}

body.theme-light.project-page .calendar-month-title span,
body.theme-light.project-page .calendar-weekdays {
  color: #b9b481;
}

body.theme-light.project-page .calendar-day {
  min-height: 34px;
  color: #f7f1cd;
  background: rgba(8,13,7,0.22);
}

body.theme-light.project-page .calendar-day:not(.muted):hover {
  background: rgba(177,197,48,0.16);
  color: #fffbd3;
}

body.theme-light.project-page .calendar-day.selected {
  background: linear-gradient(180deg, rgba(95,112,27,0.98), rgba(40,59,18,0.98));
  color: #fffbd3;
  box-shadow: inset 0 0 0 1px rgba(226,215,92,0.18);
}

body.theme-light.project-page .calendar-day.has-check i,
body.theme-light.project-page .dot-check {
  background: #d6e84c;
}

body.theme-light.project-page .range-legend {
  color: #d6d09a;
}

body.theme-light.project-page .compare-summary span {
  border-color: rgba(179,186,84,0.18);
  background: rgba(8,13,7,0.44);
  color: #d6d09a;
}

body.theme-light.project-page .matrix-card {
  overflow: hidden;
}

body.theme-light.project-page .matrix-shell {
  border-radius: 10px;
}

/* Premium olive console refinement */
body.theme-light {
  --bg: #172012;
  --panel: #27311c;
  --panel2: #1c2516;
  --border: rgba(178,171,111,0.24);
  --border2: rgba(196,187,126,0.28);
  --text: #f5efd2;
  --muted: #d0c89a;
  --muted2: #aaa37b;
  --accent: #a7a45b;
  --accent2: #7f8545;
  --matrix-bg: #f6f0d8;
  --matrix-bg-2: #efe6c8;
  --matrix-bg-3: #fff9df;
  --matrix-line: rgba(93,89,54,0.24);
  --matrix-line-soft: rgba(93,89,54,0.16);
}

body.theme-light.home-page,
body.theme-light.project-page {
  background:
    linear-gradient(180deg, rgba(45,58,32,0.72), rgba(24,33,19,0.84) 38%, #11180f),
    #172012;
}

body.theme-light header,
body.theme-light.home-page header,
body.theme-light.project-page header,
body.theme-light .account-console-top,
body.theme-light.project-page .project-info,
body.theme-light.project-page .summary-item,
body.theme-light.home-page .summary-item,
body.theme-light.home-page .home-panel {
  border-color: rgba(196,187,126,0.22);
  background:
    linear-gradient(180deg, rgba(47,58,34,0.94), rgba(24,32,20,0.96));
  box-shadow:
    inset 0 1px 0 rgba(255,248,210,0.08),
    0 18px 44px rgba(0,0,0,0.22);
}

body.theme-light .logo i,
body.theme-light .section-title i,
body.theme-light .project-actions i,
body.theme-light .summary-item > i {
  color: #bbb66b;
}

body.theme-light .app-badge,
body.theme-light .account-console-pill span,
body.theme-light.project-page .project-avatar {
  border-color: rgba(196,187,126,0.34);
  background: linear-gradient(180deg, rgba(170,171,95,0.20), rgba(86,95,47,0.28));
  color: #efe9b9;
  box-shadow: none;
}

body.theme-light .account-action,
body.theme-light .btn,
body.theme-light .icon-btn,
body.theme-light .account-pill,
body.theme-light.project-page .icon-btn,
body.theme-light.project-page .inline-edit,
body.theme-light.project-page .matrix-toolbar .btn,
body.theme-light.project-page .matrix-filter-count {
  border-color: rgba(196,187,126,0.25);
  background: linear-gradient(180deg, rgba(40,49,30,0.94), rgba(22,30,18,0.96));
  color: #f4edcf;
  box-shadow: none;
}

body.theme-light .btn-primary,
body.theme-light .btn.active,
body.theme-light.home-page .btn-primary {
  border-color: rgba(190,181,105,0.42);
  background: linear-gradient(180deg, #858949, #5c642f);
  color: #fff8d7;
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

body.theme-light.project-page .btn:hover,
body.theme-light.project-page .account-action:hover,
body.theme-light.project-page .icon-btn:hover,
body.theme-light.project-page .inline-edit:hover,
body.theme-light.project-page .range-presets button:hover,
body.theme-light.project-page .range-presets button.active {
  border-color: rgba(218,205,135,0.48);
  background: linear-gradient(180deg, #6f7440, #404b27);
  color: #fff8d7;
  box-shadow: 0 10px 22px rgba(0,0,0,0.20);
}

body.theme-light .summary-item path,
body.theme-light.home-page .summary-item path {
  stroke: #b9b06a;
  filter: none;
}

body.theme-light.project-page .matrix-card {
  border-color: rgba(196,187,126,0.24);
  background:
    linear-gradient(180deg, rgba(47,58,34,0.92), rgba(23,31,19,0.95));
  box-shadow:
    inset 0 1px 0 rgba(255,248,210,0.08),
    0 20px 44px rgba(0,0,0,0.24);
}

body.theme-light .project-table-shell,
body.theme-light.project-page .matrix-shell {
  border: 1px solid rgba(160,151,97,0.42);
  background: #f6f0d8;
  box-shadow: 0 18px 34px rgba(0,0,0,0.22);
}

body.theme-light.project-page .matrix-table {
  min-width: 1040px;
  table-layout: fixed;
  color: #18170f;
}

body.theme-light.project-page .matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, #2a351f, #1d2818);
  color: #f5edca;
  border-color: rgba(236,226,167,0.14);
  height: 68px;
}

body.theme-light.project-page .keyword-col,
body.theme-light.project-page .select-col {
  position: static !important;
  left: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
}

body.theme-light.project-page .matrix-table tbody td,
body.theme-light.project-page .keyword-col,
body.theme-light.project-page .select-col {
  background: #fbf5dc !important;
  color: #18170f;
}

body.theme-light.project-page .matrix-table tbody tr:nth-child(odd) td,
body.theme-light.project-page .matrix-table tbody tr:nth-child(odd) .keyword-col,
body.theme-light.project-page .matrix-table tbody tr:nth-child(odd) .select-col {
  background: #f4edcf !important;
}

body.theme-light.project-page .matrix-table tbody tr:hover td,
body.theme-light.project-page .matrix-table tbody tr:hover .keyword-col,
body.theme-light.project-page .matrix-table tbody tr:hover .select-col {
  background: #fff8df !important;
}

body.theme-light.project-page .matrix-keyword {
  width: auto;
  min-width: 0;
  max-width: none;
  word-break: normal;
  overflow-wrap: break-word;
  color: #11130d;
}

body.theme-light.project-page .rank-badge,
body.theme-light.project-page .history-chip {
  border: 0;
  box-shadow: none;
}

body.theme-light.project-page .rank-badge.pos-good,
body.theme-light.project-page .history-chip.pos-good {
  background: linear-gradient(180deg, #b7d66f, #8fb657);
}

body.theme-light.project-page .rank-badge.pos-top10,
body.theme-light.project-page .history-chip.pos-top10 {
  background: linear-gradient(180deg, #d4df7c, #b5c85d);
}

body.theme-light.project-page .rank-badge.pos-mid,
body.theme-light.project-page .history-chip.pos-mid {
  background: linear-gradient(180deg, #e5d978, #ccb856);
}

body.theme-light.project-page .rank-badge.pos-bad,
body.theme-light.project-page .history-chip.pos-bad {
  background: linear-gradient(180deg, #e8be5e, #ce963f);
}

body.theme-light.project-page .project-meta i,
body.theme-light.project-page .project-meta svg,
body.theme-light.project-page .project-info i,
body.theme-light.project-page .project-info svg,
body.theme-light.project-page .access-pill i,
body.theme-light.project-page .access-pill svg,
body.theme-light.project-page .inline-edit i,
body.theme-light.project-page .refresh-link,
body.theme-light.project-page .account-action-theme i,
body.theme-light.project-page .account-console-billing i {
  color: #b9ad66 !important;
  fill: #b9ad66 !important;
  stroke: #b9ad66 !important;
}

body.theme-light.project-page .tracking-status,
body.theme-light.project-page .mode-pill,
body.theme-light.project-page .access-pill {
  border-color: rgba(196,187,126,0.20);
  background: rgba(246,240,216,0.08);
  color: #d8cf9d;
}

body.theme-light.project-page .hero-wave path,
body.theme-light.project-page .summary-item svg path,
body.theme-light.home-page .summary-item svg path,
body.theme-light .project-spark path {
  stroke: #b9ad66 !important;
  filter: none !important;
}

body.theme-light.project-page .hero-wave {
  opacity: .78;
  background: linear-gradient(90deg, transparent, rgba(246,240,216,0.06));
}

body.theme-light .account-console-billing span {
  background: transparent;
}

@media (max-width: 1180px) {
  body.theme-light.project-page .analytics-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  body.theme-light.project-page .analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.keyword-history-content {
  width: min(860px, calc(100vw - 28px));
}

.keyword-history-content .modal-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.keyword-history-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.keyword-history-meta span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
  font-weight: 850;
}

.keyword-history-meta b {
  color: var(--muted);
  font-size: 12px;
}

.keyword-history-chart-wrap {
  min-height: 260px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0,0,0,0.16);
}

.history-chart {
  width: 100%;
  height: auto;
  overflow: visible;
}

.history-chart line {
  stroke: rgba(200,193,134,0.24);
  stroke-width: 2;
}

.history-chart path {
  fill: none;
  stroke: #beb46b;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.history-chart circle {
  fill: #f5efd2;
  stroke: #8c8952;
  stroke-width: 3;
}

.history-chart text {
  fill: #f5efd2;
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.history-chart .history-date-label {
  fill: rgba(245,239,210,0.62);
  font-size: 11px;
  font-weight: 650;
}

.history-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  color: var(--muted);
}

body.theme-light.project-page .keyword-history-content {
  border-color: rgba(196,187,126,0.26);
  background: linear-gradient(180deg, #2a351f, #172113);
}

body.theme-light.project-page .keyword-history-meta span,
body.theme-light.project-page .keyword-history-chart-wrap {
  border-color: rgba(196,187,126,0.22);
  background: rgba(10,15,8,0.42);
}

body.theme-light.project-page .history-chart path {
  stroke: #b9ad66;
  filter: none;
}

body.theme-light.project-page .history-chart circle {
  fill: #f6f0d8;
  stroke: #8a8750;
}

body.theme-light.project-page .history-chart text {
  fill: #f6f0d8;
}

@media (max-width: 900px) {
  body.theme-light.project-page .matrix-shell,
  body.theme-light.project-page .matrix-table,
  body.theme-light.project-page .matrix-table tbody,
  body.theme-light.project-page .matrix-table tr,
  body.theme-light.project-page .matrix-table td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }

  body.theme-light.project-page .matrix-shell {
    max-height: none;
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.theme-light.project-page .matrix-table {
    min-width: 0;
  }

  body.theme-light.project-page .matrix-table thead {
    display: none;
  }

  body.theme-light.project-page .matrix-table tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid rgba(160,151,97,0.36);
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(255,252,234,0.96), rgba(244,238,211,0.98));
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.58),
      0 12px 24px rgba(0,0,0,0.16);
  }

  body.theme-light.project-page .matrix-table td {
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  body.theme-light.project-page .matrix-table td:nth-child(1),
  body.theme-light.project-page .matrix-table td:nth-child(2),
  body.theme-light.project-page .matrix-table td:nth-child(3),
  body.theme-light.project-page .matrix-table td:nth-child(7) {
    display: none;
  }

  body.theme-light.project-page .keyword-col {
    order: 1;
    padding-right: 74px;
  }

  body.theme-light.project-page .matrix-frequency {
    order: 2;
    display: inline-flex;
    width: fit-content;
    min-width: 0;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 10px;
    border: 1px solid rgba(160,151,97,0.24);
    border-radius: 999px;
    background: rgba(90,92,49,0.08) !important;
    color: #4f4c31;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
  }

  body.theme-light.project-page .matrix-frequency::before {
    content: "Частота: ";
    margin-right: 4px;
    color: #7c7650;
    font-weight: 700;
  }

  body.theme-light.project-page .matrix-positions-cell {
    order: 3;
    display: block;
    min-width: 0;
    padding-top: 6px;
    border-top: 1px solid rgba(160,151,97,0.18);
  }

  body.theme-light.project-page .matrix-keyword {
    display: block;
    width: auto;
    min-width: 0;
    max-width: none;
    color: #11130d;
    font-size: 18px;
    line-height: 1.28;
    font-weight: 850;
  }

  body.theme-light.project-page .matrix-positions-cell::before {
    content: "История позиций";
    display: block;
    margin-bottom: 8px;
    color: #77704d;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  body.theme-light.project-page .matrix-positions-cell > .rank-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    min-width: 52px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 20px;
    font-weight: 900;
  }

  body.theme-light.project-page .matrix-history {
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  body.theme-light.project-page .history-chip {
    min-width: 34px;
    min-height: 30px;
    border-radius: 9px;
    font-size: 14px;
  }

  body.theme-light.project-page .matrix-toolbar {
    grid-template-columns: 1fr;
  }
}

body.theme-light.project-page .matrix-table {
  min-width: 1120px;
  color: #15170f;
  table-layout: fixed;
}

body.theme-light.project-page .matrix-table th:nth-child(1),
body.theme-light.project-page .matrix-table td:nth-child(1) { width: 116px; }
body.theme-light.project-page .matrix-table th:nth-child(2),
body.theme-light.project-page .matrix-table td:nth-child(2) { width: 150px; }
body.theme-light.project-page .matrix-table th:nth-child(3),
body.theme-light.project-page .matrix-table td:nth-child(3) { width: 96px; }
body.theme-light.project-page .matrix-table th:nth-child(4),
body.theme-light.project-page .matrix-table td:nth-child(4) { width: 110px; text-align: center; }
body.theme-light.project-page .matrix-table th:nth-child(5),
body.theme-light.project-page .matrix-table td:nth-child(5) { width: 330px; }
body.theme-light.project-page .matrix-table th:nth-child(6),
body.theme-light.project-page .matrix-table td:nth-child(6) { width: 210px; }
body.theme-light.project-page .matrix-table th:nth-child(7),
body.theme-light.project-page .matrix-table td:nth-child(7) { width: 110px; text-align: center; }

body.theme-light.project-page .matrix-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 180px 140px 100px;
  align-items: end;
  gap: 10px;
}

body.theme-light.project-page .matrix-toolbar .btn,
body.theme-light.project-page .matrix-filter-count {
  height: 42px;
  min-height: 42px;
  border: 1px solid rgba(179,186,84,0.26);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(37,44,22,0.84), rgba(13,18,10,0.9));
  color: #f5f1cf;
}

body.theme-light.project-page .matrix-filter-count {
  display: grid;
  place-items: center;
  padding: 0 10px;
  font-weight: 850;
  white-space: nowrap;
}

body.theme-light.project-page .matrix-toolbar .form-group {
  margin: 0;
}

body.theme-light.project-page .matrix-table thead th {
  background: linear-gradient(180deg, #24301a, #17210f);
  color: #f8f1ce;
  border-color: rgba(224,215,154,0.12);
  text-shadow: none;
  height: 66px;
  padding: 9px 10px;
  vertical-align: middle;
}

body.theme-light.project-page .matrix-table tbody td {
  background: rgba(253,249,225,0.94);
  color: #15170f;
  border-color: rgba(83,90,37,0.16);
}

body.theme-light.project-page .matrix-table tbody tr:nth-child(odd) td {
  background: rgba(248,243,216,0.96);
}

body.theme-light.project-page .matrix-table tbody tr:hover td {
  background: #fff4c6;
}

body.theme-light.project-page .keyword-col,
body.theme-light.project-page .select-col {
  background: rgba(253,249,225,0.98) !important;
  color: #15170f;
  box-shadow:
    10px 0 18px rgba(83,90,37,0.08),
    1px 0 0 rgba(83,90,37,0.16);
}

body.theme-light.project-page .matrix-table tbody tr:nth-child(odd) .keyword-col,
body.theme-light.project-page .matrix-table tbody tr:nth-child(odd) .select-col {
  background: rgba(248,243,216,0.98) !important;
}

body.theme-light.project-page .matrix-table tbody tr:hover .keyword-col,
body.theme-light.project-page .matrix-table tbody tr:hover .select-col {
  background: #fff4c6 !important;
}

body.theme-light.project-page .matrix-keyword,
body.theme-light.project-page .matrix-frequency,
body.theme-light.project-page .matrix-pos.pos-neutral {
  color: #15170f;
}

body.theme-light.project-page .rank-badge,
body.theme-light.project-page .history-chip {
  color: #1b1e10;
}

body.theme-light.project-page .rank-badge.pos-good,
body.theme-light.project-page .history-chip.pos-good {
  background: linear-gradient(180deg, #a7d56b, #7eb342);
}

body.theme-light.project-page .rank-badge.pos-top10,
body.theme-light.project-page .history-chip.pos-top10 {
  background: linear-gradient(180deg, #cbe77b, #9fca45);
}

body.theme-light.project-page .rank-badge.pos-mid,
body.theme-light.project-page .history-chip.pos-mid {
  background: linear-gradient(180deg, #dce98a, #b7cf4b);
}

body.theme-light.project-page .rank-badge.pos-bad,
body.theme-light.project-page .history-chip.pos-bad {
  background: linear-gradient(180deg, #f2c950, #e2a72d);
}

body.theme-light.project-page .rank-badge.pos-neutral,
body.theme-light.project-page .history-chip.pos-neutral {
  background: #dfdbc3;
  color: #5b5a4d;
}

/* Retro usability polish */
body.theme-light.home-page .container {
  width: min(100% - 32px, 1440px);
  max-width: 1440px;
  padding: 0;
}

body.theme-light.home-page header,
body.theme-light.project-page header {
  margin: 8px 8px 24px;
}

body.theme-light.home-page .header-content,
body.theme-light.project-page .header-content {
  min-height: 128px;
}

body.theme-light.home-page .home-panel {
  padding: 24px;
}

body.theme-light.home-page .manual-tools .card {
  min-height: 330px;
}

body.theme-light.home-page .manual-card-head span {
  width: 56px;
  height: 56px;
}

body.theme-light.home-page .manual-card-head h3 {
  font-size: 24px;
}

body.theme-light.home-page .manual-card-head p {
  font-size: 15px;
}

body.theme-light.home-page .home-stats {
  gap: 10px;
}

body.theme-light.home-page .summary-item {
  min-height: 70px;
  padding: 14px;
}

body.theme-light.home-page .summary-item b {
  font-size: 22px;
  line-height: 1.1;
}

body.theme-light.home-page .summary-item > i {
  width: 38px;
  height: 38px;
  min-width: 38px;
}

body.theme-light .home-project-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px 190px;
}

body.theme-light .project-table {
  min-width: 1120px;
  table-layout: fixed;
}

body.theme-light .project-table th:nth-child(1),
body.theme-light .project-table td:nth-child(1) { width: 56px; }
body.theme-light .project-table th:nth-child(2),
body.theme-light .project-table td:nth-child(2) { width: 270px; }
body.theme-light .project-table th:nth-child(3),
body.theme-light .project-table td:nth-child(3) { width: 220px; }
body.theme-light .project-table th:nth-child(4),
body.theme-light .project-table td:nth-child(4) { width: 95px; text-align: center; }
body.theme-light .project-table th:nth-child(5),
body.theme-light .project-table td:nth-child(5) { width: 140px; text-align: center; }
body.theme-light .project-table th:nth-child(6),
body.theme-light .project-table td:nth-child(6) { width: 135px; text-align: center; }
body.theme-light .project-table th:nth-child(7),
body.theme-light .project-table td:nth-child(7) { width: 155px; text-align: center; }
body.theme-light .project-table th:nth-child(8),
body.theme-light .project-table td:nth-child(8) { width: 150px; }

body.theme-light .project-table td {
  vertical-align: middle;
}

body.theme-light .project-table td:nth-child(3) a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

body.theme-light .project-table-actions {
  justify-content: flex-start;
}

@media (max-width: 1100px) {
  body.theme-light.home-page .header-content,
  body.theme-light.project-page .header-content {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 0;
  }

  body.theme-light.home-page .account-console,
  body.theme-light.project-page .account-console {
    width: 100%;
    max-width: none;
  }

  body.theme-light .home-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html,
  body,
  body.theme-light.home-page,
  body.theme-light.project-page {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  body.theme-light.home-page header,
  body.theme-light.project-page header {
    margin: 6px 6px 16px;
    border-radius: 10px;
  }

  body.theme-light.home-page .container,
  body.theme-light.project-page .container {
    width: calc(100% - 14px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding: 0;
  }

  body.theme-light.home-page header .container,
  body.theme-light.project-page header .container {
    width: 100%;
    padding: 0 10px;
  }

  body.theme-light.home-page .header-content,
  body.theme-light.project-page .header-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0;
  }

  body.theme-light.home-page .logo,
  body.theme-light.project-page .logo {
    font-size: 20px;
    gap: 8px;
  }

  body.theme-light.home-page .logo i,
  body.theme-light.project-page .logo i {
    font-size: 24px;
  }

  body.theme-light.home-page .app-badge,
  body.theme-light.project-page .app-badge {
    height: 24px;
    padding: 0 8px;
    font-size: 12px;
  }

  body.theme-light .account-console {
    gap: 8px;
  }

  body.theme-light .account-console-top,
  body.theme-light .account-console.no-settings .account-console-top {
    min-height: 0;
    grid-template-columns: 68px minmax(0, 1fr) 44px;
    gap: 10px;
    padding: 10px;
  }

  body.theme-light .account-console-pill {
    width: 62px;
    min-height: 44px;
    padding: 0 8px;
  }

  body.theme-light .account-console-pill span {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  body.theme-light .account-identity {
    padding-right: 0;
    border-right: 0;
  }

  body.theme-light .account-console-billing {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 0 0;
    border-top: 1px solid rgba(179,186,84,0.16);
    border-right: 0;
    font-size: 12px;
  }

  body.theme-light .account-console-settings {
    position: static;
    width: 40px;
    height: 40px;
    min-width: 40px;
  }

  body.theme-light .account-console-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.theme-light .account-action {
    min-height: 40px;
    font-size: 12px;
  }

  body.theme-light.home-page .home-panel {
    padding: 14px;
    border-radius: 10px;
  }

  body.theme-light.home-page .home-section-head {
    display: block;
    margin-bottom: 14px;
  }

  body.theme-light.home-page .section-title {
    font-size: 20px;
    line-height: 1.2;
  }

  body.theme-light.home-page .home-section-head p {
    margin-top: 6px;
    font-size: 13px;
  }

  body.theme-light.home-page .manual-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.theme-light.home-page .manual-tools .card {
    min-height: 0;
    padding: 14px;
  }

  body.theme-light.home-page .manual-card-head {
    gap: 10px;
    margin-bottom: 14px;
  }

  body.theme-light.home-page .manual-card-head span {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  body.theme-light.home-page .manual-card-head h3 {
    font-size: 18px;
  }

  body.theme-light.home-page .manual-card-head p {
    font-size: 12px;
  }

  body.theme-light.home-page textarea {
    min-height: 92px;
  }

  body.theme-light.home-page .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
  }

  body.theme-light.home-page .summary-item {
    min-height: 72px;
    padding: 10px;
    gap: 8px;
  }

  body.theme-light.home-page .summary-item span {
    font-size: 11px;
  }

  body.theme-light.home-page .summary-item b {
    font-size: 18px;
  }

  body.theme-light.home-page .summary-item > i {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: 13px;
  }

  body.theme-light .home-projects-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  body.theme-light .home-projects-head .btn {
    width: 100%;
    justify-content: center;
  }

  body.theme-light .home-project-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 10px;
  }

  body.theme-light .home-project-toolbar .matrix-search-wrap,
  body.theme-light .home-project-toolbar select {
    width: 100%;
    min-width: 0;
    height: 40px;
  }

  body.theme-light .project-table-shell {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  body.theme-light .project-table,
  body.theme-light .project-table thead,
  body.theme-light .project-table tbody,
  body.theme-light .project-table tr,
  body.theme-light .project-table td {
    display: block;
    width: 100% !important;
    min-width: 0;
  }

  body.theme-light .project-table thead {
    display: none;
  }

  body.theme-light .project-table tr {
    margin-bottom: 10px;
    border: 1px solid rgba(112,119,47,0.34);
    border-radius: 10px;
    overflow: hidden;
    background: #f5efd0;
    box-shadow: 0 12px 24px rgba(0,0,0,0.18);
  }

  body.theme-light .project-table td {
    min-height: 0;
    height: auto;
    padding: 9px 12px;
    border-right: 0;
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    font-size: 13px;
  }

  body.theme-light .project-table td::before {
    color: #6d6b48;
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
  }

  body.theme-light .project-table td:nth-child(1)::before { content: "#"; }
  body.theme-light .project-table td:nth-child(2)::before { content: "Проект"; }
  body.theme-light .project-table td:nth-child(3)::before { content: "Домен"; }
  body.theme-light .project-table td:nth-child(4)::before { content: "Ключей"; }
  body.theme-light .project-table td:nth-child(5)::before { content: "Средняя"; }
  body.theme-light .project-table td:nth-child(6)::before { content: "Проверки"; }
  body.theme-light .project-table td:nth-child(7)::before { content: "Дата"; }
  body.theme-light .project-table td:nth-child(8)::before { content: "Действия"; }

  body.theme-light .project-name-cell {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  body.theme-light .project-avatar {
    width: 36px;
    height: 36px;
  }

  body.theme-light .project-name-cell b {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
  }

  body.theme-light .project-table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  body.theme-light .project-table-footer {
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
    border: 1px solid rgba(112,119,47,0.34);
    border-radius: 10px;
  }

  body.theme-light .project-pagination {
    justify-content: space-between;
  }

  body.theme-light .home-footer .container {
    width: calc(100% - 14px);
    padding: 0;
  }

  body.theme-light.project-page .project-info {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
  }

  body.theme-light.project-page .project-avatar {
    width: 54px;
    height: 54px;
    font-size: 18px;
  }

  body.theme-light.project-page .project-info h2 {
    font-size: 20px;
    line-height: 1.15;
  }

  body.theme-light.project-page .project-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.theme-light.project-page .access-tags {
    flex-wrap: wrap;
  }

  body.theme-light.project-page .project-status-side {
    grid-column: 1 / -1;
    min-height: 52px;
  }

  body.theme-light.project-page .project-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.theme-light.project-page .project-actions .btn {
    width: 100%;
    justify-content: center;
  }

  body.theme-light.project-page .analytics-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  body.theme-light.project-page .summary-item {
    min-height: 74px;
    padding: 10px;
  }

  body.theme-light.project-page .summary-item b {
    font-size: 19px;
  }

  body.theme-light.project-page .matrix-card {
    padding: 10px;
    border-radius: 10px;
  }

  body.theme-light.project-page .matrix-toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.theme-light.project-page .matrix-toolbar .btn,
  body.theme-light.project-page .matrix-search-wrap,
  body.theme-light.project-page .matrix-toolbar select,
  body.theme-light.project-page .matrix-toolbar input[type="number"],
  body.theme-light.project-page .matrix-filter-count {
    width: 100%;
    max-width: none;
  }

  body.theme-light.project-page .matrix-shell {
    overflow-x: auto;
    max-height: 70vh;
    overflow-y: auto;
    border-radius: 8px;
  }

  body.theme-light.project-page .matrix-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  body.theme-light.project-page .matrix-table {
    min-width: 900px;
    font-size: 12px;
  }

  body.theme-light.project-page .matrix-table th,
  body.theme-light.project-page .matrix-table td {
    padding: 9px 8px;
  }

  body.theme-light.project-page .keyword-col {
    position: static;
    box-shadow: none;
  }

  body.theme-light.project-page .matrix-keyword {
    width: 28ch;
    min-width: 28ch;
    max-width: 28ch;
  }

  body.theme-light.project-page .matrix-sort-head select {
    height: 28px;
    font-size: 11px;
  }

  body.theme-light.project-page .matrix-history {
    margin-left: 5px;
    gap: 4px;
  }

  body.theme-light.project-page .history-chip {
    min-width: 22px;
    min-height: 22px;
    padding: 2px 5px;
  }
}

/* =========================
   Responsive
========================= */

@media (max-width: 768px) {
  .project-page .header-content {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 0;
  }

  .project-page .header-tools {
    margin-left: 0;
  }

  .project-page .project-info {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 18px;
    padding: 22px;
  }

  .project-page .project-avatar {
    width: 76px;
    height: 76px;
    font-size: 22px;
  }

  .project-page .project-info h2 {
    font-size: 23px;
  }

  .project-page .project-status-side {
    grid-column: 1 / -1;
    min-height: 70px;
  }

  .project-page .tracking-status {
    float: none;
  }

  .project-page .hero-wave {
    width: 230px;
    height: 70px;
    right: -20px;
    bottom: 0;
  }

  .project-page .schedule-panel {
    grid-column: 1 / -1;
  }

  .project-page .range-calendar-shell {
    grid-template-columns: 1fr;
  }

  .project-page .range-calendar {
    grid-template-columns: 1fr;
  }

  .project-page .range-side {
    border-left: 0;
    padding-left: 0;
  }

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

  .summary-item {
    min-height: 98px;
  }

  .project-page .matrix-toolbar {
    align-items: stretch;
  }

  .project-page .matrix-search-wrap,
  .project-page .matrix-toolbar .form-group,
  .project-page .matrix-toolbar select,
  .project-page .matrix-toolbar input[type="number"],
  .project-page .matrix-toolbar .btn,
  .project-page .matrix-filter-count {
    width: 100%;
    max-width: none;
  }

  .projects-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .home-page .header-tools {
    margin-left: auto;
  }

  .header-content {
    align-items: flex-start;
  }

  .home-page header,
  .project-page header {
    margin: 8px;
  }

  .home-page header .container,
  .project-page header .container {
    padding: 0 14px;
  }

  .home-page .header-content,
  .project-page .header-content {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 0;
  }

  .logo {
    min-width: 0;
  }

  .home-page .logo,
  .project-page .logo {
    font-size: 22px;
  }

  .home-page .logo i,
  .project-page .logo i {
    font-size: 28px;
  }

  .logo a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-tools {
    gap: 8px;
  }

  .account-console,
  .home-page .account-console,
  .project-page .account-console {
    width: 100%;
  }

  .account-console-top,
  .account-console.no-settings .account-console-top {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .account-console-billing {
    grid-column: 1 / -1;
    padding: 12px 0 0;
    border-top: 1px solid rgba(135,151,186,0.14);
    border-right: 0;
  }

  .account-console-settings {
    position: absolute;
    right: 16px;
    top: 12px;
  }

  .account-console-top {
    position: relative;
  }

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

  .account-action {
    min-height: 44px;
    padding: 0 10px;
    font-size: 13px;
  }

  .account-pill {
    min-width: 38px;
    padding: 0 10px;
  }

  .home-page .account-console-pill,
  .project-page .account-console-pill,
  .account-console-pill {
    width: 70px;
    min-height: 48px;
  }

  .home-panel {
    padding: 18px;
  }

  .home-section-head {
    padding: 0;
  }

  .home-page .manual-tools {
    width: 100%;
    margin: 18px 0 0;
  }

  .home-stats,
  .home-page .projects-grid,
  .home-page .manual-tools {
    grid-template-columns: 1fr;
  }

  .home-project-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .home-project-toolbar select,
  .home-project-toolbar .matrix-search-wrap {
    width: 100%;
  }

  .home-footer .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

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

  .admin-modal-content {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
    padding: 16px;
  }

  .admin-panel {
    min-height: 360px;
  }

  .admin-access-row,
  .admin-user-row {
    align-items: flex-start;
  }

  .admin-access-row {
    grid-template-columns: 1fr;
  }

  .admin-user-billing {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .admin-user-actions {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .admin-user-credentials {
    grid-template-columns: 1fr;
  }

  .admin-user-actions .btn,
  .admin-billing-input {
    width: 100%;
  }

  .admin-billing-input {
    grid-column: 1 / -1;
  }

  .admin-create-user {
    grid-template-columns: 1fr;
  }

  .admin-create-user #admin-new-paid-months,
  .admin-create-user #admin-new-balance {
    grid-column: 1 / -1;
  }

  .project-card-top > div {
    padding-right: 0;
  }

  .project-spark {
    position: static;
    width: 100%;
    max-width: 140px;
    margin: 8px 0 0 auto;
    display: block;
  }

  .project-meta > div {
    justify-content: flex-start;
    width: 100%;
  }

  .project-page .compare-panel {
    grid-template-columns: 1fr;
  }

  .project-page .matrix-filters {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .manual-result {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .project-page .container {
    width: calc(100vw - 20px);
    margin-left: calc(50% - 50vw + 10px);
    margin-right: calc(50% - 50vw + 10px);
  }

  .project-page .project-info,
  .project-page .project-actions,
  .project-page .semantics-panel,
  .project-page .loading {
    max-width: 100%;
    width: 100%;
  }

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

  .project-page .project-actions .btn,
  .project-page .project-actions a.btn {
    width: 100%;
  }

  .project-page .matrix-section {
    padding: 0 10px 30px;
  }

  .project-page .matrix-table thead th.sticky-col,
  .project-page .matrix-table tbody td.sticky-col,
  .project-page .matrix-keyword {
    width: 30ch;
    min-width: 30ch;
    max-width: 30ch;
  }

  .project-page .matrix-pos {
    font-size: 30px;
    min-width: 102px;
  }
}

/* Home dashboard final polish */
.project-avatar.project-favicon {
  position: relative;
  overflow: hidden;
}

.project-avatar.project-favicon img {
  position: absolute;
  inset: 8px;
  width: calc(100% - 16px);
  height: calc(100% - 16px);
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255,255,255,0.92);
  z-index: 2;
}

.project-avatar.project-favicon img + .project-avatar-fallback,
.project-avatar.project-favicon:has(img) .project-avatar-fallback {
  opacity: 0;
}

body.theme-light.home-page .header-content {
  min-height: 156px;
  grid-template-columns: minmax(360px, 1fr) minmax(620px, 780px);
  align-items: center;
}

body.theme-light.home-page .logo {
  align-self: center;
}

body.theme-light.home-page .account-console {
  width: min(100%, 780px);
  justify-self: end;
}

body.theme-light.home-page .account-console-top {
  grid-template-columns: 98px minmax(160px, 1fr) minmax(260px, 1.2fr) 64px;
}

body.theme-light.home-page .project-table-shell {
  border: 1px solid rgba(196,187,126,0.16);
  background: linear-gradient(180deg, rgba(13,18,14,0.96), rgba(9,13,10,0.98));
  box-shadow: 0 18px 36px rgba(0,0,0,0.28);
}

body.theme-light.home-page .project-table {
  color: #f5edca;
}

body.theme-light.home-page .project-table th {
  border-color: rgba(196,187,126,0.14);
  background: linear-gradient(180deg, rgba(42,53,31,0.96), rgba(24,34,20,0.98));
  color: rgba(245,237,202,0.84);
}

body.theme-light.home-page .project-table td {
  border-color: rgba(196,187,126,0.10);
  background: rgba(10,14,11,0.82);
  color: rgba(250,246,222,0.90);
}

body.theme-light.home-page .project-table tbody tr:nth-child(even) td {
  background: rgba(15,21,15,0.90);
}

body.theme-light.home-page .project-table tbody tr:hover td {
  background: rgba(38,50,27,0.92);
}

body.theme-light.home-page .project-table a,
body.theme-light.home-page .project-name-cell b {
  color: #fff8d7;
}

body.theme-light.home-page .project-name-cell small,
body.theme-light.home-page .project-index,
body.theme-light.home-page .project-table-footer {
  color: rgba(245,237,202,0.62);
}

body.theme-light.home-page .project-table-footer {
  border-color: rgba(196,187,126,0.14);
  background: rgba(8,12,9,0.92);
}

body.theme-light.home-page .project-table .icon-btn {
  border-color: rgba(196,187,126,0.20);
  background: rgba(22,30,18,0.92);
  color: #f4edcf;
}

@media (max-width: 1100px) {
  body.theme-light.home-page .header-content {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.theme-light.home-page .account-console {
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .project-avatar.project-favicon img {
    inset: 6px;
    width: calc(100% - 12px);
    height: calc(100% - 12px);
  }

  body.theme-light.home-page .project-table-shell {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.theme-light.home-page .project-table tr {
    border-color: rgba(196,187,126,0.18);
    background: linear-gradient(180deg, rgba(18,25,15,0.96), rgba(10,14,10,0.98));
    box-shadow: 0 14px 26px rgba(0,0,0,0.24);
  }

  body.theme-light.home-page .project-table td,
  body.theme-light.home-page .project-table tbody tr:nth-child(even) td,
  body.theme-light.home-page .project-table tbody tr:hover td {
    background: transparent;
  }

body.theme-light.home-page .project-table td::before {
    color: rgba(245,237,202,0.58);
  }
}

/* Theme table correction and motion polish */
body.home-page:not(.theme-light) .project-table-shell {
  border: 1px solid rgba(135,151,186,0.18);
  background: rgba(8,12,22,0.78);
  box-shadow: 0 18px 42px rgba(0,0,0,0.28);
}

body.home-page:not(.theme-light) .project-table {
  color: #eef3ff;
}

body.home-page:not(.theme-light) .project-table th {
  border-color: rgba(135,151,186,0.14);
  background: linear-gradient(180deg, rgba(16,23,38,0.98), rgba(10,15,26,0.98));
  color: rgba(225,230,242,0.72);
}

body.home-page:not(.theme-light) .project-table td {
  border-color: rgba(135,151,186,0.10);
  background: rgba(10,15,26,0.86);
  color: rgba(245,247,255,0.88);
}

body.home-page:not(.theme-light) .project-table tbody tr:nth-child(even) td {
  background: rgba(14,19,32,0.90);
}

body.home-page:not(.theme-light) .project-table tbody tr:hover td {
  background: rgba(21,29,48,0.98);
}

body.home-page:not(.theme-light) .project-table a,
body.home-page:not(.theme-light) .project-name-cell b {
  color: #dbe7ff;
}

body.home-page:not(.theme-light) .project-name-cell small,
body.home-page:not(.theme-light) .project-index,
body.home-page:not(.theme-light) .project-table-footer {
  color: rgba(225,230,242,0.58);
}

body.home-page:not(.theme-light) .project-table-footer {
  border-color: rgba(135,151,186,0.14);
  background: rgba(7,10,18,0.92);
}

body.home-page:not(.theme-light) .project-position-badge,
body.home-page:not(.theme-light) .avg-position {
  background: rgba(119,89,210,0.22);
  color: #e9ddff;
}

body.theme-light.home-page .project-table-shell {
  border: 1px solid rgba(160,151,97,0.42);
  background: #f6f0d8;
  box-shadow: 0 18px 34px rgba(0,0,0,0.22);
}

body.theme-light.home-page .project-table {
  color: #18170f;
}

body.theme-light.home-page .project-table th {
  border-color: rgba(93,89,54,0.24);
  background: linear-gradient(180deg, #d9dfa4, #c6cc80);
  color: #1a210b;
}

body.theme-light.home-page .project-table td {
  border-color: rgba(93,89,54,0.16);
  background: rgba(252,248,224,0.92);
  color: #15170d;
}

body.theme-light.home-page .project-table tbody tr:nth-child(even) td {
  background: rgba(246,241,211,0.94);
}

body.theme-light.home-page .project-table tbody tr:hover td {
  background: #fff6cc;
}

body.theme-light.home-page .project-table a {
  color: #1356b8;
}

body.theme-light.home-page .project-name-cell b {
  color: #15170d;
}

body.theme-light.home-page .project-name-cell small,
body.theme-light.home-page .project-index,
body.theme-light.home-page .project-table-footer {
  color: #545638;
}

body.theme-light.home-page .project-table-footer {
  border-color: rgba(93,89,54,0.16);
  background: rgba(243,238,210,0.96);
}

.home-page .header-content,
.project-page .header-content {
  align-items: center;
}

.home-page .logo,
.project-page .logo {
  min-width: 0;
  line-height: 1;
  align-items: center;
  transform: translateY(-1px);
}

.home-page .logo a,
.project-page .logo a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  line-height: 1;
}

.home-page .logo i,
.project-page .logo i {
  width: 1.12em;
  display: inline-flex;
  justify-content: center;
  line-height: 1;
}

body.theme-light.home-page .header-content {
  min-height: 136px;
  grid-template-columns: minmax(380px, 1fr) minmax(620px, 780px);
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .manual-tools .card,
  .summary-item,
  .project-table-shell,
  .matrix-card,
  .project-info,
  .account-console,
  .modal-content,
  .keyword-history-content {
    animation: softRise .28s ease both;
  }

  .modal.show .modal-content,
  .modal.show .keyword-history-content {
    animation: modalIn .22s ease both;
  }

  .project-table tbody tr,
  .matrix-table tbody tr,
  .btn,
  .icon-btn,
  .account-action,
  .project-avatar,
  .summary-item,
  .access-pill,
  .rank-badge,
  .history-chip {
    transition:
      transform .18s ease,
      border-color .18s ease,
      background .18s ease,
      color .18s ease,
      box-shadow .18s ease,
      opacity .18s ease;
  }

  .project-table tbody tr:hover,
  .matrix-table tbody tr:hover {
    transform: translateY(-1px);
  }

  .btn:active,
  .icon-btn:active,
  .account-action:active {
    transform: translateY(0) scale(.985);
  }
}

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

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes themeVeil {
  0% { opacity: 0; }
  28% { opacity: 1; }
  100% { opacity: 0; }
}

@media (max-width: 760px) {
  body.home-page:not(.theme-light) .project-table-shell,
  body.theme-light.home-page .project-table-shell {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body.home-page:not(.theme-light) .project-table tr {
    border-color: rgba(135,151,186,0.18);
    background: linear-gradient(180deg, rgba(12,17,29,0.96), rgba(7,10,18,0.98));
  }

  body.theme-light.home-page .project-table tr {
    border-color: rgba(160,151,97,0.30);
    background: #f6f0d8;
  }

  body.home-page:not(.theme-light) .project-table td,
  body.home-page:not(.theme-light) .project-table tbody tr:nth-child(even) td,
  body.home-page:not(.theme-light) .project-table tbody tr:hover td,
  body.theme-light.home-page .project-table td,
  body.theme-light.home-page .project-table tbody tr:nth-child(even) td,
  body.theme-light.home-page .project-table tbody tr:hover td {
    background: transparent;
  }

  body.home-page:not(.theme-light) .project-table td::before {
    color: rgba(225,230,242,0.58);
  }

  body.theme-light.home-page .project-table td::before {
    color: #6d6b48;
  }
}

/* Project matrix behavior: desktop is page scroll, mobile is cards */
.project-page .matrix-shell,
body.theme-light.project-page .matrix-shell {
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}

.project-page .matrix-card {
  overflow: visible;
}

@media (max-width: 900px) {
  .project-page .matrix-shell,
  .project-page .matrix-table,
  .project-page .matrix-table tbody,
  .project-page .matrix-table tr,
  .project-page .matrix-table td,
  body.theme-light.project-page .matrix-shell,
  body.theme-light.project-page .matrix-table,
  body.theme-light.project-page .matrix-table tbody,
  body.theme-light.project-page .matrix-table tr,
  body.theme-light.project-page .matrix-table td {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
  }

  .project-page .matrix-shell,
  body.theme-light.project-page .matrix-shell {
    max-height: none !important;
    overflow: visible !important;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .project-page .matrix-table,
  body.theme-light.project-page .matrix-table {
    min-width: 0 !important;
    table-layout: auto;
  }

  .project-page .matrix-table thead,
  body.theme-light.project-page .matrix-table thead {
    display: none;
  }

  .project-page .matrix-table tr,
  body.theme-light.project-page .matrix-table tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
    padding: 16px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.16);
  }

  .project-page .matrix-table tr {
    border: 1px solid rgba(135,151,186,0.18);
    background: linear-gradient(180deg, rgba(13,18,31,0.97), rgba(8,12,22,0.99));
  }

  body.theme-light.project-page .matrix-table tr {
    border: 1px solid rgba(160,151,97,0.36);
    background: linear-gradient(180deg, rgba(255,252,234,0.96), rgba(244,238,211,0.98));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.58), 0 12px 24px rgba(0,0,0,0.16);
  }

  .project-page .matrix-table td,
  body.theme-light.project-page .matrix-table td {
    min-height: 0;
    height: auto;
    padding: 0;
    border: 0;
    background: transparent !important;
  }

  .project-page .matrix-table td:nth-child(1),
  .project-page .matrix-table td:nth-child(2),
  .project-page .matrix-table td:nth-child(3),
  .project-page .matrix-table td:nth-child(7),
  body.theme-light.project-page .matrix-table td:nth-child(1),
  body.theme-light.project-page .matrix-table td:nth-child(2),
  body.theme-light.project-page .matrix-table td:nth-child(3),
  body.theme-light.project-page .matrix-table td:nth-child(7) {
    display: none !important;
  }

  .project-page .keyword-col,
  body.theme-light.project-page .keyword-col {
    order: 1;
    padding-right: 74px;
    position: static !important;
    box-shadow: none !important;
  }

  .project-page .matrix-keyword,
  body.theme-light.project-page .matrix-keyword {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    font-size: 18px;
    line-height: 1.28;
    font-weight: 850;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .project-page .matrix-keyword {
    color: #f7f9ff;
  }

  body.theme-light.project-page .matrix-keyword {
    color: #11130d;
  }

  .project-page .matrix-frequency,
  body.theme-light.project-page .matrix-frequency {
    order: 2;
    display: inline-flex;
    width: fit-content !important;
    min-width: 0 !important;
    align-items: center;
    justify-content: flex-start;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
  }

  .project-page .matrix-frequency {
    border: 1px solid rgba(135,151,186,0.18);
    background: rgba(255,255,255,0.06) !important;
    color: rgba(225,230,242,0.82);
  }

  body.theme-light.project-page .matrix-frequency {
    border: 1px solid rgba(160,151,97,0.24);
    background: rgba(90,92,49,0.08) !important;
    color: #4f4c31;
  }

  .project-page .matrix-frequency::before,
  body.theme-light.project-page .matrix-frequency::before {
    content: "Частота: ";
    margin-right: 4px;
    font-weight: 700;
  }

  .project-page .matrix-positions-cell,
  body.theme-light.project-page .matrix-positions-cell {
    order: 3;
    display: block;
    min-width: 0;
    padding-top: 6px;
  }

  .project-page .matrix-positions-cell {
    border-top: 1px solid rgba(135,151,186,0.14);
  }

  body.theme-light.project-page .matrix-positions-cell {
    border-top: 1px solid rgba(160,151,97,0.18);
  }

  .project-page .matrix-positions-cell::before,
  body.theme-light.project-page .matrix-positions-cell::before {
    content: "История позиций";
    display: block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  .project-page .matrix-positions-cell::before {
    color: rgba(225,230,242,0.52);
  }

  body.theme-light.project-page .matrix-positions-cell::before {
    color: #77704d;
  }

  .project-page .matrix-positions-cell > .rank-badge,
  body.theme-light.project-page .matrix-positions-cell > .rank-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    min-width: 52px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    font-size: 20px;
    font-weight: 900;
  }

  .project-page .matrix-history,
  body.theme-light.project-page .matrix-history {
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .project-page .history-chip,
  body.theme-light.project-page .history-chip {
    min-width: 34px;
    min-height: 30px;
    border-radius: 9px;
    font-size: 14px;
  }
}

/* Theme switch geometry lock: colors change, layout stays put */
:root {
  --theme-transition-speed: 560ms;
  --theme-transition-ease: cubic-bezier(.16, 1, .3, 1);
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after,
body.theme-switching *,
body.theme-switching *::before,
body.theme-switching *::after {
  transition:
    background-color var(--theme-transition-speed) var(--theme-transition-ease),
    background var(--theme-transition-speed) var(--theme-transition-ease),
    border-color var(--theme-transition-speed) var(--theme-transition-ease),
    color var(--theme-transition-speed) var(--theme-transition-ease),
    box-shadow var(--theme-transition-speed) var(--theme-transition-ease),
    opacity var(--theme-transition-speed) var(--theme-transition-ease),
    fill var(--theme-transition-speed) var(--theme-transition-ease),
    stroke var(--theme-transition-speed) var(--theme-transition-ease) !important;
}

body.home-page,
body.theme-light.home-page,
body.project-page,
body.theme-light.project-page {
  min-width: 0;
}

body.home-page header,
body.theme-light.home-page header,
body.project-page header,
body.theme-light.project-page header {
  margin: 8px 8px 24px;
  padding: 0;
  border-radius: 12px;
}

body.home-page > .container,
body.theme-light.home-page > .container {
  width: min(100% - 32px, 1440px);
  max-width: 1440px;
  padding: 0;
}

body.project-page > .container,
body.theme-light.project-page > .container {
  width: calc(100vw - 40px);
  max-width: none;
  padding: 0;
}

body.home-page header .container,
body.theme-light.home-page header .container,
body.project-page header .container,
body.theme-light.project-page header .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 22px;
}

body.theme-switching::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  pointer-events: none;
  background: rgba(255,255,255,0.035);
  animation: themeVeil 620ms var(--theme-transition-ease) both;
}

body.home-page .header-content,
body.theme-light.home-page .header-content,
body.project-page .header-content,
body.theme-light.project-page .header-content {
  min-height: 136px;
  grid-template-columns: minmax(380px, 1fr) minmax(620px, 780px);
  gap: 24px;
  align-items: center;
}

body.home-page .account-console,
body.theme-light.home-page .account-console,
body.project-page .account-console,
body.theme-light.project-page .account-console {
  width: min(100%, 780px);
  justify-self: end;
}

body.home-page .account-console-top,
body.theme-light.home-page .account-console-top,
body.project-page .account-console-top,
body.theme-light.project-page .account-console-top {
  min-height: 74px;
  grid-template-columns: 98px minmax(160px, 1fr) minmax(260px, 1.2fr) 64px;
  gap: 16px;
  padding: 12px 16px;
}

body.home-page .account-console.no-settings .account-console-top,
body.theme-light.home-page .account-console.no-settings .account-console-top,
body.project-page .account-console.no-settings .account-console-top,
body.theme-light.project-page .account-console.no-settings .account-console-top {
  grid-template-columns: 98px minmax(160px, 1fr) minmax(260px, 1.2fr);
}

body.home-page .account-console-actions,
body.theme-light.home-page .account-console-actions,
body.project-page .account-console-actions,
body.theme-light.project-page .account-console-actions {
  grid-template-columns: minmax(136px, 1fr) minmax(150px, 1.15fr) minmax(210px, 1.55fr) minmax(112px, .85fr);
  gap: 12px;
}

body.home-page .logo,
body.theme-light.home-page .logo,
body.project-page .logo,
body.theme-light.project-page .logo {
  font-size: 28px;
  gap: 14px;
}

body.home-page .logo i,
body.theme-light.home-page .logo i,
body.project-page .logo i,
body.theme-light.project-page .logo i {
  font-size: 34px;
}

body.home-page .app-badge,
body.theme-light.home-page .app-badge,
body.project-page .app-badge,
body.theme-light.project-page .app-badge {
  height: 31px;
  padding: 0 11px;
  border-radius: 8px;
  font-size: 16px;
}

body.home-page .home-stats,
body.theme-light.home-page .home-stats {
  gap: 10px;
}

body.home-page .summary-item,
body.theme-light.home-page .summary-item,
body.project-page .summary-item,
body.theme-light.project-page .summary-item {
  min-height: 70px;
  padding: 14px;
}

body.home-page .summary-item b,
body.theme-light.home-page .summary-item b,
body.project-page .summary-item b,
body.theme-light.project-page .summary-item b {
  font-size: 22px;
  line-height: 1.1;
}

body.home-page .home-project-toolbar,
body.theme-light.home-page .home-project-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px 190px;
  gap: 12px;
}

body.home-page .project-table,
body.theme-light.home-page .project-table {
  min-width: 1120px;
  table-layout: fixed;
}

body.home-page .project-table th:nth-child(1),
body.home-page .project-table td:nth-child(1),
body.theme-light.home-page .project-table th:nth-child(1),
body.theme-light.home-page .project-table td:nth-child(1) { width: 56px; }
body.home-page .project-table th:nth-child(2),
body.home-page .project-table td:nth-child(2),
body.theme-light.home-page .project-table th:nth-child(2),
body.theme-light.home-page .project-table td:nth-child(2) { width: 270px; }
body.home-page .project-table th:nth-child(3),
body.home-page .project-table td:nth-child(3),
body.theme-light.home-page .project-table th:nth-child(3),
body.theme-light.home-page .project-table td:nth-child(3) { width: 220px; }
body.home-page .project-table th:nth-child(4),
body.home-page .project-table td:nth-child(4),
body.theme-light.home-page .project-table th:nth-child(4),
body.theme-light.home-page .project-table td:nth-child(4) { width: 95px; text-align: center; }
body.home-page .project-table th:nth-child(5),
body.home-page .project-table td:nth-child(5),
body.theme-light.home-page .project-table th:nth-child(5),
body.theme-light.home-page .project-table td:nth-child(5) { width: 140px; text-align: center; }
body.home-page .project-table th:nth-child(6),
body.home-page .project-table td:nth-child(6),
body.theme-light.home-page .project-table th:nth-child(6),
body.theme-light.home-page .project-table td:nth-child(6) { width: 135px; text-align: center; }
body.home-page .project-table th:nth-child(7),
body.home-page .project-table td:nth-child(7),
body.theme-light.home-page .project-table th:nth-child(7),
body.theme-light.home-page .project-table td:nth-child(7) { width: 155px; text-align: center; }
body.home-page .project-table th:nth-child(8),
body.home-page .project-table td:nth-child(8),
body.theme-light.home-page .project-table th:nth-child(8),
body.theme-light.home-page .project-table td:nth-child(8) { width: 150px; }

body.project-page .matrix-table,
body.theme-light.project-page .matrix-table {
  min-width: 1120px;
  table-layout: fixed;
}

body.project-page .matrix-table th:nth-child(1),
body.project-page .matrix-table td:nth-child(1),
body.theme-light.project-page .matrix-table th:nth-child(1),
body.theme-light.project-page .matrix-table td:nth-child(1) { width: 116px; }
body.project-page .matrix-table th:nth-child(2),
body.project-page .matrix-table td:nth-child(2),
body.theme-light.project-page .matrix-table th:nth-child(2),
body.theme-light.project-page .matrix-table td:nth-child(2) { width: 150px; }
body.project-page .matrix-table th:nth-child(3),
body.project-page .matrix-table td:nth-child(3),
body.theme-light.project-page .matrix-table th:nth-child(3),
body.theme-light.project-page .matrix-table td:nth-child(3) { width: 96px; }
body.project-page .matrix-table th:nth-child(4),
body.project-page .matrix-table td:nth-child(4),
body.theme-light.project-page .matrix-table th:nth-child(4),
body.theme-light.project-page .matrix-table td:nth-child(4) { width: 110px; text-align: center; }
body.project-page .matrix-table th:nth-child(5),
body.project-page .matrix-table td:nth-child(5),
body.theme-light.project-page .matrix-table th:nth-child(5),
body.theme-light.project-page .matrix-table td:nth-child(5) { width: 330px; }
body.project-page .matrix-table th:nth-child(6),
body.project-page .matrix-table td:nth-child(6),
body.theme-light.project-page .matrix-table th:nth-child(6),
body.theme-light.project-page .matrix-table td:nth-child(6) { width: 210px; }
body.project-page .matrix-table th:nth-child(7),
body.project-page .matrix-table td:nth-child(7),
body.theme-light.project-page .matrix-table th:nth-child(7),
body.theme-light.project-page .matrix-table td:nth-child(7) { width: 110px; text-align: center; }

@media (max-width: 1100px) {
  body.home-page .header-content,
  body.theme-light.home-page .header-content,
  body.project-page .header-content,
  body.theme-light.project-page .header-content {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  body.home-page .account-console,
  body.theme-light.home-page .account-console,
  body.project-page .account-console,
  body.theme-light.project-page .account-console {
    justify-self: stretch;
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 900px) {
  body.project-page .matrix-table,
  body.theme-light.project-page .matrix-table {
    min-width: 0 !important;
    table-layout: auto;
  }
}

@media (max-width: 760px) {
  body.home-page .header-content,
  body.theme-light.home-page .header-content,
  body.project-page .header-content,
  body.theme-light.project-page .header-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 0;
  }

  body.home-page .logo,
  body.theme-light.home-page .logo,
  body.project-page .logo,
  body.theme-light.project-page .logo {
    font-size: 20px;
    gap: 8px;
  }

  body.home-page .logo i,
  body.theme-light.home-page .logo i,
  body.project-page .logo i,
  body.theme-light.project-page .logo i {
    font-size: 24px;
  }

  body.home-page .account-console-top,
  body.theme-light.home-page .account-console-top,
  body.project-page .account-console-top,
  body.theme-light.project-page .account-console-top {
    grid-template-columns: 68px minmax(0, 1fr) 44px;
    gap: 10px;
    padding: 10px;
  }

  body.home-page .account-console.no-settings .account-console-top,
  body.theme-light.home-page .account-console.no-settings .account-console-top,
  body.project-page .account-console.no-settings .account-console-top,
  body.theme-light.project-page .account-console.no-settings .account-console-top {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  body.home-page .account-console-actions,
  body.theme-light.home-page .account-console-actions,
  body.project-page .account-console-actions,
  body.theme-light.project-page .account-console-actions {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  body.home-page .home-project-toolbar,
  body.theme-light.home-page .home-project-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.home-page .project-table,
  body.theme-light.home-page .project-table {
    min-width: 0;
  }
}
