:root{
  --primary:#0070c4;
  --bg:#f6f9fc;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --border:rgba(15,23,42,.10);
  --shadow: 0 10px 25px rgba(15,23,42,.08);
  --radius:18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(0,112,196,.18), transparent 60%),
    radial-gradient(700px 450px at 90% 10%, rgba(0,112,196,.12), transparent 55%),
    var(--bg);
}

a{color:var(--primary); text-decoration:none}
a:hover{text-decoration:underline}

.dot{
  width:12px; height:12px; border-radius:99px;
  background:var(--primary);
  box-shadow:0 0 0 6px rgba(0,112,196,.15);
}

.muted{color:var(--muted)}
.tiny{font-size:12px}

.login-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.login-card{
  width:min(440px, 100%);
  background:rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:26px;
}

.brand{
  display:flex;
  gap:14px;
  align-items:center;
  margin-bottom:18px;
}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:13px; color:var(--muted); margin-top:2px}

h1{margin:10px 0 6px; font-size:24px}
p{margin:0 0 14px}

label{display:block; font-size:13px; color:var(--muted); margin:12px 0 6px}
input{
  width:100%;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  outline:none;
  font-size:15px;
  background:#fff;
}
input:focus{
  border-color: rgba(0,112,196,.55);
  box-shadow: 0 0 0 4px rgba(0,112,196,.12);
}

button{
  margin-top:14px;
  width:100%;
  padding:12px 14px;
  border:0;
  border-radius:14px;
  background:linear-gradient(135deg, var(--primary), #0a8be8);
  color:white;
  font-weight:700;
  cursor:pointer;
  box-shadow: 0 12px 20px rgba(0,112,196,.25);
}
button:hover{filter:brightness(1.03)}

.alert{
  margin:12px 0 0;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(239,68,68,.08);
  border:1px solid rgba(239,68,68,.18);
  color:#991b1b;
  font-size:14px;
}

.topbar{
  position:sticky; top:0;
  background:rgba(255,255,255,.75);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
}
.topbar-left{display:flex; align-items:center; gap:12px}
.topbar-title{font-weight:800}
.link{font-weight:600}

.shell{max-width:1100px; margin:0 auto; padding:22px}
.placeholder{
  background:rgba(255,255,255,.85);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:24px;
}

.topbar-sub{font-size:12px; margin-top:2px}

.controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
  flex-wrap:wrap;
}

.searchbox{
  flex:1;
  min-width:260px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.80);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}

.searchbox input{
  border:0;
  padding:8px 4px;
  margin:0;
  outline:none;
  background:transparent;
  box-shadow:none;
  font-size:15px;
}
.searchbox input:focus{box-shadow:none}
.searchicon{color:var(--muted); font-weight:700}

.count{font-weight:600}

.viewtoggle{
  display:flex;
  gap:8px;
  align-items:center;
}

.chip{
  border:1px solid var(--border);
  background:rgba(255,255,255,.75);
  padding:9px 12px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  color:var(--text);
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}
.chip:hover{filter:brightness(1.02)}
html[data-view="cards"] #toggleCards,
html[data-view="list"] #toggleList{
  border-color: rgba(0,112,196,.35);
  box-shadow: 0 0 0 4px rgba(0,112,196,.10);
}

.results{margin-top:10px}

/* Cards grid */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap:14px;
}

.card{
  display:flex;
  flex-direction:column;
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:rgba(255,255,255,.88);
  box-shadow: 0 12px 22px rgba(15,23,42,.06);
  overflow:hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15,23,42,.10);
  text-decoration:none;
}

.cover{
  position:relative;
  aspect-ratio: 3 / 4;
  background: rgba(0,112,196,.06);
}
.cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.badge{
  position:absolute;
  right:10px;
  top:10px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.85);
  border:1px solid var(--border);
  font-size:12px;
  font-weight:800;
}

.card-meta{
  padding:12px 12px 14px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.card-title{
  font-weight:800;
  line-height:1.15;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}
.card-sub{
  font-size:12.5px;
  line-height:1.2;
  display:-webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow:hidden;
}

.folder .cover{display:none}
.folder{
  padding:16px;
  gap:10px;
  justify-content:center;
  min-height:120px;
}
.folder-icon{
  font-size:34px;
}
.folder .card-meta{padding:0}
.folder .card-title{-webkit-line-clamp: 3}

/* List view */
.list{
  display:none;
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  background:rgba(255,255,255,.88);
  box-shadow: 0 12px 22px rgba(15,23,42,.06);
}
.list-head, .list-row{
  display:grid;
  grid-template-columns: 64px 2fr 1.2fr 1.2fr 2fr;
  gap:10px;
  align-items:center;
  padding:12px 14px;
}
.list-head{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  background:rgba(0,112,196,.06);
  border-bottom:1px solid var(--border);
}
.list-row{
  border-bottom:1px solid var(--border);
}
.list-row:last-child{border-bottom:0}
.list-row:hover{
  background:rgba(0,112,196,.05);
  text-decoration:none;
}

.errorbox{
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(239,68,68,.22);
  background:rgba(239,68,68,.08);
  color:#991b1b;
}

/* Toggle actual visibility */
html[data-view="cards"] .grid{display:grid}
html[data-view="cards"] .list{display:none}
html[data-view="list"] .grid{display:none}
html[data-view="list"] .list{display:block}

/* Mobile tweak */
@media (max-width: 780px){
  .list-head, .list-row{
    grid-template-columns: 44px 2fr 1fr;
  }
  .list-head div:nth-child(3),
  .list-head div:nth-child(4),
  .list-head div:nth-child(5),
  .list-row div:nth-child(3),
  .list-row div:nth-child(4),
  .list-row div:nth-child(5){
    display:none;
  }
}

.crumbs{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:12px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:16px;
  background:rgba(255,255,255,.75);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 18px rgba(15,23,42,.05);
  font-weight:700;
}

.crumb{color:var(--primary)}
.crumb:hover{text-decoration:underline}
.crumb-sep{color:rgba(15,23,42,.25)}
.crumb-current{color:var(--text)}

.right-controls{
  display:flex;
  align-items:center;
  gap:12px;
}

.selectwrap{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:16px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.80);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 18px rgba(15,23,42,.06);
}

.selectwrap label{
  margin:0;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}

.selectwrap select{
  border:0;
  background:transparent;
  font-weight:800;
  outline:none;
  cursor:pointer;
  padding:6px 6px;
}

.morewrap{
  display:flex;
  justify-content:center;
  margin:18px 0 4px;
}

.morebtn{
  width:auto;
  padding:10px 16px;
  border-radius:999px;
  border:1px solid rgba(0,112,196,.25);
  background:rgba(255,255,255,.85);
  color:var(--text);
  font-weight:900;
  cursor:pointer;
  box-shadow: 0 12px 20px rgba(15,23,42,.08);
}
.morebtn:hover{filter:brightness(1.02)}

