:root {
    --bg: #f6efe4;
    --bg-deep: #f0e4d1;
    --surface: rgba(255, 252, 246, 0.86);
    --surface-strong: #fffaf2;
    --surface-dark: #1f2733;
    --ink: #1e2530;
    --ink-soft: #5d6674;
    --line: rgba(34, 43, 56, 0.1);
    --line-strong: rgba(34, 43, 56, 0.18);
    --accent: #cc6b2c;
    --accent-soft: rgba(204, 107, 44, 0.12);
    --teal: #0d7063;
    --teal-soft: rgba(13, 112, 99, 0.12);
    --blue-soft: rgba(40, 101, 173, 0.12);
    --danger: #b3492d;
    --danger-soft: rgba(179, 73, 45, 0.12);
    --success: #17654b;
    --success-soft: rgba(23, 101, 75, 0.12);
    --info: #1f5d8f;
    --info-soft: rgba(31, 93, 143, 0.12);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-lg: 0 26px 70px rgba(35, 36, 48, 0.11);
    --shadow-md: 0 18px 40px rgba(35, 36, 48, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(204, 107, 44, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(13, 112, 99, 0.16), transparent 30%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
    font-family: "Sora", sans-serif;
    position: relative;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%, rgba(255, 255, 255, 0.1));
    pointer-events: none;
}

h1,
h2,
h3,
h4 {
    margin: 0;
    font-family: "Fraunces", serif;
    letter-spacing: -0.02em;
}

p {
    line-height: 1.6;
}

.scene-grid,
.scene-blur {
    position: fixed;
    pointer-events: none;
    z-index: -2;
}

.scene-grid {
    inset: 0;
    background-image:
        linear-gradient(rgba(30, 37, 48, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30, 37, 48, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 92%);
}

.scene-blur {
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.55;
}

.blur-one {
    top: -120px;
    left: -90px;
    background: rgba(204, 107, 44, 0.28);
}

.blur-two {
    right: -120px;
    bottom: -140px;
    background: rgba(13, 112, 99, 0.24);
}

.dashboard-body,
.login-body {
    padding: 28px 18px 42px;
}

.dashboard-shell,
.topbar,
.login-shell {
    width: min(1260px, 100%);
    margin: 0 auto;
}

.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.brand-stack {
    max-width: 760px;
}

.hero-copy {
    margin: 12px 0 0;
    max-width: 58ch;
    color: var(--ink-soft);
    font-size: 0.97rem;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(2.1rem, 4vw, 4rem);
}

h2 {
    font-size: clamp(1.45rem, 2.4vw, 2rem);
}

h3 {
    font-size: 1.04rem;
}

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

.mobile-scroll-row {
    scrollbar-width: none;
}

.mobile-scroll-row::-webkit-scrollbar {
    display: none;
}

.metric-chip,
.login-chip {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(34, 43, 56, 0.12);
    background: rgba(255, 251, 245, 0.74);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(34, 43, 56, 0.06);
    font-size: 0.84rem;
    font-weight: 600;
}

.metric-chip-strong {
    color: var(--teal);
    border-color: rgba(13, 112, 99, 0.22);
    background: rgba(13, 112, 99, 0.08);
}

.login-chip {
    color: var(--accent);
    border-color: rgba(204, 107, 44, 0.22);
    background: rgba(204, 107, 44, 0.08);
}

.dashboard-shell {
    display: grid;
    gap: 18px;
}

.hero-strip,
.workspace-grid,
.feedback-card,
.preview-card,
.history-card {
    width: 100%;
}

.hero-panel,
.card,
.brand-block,
.login-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
}

.hero-panel {
    padding: 26px;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

.hero-copy-block p:last-child {
    margin-bottom: 0;
    color: var(--ink-soft);
}

.hero-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.hero-step {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 236, 0.72));
    border: 1px solid rgba(34, 43, 56, 0.08);
}

.hero-step span {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-dark);
    color: #fff8ef;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.hero-step strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 8px;
}

.hero-step p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--ink-soft);
}

.card {
    padding: 24px;
}

.card-header {
    margin-bottom: 18px;
}

.card-header p:last-child,
.history-caption {
    margin: 8px 0 0;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.card-header-split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 18px;
}

.mini-kpi-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mini-kpi {
    min-width: 108px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(31, 39, 51, 0.96);
    color: #f9f2e7;
}

.mini-kpi span {
    display: block;
    font-size: 0.75rem;
    color: rgba(249, 242, 231, 0.72);
    margin-bottom: 6px;
}

.mini-kpi strong {
    font-size: 1.2rem;
    font-weight: 700;
}

.builder-form {
    display: grid;
    gap: 16px;
}

