:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --text: #101828;
    --muted: #667085;
    --border: #d0d5dd;
    --primary: #0f3d5e;
    --primary-dark: #09283f;
    --primary-soft: #eef4ff;
    --safe: #027a48;
    --caution: #b54708;
    --avoid: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.app-shell {
    min-height: 100vh;
    padding-bottom: 78px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--primary);
    color: white;
    font-weight: 900;
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-form {
    margin: 0;
}

.header-button {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
}

.pro-pill,
.pro-lock {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.page-container {
    width: min(1080px, 100%);
    margin: 0 auto;
    padding: 1rem;
}

h1 {
    font-size: clamp(1.7rem, 5vw, 2.4rem);
    line-height: 1.05;
    margin: 0 0 0.5rem;
}

h2 {
    margin: 0 0 0.5rem;
}

.page-intro,
.section-heading p {
    color: var(--muted);
    margin-top: 0;
}

.eyebrow {
    margin: 0 0 0.5rem;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
}

.hero-card,
.form-card,
.result-panel,
.tips-card,
.template-card,
.progress-card,
.feature-list {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

.hero-card {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1.2rem;
}

.section-heading {
    margin: 1.2rem 0 0.7rem;
}

.tool-grid {
    display: grid;
    gap: 0.8rem;
}

.auth-layout {
    display: grid;
    place-items: start center;
    padding-top: 1rem;
}

.auth-card {
    width: min(460px, 100%);
}

.tool-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .tool-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
    }

    .tool-card h3 {
        margin: 0 0 0.25rem;
    }

    .tool-card p {
        margin: 0;
        color: var(--muted);
    }

.tool-card-arrow {
    color: var(--muted);
    font-size: 2rem;
}

.calculator-layout,
.two-column-layout {
    display: grid;
    gap: 1rem;
}

.form-grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

label {
    display: block;
    font-weight: 700;
    margin: 0.7rem 0 0.3rem;
}

.input,
.textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem;
    font-size: 1rem;
    background: white;
    color: var(--text);
}

.textarea {
    min-height: 130px;
    resize: vertical;
}

.primary-button,
.secondary-button,
.small-button {
    border: 0;
    border-radius: 15px;
    padding: 0.85rem 1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.primary-button {
    background: var(--primary);
    color: white;
}

.secondary-button {
    background: var(--primary-soft);
    color: var(--primary);
}

.small-button {
    background: var(--surface-soft);
    color: var(--primary);
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    margin: 0.25rem 0 0.5rem;
}

.full-width {
    width: 100%;
    margin-top: 0.8rem;
}

.result-card {
    margin-bottom: 1rem;
}

.result-label {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.result-value {
    display: block;
    font-size: clamp(2.2rem, 8vw, 3.3rem);
    line-height: 1;
    margin: 0.35rem 0;
}

.result-description {
    color: var(--muted);
    margin-bottom: 0;
}

.empty-state {
    color: var(--muted);
}

.risk-badge {
    display: inline-flex;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.risk-safe {
    background: #ecfdf3;
    color: var(--safe);
}

.risk-caution {
    background: #fffaeb;
    color: var(--caution);
}

.risk-avoid {
    background: #fef3f2;
    color: var(--avoid);
}

.breakdown {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
    margin: 0;
}

    .breakdown dt {
        color: var(--muted);
    }

    .breakdown dd {
        margin: 0;
        font-weight: 800;
    }

.counter-status {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.8rem 0;
    padding: 0.85rem;
    border-radius: 16px;
    background: #ecfdf3;
    color: var(--safe);
    font-weight: 800;
}

    .counter-status.danger {
        background: #fef3f2;
        color: var(--avoid);
    }

.button-row {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.quality-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .quality-list li {
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--border);
    }

        .quality-list li.ok::before {
            content: "✓ ";
            color: var(--safe);
            font-weight: 900;
        }

        .quality-list li.missing::before {
            content: "○ ";
            color: var(--muted);
            font-weight: 900;
        }

.locked-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--primary-soft);
}

.template-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.template-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

    .template-header h2 {
        font-size: 1.1rem;
        margin: 0;
    }

    .template-header span {
        color: var(--muted);
    }

.progress-card {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}

    .progress-card strong {
        font-size: 2rem;
    }

.progress-track {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e4e7ec;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--safe);
}

