/* ---------- Design tokens ---------- */
:root {
    /* Brand + accent */
    --primary:        #2a3a6e;
    --primary-dark:   #1f2c54;
    --primary-light:  #e3e7f3;
    --accent:         #d97a3a;
    --accent-dark:    #b6602a;
    --accent-light:   #fbeede;

    /* Neutral surfaces */
    --bg:             #f6f5f1;       /* warm off-white page background */
    --surface:        #ffffff;       /* card surfaces */
    --surface-soft:   #fafaf7;       /* table headers, hover bg */
    --border:         #dfdcd2;       /* warm grey borders */
    --border-soft:    #ebe9e1;
    --line:           rgba(0, 0, 0, 0.06);

    /* Text */
    --text:           #20243a;
    --text-soft:      #565b73;
    --text-muted:     #8a8e9c;
    --text-inverse:   #ffffff;

    /* Status */
    --success:        #2f7d57;
    --success-light:  #e3f1ea;
    --error:          #b1463f;
    --error-light:    #fbe5e2;
    --warning:        #c08323;
    --warning-light:  #fbeed1;
    --info:           #3d6789;
    --info-light:     #e6eef4;

    /* Shape + depth */
    --radius:         8px;
    --radius-lg:      12px;
    --radius-pill:    999px;
    --shadow-sm:      0 1px 2px rgba(20, 24, 50, 0.06), 0 1px 1px rgba(20, 24, 50, 0.04);
    --shadow:         0 2px 6px rgba(20, 24, 50, 0.08), 0 1px 2px rgba(20, 24, 50, 0.05);
    --shadow-lg:      0 8px 24px rgba(20, 24, 50, 0.12), 0 2px 4px rgba(20, 24, 50, 0.06);

    /* Motion */
    --t:              160ms ease;

    /* Chart-only colors — exposed as vars so dark mode can re-tint them.
       SVGs reference these via currentColor / inline style where reasonable
       but a few are hard-coded; the override block below adjusts the static
       references too. */
    --chart-axis:     #cccccc;
    --chart-axis-text:#666666;
    --chart-line:     #20243a;
    --chart-line-dot: #20243a;
    --chart-cumul:    #d97a3a;
}

/* ---------- Dark mode ---------- */
/* Two paths to dark:
   1. Explicit user choice via cookie (server renders `:root.theme-dark`)
   2. System preference (only when user hasn't explicitly forced light)
   Duplicated block keeps both selectors independent. */
:root.theme-dark {
        /* Brand stays in the same hue family but lifted for contrast */
        --primary:        #6f80c4;
        --primary-dark:   #4a5a9a;
        --primary-light:  rgba(111, 128, 196, 0.18);
        --accent:         #e9905a;
        --accent-dark:    #c97843;
        --accent-light:   rgba(233, 144, 90, 0.18);

        --bg:             #14161f;
        --surface:        #1c1f2c;
        --surface-soft:   #232739;
        --border:         #353a52;
        --border-soft:    #2a2f44;
        --line:           rgba(255, 255, 255, 0.07);

        --text:           #e6e7ed;
        --text-soft:      #a8acbd;
        --text-muted:     #7a7f93;
        --text-inverse:   #14161f;

        --success:        #5fbb87;
        --success-light:  rgba(95, 187, 135, 0.16);
        --error:          #e07269;
        --error-light:    rgba(224, 114, 105, 0.18);
        --warning:        #e3b256;
        --warning-light:  rgba(227, 178, 86, 0.16);
        --info:           #6ea5d6;
        --info-light:     rgba(110, 165, 214, 0.18);

        --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
        --shadow:         0 2px 6px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
        --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.35);

    --chart-axis:     #3a3f55;
    --chart-axis-text:#7a7f93;
    --chart-line:     #c7cae0;
    --chart-line-dot: #c7cae0;
    --chart-cumul:    #e9905a;
}

