:root{
  --bg:#fff; --text:#0f172a; --muted:#475569;
  --border: rgba(15,23,42,.12);
  --accent:#2D9CDB;
  --radius:18px;
  --container:1120px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1000px 520px at 12% 0%, rgba(45,156,219,0.10), rgba(255,255,255,0) 70%),
    radial-gradient(900px 520px at 90% 10%, rgba(15,23,42,0.06), rgba(255,255,255,0) 60%),
    var(--bg);
  color:var(--text);
}
a{color:inherit;text-decoration:none}

.container{width:min(var(--container), calc(100% - 40px)); margin:0 auto;}
.page{padding:26px 0 20px;}

/* Header: gradient */
.site-header{
  position:sticky;top:0;z-index:50;
  background: linear-gradient(90deg, #2D9CDB 0%, #1E78B9 100%);
  border-bottom:1px solid rgba(255,255,255,.16);
}
.header-inner{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;}
.brand{display:flex;align-items:center;gap:14px;min-width:280px;}
.brand-logo{
  width:128px;
  max-height:44px;
  height:auto;
  background:transparent;border:0;padding:0;border-radius:0;
  object-fit:contain;
  filter: drop-shadow(0 8px 16px rgba(2,8,23,0.28));
}
.brand-text{display:grid;gap:2px;}
.brand-title{font-weight:850;letter-spacing:-.02em;color:#fff;line-height:1.1;}
.brand-subtitle{font-size:13px;color:rgba(255,255,255,.88);}
.nav{display:flex;align-items:center;gap:10px;}
.nav-link{font-size:14px;color:rgba(255,255,255,.92);padding:8px 10px;border-radius:12px;}
.nav-link:hover{color:#fff;background:rgba(255,255,255,.16);}

.section-head{display:grid;gap:8px;margin-bottom:16px;}
.section-title{margin:0;font-size:clamp(22px,2.4vw,30px);letter-spacing:-.03em;}
.section-subtitle{margin:0;color:var(--muted);line-height:1.6;max-width:80ch;}

.page-hero{
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 28px rgba(2,8,23,.05);
}
.page-hero h1{margin:0;font-size:22px;letter-spacing:-.03em;}
.page-hero p{margin:8px 0 0;color:var(--muted);line-height:1.6;max-width:80ch;}
.page-shell{
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 28px rgba(2,8,23,.05);
}

/* Table styling */
.table-wrap{overflow:auto;border-radius:16px;border:1px solid var(--border);}
table{border-collapse:separate;border-spacing:0;width:100%;min-width:760px;background:#fff;}
thead th{
  text-align:left;
  font-size:12px;
  letter-spacing:.02em;
  color:#0f172a;
  background: rgba(45,156,219,.10);
  border-bottom:1px solid rgba(45,156,219,.25);
  padding:10px 12px;
  position:sticky; top:0;
}
tbody td{
  padding:10px 12px;
  border-bottom:1px solid rgba(15,23,42,.08);
  color:#0f172a;
  vertical-align:top;
  font-size:14px;
}
tbody tr:nth-child(2n){background: rgba(15,23,42,.02);}
tbody tr:hover{background: rgba(45,156,219,.08);}

.home-title-link{font-weight:800;color:#0f172a;}
.home-title-link:hover{color:#0b3a55;text-decoration:underline;}

.small{font-size:12px;color:var(--muted);line-height:1.5;margin-top:10px;}

/* Footer */
.site-footer{padding:20px 0;border-top:1px solid var(--border);background:rgba(255,255,255,.7);}
.footer-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;}
.muted{color:var(--muted);margin:0;font-size:13px;}
.footer-links{display:flex;gap:12px;}
.muted-link{color:var(--muted);font-size:13px;padding:6px 8px;border-radius:10px;}
.muted-link:hover{color:var(--text);background:rgba(15,23,42,.04);}

@media (max-width:860px){
  .brand-subtitle{display:none;}
  .brand-logo{max-height:40px;}
  .nav{display:none;}
}

/* PATCH: Library controls + cards view + category column (keeps existing site styles intact) */

.sr-only{
  position:absolute !important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

.library-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 0 0 12px;
}

.library-controls-left{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
  min-width: 240px;
}

.library-search{
  flex: 1;
  min-width: 220px;
  height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 22px rgba(2,8,23,.04);
  outline: none;
  font-size: 14px;
}

.library-search:focus{
  border-color: rgba(45,156,219,.55);
  box-shadow: 0 10px 22px rgba(45,156,219,.12);
}

.library-count{
  font-size: 13px;
  color: #475569;
  white-space: nowrap;
}

.toggle-btn{
  height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.toggle-btn:hover{
  border-color: rgba(45,156,219,.55);
}
.toggle-label{ display:inline-block; }

.category-pill{
  display:inline-flex;
  align-items:center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
  background: rgba(45,156,219,.12);
  border: 1px solid rgba(45,156,219,.28);
}

.library-table th.sortable{
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.library-table th.sortable:hover{
  background: rgba(45,156,219,.16);
}
.sort-ind{ font-size: 11px; color:#0f172a; opacity: .8; }

.empty{
  padding: 14px 12px;
  color: #475569;
}

/* Cards view */
.library-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
}

.library-card{
  display:grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  box-shadow: 0 10px 28px rgba(2,8,23,.05);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.library-card:hover{
  transform: translateY(-2px);
  border-color: rgba(45,156,219,.45);
  box-shadow: 0 16px 38px rgba(2,8,23,.08);
}

.library-card-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 10px;
}

.library-card-title{
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.25;
}

.library-card-desc{
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.library-card-cta{
  margin-top: 2px;
  display:inline-flex;
  width: fit-content;
  padding: 9px 12px;
  border-radius: 14px;
  background: #2D9CDB;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
  box-shadow: 0 10px 22px rgba(45,156,219,.18);
}

@media (max-width:1100px){
  .library-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width:860px){
  .library-controls{ flex-direction: column; align-items: stretch; }
  .library-controls-left{ width:100%; }
  .library-grid{ grid-template-columns: 1fr; }
}


/* PATCH: shared button styles (used across pages) */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid rgba(15,23,42,.12);
  background: rgba(255,255,255,.92);
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  text-decoration:none;
}
.btn:hover{ border-color: rgba(45,156,219,.55); }
.btn-primary{
  background: #2D9CDB;
  color:#fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(45,156,219,.18);
}
.btn-primary:hover{ filter: brightness(.98); }
