/* ==========================================================================
   PayDue v2 components: emoji icons, payment methods, pickers, chips.
   Loaded after app.css (uses its colour tokens).
   ========================================================================== */
.emoji { font-size: 18px; line-height: 1; display: inline-block; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.icon-tile .emoji { font-size: 20px; }
.icon-tile.sm .emoji { font-size: 17px; }
.icon-tile.lg .emoji { font-size: 24px; }
.flag { font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }

/* Payment method badges (stylised marks, not official logos) */
.pm { width: 46px; height: 32px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center;
      font-weight: 900; font-size: 10.5px; letter-spacing: .02em; color: #fff; position: relative; overflow: hidden; }
.pm.lg { width: 64px; height: 44px; border-radius: 10px; font-size: 13px; }
.pm-cash { background: #e7f8ee; font-size: 20px; }
.pm.lg.pm-cash { font-size: 26px; }
.pm-uzcard { background: linear-gradient(135deg, #0a4bbf, #1c7bf2); }
.pm-humo { background: linear-gradient(135deg, #0f9a76, #19c39a); }
.pm-visa { background: linear-gradient(135deg, #1a1f71, #2a3aa8); font-style: italic; font-size: 12px; }
.pm.lg.pm-visa { font-size: 15px; }
.pm-mastercard { background: #1f2430; }
.pm-mastercard::before, .pm-mastercard::after { content: ''; position: absolute; width: 15px; height: 15px; border-radius: 50%; top: 50%; transform: translateY(-50%); }
.pm-mastercard::before { background: #eb001b; left: calc(50% - 12px); }
.pm-mastercard::after { background: #f79e1b; left: calc(50% - 3px); opacity: .9; }
.pm.lg.pm-mastercard::before, .pm.lg.pm-mastercard::after { width: 21px; height: 21px; }
.pm.lg.pm-mastercard::before { left: calc(50% - 17px); }
.pm.lg.pm-mastercard::after { left: calc(50% - 4px); }
.pm-other { background: var(--surface-3); font-size: 19px; }
.pm.lg.pm-other { font-size: 24px; }
[data-theme="dark"] .pm-cash { background: rgba(47, 204, 113, .15); }

/* Generic choice grid (type picker) */
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice-grid input, .chip-row input { position: absolute; opacity: 0; pointer-events: none; }
.choice {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
    min-height: 78px; padding: 10px 6px; border-radius: 14px; cursor: pointer;
    border: 1.5px solid var(--border-strong); background: var(--surface);
    font-size: 12.5px; font-weight: 650; color: var(--text-2);
    transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--faint); }
input:checked + .choice { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
input:focus-visible + .choice, input:focus-visible + .chip { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Chips (categories, suggestions, date shortcuts) */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 999px;
    border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer;
    font: inherit; font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--faint); }
.chip .emoji { font-size: 16px; }
.chip svg { width: 15px; height: 15px; }
input:checked + .chip, .chip.is-active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.chip.chip-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.chip.is-locked { cursor: default; border-color: var(--partial); background: var(--partial-soft); color: var(--text); }
.chip.chip-add { border-style: dashed; color: var(--primary); }
.suggest-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-top: 2px; }
.suggest-row::-webkit-scrollbar { display: none; }
.suggest-row .chip { flex-shrink: 0; height: 30px; font-size: 12.5px; background: var(--surface-2); border-width: 1px; }

/* Emoji picker */
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.emoji-grid button {
    aspect-ratio: 1; border: 1.5px solid transparent; border-radius: 10px; background: var(--surface); cursor: pointer;
    font-size: 20px; display: grid; place-items: center; padding: 0;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}
.emoji-grid button:hover { background: var(--surface-3); }
.emoji-grid button.is-active { border-color: var(--primary); background: var(--primary-soft); }
.new-box { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 10px; }

/* Currency picker */
.cur-btn {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 6px;
    min-width: 108px; height: 44px; padding: 0 10px 0 12px; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-weight: 700; font-size: 14px; color: var(--text);
}
.cur-btn .flag { font-size: 18px; }
.cur-btn svg { width: 15px; height: 15px; color: var(--faint); }
.cur-btn.block { width: 100%; }
.input-group > .cur-picker { flex: 0 0 auto; }
.input-group > input { flex: 1 1 auto; min-width: 0; }
.cur-picker .cur-btn.block { width: 100%; }
.cur-list { display: flex; flex-direction: column; max-height: 52vh; overflow-y: auto; margin: 8px -8px 0; }
.cur-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 10px; cursor: pointer;
    border: 0; background: none; text-align: left; width: 100%; font: inherit; color: var(--text);
}
.cur-item:hover, .cur-item.is-active { background: var(--surface-2); }
.cur-item .flag { font-size: 24px; width: 30px; text-align: center; }
.cur-item strong { font-size: 14px; min-width: 42px; }
.cur-item span:last-child { color: var(--muted); font-size: 13px; }
.cur-section { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 8px 4px; }

/* Money & date inputs */
input[data-money] { font-variant-numeric: tabular-nums; }
.date-help { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.date-help strong { color: var(--text); text-transform: capitalize; }
.quick-amounts { display: flex; gap: 6px; flex-wrap: wrap; }

/* Recurring */
.repeat-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--violet); }
.repeat-badge svg { width: 12px; height: 12px; }
.cal-event.projected { border-left-style: dashed; }
.sub-cost { text-align: right; white-space: nowrap; }
.sub-cost strong { display: block; font-size: 15px; font-weight: 750; }
.sub-cost small { font-size: 11.5px; color: var(--muted); font-weight: 600; }

/* Notification card */
.notif-status { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; font-weight: 600; }
.notif-status.on { background: var(--paid-soft); color: var(--paid); }
.notif-status.off { background: var(--partial-soft); color: var(--partial); }

/* Analytics */
.kpi-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .kpi-mini { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi-mini > div { padding: 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.kpi-mini span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi-mini strong { display: block; font-size: 18px; font-weight: 800; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Loan calculator */
.loan-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
@media (min-width: 720px) { .loan-types { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.loan-types label { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; cursor: pointer;
    border: 1.5px solid var(--border-strong); background: var(--surface); }
.loan-types label strong { font-size: 14px; }
.loan-types label small { font-size: 12px; color: var(--muted); }
.loan-types input { position: absolute; opacity: 0; pointer-events: none; }
.loan-types input:checked + label { border-color: var(--primary); background: var(--primary-soft); }

.flag-img { width: 22px; height: 16px; object-fit: cover; border-radius: 3px; display: inline-block; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.cur-item .flag-img { width: 28px; height: 20px; }

/* Confirm dialog */
.btn-danger-solid { background: var(--overdue); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.06); }
@media (min-width: 640px) { dialog.confirm-sheet { max-width: 440px; } }
.confirm-sheet .sheet-body p { color: var(--text-2); }
