:root {
  color-scheme: light;
  --bg: #f4f9ff;
  --text: #10192d;
  --muted: #66758d;
  --line: rgba(17, 24, 39, .11);
  --panel: rgba(255, 255, 255, .94);
  --panel-2: rgba(248, 252, 255, .92);
  --blue: #36bdf4;
  --blue-dark: #0572ad;
  --green: #20c870;
  --red: #e54863;
  --shadow: 0 18px 48px rgba(75, 105, 160, .16);
}


.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #eaf5ff 0%, #f8fbff 58%, #ffffff 100%); }

.orb { position: absolute; width: 280px; height: 280px; border-radius: 999px; filter: blur(12px); opacity: .58; }

.orb-a { top: -110px; right: -90px; background: radial-gradient(circle, rgba(56,189,248,.25), transparent 66%); }

.orb-b { bottom: -120px; left: -90px; background: radial-gradient(circle, rgba(34,197,94,.18), transparent 67%); }

.grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(37,99,235,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(37,99,235,.08) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, rgba(0,0,0,.78), transparent); }


.app-shell { width: min(860px, 100%); margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 4px 0 16px; }

.app-titlebar { align-items: flex-start; }

.user-id-line { margin: 8px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }

.eyebrow { margin: 0 0 8px; color: var(--blue); text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 900; }


.glass, .hero-card, .panel { background: linear-gradient(145deg, var(--panel), var(--panel-2)); border: 1px solid rgba(30, 64, 175, .10); box-shadow: var(--shadow); backdrop-filter: blur(18px); }

.hero-card { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: center; padding: 20px; border-radius: 32px; overflow: hidden; position: relative; }

.hero-card:after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 220px; height: 220px; background: radial-gradient(circle, rgba(34,197,94,.20), transparent 65%); pointer-events: none; }

.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 16px; border-radius: 999px; background: #ecfdf5; color: #047857; border: 1px solid #bbf7d0; font-size: 12px; font-weight: 900; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(34,197,94,.14); }

.panel { padding: clamp(18px, 5vw, 28px); border-radius: 30px; margin-top: 16px; }

.steps-panel { padding: 18px; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }


.icon-button, .link-button, .submit-button { border: 0; font-weight: 900; }

