/* PagoJusto — Premium UI · letra grande · accesible */
:root {
    --primary: #0c6e66;
    --primary-hover: #12867c;
    --primary-dark: #134e4a;
    --primary-soft: #d7f3ef;
    --accent: #c4841d;
    --accent-soft: #f8efd8;
    --danger: #b42318;
    --danger-soft: #fde8e6;
    --success: #067647;
    --success-soft: #d8f3e4;
    --bg: #f6f3ee;
    --card: #ffffff;
    --text: #1c1917;
    --text-muted: #57534e;
    --border: #e7e2da;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 1px 2px rgba(28,25,23,0.04), 0 10px 28px rgba(28,25,23,0.06);
    --shadow-lg: 0 18px 48px rgba(28,25,23,0.1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fs-base: 1.0625rem;   /* 17px */
    --fs-sm: 0.95rem;
    --fs-lg: 1.2rem;
    --fs-xl: 1.45rem;
    --fs-2xl: 1.75rem;
    --fs-3xl: 2.1rem;
    --lh: 1.6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font);
    background:
        radial-gradient(900px 420px at 100% -10%, rgba(12,110,102,0.08), transparent 60%),
        var(--bg);
    color: var(--text);
    font-size: var(--fs-base);
    line-height: var(--lh);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--primary-hover); }

.container { max-width: 980px; margin: 0 auto; padding: 0 18px; }
.main-content { padding-top: 28px; padding-bottom: 56px; }

/* Header */
.header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
}
.logo-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: block;
    flex-shrink: 0;
}
.logo-mark {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 10px rgba(15,118,110,0.3);
}
.logo-mark.sm { width: 32px; height: 32px; font-size: 0.75rem; border-radius: 9px; }
.logo-text {
    font-size: 1.35rem;
    font-weight: 750;
    color: var(--text);
    letter-spacing: -0.4px;
}
.nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav a {
    font-size: 1rem;
    font-weight: 550;
    color: var(--text-muted);
    padding: 8px 12px;
    border-radius: 10px;
}
.nav a:hover { color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.nav-admin {
    background: var(--accent-soft) !important;
    color: #92400e !important;
    font-weight: 650 !important;
}
.nav-user { font-size: 0.95rem; color: var(--text-muted); padding: 0 8px; }

/* Cards */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}
.card-title {
    font-size: var(--fs-lg);
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: -0.3px;
    line-height: 1.35;
}

/* Buttons — larger touch targets */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 650;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none !important;
    font-family: inherit;
    min-height: 48px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: white !important;
    box-shadow: 0 3px 12px rgba(15,118,110,0.28);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    box-shadow: 0 5px 16px rgba(15,118,110,0.38);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: white !important; }
.btn-sm { padding: 10px 16px; font-size: 0.95rem; min-height: 42px; }
.btn-block { width: 100%; }

/* Forms — bigger inputs */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 1.05rem;
    font-weight: 650;
    margin-bottom: 8px;
    color: var(--text);
}
.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    transition: all 0.15s;
    background: white;
    font-family: inherit;
    color: var(--text);
    min-height: 52px;
    line-height: 1.4;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(15,118,110,0.14);
}
.form-control::placeholder { color: #94a3b8; }
select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 42px;
}

