:root {
    --geo-bg: #f3f7fc;
    --geo-surface: #ffffff;
    --geo-surface-muted: #f7faff;
    --geo-border: #d8e3f0;
    --geo-border-strong: #c5d5e8;
    --geo-text: #17324d;
    --geo-text-soft: #62748a;
    --geo-primary: #2f6fed;
    --geo-primary-soft: #e8f0ff;
    --geo-success: #1f9d68;
    --geo-warning: #c98318;
    --geo-danger: #d95454;
    --geo-radius-lg: 18px;
    --geo-radius-xl: 26px;
    --geo-shadow-sm: 0 10px 24px rgba(28, 69, 117, 0.07);
    --geo-shadow-md: 0 18px 48px rgba(26, 62, 104, 0.1);
}

body.geo-app-body {
    background:
        radial-gradient(circle at top left, rgba(47, 111, 237, 0.08), transparent 24%),
        linear-gradient(180deg, #f7fbff 0%, var(--geo-bg) 100%);
    color: var(--geo-text);
    font-family: "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.geo-shell-container {
    width: min(1180px, calc(100% - 40px));
}

.geo-main-shell {
    padding-top: 32px;
    padding-bottom: 56px;
}

.site-header,
.site-footer,
.sidebar {
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(216, 227, 240, 0.95);
    backdrop-filter: blur(14px);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 4px 18px rgba(26, 62, 104, 0.04);
}

.geo-site-header-row {
    min-height: 78px;
}

.geo-site-brand h1 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.geo-site-eyebrow {
    margin: 0 0 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--geo-primary);
    font-weight: 700;
}

.geo-header-user-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    color: var(--geo-text-soft);
    font-weight: 600;
}

.sidebar {
    padding: 10px 0 14px;
    box-shadow: inset 0 -1px 0 rgba(216, 227, 240, 0.8);
}

.sidebar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sidebar-nav a,
.sidebar-nav .link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--geo-text);
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav .link-button:hover {
    color: var(--geo-primary);
    background: var(--geo-primary-soft);
    border-color: rgba(47, 111, 237, 0.16);
}

.logout-form {
    margin-left: auto;
}

.panel,
.hero-copy,
.hero-note,
.auth-panel,
.mini-card,
.suggestion-card {
    border-radius: var(--geo-radius-xl);
    border: 1px solid var(--geo-border);
    box-shadow: var(--geo-shadow-sm);
}

.panel {
    padding: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 252, 255, 0.98));
}

.page-head,
.geo-page-head,
.geo-section-head,
.suggestion-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

.geo-page-flow {
    display: grid;
    gap: 22px;
}

.geo-page-hero {
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 255, 0.98)),
        var(--geo-surface);
}

.geo-page-hero h2,
.geo-section-head h3,
.geo-page-head h3 {
    margin: 0;
    font-size: 1.65rem;
    letter-spacing: -0.03em;
}

.geo-page-subtitle,
.geo-section-head .muted-text,
.geo-detail-grid .muted-text,
.geo-feature-card .muted-text,
.muted-text {
    color: var(--geo-text-soft);
    line-height: 1.65;
}

.geo-section-kicker {
    margin: 0 0 10px;
    color: var(--geo-primary);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.geo-inline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.geo-badge,
.scan-detail-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.geo-badge-soft,
.scan-detail-chip,
.geo-inline-meta .geo-badge {
    background: var(--geo-primary-soft);
    color: var(--geo-primary);
    border: 1px solid rgba(47, 111, 237, 0.12);
}

.geo-badge-primary {
    background: rgba(47, 111, 237, 0.12);
    color: var(--geo-primary);
    border: 1px solid rgba(47, 111, 237, 0.18);
}

.geo-inline-link,
.text-button {
    color: var(--geo-primary);
    font-weight: 700;
}

.detail-grid,
.geo-detail-grid,
.card-grid,
.geo-ai-grid,
.geo-action-grid,
.geo-feature-grid {
    display: grid;
    gap: 20px;
}

.geo-detail-grid,
.geo-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.geo-info-card,
.geo-feature-card {
    position: relative;
    overflow: hidden;
}

.geo-info-card::before,
.geo-feature-card::before,
.geo-ai-card::before,
.geo-stat-card::before,
.geo-action-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, rgba(47, 111, 237, 0.95), rgba(104, 160, 255, 0.42));
}

.geo-info-list,
.info-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.geo-info-list p,
.info-list p {
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--geo-surface-muted);
    border: 1px solid rgba(216, 227, 240, 0.72);
    line-height: 1.6;
}

.geo-stat-card,
.geo-action-card,
.geo-weak-card,
.geo-keyword-add-card,
.geo-keyword-list-card {
    padding: 24px;
    background: var(--geo-surface);
}

