/* Library 2.0 — document management surface */

.library-card{
  width:min(1080px,100%);
  margin:0 auto;
}

.library-head{
  align-items:flex-end!important;
  padding-bottom:16px!important;
  border-bottom:1px solid var(--app-line)!important;
}
.library-head h2{
  margin:3px 0 5px!important;
  font-family:Georgia,"Times New Roman",serif!important;
  font-size:clamp(28px,3.8vw,38px)!important;
  font-weight:500!important;
  letter-spacing:-.025em!important;
}
.library-head p{font-size:10px!important;color:var(--app-muted)!important}

.library-controls{gap:7px!important}
.library-search-wrap{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:min(330px,42vw);
  height:34px;
  padding:0 7px;
  border:1px solid var(--app-line);
  border-radius:9px;
  background:var(--app-surface);
}
.library-search-wrap .ui-icon{width:14px;height:14px;color:#968b80;flex:0 0 14px}
.library-search-wrap input{
  min-width:0;
  width:100%;
  height:30px;
  padding:4px 2px;
  border:0;
  outline:0;
  background:transparent;
  color:var(--app-ink);
  font-size:10px;
}
.library-search-wrap input::placeholder{color:#a59b92}
.library-search-wrap .icon-only-button{
  width:26px;
  min-width:26px;
  height:26px;
  padding:0!important;
}
.library-search-wrap .icon-only-button .ui-icon{width:12px;height:12px}

.library-summary{
  display:flex!important;
  justify-content:flex-start!important;
  gap:20px!important;
  margin:12px 0 16px!important;
  padding:0!important;
  border:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.library-summary>div{
  display:flex!important;
  align-items:baseline;
  gap:4px;
}
.library-summary strong{
  color:var(--app-ink)!important;
  font-size:13px!important;
  font-variant-numeric:tabular-nums;
}
.library-summary span{
  color:var(--app-muted)!important;
  font-size:9px!important;
}

.library-continue{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:0 0 18px;
  padding:14px 16px;
  border:1px solid var(--app-line);
  border-radius:12px;
  background:var(--app-surface);
  box-shadow:var(--app-shadow);
}
.library-continue-copy{min-width:0}
.library-continue-copy .eyebrow{margin-bottom:4px}
.library-continue-copy h3{
  margin:0 0 4px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--app-ink);
  font-family:Georgia,"Times New Roman",serif;
  font-size:17px;
  font-weight:500;
}
.library-continue-copy p{
  margin:0;
  color:var(--app-muted);
  font-size:9px;
  font-variant-numeric:tabular-nums;
}
.library-continue .primary-button{
  min-height:34px!important;
  padding:7px 10px!important;
  flex:0 0 auto;
  box-shadow:none!important;
}

.library-list{
  display:flex;
  flex-direction:column;
  gap:7px;
}
.library-item{
  display:grid!important;
  grid-template-columns:34px minmax(0,1fr) auto!important;
  align-items:center;
  gap:12px!important;
  min-height:82px!important;
  padding:11px 12px!important;
  border:1px solid var(--app-line)!important;
  border-radius:11px!important;
  background:var(--app-surface)!important;
  box-shadow:none!important;
}
.library-item:hover{
  border-color:var(--app-line-strong)!important;
  background:#fbf8f2!important;
}
.library-item.hidden{display:none!important}
.library-document-icon{
  display:grid!important;
  place-items:center;
  width:34px!important;
  height:34px!important;
  border:1px solid var(--app-line)!important;
  border-radius:8px!important;
  background:var(--app-surface-soft)!important;
  color:#796d62!important;
}
.library-document-icon .ui-icon{width:16px;height:16px}
.library-item-content{min-width:0!important}
.library-item-title{
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--app-ink)!important;
  font-family:Georgia,"Times New Roman",serif!important;
  font-size:13px!important;
  font-weight:500!important;
}
.library-item-meta{
  display:flex!important;
  align-items:center;
  flex-wrap:wrap;
  gap:0!important;
  margin-top:5px!important;
  color:var(--app-muted)!important;
  font-size:8px!important;
  line-height:1.5!important;
}
.library-item-meta span{
  display:inline-flex;
  align-items:center;
  white-space:nowrap;
}
.library-item-meta span+span::before{
  content:"·";
  margin:0 6px;
  color:#b0a69d;
}
.library-item-track{
  width:100%;
  height:2px!important;
  margin-top:8px!important;
  overflow:hidden;
  border-radius:99px;
  background:#e9e1d7!important;
}
.library-item-track span{
  display:block;
  height:100%;
  border-radius:inherit;
  background:var(--app-accent)!important;
  transition:width .16s ease;
}
.library-item-actions{
  display:flex!important;
  align-items:center;
  gap:5px!important;
}
.library-open-button{
  min-height:32px!important;
  padding:6px 9px!important;
  box-shadow:none!important;
  font-size:9px!important;
}
.library-open-button .ui-icon{width:13px;height:13px}
.library-item-menu{position:relative}
.library-item-menu>summary{
  width:32px!important;
  min-width:32px!important;
  height:32px!important;
  padding:0!important;
  display:grid!important;
  place-items:center;
  list-style:none;
  cursor:pointer;
}
.library-item-menu>summary::-webkit-details-marker{display:none}
.library-item-menu>summary .ui-icon{width:15px;height:15px}
.library-item-menu-panel{
  position:absolute;
  z-index:30;
  right:0;
  top:calc(100% + 5px);
  min-width:132px;
  padding:5px;
  border:1px solid var(--app-line);
  border-radius:9px;
  background:var(--app-surface);
  box-shadow:0 12px 30px rgba(62,50,39,.10);
}
.library-menu-action{
  width:100%;
  min-height:32px!important;
  justify-content:flex-start!important;
  padding:6px 8px!important;
  border:0!important;
  border-radius:7px!important;
  background:transparent!important;
  color:var(--app-ink)!important;
  font-size:9px!important;
}
.library-menu-action:hover{background:var(--app-surface-soft)!important}
.library-menu-action .ui-icon{width:13px;height:13px}
.library-menu-danger{color:var(--app-danger)!important}

.library-empty{
  margin:8px 0;
  padding:25px 16px!important;
  border:1px dashed var(--app-line-strong)!important;
  border-radius:12px!important;
  background:var(--app-surface-soft)!important;
}
.library-empty-action{margin-top:12px!important}
.library-filter-empty{margin-top:0!important}
.library-filter-empty.hidden{display:none!important}

@media(max-width:700px){
  .library-head{align-items:flex-start!important;gap:12px!important}
  .library-controls{width:100%;justify-content:flex-start}
  .library-search-wrap{min-width:0;flex:1}
  .library-summary{gap:14px!important}
  .library-continue{align-items:flex-start;flex-direction:column;gap:10px}
  .library-continue .primary-button{width:100%}
  .library-item{
    grid-template-columns:32px minmax(0,1fr) auto!important;
    gap:9px!important;
    padding:10px!important;
  }
  .library-item-meta{
    max-width:100%;
    gap:0!important;
  }
  .library-open-button{
    width:32px!important;
    min-width:32px!important;
    height:32px!important;
    padding:0!important;
  }
  .library-open-button span{display:none}
  .library-item-actions{gap:3px!important}
  .library-item-menu>summary{width:32px!important;min-width:32px!important}
}
@media(max-width:480px){
  .library-summary{justify-content:space-between!important;width:100%}
  .library-summary>div{display:flex!important;flex-direction:column;gap:1px}
  .library-item-title{font-size:12px!important}
  .library-item-meta{font-size:7px!important}
  .library-item-meta span+span::before{margin:0 4px}
  .library-document-icon{width:30px!important;height:30px!important}
  .library-item{grid-template-columns:30px minmax(0,1fr) auto!important}
}
@media(prefers-reduced-motion:reduce){
  .library-item-track span{transition:none}
}

/* Global UX search — compact, keyboard-first */
.global-search-trigger{
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
}
.global-search-trigger .ui-icon{width:16px;height:16px}

.global-search-overlay{
  position:fixed;
  inset:0;
  z-index:1000;
  display:grid;
  place-items:start center;
  padding:clamp(70px,12vh,120px) 16px 24px;
}
.global-search-overlay.hidden{display:none}
.global-search-backdrop{
  position:absolute;
  inset:0;
  background:rgba(47,43,39,.22);
  backdrop-filter:blur(3px);
}
.global-search-panel{
  position:relative;
  width:min(560px,100%);
  max-height:min(620px,calc(100vh - 110px));
  overflow:auto;
  padding:15px;
  border:1px solid var(--app-line);
  border-radius:14px;
  background:var(--app-surface);
  box-shadow:0 22px 60px rgba(47,43,39,.16);
}
.global-search-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.global-search-head h2{
  margin:3px 0 0;
  color:var(--app-ink);
  font-family:Georgia,"Times New Roman",serif;
  font-size:18px;
  font-weight:500;
}
.global-search-field{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:40px;
  padding:0 8px;
  border:1px solid var(--app-line-strong);
  border-radius:10px;
  background:#fffdfa;
}
.global-search-field>.ui-icon{width:15px;height:15px;color:#91867c}
.global-search-field input{
  min-width:0;
  flex:1;
  height:36px;
  border:0;
  outline:0;
  background:transparent;
  color:var(--app-ink);
  font-size:11px;
}
.global-search-field .icon-only-button{
  width:28px!important;
  min-width:28px!important;
  height:28px!important;
}
.global-search-results{margin-top:12px}
.global-search-group+.global-search-group{margin-top:14px}
.global-search-group-title{
  display:block;
  margin:0 5px 5px;
  color:var(--app-faint);
  font-size:8px;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.global-search-result{
  display:flex;
  align-items:center;
  width:100%;
  min-height:46px;
  gap:10px;
  padding:7px 8px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--app-ink);
  text-align:left;
  cursor:pointer;
}
.global-search-result:hover,
.global-search-result:focus-visible{background:var(--app-surface-soft)}
.global-search-result>.ui-icon{
  width:16px;
  height:16px;
  flex:0 0 16px;
  color:var(--app-accent);
}
.global-search-result-copy{
  display:grid;
  min-width:0;
  gap:2px;
}
.global-search-result-copy strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:10px;
  font-weight:600;
}
.global-search-result-copy small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--app-muted);
  font-size:8px;
}
.global-search-empty{
  display:grid;
  justify-items:center;
  gap:5px;
  padding:28px 12px;
  color:var(--app-muted);
  text-align:center;
}
.global-search-empty .ui-icon{width:18px;height:18px;color:var(--app-faint)}
.global-search-empty strong{color:var(--app-ink);font-size:10px}
.global-search-empty span{font-size:8px}
@media(max-width:700px){
  .global-search-overlay{padding:60px 10px 16px}
  .global-search-panel{max-height:calc(100vh - 76px);padding:13px}
}
@media(prefers-reduced-motion:reduce){
  .global-search-backdrop{backdrop-filter:none}
}
