@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@200;300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
    --bg: #151a22;
    --sidebar: #111720;
    --panel: #202734;
    --panel-2: #252d3a;
    --panel-3: #1b222e;
    --line: #303949;
    --line-soft: #283241;
    --ink: #f1f5fb;
    --muted: #9ba6b6;
    --muted-2: #6f7b8d;
    --blue: #1699e8;
    --blue-2: #0f78bd;
    --green: #65c86f;
    --amber: #f2aa28;
    --red: #ef5350;
    --olive: #b7c84a;
    --shadow: 0 18px 40px rgba(0, 0, 0, .24);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--bg);
    font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-weight: 200;
    letter-spacing: 0;
}

h1,
h2,
h3,
.brand,
.quick-tabs,
.thead,
button,
.kpi-grid strong {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
    font-weight: 400;
}

h1,
h2,
p {
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    padding: 14px 12px;
    background: var(--sidebar);
    border-right: 1px solid #202938;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: width .18s ease;
    z-index: 10;
}

.brand {
    display: grid;
    grid-template-columns: 32px 1fr 28px;
    align-items: center;
    gap: 9px;
    min-height: 34px;
}

.brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #6b8237;
    color: #fff;
    font-size: 13px;
}

.brand-name {
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-toggle {
    width: 28px;
    height: 28px;
    min-height: 28px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel-3);
    color: var(--muted);
}

.project-list {
    display: grid;
    gap: 4px;
}

.project-switcher {
    position: relative;
}

.project-switcher summary {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 50px;
    padding: 9px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #161d28;
    cursor: pointer;
    list-style: none;
}

.project-switcher summary::-webkit-details-marker {
    display: none;
}

.project-switcher summary strong,
.project-switcher summary small {
    grid-column: 2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-switcher summary strong {
    font-size: 13px;
    font-weight: 600;
}

.project-switcher summary small {
    color: var(--muted-2);
    font-size: 11px;
}

.project-menu {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #151d27;
    box-shadow: var(--shadow);
}

.project-menu a {
    display: grid;
    gap: 2px;
    padding: 8px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
}

.project-menu a.active,
.project-menu a:hover {
    background: #1d2633;
    color: var(--ink);
}

.project-menu a strong,
.project-menu a small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-menu form {
    display: grid;
    gap: 7px;
    padding-top: 8px;
    border-top: 1px solid var(--line-soft);
}

.nav-label {
    padding: 0 8px 4px;
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
}

.project-list a {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 8px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
}

.project-list a.active,
.project-list a:hover {
    background: #1d2633;
    color: var(--ink);
}

.project-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--blue);
}

.project-list strong,
.project-list small {
    grid-column: 2;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-list strong {
    font-size: 13px;
    font-weight: 500;
}

.project-list small {
    color: var(--muted-2);
    font-size: 11px;
}

.side-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.side-menu {
    display: grid;
    gap: 4px;
    padding-top: 4px;
}

.side-menu a {
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 5px 8px;
    border-radius: 7px;
    color: var(--muted);
    text-decoration: none;
}

.side-menu a:hover,
.side-menu a.active {
    background: #1d2633;
    color: var(--ink);
}

.side-menu span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--blue);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 10px;
}

.side-menu strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
}

.side-metrics div {
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    background: #161d28;
}

.side-metrics span,
.side-metrics small {
    display: block;
}

.side-metrics span {
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 16px;
}

.side-metrics small {
    color: var(--muted-2);
    font-size: 10px;
}

.compact-form,
.stack-form {
    display: grid;
    gap: 7px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 9px;
    background: #1c2430;
    color: var(--ink);
    outline: none;
    resize: vertical;
}

input::placeholder {
    color: #697587;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 2px rgba(22, 153, 232, .14);
}

button {
    min-height: 34px;
    border: 1px solid var(--blue-2);
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
    font-size: 12px;
}

button:disabled {
    cursor: not-allowed;
    border-color: #465164;
    background: #3a4453;
    color: #8793a5;
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.shell {
    margin-left: 248px;
    padding: 10px 32px 0;
    transition: margin-left .18s ease;
}

.topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    min-height: 58px;
    border-bottom: 1px solid #202938;
}

.eyebrow {
    color: var(--muted);
    font-size: 13px;
}

