/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Light theme (default) */
    --color-bg: #f5f5f7;
    --color-surface: #ffffff;
    --color-surface-secondary: #f0f0f2;
    --color-text: #1c1c1e;
    --color-text-secondary: #6c6c70;
    --color-text-tertiary: #737378;
    --color-border: #e5e5ea;
    --color-primary: #007aff;
    --color-primary-hover: #0051d5;
    --color-success: #34c759;
    --color-warning: #ff9500;
    --color-danger: #ff3b30;
    --color-danger-hover: #e0332b;
    --color-pending: #ffcc00;
    --color-info: #0ea5e9;
    --color-muted: #6b7280;

    /* Themed surfaces & accents (light) */
    --color-danger-bg: #fff0f0;
    --color-danger-border: #fecaca;
    --color-danger-soft: rgba(239, 68, 68, 0.1);
    --color-success-bg: #f0fff4;
    --color-success-text: #1a7f37;
    --color-info-bg: #e8f4fd;
    --color-info-light: #bae6fd;
    --color-info-gradient: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    --color-frozen-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --color-overlay: rgba(0, 0, 0, 0.4);
    --color-loader-track: rgba(0, 0, 0, 0.15);
    --color-loader-track-on-primary: rgba(255, 255, 255, 0.3);
    --color-primary-focus: rgba(0, 122, 255, 0.15);
    --color-google-text: #444;

    /* Theme-color meta tag value (used by app.js) */
    --color-theme-meta: #ffffff;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);

    --safe-top: env(safe-area-inset-top, 0);
    --safe-bottom: env(safe-area-inset-bottom, 0);

    --nav-height: 64px;
    --header-height: 56px;
}

/* Dark theme — applied via [data-theme="dark"] on <html> */
[data-theme="dark"] {
    --color-bg: #000000;
    --color-surface: #1c1c1e;
    --color-surface-secondary: #2c2c2e;
    --color-text: #f2f2f7;
    --color-text-secondary: #a1a1a6;
    --color-text-tertiary: #8e8e93;
    --color-border: #38383a;
    --color-primary: #0a84ff;
    --color-primary-hover: #409cff;
    --color-success: #30d158;
    --color-warning: #ff9f0a;
    --color-danger: #ff453a;
    --color-danger-hover: #ff6961;
    --color-pending: #ffd60a;
    --color-info: #38bdf8;
    --color-muted: #98989f;

    --color-danger-bg: rgba(255, 69, 58, 0.16);
    --color-danger-border: rgba(255, 69, 58, 0.4);
    --color-danger-soft: rgba(255, 69, 58, 0.18);
    --color-success-bg: rgba(48, 209, 88, 0.15);
    --color-success-text: #4ade80;
    --color-info-bg: rgba(56, 189, 248, 0.15);
    --color-info-light: rgba(56, 189, 248, 0.3);
    --color-info-gradient: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(56, 189, 248, 0.32) 100%);
    --color-frozen-gradient: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.2) 100%);
    --color-overlay: rgba(0, 0, 0, 0.6);
    --color-loader-track: rgba(255, 255, 255, 0.2);
    --color-loader-track-on-primary: rgba(255, 255, 255, 0.3);
    --color-primary-focus: rgba(10, 132, 255, 0.3);
    --color-google-text: #f2f2f7;

    --color-theme-meta: #1c1c1e;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
}

/* Auto dark theme via system preference (only when no explicit choice) */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --color-bg: #000000;
        --color-surface: #1c1c1e;
        --color-surface-secondary: #2c2c2e;
        --color-text: #f2f2f7;
        --color-text-secondary: #a1a1a6;
        --color-text-tertiary: #8e8e93;
        --color-border: #38383a;
        --color-primary: #0a84ff;
        --color-primary-hover: #409cff;
        --color-success: #30d158;
        --color-warning: #ff9f0a;
        --color-danger: #ff453a;
        --color-danger-hover: #ff6961;
        --color-pending: #ffd60a;
        --color-info: #38bdf8;
        --color-muted: #98989f;
        --color-danger-bg: rgba(255, 69, 58, 0.16);
        --color-danger-border: rgba(255, 69, 58, 0.4);
        --color-danger-soft: rgba(255, 69, 58, 0.18);
        --color-success-bg: rgba(48, 209, 88, 0.15);
        --color-success-text: #4ade80;
        --color-info-bg: rgba(56, 189, 248, 0.15);
        --color-info-light: rgba(56, 189, 248, 0.3);
        --color-info-gradient: linear-gradient(135deg, rgba(56, 189, 248, 0.18) 0%, rgba(56, 189, 248, 0.32) 100%);
        --color-frozen-gradient: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(56, 189, 248, 0.2) 100%);
        --color-overlay: rgba(0, 0, 0, 0.6);
        --color-loader-track: rgba(255, 255, 255, 0.2);
        --color-primary-focus: rgba(10, 132, 255, 0.3);
        --color-google-text: #f2f2f7;
        --color-theme-meta: #1c1c1e;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.5);
        --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.6);
    }
}