/* Alerts */
.alert {
    padding: 16px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 1.05rem;
    font-weight: 550;
    line-height: 1.45;
}
.alert-success { background: var(--success-soft); color: #065f46; border: 1px solid #6ee7b7; }
.alert-error { background: var(--danger-soft); color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
th, td { padding: 16px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

.balance-positive { color: var(--success); font-weight: 700; font-size: 1.1rem; }
.balance-negative { color: var(--danger); font-weight: 700; font-size: 1.1rem; }
.balance-zero { color: var(--text-muted); font-size: 1.1rem; }

/* Split options */
.split-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}
.split-option {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 1rem;
    font-weight: 600;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.split-option:hover, .split-option.active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary-dark);
}
.split-option input { display: none; }

.member-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.member-chip {
    background: var(--primary-soft);
    color: var(--primary-dark);
    padding: 6px 14px 6px 6px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.8rem; font-weight: 800;
    flex-shrink: 0;
    object-fit: cover;
    background: #e2e8f0;
}

.empty-state { text-align: center; padding: 52px 20px; color: var(--text-muted); }
.empty-state h3 { margin-bottom: 10px; color: var(--text); font-weight: 700; font-size: var(--fs-xl); }
.empty-state p { font-size: 1.05rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 680px) {
    .grid-2 { grid-template-columns: 1fr; }
    .header-inner { flex-wrap: wrap; }
    .split-options { grid-template-columns: 1fr; }
    :root { --fs-base: 1.1rem; }
}

.invite-box {
    background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
    border: 2px dashed #5eead4;
    border-radius: var(--radius-sm);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.invite-code {
    font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace;
    font-size: 1.5rem;
    font-weight: 750;
    letter-spacing: 3px;
    color: var(--primary-dark);
}

.footer {
    text-align: center;
    padding: 44px 20px;
    color: var(--text-muted);
    font-size: 1rem;
    border-top: 1px solid var(--border);
    background: white;
}
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}
.footer-logo { border-radius: 10px; vertical-align: middle; }
.footer-tagline { margin: 8px 0 12px; font-size: 1rem; }
.footer-credit { font-size: 0.95rem; color: var(--text-muted); }
.footer-link {
    color: var(--primary);
    font-weight: 650;
    text-decoration: none;
}
.footer-link:hover { text-decoration: underline; color: var(--primary-hover); }
.footer-install { margin-bottom: 10px; font-size: 1.05rem; }

/* Auth */
.auth-container { max-width: 440px; margin: 40px auto; padding: 0 16px; }
.auth-card {
    background: var(--card);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    padding: 36px 28px;
    border: 1px solid var(--border);
}
.auth-brand { text-align: center; margin-bottom: 8px; }
.auth-brand .brand-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 4px 18px rgba(15,118,110,0.3);
}
.auth-card h1 {
    font-size: var(--fs-2xl);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    line-height: 1.25;
}
.auth-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 1.05rem;
    line-height: 1.5;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 1.05rem;
    color: var(--text-muted);
}

.amount-big { font-size: 1.75rem; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }

.settlement-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    font-size: 1.05rem;
    gap: 10px;
    flex-wrap: wrap;
}
.settlement-item:last-child { border-bottom: none; }
.arrow { color: var(--text-muted); margin: 0 8px; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 26px;
    flex-wrap: wrap;
    gap: 14px;
}
.page-header h1 {
    font-size: var(--fs-3xl);
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.group-card {
    text-decoration: none !important;
    color: inherit;
    display: block;
    background: linear-gradient(165deg, #ffffff 0%, #f0fdfa 55%, #e6fffa 100%);
    border: 1px solid #99f6e4;
    border-radius: 18px;
    padding: 20px 20px 16px;
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.group-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg, #0f766e, #14b8a6);
}
.group-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(15, 118, 110, 0.16);
    border-color: #2dd4bf;
}
.group-card-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}
.group-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(15, 118, 110, 0.28);
}
.group-card-heading {
    flex: 1;
    min-width: 0;
}
.group-card-heading strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.25;
}
.group-card-desc {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 0.98rem;
}
.group-currency {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #115e59;
    background: #ccfbf1;
    border: 1px solid #99f6e4;
    padding: 4px 8px;
    border-radius: 8px;
}
.group-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.95rem;
    color: #0f766e;
    font-weight: 600;
}
.group-card-meta span {
    background: rgba(255,255,255,0.8);
    border: 1px solid #ccfbf1;
    padding: 6px 10px;
    border-radius: 999px;
}
.group-card-go {
    margin-left: auto !important;
    background: #0f766e !important;
    color: #fff !important;
    border-color: #0f766e !important;
}