.icon-button { width: 52px; height: 52px; border-radius: 18px; background: rgba(255,255,255,.88); color: #0f172a; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 24px; }

.link-button { min-height: 48px; padding: 12px 16px; border-radius: 999px; color: var(--blue-dark); background: linear-gradient(180deg, #e0f7ff, #d7f3ff); border: 1px solid rgba(14, 165, 233, .42); box-shadow: 0 10px 24px rgba(14, 165, 233, .16); }

.link-button:disabled { opacity: .42; filter: grayscale(.35); }

.submit-button { width: 100%; min-height: 58px; padding: 16px 18px; border-radius: 22px; color: white; background: linear-gradient(135deg, #22c55e, #0284c7); box-shadow: 0 16px 36px rgba(2,132,199,.24); font-size: 18px; }

.submit-button:disabled { opacity: .65; filter: saturate(.7); }

.icon-button:active, .link-button:not(:disabled):active, .submit-button:not(:disabled):active, .row-card:active, .mini-step:not(:disabled):active { transform: scale(.985); }

.wide-back { width: 100%; margin: 0 0 18px; display: inline-flex; align-items: center; justify-content: center; }


.mini-steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }

.mini-step { border: 1px solid rgba(15,23,42,.10); border-radius: 18px; padding: 10px 6px; color: #64748b; background: #f8fafc; text-align: center; }

.mini-step span { width: 32px; height: 32px; display: grid; place-items: center; margin: 0 auto 7px; border-radius: 12px; background: #e2e8f0; color: #475569; font-weight: 900; }

.mini-step b { display: block; font-size: 11px; line-height: 1.15; }

.mini-step.active { background: #eff6ff; color: #0f172a; border-color: rgba(14,165,233,.45); }

.mini-step.active span { background: var(--blue); color: #082f49; }

.mini-step.done { background: #ecfdf5; color: #047857; border-color: rgba(34,197,94,.32); }

.mini-step.done span { background: var(--green); color: #052e16; }

.mini-step:disabled { opacity: .58; }


.smart-form { display: grid; gap: 14px; }

.smart-form label { display: grid; gap: 9px; color: #dbeafe; font-weight: 900; font-size: 14px; }

.smart-form label span { color: #dbeafe; }

.smart-form input, .smart-form select { width: 100%; min-height: 58px; border: 1px solid rgba(15,23,42,.14); border-radius: 22px; padding: 15px 18px; color: #0f172a; caret-color: #0f172a; background: #ffffff; outline: none; font-weight: 800; }

.smart-form input { -webkit-text-fill-color: #0f172a; }

.smart-form input::placeholder { color: rgba(15,23,42,.42); }

.smart-form input:focus, .smart-form select:focus { border-color: rgba(56,189,248,.86); box-shadow: 0 0 0 4px rgba(56,189,248,.13); }

.auto-detect { margin: -4px 2px 0; color: #64748b; font-weight: 800; }


.list { display: grid; gap: 12px; margin-top: 18px; }

.row-card { width: 100%; display: grid; gap: 7px; padding: 18px; border-radius: 24px; border: 1px solid rgba(15,23,42,.10); background: rgba(255,255,255,.88); color: #0f172a; text-align: left; }

.row-card.selected, .row-card:active { background: #ecfdf5; border-color: rgba(34,197,94,.55); }

.row-card b { color: #0f172a; font-size: 17px; line-height: 1.18; }

.row-card small { color: var(--muted); line-height: 1.35; font-size: 14px; }

.row-card em { justify-self: start; color: #64748b; background: #f1f5f9; border-radius: 999px; padding: 4px 9px; font-style: normal; font-weight: 800; font-size: 12px; }

.empty { padding: 22px; border-radius: 22px; background: #f1f5f9; color: #64748b; text-align: center; font-weight: 800; }

.empty.error { display: grid; gap: 12px; background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }

.retry-button { justify-self: center; }

.nav-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }

.hint { margin: 12px 2px 0; font-size: 13px; }

.hint.center { text-align: center; }


.summary-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 22px; background: rgba(255,255,255,.72); border: 1px solid rgba(15,23,42,.08); margin-bottom: 14px; }

.summary-card span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 18px; background: #eef6ff; font-size: 24px; flex: 0 0 auto; }

.summary-card b, .summary-card small { display: block; }

.summary-card b { color: #0f172a; }

.summary-card small { color: var(--muted); margin-top: 4px; }

.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }

.danger { background: linear-gradient(135deg, #fb7185, #f97316); }

.done-card { text-align: center; }

.done-icon { width: 76px; height: 76px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 28px; background: rgba(34,197,94,.16); font-size: 40px; }

.result-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; text-align: left; }

.result-list li { padding: 10px 12px; border-radius: 12px; background: rgba(15,23,42,.04); border: 1px solid rgba(15,23,42,.08); font-size: 14px; line-height: 1.4; color: var(--text); }

.submit-button.secondary { background: linear-gradient(135deg, #64748b, #475569); margin-top: 8px; display: inline-block; text-decoration: none; text-align: center; }

.loader { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border: 2px solid rgba(100,116,139,.28); border-top-color: var(--blue-dark); border-radius: 999px; vertical-align: -2px; animation: spin .8s linear infinite; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 5; transform: translateY(140%); opacity: 0; transition: .22s ease; padding: 14px 16px; border-radius: 18px; background: rgba(15,23,42,.92); border: 1px solid rgba(255,255,255,.12); box-shadow: var(--shadow); color: white; font-weight: 800; text-align: center; backdrop-filter: blur(18px); }

.toast.show { transform: translateY(0); opacity: 1; }


.scan-field { position: relative; display: grid; }

.scan-field input { padding-right: 118px; }

.scan-field.scan-field-single-action input { padding-right: 68px; }

.scan-button {
  position: absolute;
  right: 60px;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #dff8ff, #c8f0ff);
  color: #0572ad;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(14,165,233,.18);
}

.attach-button {
  right: 8px;
  background: linear-gradient(135deg, #ecfdf5, #d9fbe8);
  color: #047857;
  font-size: 22px;
}

.attach-button:disabled { opacity: .72; filter: saturate(.7); }

.attach-button[aria-busy="true"] { font-size: 28px; line-height: 1; }

.onu-photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.scan-button:active { transform: translateY(-50%) scale(.96); }

.scanner-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(10px);
}

.scanner-card {
  width: min(520px, 100%);
  padding: 16px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0,0,0,.32);
}

.scanner-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-size: 20px; }

.scanner-close { width: 42px; height: 42px; border: 0; border-radius: 14px; background: #f1f5f9; color: #0f172a; font-size: 28px; line-height: 1; }

.scanner-frame { position: relative; overflow: hidden; border-radius: 22px; background: #0f172a; aspect-ratio: 3 / 4; }

.scanner-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }

.scanner-frame span { position: absolute; left: 10%; right: 10%; top: 50%; height: 3px; border-radius: 999px; background: #22c55e; box-shadow: 0 0 0 999px rgba(15,23,42,.22), 0 0 18px rgba(34,197,94,.85); }

.scanner-card p { margin: 12px 4px 0; text-align: center; font-weight: 800; }


/* Alphabetical filter bar (OLT step) */
.letter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; padding: 8px; border-radius: 14px; background: rgba(255,255,255,.55); backdrop-filter: blur(8px); border: 1px solid rgba(15,23,42,.06); }

.letter-chip { display: inline-flex; align-items: center; gap: 4px; min-width: 38px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(15,23,42,.1); background: #fff; color: #0f172a; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform .08s ease, background .15s ease, color .15s ease, border-color .15s ease; }

.letter-chip b { font-weight: 800; letter-spacing: .02em; }

.letter-chip i { font-style: normal; font-size: 11px; font-weight: 600; color: #64748b; }

.letter-chip:hover { border-color: var(--blue, #2563eb); }

.letter-chip:active { transform: scale(.96); }

.letter-chip.active { background: var(--blue, #2563eb); color: #fff; border-color: var(--blue, #2563eb); }

.letter-chip.active i { color: rgba(255,255,255,.85); }


/* Unified review card (single block, multiple rows) */
.review-card { display: flex; flex-direction: column; gap: 0; margin: 12px 0 16px; padding: 6px 14px; background: #fff; border-radius: 18px; border: 1px solid rgba(15,23,42,.08); box-shadow: 0 6px 24px rgba(15,23,42,.06); overflow: hidden; }

.review-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid rgba(15,23,42,.06); }

.review-row:last-child { border-bottom: 0; }

.review-row-icon { flex: 0 0 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: #eff6ff; font-size: 18px; }

.review-row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }

.review-row-text b { font-size: 16px; font-weight: 800; color: #0f172a; line-height: 1.2; word-break: break-word; }

.review-row-text small { font-size: 13px; color: #64748b; margin-top: 2px; line-height: 1.25; word-break: break-word; }


/* Быстрый ввод префикса IP на шаге поиска абонента */
.ip-prefix-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 6px; }

.ip-prefix-chip { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(15,23,42,.12); background: rgba(255,255,255,.7); color: #0f172a; font-size: 13px; font-weight: 600; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; transition: transform .08s ease, background .15s ease, border-color .15s ease; }

.ip-prefix-chip:hover { border-color: var(--blue, #2563eb); background: #fff; }

.ip-prefix-chip:active { transform: scale(.96); }


/* Бейдж требуемого типа идентификатора ONU (зависит от типа OLT) */
.onu-required-badge { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 8px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; border: 1px solid transparent; }

.onu-required-badge.epon { background: #ecfdf5; color: #047857; border-color: rgba(4,120,87,.2); }

.onu-required-badge.gpon { background: #eff6ff; color: #1d4ed8; border-color: rgba(29,78,216,.2); }


/* Выпадающий список ONU (шаг 3) */
.pick-onu-toggle { margin: 10px 0 0; width: 100%; text-align: center; }

.onu-pick-wrap { margin: 10px 0 2px; }

.onu-pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }

.onu-pick-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 14px; border-radius: 14px; border: 1px solid rgba(15,23,42,.1); background: #fff; color: #0f172a; font-size: 14px; font-weight: 600; text-align: left; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; cursor: pointer; transition: transform .08s ease, background .15s ease, border-color .15s ease; }

.onu-pick-item:hover { border-color: var(--blue, #2563eb); background: #f8fafc; }

.onu-pick-item:active { transform: scale(.97); }