/* =========================================================
   tg-eyeVision — 서비스 신청 페이지
   메인 홈페이지(../css/style.css) 디자인 토큰과 동일 계열
   ========================================================= */

:root {
    --primary:        #22d3ee;
    --primary-strong: #38bdf8;
    --primary-deep:   #0ea5e9;
    --blue:           #2563eb;

    --ink:       #f4f7fb;
    --ink-soft:  #d6dee9;
    --slate:     #b6c1d3;
    --muted:     #8894a8;

    --line:        rgba(255, 255, 255, .08);
    --line-strong: rgba(255, 255, 255, .16);

    --bg:        #070a12;
    --surface:   #0e1420;
    --surface-2: #141b2c;
    --field:     #0a0f19;

    --important: #fb7185;
    --warning:   #fbbf24;
    --success:   #34d399;

    --radius:    18px;
    --radius-sm: 10px;
    --ctl-h:     44px;
    --label-w:   120px;
    --ring:      0 0 0 4px rgba(56, 189, 248, .18);
    --shadow:    0 24px 60px -24px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(900px 480px at 85% -10%, rgba(37, 99, 235, .16), transparent 60%),
        radial-gradient(700px 420px at 0% 0%, rgba(34, 211, 238, .10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    color: var(--ink-soft);
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "Malgun Gothic", "Apple SD Gothic Neo", "Meiryo", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

p, h1, h2, h3, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* WPF Visibility.Collapsed 대응 */
[hidden] { display: none !important; }

/* WPF IsEnabled=false + Opacity=0.5 대응 (inert 와 함께 사용) */
.is-disabled {
    opacity: .38;
    filter: saturate(.3);
    pointer-events: none;
    transition: opacity .25s ease;
}
/* 비활성 영역 안의 비활성 항목은 흐림이 중복되지 않게 */
.is-disabled .is-disabled { opacity: 1; filter: none; }

::selection { background: rgba(56, 189, 248, .35); color: #fff; }

/* ---------------- 상단 바 ---------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(7, 10, 18, .72);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar-in {
    max-width: 1360px;
    height: 64px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; }
.brand-name { color: var(--ink); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.topbar-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--slate);
    font-size: 13.5px;
    font-weight: 500;
    transition: color .2s, border-color .2s, background .2s;
}
.topbar-link svg { width: 16px; height: 16px; }
.topbar-link:hover { color: var(--ink); border-color: var(--primary-strong); background: rgba(56, 189, 248, .08); }

/* ---------------- 레이아웃 (ucMain) ---------------- */
.app {
    flex: 1 0 auto;
    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 40px 32px 64px;
}

.page-head { margin-bottom: 28px; }
.page-title {
    color: var(--ink);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.25;
}
.page-desc { margin-top: 6px; color: var(--muted); }

.layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* ---------------- 좌측 메뉴 ---------------- */
.side {
    position: sticky;
    top: 88px;
    padding: 18px;
    background: rgba(14, 20, 32, .72);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.side-title {
    padding: 2px 6px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.side-group + .side-group { margin-top: 10px; }
.side-sub   { padding: 8px 0 4px 18px; margin-left: 18px; border-left: 1px solid var(--line); }
.side-block + .side-block { margin-top: 4px; }

/* 선택 항목이 아닌 하위 메뉴는 접어서 표시 */
.side .is-disabled { display: none; }

.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--slate);
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: background .2s, color .2s;
}
.opt:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.opt input,
.seg input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}
.opt-text { line-height: 1.35; }

.opt.top {
    padding: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .02);
    color: var(--ink-soft);
    font-size: 15px;
    font-weight: 600;
}
.opt.top:has(input:checked) {
    border-color: rgba(56, 189, 248, .45);
    background: linear-gradient(135deg, rgba(34, 211, 238, .12), rgba(37, 99, 235, .10));
    color: var(--ink);
}
.opt-ico {
    flex: 0 0 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
    transition: background .2s, color .2s;
}
.opt-ico svg { width: 17px; height: 17px; }
.opt.top:has(input:checked) .opt-ico {
    background: linear-gradient(135deg, var(--primary), var(--blue));
    color: #fff;
}

.opt-dot {
    flex: 0 0 16px;
    height: 16px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    transition: border-color .2s, box-shadow .2s;
}
.opt:has(input:checked) { color: var(--ink); }
.opt input:checked + .opt-dot {
    border-color: var(--primary-strong);
    box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--primary-strong);
}
.opt input:focus-visible ~ .opt-dot,
.opt input:focus-visible ~ .opt-ico { box-shadow: var(--ring); }

/* 데모 / 서비스 세그먼트 */
.seg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 4px 0 8px 36px;
    padding: 4px;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.seg label {
    position: relative;
    display: block;
    cursor: pointer;
    user-select: none;
}
.seg span {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: background .2s, color .2s;
}
.seg label:hover span { color: var(--ink); }
.seg input:checked + span {
    background: var(--surface-2);
    color: var(--ink);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 12px rgba(0, 0, 0, .35);
}
.seg input:focus-visible + span { box-shadow: var(--ring); }

.side-contact {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .03);
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
}