/* Google */
.btn-google {
    background: #fff !important;
    color: #3c4043 !important;
    border: 2px solid #dadce0 !important;
    box-shadow: none !important;
    font-weight: 600;
    gap: 12px;
    font-size: 1.05rem;
}
.btn-google:hover {
    background: #f8f9fa !important;
    border-color: #c6c8cc !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Admin */
.admin-body { background: #0f172a; }
.admin-body .header {
    background: #1e293b;
    border-bottom-color: #334155;
}
.admin-body .logo-text { color: #f1f5f9; }
.admin-body .nav a { color: #94a3b8; }
.admin-body .nav a:hover { color: #5eead4; background: rgba(45,212,191,0.1); }
.admin-body .nav-user { color: #64748b; }
.admin-body .main-content { color: #e2e8f0; }
.admin-body .card {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}
.admin-body .card-title { color: #f1f5f9; }
.admin-body th { color: #94a3b8; }
.admin-body td { border-bottom-color: #334155; color: #cbd5e1; }
.admin-body tr:hover td { background: #334155; }
.admin-body .footer { background: #0f172a; border-top-color: #1e293b; color: #64748b; }
.admin-body .footer-credit { color: #64748b; }
.admin-body .footer-link { color: #5eead4; }
.admin-body .page-header h1 { color: #f1f5f9; }
.admin-body table { font-size: 0.95rem; }
.admin-body th {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}
.admin-body td { vertical-align: middle; padding: 14px 12px; }
.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.admin-body .btn-quiet,
.admin-body .btn-ghost-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #334155;
  background: transparent;
  line-height: 1.2;
}
.admin-body .btn-quiet { color: #99f6e4; }
.admin-body .btn-quiet:hover { background: rgba(45,212,191,0.12); border-color: #2dd4bf; }
.admin-body .btn-ghost-danger { color: #fda4af; border-color: #3f1d24; }
.admin-body .btn-ghost-danger:hover { background: rgba(127,29,29,0.35); border-color: #fb7185; color: #fecdd3; }

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: var(--radius);
    padding: 24px 18px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: #5eead4;
    letter-spacing: -1px;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 8px;
    font-weight: 650;
}
.admin-badge {
    display: inline-block;
    background: var(--accent-soft);
    color: #92400e;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* PWA Install — hidden when installed */
.pj-standalone .pj-install-banner,
.pj-standalone .footer-install,
html.pj-standalone .pj-install-banner,
html.pj-standalone .footer-install {
    display: none !important;
}

.pj-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(15,23,42,0.12);
  animation: pjSlideUp 0.35s ease;
}
@keyframes pjSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.pj-install-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}
.pj-install-icon { border-radius: 12px; flex-shrink: 0; }
.pj-install-text { flex: 1; min-width: 180px; font-size: 1.05rem; color: var(--text); }
.pj-install-text strong { display: block; font-size: 1.15rem; margin-bottom: 4px; }
.pj-install-text p { color: var(--text-muted); margin: 0 0 6px; font-size: 1rem; }
.pj-install-steps {
  margin: 6px 0 0;
  padding-left: 20px;
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.pj-install-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pj-install-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
}
.pj-install-close:hover { color: var(--text); }

.pj-how-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15,23,42,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pj-how-card {
  background: #fff;
  border-radius: 22px;
  padding: 28px 24px;
  max-width: 580px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.pj-how-card h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 18px;
  letter-spacing: -0.3px;
}
.pj-how-card .pj-install-close {
  position: absolute;
  top: 12px;
  right: 12px;
}
.pj-how-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 560px) {
  .pj-how-grid { grid-template-columns: 1fr; }
}
.pj-how-col h3 {
  font-size: 1.1rem;
  font-weight: 750;
  color: var(--primary);
  margin-bottom: 8px;
}
.pj-how-hint {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 8px;
}


.auth-how {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.auth-how-hint {
    text-align: center;
    margin-top: 12px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

/* Expense row hint */
tr.expense-row { cursor: pointer; }
tr.expense-row:hover td { background: #f0fdfa; }
.expense-link { font-weight: 650; color: var(--primary); }
.expense-hint {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* Help dots */
.help-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  background: #115e59;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  border: 2px solid #fff;
  cursor: pointer;
  padding: 0;
  vertical-align: middle;
  box-shadow: 0 1px 4px rgba(17,94,89,0.35);
  font-family: inherit;
  flex-shrink: 0;
}
.help-dot:hover { background: #0f766e; }
.pj-standalone .help-dot,
.help-dot {
  -webkit-tap-highlight-color: transparent;
}

.help-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(15,23,42,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .help-modal { align-items: center; }
}
.help-modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 26px 22px 22px;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: 0 16px 40px rgba(15,23,42,0.2);
  max-height: min(80vh, 520px);
  overflow-y: auto;
}
.help-modal-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
  padding-right: 36px;
  line-height: 1.3;
}
.help-modal-card p {
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text);
}
.help-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1f5f9;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  color: var(--text);
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pj-standalone .help-modal {
  padding-top: calc(12px + env(safe-area-inset-top));
}

/* Receipt lightbox */
.receipt-open {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin-top: 8px;
  text-align: left;
  cursor: zoom-in;
  font-family: inherit;
}
.receipt-thumb {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
}
.receipt-open-hint {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}
.receipt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 30000;
  background: rgba(15,23,42,0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}
.receipt-lightbox img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  object-fit: contain;
  border-radius: 12px;
}
.receipt-lightbox-close {
  margin-top: 16px;
  min-width: 180px;
}

.group-bal { font-weight: 750 !important; }
.group-bal-pos { background: #d1fae5 !important; color: #065f46 !important; border-color: #6ee7b7 !important; }
.group-bal-neg { background: #fee2e2 !important; color: #991b1b !important; border-color: #fca5a5 !important; }
.group-bal-ok { background: #f1f5f9 !important; color: #475569 !important; }

body.readonly-view .btn-danger,
body.readonly-view form[method="POST"] button,
body.readonly-view form[method="post"] button {
  pointer-events: none;
  opacity: 0.4;
}

.legal-banner {
  position: sticky;
  bottom: 0;
  z-index: 9000;
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.2);
}
.legal-banner a { color: #5eead4; }
.pj-standalone .legal-banner {
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

.lang-switch { display:inline-flex; gap:2px; align-items:center; margin:0 4px; }
.lang-switch a { font-size:0.75rem; font-weight:700; letter-spacing:.04em; padding:4px 7px; border-radius:8px; color:#64748b; text-decoration:none; }
.lang-switch a.is-active { background:#ccfbf1; color:#0f766e; }
.admin-body .lang-switch a { color:#94a3b8; }
.admin-body .lang-switch a.is-active { background:rgba(45,212,191,.15); color:#5eead4; }

.cat-grid { display:flex; flex-wrap:wrap; gap:8px; }
.cat-btn {
  border:1px solid var(--border); background:#fff; border-radius:999px;
  padding:8px 12px; font-size:0.92rem; font-weight:650; cursor:pointer;
}
.cat-btn.is-on { background:#ccfbf1; border-color:#0f766e; color:#115e59; }

.cat-ico { vertical-align:-3px; }
.cat-mini { display:inline-flex; align-items:center; gap:6px; font-size:0.95rem; color:#0f766e; font-weight:700; }
.cat-filter { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 14px; }
.cat-filter .cat-btn { text-decoration:none; color:inherit; display:inline-flex; align-items:center; gap:6px; }
.cat-filter .cat-btn small { color:#64748b; font-weight:600; }
.cat-btn { display:inline-flex; align-items:center; gap:6px; }
.expense-link .cat-ico { margin-right:4px; color:#0f766e; }

.cat-badge {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.04);
}
.cat-badge .cat-ico { color: inherit; }
.cat-food { background:#dcfce7; color:#166534; }
.cat-transport { background:#ffedd5; color:#c2410c; }
.cat-stay { background:#e0e7ff; color:#3730a3; }
.cat-home { background:#fce7f3; color:#9d174d; }
.cat-fun { background:#f3e8ff; color:#6b21a8; }
.cat-shop { background:#dbeafe; color:#1d4ed8; }
.cat-health { background:#ffe4e6; color:#be123c; }
.cat-utilities { background:#fef9c3; color:#a16207; }
.cat-other { background:#e2e8f0; color:#334155; }
.expense-link { display:inline-flex; align-items:center; gap:8px; }
.cat-btn .cat-badge { width:28px; height:28px; border-radius:9px; }
.cat-mini .cat-badge { width:26px; height:26px; }

.exp-list { display:flex; flex-direction:column; }
.exp-item {
  display:flex; align-items:center; gap:12px;
  padding:12px 4px; border-bottom:1px solid #eef2f6;
  text-decoration:none; color:inherit;
}
.exp-item:last-child { border-bottom:none; }
.exp-item:hover { background:#f8fafc; }
.exp-date {
  width:36px; text-align:center; flex-shrink:0; line-height:1.05;
}
.exp-date strong { display:block; font-size:1.05rem; color:#0f172a; }
.exp-date span { font-size:0.72rem; text-transform:uppercase; letter-spacing:.04em; color:#94a3b8; font-weight:700; }
.exp-body { flex:1; min-width:0; }
.exp-body strong { display:block; font-size:1.05rem; font-weight:700; }
.exp-body small { color:#64748b; font-size:0.88rem; }
.exp-amt { font-weight:800; color:#0f172a; white-space:nowrap; }
.cat-btn {
  border:1px solid #e2e8f0; background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.cat-btn.is-on { box-shadow:0 0 0 2px rgba(15,118,110,.18); }

.group-hero {
  background: linear-gradient(180deg,#fff,#fbfaf7);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 22px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.group-hero-top { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.group-kicker { font-size:.75rem; letter-spacing:.08em; text-transform:uppercase; color:#0f766e; font-weight:800; margin-bottom:4px; }
.group-hero h1 { font-size:1.7rem; letter-spacing:-.4px; margin:0 0 4px; }
.group-desc { color:var(--text-muted); margin:0; }
.group-balance { margin-top:14px; font-size:1.2rem; font-weight:750; color:#0f172a; }
.group-balance p { margin:0 0 4px; }
.group-balance.is-ok { color:#047857; font-size:1.05rem; }
.group-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.more-block { margin: 8px 0 28px; }
.more-block > summary {
  cursor:pointer; font-weight:700; color:#475569; padding:10px 4px; list-style:none;
}
.more-block > summary::-webkit-details-marker { display:none; }
.more-block > summary::after { content:' ▾'; color:#94a3b8; }
.grid-2 .card { margin-bottom: 16px; }

.group-card { border-color:#e7e2da; }

.file-pick { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.file-pick input[type=file] { position:absolute; width:1px; height:1px; opacity:0; }
.file-pick span { color: var(--text-muted); }
