:root {
  color-scheme: light;
  --ink: #1f2330;
  --muted: #676879;
  --line: #e6e9ef;
  --paper: #ffffff;
  --canvas: #f6f7fb;
  --blue: #0073ea;
  --blue-dark: #0060b9;
  --blue-soft: #e6f1fd;
  --green: #16825d;
  --green-soft: #e5f8f1;
  --amber: #ad6a00;
  --amber-soft: #fff6df;
  --red: #c53b3b;
  --red-soft: #fff0ef;
  --shadow: 0 7px 22px rgba(31, 35, 48, .07);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); font: 15px/1.5 'Figtree', 'Segoe UI', sans-serif; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

.login-screen { position: fixed; inset: 0; z-index: 1100; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 0, #eef5ff, var(--canvas) 42%); }
.login-card { width: min(390px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 20px 55px rgba(31, 35, 48, .12); }
.login-card img { display: block; width: 178px; height: auto; margin-bottom: 28px; }
.login-card h1 { margin: 0; font-size: 25px; line-height: 1.16; letter-spacing: -.03em; }
.login-card > p:not(.eyebrow):not(.form-message) { margin: 9px 0 22px; color: var(--muted); }
.login-card label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; min-height: 46px; margin-bottom: 13px; padding: 10px 12px; border: 1px solid #c7cbd4; border-radius: 8px; }
.login-card .button { width: 100%; }
.form-message { min-height: 20px; margin: 12px 0 0; font-size: 13px; font-weight: 650; }
.form-message.error { color: var(--red); }

.shell { width: min(1120px, calc(100% - 42px)); margin: 42px auto 70px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow, .step { margin: 0 0 5px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 44px); line-height: 1.08; letter-spacing: -.04em; }
h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.subtitle, .panel-heading p { margin: 7px 0 0; color: var(--muted); }

.connection { display: flex; align-items: center; gap: 9px; min-height: 40px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); box-shadow: var(--shadow); white-space: nowrap; font-size: 13px; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #d1932f; }
.connection.ready { color: var(--green); border-color: #bde3d1; background: var(--green-soft); }
.connection.ready .dot { background: #20a06b; }
.connection.error { color: var(--red); border-color: #efc8c5; background: var(--red-soft); }
.connection.error .dot { background: var(--red); }

.notice { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 13px 16px; border-radius: 9px; font-size: 13px; }
.notice.warning { color: var(--amber); border: 1px solid #efd99d; background: var(--amber-soft); }
.notice strong { flex-shrink: 0; }

.summary-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.summary-card { min-height: 130px; display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); box-shadow: var(--shadow); }
.summary-card span { color: var(--muted); font-weight: 650; }
.summary-card strong { margin: auto 0 1px; font-size: 27px; letter-spacing: -.025em; }
.summary-card small { color: var(--muted); }
.summary-card.primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #1164b6, var(--blue)); }
.summary-card.primary span, .summary-card.primary small { color: rgba(255,255,255,.8); }
.summary-card.primary strong { font-size: 38px; }

.panel { margin-top: 18px; padding: 23px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.panel-heading.compact { margin-bottom: 16px; }
.button { min-height: 42px; padding: 9px 16px; border: 0; border-radius: 7px; cursor: pointer; font-weight: 750; transition: background .15s, transform .15s, opacity .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover:not(:disabled) { background: var(--blue-dark); }
.button.secondary { color: var(--blue-dark); background: var(--blue-soft); }
.button:disabled { opacity: .45; cursor: not-allowed; }

.drop-zone { width: 100%; min-height: 168px; display: grid; place-items: center; align-content: center; gap: 5px; padding: 25px; border: 1.5px dashed #aeb9c8; border-radius: 10px; background: #fafbfd; color: var(--muted); cursor: pointer; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--blue); background: #f2f8ff; }
.drop-zone strong { color: var(--ink); font-size: 16px; }
.drop-icon { width: 49px; height: 49px; display: grid; place-items: center; margin-bottom: 3px; border-radius: 50%; color: var(--blue); background: var(--blue-soft); }

.table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: #f8f9fb; color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; max-width: 390px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.check { width: 48px; text-align: center; }
input[type='checkbox'] { width: 17px; height: 17px; accent-color: var(--blue); }
.money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 750; }
.remove-heading { width: 72px; text-align: center; }
.status { display: inline-block; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status.ready { color: var(--green); background: var(--green-soft); }
.status.loading { color: var(--amber); background: var(--amber-soft); }
.status.error { color: var(--red); background: var(--red-soft); }
.remove-button { width: 30px; height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; }
.remove-button:hover { color: var(--red); background: var(--red-soft); }
.receipt-error { color: var(--red); }

.send-area { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.send-options { display: flex; align-items: end; gap: 14px; }
.send-options label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; }
select { min-height: 42px; padding: 8px 34px 8px 11px; border: 1px solid #c7cbd4; border-radius: 7px; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(0, 115, 234, .2); outline-offset: 2px; }
.send-action { margin-left: auto; text-align: right; }
.send-action p { margin: 0 0 7px; color: var(--muted); font-size: 13px; }
.send-button { min-width: 200px; }

.progress { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf0f4; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .25s ease; }
.progress p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.result { display: flex; align-items: center; gap: 13px; margin-top: 20px; padding: 15px; border: 1px solid #bde3d1; border-radius: 9px; background: var(--green-soft); color: #126748; }
.result.error { border-color: #efc8c5; background: var(--red-soft); color: #a42f2f; }
.result-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-weight: 800; }
.result p { margin: 2px 0 0; }

footer { display: flex; justify-content: space-between; gap: 20px; padding: 18px 4px 0; color: var(--muted); font-size: 12px; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 700; }

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr; }
  .summary-card { min-height: 112px; }
  .send-area { align-items: stretch; flex-direction: column; }
  .send-action { width: 100%; margin-left: 0; text-align: left; }
}

@media (max-width: 640px) {
  .shell { width: min(100% - 20px, 1120px); margin: 64px auto 44px; }
  .topbar, .panel-heading, .notice { align-items: flex-start; flex-direction: column; }
  .panel { padding: 17px; }
  .send-options { align-items: stretch; flex-direction: column; }
  .send-options label, select, .send-button { width: 100%; }
  footer { align-items: flex-start; flex-direction: column; }
}