/* ---------------- 컨텐츠 공통 ---------------- */
.content { min-width: 0; }
.view { animation: fadeUp .35s ease both; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

.view-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}
.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
}
.view-title {
    margin-top: 2px;
    color: var(--ink);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.svc-type {
    flex: 0 0 auto;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .1);
    color: var(--success);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.svc-type:empty { display: none; }
.svc-type[data-type="Premium"] {
    border-color: rgba(56, 189, 248, .45);
    background: linear-gradient(135deg, rgba(34, 211, 238, .16), rgba(37, 99, 235, .16));
    color: var(--primary);
}

/* ---------------- 카드 ---------------- */
.card {
    padding: 26px 28px;
    margin-bottom: 20px;
    background: rgba(14, 20, 32, .78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.card-head h3 {
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
}
.step {
    flex: 0 0 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--blue));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* 약관 */
.agreements {
    height: 220px;
    padding: 16px 18px;
    overflow: auto;
    background: var(--field);
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.75;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

/* check.png / uncheck.png 토글 버튼 대체 */
.agree {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 10px 16px 10px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: border-color .2s, background .2s;
}
.agree:hover { border-color: var(--primary-strong); }
.agree input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.agree-box {
    flex: 0 0 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 7px;
    transition: background .2s, border-color .2s;
}
.agree-box::after {
    content: "";
    width: 6px;
    height: 11px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .18s ease;
}
.agree:has(input:checked) { border-color: rgba(56, 189, 248, .5); background: rgba(56, 189, 248, .08); }
.agree input:checked + .agree-box {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary), var(--blue));
}
.agree input:checked + .agree-box::after { transform: rotate(45deg) scale(1); }
.agree input:focus-visible + .agree-box { box-shadow: var(--ring); }

/* 안내 박스 */
.callout {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .03);
    color: var(--slate);
    font-size: 13.5px;
    line-height: 1.65;
}
.callout.warn   { border-color: rgba(251, 191, 36, .28); background: rgba(251, 191, 36, .07); color: #f6d58a; }
.callout.danger { border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .08); color: #fda4af; font-weight: 600; }
.box-form .callout { margin: 4px 0 18px; }

.callout.steps {
    list-style: none;
    counter-reset: s;
    display: grid;
    gap: 6px;
}
.callout.steps li { display: flex; gap: 8px; }

/* ---------------- 입력 박스 ---------------- */
.box {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}
.box:has(.box-video:empty) { grid-template-columns: minmax(0, 640px); }
.box-video:empty { display: none; }
.box.wide { grid-template-columns: minmax(0, 1fr); }  /* 설치가이드 영상 없이 폼만 넓게 */

.box-form { min-width: 0; }

.box-video {
    position: sticky;
    top: 88px;
    min-width: 0;
}
.video-cap {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.box-video video {
    display: block;
    width: 100%;
    background: #000;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8);
}

.divider { height: 1px; margin: 22px 0; background: var(--line); }

.row {
    display: grid;
    grid-template-columns: var(--label-w) minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.row > :only-child { grid-column: 1 / -1; }
.row.tight { margin-bottom: 6px; }
.row > .opt-err { grid-column: 2; margin-top: -6px; }

.lbl {
    color: var(--slate);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.fld {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.hint {
    margin: 0 0 4px calc(var(--label-w) + 14px);
    color: var(--muted);
    font-size: 12.5px;
}

input[type=text],
input[type=password] {
    width: 100%;
    min-width: 0;
    height: var(--ctl-h);
    padding: 0 14px;
    background: var(--field);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
input[type=text]:hover,
input[type=password]:hover { border-color: rgba(255, 255, 255, .26); }
input[type=text]:focus,
input[type=password]:focus {
    outline: none;
    border-color: var(--primary-strong);
    box-shadow: var(--ring);
    background: #0b1220;
}
/* 로그인 정보 등 꼭 기억해야 하는 항목 */
input.important { border-color: rgba(251, 113, 133, .45); }
input.important:focus { border-color: var(--important); box-shadow: 0 0 0 4px rgba(251, 113, 133, .16); }
input[readonly] { background: rgba(255, 255, 255, .03); color: var(--primary); font-weight: 600; }
input[readonly]:focus { box-shadow: none; }

/* 입력 + 버튼 */
.fld-btn input  { flex: 1 1 auto; }
.fld-btn .btn   { flex: 0 0 auto; min-width: 152px; }

/* RTSP 입력 + 확인 + ? */
.fld-rtsp input     { flex: 1 1 auto; }
.fld-rtsp .btn      { flex: 0 0 100px; }
.fld-rtsp .btn.help { flex: 0 0 var(--ctl-h); padding: 0; font-weight: 700; }

/* 사용기간: [n] 개월 [가격] 원 */
.fld-price .month { flex: 0 0 84px; text-align: center; }
.fld-price .price {
    flex: 1 1 auto;
    text-align: right;
    font-size: 17px;
    font-variant-numeric: tabular-nums;
    border-color: transparent;
    background: rgba(56, 189, 248, .06);
}

/* 시리얼키 생성 + 라벨 + 입력 */
.fld-serial .btn   { flex: 0 0 auto; padding: 0 20px; }
.fld-serial .unit  { padding: 0 4px; }
.fld-serial input  { flex: 1 1 auto; }

/* 버튼 2개 */
.fld-2btn .btn { flex: 1 1 0; }

.unit {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------------- 시스템 옵션 (현장학습 / LLM / 얼굴인식 / 디바이스) ---------------- */
.opts { display: grid; gap: 14px; }
.opt-group {
    padding: 16px 18px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .02);
}
.opt-group-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
label.opt-group-head { cursor: pointer; user-select: none; }
.opt-group-title { color: var(--ink); font-size: 15px; font-weight: 700; }

.opt-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}
.opt-grid .span-full { grid-column: 1 / -1; }

/* 그룹 안의 하위 그룹 (현장학습 > 얼굴인식) */
.opt-sub { padding: 14px 16px 16px; }
.opt-grid:not([hidden]) + .opt-sub { margin-top: 14px; }
.opt-sub > .opt-group-head:last-child,
.opt-sub > .opt-group-head:has(+ [hidden]) { margin-bottom: 0; }
.opt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt-field > label { color: var(--slate); font-size: 13px; font-weight: 600; line-height: 1.35; }
.opt-field [title] { cursor: help; }
.opt-err { color: var(--important); font-size: 12px; }
.opt-inline { display: flex; align-items: center; gap: 12px; min-width: 0; }
.opt-inline .chk { flex: 0 0 auto; white-space: nowrap; }
.opt-inline select { flex: 1 1 auto; }

select {
    width: 100%;
    min-width: 0;
    height: var(--ctl-h);
    padding: 0 36px 0 14px;
    background: var(--field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238894a8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font: inherit;
    font-size: 15px;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
select:hover { border-color: rgba(255, 255, 255, .26); }
select:focus { outline: none; border-color: var(--primary-strong); box-shadow: var(--ring); }
select option { background: var(--surface); color: var(--ink); }

/* 체크박스 (agree-box 와 동일한 모양) */
.chk {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}
.chk input,
.opt-group-head input,
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chk-box {
    flex: 0 0 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 2px solid var(--line-strong);
    border-radius: 6px;
    transition: background .2s, border-color .2s;
}
.chk-box::after {
    content: "";
    width: 5px;
    height: 10px;
    margin-top: -2px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .18s ease;
}
input:checked + .chk-box { border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--blue)); }
input:checked + .chk-box::after { transform: rotate(45deg) scale(1); }
input:focus-visible + .chk-box { box-shadow: var(--ring); }

/* 디바이스 타입 다중 선택 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; user-select: none; }
.chip span {
    display: block;
    padding: 8px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    transition: background .2s, border-color .2s, color .2s;
}
.chip:hover span { color: var(--ink); }
.chip input:checked + span { border-color: rgba(56, 189, 248, .5); background: rgba(56, 189, 248, .12); color: var(--ink); }
.chip input:focus-visible + span { box-shadow: var(--ring); }

/* 하단 안내 */
.notes {
    margin-top: 22px;
    padding: 16px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}
.notes p + p { margin-top: 4px; }
.notes-title { margin-bottom: 6px; color: var(--slate); font-weight: 700; font-size: 13px; }
.notes .spec { color: var(--slate); }
.notes .spec:first-of-type { margin-top: 10px; }

/* ---------------- 버튼 (ucButton 대체) ---------------- */
.btn {
    height: var(--ctl-h);
    padding: 0 16px;
    border: 1px solid rgba(56, 189, 248, .35);
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, .10);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background .2s, border-color .2s, box-shadow .2s, transform .1s;
}
.btn:hover:not(:disabled)  { background: rgba(56, 189, 248, .18); border-color: var(--primary-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible         { outline: none; box-shadow: var(--ring); }
.btn:disabled              { cursor: default; opacity: .55; }

.btn.important {
    border-color: transparent;
    background: linear-gradient(135deg, var(--primary) 0%, var(--blue) 100%);
    color: #fff;
    box-shadow: 0 10px 24px -12px rgba(37, 99, 235, .8);
}
.btn.important:hover:not(:disabled) {
    background: linear-gradient(135deg, #3ee0f5 0%, #3b76f0 100%);
    box-shadow: 0 14px 30px -12px rgba(37, 99, 235, .95);
}
.btn.ghost {
    border-color: var(--line-strong);
    background: transparent;
    color: var(--slate);
}
.btn.ghost:hover:not(:disabled) { color: var(--ink); background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .3); }
.btn.full { width: 100%; }

/* ---------------- 처리중 (Cursors.Wait) ---------------- */
body.busy, body.busy * { cursor: progress !important; }
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 40%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--blue), transparent);
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
}
body.busy::after {
    opacity: 1;
    animation: busy 1.1s ease-in-out infinite;
}
@keyframes busy {
    from { transform: translateX(-100%); }
    to   { transform: translateX(250%); }
}

/* ---------------- 메시지 대화상자 ---------------- */
.dlg {
    width: min(420px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    color: var(--ink-soft);
    box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .8);
}
.dlg::backdrop { background: rgba(2, 4, 8, .6); backdrop-filter: blur(4px); }
.dlg[open] { animation: dlgIn .2s ease both; }
@keyframes dlgIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to   { opacity: 1; transform: none; }
}
.dlg form { padding: 24px; }
.dlg-title { margin-bottom: 10px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.dlg-msg { color: var(--ink); font-size: 15.5px; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.dlg-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.dlg-actions .btn { min-width: 96px; }

/* ---------------- 푸터 ---------------- */
.footer {
    padding: 22px 32px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
    text-align: center;
}

/* ---------------- 좁은 화면 ---------------- */
@media (max-width: 1180px) {
    .box, .box:has(.box-video:empty) { grid-template-columns: minmax(0, 1fr); }
    .box-video { position: static; }
}
@media (max-width: 860px) {
    .topbar-in, .app { padding-left: 16px; padding-right: 16px; }
    .app { padding-top: 28px; }
    .page-title { font-size: 24px; }
    .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .side { position: static; }
    .card { padding: 20px 18px; }
}
@media (max-width: 560px) {
    .row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
    .row .lbl:empty { display: none; }
    .row > .opt-err { grid-column: 1; margin-top: 0; }
    .hint { margin-left: 0; }
    .fld-btn, .fld-rtsp, .fld-serial { flex-wrap: wrap; }
    .fld-btn .btn { flex: 1 1 100%; }
    .fld-serial .btn { flex: 1 1 100%; }
    .view-head { flex-direction: column; align-items: flex-start; }
    .opt-grid { grid-template-columns: minmax(0, 1fr); }
    .opt-group { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