/* Same dark palette via system preference, but only when the user
   has not explicitly forced light or dark via the toggle. */
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light):not(.theme-dark) {
        --primary:        #6f80c4;
        --primary-dark:   #4a5a9a;
        --primary-light:  rgba(111, 128, 196, 0.18);
        --accent:         #e9905a;
        --accent-dark:    #c97843;
        --accent-light:   rgba(233, 144, 90, 0.18);

        --bg:             #14161f;
        --surface:        #1c1f2c;
        --surface-soft:   #232739;
        --border:         #353a52;
        --border-soft:    #2a2f44;
        --line:           rgba(255, 255, 255, 0.07);

        --text:           #e6e7ed;
        --text-soft:      #a8acbd;
        --text-muted:     #7a7f93;
        --text-inverse:   #14161f;

        --success:        #5fbb87;
        --success-light:  rgba(95, 187, 135, 0.16);
        --error:          #e07269;
        --error-light:    rgba(224, 114, 105, 0.18);
        --warning:        #e3b256;
        --warning-light:  rgba(227, 178, 86, 0.16);
        --info:           #6ea5d6;
        --info-light:     rgba(110, 165, 214, 0.18);

        --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(0, 0, 0, 0.3);
        --shadow:         0 2px 6px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.35);
        --shadow-lg:      0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 4px rgba(0, 0, 0, 0.35);

        --chart-axis:     #3a3f55;
        --chart-axis-text:#7a7f93;
        --chart-line:     #c7cae0;
        --chart-line-dot: #c7cae0;
        --chart-cumul:    #e9905a;
    }
}

/* Chart-element overrides apply in both dark paths. */
:root.theme-dark .sparkline line[stroke="#ccc"],
:root:not(.theme-light) .sparkline line[stroke="#ccc"] { stroke: var(--chart-axis) !important; }
:root.theme-dark .sparkline text[fill="#777"],
:root.theme-dark .sparkline text[fill="#666"]   { fill:   var(--chart-axis-text) !important; }
:root.theme-dark .sparkline polyline[stroke="#335"] { stroke: var(--chart-line) !important; }
:root.theme-dark .sparkline circle[fill="#335"]     { fill:   var(--chart-line-dot) !important; }

@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) .sparkline text[fill="#777"],
    :root:not(.theme-light) .sparkline text[fill="#666"]   { fill:   var(--chart-axis-text) !important; }
    :root:not(.theme-light) .sparkline polyline[stroke="#335"] { stroke: var(--chart-line) !important; }
    :root:not(.theme-light) .sparkline circle[fill="#335"]     { fill:   var(--chart-line-dot) !important; }
}

/* Form input native chrome (date pickers, scrollbars) in dark mode. */
:root.theme-dark input,
:root.theme-dark select,
:root.theme-dark textarea { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
    :root:not(.theme-light) input,
    :root:not(.theme-light) select,
    :root:not(.theme-light) textarea { color-scheme: dark; }
}

/* Theme toggle button in nav */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-soft);
    color: var(--text-soft);
    font-size: 0.92rem;
    width: 2rem;
    height: 2rem;
    line-height: 1;
    border-radius: var(--radius-pill);
    padding: 0;
    cursor: pointer;
    box-shadow: none;
}
.theme-toggle:hover {
    background: var(--surface-soft);
    color: var(--text);
    transform: none;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

/* Hard guard: nothing should ever cause horizontal page scroll on mobile.
   If a child overflows, clip it — vertical scroll only. */
html, body { overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    margin: 0 auto;
    max-width: 920px;
    padding: 1rem 1.25rem 2.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main { padding-top: 0.25rem; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    color: var(--text);
    letter-spacing: -0.015em;
    line-height: 1.25;
}
h1 {
    font-size: 1.85rem;
    font-weight: 700;
    margin: 0.5rem 0 0.5rem;
    letter-spacing: -0.022em;
}
h2 {
    font-size: 1.18rem;
    font-weight: 600;
    margin: 1.75rem 0 0.6rem;
    padding-left: 0.65rem;
    border-left: 3px solid var(--primary);
}
h3 {
    font-size: 0.98rem;
    font-weight: 600;
    margin: 1.25rem 0 0.4rem;
    color: var(--text-soft);
}

p { margin: 0.5rem 0 0.85rem; }

a {
    color: var(--primary);
    transition: color var(--t);
    text-decoration-color: rgba(42, 58, 110, 0.3);
    text-underline-offset: 2px;
}
a:hover {
    color: var(--accent-dark);
    text-decoration-color: var(--accent-dark);
}

small { font-size: 0.83rem; }
.muted { color: var(--text-muted); }

/* ---------- Nav header ---------- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
nav .brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.02em;
}
nav .nav-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
nav .nav-link {
    color: var(--text-soft);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-pill);
    transition: background var(--t), color var(--t);
}
nav .nav-link:hover {
    background: var(--accent-light);
    color: var(--accent-dark);
}

/* ---------- Forms ---------- */
form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-width: 440px;
    margin: 1rem 0;
}
form.inline { display: inline; margin: 0; }

label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.88rem;
    color: var(--text-soft);
    font-weight: 500;
}