/* Use color-scheme so native form controls follow theme */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { color-scheme: dark; }
}

/* Body locked when modal is open (prevents background scroll) */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* CTA banner — soft inline action, e.g. "Complete your profile to vote" */
.cta-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: var(--color-info-bg);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
    border: 1px solid transparent;
    transition: border-color 0.15s, transform 0.15s;
}

.cta-banner:hover { border-color: var(--color-info); }
.cta-banner:active { transform: scale(0.99); }

.cta-banner > i:first-child {
    color: var(--color-warning);
    font-size: 20px;
    flex-shrink: 0;
}

.cta-banner .cta-text { flex: 1; }

.cta-banner > i:last-child {
    color: var(--color-text-tertiary);
    font-size: 14px;
}

/* Pull-to-refresh indicator */
.ptr-indicator {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-size: 13px;
    pointer-events: none;
    overflow: hidden;
    transition: height 0.18s ease;
    background: var(--color-bg);
    z-index: 2;
}

.ptr-indicator.active { height: 48px; }
.ptr-indicator i { margin-right: 6px; font-size: 16px; transition: transform 0.18s; }
.ptr-indicator.armed i { transform: rotate(180deg); }
.ptr-indicator.refreshing i { animation: spin 0.8s linear infinite; }

/* Confirm dialog — narrower than full action sheet */
.modal-content.modal-confirm {
    max-width: 380px;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    border-radius: var(--radius-xl);
}

/* Toast container — fixed at top, mobile-first */
.toast-container {
    position: fixed;
    top: calc(var(--safe-top) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 24px);
    max-width: 440px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--color-surface);
    color: var(--color-text);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--color-primary);
    font-size: 14px;
    line-height: 1.4;
    animation: toast-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
    word-break: break-word;
}

.toast.toast-leaving {
    animation: toast-out 0.18s ease forwards;
}

.toast .toast-icon {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
    margin-top: 1px;
}

.toast .toast-text {
    flex: 1;
    min-width: 0;
}

.toast .toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-tertiary);
    padding: 2px;
    margin: -2px -2px -2px 0;
    font-size: 16px;
    line-height: 1;
}

.toast.toast-error    { border-left-color: var(--color-danger);  }
.toast.toast-success  { border-left-color: var(--color-success); }
.toast.toast-warning  { border-left-color: var(--color-warning); }
.toast.toast-info     { border-left-color: var(--color-info);    }

.toast.toast-error    .toast-icon { color: var(--color-danger);  }
.toast.toast-success  .toast-icon { color: var(--color-success); }
.toast.toast-warning  .toast-icon { color: var(--color-warning); }
.toast.toast-info     .toast-icon { color: var(--color-info);    }

@keyframes toast-in {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}
@keyframes toast-out {
    from { transform: translateY(0);     opacity: 1; }
    to   { transform: translateY(-12px); opacity: 0; }
}

/* Skeleton loader for cards */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-surface-secondary) 0%,
        var(--color-border) 50%,
        var(--color-surface-secondary) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 110px;
    border-radius: var(--radius-lg);
}

@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Empty state with call-to-action */
.empty-cta {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
}

.empty-cta .empty-icon {
    font-size: 48px;
    color: var(--color-text-tertiary);
    margin-bottom: 12px;
    line-height: 1;
}

.empty-cta .empty-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}

