:root {
  --bg: #F4F5F7;
  --card: #FFFFFF;
  --ink: #1B1F23;
  --muted: #4A5260;
  --line: #E1E4E8;
  --blue: #1F5FBF;
  --blue-dark: #174A94;
  --ok-bg: #E3F3EA;
  --ok: #17663F;
  --warn-bg: #FFF1D6;
  --warn: #7A4B00;
  --bad-bg: #FDE8E6;
  --bad: #A32018;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
[hidden] { display: none !important; }
.screen { max-width: 520px; margin: 0 auto; padding: 20px 20px 40px; }
h1 { font-size: 26px; line-height: 1.2; margin: 18px 0 6px; }
.muted { color: var(--muted); margin: 0 0 16px; }
.muted-inline { color: var(--muted); font-size: 16px; font-weight: 500; }
.small { font-size: 14px; margin: 8px 0 0; }

.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 44px; height: 44px; border-radius: 8px; background: #fff; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 15px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.link {
  background: none; border: 0; color: var(--blue); font: inherit; font-weight: 600;
  min-height: 44px; padding: 0 4px; cursor: pointer;
}

label { display: block; font-weight: 600; margin: 16px 0 6px; }
input[type="tel"], input[type="password"] {
  width: 100%; height: 52px; padding: 0 14px; font-size: 18px;
  border: 1px solid #C5CAD1; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus-visible, button:focus-visible { outline: 3px solid #9DBBEA; outline-offset: 2px; }

.btn {
  width: 100%; min-height: 56px; border-radius: 12px; border: 0;
  font: inherit; font-size: 17px; font-weight: 700; cursor: pointer;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-dark); }
.btn.secondary { background: #fff; color: var(--ink); border: 1px solid #C5CAD1; }
.btn:disabled { opacity: .6; }
form .btn { margin-top: 20px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.big { font-size: 30px; font-weight: 700; line-height: 1.1; }
.bar { margin-top: 12px; height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
#barFill { height: 100%; width: 0; background: var(--blue); border-radius: 5px; transition: width .25s; }
.hint { margin: 12px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }

.banner { margin-top: 14px; padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.error { color: var(--bad); font-weight: 600; margin: 12px 0 0; }

.files { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 14px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
}
.files .name { font-weight: 600; font-size: 15px; word-break: break-all; }
.files .meta { font-size: 13px; color: var(--muted); }
.files .state { font-size: 13px; font-weight: 700; white-space: nowrap; }
.state.done { color: var(--ok); }
.state.uploading { color: var(--blue-dark); }
.state.waiting { color: var(--muted); }
.state.failed { color: var(--bad); }
.state.skipped { color: var(--warn); }

.installbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: #E8F0FD; border-bottom: 1px solid #C9DAF7; }
.installbar .it { display: flex; flex-direction: column; font-size: 14px; color: var(--ink); }
.installbar .it span { color: var(--muted); font-size: 13px; }
.installbar .btn { width: auto; margin: 0; padding: 10px 16px; white-space: nowrap; }
