/* MoneyCompass visual redesign
   Presentation only: no behavioral selectors or form names are changed. */

:root {
    --primary-teal: #00b593;
    --primary-teal-dark: #008f76;
    --mc-teal-soft: #e9faf6;
    --mc-teal-pale: #f4fbf9;
    --bg-body: #edf1f5;
    --bg-card: #ffffff;
    --text-dark: #14233a;
    --text-medium: #5b6b7f;
    --text-light: #94a3b8;
    --danger: #d94c4c;
    --success: #008f6a;
    --warning: #c88a18;
    --mc-border: #e7edf2;
    --mc-input: #f8fafc;
    --card-radius: 18px;
    --btn-radius: 10px;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.06);
    --shadow-card: 0 8px 22px rgba(15, 23, 42, 0.055);
}

html {
    background: var(--bg-body);
}

body {
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text-medium);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

body,
button,
input,
select,
textarea {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

::selection {
    color: #ffffff;
    background: var(--primary-teal);
}

/* Shared shell */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    background: #ffffff;
    border-bottom: 1px solid #eef2f6;
    box-shadow: none;
}

.navbar-inner {
    width: 100%;
    max-width: 1380px;
    min-height: 72px;
    margin: 0 auto;
    padding: 0 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-brand {
    flex: 0 0 auto;
    gap: 8px;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-dark);
}

.nav-brand::before {
    width: 10px;
    height: 10px;
    background: var(--primary-teal);
}

.nav-links {
    align-items: center;
    justify-content: center;
    gap: 28px;
}

.nav-item {
    padding: 25px 0 23px;
    color: #66768a;
    border: 0;
    font-size: 0.86rem;
    font-weight: 600;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-teal);
    border: 0;
}

.nav-profile-container {
    padding: 8px 0;
}

.nav-profile {
    width: 34px;
    height: 34px;
    color: #ffffff;
    background: var(--primary-teal);
    border: 0;
    font-size: 0.82rem;
    box-shadow: 0 6px 14px rgba(0, 181, 147, 0.22);
}

.nav-profile:hover {
    border: 0;
    transform: translateY(-1px);
}

.profile-dropdown {
    top: calc(100% - 2px);
    width: 190px;
    padding: 8px;
    border: 1px solid var(--mc-border);
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.dropdown-item {
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--text-dark);
    font-size: 0.86rem;
    font-weight: 600;
}

.dropdown-item:hover {
    color: var(--primary-teal-dark);
    background: var(--mc-teal-pale);
}

.dropdown-button {
    width: 100%;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
}

.dropdown-language {
    padding: 8px 10px 10px;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 5px;
}

.dropdown-language > span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-light);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dropdown-language form,
.language-switch {
    display: inline-flex;
    gap: 4px;
    padding: 3px;
    margin: 0;
    background: #f1f5f9;
    border-radius: 9px;
}

.dropdown-language button,
.language-switch button {
    padding: 5px 9px;
    border: 0;
    border-radius: 7px;
    color: var(--text-light);
    background: transparent;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
}

.dropdown-language button.active,
.language-switch button.active {
    color: #ffffff;
    background: var(--primary-teal);
}

.public-nav-actions {
    margin-left: auto;
}

.app-container {
    width: 100%;
    max-width: 1380px;
    padding: 30px 34px 80px;
}

.page-title-row,
.page-header,
.assets-page .assets-header {
    margin: 0 0 20px !important;
    min-height: 46px;
}

.page-title-row h2,
.page-header h2,
.assets-page .assets-title {
    font-size: 1.8rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--text-dark);
}

.card {
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid rgba(231, 237, 242, 0.78);
    border-radius: var(--card-radius);
    background: var(--bg-card);
    box-shadow: var(--shadow-soft);
}

.card-title {
    margin-bottom: 16px;
    color: var(--text-dark);
    font-size: 1.02rem;
    font-weight: 800;
}

.flash-message {
    margin: 0 0 18px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-card);
}

.flash-success {
    color: #076447;
    background: #e9fbf4;
    border-color: #bcebdc;
}

.flash-error {
    color: #9e3232;
    background: #fff2f2;
    border-color: #f5caca;
}

.flash-info,
.flash-warning {
    color: #695115;
    background: #fff9e9;
    border-color: #f2dfa5;
}

.btn {
    min-height: 38px;
    padding: 9px 16px;
    border-radius: var(--btn-radius);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: none;
}

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

