/* Member area. One accent colour per brand: layout.php sets --h (hue) on <html>, everything else derives from it. */
:root {
  --h: 217;
  --accent: hsl(var(--h) 76% 46%);
  --accent-strong: hsl(var(--h) 76% 38%);
  --accent-soft: hsl(var(--h) 90% 96%);
  --accent-ring: hsl(var(--h) 76% 46% / .22);
  --on-accent: #fff;

  --bg: #f6f7f9;
  --surface: #fff;
  --surface-2: #f9fafb;
  --text: #1c2230;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e7eaef;
  --line-strong: #d5d9e0;
  --hover: #f2f4f7;

  --green: #12a150;
  --red: #e5484d;
  --cyan: #0891b2;
  --yellow: #f5a524;
  --green-soft: #e7f6ee;
  --yellow-soft: #fff4dc;
  --red-soft: #fdecec;
  --cyan-soft: #e3f5f9;
  --dark-soft: #eceff3;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 32px rgba(16,24,40,.16), 0 2px 6px rgba(16,24,40,.08);
  --side-w: 256px;
  color-scheme: light;
}
/* dark theme: only when the visitor picks it (theme.js sets data-theme on <html>); light is the default */
:root[data-theme="dark"] {
  --accent: hsl(var(--h) 85% 64%);
  --accent-strong: hsl(var(--h) 85% 72%);
  --accent-soft: hsl(var(--h) 40% 18%);
  --accent-ring: hsl(var(--h) 85% 64% / .3);
  --on-accent: #0b1020;
  --bg: #0e1118;
  --surface: #171b24;
  --surface-2: #1c212c;
  --text: #e8ebf1;
  --muted: #9aa3b2;
  --faint: #6b7587;
  --line: #262c39;
  --line-strong: #343c4c;
  --hover: #212736;
  --green: #3ecf8e;
  --red: #ff6b70;
  --cyan: #38bdf8;
  --yellow: #fbbf24;
  --green-soft: #12301f;
  --yellow-soft: #3a2d0e;
  --red-soft: #3a1a1c;
  --cyan-soft: #0f2c38;
  --dark-soft: #262c39;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
  color-scheme: dark;
  }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: 'Kanit', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; font-weight: 300; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }
.text-center, .center { text-align: center; }
.text-right { text-align: right; }
.text-cyan { color: var(--cyan); } .text-red { color: var(--red); } .text-green { color: var(--green); } .text-yellow { color: var(--yellow); }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- shell: sidebar (desktop) / topbar + drawer (phone) ---------- */
#topbar { position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
#menu_toggle { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--text); font-size: 22px; cursor: pointer; }
#menu_toggle:hover { background: var(--hover); }
.top-brand { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 16px; min-width: 0; }
.top-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 500; font-size: 16px; }
#topbar .right { margin-left: auto; display: flex; gap: 6px; }
#topbar .right .badge-user { display: none; }

#sidemenu { position: fixed; z-index: 99; top: var(--topbar-h, 61px); bottom: 0; left: 0; width: var(--side-w); max-width: 85vw; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(-105%); visibility: hidden; transition: transform .2s, visibility .2s; }
#sidemenu.open { transform: none; visibility: visible; }
#sidemenu .side-brand { display: none; }
#sidemenu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 400; white-space: nowrap; transition: background .12s, color .12s; }
#sidemenu a .i { font-size: 18px; flex: none; }
#sidemenu a:hover { background: var(--hover); color: var(--text); }
#sidemenu a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
#sidemenu a.logout { margin-top: auto; color: var(--red); }
#sidemenu a.logout:hover { background: var(--red-soft); color: var(--red); }
#menu_backdrop { position: fixed; z-index: 98; top: var(--topbar-h, 61px); left: 0; right: 0; bottom: 0; background: rgba(10,14,22,.45); display: none; }
#menu_backdrop.open { display: block; }

main.container { padding-top: 12px; padding-bottom: 40px; }