input, textarea, select {
    padding: 0.55rem 0.7rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    transition: border-color var(--t), box-shadow var(--t);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(42, 58, 110, 0.15);
}
input[disabled], select[disabled] {
    background: var(--surface-soft);
    color: var(--text-muted);
    cursor: not-allowed;
}

textarea { resize: vertical; min-height: 4em; }

/* ---------- Buttons ---------- */
button, .button {
    background: var(--primary);
    color: var(--text-inverse);
    border: 1px solid var(--primary);
    cursor: pointer;
    padding: 0.55rem 1.1rem;
    text-decoration: none;
    display: inline-block;
    align-self: flex-start;
    font-weight: 600;
    font-size: 0.92rem;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
}
button:hover, .button:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--text-inverse);
}
button:active, .button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.button-secondary {
    background: var(--surface);
    color: var(--text-soft);
    border: 1px solid var(--border);
    padding: 0.5rem 0.95rem;
    border-radius: 6px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--t);
    align-self: stretch;
}
.button-secondary:hover {
    background: var(--surface-soft);
    color: var(--text);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.link-button {
    background: none;
    color: var(--primary);
    padding: 0;
    border: none;
    text-decoration: underline;
    text-decoration-color: rgba(42, 58, 110, 0.3);
    text-underline-offset: 2px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: none;
}
.link-button:hover {
    background: none;
    color: var(--accent-dark);
    text-decoration-color: var(--accent-dark);
    transform: none;
    box-shadow: none;
}

/* ---------- Lists ---------- */
ul.group-list, ul.member-list, .balance-list,
.suggestion-list, .expense-list, .settlement-list, .fun-facts {
    list-style: none;
    padding-left: 0;
    margin: 0.5rem 0;
}

ul.group-list li, ul.member-list li, .balance-list li,
.suggestion-list li, .expense-list li, .settlement-list li {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border-soft);
}
ul.group-list li:last-child, ul.member-list li:last-child,
.balance-list li:last-child, .suggestion-list li:last-child,
.expense-list li:last-child, .settlement-list li:last-child {
    border-bottom: none;
}

.expense-list li, .settlement-list li {
    transition: background var(--t);
    padding-left: 0.6rem;
    margin-left: -0.6rem;
    border-radius: 6px;
}
.bulk-check {
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
    cursor: pointer;
}
.bulk-check input[type="checkbox"] {
    width: auto;
    margin: 0;
    vertical-align: middle;
}
.bulk-toggle {
    margin: 0.5rem 0 0.25rem 0.6rem;
}
.bulk-toggle label {
    flex-direction: row !important;
    cursor: pointer;
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}
.bulk-toggle input[type="checkbox"] {
    width: auto;
    margin: 0;
}
.expense-list li:hover, .settlement-list li:hover {
    background: var(--surface-soft);
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: var(--radius-pill);
    font-size: 0.74rem;
    font-weight: 600;
    margin-left: 0.3rem;
    letter-spacing: 0.01em;
}
.badge-success { background: var(--success-light); color: var(--success); }
.badge-admin   { background: var(--accent-light); color: var(--accent-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning); }

/* ---------- Flash messages ---------- */
.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
    border-left: 3px solid;
}
.flash-info    { background: var(--info-light);    color: var(--info);    border-left-color: var(--info); }
.flash-success { background: var(--success-light); color: var(--success); border-left-color: var(--success); }
.flash-error   { background: var(--error-light);   color: var(--error);   border-left-color: var(--error); }
.flash-warning { background: var(--warning-light); color: var(--warning); border-left-color: var(--warning); }

/* ---------- Sections ---------- */
section { margin: 1.5rem 0; }
section > h2:first-child { margin-top: 0; }

/* ---------- Group view header ---------- */
.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 0.25rem;
}
.group-header h1 { margin: 0; }
.group-color-dot {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    margin-right: 0.45rem;
    vertical-align: middle;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset;
}