.btn-primary {
    color: #ffffff;
    background: var(--primary-teal);
    box-shadow: 0 7px 16px rgba(0, 181, 147, 0.16);
}

.btn-primary:hover {
    background: var(--primary-teal-dark);
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.icon-action {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #d9ebe7;
    border-radius: 8px;
    color: var(--primary-teal-dark);
    background: #f2fbf9;
    text-decoration: none;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.icon-action:hover {
    color: #ffffff;
    background: var(--primary-teal);
    border-color: var(--primary-teal);
    transform: translateY(-1px);
}

.icon-action i,
.edit-column-heading i {
    font-size: 1rem;
    line-height: 1;
}

.edit-column-heading {
    width: 50px;
    text-align: center;
}

.text-teal {
    color: var(--primary-teal);
}

.text-teal-dark {
    color: var(--primary-teal-dark);
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
select,
textarea,
.form-input,
.upload-control {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px !important;
    color: var(--text-dark);
    background: var(--mc-input) !important;
    border: 1px solid var(--mc-border) !important;
    border-radius: 10px !important;
    outline: 0;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):focus,
select:focus,
textarea:focus,
.form-input:focus {
    background: #ffffff !important;
    border-color: rgba(0, 181, 147, 0.62) !important;
    box-shadow: 0 0 0 3px rgba(0, 181, 147, 0.11);
}

label {
    color: var(--text-medium);
    font-weight: 600;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th {
    padding: 12px 10px;
    color: #8491a2;
    border-bottom: 1px solid var(--mc-border);
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

td {
    padding: 14px 10px;
    color: var(--text-dark);
    border-bottom: 1px solid #f0f3f6;
    font-size: 0.88rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover td {
    background: rgba(248, 250, 252, 0.72);
}

/* Onboarding */
.onboarding-banner {
    width: calc(100% - 68px);
    max-width: 1312px;
    margin: 24px auto 0;
    border: 1px solid var(--mc-border);
    border-left: 4px solid var(--primary-teal);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.onboarding-banner .container {
    max-width: none;
    padding: 16px 20px;
}

.onboarding-banner .btn-light {
    padding: 9px 14px;
    border: 0;
    border-radius: 9px;
    background: var(--primary-teal);
    font-size: 0.82rem;
}

/* Dashboard */
.dashboard-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
}

.dashboard-page > * {
    min-width: 0;
    margin-bottom: 0;
}

.dashboard-title-row,
.net-worth-card,
.dashboard-goals-card,
.dashboard-category-card {
    grid-column: 1 / -1;
}

.dashboard-title-row {
    order: 0;
}

.net-worth-card {
    order: 1;
    padding: 32px !important;
}

.dashboard-accounts-card {
    order: 2;
}

.dashboard-history-card {
    order: 2;
}

.dashboard-goals-card {
    order: 3;
}

.dashboard-income-card {
    order: 4;
}

.dashboard-net-month-card {
    order: 4;
}

.dashboard-category-card {
    order: 5;
}

.net-worth-card > .text-medium:first-child {
    color: #8794a5 !important;
    font-size: 0.73rem !important;
    font-weight: 700;
    letter-spacing: 0.12em !important;
}

.net-worth-card > div:nth-child(2) {
    margin-bottom: 26px !important;
    color: var(--text-dark) !important;
    font-size: 3.05rem !important;
    font-weight: 800 !important;
}

.net-worth-card div[style*="height:14px"] {
    height: 10px !important;
    border-radius: 999px !important;
}

.dashboard-history-card > div[style*="height:320px"] {
    height: 260px !important;
}

.dashboard-income-card canvas,
.dashboard-category-card canvas {
    max-height: 270px;
}

.dashboard-goals-card {
    border-color: var(--mc-border) !important;
}

.dashboard-goals-card > div[style*="grid-template-columns"] > div {
    border: 1px solid var(--mc-border) !important;
    border-radius: 12px !important;
    background: var(--mc-input) !important;
}

.dashboard-category-card .cat-btn {
    padding: 7px 10px !important;
    border: 1px solid var(--mc-border) !important;
    border-radius: 9px !important;
    background: #ffffff !important;
    color: var(--text-medium);
    font-weight: 600;
}

/* Statistics */
.statistics-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin: 0 0 22px !important;
}

.statistics-summary-grid > .card {
    min-height: 108px;
    margin: 0 !important;
    padding: 19px 21px;
}

.statistics-summary-grid > .card > div:first-child {
    color: #8a97a7 !important;
    font-size: 0.76rem !important;
    font-weight: 600;
}

.statistics-summary-grid > .card > div:nth-child(2),
.statistics-summary-grid > .card > .text-teal {
    margin-top: 4px;
    font-size: 1.42rem !important;
    font-weight: 800 !important;
}

.statistics-page .card .card {
    border: 1px solid #edf2f5;
    background: var(--mc-input);
    box-shadow: none;
}

.statistics-page > div[style*="margin:1.25rem"] {
    margin: 16px 2px 8px !important;
}

/* Reports */
.reports-page > .card:first-of-type {
    padding: 14px 18px;
}

.reports-page .card a.btn {
    border-radius: 9px !important;
}

/* Portfolio */
.assets-page .assets-header {
    margin-top: 0;
}

.assets-page .assets-total-value {
    color: var(--primary-teal);
    font-size: 1.62rem;
    font-weight: 800;
}

.assets-page .assets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.assets-page .asset-card {
    min-height: 430px;
    gap: 14px;
    padding: 22px;
    border-top-width: 4px;
}

.assets-page .asset-card--crypto {
    border-top-color: #805ad5;
}

.assets-page .asset-card--stock {
    border-top-color: #3182ce;
}

.assets-page .asset-add-btn {
    min-height: 32px;
    padding: 7px 11px;
}

.assets-page .asset-chart-canvas {
    height: 220px;
}

.assets-page .chart-toggle-group {
    border: 1px solid #edf1f4;
    background: #f8fafc;
}

/* Transactions and import */
.transactions-title-row {
    margin-bottom: 10px !important;
}

.transaction-tabs {
    gap: 7px !important;
    margin-bottom: 16px !important;
}

.transaction-tabs a {
    padding: 7px 11px;
    border-radius: 9px;
    color: var(--text-medium) !important;
    background: #ffffff;
    border: 1px solid var(--mc-border);
    font-size: 0.78rem;
    font-weight: 700 !important;
}

.transaction-tabs a:first-child {
    color: #68409a !important;
    background: #f4edff;
    border-color: #eadcff;
}

.import-card {
    padding: 22px;
}

.upload-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 15px !important;
}

.upload-file-field {
    grid-column: 1 / -1;
}

.upload-dropzone {
    min-height: 176px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1.5px dashed #9ad9c7;
    border-radius: 14px;
    color: var(--text-dark);
    background: var(--mc-teal-pale);
    text-align: center;
    cursor: pointer;
}

.upload-dropzone:hover {
    border-color: var(--primary-teal);
    background: #edfaf6;
}

.upload-dropzone-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 3px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--primary-teal);
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 181, 147, 0.1);
    font-size: 1.4rem;
}

.upload-dropzone strong {
    font-size: 0.95rem;
}

.upload-dropzone > span:not(.upload-dropzone-icon) {
    color: var(--text-light);
    font-size: 0.78rem;
    font-weight: 500;
}

.upload-dropzone input[type="file"] {
    width: auto !important;
    min-height: 0;
    margin-top: 8px;
    padding: 7px !important;
    color: var(--text-medium);
    background: #ffffff !important;
}

.upload-actions {
    grid-column: 1 / -1;
    justify-content: center;
}

.upload-actions .btn {
    min-width: 120px;
}

.filter-card > form > div[style*="grid-template-columns"] {
    gap: 12px !important;
}

.transaction-list-card {
    border: 1px solid var(--mc-border);
}

.transaction-list-card > div:first-child {
    background: #fbfcfd !important;
    border-color: var(--mc-border) !important;
}

.transaction-list-card select {
    min-height: 34px;
    padding: 6px 8px !important;
}

/* Categories */
.categories-page {
    max-width: 980px;
    margin: 0 auto;
}

.category-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-dark);
    font-weight: 700;
}

