:root{
  --bg:#ffffff;
  --text:#111;
  --muted:#666;
  --border:#e6e6e6;
  --card:#fafafa;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:var(--bg);
  color:var(--text);
}

a{ color:inherit; }
code{ background:#f1f1f1; padding:2px 6px; border-radius:6px; }

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  background:var(--bg);
  z-index:10;
}

.brand{ display:flex; gap:16px; align-items:center; }
.brand__name{ font-weight:800; text-decoration:none; }

.nav{ display:flex; gap:12px; }
.nav a{ text-decoration:none; color:var(--muted); }
.nav a.active{ color:var(--text); font-weight:700; }

.topbar__actions{ display:flex; gap:10px; }

.container{ max-width:1100px; margin:0 auto; padding:24px 18px; }

.pagehead h1{ margin:0 0 6px 0; font-size:34px; }
.muted{ color:var(--muted); }
.small{ font-size:13px; }

.tabs{ display:flex; gap:10px; margin:18px 0 10px; }
.tab{
  border:1px solid var(--border);
  background:#fff;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
  color:var(--muted);
}
.tab.active{
  color:var(--text);
  border-color:#cfcfcf;
  font-weight:700;
}

.status{ margin:12px 0; min-height:20px; color:var(--muted); }
.hidden{ display:none !important; }

.split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
}
@media (max-width:900px){
  .split{ grid-template-columns:1fr; }
}

.list{ display:flex; flex-direction:column; gap:12px; margin-top:10px; }

.card{
  border:1px solid var(--border);
  background:var(--card);
  border-radius:14px;
  padding:14px;
  display:grid;
  gap:10px;
}
.card__top{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.card h3{ margin:0; font-size:18px; }
.meta{ color:var(--muted); font-size:13px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#fff;
  font-size:12px;
  color:#333;
  white-space:nowrap;
}

.memory{
  display:flex;
  gap:12px;
  align-items:flex-start;
}
.memory img{
  width:110px;
  height:84px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
}
.memory__empty{
  padding:12px;
  border:1px dashed #cfcfcf;
  border-radius:12px;
  background:#fff;
  color:var(--muted);
  font-size:13px;
  width:100%;
}

.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.btn{
  border:1px solid var(--border);
  background:#fff;
  padding:9px 12px;
  border-radius:10px;
  cursor:pointer;
}
.btn:hover{ border-color:#cfcfcf; }
.btn--ghost{ background:transparent; }
.btn--primary{
  background:#111;
  color:#fff;
  border-color:#111;
}

.iconbtn{
  border:0;
  background:transparent;
  cursor:pointer;
  font-size:18px;
}

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:50;
}
.modal__card{
  width:min(560px, 100%);
  background:#fff;
  border-radius:16px;
  box-shadow:var(--shadow);
  overflow:hidden;
}
.modal__head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
}
.modal__body{ padding:14px 16px; display:grid; gap:12px; }
.modal__actions{
  padding:14px 16px;
  border-top:1px solid var(--border);
  display:flex;
  justify-content:flex-end;
}

.field{ display:grid; gap:6px; }
.field span{ font-size:13px; color:var(--muted); }
.field input{
  border:1px solid var(--border);
  padding:10px 12px;
  border-radius:10px;
  outline:none;
}
.field input:focus{ border-color:#cfcfcf; }

.hint{ font-size:12px; color:var(--muted); }
.error{ color:#b00020; font-size:13px; }