/* ---------- Dashboard: summary cards ---------- */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin: 1.25rem 0 2rem;
}
@media (max-width: 600px) {
    .summary-cards { grid-template-columns: 1fr; }
}
.summary-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1rem 1.25rem;
    text-align: center;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-soft);
    transition: transform var(--t), box-shadow var(--t);
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.summary-card-highlight {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary-dark);
    color: var(--text-inverse);
}
.summary-card-highlight .summary-label { color: rgba(255,255,255,0.78); }
.summary-card-highlight .summary-value,
.summary-card-highlight .summary-value.positive,
.summary-card-highlight .summary-value.negative,
.summary-card-highlight .summary-value.neutral { color: var(--text-inverse); }

.summary-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.summary-value {
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.positive { color: var(--success); }
.negative { color: var(--error); }
.neutral  { color: var(--text-soft); }

/* ---------- Dashboard: lifetime stat tiles ---------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
    margin: 0.5rem 0 1.25rem;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
    font-weight: 600;
}
.stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* ---------- Dashboard: fun facts ---------- */
.fun-facts li {
    padding: 0.65rem 0.9rem;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.fact-icon {
    font-size: 1.05rem;
    margin-right: 0.4rem;
}

/* ---------- Dashboard: balance bars ---------- */
.balance-bars {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    margin: 1rem 0;
}
.balance-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 2fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.5rem 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--t), transform var(--t);
}
.balance-row:hover {
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}
.balance-row-pinned {
    background: linear-gradient(to right, var(--accent-light), var(--surface) 40%);
}
@media (max-width: 600px) {
    .balance-row { grid-template-columns: 1fr; }
}
.balance-name { font-size: 0.95rem; }
.balance-name a { font-weight: 600; text-decoration: none; }
.balance-name a:hover { text-decoration: underline; }
.balance-name .muted { display: block; font-size: 0.75rem; }
.balance-bar-track {
    position: relative;
    height: 14px;
    background: var(--surface-soft);
    border-radius: 7px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}
.balance-bar-zero {
    position: absolute;
    left: 50%; top: 0; bottom: 0;
    width: 1px;
    background: var(--text-muted);
    opacity: 0.4;
}
.balance-bar {
    position: absolute;
    top: 2px; bottom: 2px;
    border-radius: 4px;
}
.balance-bar.positive { background: var(--success); }
.balance-bar.negative { background: var(--error); }
.balance-amount {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* ---------- Dashboard: per-group mini sparkline (last 6 months) ---------- */
.mini-sparkline {
    display: block;
    width: 70px;
    height: 16px;
    margin-top: 0.3rem;
    color: var(--primary);
    opacity: 0.65;
}

/* ---------- Dashboard: sparkline ---------- */
.sparkline {
    width: 100%;
    max-width: 720px;
    height: auto;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0.6rem;
    box-shadow: var(--shadow-sm);
}

/* ---------- Tables (cost-table, admin tables) ---------- */
.cost-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    margin: 0.75rem 0;
    font-size: 0.92rem;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-soft);
}
.cost-table th, .cost-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}
.cost-table th {
    background: var(--surface-soft);
    font-weight: 600;
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cost-table tbody tr:last-child td { border-bottom: none; }
.cost-table tbody tr { transition: background var(--t); }
.cost-table tbody tr:hover { background: var(--surface-soft); }

/* ---------- Tag chips ---------- */
.tag-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.6rem 0;
    align-items: center;
}
.chip {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    padding: 0.28rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--t), transform var(--t);
    box-shadow: none;
}
.chip:hover {
    background: #d6dcea;
    transform: translateY(-1px);
}
.chip-off { background: var(--error-light); color: var(--error); }
.chip-off:hover { background: #f6d3ce; }

/* ---------- Expense form layout helpers ---------- */
fieldset.participants {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    margin: 0.5rem 0;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}
fieldset.participants legend {
    padding: 0 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.checkbox-row {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] { width: auto; }

.participant-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.participant-row:last-child { border-bottom: none; }
.participant-row .checkbox-row { flex: 1; margin: 0; }

.weight-input {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-soft);
}

.inline-form {
    display: inline-block;
    margin: 0.5rem 0;
}

/* ---------- Multi-currency rows ---------- */
.category-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    margin: 0.5rem 0;
}
.category-row label { margin: 0; }