@media (min-width: 960px) {
  #topbar { margin-left: var(--side-w); }
  #menu_toggle, #menu_backdrop, .top-brand { display: none !important; }
  #topbar .right { margin-left: 0; width: 100%; justify-content: flex-end; }
  #topbar .right .badge-user { display: inline-flex; }
  #sidemenu { top: 0; transform: none; visibility: visible; box-shadow: none; max-width: none; padding-top: 18px; }
  #sidemenu .side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; font-weight: 500; font-size: 17px; }
  body > main.container { margin-left: var(--side-w); width: auto; max-width: none; padding: 12px 32px 48px; }
  body > main.container > .pg, body > main.container > .container { max-width: 1080px; margin-left: auto; margin-right: auto; }
}

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 400; line-height: 1.4; white-space: nowrap; }
.badge b { font-weight: 500; }
.badge-dark { background: var(--dark-soft); color: var(--text); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-cyan { background: var(--cyan-soft); color: var(--cyan); }
.badge-yellow { background: var(--yellow-soft); color: #b7791f; }
:root[data-theme=dark] .badge-yellow { color: var(--yellow); }
.badge-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- layout + cards ---------- */
.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 520px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin: 16px 0; overflow: hidden; }
.card-header { padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 500; }
.card-body { padding: 20px 24px 24px; }
.card-footer { padding: 12px 24px; border-top: 1px solid var(--line); }
.card.center { padding: 24px; }

.dropdown { position: relative; }
.dropdown .menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); z-index: 5; font-size: 14px; }
.dropdown.open .menu { display: block; }
.dropdown .menu div { padding: 9px 12px; border-radius: 8px; cursor: pointer; }
.dropdown .menu div:hover { background: var(--hover); }

.pg-head { display: flex; align-items: center; gap: 14px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.pg-head > div:not(.dropdown) { flex: 1; min-width: 0; }
.pg-head .dropdown { flex: none; }
.pg-head h2 { margin: 0; font-size: 18px; font-weight: 500; }
.pg-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.pg-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); font-size: 20px; }

