/* Public profile: compact identity, two-row library toolbar, quiet file actions.
   Keep the existing site's font, blue accent, light/dark tokens and shared header. */
.public-home{--puh-ink:var(--color-text,#203a53);--puh-muted:var(--color-text-secondary,#5a6478);--puh-line:var(--color-border-light,#e1e8ef);--puh-bg:var(--color-bg,#f3f6fa);--puh-paper:var(--color-surface,#fff);--puh-soft:var(--color-surface-alt,#eaf1f8);--puh-accent:var(--color-dark-mode-link,#234d76);color:var(--puh-ink);background:var(--puh-paper);font-family:inherit;font-size:14px;line-height:1.6;min-height:100%;container-type:inline-size}
.public-home *{box-sizing:border-box}
.public-home h1,.public-home h2,.public-home h3,.public-home p{margin:0}
.public-home button,.public-home input,.public-home select,.public-home textarea,.public-home summary{font:inherit;color:inherit}
.public-home button,.public-home summary{cursor:pointer}
.public-home button:disabled{opacity:.5;cursor:not-allowed}
.public-home :is(button,input,select,textarea,summary):focus-visible,.puh-switch button:focus-visible{outline:2px solid var(--puh-accent,#7497b8);outline-offset:3px}
.public-home button,.public-home input,.public-home select,.public-home textarea{border:1px solid var(--puh-line);border-radius:7px;background:var(--puh-paper);padding:7px 12px}
.public-home button:hover,.public-home summary:hover{background:var(--puh-soft)}
.public-home .puh-primary{background:#234d76;color:#fff;border-color:#234d76}
.public-home .puh-primary:hover{background:#1d3d5f}
.public-home .puh-body{max-width:1240px;padding:32px 32px 24px;margin:auto}
.public-home .puh-profile{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:24px;padding:4px 0 30px;border-bottom:1px solid var(--puh-line)}
.public-home .puh-identity{display:flex;align-items:flex-start;gap:20px;min-width:0}
.public-home .puh-identity>div:last-child{flex:1;min-width:0}
.public-home .puh-avatar{width:64px;height:64px}
.public-home h1{font-size:24px;line-height:1.4;font-weight:650;overflow-wrap:anywhere}
.public-home .puh-bio{font-size:13px;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;margin-top:8px;max-width:650px;color:var(--puh-muted)}
.public-home .puh-stats{display:flex;flex-wrap:wrap;gap:6px 20px;margin-top:14px;color:var(--puh-muted);font-size:12px}
.public-home .puh-stats b{font-weight:600;color:var(--puh-ink);font-variant-numeric:tabular-nums}
.public-home .puh-share{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;font-size:12px;white-space:nowrap;margin-top:2px}
.public-home .puh-body .mwh-icon{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.public-home .puh-body .mwh-avatar .mwh-icon{width:53%;height:53%}
.public-home .puh-library{padding-top:26px}
.public-home .puh-library-heading{display:flex;align-items:center;justify-content:space-between;gap:20px}
.public-home h2{font-size:18px;line-height:1.5;font-weight:650;white-space:nowrap}
.public-home .puh-total{font-size:13px;font-weight:400;color:var(--puh-muted);margin-left:6px}
.public-home .puh-search-wrap{display:flex;align-items:center;gap:8px;width:270px;max-width:50%;padding:0 10px;background:var(--puh-bg);border:1px solid transparent;border-radius:7px;color:var(--puh-muted)}
.public-home .puh-search-wrap:focus-within{border-color:var(--puh-accent)}
.public-home .puh-search{width:100%;min-width:0;height:36px;padding:6px 0;border:0;border-radius:0;background:transparent;font-size:12px;outline:none}
.public-home input::placeholder,.public-home textarea::placeholder{color:var(--puh-muted);opacity:1}
.public-home .puh-filterbar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:18px;padding-bottom:16px;border-bottom:1px solid var(--puh-line)}
.public-home .puh-filters{display:flex;flex-wrap:wrap;gap:4px}
.public-home .puh-filters button{border:0;background:transparent;padding:5px 10px;font-size:12px;white-space:nowrap;min-height:32px}
.public-home .puh-filters button[aria-pressed=true]{background:var(--puh-soft);color:var(--puh-accent);font-weight:600}
.public-home .puh-filters button:hover{background:var(--puh-bg)}
.public-home .puh-selects{display:flex;gap:8px;min-width:0}
.public-home .puh-selects select{width:140px;min-width:0;height:32px;padding:4px 24px 4px 9px;font-size:12px;text-overflow:ellipsis}
.public-home .puh-selects .puh-sort{width:120px}
.public-home .puh-result-count{font-size:12px;color:var(--puh-muted);padding-top:12px}
.public-home .puh-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:14px;min-height:76px;padding:14px 0;border-bottom:1px solid var(--puh-line)}
.public-home .puh-row:last-child{border-bottom:0}
.public-home .puh-row:hover .puh-file-open{color:var(--puh-accent)}
.public-home .puh-filetype{width:34px;height:40px;display:grid;place-items:center;font-size:9px;font-weight:600;letter-spacing:.1px;background:var(--puh-bg);color:var(--puh-muted);border-radius:5px}
.public-home .puh-file-info{min-width:0}
.public-home .puh-file-info h3{display:flex;align-items:center;gap:7px;min-width:0;font-size:14px;line-height:1.5;font-weight:550}
.public-home .puh-file-open{display:block;min-width:0;max-width:100%;padding:0;border:0;border-radius:2px;background:transparent;text-align:left;font-weight:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.public-home .puh-file-open:hover{background:transparent;text-decoration:underline;text-underline-offset:3px}
.public-home .puh-file-info p{display:flex;flex-wrap:wrap;gap:2px 16px;margin-top:4px;font-size:11px;color:var(--puh-muted);overflow-wrap:anywhere}
.public-home .puh-file-info time{white-space:nowrap}
.public-home .puh-pin{font-size:10px;font-weight:400;white-space:nowrap;color:var(--puh-accent);flex-shrink:0}
.public-home .puh-row-actions{display:flex;align-items:center;gap:4px;justify-content:flex-end}
.public-home .puh-favorite{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:48px;height:32px;padding:4px 6px;border:0;background:transparent;color:var(--puh-muted);font-size:12px;font-variant-numeric:tabular-nums}
.public-home .puh-favorite[aria-pressed=true]{color:var(--puh-accent)}
.public-home .puh-favorite[aria-pressed=true] svg{fill:currentColor}
.public-home .puh-more{position:relative}
.public-home .puh-more summary{display:grid;place-items:center;list-style:none;width:32px;height:32px;font-size:22px;line-height:1;border-radius:7px;color:var(--puh-muted)}
.public-home .puh-more summary::-webkit-details-marker{display:none}
.public-home .puh-more[open] summary{background:var(--puh-soft);color:var(--puh-ink)}
.public-home .puh-more-panel{position:absolute;z-index:5;right:0;top:36px;min-width:116px;padding:5px;background:var(--puh-paper);border:1px solid var(--puh-line);border-radius:8px;box-shadow:0 5px 18px #16345414}
.public-home .puh-more-panel button{display:block;width:100%;text-align:left;border:0;font-size:12px;padding:7px 10px;white-space:nowrap}
.public-home .puh-pagination{display:flex;justify-content:space-between;align-items:center;gap:15px;border-top:1px solid var(--puh-line);padding:16px 0;font-size:11px;color:var(--puh-muted)}
.public-home .puh-pagination>div{display:flex;align-items:center;gap:5px}
.public-home .puh-pagination button{font-size:11px;padding:5px 8px;min-width:28px}
.public-home .puh-pagination button[aria-current=page]{background:#234d76;border-color:#234d76;color:#fff}
.public-home .puh-empty{padding:44px 16px;text-align:center;color:var(--puh-muted)}
.public-home .puh-empty h3{font-size:15px;font-weight:550;color:var(--puh-ink);margin-bottom:8px}
.public-home .puh-empty p{font-size:12px}.public-home .puh-empty button{margin-top:12px}
.public-home .puh-status{font-size:12px;margin-top:8px}.public-home .puh-status:empty{display:none}
.public-home .puh-profile-loading{display:flex;align-items:center;gap:20px;min-height:118px;color:var(--puh-muted);font-size:12px}
.public-home .puh-skeleton-avatar{width:64px;height:64px;border-radius:50%;background:var(--puh-bg);flex-shrink:0}
.public-home .puh-skeleton-line{display:block;height:22px;width:160px;background:var(--puh-bg);border-radius:4px;margin-bottom:10px}
.public-home .puh-list-loading{padding:24px 0;color:var(--puh-muted);font-size:12px}
.public-home .puh-edit-bio{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;width:28px;height:28px;margin-left:6px;padding:5px;border:0;background:transparent;color:var(--puh-muted)}
.public-home .puh-edit-bio:hover{background:var(--puh-soft);color:var(--puh-ink)}.public-home .puh-edit-bio svg{width:18px;height:18px}
.public-home .puh-bio-editor{margin-top:8px;max-width:650px}
.public-home .puh-bio-editor textarea{display:block;width:100%;min-height:90px;resize:vertical;font-size:13px;line-height:1.9}
.public-home .puh-edit-hint{font-size:11px;color:var(--puh-muted);margin-top:6px}
.public-home .puh-edit-status{font-size:12px;margin-top:6px}.public-home .puh-edit-status:empty{display:none}
.public-home .puh-edit-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.public-home .puh-edit-actions button{font-size:12px;padding:5px 12px}
.public-home [hidden]{display:none!important}
@container(max-width:760px){.public-home .puh-filterbar{flex-wrap:wrap}.public-home .puh-selects{margin-left:auto}.public-home .puh-body{padding:26px 24px 20px}}
@container(max-width:520px){.public-home .puh-body{padding:24px 16px 16px}.public-home .puh-profile{grid-template-columns:1fr;gap:14px;padding-bottom:24px}.public-home .puh-identity{gap:14px}.public-home .puh-avatar{width:44px;height:44px}.public-home h1{font-size:21px}.public-home .puh-share{justify-self:start;margin:0 0 0 58px;min-height:32px}.public-home .puh-stats{gap:6px 14px}.public-home .puh-library{padding-top:22px}.public-home .puh-library-heading{flex-wrap:wrap;gap:12px}.public-home .puh-search-wrap{width:100%;max-width:100%}.public-home .puh-filterbar{gap:10px;margin-top:12px;padding-bottom:12px}.public-home .puh-filters{gap:2px;width:100%}.public-home .puh-filters button{padding:5px 8px}.public-home .puh-selects{width:100%;margin:0}.public-home .puh-selects select{flex:1;width:0}.public-home .puh-row{gap:10px;grid-template-columns:29px minmax(0,1fr) auto;min-height:76px}.public-home .puh-filetype{width:29px;height:35px;font-size:8px}.public-home .puh-file-info h3{font-size:13px}.public-home .puh-file-open{white-space:normal;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.public-home .puh-row-actions{gap:0}.public-home .puh-favorite{min-width:36px;gap:3px;padding:4px}.public-home .puh-more summary{width:28px}.public-home .puh-pagination{align-items:flex-start;flex-direction:column;gap:10px}.public-home .puh-pagination>div{flex-wrap:wrap}}
.puh-switch{display:flex;gap:4px;padding:4px;border-radius:8px;background:var(--color-bg,#f3f6fa);flex-shrink:0}
.puh-switch button{font:inherit;font-size:12px;border:0;border-radius:5px;padding:6px 14px;cursor:pointer;background:none;color:var(--color-text-secondary,#617489);white-space:nowrap}
.puh-switch button[aria-pressed=true]{background:var(--color-surface,#fff);color:var(--color-primary,#234d76);font-weight:600}
.mine-workspace .mwh-topbar:has(.puh-switch){flex-wrap:wrap}.mine-workspace .mwh-topbar .puh-switch{margin-inline:auto}
.mine-workspace .mwh-topbar:has(.puh-switch){height:auto;min-height:56px;padding-block:8px;row-gap:8px}.mine-workspace .mwh-topbar:has(.puh-switch) .mwh-tools{min-width:max-content;flex-shrink:0}.mine-workspace .mwh-topbar .puh-switch button{padding:6px 14px;font-size:12px;background:transparent;border-radius:5px}.mine-workspace .mwh-topbar .puh-switch button[aria-pressed=true]{background:var(--color-surface,#fff);color:var(--color-primary,#234d76)}
@container mine-workspace (max-width:650px){.mine-workspace .mwh-topbar:has(.puh-switch) .mwh-crumb{display:none}.mine-workspace .mwh-topbar:has(.puh-switch) .mwh-tools{flex-basis:100%;justify-content:flex-end}.mine-workspace .mwh-topbar:has(.puh-switch) .puh-switch{margin-inline:auto}}

/* Public view reuses the original workspace header without moving its controls. */
.public-home .puh-header-shell{min-height:0;container-type:inline-size;container-name:mine-workspace;background:var(--color-bg)}
.public-home .puh-header-shell .mwh-search input{padding:0;border:0;border-radius:0;font-size:12px;background:none}
.public-home .puh-header-shell .mwh-topbar button{border:0;background:none;border-radius:0;padding:0;color:inherit}
.public-home .puh-header-shell .mwh-topbar .puh-switch button{padding:6px 14px;border-radius:5px;font-size:12px}
.public-home .puh-header-shell .mwh-topbar .puh-switch button[aria-pressed=true]{background:var(--color-surface);color:var(--color-primary)}
.public-home .puh-header-shell .mwh-account-menu button{padding:8px;border-radius:5px;font-size:13px}
.public-home .puh-header-shell .mwh-search input::placeholder{color:var(--color-text-secondary)}
/* Keep the header tracks and scrollbar gutter stable during async home loads. */
#pageContent:has(>.mine-workspace),#pageContent:has(>.public-home){scrollbar-gutter:stable}
.mine-workspace .mwh-topbar:has(.puh-switch),.mine-workspace .mwh-topbar:has(.puh-switch-placeholder){display:grid;grid-template-columns:minmax(0,1fr) 226px minmax(0,1fr);gap:18px;height:48px;min-height:48px;padding:3px 28px;align-items:center;box-sizing:border-box}
.mine-workspace .mwh-topbar .puh-switch,.mine-workspace .mwh-topbar .puh-switch-placeholder{width:226px;height:38px;margin:0;box-sizing:border-box;justify-content:center;align-items:center;flex-shrink:0}
.mine-workspace .mwh-topbar .puh-switch button,.public-home .puh-header-shell .mwh-topbar .puh-switch button{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:32px;line-height:20px;padding:6px 12px;font-size:13px;box-sizing:border-box;flex:1;min-width:0;border:0;border-radius:999px;font-weight:500;color:var(--color-text-secondary);box-shadow:none;transition:background-color .15s ease,border-color .15s ease,color .15s ease}
.mine-workspace .mwh-topbar:has(.puh-switch) .mwh-tools,.mine-workspace .mwh-topbar:has(.puh-switch-placeholder) .mwh-tools{justify-self:end;min-width:0;flex-shrink:1}
@container mine-workspace (max-width:800px){.mine-workspace .mwh-topbar:has(.puh-switch),.mine-workspace .mwh-topbar:has(.puh-switch-placeholder){grid-template-columns:minmax(0,1fr) 226px;height:auto;min-height:48px;padding-block:8px;row-gap:8px}.mine-workspace .mwh-topbar:has(.puh-switch) .mwh-tools,.mine-workspace .mwh-topbar:has(.puh-switch-placeholder) .mwh-tools{grid-column:1/-1;justify-self:end}.mine-workspace .mwh-topbar:has(.puh-switch) .mwh-crumb,.mine-workspace .mwh-topbar:has(.puh-switch-placeholder) .mwh-crumb{display:flex}.mine-workspace .mwh-topbar:has(.puh-switch) .puh-switch{margin:0}}
@container mine-workspace (max-width:430px){.mine-workspace .mwh-topbar:has(.puh-switch),.mine-workspace .mwh-topbar:has(.puh-switch-placeholder){padding-inline:16px;gap:8px}}

/* Rounded home switch with a prominent active state in both views. */
.mine-workspace .mwh-topbar .puh-switch{gap:4px;padding:3px;border:0;border-radius:999px;background:var(--mwh-soft)}
.mine-workspace .mwh-topbar .puh-switch button[aria-pressed=false]:hover{background:var(--color-border-light);color:var(--color-text)}
.mine-workspace .mwh-topbar .puh-switch button[aria-pressed=true],.public-home .puh-header-shell .mwh-topbar .puh-switch button[aria-pressed=true]{background:#1d3d5f;color:#fff;font-weight:600;box-shadow:none}
.mine-workspace .mwh-topbar .puh-switch button:focus-visible{outline:2px solid var(--color-dark-mode-link,var(--color-primary-light));outline-offset:2px;position:relative;z-index:1}
@media(prefers-reduced-motion:reduce){.mine-workspace .mwh-topbar .puh-switch button{transition:none}}

.mine-workspace .mwh-topbar .puh-switch .mwh-icon{width:15px;height:15px;stroke-width:1.8}
:root[data-color-mode="dark"] .mine-workspace .mwh-topbar .puh-switch button[aria-pressed=true]{background:#a8cff6;color:#14283d}