.amount-row, .rate-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    margin: 0.5rem 0;
}
.amount-row label, .rate-row label { margin: 0; }
.converted-hint {
    margin: -0.2rem 0 0.75rem 0;
    font-style: italic;
    color: var(--text-muted);
}

/* ---------- Split mode picker ---------- */
.split-mode-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 0.55rem 0.85rem;
    background: var(--primary-light);
    border-radius: var(--radius);
    margin: 0.5rem 0;
    font-size: 0.92rem;
    color: var(--text);
}
.split-mode-picker label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    margin: 0;
    color: var(--text);
}
.split-sum {
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: right;
}

/* ---------- Attachments ---------- */
.attachments-section {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
}
.attachment-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}
.attachment-item {
    display: flex;
    flex-direction: column;
    width: 200px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--t), box-shadow var(--t);
}
.attachment-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.attachment-thumb {
    height: 140px;
    background: var(--surface-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}
.attachment-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.attachment-icon {
    font-size: 2rem;
    color: var(--text-soft);
}
.attachment-meta {
    padding: 0.55rem 0.7rem;
    font-size: 0.85rem;
}
.attachment-meta strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.attachment-item .inline-form {
    padding: 0.4rem 0.7rem;
    border-top: 1px solid var(--border-soft);
    text-align: right;
    margin: 0;
}

/* ---------- Drag-and-drop file zone ---------- */
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 96px;
    padding: 1rem;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--text-soft);
    font-size: 0.92rem;
    cursor: pointer;
    transition: background var(--t), border-color var(--t);
    text-align: center;
    margin: 0.5rem 0;
}
.dropzone:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.dropzone-hot {
    background: var(--accent-light) !important;
    border-color: var(--accent-dark) !important;
    color: var(--accent-dark) !important;
}
.dropzone-files:not(:empty) {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text);
}

/* ---------- Placeholder rows (offene Posten) ---------- */
.placeholder-row { background: var(--warning-light); }
.placeholder-row td { border-color: rgba(192, 131, 35, 0.25); }

.placeholder-toggle {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.5rem;
    margin: 0.25rem 0;
    background: var(--warning-light);
    border-radius: var(--radius);
    border-left: 3px solid var(--warning);
}

/* ---------- Action row (CTA + secondary side by side) ---------- */
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.5rem 0 0.75rem;
}

/* ---------- Filter panel ---------- */
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    margin: 0.5rem 0 1rem;
    box-shadow: var(--shadow-sm);
}
.filter-panel summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-soft);
    padding: 0.25rem 0;
    user-select: none;
}
.filter-panel summary::marker { color: var(--text-muted); }
.filter-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 0.6rem;
    margin: 0.75rem 0 0;
    max-width: none;
}
@media (max-width: 700px) {
    .filter-form { grid-template-columns: 1fr 1fr; }
}
.filter-form label { margin: 0; }
.filter-buttons {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.filter-quick-dates {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: -0.2rem;
}
.filter-quick-dates button[data-range] {
    background: var(--surface-soft);
    color: var(--text-soft);
    border: 1px solid var(--border-soft);
    padding: 0.25rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    cursor: pointer;
    box-shadow: none;
}
.filter-quick-dates button[data-range]:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-light);
    transform: none;
}

/* ---------- Expense notes display ---------- */
.expense-note {
    background: var(--surface-soft);
    border-left: 3px solid var(--border);
    padding: 0.4rem 0.7rem;
    margin-top: 0.4rem;
    font-size: 0.88rem;
    color: var(--text-soft);
    border-radius: 0 4px 4px 0;
    white-space: pre-wrap;
}

/* ---------- Pie chart ---------- */
.pie-wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    background: var(--surface);
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.pie-svg {
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}
.pie-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    min-width: 200px;
}
.pie-legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.92rem;
}
.pie-legend li:last-child { border-bottom: none; }
.pie-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ---------- Avatars (letter circles) ---------- */
.avatar {
    display: inline-block;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
    margin-right: 0.35rem;
    vertical-align: middle;
    box-shadow: var(--shadow-sm);
    user-select: none;
}

/* ---------- Activity feed ---------- */
.activity-feed {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 1rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.activity-feed li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border-soft);
    font-size: 0.92rem;
}
.activity-feed li:last-child { border-bottom: none; }
.activity-feed li:hover { background: var(--surface-soft); }
.activity-icon {
    font-size: 1rem;
    flex-shrink: 0;
}
.activity-avatar {
    flex-shrink: 0;
}
.activity-text {
    flex: 1;
    line-height: 1.4;
}
.activity-text strong { font-weight: 600; }