.eyebrow strong {
    color: var(--ink);
    font-size: 19px;
    font-weight: 700;
}

h1 {
    display: none;
}

.project-meta {
    display: flex;
    gap: 10px;
    margin-top: 5px;
    color: var(--ink);
    font-size: 12px;
}

.project-meta span {
    color: var(--ink);
}

.project-meta span:first-child::before {
    content: "...";
    margin-right: 8px;
    color: var(--blue);
    font-weight: 800;
}

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

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #1b2330;
    color: var(--muted);
    font-size: 11px;
}

.status-pill span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-pill.ok span {
    background: var(--green);
}

.status-pill.warn span {
    background: var(--amber);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-pill b {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #71853d;
    font-family: "Plus Jakarta Sans", sans-serif;
}

.user-pill span,
.user-pill small {
    display: block;
}

.user-pill span {
    color: var(--ink);
    font-size: 12px;
}

.user-pill small {
    color: var(--muted);
    font-size: 11px;
}

.user-pill a {
    color: var(--muted);
    text-decoration: none;
}

.user-pill a:hover {
    color: #8bd3ff;
}

.quick-tabs {
    display: flex;
    gap: 22px;
    min-height: 52px;
    align-items: end;
    border-bottom: 1px solid #202938;
}

.quick-tabs a {
    position: relative;
    padding: 0 0 13px;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.quick-tabs a.active,
.quick-tabs a:hover {
    color: var(--blue);
}

.quick-tabs a.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--blue);
}

.action-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 48px;
    padding: 8px 0;
    border-bottom: 1px solid #202938;
}

.action-menu {
    position: relative;
}

.action-menu summary,
.toolbar-form button,
.toolbar-number {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #1b2430;
    color: var(--ink);
    font-size: 12px;
    list-style: none;
    cursor: pointer;
}

.toolbar-number {
    padding: 0 4px 0 9px;
    cursor: default;
}

.toolbar-number span {
    color: var(--muted);
    font-size: 11px;
}

.action-menu summary::-webkit-details-marker {
    display: none;
}

.action-menu summary i,
.toolbar-form button i,
.side-menu i {
    color: var(--blue);
}

.action-menu[open] summary,
.action-menu summary:hover,
.toolbar-form button:hover {
    border-color: var(--blue-2);
    background: #1e2b3c;
}

.action-menu form {
    position: absolute;
    z-index: 20;
    top: calc(100% + 8px);
    left: 0;
    width: 340px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.action-menu.align-right form {
    right: 0;
    left: auto;
}

.toolbar-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    margin: 0;
}

.toolbar-number input {
    width: 46px;
    min-height: 24px;
    padding: 0 4px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    text-align: center;
}

.search-strip {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    height: 34px;
    margin: 20px 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #1d2531;
    overflow: hidden;
}

.search-strip label {
    display: grid;
    grid-template-columns: 70px 1fr;
    align-items: center;
    height: 100%;
    color: var(--muted);
    font-size: 12px;
}

.search-strip label span {
    padding-left: 11px;
}

.search-strip input {
    min-height: 32px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.filter-button {
    min-height: 32px;
    padding: 0 16px;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    text-transform: uppercase;
}

.filters-panel {
    display: grid;
    grid-template-columns: 170px 170px 170px auto;
    gap: 10px;
    align-items: end;
    margin: -10px 0 20px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-3);
}

.filters-panel[hidden] {
    display: none;
}

.filters-panel label {
    display: grid;
    gap: 5px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    min-height: 146px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    overflow: hidden;
}

.kpi-grid article {
    position: relative;
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 20px 18px;
    border-right: 1px solid var(--line-soft);
}

.kpi-grid article:last-child {
    border-right: 0;
}

.kpi-grid small,
.kpi-grid span,
.panel-title p,
.keyword-row small,
label,
.note p {
    color: var(--muted);
    font-size: 11px;
}

.kpi-grid strong {
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
}

.kpi-grid article::after {
    content: "";
    position: absolute;
    right: 18px;
    bottom: 25px;
    left: 18px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--blue), #2aaee8);
    box-shadow: 0 0 12px rgba(22, 153, 232, .45);
}