.empty-cta .empty-hint {
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    max-width: 280px;
    margin: 0 auto;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

.hidden {
    display: none !important;
}

/* Phosphor Icons */
.ph {
    font-size: 1.2em;
    vertical-align: middle;
    line-height: 1;
}

.ph-fill {
    font-weight: 700;
}

.nav-icon .ph {
    font-size: 24px;
}

.logo-icon .ph {
    font-size: 32px;
    color: var(--color-primary);
}

.profile-avatar .ph {
    font-size: 48px;
    color: var(--color-text-secondary);
}

.member-avatar .ph,
.request-avatar .ph {
    font-size: 20px;
    color: var(--color-text-secondary);
}

.voting-status .ph {
    font-size: 16px;
}

#app {
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    background: var(--color-surface);
    position: relative;
    overflow: hidden;
}

/* Screen Management */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    overflow: hidden;
}

.screen.hidden {
    display: none;
}

.screen-header {
    height: var(--header-height);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
    padding-top: var(--safe-top);
}

.screen-header h2 {
    font-size: 18px;
    font-weight: 600;
}

/* Header actions row (info + create/action buttons) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Info button (circle with i) */
.btn-info {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-info:hover {
    background: var(--color-surface-secondary);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-info:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.screen-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 16px);
    -webkit-overflow-scrolling: touch;
}

/* Auth Screen */
#auth-screen,
#loading-screen {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: safe center;
    padding: 32px 32px 48px;
    text-align: center;
    min-height: 100%;
    width: 100%;
}

/* Compact layout: fits a single phone screen, no scroll */
.auth-container.auth-compact {
    padding: calc(var(--safe-top) + 16px) 24px calc(var(--safe-bottom) + 16px);
    justify-content: flex-start;
    gap: 12px;
}

.auth-container.auth-compact .logo {
    margin-bottom: 8px;
}

.auth-container.auth-compact .auth-form {
    gap: 10px;
}

.auth-container.auth-compact .auth-divider {
    margin: 6px 0;
}

.auth-language-selector {
    align-self: flex-end;
    margin-bottom: 8px;
}

/* Inline logo: icon + (title + subtitle) horizontally — saves vertical space.
   `display: flex` is required — without it, flex-direction is a no-op and the
   icon stacks above the text. */
.logo.logo-inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: left;
    margin-bottom: 12px;
}

.logo.logo-inline .logo-icon {
    font-size: 44px;
    margin-bottom: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    line-height: 1;
}

.logo.logo-inline .logo-icon .ph {
    font-size: 44px;
    line-height: 1;
}

.logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
}

.logo:not(.logo-inline) .logo-img {
    width: 96px;
    height: 96px;
}

.logo.logo-inline .logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo.logo-inline .logo-text h1 {
    font-size: 26px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.logo.logo-inline .logo-text p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.2;
}

/* Inline links row: "Forgot password? · Register" */
.auth-links-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.auth-links-row .auth-link {
    margin-top: 0;
}

.auth-link-separator {
    color: var(--color-text-tertiary);
    font-weight: 400;
}

/* Back row on Register screen */
.auth-back-row {
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.auth-back-row .back-btn {
    color: var(--color-text);
}

.logo {
    margin-bottom: 32px;
}

.logo-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.logo h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.logo p {
    color: var(--color-text-secondary);
    font-size: 16px;
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth form */
.auth-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-form .form-group {
    margin-bottom: 0;
}

.auth-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: border-color 0.2s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.password-group {
    position: relative;
}

.password-group input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--color-text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--color-text);
}

.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 14px;
    text-align: center;
    display: block;
    margin-top: 4px;
}

.auth-link:hover {
    text-decoration: underline;
}

/* Auth divider */
.auth-divider {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 320px;
    margin: 20px 0;
    gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.auth-divider span {
    color: var(--color-text-tertiary);
    font-size: 14px;
    white-space: nowrap;
}

/* Auth error/success messages */
.auth-error {
    width: 100%;
    max-width: 320px;
    padding: 12px 16px;
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-md);
    color: var(--color-danger);
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.auth-success {
    width: 100%;
    max-width: 320px;
    padding: 12px 16px;
    background: var(--color-success-bg);
    border: 1px solid var(--color-success);
    border-radius: var(--radius-md);
    color: var(--color-success-text);
    font-size: 14px;
    margin-bottom: 16px;
    text-align: center;
}

/* Readonly input */
.input-readonly {
    background: var(--color-surface-secondary);
    color: var(--color-text-secondary);
    cursor: default;
}

/* Button loading state */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-loader-track-on-primary);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-secondary.btn-loading::after {
    border-color: var(--color-loader-track);
    border-top-color: var(--color-text);
}