/* ---------- Top counterparties bars ---------- */
.counterparty-bars {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}
.counterparty-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.6fr) 1fr auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-soft);
}
.counterparty-row:last-child { border-bottom: none; }
.counterparty-name { font-weight: 600; }
.counterparty-track {
    height: 12px;
    background: var(--surface-soft);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-soft);
}
.counterparty-bar {
    height: 100%;
    border-radius: 5px;
    transition: width var(--t);
}
.counterparty-bar.positive { background: var(--success); }
.counterparty-bar.negative { background: var(--error); }
.counterparty-amount {
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
    letter-spacing: -0.01em;
}

/* ---------- Archive ---------- */
.archive-section {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.archive-section h2 {
    margin-top: 0;
    border-left-color: var(--text-muted);
}
.archive-link {
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius);
}
.archive-link a {
    color: var(--text-soft);
    font-weight: 500;
}

/* ---------- Onboarding / welcome panel ---------- */
.welcome-panel {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem 1.75rem;
    margin: 2rem 0;
}
.welcome-hero {
    text-align: center;
    margin-bottom: 2rem;
}
.welcome-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
}
.welcome-hero h2 {
    border-left: none;
    padding-left: 0;
    margin: 0.4rem 0 0.6rem;
    font-size: 1.55rem;
}
.welcome-hero p {
    max-width: 540px;
    margin: 0 auto;
    color: var(--text-soft);
}
.welcome-steps {
    list-style: none;
    counter-reset: welcome;
    padding: 0;
    margin: 1.5rem 0;
    display: grid;
    gap: 0.85rem;
}
.welcome-steps li {
    counter-increment: welcome;
    background: var(--surface-soft);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem 0.9rem 3rem;
    position: relative;
}
.welcome-steps li::before {
    content: counter(welcome);
    position: absolute;
    left: 0.85rem;
    top: 0.85rem;
    width: 1.6rem;
    height: 1.6rem;
    line-height: 1.6rem;
    text-align: center;
    background: var(--primary);
    color: var(--text-inverse);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.85rem;
}
.welcome-steps strong {
    display: block;
    margin-bottom: 0.2rem;
}
.welcome-cta {
    text-align: center;
    margin-top: 1.5rem;
}
.welcome-cta .button {
    font-size: 1rem;
    padding: 0.7rem 1.4rem;
}

/* ---------- 2FA setup ---------- */
.setup-steps {
    padding-left: 1.25rem;
}
.setup-steps li {
    margin-bottom: 1rem;
    line-height: 1.55;
}
.kv-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.4rem 1rem;
    margin: 0.6rem 0;
}
.kv-grid dt {
    color: var(--text-soft);
    font-weight: 500;
    font-size: 0.88rem;
}
.kv-grid dd {
    margin: 0;
}
.totp-secret {
    font-size: 1.15rem;
    letter-spacing: 0.05em;
    padding: 0.3rem 0.6rem;
    background: var(--primary-light);
    border-radius: 4px;
    user-select: all;
}
.totp-qr-caption {
    margin: 0.85rem 0 0.25rem;
}
.totp-qr {
    display: block;
    width: 218px;
    margin: 0;
    padding: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    line-height: 0;
    min-height: 210px;
}
.totp-qr img,
.totp-qr canvas,
.totp-qr table {
    display: block;
    margin: 0;
}
.otpauth-link {
    word-break: break-all;
    font-size: 0.85rem;
    color: var(--text-soft);
}
.totp-confirm {
    margin-top: 0.5rem;
    max-width: 320px;
}
.backup-codes-block {
    font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
    font-size: 1.1rem;
    line-height: 1.8;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    letter-spacing: 0.05em;
    user-select: all;
}

