/* I01 personal VIEW workspace. Scoped styles; no global navigation redesign. */
.hhd-document-workspace{display:flex;flex-direction:column;gap:12px;min-height:calc(100dvh - 190px);padding:16px;min-width:0}
.hhd-document-workspace-header{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px}
.hhd-document-workspace-header h1{margin:0;font-size:1.35rem}
.hhd-document-workspace-header p{margin:4px 0 0;color:var(--hhd-text-muted,#697586)}
.hhd-document-workspace-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.hhd-document-workspace-tabs{min-width:0;flex:1;display:flex;flex-direction:column}
.hhd-document-workspace-tabs .e-content{min-height:0;flex:1}
.hhd-document-workspace-body{height:min(75dvh,920px);min-height:360px;min-width:0}
.hhd-document-view-container{height:100%;width:100%;min-width:0;overflow:auto}
.hhd-document-image-view{height:100%;display:flex;align-items:center;justify-content:center;overflow:auto;background:var(--hhd-surface-soft,#f4f6f8)}
.hhd-document-image-view img{display:block;max-height:100%;max-width:100%;object-fit:contain}
.hhd-document-text-view{min-height:100%;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:16px;line-height:1.5;font:0.92rem/1.5 ui-monospace,Consolas,monospace;background:var(--hhd-surface,#fff);color:var(--hhd-text,#222)}
.hhd-document-workspace-state{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:24px;border:1px solid var(--hhd-border,#d7dce3);border-radius:10px}
@media(max-width:600px){.hhd-document-workspace{padding:10px;min-height:calc(100dvh - 115px)}.hhd-document-workspace-actions{width:100%}.hhd-document-workspace-body{height:calc(100dvh - 280px);min-height:260px}}

/* EV-I02: office engine surface remains bounded by personal document viewer. */
.hhd-document-office-view{height:100%;min-height:0;width:100%;overflow:auto}
.hhd-document-office-view>.e-control{height:100%}

/* A02C: HHD-owned editor actions and working-document state. */
.hhd-document-text-editor{display:block;width:100%;height:100%;min-height:320px;resize:vertical;padding:16px;
    font:0.92rem/1.5 ui-monospace,Consolas,monospace;white-space:pre;tab-size:4;
    border:1px solid var(--hhd-border,#d7dce3);border-radius:6px;
    background:var(--hhd-surface,#fff);color:var(--hhd-text,#222)}
.hhd-document-save-status{margin:0 0 8px;padding:8px 12px;border-radius:6px;
    background:var(--hhd-surface-soft,#f4f6f8);color:var(--hhd-text,#222)}

/* Editors use the available bounded workspace, never a stacked growing page. */
.hhd-document-text-rte, .hhd-document-image-editor { width:100%; height:100%; min-height:380px; }
.hhd-document-text-format-note { margin:0.3rem 0; font-size:0.78rem; color:var(--hhd-text-secondary, #555); }

/* A02C2: bounded, keyboard-accessible MIME document editing, not an inbox. */
.hhd-email-editor { display: flex; flex-direction: column; min-height: 0; height: 100%; gap: .75rem; overflow-y: auto; padding: .7rem; }
.hhd-email-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: .4rem; }
.hhd-email-fields label { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; gap: .5rem; font-size: .82rem; }
.hhd-email-fields input { min-width: 0; width: 100%; border: 1px solid var(--hhd-border, #ced4da); border-radius: .4rem; padding: .43rem .6rem; background: var(--hhd-surface, #fff); color: var(--hhd-text, #17212d); }
.hhd-email-fields input:focus-visible { outline: 2px solid var(--hhd-focus, #2563eb); outline-offset: 2px; }
.hhd-email-body { min-height: 16rem; height: min(46vh, 480px); }
.hhd-email-attachments { display: flex; flex-direction: column; gap: .3rem; font-size: .84rem; }
.hhd-email-attachments ul { margin: 0; padding-inline-start: 1.2rem; }
.hhd-email-attachments input[type="file"] { max-width: 100%; }
.hhd-email-draft-note { font-size: .76rem; opacity: .8; }
@media (max-width: 580px) { .hhd-email-fields label { grid-template-columns: 1fr; gap: .2rem; } .hhd-email-body { min-height: 17rem; } }

/* EV-I03 A02C2 FIX02 — Syncfusion Ribbon is the DOCX primary command surface.
   Spreadsheet keeps its vendor-owned SpreadsheetRibbon. No duplicate ribbon. */
.hhd-word-office-view{display:flex;flex-direction:column;overflow:hidden;min-width:0;}
.hhd-word-office-view .hhd-word-ribbon{flex:0 0 auto;min-width:0;max-width:100%;}
.hhd-word-office-view .hhd-word-ribbon .e-ribbon{max-width:100%;}
.hhd-word-office-view .hhd-word-editor-canvas{flex:1 1 auto;min-height:220px;min-width:0;overflow:hidden;}
.hhd-word-office-view .hhd-word-editor-canvas > .e-control{height:100%;}
.hhd-word-ribbon-error{margin:0;padding:.35rem .7rem;color:var(--hhd-danger,#b42318);font-size:.83rem;}
@media(max-width:640px){.hhd-word-office-view .hhd-word-editor-canvas{min-height:160px;}}

/* Unified first-party SfRibbon surface for DOCX and XLSX (not SpreadsheetRibbon). */
.hhd-office-ribbon{flex:0 0 auto;min-width:0;width:100%;max-width:100%;}
.hhd-office-ribbon>.e-ribbon,.hhd-office-ribbon .e-ribbon{width:100%;max-width:100%;}
.hhd-office-ribbon-error{margin:0;padding:.35rem .7rem;color:var(--hhd-danger,#b42318);font-size:.83rem;}
.hhd-sheet-office-view{display:flex;flex-direction:column;overflow:hidden;min-width:0;}
.hhd-sheet-office-view .hhd-sheet-editor-canvas{flex:1 1 auto;min-height:200px;min-width:0;overflow:hidden;}
.hhd-sheet-office-view .hhd-sheet-editor-canvas>.e-control{height:100%;}
@media(max-width:640px){.hhd-sheet-office-view .hhd-sheet-editor-canvas{min-height:160px;}}

/* A02C2 FIX05: CSV is a tabular editor, not a disguised XLSX. */
.hhd-csv-editor{display:flex;flex-direction:column;gap:.5rem;height:100%;width:100%;min-height:0;overflow:hidden}
.hhd-csv-toolbar{display:flex;gap:.4rem;flex-wrap:wrap;align-items:center;flex:none}
.hhd-csv-dialect{font-size:.77rem;color:var(--hhd-text-muted,#697586);margin-inline-start:auto}
.hhd-csv-grid-container{flex:1;min-height:0;overflow:auto}
.hhd-csv-cell{width:100%;max-width:100%;min-width:90px;padding:.3rem .35rem;border:1px solid transparent;
  border-radius:3px;background:transparent;color:var(--hhd-text,#222);font:inherit}
.hhd-csv-cell:hover{border-color:var(--hhd-border,#ccc)}
.hhd-csv-cell:focus-visible{border-color:var(--hhd-focus,#2563eb);outline:2px solid var(--hhd-focus,#2563eb);outline-offset:1px}
.hhd-csv-delete-row{min-width:32px;min-height:32px;background:transparent;border:1px solid var(--hhd-border,#ccc);
  color:var(--hhd-text,#222);border-radius:4px;cursor:pointer}
.hhd-csv-delete-row:focus-visible{outline:2px solid var(--hhd-focus,#2563eb)}
@media(max-width:580px){.hhd-csv-toolbar{gap:.25rem}.hhd-csv-dialect{width:100%;text-align:right}}

/* A02C2 FIX06: real PDF annotation/form editing remains within the bounded workspace. */
.hhd-document-pdf-editor{width:100%;height:100%;min-height:0;overflow:hidden;position:relative}
.hhd-document-pdf-status{position:absolute;z-index:2;top:.5rem;left:.5rem;right:.5rem;
  padding:.6rem;border-radius:.35rem;background:var(--hhd-surface,#fff);color:var(--hhd-danger,#b42318)}

/* A02C2 FIX07: bounded vendor-native diagram editor. */
.hhd-diagram-editor{display:flex;flex-direction:column;gap:.5rem;height:100%;min-height:0;min-width:0;width:100%}
.hhd-diagram-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;flex:none;padding:.3rem .35rem}
.hhd-diagram-toolbar button{min-height:32px}
.hhd-diagram-help{font-size:.76rem;color:var(--hhd-text-muted,#697586);margin-inline-start:auto}
.hhd-diagram-canvas{flex:1;min-height:280px;min-width:0;overflow:hidden;border:1px solid var(--hhd-border,#ccc);border-radius:6px}
@media(max-width:580px){.hhd-diagram-help{width:100%}.hhd-diagram-canvas{min-height:240px}}

/* EV-I03 FIX08: calendar editor. All-day and recurring items are owned by the
   iCalendar file, not by a second server-side calendar authority. */
.hhd-ics-editor { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.hhd-ics-editor-information { display: flex; gap: .5rem 1rem; flex-wrap: wrap; align-items: center;
    padding: .55rem .8rem; font-size: .84rem; line-height: 1.4; }
.hhd-ics-editor-information span:first-child { font-weight: 600; }
.hhd-ics-editor-notice { margin: .25rem .8rem; }
.hhd-ics-schedule { flex: 1 1 auto; min-height: 360px; overflow: hidden; }
@media(max-width: 640px) {
    .hhd-ics-editor-information { padding: .5rem; gap: .25rem; }
    .hhd-ics-schedule { min-height: 420px; }
}

/* FIX09 Paneles: composition with Syncfusion DashboardLayout; no second data source. */
.hhd-panel-editor{display:flex;flex-direction:column;min-height:0;height:100%;min-width:0;overflow:hidden}
.hhd-panel-toolbar{display:flex;gap:.35rem .65rem;align-items:center;flex-wrap:wrap;padding:.45rem;flex:none}
.hhd-panel-toolbar span{color:var(--hhd-text-muted,#697586);font-size:.78rem;flex:1 1 20rem}
.hhd-panel-layout-with-detail{display:grid;grid-template-columns:minmax(0,1fr) minmax(220px,275px);gap:.65rem;min-height:0;flex:1;overflow:auto}
.hhd-panel-layout-area{min-width:0;overflow:auto;min-height:260px;padding:.25rem}
.hhd-panel-layout-area .e-dashboardlayout{min-height:260px}
.hhd-panel-grab{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.2rem .4rem;min-height:35px}
.hhd-panel-grab strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hhd-panel-edit-button{border:1px solid var(--hhd-border,#ccc);border-radius:5px;padding:.24rem .45rem;background:var(--hhd-surface,#fff);color:inherit;cursor:pointer}
.hhd-panel-edit-button:focus-visible{outline:2px solid var(--hhd-focus,#2563eb)}
.hhd-panel-content{padding:.45rem;overflow:auto;max-height:100%;font-size:.85rem}
.hhd-panel-note{white-space:pre-wrap;overflow-wrap:anywhere}
.hhd-panel-metric{display:block;font-size:1.7rem;overflow-wrap:anywhere}
.hhd-panel-metric small{font-size:.75rem;margin-left:.4rem;font-weight:400}
.hhd-panel-detail{padding:.7rem;min-width:0;max-height:100%;overflow:auto;border:1px solid var(--hhd-border,#ccc);border-radius:6px}
.hhd-panel-detail-heading{display:flex;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.65rem}
.hhd-panel-detail label{display:flex;flex-direction:column;gap:.2rem;margin:.45rem 0;font-size:.84rem}
.hhd-panel-detail input,.hhd-panel-detail textarea{max-width:100%;width:100%;border:1px solid var(--hhd-border,#ccc);border-radius:5px;padding:.35rem .5rem;font:inherit;background:var(--hhd-surface,#fff);color:inherit}
.hhd-panel-detail input:focus-visible,.hhd-panel-detail textarea:focus-visible{outline:2px solid var(--hhd-focus,#2563eb)}
.hhd-panel-point{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.8fr) auto;gap:.3rem;align-items:center;margin:.4rem 0}
.hhd-panel-error{color:var(--hhd-danger,#b42318);padding:.35rem .6rem}
.hhd-panel-empty,.hhd-panel-manual-data{padding:.5rem;color:var(--hhd-text-muted,#697586)}
@media(max-width:750px){.hhd-panel-layout-with-detail{grid-template-columns:1fr;overflow:auto}.hhd-panel-detail{max-height:none}.hhd-panel-layout-area{min-height:190px}}

/* FIX10 SVG: document-owned vector drawing, no raster conversion or secondary save. */
.hhd-svg-editor{display:flex;flex-direction:column;min-height:0;height:100%;width:100%;min-width:0;overflow:hidden}
.hhd-svg-toolbar{display:flex;gap:.4rem;align-items:center;flex-wrap:wrap;padding:.45rem;flex:none}
.hhd-svg-toolbar span{flex:1 1 18rem;color:var(--hhd-text-muted,#697586);font-size:.8rem}
.hhd-svg-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,330px);gap:.7rem;min-height:0;flex:1;overflow:auto}
.hhd-svg-preview{min-height:250px;display:flex;align-items:center;justify-content:center;padding:.8rem;
 background:var(--hhd-surface,#fff);border:1px solid var(--hhd-border,#ccc);border-radius:6px;overflow:auto}
.hhd-svg-preview img{max-width:100%;max-height:100%;object-fit:contain;box-shadow:0 1px 8px #0002}
.hhd-svg-side{display:flex;flex-direction:column;gap:.5rem;overflow:auto;min-width:0;min-height:0}
.hhd-svg-dimensions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
.hhd-svg-elements{height:190px;min-height:130px;flex:none;overflow:auto}
.hhd-svg-properties{display:flex;flex-direction:column;gap:.5rem;padding:.6rem;border:1px solid var(--hhd-border,#ccc);border-radius:6px}
.hhd-svg-properties-title{display:flex;align-items:center;justify-content:space-between}
.hhd-svg-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
.hhd-svg-properties label,.hhd-svg-dimensions label{display:flex;flex-direction:column;gap:.2rem;font-size:.8rem}
.hhd-svg-properties input,.hhd-svg-properties textarea,.hhd-svg-dimensions input{width:100%;min-width:0;max-width:100%;
 border:1px solid var(--hhd-border,#ccc);border-radius:5px;padding:.35rem;background:var(--hhd-surface,#fff);color:inherit;font:inherit}
.hhd-svg-properties input:focus-visible,.hhd-svg-properties textarea:focus-visible,.hhd-svg-dimensions input:focus-visible,
.hhd-svg-select:focus-visible,.hhd-svg-order:focus-visible{outline:2px solid var(--hhd-focus,#2563eb);outline-offset:1px}
.hhd-svg-select{border:0;background:transparent;color:inherit;cursor:pointer;text-align:left;min-height:32px}
.hhd-svg-select[aria-pressed=true]{font-weight:700;text-decoration:underline}
.hhd-svg-order{border:1px solid var(--hhd-border,#ccc);border-radius:4px;padding:.25rem;background:var(--hhd-surface,#fff);color:inherit;cursor:pointer}
.hhd-svg-empty,.hhd-svg-notice{margin:.2rem;padding:.5rem;font-size:.82rem}
.hhd-svg-notice{color:var(--hhd-danger,#b42318)}
@media(max-width:790px){.hhd-svg-body{grid-template-columns:minmax(0,1fr);overflow:auto}
.hhd-svg-side{overflow:visible}.hhd-svg-preview{min-height:180px;max-height:45vh}.hhd-svg-elements{height:170px}}

/* FIX11 Mapas: GeoJSON document geometry; no remote tile providers or parallel save. */
.hhd-geo-editor{display:flex;flex-direction:column;min-height:0;height:100%;width:100%;min-width:0;overflow:hidden}
.hhd-geo-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.45rem;flex:none}
.hhd-geo-toolbar span{flex:1 1 22rem;font-size:.8rem;color:var(--hhd-text-muted,#697586)}
.hhd-geo-workspace{display:grid;grid-template-columns:minmax(0,1fr) minmax(245px,320px);gap:.6rem;min-height:0;flex:1;overflow:auto}
.hhd-geo-map{min-width:0;min-height:280px;position:relative;border:1px solid var(--hhd-border,#ccc);border-radius:5px;overflow:hidden}
.hhd-geo-empty{position:absolute;top:.5rem;left:.7rem;right:.7rem;z-index:1;padding:.5rem;font-size:.8rem;background:var(--hhd-surface,#fff)}
.hhd-geo-detail{min-height:0;overflow:auto;padding:.65rem;border:1px solid var(--hhd-border,#ccc);border-radius:5px}
.hhd-geo-list{display:flex;flex-direction:column;gap:.2rem;margin:.5rem 0;max-height:200px;overflow:auto}
.hhd-geo-item{display:flex;justify-content:space-between;align-items:center;gap:.4rem;text-align:left;min-height:34px;padding:.4rem;border:1px solid var(--hhd-border,#ccc);border-radius:4px;background:var(--hhd-surface,#fff);color:inherit;cursor:pointer}
.hhd-geo-item[aria-pressed=true]{font-weight:700;border-color:var(--hhd-focus,#2563eb)}
.hhd-geo-item small{font-size:.72rem;color:var(--hhd-text-muted,#697586)}
.hhd-geo-form{display:flex;flex-direction:column;gap:.45rem;padding:.55rem;border:1px solid var(--hhd-border,#ccc);border-radius:5px}
.hhd-geo-form label{display:flex;flex-direction:column;gap:.2rem;font-size:.82rem}
.hhd-geo-form input,.hhd-geo-form textarea,.hhd-geo-form select{width:100%;min-width:0;max-width:100%;font:inherit;background:var(--hhd-surface,#fff);color:inherit;padding:.4rem;border:1px solid var(--hhd-border,#ccc);border-radius:5px}
.hhd-geo-actions{display:flex;flex-wrap:wrap;gap:.3rem}
.hhd-geo-help{font-size:.75rem;line-height:1.5;color:var(--hhd-text-muted,#697586)}
.hhd-geo-notice{padding:.3rem .65rem;color:var(--hhd-danger,#b42318)}
.hhd-geo-item:focus-visible,.hhd-geo-form input:focus-visible,.hhd-geo-form textarea:focus-visible,.hhd-geo-form select:focus-visible{outline:2px solid var(--hhd-focus,#2563eb);outline-offset:1px}
@media(max-width:800px){.hhd-geo-workspace{grid-template-columns:minmax(0,1fr);overflow:auto}.hhd-geo-map{min-height:300px;max-height:55vh}.hhd-geo-detail{overflow:visible}}

/* FIX12: document-owned pivot analysis, no browser-persisted authority. */
.hhd-pivot-editor{display:flex;flex-direction:column;gap:12px;min-height:0;padding:12px}
.hhd-pivot-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.hhd-pivot-toolbar p,.hhd-pivot-summary{font-size:.84rem;color:var(--hhd-text-muted,#697586);margin:4px 0}
.hhd-pivot-data-editor{display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--hhd-border,#d7dce3);border-radius:9px}
.hhd-pivot-data-editor textarea{width:100%;min-height:120px;max-height:280px;resize:vertical;font-family:ui-monospace,monospace}
.hhd-pivot-actions,.hhd-pivot-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.hhd-pivot-controls label{display:flex;flex-direction:column;gap:5px;flex:1 1 145px;min-width:0;font-size:.83rem}
.hhd-pivot-controls select{max-width:100%;min-height:36px;border:1px solid var(--hhd-border,#d7dce3);border-radius:6px;background:var(--hhd-surface,#fff);color:var(--hhd-text,#14213d)}
.hhd-pivot-canvas{min-width:0;overflow:auto;border:1px solid var(--hhd-border,#d7dce3);border-radius:9px}
.hhd-pivot-empty,.hhd-pivot-error{padding:14px;border:1px solid var(--hhd-border,#d7dce3);border-radius:8px}
@media(max-width:650px){.hhd-pivot-editor{padding:6px}.hhd-pivot-controls label{flex:1 1 100%}.hhd-pivot-canvas{min-height:300px}}

/* FIX13: compact personal planning document, not an operational task board */
.hhd-taskplan-editor { display:flex; flex-direction:column; gap:0.75rem; min-width:0; padding:0.85rem; }
.hhd-taskplan-header { display:flex; justify-content:space-between; align-items:start; gap:0.75rem; flex-wrap:wrap; }
.hhd-taskplan-header p, .hhd-taskplan-footnote { font-size:0.82rem; opacity:0.78; margin:0.25rem 0; }
.hhd-taskplan-form { border:1px solid var(--hhd-border-color, #c8d2dd); border-radius:8px; padding:0.8rem; }
.hhd-taskplan-form-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(175px,1fr)); gap:0.65rem; }
.hhd-taskplan-form-grid label { display:flex; flex-direction:column; gap:0.25rem; font-size:0.82rem; }
.hhd-taskplan-form-grid input,.hhd-taskplan-form-grid select { min-width:0; width:100%; padding:0.45rem; }
.hhd-taskplan-actions { display:flex; flex-wrap:wrap; gap:0.35rem; align-items:center; }
.hhd-taskplan-form .hhd-taskplan-actions { margin-top:0.7rem; }
.hhd-taskplan-list { display:flex; flex-direction:column; gap:0.3rem; max-height:180px; overflow-y:auto; }
.hhd-taskplan-list-item { display:flex; justify-content:space-between; align-items:center; gap:0.65rem; border-bottom:1px solid var(--hhd-border-color, #c8d2dd); padding:0.4rem 0; }
.hhd-taskplan-list-item > div:first-child { display:flex; flex-direction:column; gap:0.15rem; min-width:0; overflow-wrap:anywhere; }
.hhd-taskplan-list-item small { opacity:0.75; }
.hhd-taskplan-gantt { overflow:auto; min-width:0; }
.hhd-taskplan-error { color:#9b2323; }
@media(max-width:640px) { .hhd-taskplan-list-item { align-items:start; flex-direction:column; } }