/* ---------- forms + buttons ---------- */
.form-grid { display: flex; flex-wrap: wrap; margin: 0 -10px; }
.form-grid > div { padding: 8px 10px; flex: 1 1 calc(50% - 20px); min-width: 240px; }
.form-grid > div.full { flex-basis: 100%; }
label, .lbl { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 400; color: var(--muted); }
.opt { color: var(--faint); }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea, .edit-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: inherit; font-size: 15px; color: var(--text); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input.bad, select.bad, textarea.bad { border-color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, var(--surface)); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.unit { position: relative; }
.unit input { padding-right: 52px; }
.unit span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; pointer-events: none; }
.field { margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 22px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font: inherit; font-weight: 400; text-decoration: none; cursor: pointer; transition: background .12s, box-shadow .12s; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.light { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.light:hover { background: var(--hover); }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.pg-actions { margin-top: 12px; padding: 0 10px; }
.pg-actions .btn { width: 100%; padding: 12px 20px; font-size: 16px; }
@media (min-width: 640px) { .pg-actions { text-align: right; } .pg-actions .btn { width: auto; min-width: 220px; } }
.pg-center { text-align: center; margin-top: 20px; }
.alert { padding: 11px 16px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 14px; }
.alert-danger { background: var(--red-soft); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }

/* ---------- login ---------- */
body.login { min-height: 100vh; background: radial-gradient(900px 500px at 15% -10%, var(--accent-soft), transparent 70%), radial-gradient(700px 500px at 100% 110%, var(--accent-soft), transparent 70%), var(--bg); }
.lg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.lg-card { width: 400px; max-width: 100%; padding: 36px 32px 30px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); }
.lg-brand { text-align: center; margin-bottom: 24px; }
.lg-mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-size: 26px; font-weight: 500; box-shadow: 0 8px 20px var(--accent-ring); }
.lg-brand h1 { margin: 14px 0 2px; font-size: 22px; font-weight: 500; }
.lg-brand p { margin: 0; font-size: 14px; color: var(--muted); }
.lg-form label { margin: 16px 0 6px; }
.lg-form input[type=text], .lg-form input[type=password] { padding: 12px 14px; font-size: 16px; }
.lg-pw { position: relative; }
.lg-pw input { padding-right: 70px !important; }
.lg-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 6px 10px; border: 0; border-radius: 8px; background: none; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.lg-eye:hover { background: var(--accent-soft); }
.lg-form .check { display: flex; align-items: center; gap: 8px; margin: 16px 0 22px; }
.lg-form .check label { margin: 0; }
.lg-submit { width: 100%; padding: 13px 18px; font-size: 16px; }
.lg .alert { margin: 0 0 4px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.table-wrap:hover { scrollbar-color: var(--line-strong) transparent; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.table-wrap:hover::-webkit-scrollbar-thumb { background: var(--line-strong); }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 12px 10px; text-align: left; vertical-align: middle; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t th { background: var(--surface-2); color: var(--muted); font-size: 12.5px; font-weight: 500; }
table.t th a { color: inherit; text-decoration: none; }
table.t th a:hover { color: var(--accent); }
table.t td.c, table.t th.c { text-align: center; }
table.t.compact { font-size: 13.5px; }
table.t td.wrap { white-space: normal; min-width: 90px; line-height: 1.35; }
table.t td small { color: var(--faint); font-size: 12px; }
table.t td.amt { font-weight: 500; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover td, table.t tr:hover > td { background: var(--surface-2); }
table.t th:first-child, table.t td:first-child { padding-left: 20px; }
table.t th:last-child, table.t td:last-child { padding-right: 20px; }
.btn-edit { padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.btn-edit:hover { background: var(--accent-soft); }
.btn-edit:disabled { opacity: .6; cursor: not-allowed; }

.card-footer.pager { display: flex; justify-content: flex-end; }
.pagination { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pagination a, .pagination span { display: block; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; text-decoration: none; }
.pagination a { color: var(--accent); }
.pagination a:hover { background: var(--accent-soft); }
.pagination .active span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pagination .disabled span { color: var(--faint); }

details.card > summary { display: flex; align-items: center; gap: 8px; padding: 14px 24px; color: var(--muted); font-size: 14px; cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▸"; margin-left: auto; transition: transform .15s; }
details.card[open] > summary::after { transform: rotate(90deg); }
.search-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 4px 24px 20px; }
.search-bar > div { min-width: 170px; }
.search-bar .grow { margin-left: auto; display: flex; gap: 8px; }

/* ---------- payment: bank accounts ---------- */
.bank-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; padding: 20px 24px 24px; }
.bank { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.bank img { flex: none; border-radius: 10px; }
.bank-info { flex: 1; min-width: 0; line-height: 1.35; }
.bank-name { font-size: 13px; color: var(--muted); }
.bank-no { font-size: 18px; font-weight: 500; letter-spacing: .5px; }
.bank-owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.copy { flex: none; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.copy:hover { background: var(--accent-soft); }

/* ---------- guide ---------- */
.guide-wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.guide-wrap .card { margin: 16px 0 0; }
.tabs { flex: 0 0 280px; max-width: 100%; padding: 8px; }
.tabs button { display: block; width: 100%; margin: 0 0 2px; padding: 10px 14px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.tabs button:hover { background: var(--hover); color: var(--text); }
.tabs button.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.guide-main { flex: 1 1 400px; min-width: 0; }
.guide-empty { padding: 40px 24px; text-align: center; color: var(--faint); }
.guide-detail { padding: 20px 24px; }
.pane { display: none; }
.pane.active { display: block; }
.pane video { display: block; width: 100%; background: #000; }
.section_partition { margin-top: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.section_partition img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.section_partition .detail { margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius-sm); background: #0f1420; color: #b6f06a; line-height: 1.7; }
.section_partition .detail a { color: #7dd3fc; }

/* ---------- home ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.stat { margin: 0; padding: 18px 20px; }
.stat-label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.stat-label .pg-ico { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
.stat-hint { font-size: 12px; color: var(--faint); }
.stat-value { margin-top: 12px; font-size: 22px; font-weight: 500; line-height: 1.25; word-break: break-word; }
.stat-sub { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--muted); }
.stat-sub.text-red { color: var(--red); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; padding: 20px 24px 24px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; transition: box-shadow .15s, transform .15s, border-color .15s; }
a.app:hover, button.app:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
button.app { width: 100%; font: inherit; cursor: pointer; }
.app-ico { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: var(--accent); font-size: 30px; }
.app-ico img { width: 40px; height: 40px; object-fit: contain; }
.app-text { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.app-name { font-size: 14.5px; font-weight: 400; }
.app-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.apps-main { margin: 16px 0; }
.app.hero { flex-direction: row; gap: 20px; padding: 22px 26px; text-align: left; background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); width: 100%; }
.app.hero .app-ico { width: 72px; height: 72px; background: var(--surface); box-shadow: var(--shadow); }
.app.hero .app-text { flex: 1; text-align: left; }
.app.hero .app-name { font-size: 20px; font-weight: 500; }
.app.hero .app-desc { font-size: 14px; }
.app-go { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-weight: 400; }
.app.hero:hover .app-go { background: var(--accent-strong); }
@media (max-width: 640px) { .app.hero { flex-wrap: wrap; padding: 18px; } .app.hero .app-go { width: 100%; justify-content: center; } }
.notice { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0; padding: 16px 20px; border: 1px solid color-mix(in srgb, var(--yellow) 45%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--yellow) 12%, var(--surface)); }
.notice > div { flex: 1; min-width: 200px; }
.notice p { margin: 0; font-size: 13px; color: var(--muted); }
.notice .pg-ico { background: color-mix(in srgb, var(--yellow) 22%, var(--surface)); color: var(--yellow); }
.restart-row { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; padding-bottom: 20px; }
.app.off { opacity: .45; cursor: not-allowed; }
.gear { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer; }
.gear:hover { background: var(--hover); color: var(--text); }

/* FTP connection dialog (home) */
.ftp-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.ftp-dialog::backdrop { background: rgba(10,14,22,.55); }
.ftp-row { margin-bottom: 12px; }
.ftp-field { display: flex; gap: 8px; }
.ftp-field input { flex: 1; min-width: 0; background: var(--surface-2); }
.ftp-field .btn { padding: 8px 14px; font-size: 14px; white-space: nowrap; }
.ftp-note { margin: 14px 0; font-size: 13px; color: var(--muted); line-height: 1.7; }
.ftp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- toast + modals ---------- */
#toast { position: fixed; inset: 0; z-index: 999; display: none; align-items: flex-start; justify-content: center; padding: 20px 16px; pointer-events: none; }
#toast.show { display: flex; }
#toast > div { position: relative; display: flex; align-items: center; gap: 14px; max-width: 440px; min-width: 280px; padding: 14px 52px 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); font-size: 15px; font-weight: 400; pointer-events: auto; animation: toastIn .22s ease-out; }
#toast > div::before { content: ''; display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 16px; font-weight: 500; }
#toast .ok { border-left-color: var(--green); }
#toast .ok::before { content: '✓'; background: var(--green-soft); color: var(--green); }
#toast .fail { border-left-color: var(--red); }
#toast .fail::before { content: '✕'; background: var(--red-soft); color: var(--red); }
#toast .toast-content { flex: 1; }
#toast .toast-close { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--faint); font-size: 20px; cursor: pointer; }
#toast .toast-close:hover { background: var(--hover); color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

#confirm-modal { display: none; }
#confirm-modal.show, .modal-overlay { position: fixed; inset: 0; z-index: 998; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10,14,22,.5); animation: fadeIn .15s ease-out; }
#confirm-modal .modal-bg, #edit-payment-modal .modal-bg { width: 100%; padding: 26px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-lg); animation: slideUp .22s ease-out; }
#confirm-modal .modal-bg { max-width: 420px; }
#edit-payment-modal .modal-bg { max-width: 500px; }
.modal-title { margin: 0 0 8px; font-size: 18px; font-weight: 500; }
.modal-text { margin: 0 0 24px; color: var(--muted); }
.modal-actions, .edit-modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions button { padding: 10px 20px; border: 0; border-radius: var(--radius-sm); font: inherit; font-weight: 400; cursor: pointer; }
.btn-cancel { background: var(--hover); color: var(--text); }
.btn-cancel:hover { background: var(--line); }
.btn-confirm { min-width: 100px; background: var(--accent); color: var(--on-accent); }
.btn-confirm:hover { background: var(--accent-strong); }

.edit-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.edit-modal-header h2 { margin: 0; font-size: 18px; font-weight: 500; }
.edit-modal-form { display: grid; gap: 16px; margin-bottom: 24px; }
.edit-amount-group { display: flex; align-items: center; }
.edit-unit { padding: 0 0 0 12px; color: var(--faint); font-size: 13px; white-space: nowrap; }
.btn-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 24px; line-height: 1; cursor: pointer; }
.btn-close:hover { background: var(--hover); color: var(--text); }

@media (max-width: 640px) {
  .pg-head { padding: 16px; }
  .card-body, .bank-list, .apps { padding-left: 16px; padding-right: 16px; }
  .search-bar { padding: 4px 16px 16px; }
  .search-bar .grow { margin-left: 0; width: 100%; }
  .search-bar .grow .btn { flex: 1; }
  #confirm-modal .modal-bg, #edit-payment-modal .modal-bg { padding: 22px 20px; }
  .edit-modal-actions { flex-direction: column-reverse; }
  .edit-modal-actions .btn { width: 100%; }
  #toast > div { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.container.plain { padding-top: 24px; padding-bottom: 40px; }

/* theme toggle */
.theme-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 17px; cursor: pointer; }
.theme-btn:hover { background: var(--hover); color: var(--text); }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
.theme-btn.float { position: fixed; top: 16px; right: 16px; z-index: 5; }

/* amount vs package/length notice (information only) */
.pay-warn { margin-top: 0; max-height: 0; overflow: hidden; opacity: 0; font-size: 13px; line-height: 1.5; color: var(--red); color: color-mix(in srgb, var(--red) 70%, transparent); transition: opacity .5s ease, max-height .5s ease, margin-top .5s ease; }
.pay-warn.show { margin-top: 6px; max-height: 90px; opacity: 1; }

/* contact_us: messages the customer sent before */
.sent-item { padding: 12px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.sent-item:first-of-type { border-top: 0; }
.sent-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
