/* Hanna picture editor (pics1 + pics2). The editor is a neutral dark studio in every theme, so colours in a photo read true.
   The Hanna Docs Pictures tab and the People & access box follow the page theme. */
.hp-overlay{
  --hp-bg:#15171c;--hp-panel:#1d2027;--hp-raise:#262a33;--hp-line:#323743;--hp-text:#eef0f4;--hp-muted:#a3a9b6;
  --hp-accent:var(--ht-accent,#3d7bfd);--hp-accent-ink:var(--ht-accent-ink,#fff);--hp-danger:#ff6b6b;
  position:fixed;inset:0;z-index:2147483000;display:flex;flex-direction:column;background:var(--hp-bg);color:var(--hp-text);
  font:14px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
html.hp-open,html.hp-open body{overflow:hidden!important}
dialog.hp-overlay{width:100%;height:100%;max-width:none;max-height:none;margin:0;border:0;box-sizing:border-box}   /* pics2: top layer */
dialog.hp-overlay:not([open]){display:none}
dialog.hp-overlay::backdrop{background:transparent}
.hp-overlay *{box-sizing:border-box}
.hp-overlay [hidden]{display:none!important}
.hp-overlay button{font:inherit;color:inherit}
.hp-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:7px 14px;border-radius:7px;border:1px solid var(--hp-line);background:var(--hp-raise);color:var(--hp-text);font-weight:600;cursor:pointer;line-height:1.15;box-shadow:none;text-align:center}
.hp-btn:hover{border-color:#4a5161;background:#2c313b}
.hp-btn:focus-visible{outline:2px solid var(--hp-accent);outline-offset:2px}
.hp-btn:disabled{opacity:.45;cursor:default}
.hp-btn.hp-primary{background:var(--hp-accent);border-color:var(--hp-accent);color:var(--hp-accent-ink)}
.hp-btn.hp-primary:hover{filter:brightness(1.08)}
.hp-btn.hp-quiet{background:transparent;border-color:transparent;color:var(--hp-muted)}
.hp-btn.hp-quiet:hover{color:var(--hp-text);background:var(--hp-raise)}
.hp-btn.hp-sm{min-height:30px;padding:5px 10px;font-size:12.5px}
.hp-btn.hp-wide{width:100%}
.hp-btn.hp-icon{width:38px;height:38px;min-height:38px;padding:0;background:transparent;border-color:transparent}
.hp-btn.hp-icon:hover{background:var(--hp-raise)}
.hp-btn.hp-icon.hp-sm{width:32px;height:32px;min-height:32px}

.hp-top{display:flex;align-items:center;justify-content:space-between;gap:10px;height:56px;padding:0 12px;border-bottom:1px solid var(--hp-line);background:var(--hp-panel);flex:0 0 auto}
.hp-top-left,.hp-top-mid,.hp-top-right{display:flex;align-items:center;gap:6px;min-width:0}
.hp-top-left{flex:1 1 0}
.hp-top-right{flex:1 1 0;justify-content:flex-end}
.hp-title{display:flex;flex-direction:column;min-width:0}
.hp-title strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hp-title small{font-size:12px;color:var(--hp-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.hp-main{flex:1 1 auto;display:flex;min-height:0}
.hp-rail{flex:0 0 88px;display:flex;flex-direction:column;gap:2px;padding:8px 6px;border-right:1px solid var(--hp-line);background:var(--hp-panel);overflow-y:auto}
.hp-tool{flex-direction:column;gap:4px;min-height:60px;padding:8px 4px;border-color:transparent;background:transparent;font-weight:500;font-size:11.5px;color:var(--hp-muted)}
.hp-tool:hover{color:var(--hp-text);background:var(--hp-raise);border-color:transparent}
.hp-tool.is-on{color:var(--hp-text);background:var(--hp-raise);border-color:var(--hp-line)}
.hp-tool.is-on svg{color:var(--hp-accent)}
.hp-tool span{display:block;line-height:1.15}
.hp-tool svg{flex:0 0 auto}            /* pics2: two-line labels squashed the icon */

.hp-stage{position:relative;flex:1 1 auto;min-width:0;overflow:hidden;touch-action:none;background:#101216;cursor:default}
.hp-overlay[data-tool="crop"] .hp-stage,.hp-overlay[data-tool="markup"] .hp-stage,.hp-overlay[data-tool="hide"] .hp-stage,.hp-overlay[data-tool="spots"] .hp-stage{cursor:crosshair}
.hp-view{position:absolute;left:0;top:0;display:block}
.hp-zoom{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);display:flex;align-items:center;gap:2px;padding:3px;border-radius:9px;background:rgba(29,32,39,.92);border:1px solid var(--hp-line)}
.hp-zoom-l{min-width:74px;text-align:center;font-size:12px;color:var(--hp-muted);font-variant-numeric:tabular-nums}
.hp-busy{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;background:rgba(16,18,22,.72);font-weight:600;z-index:3}
.hp-busy progress{width:200px;accent-color:var(--hp-accent)}
.hp-spin{width:30px;height:30px;border-radius:50%;border:3px solid rgba(255,255,255,.18);border-top-color:var(--hp-accent);animation:hp-spin .8s linear infinite}
@keyframes hp-spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.hp-spin{animation-duration:2.4s}}

.hp-panel{flex:0 0 312px;display:flex;flex-direction:column;border-left:1px solid var(--hp-line);background:var(--hp-panel);min-height:0}
.hp-panel-head{padding:14px 16px 6px}
.hp-panel-head h3{margin:0;font-size:15px}
.hp-panel-body{padding:6px 16px 16px;overflow-y:auto;display:flex;flex-direction:column;gap:12px;min-height:0}
.hp-label{font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--hp-muted);font-weight:600;margin-bottom:-6px}
.hp-hint,.hp-small{margin:0;font-size:12.5px;color:var(--hp-muted)}
.hp-error{margin:0;color:var(--hp-danger);font-size:13px}
.hp-chips{display:flex;flex-wrap:wrap;gap:6px}
.hp-chip{min-height:32px;padding:5px 11px;font-size:12.5px;font-weight:500;background:transparent}
.hp-chip.is-on{background:var(--hp-accent);border-color:var(--hp-accent);color:var(--hp-accent-ink)}
.hp-grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.hp-actions{display:flex;gap:8px;justify-content:flex-end;position:sticky;bottom:-16px;padding:10px 0 4px;background:var(--hp-panel)}
.hp-slider{display:flex;flex-direction:column;gap:4px}
.hp-slider-top{display:flex;justify-content:space-between;font-size:13px}
.hp-slider output{color:var(--hp-muted);font-variant-numeric:tabular-nums}
.hp-slider input[type=range]{width:100%;accent-color:var(--hp-accent);height:24px}
.hp-field{display:flex;flex-direction:column;gap:4px;font-size:13px}
.hp-field span{color:var(--hp-muted);font-size:12px}
.hp-overlay input[type=number],.hp-overlay input[type=text],.hp-overlay select,.hp-textbox{width:100%;min-height:36px;padding:7px 9px;border-radius:7px;border:1px solid var(--hp-line);background:var(--hp-bg);color:var(--hp-text);font:inherit;font-size:16px}
@media (min-width:761px){.hp-overlay input[type=number],.hp-overlay input[type=text],.hp-overlay select,.hp-textbox{font-size:14px}}
.hp-textbox{resize:vertical;line-height:1.45}
.hp-ocr{min-height:180px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:13px}
.hp-check{display:flex;align-items:center;gap:8px;font-size:13px}
.hp-check input{width:18px;height:18px;accent-color:var(--hp-accent)}
.hp-swatches{display:flex;flex-wrap:wrap;gap:8px}
.hp-swatch{width:30px;height:30px;min-height:30px;padding:0;border-radius:50%;border:2px solid var(--hp-line)}
.hp-swatch.is-on{outline:2px solid var(--hp-accent);outline-offset:2px}
.hp-swatch-any{-webkit-appearance:none;appearance:none;background:conic-gradient(#e53935,#ffd400,#43a047,#1e88e5,#8e24aa,#e53935);cursor:pointer;overflow:hidden}
.hp-swatch-any::-webkit-color-swatch-wrapper{padding:0}
.hp-swatch-any::-webkit-color-swatch{border:0;border-radius:50%;opacity:0}
.hp-swatch-any.is-on::-webkit-color-swatch{opacity:1}
.hp-swatch-any::-moz-color-swatch{border:0;border-radius:50%;opacity:0}
.hp-swatch-any.is-on::-moz-color-swatch{opacity:1}
.hp-filters{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.hp-filter{flex-direction:column;gap:4px;padding:4px;min-height:0;background:transparent;border-color:transparent;font-weight:500;font-size:11.5px}
.hp-filter.is-on{border-color:var(--hp-accent);background:var(--hp-raise)}
.hp-thumb{width:100%;aspect-ratio:1;object-fit:cover;border-radius:6px;display:block;background:#000}
.hp-pos{display:grid;grid-template-columns:repeat(3,36px);gap:5px}
.hp-pos-b{width:36px;height:30px;min-height:30px;padding:0;background:transparent}
.hp-pos-b.is-on{background:var(--hp-accent);border-color:var(--hp-accent)}

.hp-status{flex:0 0 auto;min-height:28px;padding:5px 14px calc(5px + env(safe-area-inset-bottom));border-top:1px solid var(--hp-line);background:var(--hp-panel);font-size:12.5px;color:var(--hp-muted)}
.hp-status.is-error{color:var(--hp-danger)}
.hp-menu{position:fixed;z-index:2147483001;min-width:220px;padding:6px;border-radius:10px;background:var(--hp-raise);border:1px solid var(--hp-line);box-shadow:0 12px 32px rgba(0,0,0,.45);display:flex;flex-direction:column}
.hp-menu-i{justify-content:flex-start;border-color:transparent;background:transparent;font-weight:500}
.hp-menu-i:hover{background:#323743}

/* Phones: tools along the bottom, options in a sheet above them. */
@media (max-width:760px){
  .hp-top{height:52px;padding:0 6px}
  .hp-title small{display:none}
  .hp-top-mid{gap:0}
  .hp-btn.hp-icon{width:40px;height:40px;min-height:40px}
  .hp-main{flex-direction:column}
  .hp-rail{order:3;flex:0 0 auto;flex-direction:row;overflow-x:auto;overflow-y:hidden;border-right:0;border-top:1px solid var(--hp-line);padding:6px;gap:4px;scrollbar-width:none}
  .hp-rail::-webkit-scrollbar{display:none}
  .hp-tool{flex:0 0 72px;min-height:56px}
  .hp-stage{order:1;flex:1 1 auto;min-height:180px}
  .hp-panel{order:2;flex:0 0 auto;max-height:42vh;border-left:0;border-top:1px solid var(--hp-line)}
  .hp-panel-head{padding:10px 14px 2px}
  .hp-panel-body{padding:4px 14px 12px}
  .hp-filters{grid-template-columns:repeat(4,1fr)}
  .hp-zoom{bottom:8px}
  .hp-status{padding-bottom:5px}
  .hp-rail{padding-bottom:calc(6px + env(safe-area-inset-bottom))}
}
@media (max-width:760px) and (orientation:landscape) and (max-height:500px){
  .hp-main{flex-direction:row}
  .hp-rail{order:0;flex-direction:column;overflow-y:auto;overflow-x:hidden;border-top:0;border-right:1px solid var(--hp-line);flex:0 0 76px}
  .hp-panel{order:2;max-height:none;flex:0 0 260px;border-top:0;border-left:1px solid var(--hp-line)}
}

/* Floating "Edit picture" on a picture in Writer */
.hp-edit-pill{position:fixed;z-index:2147482000;padding:7px 12px;border-radius:7px;border:1px solid rgba(0,0,0,.18);background:#fff;color:#14171f;font:600 13px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;cursor:pointer;box-shadow:0 2px 10px rgba(0,0,0,.18)}
.hp-edit-pill:hover{background:#f2f4f8}
.hp-edit-pill[hidden]{display:none}

/* Hanna Docs: Pictures tab (follows the page theme) */
.hp-docs{display:flex;flex-direction:column;gap:14px}
.hp-docs *{box-sizing:border-box}
.hp-docs .hp-btn{border:1px solid var(--edge,#d0d5dd);background:var(--surface,#fff);color:var(--text,#14171f)}
.hp-docs .hp-btn:hover{border-color:var(--accent,#3d7bfd);background:var(--hover,#f2f4f8)}
.hp-docs .hp-btn.hp-primary{background:var(--ht-accent,var(--accent,#3d7bfd));border-color:var(--ht-accent,var(--accent,#3d7bfd));color:var(--ht-accent-ink,#fff);align-self:flex-start}
.hp-docs .hp-btn.hp-quiet{background:transparent;border-color:transparent;color:var(--muted,#667085)}
.hp-docs-allow{margin:0;font-size:13px;color:var(--muted,#667085)}
.hp-docs-tools{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}
.hp-docs-tool{flex-direction:column;align-items:flex-start;text-align:left;gap:3px;padding:10px 12px;min-height:64px;font-weight:400}
.hp-docs-tool strong{font-size:13.5px}
.hp-docs-tool span{font-size:12px;color:var(--muted,#667085);line-height:1.3}
.hp-docs .hp-docs-tool.is-on{border-color:var(--ht-accent,var(--accent,#3d7bfd));box-shadow:inset 0 0 0 1px var(--ht-accent,var(--accent,#3d7bfd))}
.hp-drop{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:120px;padding:18px;border:1.5px dashed var(--edge,#d0d5dd);border-radius:10px;background:var(--surface,#fff);cursor:pointer;text-align:center}
.hp-drop span{font-size:12.5px;color:var(--muted,#667085)}
.hp-drop.is-over,.hp-drop:focus-visible{border-color:var(--ht-accent,var(--accent,#3d7bfd));outline:none;background:var(--hover,#f2f4f8)}
.hp-docs-files{display:flex;flex-direction:column;border:1px solid var(--edge,#d0d5dd);border-radius:10px;overflow:hidden}
.hp-docs-file{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 12px;border-top:1px solid var(--edge,#e4e7ec);background:var(--surface,#fff)}
.hp-docs-file:first-child{border-top:0}
.hp-docs-file>span{flex:1 1 200px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;font-size:13px}
.hp-docs-file>small{color:var(--muted,#667085);font-size:12px;margin-right:auto}
.hp-docs-opts{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px;align-items:end}
.hp-docs .hp-field span{color:var(--muted,#667085)}
.hp-docs input[type=number],.hp-docs input[type=text],.hp-docs select,.hp-docs .hp-textbox{width:100%;min-height:36px;padding:7px 9px;border-radius:7px;border:1px solid var(--edge,#d0d5dd);background:var(--surface,#fff);color:var(--text,#14171f);font:inherit;font-size:14px}
.hp-docs .hp-check{display:flex;gap:8px;align-items:center;font-size:13px}
.hp-docs-results{display:flex;flex-direction:column;gap:10px}
.hp-docs-results h3{margin:0;font-size:15px}
.hp-docs .hp-small{margin:0;font-size:12.5px;color:var(--muted,#667085)}
.hp-docs .hp-error{margin:0;color:#c62828;font-size:13px}
@media (max-width:760px){.hp-docs-tools{grid-template-columns:1fr 1fr}.hp-docs-tool{min-height:44px}.hp-docs-tool span{display:none}.hp-docs input,.hp-docs select{font-size:16px!important}}

/* People & access: picture allowance */
fieldset.hp-allow input[type=number]{width:120px}

/* pics2: Every size sheet (follows a dark studio like the editor) */
.hp-sheet-wrap{align-items:center;justify-content:center;background:rgba(10,12,16,.72)}
.hp-sheet{width:min(960px,100%);max-height:min(860px,100%);display:flex;flex-direction:column;background:var(--hp-panel);border:1px solid var(--hp-line);border-radius:12px;overflow:hidden}
.hp-sheet-narrow{width:min(720px,100%)}
.hp-sheet-narrow .hp-size img{max-height:160px;object-fit:contain}
.hp-sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 8px 8px 16px;border-bottom:1px solid var(--hp-line)}
.hp-sheet-body{padding:14px 16px 18px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}
.hp-sheet-body .hp-btn.hp-primary{align-self:flex-start}
.hp-sizes{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.hp-size{display:flex;flex-direction:column;gap:5px;padding:8px;border:1px solid var(--hp-line);border-radius:10px;background:var(--hp-raise)}
.hp-size img{width:100%;height:150px;object-fit:contain;background:#101216;border-radius:6px}
.hp-size small{color:var(--hp-muted);font-size:12px}
@media (max-width:760px){.hp-sheet{max-height:100%;height:100%;border-radius:0}.hp-sizes{grid-template-columns:1fr 1fr}.hp-size img{height:110px}}

/* pics2: Docs tab extras */
.hp-docs-checks{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px 16px;margin:0;padding:8px 12px;border:1px solid var(--edge,#d0d5dd);border-radius:8px}
.hp-docs-checks legend{font-size:12px;color:var(--muted,#667085);padding:0 4px}
.hp-palette{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.hp-palette>strong{flex:1 0 100%;font-size:13px}
.hp-palette>small{flex:1 0 100%;font-size:12px;color:var(--muted,#667085)}
.hp-btn.hp-palette-c{min-height:30px;padding:4px 10px 4px 4px;font:500 12.5px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
.hp-palette-dot{width:22px;height:22px;border-radius:50%;border:1px solid rgba(0,0,0,.15)}
/* pics3: Hanna AI */
.hp-ai-tag{display:inline-block;width:max-content;max-width:100%;margin-top:2px;padding:1px 7px;border-radius:5px;font-size:11px;font-weight:700;letter-spacing:.02em;color:var(--hp-accent);border:1px solid currentColor;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (max-width:760px){.hp-ai-long{display:none}}
.hp-ai-modes .hp-chip{flex:1 1 auto}
.hp-tool[data-tool="ai"] svg{color:#c77dff}
.hp-tool[data-tool="ai"].is-on svg{color:var(--hp-accent)}