/* ---------- Error page ---------- */
.error-page {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
    max-width: 520px;
    margin: 0 auto;
}
.error-code {
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.error-page h1 {
    margin: 0.25rem 0 0.75rem;
}
.error-message {
    color: var(--text-soft);
    font-size: 1.02rem;
    margin: 0.5rem 0 1.5rem;
}
.error-page .action-row {
    justify-content: center;
}

/* ---------- Misc ---------- */
hr {
    border: none;
    border-top: 1px solid var(--border-soft);
    margin: 1.5rem 0;
}

::selection { background: var(--accent-light); color: var(--accent-dark); }

/* ---------- Print ---------- */
/* Goal: a group page should print as a clean one-page-ish summary —
   black-on-white, no nav/buttons/forms/shadows, link text remains
   readable. Targeted at the group show / show_household views; the
   dashboard prints fine with the same rules. */
@media print {
    body {
        background: #fff !important;
        color: #000 !important;
        max-width: none;
        padding: 0.5cm 1cm 1cm;
        font-size: 11pt;
    }
    nav, .flash, .action-row, .filter-panel, form,
    .archive-link, .welcome-cta,
    .activity-feed, /* live noise */
    .pie-wrap,      /* heavy graphic */
    .balance-bar-track,
    .mini-sparkline,
    .group-color-dot,
    .theme-toggle,
    button, .button, .button-secondary, .link-button {
        display: none !important;
    }
    a {
        color: #000 !important;
        text-decoration: none !important;
    }
    .summary-cards { display: block; }
    .summary-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        background: #fff !important;
        margin-bottom: 0.5rem;
        page-break-inside: avoid;
    }
    h1 { font-size: 16pt; }
    h2 { font-size: 13pt; border-left: 2px solid #000; }
    h3 { font-size: 11pt; }
    .cost-table, .balance-row, .expense-list li, .settlement-list li,
    .suggestion-list li, .balance-list li, .summary-card,
    .stat-card, .activity-feed li, .fun-facts li {
        page-break-inside: avoid;
    }
    .cost-table {
        border: 1px solid #aaa !important;
        background: #fff !important;
        box-shadow: none !important;
    }
    .cost-table th, .cost-table td {
        border-bottom: 1px solid #ddd !important;
    }
    .balance-row {
        background: #fff !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
    /* Charts: keep the SVGs (they shrink to fit) but flatten colors */
    .sparkline {
        background: #fff !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}

/* ---------- Mobile pass ---------- */

/* Tables: horizontally scroll inside the cell box on narrow screens,
   rather than blowing past the viewport and forcing the whole page wide. */
/* Below 700px, the cost-table morphs into a stack of cards:
   thead hidden, every row is a card, every cell becomes a "label: value"
   row pulled from data-label. First cell = card title, action cells (no
   data-label) align left without a pseudo-label. */
@media (max-width: 700px) {
    .cost-table,
    .cost-table thead,
    .cost-table tbody,
    .cost-table tr,
    .cost-table th,
    .cost-table td { display: block; }

    .cost-table {
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
        padding: 0;
        margin: 0.6rem 0;
    }
    .cost-table thead { display: none; }

    .cost-table tr {
        background: var(--surface);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius);
        box-shadow: var(--shadow-sm);
        margin-bottom: 0.55rem;
        padding: 0.4rem 0.85rem;
    }
    .cost-table tr:hover { background: var(--surface); }
    .cost-table tr.placeholder-row {
        background: var(--warning-light);
        border-color: rgba(192, 131, 35, 0.35);
    }

    .cost-table td {
        border-bottom: 1px solid var(--border-soft);
        padding: 0.45rem 0;
    }
    .cost-table td:last-child { border-bottom: none; }

    /* First cell = bold card title (no data-label needed) */
    .cost-table td:first-child {
        font-weight: 600;
        font-size: 1rem;
        color: var(--text);
        padding: 0.3rem 0 0.55rem;
    }

    /* Subsequent cells: label-value pair, right-aligned value */
    .cost-table td:not(:first-child) {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.85rem;
        text-align: right;
    }
    .cost-table td:not(:first-child)[data-label]::before {
        content: attr(data-label);
        flex: 0 0 auto;
        font-weight: 600;
        color: var(--text-soft);
        font-size: 0.74rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: left;
    }
    /* Action cells (no data-label): no label, left-aligned content */
    .cost-table td:not(:first-child):not([data-label]) {
        justify-content: flex-start;
        text-align: left;
    }
}

/* Long unbroken strings (URLs in notes, long category names, etc.) should
   wrap instead of forcing the parent wider than the viewport. */
body { overflow-wrap: anywhere; word-break: normal; }

/* Filter form: 2 columns at <=700px is already cramped on phones — drop to 1. */
@media (max-width: 480px) {
    .filter-form { grid-template-columns: 1fr; }
}

/* Counterparty rows: stack name above the bar so the bar gets full width. */
@media (max-width: 500px) {
    .counterparty-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name amount"
            "bar  bar";
        row-gap: 0.35rem;
    }
    .counterparty-name   { grid-area: name; }
    .counterparty-amount { grid-area: amount; }
    .counterparty-track  { grid-area: bar; }
}

/* Phone-only tightening: padding, nav, headline scale, pie shrink. */
@media (max-width: 500px) {
    body {
        padding: 0.75rem 0.85rem 2rem;
        font-size: 14.5px;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.08rem; margin-top: 1.4rem; }

    nav {
        padding: 0.5rem 0.7rem;
        margin-bottom: 1rem;
        gap: 0.4rem;
    }
    nav .brand { font-size: 1rem; }
    nav .nav-right { gap: 0.15rem; flex-wrap: wrap; justify-content: flex-end; }
    nav .nav-link {
        font-size: 0.82rem;
        padding: 0.3rem 0.5rem;
    }

    .pie-wrap { padding: 0.75rem; gap: 0.85rem; }
    .pie-svg  { width: 170px; height: 170px; }
    .pie-legend { min-width: 0; font-size: 0.88rem; }

    /* Action rows (buttons next to each other) wrap full-width so taps are easy */
    .action-row .button,
    .action-row .button-secondary { flex: 1 1 auto; text-align: center; }
}

/* ---------- Account hub (Phase 67) ---------- */
.account-hub {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.25rem 0 1.5rem;
}
@media (max-width: 760px) {
    .account-hub { grid-template-columns: 1fr; }
}
.account-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.15rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: transform var(--t), box-shadow var(--t), border-color var(--t);
    min-height: 11rem;
}
.account-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}
.account-card-head {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.65rem;
    border-left: 3px solid var(--primary);
    padding-left: 0.55rem;
    line-height: 1.1;
}
.account-card-body {
    flex: 1;
    font-size: 0.9rem;
}
.account-card-body .muted { margin: 0.2rem 0; }
.account-card-line {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.2rem 0;
    border-bottom: 1px dashed var(--border-soft);
}
.account-card-line:last-child { border-bottom: 0; }
.account-card-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.account-card-value {
    font-weight: 600;
    text-align: right;
    overflow-wrap: anywhere;
}
.account-card-status {
    font-weight: 700;
    margin: 0 0 0.35rem;
}
.account-card-status.positive { color: var(--success); }
.account-card-status.negative { color: var(--accent); }
.account-card-action {
    margin-top: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-align: right;
}