.checklist-group {
    margin: 1rem 0;
}

.checklist-item {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    background: white;
    border: 1px solid var(--border);
    padding: 0.85rem;
    border-radius: 15px;
    margin-bottom: 0.55rem;
    cursor: pointer;
}

.price-card {
    display: grid;
    gap: 0.2rem;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
}

    .price-card strong {
        font-size: 2.4rem;
    }

.feature-list {
    margin-top: 1rem;
}

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

    .bottom-nav a {
        padding: 0.65rem 0.4rem;
        text-align: center;
        text-decoration: none;
        color: var(--muted);
        font-weight: 800;
        border-radius: 14px;
    }

        .bottom-nav a.active {
            background: var(--primary-soft);
            color: var(--primary);
        }

@media (min-width: 850px) {
    .calculator-layout,
    .two-column-layout {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
        align-items: start;
    }

    .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bottom-nav {
        display: none;
    }

    .app-shell {
        padding-bottom: 0;
    }

    .page-container {
        padding: 1.5rem;
    }
   
}
.preset-note {
    margin: 0.6rem 0 0.8rem;
    padding: 0.8rem;
    border-radius: 16px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.92rem;
}

    .preset-note strong {
        font-weight: 900;
    }

    .preset-note small {
        display: block;
        margin-top: 0.3rem;
        color: var(--muted);
        line-height: 1.35;
    }

.fee-disclaimer {
    margin: 1rem 0;
    padding: 0.85rem;
    border-radius: 16px;
    background: #fffaeb;
    color: #92400e;
    border: 1px solid #fedf89;
    font-size: 0.9rem;
}
.feedback-button {
    position: fixed;
    right: 1rem;
    bottom: 5.4rem;
    z-index: 40;
    background: var(--primary);
    color: white;
    text-decoration: none;
    font-weight: 800;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.18);
}

@media (min-width: 850px) {
    .feedback-button {
        bottom: 1rem;
    }
}

.cookie-notice {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 5.4rem;
    z-index: 60;
    display: grid;
    gap: 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 18px 44px rgba(16, 24, 40, 0.22);
}

    .cookie-notice strong {
        display: block;
        margin-bottom: 0.25rem;
    }

    .cookie-notice p {
        margin: 0 0 0.35rem;
        color: var(--muted);
        font-size: 0.92rem;
    }

    .cookie-notice a {
        color: var(--primary);
        font-weight: 800;
    }

.cookie-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

    .cookie-actions .primary-button,
    .cookie-actions .secondary-button {
        flex: 1;
        min-width: 130px;
    }

@media (min-width: 850px) {
    .cookie-notice {
        left: auto;
        right: 1rem;
        bottom: 1rem;
        width: min(460px, calc(100vw - 2rem));
    }
}
.recent-card {
    margin-top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 1rem;
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.06);
}

    .recent-card h2 {
        font-size: 1.05rem;
        margin-bottom: 0.8rem;
    }

.recent-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}

    .recent-item:first-of-type {
        border-top: 0;
    }

    .recent-item strong {
        display: block;
        font-size: 1.2rem;
    }

    .recent-item span {
        display: block;
        color: var(--text);
    }

    .recent-item small {
        display: block;
        color: var(--muted);
        margin-top: 0.15rem;
    }

.recent-risk {
    align-self: start;
    font-weight: 800;
    color: var(--primary);
}
.bottom-nav a {
    display: grid;
    gap: 0.15rem;
    place-items: center;
}

.bottom-nav-icon {
    font-size: 1rem;
    line-height: 1;
}
.more-group {
    margin-bottom: 1.5rem;
}

    .more-group h2 {
        margin: 1rem 0 0.75rem;
    }
.trading-disclaimer {
    margin: 1rem 0;
    padding: 0.9rem;
    border-radius: 16px;
    background: #fffaeb;
    color: #92400e;
    border: 1px solid #fedf89;
    font-size: 0.92rem;
}

.result-danger {
    background: #fef3f2;
    border-color: #fecdca;
}