.category-dot {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 4px;
    background: var(--primary-teal);
}

/* Profile */
.profile-page {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.profile-page > * {
    min-width: 0;
    margin-bottom: 0;
}

.profile-page-header,
.profile-billing-card,
.profile-accounts-card,
.profile-categories-card,
.profile-caps-card,
.profile-goals-card,
.profile-delete-card {
    grid-column: 1 / -1;
}

.profile-preferences-card,
.profile-language-card {
    min-height: 190px;
}

.profile-page form[style*="background:#f8fafc"] {
    background: var(--mc-input) !important;
    border-color: var(--mc-border) !important;
    border-radius: 13px !important;
}

.profile-page table input:not([type="checkbox"]),
.profile-page table select {
    min-width: 90px;
}

.profile-page input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-teal);
}

.profile-page div[style*="height:8px"] {
    background: #e8edf1 !important;
}

.profile-page div[style*="height:8px"] > div {
    background: var(--primary-teal) !important;
}

/* Guide and secondary screens */
.guide-page {
    grid-template-columns: 250px minmax(0, 900px);
    justify-content: center;
}

.guide-sidebar,
.guide-content {
    border: 1px solid var(--mc-border);
}

.guide-image {
    border-color: var(--mc-border);
}

.mobile-community-link {
    min-height: 42px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid #eef2f5;
    border-bottom: 1px solid #eef2f5;
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.mobile-community-link:hover {
    color: var(--primary-teal-dark);
    background: #f7fafc;
}

/* Mobile app navigation */
.bottom-nav {
    min-height: 72px;
    padding: 8px 8px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #e8edf2;
    box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.07);
}