/* --- Keycloak / SSO login (Phase Keycloak) ------------------------------- */
.sso-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.4rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.sso-divider::before,
.sso-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border);
}
.sso-divider span { padding: 0 0.8rem; }

.btn-sso {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    padding: 0.7rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--surface);
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn-sso:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* --- Login: discreet local-admin link + static hub card (Phase 72) ------- */
.login-admin-link {
    margin-top: 1.3rem;
    text-align: center;
    font-size: 0.85rem;
}
.login-admin-link a { color: var(--text-muted); }
.login-admin-link a:hover { color: var(--primary); }

/* Non-clickable hub card (e.g. "verwaltet über Dobbys-Welt") */
.account-card-static {
    cursor: default;
    opacity: 0.92;
}
.account-card-static:hover {
    transform: none;
    box-shadow: none;
}

/* --- Avatar photo (Phase: Avatar upload) --------------------------------- */
/* Uploaded photo reuses .avatar (round, shadow); just needs cover-fit so a
   non-square image isn't distorted, and no text styling. */
.avatar-img {
    object-fit: cover;
    background: var(--surface-soft);
    padding: 0;
}

/* Avatar editor on /me/profile */
.avatar-edit {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.6rem;
    padding: 1rem 1.1rem;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
}
.avatar-edit-current .avatar {
    margin-right: 0;
}
.avatar-edit-forms {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
    min-width: 220px;
}
.avatar-edit-forms form {
    margin: 0;
}

/* --- Group images (Phase: group images) ---------------------------------- */
.group-header-image {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.5rem;
    box-shadow: var(--shadow-sm);
}
.group-thumb {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.45rem;
    box-shadow: var(--shadow-sm);
}