.r-targets,
.mini-card,
.risk-guard {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.r-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.7rem;
}

    .r-grid div {
        background: white;
        border: 1px solid var(--border);
        border-radius: 14px;
        padding: 0.8rem;
        text-align: center;
    }

    .r-grid span {
        display: block;
        color: var(--muted);
        font-size: 0.85rem;
        font-weight: 700;
    }

    .r-grid strong {
        display: block;
        margin-top: 0.25rem;
        font-size: 1.1rem;
    }

.risk-guard-message {
    padding: 0.7rem;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.small-help {
    margin: 0.4rem 0 0.8rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.scaleout-table {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
}

.scaleout-row {
    display: grid;
    grid-template-columns: 70px 1fr 1fr;
    gap: 0.5rem;
    align-items: center;
}

.scaleout-head {
    color: var(--muted);
    font-weight: 800;
    font-size: 0.85rem;
}

.compact-input {
    margin: 0;
    padding: 0.65rem;
}

.stop-scenario-card {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

    .stop-scenario-card p {
        color: var(--muted);
        margin-top: 0;
    }

.stop-scenario-item {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.85rem;
    margin-bottom: 0.7rem;
}

    .stop-scenario-item strong,
    .stop-scenario-item span,
    .stop-scenario-item small {
        display: block;
    }

    .stop-scenario-item small {
        margin-top: 0.2rem;
        color: var(--muted);
        line-height: 1.35;
    }

.scaleout-result-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
}

    .scaleout-result-row:last-child {
        border-bottom: 0;
    }

    .scaleout-result-row strong,
    .scaleout-result-row span {
        display: block;
    }

    .scaleout-result-row span {
        color: var(--muted);
    }

.scaleout-summary {
    margin-top: 1rem;
}

.signal-card {
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

    .signal-card strong {
        display: block;
        font-size: 2rem;
        line-height: 1;
        margin-top: 0.25rem;
    }

.signal-buy {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
}

.signal-sell {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.signal-wait {
    background: rgba(148, 163, 184, 0.12);
}

.button-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.success-message {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.danger-message {
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.danger-button {
    border: none;
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-weight: 700;
    color: white;
    background: #dc2626;
    cursor: pointer;
}

.signal-checklist {
    display: grid;
    gap: 0.75rem;
}

.checklist-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

    .checklist-row div {
        display: grid;
        gap: 0.25rem;
    }

    .checklist-row span {
        color: var(--muted-text, #64748b);
    }

    .checklist-row small {
        color: var(--muted-text, #64748b);
    }

.checklist-pass {
    background: rgba(34, 197, 94, 0.08);
}

.checklist-fail {
    background: rgba(239, 68, 68, 0.08);
}

.risk-result-box {
    margin-top: 1rem;
}

.simple-table {
    display: grid;
    gap: 0.35rem;
    overflow-x: auto;
}

.simple-table-row {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 0.8fr 0.8fr 0.8fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.simple-table-head {
    font-weight: 700;
    background: rgba(148, 163, 184, 0.12);
}

.account-table {
    display: grid;
    gap: 0.4rem;
    overflow-x: auto;
}

.account-table-row {
    display: grid;
    grid-template-columns: 1.5fr 0.7fr 0.7fr 0.9fr 1fr;
    gap: 0.75rem;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.account-user-table-row {
    grid-template-columns: 1.4fr 0.65fr 0.65fr 0.85fr 1fr 1.2fr;
}

.account-table-row small {
    display: block;
    color: var(--muted);
}

.account-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.account-actions .small-button,
.account-actions .danger-button {
    margin: 0;
    padding: 0.55rem 0.7rem;
}

.account-danger-button {
    border-radius: 0.65rem;
}

.account-table-head {
    font-weight: 700;
    background: rgba(148, 163, 184, 0.12);
}

@media (max-width: 720px) {
    .simple-table-row {
        grid-template-columns: 1fr;
    }

    .account-table-row {
        grid-template-columns: 1fr;
    }

    .account-user-table-row {
        grid-template-columns: 1fr;
    }
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

    .checkbox-line input {
        width: auto;
    }
