/* Shared device dialog for every app page. */
.device-dialog { width:min(440px,calc(100% - 32px)); padding:24px; color:var(--ink); background:var(--panel-solid); border:1px solid var(--line-strong); border-radius:18px; box-shadow:var(--shadow); font:400 var(--font-body)/1.6 var(--font-app); }
.device-dialog::backdrop { background:rgba(10,15,20,.35); backdrop-filter:blur(3px); }
.device-heading { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.device-heading h2 { margin:0; font-size:var(--font-heading); font-weight:600; line-height:1.4; letter-spacing:-.03em; }
.device-dialog p { font-size:var(--font-body); line-height:1.65; }
.device-note { color:var(--muted); }
#offlineButton[data-offline="true"] { color:var(--yellow,var(--warning)); }
.device-export,.device-option { padding:16px 0; border-bottom:1px solid var(--line); }
.device-export:last-child,.device-option:last-child { padding-bottom:0; border-bottom:0; }
.device-option:not([hidden]):not(:has(~.device-option:not([hidden]))) {padding-bottom:0;border-bottom:0}
.device-option h3 {margin:0;font-size:var(--font-small);font-weight:600;line-height:1.5}
.device-option h3~.button {margin-top:12px}
.device-export>.button,.device-option>.button { width:100%; justify-content:center; }
.device-dialog { max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain; }

.device-dialog { max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px); }
.device-heading { margin-bottom:20px; }
.device-dialog .device-heading>.button { display:grid; place-items:center; flex:none; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; border:0; border-radius:10px; background:transparent; color:var(--ink); box-shadow:none; }
.device-dialog .device-heading>.button .icon { width:20px; height:20px; stroke-width:2.5; }
.device-dialog .button:focus-visible { outline:2px solid var(--ink); outline-offset:3px; }
@media(hover:hover){.device-dialog .device-heading>.button:hover { background:var(--surface-hover); filter:none; }}
.device-dialog p { margin:8px 0 0; font-size:var(--font-small); }
.device-export > .device-note { margin:0 0 12px; }
/* Center explanatory captions paired directly with dialog actions. */
.device-dialog :is(.device-option,.device-export) > .device-note,
.device-dialog > .device-note,
.device-dialog .clear-plan-export > .device-note { text-align:center; }
@media print { .device-dialog,#offlineButton { display:none!important; } }


/* Keep mobile dialog explanations and secondary captions comfortably readable. */
@media(max-width:720px){
 .device-dialog p{font-size:16px;line-height:1.65}
 .device-dialog .device-note{font-size:15px;line-height:1.55}
}