.flash {
    margin-bottom: 14px;
    padding: 9px 11px;
    border: 1px solid rgba(22, 153, 232, .45);
    border-radius: 7px;
    background: rgba(22, 153, 232, .08);
    color: #8bd3ff;
    font-size: 12px;
}

.warning-flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-color: rgba(242, 170, 40, .5);
    background: rgba(242, 170, 40, .08);
    color: #ffd68a;
}

.warning-flash form {
    margin: 0;
}

.warning-flash button {
    min-height: 28px;
    padding: 0 10px;
    border-color: #7d5f22;
    background: #5b431d;
}

.insight-grid {
    display: none;
}

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

.table-panel {
    overflow: hidden;
}

.panel-title {
    display: grid;
    gap: 3px;
    margin-bottom: 10px;
}

.row-title {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 64px;
    padding: 16px;
    margin: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
}

.row-title h2 {
    font-size: 13px;
}

.row-title p {
    display: none;
}

.table-tools {
    display: flex;
    justify-content: end;
    gap: 7px;
}

.tool-chip {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #1b2430;
    color: var(--muted);
}

.tool-chip.active {
    border-color: var(--blue-2);
    background: var(--blue);
    color: #fff;
}

.filter-input {
    display: none;
}

.keyword-table {
    display: grid;
}

.thead,
.keyword-row {
    display: grid;
    grid-template-columns: 32px minmax(170px, 1.35fr) 46px 68px 150px 58px 100px 100px 78px 80px 64px minmax(120px, .9fr);
    align-items: center;
}

.thead {
    min-height: 41px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: #252d3a;
    color: var(--muted);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 11px;
}

.thead button {
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
}

.thead button:hover,
.thead button.active {
    color: var(--blue);
}

.thead button.active::after {
    content: " ↓";
    color: var(--blue);
}

.thead button.active[data-direction="asc"]::after {
    content: " ↑";
}

.keyword-row {
    position: relative;
    min-height: 49px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--panel);
    color: var(--ink);
    font-size: 13px;
    overflow: hidden;
}

.keyword-row:hover {
    background: #242d3b;
}

.keyword-row.selected {
    background: #243247;
}

.row-check input {
    width: 16px;
    height: 16px;
    min-height: 16px;
    padding: 0;
    border-color: #526071;
    background: transparent;
}