.auth-hint {
    margin-top: 24px;
    color: var(--color-text-tertiary);
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    width: 100%;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:active {
    background: var(--color-primary-hover);
    transform: scale(0.98);
}

.btn-secondary {
    background: var(--color-surface-secondary);
    color: var(--color-text);
}

.btn-secondary:active {
    background: var(--color-border);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
}

.btn-google {
    background: var(--color-surface);
    color: var(--color-google-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.btn-google .icon {
    width: 20px;
    height: 20px;
    background: #4285f4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.btn-icon:active {
    background: var(--color-surface-secondary);
}

.btn-text {
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
}

.back-btn {
    color: var(--color-text);
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 16px;
    background: var(--color-surface);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.hint {
    font-size: 13px;
    color: var(--color-text-tertiary);
    margin-top: 8px;
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background: var(--color-surface-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.segment {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.segment.active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

/* Voting Cards */
.voting-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.voting-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.voting-card:active {
    transform: scale(0.98);
}

.voting-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.voting-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    margin-right: 8px;
}

.voting-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.voting-status.pending { background: var(--color-pending); }
.voting-status.accepted { background: var(--color-success); }
.voting-status.rejected { background: var(--color-danger); }

.voting-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.voting-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.voting-progress {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

.progress-bar {
    height: 6px;
    background: var(--color-surface-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-fill.accepted { background: var(--color-success); }
.progress-fill.rejected { background: var(--color-danger); }

.progress-text {
    font-size: 13px;
    color: var(--color-text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Group Cards */
.join-group-section {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    min-width: 0;
    align-items: center;
}

.join-group-section input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 16px;
    letter-spacing: 2px;
}

.join-group-section input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.join-group-btn {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 20px;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.group-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s;
}

.group-card:active {
    transform: scale(0.98);
}

.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.group-card-title {
    font-size: 16px;
    font-weight: 600;
}

.group-card-role {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
    font-weight: 500;
}

.group-card-role.member {
    background: var(--color-surface-secondary);
    color: var(--color-text-secondary);
}

.group-card-meta {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.group-id-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--color-surface-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    font-family: monospace;
    margin-top: 8px;
}

/* Group Detail */
.group-info-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 16px;
}

.group-id-section {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.group-id-section .label {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.group-id {
    font-family: monospace;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
}

.group-description {
    color: var(--color-text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

.group-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    flex: 1;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.stat-label {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.admin-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
}

/* Members List */
.members-list, .requests-list {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.member-item, .request-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}

.member-item:last-child, .request-item:last-child {
    border-bottom: none;
}

/* Members Controls */
.members-controls {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 12px;
    margin-bottom: 16px;
}

.members-list {
    background: transparent;
}

.member-card {
    transition: transform 0.1s, box-shadow 0.1s;
}

.member-card:active {
    transform: scale(0.99);
}

/* Member Chips for Freeze Voting */
.member-chips {
    min-height: 36px;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.member-chip button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.search-results {
    box-shadow: var(--shadow-md);
}

.search-result-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--color-surface-secondary);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Frozen member indicator */
.frozen-indicator {
    color: var(--color-info);
    font-size: 14px;
    margin-left: 4px;
}

.sort-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text-secondary);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-btn:hover {
    color: var(--color-primary);
}

.sort-btn i {
    font-size: 20px;
}

.search-input-wrapper input {
    transition: border-color 0.2s;
}

.search-input-wrapper input:focus {
    border-color: var(--color-primary);
    outline: none;
}

#clear-search {
    color: var(--color-text-tertiary);
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

#clear-search:hover {
    color: var(--color-danger);
}

.member-avatar, .request-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
}

.member-info, .request-info {
    flex: 1;
}

.member-name, .request-name {
    font-weight: 500;
    font-size: 15px;
}

.member-role, .request-address {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.member-actions, .request-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
}

.btn-approve {
    background: var(--color-success);
    color: white;
}

.btn-reject {
    background: var(--color-surface-secondary);
    color: var(--color-text);
}

/* Notifications */
.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:active {
    background: var(--color-surface-secondary);
}

.notification-item.unread {
    background: var(--color-info-bg);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-text {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 4px;
}

.notification-time {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.notification-item.read .notification-dot {
    display: none;
}

/* Profile Screen */
.profile-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--color-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 16px;
}

.profile-info h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-info p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.profile-details {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.detail-value {
    font-size: 14px;
    font-weight: 500;
}

/* Bottom Navigation */
.main-screens {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.main-screens.hidden {
    display: none;
}

.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--color-text-tertiary);
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-icon {
    font-size: 22px;
    line-height: 1;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-overlay);
    backdrop-filter: blur(2px);
}

.modal-content {
    position: relative;
    background: var(--color-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-large {
    height: 85vh;
    max-height: 85vh;
}

.modal-large .modal-body {
    flex: 1;
    overflow-y: auto;
    max-height: calc(85vh - 60px);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
}

.modal-footer .btn {
    flex: 1;
}

/* Action Sheet (group menu, etc.) */
.modal-action-sheet {
    max-height: 50vh;
}

.action-sheet-body {
    padding: 8px 0;
}

.action-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border: none;
    background: transparent;
    font-size: 16px;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: background 0.15s;
}

.action-sheet-item:active {
    background: var(--color-surface-secondary);
}

.action-sheet-item.action-danger {
    color: var(--color-danger);
}

.action-sheet-item.action-leave {
    color: var(--color-warning);
}

.action-icon {
    font-size: 20px;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.btn-full {
    width: 100%;
}

/* Voting Detail */
.voting-detail-header {
    margin-bottom: 24px;
}

.voting-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.voting-detail-status.active {
    background: var(--color-info-bg);
    color: var(--color-primary);
}

.voting-detail-status.completed {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.voting-detail-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
}

.voting-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 12px;
}

.voting-results {
    background: var(--color-surface-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

.result-value {
    font-weight: 600;
    font-size: 16px;
}

.result-bar {
    height: 8px;
    background: var(--color-surface);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.result-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.result-bar-fill.yes {
    background: var(--color-success);
}

.result-bar-fill.no {
    background: var(--color-danger);
}

.voting-actions {
    display: flex;
    gap: 12px;
}

.voting-actions .btn {
    flex: 1;
}

/* Language Selector */
.language-selector {
    position: relative;
}

.language-selector select {
    appearance: none;
    background: var(--color-surface-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    min-width: 140px;
}

.language-selector::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--color-text-secondary);
    pointer-events: none;
}

/* Profile Actions */
.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.profile-actions .btn {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 16px;
    text-align: left;
}

.profile-actions .btn .icon {
    font-size: 20px;
}

/* Instructions */
.instructions-body {
    max-height: none;
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

.instruction-section {
    margin-bottom: 24px;
}

.instruction-section:last-child {
    margin-bottom: 0;
}

.instruction-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-primary);
}

.instruction-item {
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.instruction-item h5 {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.instruction-item p {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.badge-example {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    margin-right: 8px;
    color: white;
}

.badge-example.yellow {
    background: var(--color-warning);
}

.badge-example.green {
    background: var(--color-success);
}

.badge-example.red {
    background: var(--color-danger);
}

.badge-example.blue {
    background: var(--color-primary);
}

/* Utility Color Classes */
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--color-muted); }
.text-primary { color: var(--color-primary); }
.text-warning { color: var(--color-warning); }
.text-pending { color: var(--color-pending); }
.bg-info { background: var(--color-info); }

/* Group Detail Stats */
.stat-value.info { color: var(--color-info); }
.stat-value.primary { color: var(--color-primary); }
.stat-sub-values {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 20px;
    font-weight: 600;
}
.stat-sub-values .accepted { color: var(--color-success); }
.stat-sub-values .rejected { color: var(--color-danger); }
.stat-sub-values .separator { color: var(--color-text-tertiary); font-weight: 400; }
.stat-sub-values .pending { color: var(--color-info); }

/* New stat breakdown pills (replaces legacy stat-sub-values) */
.stat-breakdown {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    background: var(--color-surface-secondary);
}

.stat-pill i { font-size: 13px; }

.stat-pill.stat-accepted { background: var(--color-success-bg); color: var(--color-success-text); }
.stat-pill.stat-rejected { background: var(--color-danger-bg); color: var(--color-danger); }
.stat-pill.stat-pending  { background: var(--color-info-bg); color: var(--color-info); }

.frozen-count-display {
    font-size: 11px;
    color: var(--color-info);
    margin-top: 2px;
    display: none;
}

.export-section {
    margin: 16px 0;
    text-align: center;
}

.export-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Members Controls — moved from inline */
.members-controls {
    margin-bottom: 16px;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 36px 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--color-surface-secondary);
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    padding: 4px;
    color: var(--color-text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
}

.clear-search-btn:hover {
    color: var(--color-danger);
}

.sort-btn {
    padding: 8px;
}

.sort-btn i {
    font-size: 20px;
}

/* Freeze Members Search — moved from inline */
.member-chips-search {
    position: relative;
}

.member-chips-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.freeze-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.member-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    min-height: 36px;
}

.freeze-info {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 8px;
}

/* Description Counter */
.char-counter {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
    text-align: right;
}

/* Terms Modal */
.terms-content {
    font-size: 14px;
    line-height: 1.6;
}

.terms-content ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.terms-content li {
    margin-bottom: 8px;
}

.terms-notice {
    margin-bottom: 16px;
    padding: 12px;
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.terms-checkbox-label input {
    margin-top: 2px;
}

/* Delete Warning */
.delete-warning {
    margin-bottom: 16px;
    color: var(--color-danger);
}

/* Group Stats layout */
.stat-centered {
    text-align: center;
    min-width: 100px;
}

/* Freeze Voting Detail */
.freeze-proposal-card {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-info-gradient);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-info);
}

.freeze-proposal-card .freeze-heading {
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-info);
}

.freeze-proposal-card .freeze-subtext {
    font-size: 13px;
    color: var(--color-info);
}

.btn-objection {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border-color: var(--color-danger-border);
}

.btn-objection:hover {
    background: var(--color-danger-border);
}

/* Member Card (dynamic) */
.member-card {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.1s, box-shadow 0.1s;
}

.member-card:active {
    transform: scale(0.99);
}

.member-card.frozen {
    opacity: 0.7;
    background: var(--color-frozen-gradient);
}

.member-card .member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.member-card.frozen .member-avatar {
    background: var(--color-info-light);
}

.member-card .member-info {
    flex: 1;
    min-width: 0;
}

.member-card .member-name {
    font-weight: 500;
    font-size: 15px;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.member-card .member-address {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin-top: 2px;
}

.member-card .member-participation {
    font-size: 15px;
    font-weight: 600;
    padding-left: 12px;
}

.member-card .member-avatar .ph {
    font-size: 24px;
}

/* History Icons */
.text-warning { color: var(--color-warning); }

/* Voting Date */
.voting-date {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-bottom: 8px;
}

/* Hover & Focus States */
.btn:hover {
    opacity: 0.9;
}

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

.btn-secondary:hover {
    background: var(--color-border);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
}

.btn-google:hover {
    background: var(--color-surface-secondary);
}

.btn-icon:hover {
    background: var(--color-surface-secondary);
}

.voting-card:hover {
    box-shadow: var(--shadow-md);
}

.group-card:hover {
    box-shadow: var(--shadow-md);
}

.notification-item:hover {
    background: var(--color-surface-secondary);
}

.segment:hover {
    color: var(--color-text);
}

.nav-item:hover {
    color: var(--color-text-secondary);
}

/* Focus Visible States */
.btn:focus-visible,
.btn-icon:focus-visible,
.btn-text:focus-visible,
.segment:focus-visible,
.nav-item:focus-visible,
.voting-card:focus-visible,
.group-card:focus-visible,
.notification-item:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-focus);
}

/* Modal overscroll containment */
.modal-body {
    overscroll-behavior: contain;
}

/* Consistent card shadows */
.notification-item {
    box-shadow: var(--shadow-sm);
}

.profile-card {
    box-shadow: var(--shadow-sm);
}

/* Voting Author (in card list) */
.voting-author {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

/* Voting Detail — Description block */
.voting-description {
    font-size: 15px;
    color: var(--color-text);
    margin: 12px 0;
    padding: 12px;
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
    line-height: 1.5;
}

/* Voting Detail — Author info */
.voting-author-info {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

/* Voting Detail — Date range */
.date-range {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* Voting Detail — Materials link */
.materials-link {
    margin-top: 16px;
    display: inline-flex;
}

/* Target Info (admin-change / remove-member) */
.target-info {
    margin-top: 16px;
    padding: 12px;
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
}

.target-info-label {
    font-weight: 600;
    margin-bottom: 4px;
}

.target-info-value {
    color: var(--color-text-secondary);
}

.removal-reason {
    margin-top: 8px;
    font-size: 14px;
}

.delete-group-warning {
    background: var(--color-danger-soft);
    border: 1px solid var(--color-danger);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--color-danger);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.delete-group-warning i {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Comments Section */
.comments-section {
    margin-top: 24px;
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
}

.comments-section h4 {
    margin-bottom: 12px;
}

.comment-item {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 600;
}

.comment-time {
    color: var(--color-text-tertiary);
    font-size: 12px;
}

.comment-vote {
    font-size: 14px;
    margin-bottom: 4px;
}

.comment-text {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* Voting Results — spacing between items already via margin-bottom */
.result-item + .result-bar {
    margin-top: 0;
}

/* Participation Summary */
.participation-summary {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

/* Voting Actions — column layout for detail view */
.voting-actions-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Vote Buttons Row */
.vote-buttons {
    display: flex;
    gap: 8px;
}

.vote-buttons .btn {
    flex: 1;
}

/* Compact form group (no margin) */
.form-group-compact {
    margin: 0;
}

/* Vote comment textarea */
.vote-comment-textarea {
    min-height: 80px;
}

/* Voted / status messages */
.voted-message {
    text-align: center;
    padding: 20px;
    color: var(--color-text-secondary);
}

/* Delete section in voting detail */
.delete-section {
    margin-top: 20px;
    text-align: center;
}

/* Objection Item (freeze) */
.objection-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.objection-date {
    color: var(--color-text-tertiary);
    font-size: 12px;
}

/* Objections Panel */
.objections-panel {
    margin-top: 20px;
    padding: 16px;
    background: var(--color-surface-secondary);
    border-radius: var(--radius-md);
}

.objections-heading {
    font-weight: 600;
    margin-bottom: 12px;
}

.auto-rejected-badge {
    margin-left: 8px;
}

.objections-needed {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Disagree info text */
.disagree-info {
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
}

/* Empty state inline (used in dynamic lists) */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.5;
}

.empty-state-inline {
    padding: 20px;
    text-align: center;
    color: var(--color-text-tertiary);
}

/* Skeleton loader for cards while data loads */
.skeleton-card {
    height: 80px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, var(--color-surface) 25%, var(--color-surface-secondary) 50%, var(--color-surface) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    margin-bottom: 12px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Smooth content transitions */
.voting-list, .groups-list, .notifications-list {
    transition: opacity 0.15s ease;
}

.empty-state-inline.small {
    padding: 12px;
    font-size: 14px;
}

/* History Item */
.history-item {
    padding: 12px;
    border-bottom: 1px solid var(--color-border);
}

.history-item-action {
    font-size: 14px;
    margin-bottom: 4px;
}

.history-item-meta {
    font-size: 12px;
    color: var(--color-text-tertiary);
}

/* Freeze search empty result */
.freeze-search-empty {
    padding: 12px;
    color: var(--color-text-tertiary);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Responsive */
@media (min-width: 481px) {
    #app {
        border-radius: var(--radius-xl);
        box-shadow: var(--shadow-lg);
        height: 90vh;
        margin-top: 5vh;
    }

    .modal-content {
        max-width: 480px;
        border-radius: var(--radius-xl);
        margin: 20px;
        max-height: calc(100% - 40px);
    }

    .instructions-body {
        max-height: 50vh;
    }
}