:root { color-scheme: light; font: 16px/1.5 system-ui, sans-serif; color: #102535; background: #edf2f3; --accent: #0b6658; --border: #d7e3e4; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
header { background: #101e2b; color: white; }
header a { color: inherit; font-size: 1.15rem; font-weight: 720; text-decoration: none; }
.shell { width: min(100% - 2rem, 1000px); margin: auto; }
.masthead, .intro, .section-head, .row, .actions { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.masthead { min-height: 65px; }
main { padding: 1.75rem 0 2rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 6vw, 2.7rem); letter-spacing: -.045em; }
h2 { font-size: 1.22rem; }
p, small { color: #425965; }
button, .link { border: 1px solid transparent; border-radius: .55rem; padding: .55rem .8rem; background: var(--accent); color: white; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.quiet, .link { background: transparent; border-color: var(--border); color: var(--accent); }
header .quiet { color: white; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin-top: 1rem; }
.stat { padding: 1rem; border-radius: .9rem; background: #dcece8; }
.stat strong { display: block; font-size: 1.65rem; }
.panel { margin-top: .85rem; background: white; border: 1px solid var(--border); border-radius: .9rem; padding: 1rem; }
.list { margin-top: .5rem; }
.row { padding: .8rem 0; border-top: 1px solid var(--border); align-items: flex-start; }
.actions { justify-content: flex-start; flex-wrap: wrap; }
.row .actions { justify-content: flex-end; }
details { margin-top: .45rem; }
summary { cursor: pointer; color: var(--accent); }
details p { margin-top: .5rem; }
.login { max-width: 440px; margin-inline: auto; }
dialog { width: min(100% - 2rem, 520px); max-height: 90dvh; border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; color: inherit; }
dialog::backdrop { background: #101e2bcc; }
label { display: block; margin-top: .8rem; font-weight: 620; }
input:not([type=checkbox]), select { width: 100%; margin-top: .25rem; border: 1px solid #9eb3ba; border-radius: .4rem; padding: .52rem; background: white; color: inherit; font: inherit; }
form button { margin-top: .6rem; }
#notice, #feedback { margin-top: .6rem; color: #8c3219; }
@media (max-width: 620px) {
  .intro, .row, .section-head { align-items: flex-start; flex-direction: column; }
  .row .actions { justify-content: flex-start; }
  .stat { padding: .65rem; font-size: .85rem; }
}
.bank-cards { width: 100%; }
.card-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(145px, 30%); gap: .75rem; align-items: start; padding: .3rem 0; }
.card-visual { display: flex; gap: .5rem; align-items: stretch; justify-content: flex-end; }
.card-edit { min-height: 5rem; writing-mode: vertical-rl; }
.card-visual img { display: block; width: min(calc(100% - 3rem), 210px); max-height: 145px; object-fit: contain; object-position: left; border-radius: .65rem; }
@media (max-width: 720px) {
  .card-line { grid-template-columns: 1fr; }
  .card-visual { justify-content: flex-start; }
}

.statement-dates:empty { visibility: hidden; }
@media (max-width: 720px) { .statement-dates:empty { display: none; } }

.payment-record { display: grid; gap: .35rem; margin-block: .5rem; }
.row .history-actions { flex-direction: column; flex-wrap: nowrap; align-items: stretch; text-align: center; }
.history-head { flex-wrap: wrap; }
.history-filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: end; }
.history-filters label { display: grid; margin-top: 0; font-size: .82rem; min-width: 0; }
.history-filters select { width: 8.2rem; max-width: 100%; font-size: .85rem; padding: .3rem .45rem; }
#history-card { width: 13rem; }
.history-actions > :is(button, .link), .payment-line > button { font-size: .88rem; padding: .35rem .6rem; }
.payment-line { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
.payment-line a { color: var(--accent); padding: 0; border: 0; text-decoration: underline; }

.row.card-module { display: grid; grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; }
.card-handle { cursor: grab; padding: .18rem .45rem; font-size: 1.3rem; line-height: 1.3; }
.card-handle:active { cursor: grabbing; }
.card-order { position: relative; padding-top: .3rem; }
.card-order-menu { position: absolute; z-index: 1; top: 100%; left: 0; background: white; display: flex; gap: .25rem; padding: .25rem; border: 1px solid var(--border); border-radius: .5rem; }
.card-order-menu[hidden] { display: none; }
.card-order-menu button { font-size: .82rem; padding: .25rem .45rem; }
.card-module.drop-before { box-shadow: inset 0 3px var(--accent); }
.card-module.drop-after { box-shadow: inset 0 -3px var(--accent); }
.late-payment { color: #a61919; font-weight: 650; }

.password-field { position: relative; }
.password-field input { padding-right: 3.25rem; }
.password-field .password-toggle { position: absolute; right: .2rem; top: .25rem; bottom: 0; margin: 0; min-width: 2.8rem; padding: .2rem; border-color: transparent; font-size: 1.2rem; line-height: 1; }
.password-toggle[aria-pressed="true"]::after { content: ""; position: absolute; width: 1.4rem; height: 2px; background: currentColor; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-42deg); }

#cards {
  display: grid;
  gap: .8rem;
  padding: .75rem;
  background: #d9e5e8;
  border: 1px solid #a6b9be;
  border-radius: .9rem;
}
#cards > .card-module {
  background: #fff;
  border: 1px solid #617a83;
  border-radius: .85rem;
  padding: .85rem;
  box-shadow: 0 2px 4px #10253520;
}
#cards > .card-module.drop-before { box-shadow: inset 0 3px var(--accent); }
#cards > .card-module.drop-after { box-shadow: inset 0 -3px var(--accent); }

@media (max-width: 720px) {
  #cards { padding: .5rem; gap: .75rem; }
  #cards > .card-module { padding: .65rem .55rem; gap: .5rem; }
}