.b-item {
    gap: 3px;
    color: #9aa6b5;
    font-size: 0.66rem;
    font-weight: 600;
}

.b-item i {
    width: 28px;
    height: 28px;
    margin: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #9aa6b5;
    font-size: 1.18rem;
}

.b-item.active,
.b-item.active i {
    color: var(--primary-teal);
}

.b-item.active i {
    color: #ffffff;
    background: var(--primary-teal);
}

/* Auth */
.auth-page {
    min-height: 100vh;
    background: #ffffff;
}

.auth-page .navbar,
.auth-page .bottom-nav,
.auth-page .pending-delete-banner,
.auth-page .onboarding-banner {
    display: none !important;
}

.auth-page .app-container {
    max-width: none;
    min-height: 100vh;
    padding: 0;
}

.auth-page .flash-message {
    position: fixed;
    top: 16px;
    left: 50%;
    z-index: 500;
    width: min(620px, calc(100% - 32px));
    transform: translateX(-50%);
}

.auth-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 44%) minmax(0, 1fr);
    background: #ffffff;
}

.auth-visual {
    position: relative;
    min-height: 100vh;
    padding: 56px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(165deg, #00d8ad 0%, #00b896 52%, #00997e 100%);
}

.auth-visual-glow {
    position: absolute;
    top: -180px;
    right: -180px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.23), rgba(255,255,255,0) 70%);
}

.auth-visual-glow-bottom {
    top: auto;
    right: auto;
    bottom: -190px;
    left: -190px;
}

.auth-mascot {
    position: relative;
    z-index: 1;
    width: min(320px, 70%);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 24px 40px rgba(0, 70, 56, 0.3));
}

.auth-visual-copy {
    position: relative;
    z-index: 1;
    margin-top: 26px;
    color: #ffffff;
    font-size: clamp(2rem, 3.2vw, 2.75rem);
    font-weight: 800;
    line-height: 1.08;
    text-align: center;
}

.auth-beta-pill {
    position: relative;
    z-index: 1;
    margin-bottom: 24px;
    padding: 9px 20px;
    border: 1px solid rgba(255,255,255,0.38);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255,255,255,0.16);
    font-size: 0.73rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-form-panel {
    position: relative;
    min-width: 0;
    padding: 54px clamp(40px, 7vw, 110px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
}

.auth-language-switch {
    position: absolute;
    top: 28px;
    right: 32px;
    z-index: 2;
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin: 0;
    border: 1px solid var(--mc-border);
    border-radius: 10px;
    background: var(--mc-input);
}

.auth-language-switch button {
    min-width: 38px;
    min-height: 32px;
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    color: var(--text-light);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 800;
}

.auth-language-switch button.active {
    color: #ffffff;
    background: var(--primary-teal);
    box-shadow: 0 4px 10px rgba(0, 181, 147, 0.18);
}

.auth-form-wrap {
    width: min(100%, 570px);
}

.auth-form-wrap-register {
    width: min(100%, 680px);
}

.auth-brand {
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--text-dark);
    font-size: 1.22rem;
    font-weight: 800;
}

.auth-brand span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-teal);
}

.auth-form-wrap h1 {
    margin: 0 0 28px;
    color: var(--text-dark);
    font-size: clamp(2.2rem, 4vw, 3rem);
    line-height: 1.08;
    font-weight: 800;
}