.geo-stat-label {
    display: block;
    margin-bottom: 8px;
    color: var(--geo-text-soft);
    font-weight: 600;
}

.geo-stat-value {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 14px;
}

.geo-form-stack {
    gap: 16px;
}

.geo-form-stack label,
.field label {
    font-weight: 700;
    color: var(--geo-text);
}

input,
select,
button,
textarea {
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 14px;
    border-color: var(--geo-border-strong);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(47, 111, 237, 0.7);
    box-shadow: 0 0 0 4px rgba(47, 111, 237, 0.12);
    background: #fff;
}

button,
.button-link {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--geo-primary), #4683f3);
    box-shadow: 0 12px 24px rgba(47, 111, 237, 0.2);
    font-weight: 700;
    letter-spacing: -0.01em;
}

button:hover,
.button-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(47, 111, 237, 0.24);
}

.secondary-button-link,
.secondary-button {
    background: #eef4fb;
    color: var(--geo-text);
    box-shadow: none;
    border: 1px solid var(--geo-border);
}

.copy-button {
    width: auto;
    min-width: 112px;
}

.helper-text {
    color: var(--geo-text-soft);
}

.status-box,
.summary-box,
.muted-box,
.flash {
    border-radius: var(--geo-radius-lg);
    border-color: var(--geo-border);
    box-shadow: var(--geo-shadow-sm);
}

.flash {
    padding: 14px 16px;
}

.geo-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.geo-keyword-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 20px;
}

.geo-keyword-form,
.geo-keyword-form-row {
    display: grid;
    gap: 14px;
}

.geo-keyword-form-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.geo-keyword-form-row button {
    min-width: 140px;
}

.geo-keyword-list {
    display: grid;
    gap: 12px;
}

.geo-keyword-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(216, 227, 240, 0.78);
    background: var(--geo-surface-muted);
}

.geo-keyword-chip-copy {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.geo-keyword-chip-copy strong {
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.geo-keyword-chip-action {
    flex: 0 0 auto;
}

.geo-keyword-chip-action .secondary-button {
    min-height: 40px;
    padding: 0 14px;
}

.geo-weak-card h4,
.geo-ai-card h4 {
    margin: 14px 0 8px;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
}

.geo-ai-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.geo-ai-card {
    display: grid;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 250, 255, 0.98));
}

.geo-ai-head {
    align-items: flex-start;
}

.geo-ai-content {
    padding: 18px;
    background: var(--geo-surface-muted);
    border: 1px solid rgba(216, 227, 240, 0.76);
    border-radius: 18px;
}

.copy-block {
    margin: 0;
    white-space: pre-wrap;
    color: var(--geo-text);
    font-family: inherit;
    line-height: 1.7;
}

.geo-ai-meta-block {
    padding-top: 2px;
    border-top: 1px solid rgba(216, 227, 240, 0.72);
}

.geo-ai-meta-block p {
    margin: 12px 0 0;
    line-height: 1.65;
}

.geo-ai-meta-muted {
    color: var(--geo-text-soft);
}

.geo-empty-state {
    margin-top: 20px;
    padding: 24px;
    border-radius: 20px;
    background: var(--geo-surface-muted);
    border: 1px dashed var(--geo-border-strong);
}

.geo-footer-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.geo-footer-row p {
    margin: 0;
}

.geo-footer-meta {
    color: var(--geo-text-soft);
    font-size: 0.92rem;
}

.grid-scan-entry-page .mini-card {
    border-radius: 20px;
}

.grid-scan-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.grid-scan-entry-actions > * {
    flex: 0 0 auto;
}

@media (max-width: 1080px) {
    .geo-detail-grid,
    .geo-feature-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 760px) {
    .geo-shell-container {
        width: min(100% - 24px, 100%);
    }

    .geo-main-shell {
        padding-top: 22px;
        padding-bottom: 38px;
    }

    .geo-page-hero,
    .panel,
    .mini-card,
    .suggestion-card {
        padding: 22px;
    }

    .geo-site-header-row,
    .geo-page-head,
    .geo-section-head,
    .suggestion-head,
    .geo-footer-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .sidebar-nav {
        gap: 8px;
    }

    .logout-form {
        margin-left: 0;
    }

    .grid-scan-entry-actions {
        flex-direction: column;
    }

    .grid-scan-entry-actions > * {
        width: 100%;
    }

    .geo-keyword-form-row {
        grid-template-columns: 1fr;
    }

    .geo-keyword-form-row button,
    .geo-keyword-chip-action,
    .geo-keyword-chip-action button {
        width: 100%;
    }

    .geo-keyword-chip {
        flex-direction: column;
        align-items: stretch;
    }
}