.field-grid {
    display: grid;
    gap: 14px;
}

.field-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid-leverage {
    grid-template-columns: minmax(160px, 0.6fr) minmax(0, 1fr);
}

.field-panel {
    padding: 16px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(34, 43, 56, 0.08);
}

.field-label {
    display: block;
    margin-bottom: 10px;
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.field-input {
    width: 100%;
    min-height: 52px;
    padding: 0 14px;
    border: 1px solid rgba(34, 43, 56, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    font-size: 16px;
}

.field-input:focus {
    border-color: rgba(13, 112, 99, 0.4);
    box-shadow: 0 0 0 4px rgba(13, 112, 99, 0.12);
    transform: translateY(-1px);
}

.choice-row {
    display: grid;
    gap: 10px;
}

.choice-row-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-row-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 14px;
    border-radius: 16px;
    border: 1px solid rgba(34, 43, 56, 0.12);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.choice-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(35, 36, 48, 0.08);
}

.choice-pill-long,
.choice-pill-short,
.choice-pill-ratio {
    color: var(--ink);
}

.choice-input:checked + .choice-pill {
    color: #fff9f1;
    border-color: transparent;
    background: linear-gradient(135deg, #202a38, #35465d);
    box-shadow: 0 16px 26px rgba(32, 42, 56, 0.18);
}

.choice-input:disabled + .choice-pill {
    cursor: not-allowed;
    color: rgba(30, 37, 48, 0.38);
    background: rgba(242, 237, 229, 0.88);
    border-style: dashed;
    box-shadow: none;
    transform: none;
}

.choice-input:checked + .choice-pill.choice-pill-long {
    background: linear-gradient(135deg, #0d7063, #188876);
}

.choice-input:checked + .choice-pill.choice-pill-short {
    background: linear-gradient(135deg, #b3492d, #cf6d44);
}

.choice-input:checked + .choice-pill.choice-pill-ratio {
    background: linear-gradient(135deg, #cc6b2c, #d98a45);
}

.preset-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.market-panel {
    display: grid;
    gap: 14px;
    background: linear-gradient(160deg, rgba(255, 248, 238, 0.88), rgba(255, 255, 255, 0.68));
}

.market-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.market-label {
    margin-bottom: 8px;
}

.market-price-line {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.market-price-line strong {
    font-size: 1.5rem;
    line-height: 1.1;
}

.market-price-symbol {
    color: var(--accent);
    font-size: 0.84rem;
    font-weight: 700;
}

.market-price-status {
    margin-top: 8px;
    color: var(--ink-soft);
    font-size: 0.86rem;
    line-height: 1.55;
}

.market-price-status.is-error {
    color: #9f4526;
}

.market-range-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.range-chip {
    display: grid;
    align-content: center;
    justify-items: start;
    min-height: 46px;
    border: 1px solid rgba(204, 107, 44, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.range-chip-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.1;
}

.range-chip-meta {
    display: block;
    margin-top: 4px;
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1.2;
}

.range-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(204, 107, 44, 0.28);
    box-shadow: 0 12px 20px rgba(204, 107, 44, 0.12);
}

.range-chip.is-recommended {
    border-color: rgba(13, 112, 99, 0.22);
    box-shadow: 0 12px 20px rgba(13, 112, 99, 0.08);
}

.range-chip.is-active {
    color: #fff8ef;
    border-color: transparent;
    background: linear-gradient(135deg, #202a38, #35465d);
    box-shadow: 0 16px 26px rgba(32, 42, 56, 0.18);
}

.range-chip.is-active .range-chip-meta {
    color: rgba(255, 248, 239, 0.78);
}

.btn-inline {
    min-width: 132px;
    min-height: 46px;
    padding: 0 16px;
}

.preset-chip {
    min-width: 74px;
    min-height: 46px;
    border: 1px solid rgba(34, 43, 56, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.preset-chip:hover,
.preset-chip.is-active {
    transform: translateY(-1px);
    border-color: rgba(204, 107, 44, 0.28);
    box-shadow: 0 12px 20px rgba(204, 107, 44, 0.12);
}

.ratio-helper,
.info-panel,
.action-panel {
    padding: 16px 18px;
    border-radius: 18px;
}

.ratio-helper {
    border: 1px dashed rgba(34, 43, 56, 0.14);
    background: rgba(255, 255, 255, 0.68);
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.65;
}

.ratio-helper strong {
    color: var(--ink);
}

.btn {
    appearance: none;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 0 18px;
    min-height: 50px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.btn:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    color: #fff8ef;
    background: linear-gradient(135deg, #cc6b2c, #b85724);
    box-shadow: 0 18px 30px rgba(204, 107, 44, 0.22);
}

.btn-danger {
    color: #fff8ef;
    background: linear-gradient(135deg, #b3492d, #91331d);
    box-shadow: 0 18px 30px rgba(179, 73, 45, 0.18);
}

.btn-ghost {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(34, 43, 56, 0.12);
}

.btn-large {
    min-height: 58px;
    font-size: 0.98rem;
}

.w-full {
    width: 100%;
}

.insight-card {
    position: sticky;
    top: 24px;
    align-self: start;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.insight-brief {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
}

.insight-brief strong {
    font-size: 1rem;
}

.insight-brief span {
    color: var(--accent);
    font-size: 0.86rem;
    font-weight: 700;
}

.live-card,
.stat-item {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(34, 43, 56, 0.08);
    background: rgba(255, 255, 255, 0.68);
}

.live-card span,
.stat-item span {
    display: block;
    color: var(--ink-soft);
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.live-card strong,
.stat-item strong {
    display: block;
    font-size: 1.02rem;
    line-height: 1.35;
}

.live-card small {
    display: block;
    margin-top: 6px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 600;
}

.live-card-wide {
    grid-column: 1 / -1;
    background: linear-gradient(140deg, rgba(31, 39, 51, 0.96), rgba(50, 61, 78, 0.92));
    color: #fff8ef;
}

.live-card-wide span,
.live-card-wide small,
.live-card-wide strong {
    color: inherit;
}

.info-panel {
    background: linear-gradient(160deg, rgba(13, 112, 99, 0.12), rgba(255, 255, 255, 0.7));
    border: 1px solid rgba(13, 112, 99, 0.14);
}

.plain-list {
    margin: 12px 0 0;
    padding-left: 18px;
    color: var(--ink-soft);
    display: grid;
    gap: 10px;
    font-size: 0.88rem;
}

.feedback-card {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.alert-chip {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    line-height: 1.6;
}

.alert-success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(23, 101, 75, 0.16);
}

.alert-error {
    color: var(--danger);
    background: var(--danger-soft);
    border-color: rgba(179, 73, 45, 0.16);
}

.alert-info {
    color: var(--info);
    background: var(--info-soft);
    border-color: rgba(31, 93, 143, 0.16);
}

.preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.preview-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-item-emphasis {
    background: linear-gradient(150deg, rgba(31, 39, 51, 0.96), rgba(50, 61, 78, 0.9));
    color: #fff8ef;
}

.stat-item-emphasis span,
.stat-item-emphasis strong {
    color: inherit;
}

.preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 18px;
}

.table-wrap {
    overflow: auto;
    border-radius: 20px;
    border: 1px solid rgba(34, 43, 56, 0.1);
    background: rgba(255, 255, 255, 0.84);
}

.table-wrap-strong {
    box-shadow: inset 0 0 0 1px rgba(34, 43, 56, 0.04);
}

.table-wrap-muted {
    background: rgba(255, 255, 255, 0.72);
}

table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid rgba(34, 43, 56, 0.08);
    font-size: 0.86rem;
    vertical-align: top;
}

th {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: rgba(31, 39, 51, 0.04);
}

.message-cell {
    max-width: 320px;
    white-space: pre-wrap;
}

.empty-cell {
    padding: 18px;
    text-align: center;
    color: var(--ink-soft);
}

.action-rail {
    display: grid;
    gap: 14px;
    align-content: start;
}

.action-panel-accent {
    background: linear-gradient(155deg, rgba(204, 107, 44, 0.12), rgba(255, 255, 255, 0.82));
    border: 1px solid rgba(204, 107, 44, 0.16);
}

.action-label {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.action-panel h3 {
    margin-bottom: 8px;
}

.action-panel p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
}

.stack-md {
    display: grid;
    gap: 12px;
}

.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    line-height: 1.55;
}

.checkbox-line input {
    margin-top: 3px;
}

.checkbox-line-strong {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(34, 43, 56, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.status-ok {
    color: var(--success);
    background: var(--success-soft);
}

.status-fail {
    color: var(--danger);
    background: var(--danger-soft);
}

.mb-16 {
    margin-bottom: 16px;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-shell {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
    align-items: stretch;
}

.brand-block,
.login-card {
    padding: 30px;
}

.brand-block-rich {
    background: linear-gradient(150deg, rgba(31, 39, 51, 0.96), rgba(43, 56, 73, 0.9));
    color: #fff8ef;
}

.brand-block-rich .eyebrow,
.brand-block-rich .subtitle {
    color: rgba(255, 248, 239, 0.74);
}

.brand-block h1 {
    font-size: clamp(2.1rem, 4.2vw, 3.8rem);
}

.subtitle {
    margin: 14px 0 0;
    max-width: 38ch;
}

.feature-stack {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.feature-card {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(255, 248, 239, 0.12);
    background: rgba(255, 255, 255, 0.08);
}

.feature-card span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 248, 239, 0.62);
}

.feature-card strong {
    font-size: 0.96rem;
    line-height: 1.55;
}

.login-card-rich {
    background: rgba(255, 252, 246, 0.88);
}

.reveal {
    animation: riseIn 0.58s ease both;
}

@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1180px) {
    .workspace-grid,
    .preview-layout,
    .login-shell,
    .hero-panel {
        grid-template-columns: 1fr;
    }

    .insight-card {
        position: static;
    }

    .preview-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .dashboard-body,
    .login-body {
        padding: 16px 12px calc(28px + env(safe-area-inset-bottom));
    }

    .topbar,
    .card-header-split,
    .preview-header,
    .market-panel-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .field-grid-2,
    .field-grid-leverage {
        grid-template-columns: 1fr;
    }

    .preview-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-steps {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 4px;
        margin-right: -4px;
        scroll-snap-type: x proximity;
    }

    .hero-step {
        min-width: 220px;
        flex: 0 0 220px;
        scroll-snap-align: start;
    }

    .mobile-scroll-row {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 2px;
        justify-content: flex-start;
        scroll-snap-type: x proximity;
    }

    .mobile-scroll-row > * {
        flex: 0 0 auto;
        scroll-snap-align: start;
    }

    .topbar-right,
    .topbar-right form {
        width: 100%;
    }

    .topbar-right {
        align-items: stretch;
    }

    .choice-row-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .live-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preset-row,
    .market-range-row {
        display: grid;
    }

    .preset-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .market-range-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .brand-block,
    .login-card,
    .card,
    .hero-panel {
        padding: 18px;
    }

    .field-panel,
    .ratio-helper,
    .info-panel,
    .action-panel {
        padding: 14px;
    }

    .choice-pill,
    .preset-chip,
    .btn {
        min-height: 54px;
    }

    .btn-large {
        min-height: 60px;
    }

    .login-card {
        order: -1;
    }

    .login-shell {
        gap: 14px;
    }

    .message-cell {
        max-width: none;
    }
}

@media (max-width: 560px) {
    .dashboard-body,
    .login-body {
        padding: 12px 10px calc(22px + env(safe-area-inset-bottom));
    }

    h1 {
        font-size: clamp(1.8rem, 9vw, 2.5rem);
    }

    h2 {
        font-size: clamp(1.22rem, 7vw, 1.6rem);
    }

    .hero-copy {
        font-size: 0.9rem;
    }

    .hero-strip {
        display: none;
    }

    .choice-row-2,
    .field-grid-2,
    .choice-row-4,
    .live-grid,
    .preview-summary-grid,
    .preset-row,
    .market-range-row {
        grid-template-columns: 1fr;
    }

    .topbar {
        gap: 14px;
    }

    .top-chip-row {
        padding-bottom: 4px;
    }

    .metric-chip,
    .login-chip {
        min-height: 36px;
        padding: 0 12px;
        font-size: 0.8rem;
    }

    .metric-chip,
    .login-chip,
    .preset-chip,
    .btn {
        width: 100%;
        justify-content: center;
    }

    .mobile-scroll-row > .metric-chip,
    .mobile-scroll-row > .login-chip {
        width: auto;
        justify-content: flex-start;
    }

    .chip-row:not(.mobile-scroll-row) {
        grid-template-columns: 1fr;
        display: grid;
    }

    .topbar-right {
        width: 100%;
        align-items: stretch;
    }

    .table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .table-wrap table,
    .table-wrap thead,
    .table-wrap tbody,
    .table-wrap tr,
    .table-wrap th,
    .table-wrap td {
        display: block;
        width: 100%;
    }

    .table-wrap thead {
        display: none;
    }

    .table-wrap tbody {
        display: grid;
        gap: 12px;
    }

    .table-wrap tr {
        display: grid;
        gap: 10px;
        padding: 14px;
        border-radius: 18px;
        border: 1px solid rgba(34, 43, 56, 0.1);
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 12px 24px rgba(35, 36, 48, 0.06);
    }

    .table-wrap td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        padding: 0;
        border-bottom: none;
        text-align: right;
        font-size: 0.88rem;
    }

    .table-wrap td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--ink-soft);
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        text-align: left;
    }

    .message-cell {
        white-space: normal;
    }

    .message-cell::before {
        align-self: flex-start;
    }

    .empty-cell {
        display: block;
        text-align: center;
        padding: 18px;
    }

    .empty-cell::before {
        content: none;
    }
}