.auth-form {
    width: 100%;
}

.auth-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.auth-field-wide {
    grid-column: 1 / -1;
}

.auth-field {
    min-width: 0;
    margin-bottom: 18px;
}

.auth-grid .auth-field {
    margin-bottom: 0;
}

.auth-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-medium);
    font-size: 0.84rem;
    font-weight: 600;
}

.auth-field input,
.auth-field select {
    min-height: 52px;
    padding: 13px 15px !important;
    border-radius: 12px !important;
    font-size: 0.95rem;
}

.auth-field .beta-code-input {
    color: #00875a;
    background: var(--mc-teal-pale) !important;
    border-color: #9ad9c7 !important;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.auth-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 22px;
    border-radius: 12px;
    font-size: 0.98rem;
}

.auth-secondary,
.auth-tertiary {
    margin-top: 18px;
    color: var(--text-medium);
    text-align: center;
    font-size: 0.88rem;
}

.auth-tertiary {
    margin-top: 8px;
}

.auth-secondary a,
.auth-tertiary a {
    color: var(--primary-teal);
    font-weight: 700;
}

.auth-help {
    margin-top: 14px;
    color: var(--text-light);
    font-size: 0.76rem;
    line-height: 1.45;
}

.auth-help ul {
    margin: 0;
    padding-left: 18px;
}

.form-alert,
.field-errors {
    color: #a83b3b;
    background: #fff3f3;
    border: 1px solid #f3cccc;
    border-radius: 10px;
}

.form-alert {
    margin-bottom: 18px;
    padding: 11px 13px;
}

.field-errors {
    margin-top: 7px;
    padding: 8px 10px;
    font-size: 0.78rem;
}

.field-errors ul,
.form-alert ul {
    margin: 0;
    padding-left: 18px;
}

/* Responsive */
@media (max-width: 980px) {
    .navbar-inner {
        padding: 0 22px;
    }

    .nav-links {
        gap: 16px;
    }

    .app-container {
        padding-right: 22px;
        padding-left: 22px;
    }

    .dashboard-page {
        grid-template-columns: 1fr;
    }

    .dashboard-page > * {
        grid-column: 1 !important;
    }

    .dashboard-history-card {
        order: 2;
    }

    .dashboard-accounts-card {
        order: 3;
    }

    .dashboard-goals-card {
        order: 4;
    }

    .dashboard-income-card {
        order: 5;
    }

    .dashboard-category-card {
        order: 7;
    }

    .dashboard-net-month-card {
        order: 6;
    }

    .statistics-page .statistics-summary-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .profile-page {
        grid-template-columns: 1fr;
    }

    .profile-page > * {
        grid-column: 1 !important;
    }
}