.keyword-row strong,
.keyword-link {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.keyword-link:hover {
    color: #8bd3ff;
}

.keyword-row small {
    display: block;
    margin-top: 2px;
}

.tag {
    display: inline-flex;
    margin-right: 5px;
    padding: 1px 5px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
}

.se-mark,
.device-mark {
    color: var(--muted);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 14px;
}

.location-cell {
    overflow: hidden;
    color: var(--ink);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank b {
    color: #fff;
    font-size: 14px;
    font-weight: 400;
}

.trend {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.trend.up {
    color: var(--green);
}

.trend.down {
    color: var(--red);
}

.difficulty {
    display: inline-grid;
    place-items: center;
    min-width: 37px;
    height: 25px;
    border-radius: 4px;
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 12px;
    font-weight: 700;
}

.difficulty.easy {
    background: #8db845;
}

.difficulty.mid {
    background: var(--olive);
}

.difficulty.hard {
    background: var(--amber);
}

.difficulty.muted {
    background: #475364;
}

.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.row-actions form {
    margin: 0;
}

.row-actions button {
    min-height: 25px;
    padding: 0 9px;
    font-size: 11px;
}

.ghost-danger {
    border-color: #5a3440;
    background: #382530;
    color: #ff9fab;
}

.row-actions span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-meter {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    opacity: .75;
}

.row-meter i {
    display: block;
    width: var(--score);
    height: 100%;
    background: var(--blue);
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 14px 0 28px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 28px;
}

.research-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    margin-top: 16px;
    padding: 16px;
}

.research-actions,
.research-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.research-search input {
    width: 280px;
}

.compact-kpis {
    min-height: 112px;
    margin-top: 14px;
}

.compact-kpis article {
    padding: 14px 16px 30px;
}

.compact-kpis article::after {
    bottom: 12px;
}

.research-filters {
    display: grid;
    grid-template-columns: 1fr 150px 120px 120px 82px;
    gap: 8px;
    align-items: end;
    margin: 14px 0;
}

.research-filters label {
    display: grid;
    gap: 4px;
}

.research-table-panel {
    overflow: hidden;
}

.research-table {
    display: grid;
}

.research-head,
.research-row {
    display: grid;
    grid-template-columns: 28px minmax(220px, 1.7fr) 90px 70px 70px 74px 110px 90px 86px minmax(150px, 1fr) 78px;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
}

.research-head {
    min-height: 40px;
    border-bottom: 1px solid var(--line);
    background: #252d3a;
    color: var(--muted);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 11px;
}

.research-head button {
    min-height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    font: inherit;
}

.research-head button:hover,
.research-head button.active {
    color: var(--blue);
}

.research-head button.active::after {
    content: " ↓";
}

.research-head button.active[data-direction="asc"]::after {
    content: " ↑";
}

.research-row {
    min-height: 52px;
    border-bottom: 1px solid var(--line-soft);
    background: var(--panel);
    font-size: 13px;
}

.research-row:hover {
    background: #242d3b;
}

.research-row strong,
.research-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.research-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.feature-pills {
    display: flex;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}

.feature-pills span {
    padding: 2px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.mini-trendline {
    display: block;
    width: 72px;
    height: 24px;
}

.mini-trendline svg {
    width: 100%;
    height: 100%;
    display: block;
}

.research-row form {
    margin: 0;
}

.research-row button {
    min-height: 27px;
    padding: 0 8px;
}

.research-bulk-form {
    display: flex;
    gap: 6px;
    justify-content: end;
    margin: 0;
}

.research-bulk-form select {
    width: 130px;
    min-height: 28px;
    padding: 0 7px;
}

.research-bulk-form button {
    min-height: 28px;
    padding: 0 10px;
}

.padded-empty {
    padding: 16px;
}

.ui-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(7, 10, 15, .62);
}

.ui-modal[hidden] {
    display: none;
}

.ui-modal-card {
    width: min(380px, 100%);
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.ui-modal-card h2 {
    margin-bottom: 6px;
    font-size: 15px;
}

.ui-modal-card p {
    color: var(--muted);
    font-size: 12px;
}

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

.ui-modal-actions button {
    padding: 0 12px;
}

.modal-secondary {
    border-color: var(--line);
    background: #1b2430;
    color: var(--muted);
}

.thead button.active::after,
.research-head button.active::after {
    content: " v";
}

.thead button.active[data-direction="asc"]::after,
.research-head button.active[data-direction="asc"]::after {
    content: " ^";
}

.module-panel,
.edit-panel {
    padding: 16px;
}

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

.two-cols {
    grid-template-columns: 1fr 1fr;
}

.wide-inline {
    grid-template-columns: 1fr 90px;
}

.module-list {
    max-height: none;
}

.large-stack {
    margin-bottom: 12px;
}

.danger-form {
    margin-top: 12px;
}

.mini-link {
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #1b2430;
    color: var(--muted);
    font-size: 11px;
    text-decoration: none;
}

.mini-link:hover {
    color: #fff;
    border-color: var(--blue-2);
}

.settings-card {
    padding: 16px;
}

.settings-form {
    display: grid;
    gap: 10px;
}

.settings-form label {
    display: grid;
    gap: 5px;
}

.action-panel {
    display: none;
    padding: 14px;
}

.competitor-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.competitor-stack form {
    margin: 0;
}

.competitor-stack button {
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #1b2430;
    color: var(--muted);
    font-size: 11px;
    min-height: 27px;
}

.inline-form {
    display: grid;
    grid-template-columns: 1fr 54px;
    gap: 6px;
    margin-top: 8px;
}

.opportunity-list {
    display: grid;
    gap: 7px;
}

.opportunity-list article,
.idea-list article {
    display: grid;
    grid-template-columns: 1fr 34px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    background: #1b2430;
}

.idea-list article {
    grid-template-columns: 1fr 45px;
}

.opportunity-list strong,
.opportunity-list small,
.idea-list strong,
.idea-list small {
    display: block;
}

.opportunity-list strong,
.idea-list strong {
    font-size: 12px;
    font-weight: 500;
}

.opportunity-list small,
.idea-list small,
.empty-state {
    color: var(--muted);
    font-size: 11px;
}

.opportunity-list span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: var(--blue);
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 12px;
}

.idea-list {
    display: grid;
    gap: 7px;
    margin-top: 9px;
    max-height: 330px;
    overflow: auto;
}

.idea-list form {
    margin: 0;
}

.idea-list button {
    min-height: 27px;
    padding: 0 8px;
}

.discover-actions {
    display: grid;
    gap: 8px;
}

.side-divider {
    height: 1px;
    margin: 14px 0;
    background: var(--line);
}

.stack-form label {
    display: grid;
    gap: 4px;
}

.note {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.detail-card {
    display: grid;
    gap: 10px;
}

.detail-score {
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 10px;
}

.detail-score strong {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 8px;
    background: #1b2430;
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 24px;
}

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

.mini-history {
    height: 70px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    background: #1b2430;
    overflow: hidden;
}

.mini-history svg {
    width: 100%;
    height: 100%;
    display: block;
}

.detail-card dl {
    display: grid;
    gap: 7px;
    margin: 0;
}

.detail-card dl div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
}

.detail-card dt,
.detail-card dd {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.detail-card dt {
    color: var(--muted);
}

.detail-card dd {
    color: var(--ink);
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(420px, 100%);
}

.login-card {
    padding: 20px;
}

.login-brand {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.login-brand h1 {
    display: block;
    color: var(--ink);
    font-size: 20px;
    font-weight: 400;
}

.login-card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stack-form label.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
    grid-template-columns: auto 1fr;
}

.stack-form label.check-line input {
    width: 15px;
    height: 15px;
    min-height: 15px;
}

body.sidebar-collapsed .sidebar {
    width: 68px;
}

body.sidebar-collapsed .shell {
    margin-left: 68px;
}

body.sidebar-collapsed .brand {
    grid-template-columns: 32px;
}

body.sidebar-collapsed .brand-name,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .project-list strong,
body.sidebar-collapsed .project-list small,
body.sidebar-collapsed .side-metrics,
body.sidebar-collapsed .compact-form,
body.sidebar-collapsed .project-switcher summary strong,
body.sidebar-collapsed .project-switcher summary small,
body.sidebar-collapsed .project-menu,
body.sidebar-collapsed .side-menu strong {
    display: none;
}

body.sidebar-collapsed .project-list a {
    grid-template-columns: 1fr;
    justify-items: center;
}

body.sidebar-collapsed .project-switcher summary {
    grid-template-columns: 1fr;
    justify-items: center;
}

body.sidebar-collapsed .side-menu a {
    grid-template-columns: 1fr;
    justify-items: center;
}

body.sidebar-collapsed .project-dot {
    grid-column: auto;
}

body.sidebar-collapsed .brand {
    justify-content: center;
    justify-items: center;
    gap: 8px;
}

body.sidebar-collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

@media (max-width: 1180px) {
    .workspace {
        grid-template-columns: 1fr;
    }

    .action-panel {
        display: none;
    }
}

@media (max-width: 980px) {
    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
    }

    .shell,
    body.sidebar-collapsed .shell {
        margin-left: 0;
        padding: 10px 12px;
    }

    .topbar,
    .kpi-grid,
    .settings-grid,
    .module-grid,
    .two-cols,
    .research-hero,
    .research-filters {
        grid-template-columns: 1fr;
    }

    .research-actions,
    .research-search {
        align-items: stretch;
        flex-direction: column;
    }

    .research-search input {
        width: 100%;
    }

    .action-toolbar {
        align-items: stretch;
    }

    .action-menu form {
        position: fixed;
        right: 12px;
        left: 12px;
        width: auto;
    }

    .action-menu.align-right form {
        right: 12px;
        left: 12px;
    }

    .toolbar-form {
        width: 100%;
    }

    .toolbar-form button {
        flex: 1;
        justify-content: center;
    }

    .top-actions,
    .side-metrics,
    .compact-form {
        display: none;
    }

    .quick-tabs {
        overflow-x: auto;
    }

    .filters-panel {
        grid-template-columns: 1fr;
    }

    .keyword-table {
        overflow-x: auto;
    }

    .research-table {
        overflow-x: auto;
    }

    .thead,
    .keyword-row,
    .research-head,
    .research-row {
        min-width: 980px;
    }
}
