/* Size the device host to the original Euno panels. File actions are the device-specific additions. */
#device-workspace { flex:1 1 0; width:100%; min-height:0; min-width:0; overflow:auto; }
.workspace-page { min-height:0; min-width:0; }
.workspace-page:is([data-page=terminal],[data-page=learning],[data-page=practice],[data-page=drafts]) {
    display:flex; flex-direction:column; width:100%; height:100%; min-height:0;
}
#lesson-terminal-content { flex:1; height:100%; width:100%; min-height:0; min-width:0; }
.device-status,.muted { color:var(--muted); font-size:14px; }
.device-status:empty { display:none; }
.device-document-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.device-document-bar button,.device-dialog button {
    padding:6px 12px; min-height:38px; border:1px solid var(--line); border-radius:6px; background:white;
    color:var(--accent); font-size:14px; font-weight:600;
}
.device-document-bar button:hover { background:var(--selection); }
.file-link { min-height:38px; border:0; background:transparent; padding:6px 4px; color:var(--accent); text-align:left; overflow-wrap:anywhere; }
.file-link:hover { text-decoration:underline; }
.device-file-menu { position:relative; }
.device-file-menu summary {
    min-height:32px; display:flex; align-items:center; padding:4px 9px; color:var(--editor-fg); border:1px solid var(--editor-edge);
    border-radius:5px; font:13px/1.4 system-ui,sans-serif; cursor:pointer;
}
.device-file-options {
    position:absolute; z-index:5; inset-block-start:calc(100% + 4px); width:max-content; max-width:calc(100vw - 24px);
    display:grid; gap:3px; padding:4px; border:1px solid var(--editor-edge); border-radius:6px;
    color:var(--editor-fg); background:var(--editor-chrome); box-shadow:0 4px 12px #0005;
}
.device-file-options button { text-align:start; }
.device-library-detail .device-document-bar { margin-top:12px; }
.device-library .sidebar h3 { margin:12px 3px 4px; font-size:13px; color:var(--muted); }
.device-dialog { max-height:82dvh; width:min(34rem,calc(100% - 24px)); overflow:auto; padding:20px;
    border:1px solid var(--line); border-radius:10px; color:var(--ink); background:white; box-shadow:0 12px 40px #17243a30; }
.device-dialog::backdrop { background:#17243a66; }
.device-dialog>button,.device-dialog form>button { margin:6px 6px 0 0; }
.device-dialog fieldset { margin:14px 0; border:1px solid var(--line); border-radius:6px; }
.device-dialog label { display:grid; gap:5px; margin:8px 0; }
.device-dialog input:not([type=checkbox]),.device-dialog textarea { width:100%; padding:7px; font:inherit; }
.device-dialog label.concept-option { display:flex; align-items:center; gap:8px; }
.device-dialog .source-preview { max-height:30vh; overflow:auto; white-space:pre-wrap; }
@media(max-width:920px) {
    body.device-signed-in .topbar { grid-template-columns:minmax(0,1fr) auto; }
    #device-nav { grid-area:2/1/auto/-1; width:100%; display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); }
    #device-nav a { padding-inline:2px; }
}
@media(max-width:720px) {
    body.device-signed-in { height:100dvh; overflow:hidden; }
    .workspace-page:is([data-page=learning],[data-page=practice]) { height:auto; min-height:100%; }
}
@media(max-width:440px) {
    #device-nav { grid-template-columns:repeat(4,minmax(0,1fr)); }
    .device-document-bar button,.file-link { min-height:44px; }
}
.device-reference .library-layout { display:grid; gap:var(--panel-gap); padding:var(--workspace-inset); align-items:start; }
.device-reference :is(.library-sidebar,.library-detail) { padding:var(--detail-inset); background:var(--surface); border:1px solid var(--line); border-radius:11px; }

.device-library .device-file-menu summary {
    color:var(--ink); background:var(--surface); border-color:var(--line); font-weight:620;
}
.device-library .device-file-options {
    inset-inline-end:0; color:var(--ink); background:var(--surface); border-color:var(--line);
}
.device-library .device-file-options button {
    padding:6px 12px; min-height:38px; border:0; border-radius:4px; background:transparent; color:var(--accent); text-align:start;
}
.device-library .device-file-options button:is(:hover,:focus-visible) {background:var(--selection);}
.device-practice-entry { display:flex; flex-direction:column; min-height:0; overflow:auto; flex:1; }

.entry-actions {
    display:flex; align-items:center; gap:8px; flex-wrap:wrap; max-width:100%; margin-inline-start:auto;
}
.lesson-management-actions { display:inline-flex; align-items:center; gap:8px; }
#device-workspace .example-actions {
    display:inline-flex; flex:none; align-items:center; flex-wrap:nowrap; gap:8px; vertical-align:middle;
}
.example-actions > .action-button {
    position:relative; display:inline-grid; place-items:center; flex:none; box-sizing:border-box;
    width:36px; height:36px; padding:0; border-radius:6px; touch-action:manipulation;
}
.example-actions svg {
    display:block; width:20px; height:20px; fill:none; stroke:currentColor;
    stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round;
}
.example-actions .action-button > span { display:none; }
/* Browsers surface title on hover. Give keyboard users the same hint while retaining focus on Escape. */
.example-actions .action-button:focus-visible:not([data-hint-dismissed])::after {
    content:attr(title); position:absolute; z-index:5; inset-block-start:calc(100% + 5px); inset-inline-end:0;
    padding:4px 8px; border:1px solid var(--line); border-radius:5px;
    background:var(--surface); color:var(--ink); font:500 12px/1.4 system-ui,sans-serif;
    box-shadow:0 2px 6px #20132924; pointer-events:none;
}
.example-actions .action-button:first-child::after { inset-inline-start:0; inset-inline-end:auto; }
@media(pointer:coarse) {
    .device-file-menu summary,.device-file-options button { min-height:44px; }
    .example-actions > .action-button { width:44px; height:44px; }
    .lesson-management-actions > button { min-height:44px; }
}