@media (max-width: 768px) {
    body.is-authenticated {
        background: var(--bg-body);
    }

    .guide-page {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .guide-sidebar,
    .guide-content {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .guide-sidebar {
        position: static;
        padding: 14px;
        overflow-x: auto;
    }

    .guide-sidebar-title {
        margin-bottom: 10px;
    }

    .guide-nav {
        width: max-content;
        min-width: 100%;
        flex-direction: row;
        gap: 8px;
    }

    .guide-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .guide-content {
        padding: 22px;
    }

    .is-authenticated .navbar {
        display: none;
    }

    .app-container {
        padding: 22px 18px 104px;
    }

    .page-title-row,
    .page-header,
    .assets-page .assets-header {
        min-height: 0;
        margin: -22px -18px 18px !important;
        padding: 20px 18px 17px;
        align-items: center;
        flex-direction: row;
        background: #ffffff;
        border-bottom: 1px solid #eef2f6;
    }

    .page-title-row h2,
    .page-header h2,
    .assets-page .assets-title {
        margin: 0 !important;
        font-size: 1.55rem;
    }

    .profile-page-header {
        display: block;
    }

    .profile-user-line {
        margin-top: 3px;
        color: var(--text-light);
        font-size: 0.76rem;
    }

    .profile-user-line strong {
        display: inline;
        color: var(--text-light);
    }

    .card {
        margin-bottom: 16px;
        padding: 19px;
        border-radius: 20px;
        box-shadow: 0 10px 25px rgba(15, 23, 42, 0.055);
    }

    .card-title {
        font-size: 1rem;
    }

    .net-worth-card {
        padding: 24px 18px !important;
    }

    .net-worth-card > div:nth-child(2) {
        margin-bottom: 20px !important;
        font-size: 2.35rem !important;
    }

    .net-worth-card > div:nth-child(2) span {
        font-size: 1rem !important;
    }

    .net-worth-card div[style*="gap:1.5rem"] {
        gap: 10px 14px !important;
    }

    .dashboard-history-card > div[style*="height:320px"] {
        height: 250px !important;
    }

    .dashboard-accounts-card {
        order: 3;
    }

    .dashboard-history-card {
        order: 2;
    }

    .dashboard-goals-card {
        order: 4;
    }

    .dashboard-income-card {
        order: 5;
    }

    .dashboard-net-month-card {
        order: 6;
    }

    .dashboard-category-card {
        order: 7;
    }

    .dashboard-category-card #catMonthTableWrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    .statistics-page .statistics-summary-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .statistics-summary-grid > .card {
        min-height: 100px;
        padding: 16px;
    }

    .statistics-summary-grid > .card > div:nth-child(2),
    .statistics-summary-grid > .card > .text-teal {
        font-size: 1.22rem !important;
    }

    .statistics-page .card .card {
        padding: 14px;
        border-radius: 14px;
    }

    .assets-page .assets-header {
        display: flex;
    }

    .assets-page .assets-total-label {
        font-size: 0.68rem;
    }

    .assets-page .assets-total-value {
        font-size: 1.25rem;
    }

    .assets-page .assets-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .assets-page .assets-grid > div,
    .assets-page .asset-card {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .assets-page .table-scroll,
    .assets-page .asset-chart-block,
    .assets-page .asset-chart-canvas {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .assets-page .asset-card {
        min-height: 0;
        padding: 18px;
    }

    .assets-page .asset-chart-canvas {
        height: 220px;
    }

    .transactions-title-row {
        margin-bottom: 0 !important;
    }

    .transactions-title-row .btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        padding: 0;
        overflow: hidden;
        color: transparent;
        font-size: 0;
        border-radius: 50%;
    }

    .transactions-title-row .btn::before {
        content: "+";
        color: #ffffff;
        font-size: 1.45rem;
        line-height: 42px;
    }

    .transaction-tabs {
        margin: 0 -18px 14px !important;
        padding: 12px 18px 0;
        overflow-x: auto;
        flex-wrap: nowrap !important;
        background: #ffffff;
        scrollbar-width: none;
    }

    .transaction-tabs::-webkit-scrollbar {
        display: none;
    }

    .transaction-tabs a {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .upload-form {
        grid-template-columns: 1fr !important;
    }

    .upload-file-field,
    .upload-actions {
        grid-column: 1;
    }

    .upload-dropzone {
        min-height: 190px;
    }

    .upload-actions .btn {
        width: 100%;
    }

    .filter-card .flex.justify-between {
        align-items: flex-start;
        flex-direction: column;
    }

    .filter-card .flex.justify-between form {
        width: 100%;
    }

    .filter-card .flex.justify-between select {
        flex: 1;
    }

    .transaction-list-card {
        padding: 0 !important;
        overflow: visible !important;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .transaction-list-card > div:first-child {
        margin-bottom: 12px;
        padding: 12px 14px !important;
        border: 1px solid var(--mc-border);
        border-radius: 14px;
        background: #ffffff !important;
    }

    .transaction-list-card form > div[style*="overflow-x"] {
        overflow: visible !important;
    }

    .transaction-list-card table,
    .transaction-list-card tbody {
        display: block;
        width: 100%;
    }

    .transaction-list-card thead {
        display: none;
    }

    .transaction-list-card tbody tr {
        position: relative;
        margin-bottom: 12px;
        padding: 16px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 5px 12px;
        border: 1px solid var(--mc-border);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: var(--shadow-card);
    }

    .transaction-list-card tbody td {
        display: block;
        min-width: 0;
        padding: 0 !important;
        border: 0;
        background: transparent !important;
    }

    .transaction-list-card tbody td:nth-child(1) {
        grid-column: 1;
        grid-row: 2;
        color: var(--text-light);
        font-size: 0.72rem;
    }

    .transaction-list-card tbody td:nth-child(2) {
        grid-column: 1;
        grid-row: 1;
        padding-right: 8px !important;
        color: var(--text-dark);
        font-size: 0.96rem;
        font-weight: 800 !important;
    }

    .transaction-list-card tbody td:nth-child(3) {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        white-space: nowrap;
        font-size: 0.96rem !important;
        font-weight: 800;
    }

    .transaction-list-card tbody td:nth-child(4),
    .transaction-list-card tbody td:nth-child(6),
    .transaction-list-card tbody td:nth-child(7) {
        display: none !important;
    }

    .transaction-list-card tbody td:nth-child(5) {
        grid-column: 1;
        grid-row: 3;
        margin-top: 7px;
    }

    .transaction-list-card tbody td:nth-child(5) select {
        max-width: 190px !important;
        min-height: 34px;
        font-size: 0.76rem;
    }

    .transaction-list-card tbody td:nth-child(8) {
        grid-column: 2;
        grid-row: 3;
        align-self: center;
        font-size: 0.76rem;
    }

    .profile-page {
        display: block;
    }

    .profile-page > .card {
        margin-bottom: 16px;
    }

    .profile-page table {
        min-width: 760px;
    }

    .profile-preferences-card,
    .profile-language-card {
        min-height: 0;
    }

    .categories-page .page-title-row a {
        min-height: 34px;
        padding: 7px 10px !important;
        font-size: 0.72rem !important;
    }

    .categories-page table thead {
        display: none;
    }

    .categories-page table,
    .categories-page tbody {
        display: block;
    }

    .categories-page tbody tr {
        min-height: 52px;
        padding: 13px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        border-bottom: 1px solid #eef2f5;
    }

    .categories-page tbody tr:last-child {
        border-bottom: 0;
    }

    .categories-page tbody td {
        padding: 0 !important;
        border: 0;
    }

    .bottom-nav {
        display: flex;
    }

    .onboarding-banner {
        width: calc(100% - 24px);
        margin: 12px auto 0;
        border-radius: 14px;
    }

    .onboarding-banner .container {
        padding: 14px;
    }

    /* Auth mobile */
    .auth-shell {
        min-height: 100vh;
        display: block;
    }

    .auth-visual {
        min-height: 0;
        height: 245px;
        padding: 28px 24px 24px;
    }

    .auth-register-page .auth-visual {
        height: 260px;
        padding-top: 24px;
    }

    .auth-mascot {
        width: 112px;
        max-height: 120px;
    }

    .auth-register-page .auth-mascot {
        width: 88px;
        max-height: 90px;
    }

    .auth-visual-copy {
        margin-top: 10px;
        font-size: 1.4rem;
    }

    .auth-register-page .auth-visual-copy {
        margin-top: 5px;
        font-size: 1.28rem;
    }

    .auth-beta-pill {
        margin-bottom: 10px;
        padding: 6px 13px;
        font-size: 0.62rem;
    }

    .auth-form-panel {
        padding: 28px 24px 40px;
        flex-direction: column;
        align-items: stretch;
    }

    .auth-language-switch {
        position: static;
        align-self: flex-end;
        margin-bottom: 18px;
    }

    .auth-brand {
        display: none;
    }

    .auth-form-wrap h1 {
        margin-bottom: 22px;
        font-size: 1.82rem;
    }

    .auth-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .auth-field-wide {
        grid-column: 1;
    }

    .auth-field {
        margin-bottom: 15px;
    }

    .auth-grid .auth-field {
        margin-bottom: 0;
    }

    .auth-field input,
    .auth-field select {
        min-height: 48px;
    }

    .auth-help {
        max-height: 90px;
        overflow: auto;
    }

    .auth-submit {
        margin-top: 18px;
    }
}

@media (max-width: 430px) {
    .app-container {
        padding-right: 14px;
        padding-left: 14px;
    }

    .page-title-row,
    .page-header,
    .assets-page .assets-header {
        margin-right: -14px !important;
        margin-left: -14px !important;
        padding-right: 14px;
        padding-left: 14px;
    }

    .statistics-page .statistics-summary-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .card {
        padding: 17px;
    }

    .auth-form-panel {
        padding-right: 20px;
        padding-left: 20px;
    }
}

.title-with-guide {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.guide-help-link {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    color: #64748b;
    background: #fff;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.guide-help-link:hover,
.guide-help-link:focus-visible {
    border-color: var(--primary-teal);
    color: var(--primary-teal-dark);
    background: #ecfdf8;
    outline: none;
}

.guide-body h2[id] {
    scroll-margin-top: 96px;
}
