:root {
  --green-900: #274c3b;
  --green-800: #355f4a;
  --green-700: #4f7f68;
  --green-600: #638f78;
  --green-500: #87ad9a;
  --green-100: #e9f2ed;
  --green-50: #f3f8f5;
  --ink: #13251d;
  --muted: #65756d;
  --line: #dbe5df;
  --surface: #ffffff;
  --canvas: #f4f7f5;
  --danger: #b93838;
  --shadow: 0 24px 60px rgba(26, 61, 45, .12);
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; min-width: 0; height: 100%; margin: 0; overflow: hidden; background: var(--canvas); color: var(--ink); }
button, input, textarea { font: inherit; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }

.view { width: 100%; height: 100dvh; }
.eyebrow { display: block; color: rgba(255,255,255,.7); font-size: 12px; font-weight: 800; letter-spacing: .14em; }
.eyebrow.green { color: var(--green-700); }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #48a875; box-shadow: 0 0 0 4px rgba(72,168,117,.12); }

.button { min-height: 42px; padding: 0 20px; border: 1px solid transparent; border-radius: 8px; background: #fff; color: var(--ink); font-weight: 750; cursor: pointer; transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease; }
.button:active { transform: translateY(1px) scale(.995); }
.button:disabled { opacity: .42; cursor: default; transform: none; }
.button.primary { background: var(--green-700); color: #fff; box-shadow: 0 8px 20px rgba(79,127,104,.2); }
.button.primary:not(:disabled):hover { background: var(--green-800); }
.button.secondary, .button.ghost { border-color: var(--line); background: #fff; }
.button.secondary:hover, .button.ghost:hover { background: var(--green-50); border-color: #c5d8cd; }
.button.danger { min-height: 36px; padding-inline: 15px; color: var(--danger); border-color: #efcaca; background: #fff; }
.button.large { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between; padding-inline: 22px; font-size: 16px; }

/* Login */
.login-view { display: grid; place-items: center; padding: max(32px, env(safe-area-inset-top)) max(42px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(42px, env(safe-area-inset-left)); background: radial-gradient(circle at 80% 12%, rgba(135,173,154,.22), transparent 29%), linear-gradient(145deg, #f8fbf9 0%, #eef5f1 100%); }
.login-shell { display: grid; grid-template-columns: minmax(420px, 1.2fr) minmax(390px, .8fr); width: min(1060px, 100%); min-height: min(620px, calc(100dvh - 64px)); overflow: hidden; border: 1px solid rgba(79,127,104,.12); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.brand-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px 54px; overflow: hidden; color: #fff; background: linear-gradient(145deg, #274c3b 0%, #3f7058 55%, #6f9b84 100%); }
.brand-panel::before, .brand-panel::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.brand-panel::before { width: 430px; height: 430px; right: -190px; bottom: -150px; }
.brand-panel::after { width: 260px; height: 260px; right: -115px; bottom: -65px; }
.login-logo { position: relative; z-index: 1; width: 188px; height: auto; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.95); }
.brand-copy { position: relative; z-index: 1; max-width: 540px; margin-block: auto; }
.brand-copy h1 { margin: 18px 0 20px; font-size: clamp(38px, 4vw, 58px); line-height: 1.16; letter-spacing: -.045em; }
.brand-copy p { margin: 0; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.7; }
.security-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.75); font-size: 13px; }
.security-line .status-dot { background: #a8ddbc; box-shadow: 0 0 0 4px rgba(168,221,188,.14); }
.login-card { display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 52px; }
.login-card h2 { margin: 9px 0 10px; font-size: 34px; letter-spacing: -.04em; }
.login-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.login-card label { display: grid; gap: 9px; color: #334b40; font-size: 13px; font-weight: 750; }
.login-card input { width: 100%; height: 50px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fbfdfc; color: var(--ink); font-size: 16px; }
.login-card input:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(99,143,120,.12); }
.login-card input[readonly] { color: var(--muted); background: #f4f7f5; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.icon-button { border: 0; background: transparent; cursor: pointer; }
.text-toggle { position: absolute; top: 0; right: 8px; height: 50px; padding: 0 10px; color: var(--green-700); font-size: 13px; font-weight: 800; }
.form-error { padding: 12px 14px; border: 1px solid #f1caca; border-radius: 8px; color: #a72d2d; background: #fff7f7; font-size: 13px; }
.login-card small { text-align: center; color: #87958e; }
.login-divider { display: flex; align-items: center; gap: 12px; color: #98a49e; font-size: 11px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.download-card { min-height: 68px; display: grid; grid-template-columns: 38px 1fr 24px; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid #cfe0d7; border-radius: 10px; color: var(--ink); background: var(--green-50); text-decoration: none; transition: border-color .14s ease, background .14s ease, transform .14s ease; }
.download-card:hover { border-color: var(--green-500); background: #edf6f1; }
.download-card:active { transform: translateY(1px); }
.download-copy { min-width: 0; display: grid; gap: 4px; }
.download-copy strong { color: var(--green-900); font-size: 14px; }
.download-copy small { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.download-icon { position: relative; width: 36px; height: 36px; border-radius: 9px; background: var(--green-700); }
.download-icon::before { content: ""; position: absolute; left: 17px; top: 8px; width: 2px; height: 13px; background: #fff; }
.download-icon::after { content: ""; position: absolute; left: 12px; top: 15px; width: 8px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.download-arrow { color: var(--green-700); font-size: 19px; font-weight: 800; }

/* Device list */
.device-view { display: flex; flex-direction: column; background: #f4f7f9; }
.app-header { height: 112px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) max(34px, env(safe-area-inset-right)) 0 max(34px, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); }
.brand-lockup { display: flex; align-items: center; gap: 18px; }
.brand-lockup img { width: 112px; height: auto; }
.brand-divider { width: 1px; height: 42px; background: var(--line); }
.brand-lockup > div:last-child { display: grid; gap: 3px; }
.brand-lockup strong { font-size: 21px; letter-spacing: .04em; }
.brand-lockup span { color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.header-download { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; white-space: nowrap; text-decoration: none; font-size: 12px; }
.mini-download-icon { position: relative; width: 14px; height: 15px; border-bottom: 1.5px solid currentColor; }
.mini-download-icon::before { content: ""; position: absolute; left: 6px; top: 0; width: 1.5px; height: 10px; background: currentColor; }
.mini-download-icon::after { content: ""; position: absolute; left: 3px; top: 5px; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.summary-chip { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 16px; border: 1px solid #d8e7df; border-radius: 999px; background: var(--green-50); color: var(--green-800); font-size: 13px; font-weight: 750; }
.device-content { flex: 1; min-height: 0; display: grid; grid-template-rows: auto auto minmax(0,1fr) auto; gap: 18px; padding: 30px max(34px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(34px, env(safe-area-inset-left)); }
.section-heading { display: flex; align-items: end; justify-content: space-between; }
.section-heading h1 { margin: 5px 0 0; font-size: 28px; letter-spacing: -.035em; }
.section-heading p { margin: 0 0 2px; color: var(--muted); font-size: 14px; }
.control-bar { display: grid; grid-template-columns: minmax(330px,1fr) auto auto auto; align-items: center; gap: 12px; }
.search-box { position: relative; display: block; }
.search-box input { width: 100%; height: 46px; padding: 0 44px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #fff; color: var(--ink); font-size: 15px; }
.search-box input:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(99,143,120,.1); }
.search-icon { position: absolute; left: 17px; top: 14px; width: 15px; height: 15px; border: 2px solid #819088; border-radius: 50%; pointer-events: none; }
.search-icon::after { content: ""; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -2px; transform: rotate(45deg); background: #819088; }
.clear-search { position: absolute; right: 8px; top: 7px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #eef3f0; color: var(--muted); font-size: 20px; }
.last-checked { white-space: nowrap; color: var(--muted); font-size: 12px; }
.device-table-shell { min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(36,69,53,.04); }
.device-table-head, .device-row { display: grid; grid-template-columns: minmax(220px,1.55fr) minmax(120px,.7fr) minmax(100px,.62fr) minmax(150px,.9fr) 30px; align-items: center; column-gap: 18px; padding-inline: 22px; }
.device-table-head { position: sticky; top: 0; z-index: 2; min-height: 42px; border-bottom: 1px solid var(--line); background: #f7faf8; color: #718078; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.device-row { min-height: 58px; border-bottom: 1px solid #edf2ef; cursor: pointer; transition: background .12s ease; }
.device-row:last-child { border-bottom: 0; }
.device-row:hover { background: #f8fbf9; }
.device-row.selected { position: relative; background: var(--green-50); box-shadow: inset 3px 0 0 var(--green-700); }
.device-row.offline { color: #829088; }
.device-name { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 750; }
.pc-icon { position: relative; flex: 0 0 auto; width: 28px; height: 20px; border: 2px solid currentColor; border-radius: 3px; color: var(--green-700); }
.pc-icon::before { content: ""; position: absolute; left: 10px; bottom: -6px; width: 5px; height: 5px; background: currentColor; }
.pc-icon::after { content: ""; position: absolute; left: 5px; bottom: -8px; width: 15px; height: 2px; background: currentColor; }
.device-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-id, .last-seen { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.online-state { display: inline-flex; align-items: center; gap: 8px; color: var(--green-700); font-size: 13px; font-weight: 750; }
.online-state.offline { color: #8a9790; }
.online-state .status-dot { width: 7px; height: 7px; box-shadow: none; }
.online-state.offline .status-dot { background: #aeb8b3; }
.row-arrow { color: var(--green-700); font-size: 22px; opacity: 0; transform: translateX(-4px); transition: .12s ease; }
.device-row.selected .row-arrow { opacity: 1; transform: none; }
.empty-state { min-height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.empty-state strong { color: #3f5148; }
.empty-icon { width: 46px; height: 34px; margin-bottom: 5px; border: 2px solid #9dafA5; border-radius: 5px; }
.device-footer { display: flex; justify-content: space-between; color: #7a8981; font-size: 11px; }

/* Remote viewer */
.remote-view { width: 100%; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #0a0d0b; }
.remote-toolbar { z-index: 5; position: relative; flex: 0 0 auto; height: calc(58px + env(safe-area-inset-top)); display: grid; grid-template-columns: minmax(250px,1fr) auto minmax(340px,1fr); align-items: end; padding: env(safe-area-inset-top) max(10px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left)); border-bottom: 1px solid #dfe6e2; background: rgba(250,252,251,.98); }
.remote-meta { align-self: center; display: grid; gap: 2px; min-width: 0; }
.remote-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.remote-meta span { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; }
.remote-meta .status-dot { width: 6px; height: 6px; box-shadow: none; }
.monitor-tabs { align-self: center; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: #eef3f0; }
.monitor-tab { min-width: 88px; height: 34px; padding: 0 16px; border: 0; border-radius: 6px; background: transparent; color: #53645b; font-size: 12px; font-weight: 800; }
.monitor-tab.active { background: #fff; color: var(--green-800); box-shadow: 0 2px 8px rgba(36,69,53,.12); }
.remote-actions { align-self: center; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.toolbar-button { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #32463c; font-size: 11px; font-weight: 750; }
.toolbar-button.icon-only { width: 38px; justify-content: center; padding: 0; }
.keyboard-icon { width: 17px; height: 12px; border: 1.5px solid currentColor; border-radius: 2px; box-shadow: inset 0 -3px 0 -2px currentColor; }
.clipboard-icon { position: relative; width: 14px; height: 16px; border: 1.5px solid currentColor; border-radius: 2px; }
.clipboard-icon::before { content: ""; position: absolute; top: -4px; left: 3px; width: 6px; height: 4px; border: 1.5px solid currentColor; border-radius: 2px; background: #fff; }
.fullscreen-icon { position: relative; display: block; width: 17px; height: 17px; border: solid currentColor; border-width: 2px 0 0 2px; }
.fullscreen-icon::before { content: ""; position: absolute; right: 0; bottom: 0; width: 8px; height: 8px; border: solid currentColor; border-width: 0 2px 2px 0; }
.screen-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 2px; background: #070907; touch-action: none; user-select: none; -webkit-user-select: none; }
#remoteCanvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; outline: none; background: #000; box-shadow: 0 0 0 1px rgba(255,255,255,.13); image-rendering: auto; touch-action: none; transform: translateZ(0); }
.connection-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; background: rgba(8,13,10,.92); }
.connection-overlay span { color: rgba(255,255,255,.58); font-size: 13px; }
.spinner { width: 34px; height: 34px; margin-bottom: 8px; border: 3px solid rgba(255,255,255,.15); border-top-color: #8cc1a5; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.touch-help { position: absolute; left: 50%; bottom: max(9px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 7px 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; color: rgba(255,255,255,.72); background: rgba(9,13,11,.67); backdrop-filter: blur(8px); font-size: 10px; pointer-events: none; transition: opacity .3s ease; }
.touch-help b { color: #91bba5; margin-inline: 5px; }

/* Dialogs and feedback */
.tool-dialog { width: min(620px, calc(100% - 48px)); padding: 0; border: 0; border-radius: 15px; background: transparent; box-shadow: 0 24px 80px rgba(0,0,0,.3); }
.tool-dialog::backdrop { background: rgba(5,12,8,.48); backdrop-filter: blur(4px); }
.dialog-card { padding: 22px; border-radius: 15px; background: #fff; }
.dialog-card header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 17px; }
.dialog-card header > div { display: grid; gap: 4px; }
.dialog-card header strong { font-size: 18px; }
.dialog-card header span { color: var(--muted); font-size: 12px; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #5f7067; background: #eef3f0; font-size: 23px; line-height: 1; }
.dialog-card textarea { width: 100%; padding: 13px; resize: none; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #fbfdfc; font-size: 15px; }
.dialog-card textarea:focus { border-color: var(--green-600); box-shadow: 0 0 0 4px rgba(99,143,120,.1); }
.key-row { display: flex; gap: 6px; margin-top: 11px; }
.key-row button { min-width: 45px; height: 37px; border: 1px solid var(--line); border-radius: 6px; background: #f7faf8; color: #33483d; font-size: 12px; font-weight: 750; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.dialog-actions.split { justify-content: stretch; }
.dialog-actions.split .button { flex: 1; padding-inline: 10px; font-size: 12px; }
.toast-region { position: fixed; z-index: 100; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: grid; gap: 8px; pointer-events: none; }
.toast { min-width: 250px; max-width: 420px; padding: 12px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: #fff; background: rgba(24,41,32,.94); box-shadow: 0 12px 35px rgba(0,0,0,.22); font-size: 13px; animation: toastIn .2s ease-out; }
.toast.error { background: rgba(137,40,40,.96); }
@keyframes toastIn { from { opacity: 0; transform: translateY(7px); } }

@media (max-height: 720px) {
  .login-shell { min-height: calc(100dvh - 36px); }
  .brand-panel { padding: 32px 42px; }
  .login-card { gap: 13px; padding: 28px 44px; }
  .brand-copy h1 { margin-block: 13px; font-size: 38px; }
  .app-header { height: 90px; }
  .device-content { gap: 12px; padding-top: 18px; }
  .device-row { min-height: 52px; }
}

@media (max-width: 900px) {
  .remote-toolbar { grid-template-columns: minmax(175px,1fr) auto minmax(255px,1fr); }
  .toolbar-button > span:last-child { display: none; }
  .toolbar-button { width: 38px; justify-content: center; padding: 0; }
  .monitor-tab { min-width: 74px; padding-inline: 11px; }
  .device-table-head, .device-row { grid-template-columns: minmax(180px,1.3fr) 110px 95px 130px 24px; gap: 10px; padding-inline: 16px; }
  .header-actions .header-download { width: 42px; padding: 0; justify-content: center; }
  .header-download-label { display: none; }
}

@media (max-width: 900px) {
  .login-view { place-items: start stretch; overflow-y: auto; padding: 0; }
  .login-shell { display: block; width: 100%; min-height: 100dvh; overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  .brand-panel { min-height: 210px; gap: 20px; padding: calc(22px + env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) 24px max(24px, env(safe-area-inset-left)); }
  .brand-panel::before { width: 280px; height: 280px; right: -150px; bottom: -150px; }
  .brand-panel::after { width: 180px; height: 180px; right: -100px; bottom: -100px; }
  .login-logo { width: 118px; padding: 9px; border-radius: 9px; }
  .brand-copy { margin: 0; }
  .brand-copy .eyebrow, .security-line { display: none; }
  .brand-copy h1 { margin: 0 0 8px; font-size: 29px; line-height: 1.12; }
  .brand-copy p { font-size: 13px; line-height: 1.5; }
  .login-card { gap: 16px; padding: 26px max(22px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
  .login-card h2 { margin-block: 6px; font-size: 27px; }
  .login-card input { height: 48px; }
  .text-toggle { height: 48px; }
  .download-card { min-height: 62px; }

  .app-header { height: calc(72px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); }
  .brand-lockup { gap: 0; }
  .brand-lockup img { width: 82px; }
  .brand-divider, .brand-lockup > div:last-child, .summary-chip { display: none; }
  .header-actions { gap: 7px; }
  .header-actions .button { min-height: 39px; padding-inline: 12px; font-size: 12px; }
  .header-actions .header-download { width: 40px; padding-inline: 0; }
  .device-content { gap: 12px; padding: 18px max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .section-heading { align-items: center; }
  .section-heading h1 { margin-top: 3px; font-size: 23px; }
  .section-heading p { display: none; }
  .section-heading .eyebrow { font-size: 9px; }
  .control-bar { grid-template-columns: 1fr 1fr; gap: 8px; }
  .search-box { grid-column: 1 / -1; }
  .last-checked { grid-column: 1 / -1; text-align: right; font-size: 10px; }
  #refreshButton, #connectButton { width: 100%; padding-inline: 10px; }
  .device-table-shell { border-radius: 10px; }
  .device-table-head { display: none; }
  .device-row { position: relative; grid-template-columns: minmax(0,1fr) auto; grid-template-rows: auto auto; gap: 6px 12px; min-height: 78px; padding: 13px 14px; }
  .device-name { grid-column: 1; grid-row: 1; }
  .online-state { grid-column: 2; grid-row: 1; font-size: 12px; }
  .device-id { grid-column: 1; grid-row: 2; padding-left: 40px; font-size: 11px; }
  .last-seen { grid-column: 2; grid-row: 2; font-size: 10px; }
  .row-arrow { display: none; }
  .device-footer > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .device-footer > span:last-child { display: none; }

  .remote-toolbar { height: calc(96px + env(safe-area-inset-top)); grid-template-columns: minmax(0,1fr) auto; grid-template-rows: 40px 40px; align-items: center; padding: env(safe-area-inset-top) max(7px, env(safe-area-inset-right)) 7px max(9px, env(safe-area-inset-left)); }
  .remote-meta { grid-column: 1; grid-row: 1; max-width: 100%; }
  .remote-meta strong { font-size: 11px; }
  .remote-meta span { font-size: 9px; }
  .remote-actions { grid-column: 2; grid-row: 1; gap: 4px; }
  .toolbar-button, .toolbar-button.icon-only { width: 34px; height: 34px; padding: 0; justify-content: center; }
  .remote-actions .button.danger { min-height: 34px; height: 34px; padding-inline: 9px; font-size: 10px; }
  .monitor-tabs { grid-column: 1 / -1; grid-row: 2; justify-self: center; max-width: 100%; overflow-x: auto; padding: 3px; scrollbar-width: none; }
  .monitor-tabs::-webkit-scrollbar { display: none; }
  .monitor-tab { min-width: 70px; height: 32px; padding-inline: 10px; font-size: 11px; }
  .screen-stage { padding: 1px; }
  .touch-help { max-width: calc(100% - 16px); overflow: hidden; padding: 6px 9px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
  .tool-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .dialog-card { padding: 18px; }
  .dialog-card header strong { font-size: 16px; }
  .key-row { overflow-x: auto; padding-bottom: 4px; }
  .dialog-actions.split { flex-direction: column; }
  .toast-region { right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); left: 10px; }
  .toast { min-width: 0; max-width: none; }
}

@media (max-width: 420px) {
  .brand-copy h1 { font-size: 26px; }
  .remote-actions .button.danger { width: 36px; overflow: hidden; padding: 0; font-size: 0; }
  .remote-actions .button.danger::before { content: "종료"; font-size: 9px; }
  .remote-meta strong { max-width: 120px; }
}
