:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #667085;
    --line: #e4e9f2;
    --accent: #0499e5;
    --accent-soft: #eaf3ff;
    --warn: #d92d20;
    --good: #079455;
    --shadow: 0 18px 45px rgba(17, 24, 39, 0.07);
}

@font-face {
    font-family: "Manrope";
    src: url("/assets/fonts/Manrope-Variable.woff2") format("woff2");
    font-weight: 200 700;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: "Manrope", "Segoe UI", Arial, sans-serif;
    font-size: 15px;
}

a {
    color: var(--accent);
    text-decoration: none;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: 28px;
    line-height: 1.15;
}

h2 {
    font-size: 18px;
}

button,
input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--text);
    font: inherit;
}

input,
select,
textarea {
    margin-top: 8px;
    padding: 12px 13px;
    background: #fff;
}

textarea {
    resize: vertical;
    min-height: 118px;
    font-family: Consolas, Menlo, monospace;
    font-size: 13px;
}

button {
    border: 0;
    padding: 13px 16px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

button:hover {
    filter: brightness(0.96);
}

label {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

th,
td {
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

th:not(:first-child),
td:not(:first-child) {
    width: 104px;
    white-space: nowrap;
}

.muted,
.topbar span {
    color: var(--muted);
}

.truncate-cell {
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 0 16px 20px;
    border-right: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 220px;
    min-height: 78px;
    margin: 0 12px 28px;
    color: var(--text);
}

.topbar .brand {
    margin: 0;
}

.app-logo {
    display: block;
    object-fit: contain;
    object-position: left center;
}

.topbar-brand {
    gap: 18px;
}

.brand-logo {
    width: 200px;
    height: 52px;
    flex: 0 0 auto;
}

.auth-logo {
    width: 260px;
    height: 61px;
    margin-bottom: 18px;
}

.main-nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 12px;
    color: #344054;
    font-weight: 700;
}

.nav-item span {
    display: grid;
    place-items: center;
    width: 22px;
    color: #667085;
}

.nav-icon {
    flex: 0 0 22px;
    height: 22px;
    background: currentColor;
    mask: var(--nav-icon) center / 22px 22px no-repeat;
    -webkit-mask: var(--nav-icon) center / 22px 22px no-repeat;
}

.nav-icon.all-sites {
    --nav-icon: url("/assets/icons/all-sites.svg");
}

.nav-icon.overview {
    --nav-icon: url("/assets/icons/overview.svg");
}

.nav-icon.pages {
    --nav-icon: url("/assets/icons/pages.svg");
}

.nav-icon.sources {
    --nav-icon: url("/assets/icons/sources.svg");
}

.nav-icon.settings {
    --nav-icon: url("/assets/icons/settings.svg");
}

.nav-icon.logout {
    --nav-icon: url("/assets/icons/logout.svg");
}

.nav-item.active,
.nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-item.active span,
.nav-item:hover span {
    color: var(--accent);
}

.sidebar-meta {
    display: grid;
    gap: 3px;
    margin-top: auto;
    padding: 0 0 16px;
    color: #344054;
}

.sidebar-all-sites {
    margin-bottom: 18px;
    border: 1px solid var(--line);
}

.sidebar-meta strong {
    padding: 0 16px;
    font-size: 14px;
    line-height: 1.25;
}

.sidebar-meta span {
    padding: 0 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.workspace {
    min-width: 0;
    overflow-x: hidden;
}

.project-topbar,
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 78px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(16px);
}

.project-title,
.topbar div {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.topbar .topbar-brand {
    align-items: center;
    gap: 18px;
}

.topbar-brand span {
    line-height: 1.2;
}

.project-heading {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.project-heading-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-wrap: wrap;
}

.project-heading-main strong {
    font-size: 20px;
    line-height: 1.2;
}

.project-domain {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.2;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.secondary-link,
.soft-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #344054;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
    gap: 18px;
    width: auto;
    margin: 20px 24px 36px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 570px);
    gap: 30px;
    width: calc(100% - 56px);
    margin: 24px auto;
}

.panel,
.auth-box {
    min-width: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.span-2 {
    grid-column: 1 / -1;
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
    gap: 18px;
    align-items: start;
}

.settings-column {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.section-title,
.snippet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-title h1,
.snippet-header h2 {
    margin: 0;
}

.section-title h1 span {
    color: var(--muted);
    font-size: 18px;
    font-weight: 500;
}

.section-title>span {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
}

.stack,
.settings-form,
.cron-fields {
    display: grid;
    gap: 14px;
}

.site-list {
    display: grid;
    gap: 12px;
}

.site-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.site-row:hover {
    border-color: rgba(4, 153, 229, 0.45);
}

.site-row strong,
.site-row small {
    display: block;
}

.site-main,
.site-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.site-main>span {
    min-width: 0;
}

.site-favicon {
    width: 16px;
    height: 16px;
    background: #fff;
    object-fit: contain;
    flex: 0 0 auto;
}

.site-row small {
    margin-top: 4px;
    color: var(--muted);
}

.site-main .status-pill {
    margin-left: 14px;
}

.stats-mini {
    display: grid;
    justify-items: end;
    gap: 4px;
    color: var(--muted);
    white-space: nowrap;
}

.stats-mini-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.stats-mini-values {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-mini b {
    color: var(--text);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.metrics div {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(180deg, #fff, #f9fbff);
}

.metrics strong {
    display: block;
    margin-bottom: 6px;
    font-size: 30px;
}

.metrics span {
    color: var(--muted);
}

.pages-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.pages-main,
.top-pages {
    min-width: 0;
}

.pages-main h2,
.top-pages h2 {
    margin-bottom: 14px;
}

.pages-subtitle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.pages-subtitle h2 {
    margin-bottom: 0;
}

.pages-subtitle span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.pages-list-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.per-page-form {
    margin: 0;
}

.per-page-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.per-page-form select {
    width: auto;
    min-width: 88px;
    margin-top: 0;
    padding: 8px 34px 8px 12px;
    color: #344054;
    font-weight: 700;
    cursor: pointer;
}

.page-list,
.top-page-list {
    display: grid;
    gap: 10px;
}

.page-card {
    display: grid;
    gap: 8px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfcff;
    color: var(--text);
}

.page-card:hover,
.top-page-item:hover {
    border-color: rgba(4, 153, 229, 0.45);
    background: var(--accent-soft);
}

.page-path,
.top-page-path {
    overflow: hidden;
    color: var(--text);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-url {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-metrics {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.page-metrics b {
    color: var(--text);
}

.page-last {
    color: var(--muted);
    font-size: 12px;
}

.top-page-item {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
}

.top-page-rank {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
}

.top-page-content {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.top-page-bar {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #edf2f7;
}

.top-page-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.top-page-count {
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 16px;
}

.pagination a,
.pagination span {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #344054;
    font-weight: 700;
}

.pagination a.active,
.pagination a:hover {
    border-color: rgba(4, 153, 229, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
}

.pagination span {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.pagination span.disabled {
    border-color: var(--line);
    background: #f8fafc;
    color: #b5bfce;
}

.pagination .pagination-current {
    width: auto;
    padding: 0 12px;
    border-color: var(--line);
    background: #fff;
}

.traffic-panel {
    display: grid;
    gap: 18px;
}

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

.traffic-header h2 {
    margin-bottom: 4px;
    font-size: 24px;
    line-height: 1.15;
}

.traffic-header span {
    color: var(--muted);
    font-size: 16px;
    font-weight: 600;
}

.traffic-chart {
    position: relative;
    min-height: 230px;
}

.traffic-chart svg {
    display: block;
    width: 100%;
    height: 190px;
    overflow: visible;
}

.traffic-chart line {
    stroke: var(--line);
    stroke-width: 0.65;
    vector-effect: non-scaling-stroke;
}

.traffic-line {
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.traffic-line.views {
    stroke: #7c4dff;
}

.traffic-line.visitors {
    stroke: #ff3f9a;
    stroke-width: 2.6;
}

.traffic-line.sessions {
    stroke: #18bfa6;
}

.traffic-hover-points {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 190px;
    pointer-events: none;
}

.traffic-hover-point {
    position: absolute;
    top: 0;
    bottom: -34px;
    width: 0;
    border-radius: 0;
    cursor: default;
    transform: translateX(-50%);
}

.traffic-hover-point::before {
    content: "";
    position: absolute;
    top: var(--point-y);
    left: 50%;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #ff3f9a;
    box-shadow: 0 4px 10px rgba(255, 63, 154, 0.28);
    z-index: 1;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.75);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.traffic-hover-point.is-active::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.traffic-tooltip {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 3;
    display: grid;
    gap: 12px;
    width: min(320px, calc(100vw - 48px));
    padding: 16px 18px;
    border-radius: 16px;
    background: #1f2631;
    box-shadow: 0 14px 34px rgba(17, 24, 39, 0.22);
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.traffic-tooltip::after {
    content: "";
    position: absolute;
    bottom: -9px;
    left: 50%;
    width: 18px;
    height: 18px;
    background: #1f2631;
    transform: translateX(-50%) rotate(45deg);
}

.traffic-hover-point.left .traffic-tooltip {
    right: 50%;
    left: auto;
    transform: translateX(0) translateY(-6px);
}

.traffic-hover-point.left .traffic-tooltip::after {
    right: 16px;
    left: auto;
    transform: rotate(45deg);
}

.traffic-hover-point.right .traffic-tooltip {
    left: 50%;
    transform: translateX(0) translateY(-6px);
}

.traffic-hover-point.right .traffic-tooltip::after {
    left: 16px;
    transform: rotate(45deg);
}

.traffic-hover-point.is-active .traffic-tooltip {
    opacity: 1;
}

.traffic-hover-point.center.is-active .traffic-tooltip {
    transform: translateX(-50%) translateY(0);
}

.traffic-hover-point.left.is-active .traffic-tooltip,
.traffic-hover-point.right.is-active .traffic-tooltip {
    transform: translateX(0) translateY(0);
}

.traffic-tooltip-date {
    color: rgba(255, 255, 255, 0.62);
    font-size: 13px;
    font-weight: 800;
}

.traffic-tooltip-row {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 800;
}

.traffic-tooltip-row strong {
    font-size: 15px;
    white-space: nowrap;
}

.traffic-hover-point::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 34px;
    left: 50%;
    width: 1px;
    background: rgba(102, 112, 133, 0.28);
    z-index: 0;
    opacity: 0;
    transform: translateX(-50%);
}

.traffic-hover-point.is-active::after {
    opacity: 1;
}

.traffic-date {
    position: absolute;
    bottom: 0;
    left: 50%;
    z-index: 2;
    padding: 5px 7px;
    border-radius: 6px;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.traffic-hover-point.is-active .traffic-date {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.traffic-axis {
    position: relative;
    height: 20px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}

.traffic-axis span {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    white-space: nowrap;
}

.traffic-axis span:first-child {
    transform: translateX(0);
}

.traffic-axis span:last-child {
    transform: translateX(-100%);
}

.traffic-legend {
    display: grid;
    gap: 12px;
}

.traffic-legend div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    color: var(--text);
    font-weight: 700;
}

.traffic-legend strong {
    font-size: 15px;
    white-space: nowrap;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-dot.views {
    background: #7c4dff;
}

.legend-dot.visitors {
    background: #ff3f9a;
}

.legend-dot.sessions {
    background: #18bfa6;
}

.chart {
    position: relative;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: clamp(16px, 4vw, 72px);
    height: 240px;
    margin-top: 24px;
    padding: 18px 0 4px;
    overflow: auto;
    border-top: 1px solid var(--line);
}

.chart::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 30px;
    left: 0;
    height: 1px;
    background: var(--line);
}

.chart .muted {
    align-self: center;
}

.bar-wrap {
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 8px;
    align-items: end;
    flex: 1 1 0;
    min-width: 46px;
    max-width: 140px;
    height: 100%;
}

.bar {
    position: relative;
    z-index: 1;
    width: 100%;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #44c2f2, var(--accent));
    box-shadow: 0 10px 20px rgba(4, 153, 229, 0.16);
}

.bar-wrap small {
    color: var(--muted);
    text-align: center;
}

.periods {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.period-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.periods a {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: #344054;
    font-weight: 700;
}

.periods a.active {
    border-color: rgba(4, 153, 229, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
}

.period-settings {
    position: relative;
}

.period-settings summary {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: #344054;
    cursor: pointer;
    list-style: none;
}

.period-settings summary::-webkit-details-marker {
    display: none;
}

.period-settings[open] summary,
.period-settings summary:hover {
    border-color: rgba(4, 153, 229, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
}

.custom-period {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr)) auto;
    gap: 10px;
    align-items: end;
    width: min(680px, calc(100vw - 56px));
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.custom-period label {
    color: var(--muted);
    font-size: 13px;
}

.custom-period input {
    margin-top: 6px;
}

.custom-period button {
    min-height: 45px;
    white-space: nowrap;
}

.secondary-button,
.icon-button {
    width: auto;
    border: 1px solid var(--line);
    background: #fff;
    color: #344054;
}

.secondary-button.active,
.secondary-button:hover,
.icon-button:hover {
    border-color: rgba(4, 153, 229, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
}

.danger-button {
    width: auto;
    min-width: 110px;
    border: 1px solid #fecdca;
    background: #fff3f2;
    color: var(--warn);
}

.danger-button:hover {
    background: #fee4e2;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

.icon-button svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

.icon-button.copied {
    border-color: #98d2bb;
    background: #eaf8f2;
    color: var(--good);
}

.availability-card {
    display: grid;
    gap: 10px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fbfcff;
}

.availability-card>div {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.availability-card p {
    margin: 0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f3f6fa;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.status-pill.up {
    border-color: #98d2bb;
    background: #eaf8f2;
    color: var(--good);
}

.status-pill.down {
    border-color: #fecdca;
    background: #fff3f2;
    color: var(--warn);
}

.status-pill.muted-status {
    color: var(--muted);
}

.monitoring-link {
    cursor: pointer;
}

.monitoring-link:focus-visible {
    outline: 3px solid rgba(4, 153, 229, 0.22);
    outline-offset: 3px;
}

.status-error {
    color: var(--warn);
    font-size: 13px;
}

.settings-form {
    margin-top: 16px;
}

.monitoring-settings-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.monitoring-settings-row .field-label {
    flex: 1 1 190px;
}

.monitoring-settings-row .secondary-button {
    flex: 0 0 auto;
    min-height: 47px;
}

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

.favicon-refresh-control {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding-top: 29px;
}

.favicon-refresh-notice {
    max-width: 320px;
    margin: 0;
    font-size: 13px;
    line-height: 1.35;
    transition: opacity .2s ease, transform .2s ease;
}

.favicon-refresh-notice.is-hiding {
    opacity: 0;
    transform: translateY(-4px);
}

.favicon-refresh-notice.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.button-favicon {
    width: 18px;
    height: 18px;
    background: #fff;
    object-fit: contain;
    flex: 0 0 auto;
}

.hidden-form {
    display: none;
}

.inline-form,
.delete-form {
    margin: 0;
}

.project-delete {
    margin-top: 16px;
}

.field-label {
    display: grid;
    gap: 8px;
}

.field-label input {
    margin-top: 0;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}

.toggle-row input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.cron-card {
    display: grid;
    gap: 12px;
}

.cron-card h2,
.cron-card p {
    margin-bottom: 0;
}

.cron-card textarea {
    min-height: 78px;
}

.settings-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.rename-form {
    display: grid;
    gap: 8px;
    margin: 0;
}

.rename-view {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rename-view h1 {
    margin: 0;
}

.edit-name-button {
    width: 42px;
    min-width: 42px;
    justify-content: center;
    padding: 9px;
}

.edit-name-button svg {
    width: 18px;
    height: 18px;
}

.rename-edit {
    display: none;
    grid-template-columns: minmax(220px, 360px) auto;
    gap: 10px;
    align-items: center;
}

.rename-edit input {
    margin: 0;
}

.rename-form.is-editing-name .rename-view {
    display: none;
}

.rename-form.is-editing-name .rename-edit {
    display: grid;
}

.settings-hero p {
    margin-bottom: 6px;
}

.settings-hero h1 {
    margin-bottom: 4px;
}

.settings-hero span {
    color: var(--muted);
}

.alert {
    margin-bottom: 14px;
    padding: 12px 13px;
    border: 1px solid #fecdca;
    border-radius: 12px;
    background: #fff3f2;
    color: var(--warn);
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-box {
    width: min(420px, 100%);
    padding: 28px;
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        padding: 16px;
    }

    .brand {
        width: 220px;
        margin: 0 0 16px;
    }

    .main-nav {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .period-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .nav-item {
        min-width: max-content;
    }

    .sidebar-meta {
        margin-top: 12px;
        padding: 0;
    }

    .project-topbar,
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .dashboard,
    .layout {
        grid-template-columns: 1fr;
    }

    .pages-layout,
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .site-row,
    .section-title,
    .snippet-header,
    .pages-subtitle,
    .settings-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats-mini {
        align-items: flex-start;
        flex-direction: column;
        justify-items: start;
        white-space: normal;
    }

    .stats-mini-values {
        align-items: flex-start;
        flex-direction: column;
    }

    .pages-list-controls,
    .per-page-form,
    .per-page-form label,
    .per-page-form select {
        width: 100%;
    }

    .metrics {
        grid-template-columns: 1fr;
    }

    .custom-period {
        position: static;
        width: 100%;
        margin-top: 10px;
        grid-template-columns: 1fr;
    }

    .delete-form,
    .danger-button,
    .secondary-button,
    .secondary-link {
        width: 100%;
    }

    .chart {
        overflow-x: auto;
    }
}
