:root{
  --bg:#0b1210;
  --panel:#111d19;
  --panel2:#0f1a16;
  --text:#e9f2ec;
  --muted:#b3c6bb;
  --line:rgba(233,242,236,.12);
  --accent:#7ae0a8;
  --accent2:#86b8ff;
  --danger:#ff6b6b;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --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;
  background:
    radial-gradient(1100px 700px at 20% -10%, rgba(122,224,168,.25), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(134,184,255,.18), transparent 52%),
    radial-gradient(800px 700px at 60% 100%, rgba(122,224,168,.12), transparent 50%),
    var(--bg);
  color:var(--text);
}
a{color:var(--accent2)}
.top{
  display:flex; gap:16px; justify-content:space-between; align-items:flex-start;
  padding:22px 22px 10px;
  max-width:1200px; margin:0 auto;
}
.brand{display:flex; gap:14px; align-items:center}
.brand__icon{width:52px;height:52px;filter: drop-shadow(0 10px 20px rgba(0,0,0,.35));}
.top h1{font-size:22px; margin:0 0 2px; letter-spacing:.2px}
.sub{margin:0; color:var(--muted); font-size:13px; max-width:62ch}
.top__actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end}

.grid{
  max-width:1200px; margin:0 auto; padding:12px 22px 40px;
  display:grid; gap:16px;
  grid-template-columns: repeat(12, 1fr);
}
.card{
  grid-column: span 6;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding:16px;
  overflow:hidden;
}
.card--wide{grid-column: 1 / -1;}
.card__head{display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px}
.card__head h2{margin:0; font-size:16px; letter-spacing:.2px}

.row{display:flex; align-items:center}
.gap{gap:10px}
.grow{flex:1}
.muted{color:var(--muted); font-size:13px}

.btn{
  appearance:none; border:none; cursor:pointer;
  background: linear-gradient(180deg, rgba(122,224,168,.95), rgba(90,190,140,.92));
  color:#062016;
  padding:10px 12px;
  border-radius: 14px;
  font-weight:700;
  letter-spacing:.2px;
  box-shadow: 0 10px 26px rgba(122,224,168,.18);
}
.btn:active{transform: translateY(1px)}
.btn--ghost{
  background: rgba(255,255,255,.06);
  color: var(--text);
  border:1px solid var(--line);
  box-shadow:none;
}
.btn--danger{background: rgba(255,107,107,.12); color: var(--text); border:1px solid rgba(255,107,107,.35); box-shadow:none}
.btn[disabled]{opacity:.5; cursor:not-allowed}

.select, select, input, textarea{
  width:100%;
  background: rgba(0,0,0,.18);
  color: var(--text);
  border:1px solid var(--line);
  border-radius: 14px;
  padding:10px 12px;
  outline:none;
}
textarea{resize: vertical}
label{display:flex; flex-direction:column; gap:6px; font-size:13px; color: var(--muted)}

.form{margin-top:10px}
.form__row{display:flex; gap:10px; margin:10px 0}

.shelfFilters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}
.shelfFilters > *{flex: 1 1 180px}
.shelfFilters > button{flex: 0 0 auto}

.details summary{cursor:pointer; color: var(--muted); font-weight:700}
.details{margin-top:12px}

.now{
  min-height:112px;
  border:1px dashed rgba(233,242,236,.22);
  background: rgba(0,0,0,.12);
  border-radius: 16px;
  padding:12px;
}
.now__title{font-weight:800; font-size:16px}
.now__meta{color:var(--muted); font-size:13px; margin-top:4px}
.now__chips{margin-top:10px; display:flex; flex-wrap:wrap; gap:8px}
.chip{font-size:12px; padding:6px 10px; border-radius:999px; border:1px solid var(--line); background: rgba(255,255,255,.05)}
.chip strong{color: var(--text)}

.prompt{
  margin-top:10px;
  padding:10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(122,224,168,.22);
  background: rgba(122,224,168,.07);
  color: #dff7ea;
  font-size:13px;
}

.timer{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px;
  background: rgba(0,0,0,.12);
  border:1px solid var(--line);
  border-radius: 16px;
}
.timer__face{min-width: 160px}
.timer__time{font-size:34px; font-weight:900; letter-spacing:.6px}
.timer__hint{color: var(--muted); font-size:12px; margin-top:4px}
.timer__actions{flex-wrap:wrap; justify-content:flex-end}

.stats{margin-top:12px; display:grid; grid-template-columns: repeat(3,1fr); gap:10px}
.stat{padding:10px 12px; border-radius:16px; border:1px solid var(--line); background: rgba(255,255,255,.04)}
.stat__k{color: var(--muted); font-size:12px}
.stat__v{font-size:18px; font-weight:900; margin-top:6px}

.goal{
  grid-column: 1 / -1;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(122,224,168,.22);
  background: rgba(122,224,168,.06);
}
.goal__head{display:flex; align-items:flex-start; justify-content:space-between; gap:12px}
.goal__k{color: var(--muted); font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em}
.goal__v{font-size:16px; font-weight:900; margin-top:4px}
.goal__hint{margin-top:6px; font-size:12px}
.goal__controls{margin-top:10px; display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.goal__controls > *{flex: 0 0 auto}
.goal__controls select{min-width: 170px}
.goal__controls input{max-width: 140px}

.sessions{margin-top:12px; display:flex; flex-direction:column; gap:8px}
.session{
  display:flex; justify-content:space-between; align-items:flex-start; gap:10px;
  padding:10px 12px; border-radius: 16px; border:1px solid var(--line); background: rgba(255,255,255,.03)
}
.session__meta{color: var(--muted); font-size:12px}
.session__title{font-weight:800}

.shelf{display:flex; flex-direction:column; gap:10px}
.book{
  display:flex; justify-content:space-between; gap:10px; align-items:flex-start;
  padding:12px;
  border-radius: 16px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.12);
}
.book__title{font-weight:900}
.book__meta{color: var(--muted); font-size:12px; margin-top:4px}
.book__notes{color: var(--muted); font-size:12px; margin-top:8px; white-space:pre-wrap}
.book__actions{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end}

.preview{display:flex; flex-direction:column; gap:10px}
canvas{
  width:100%;
  height:auto;
  border-radius: 18px;
  border:1px solid var(--line);
  background: radial-gradient(1200px 630px at 10% 10%, rgba(122,224,168,.10), transparent 55%), rgba(0,0,0,.22);
}

.foot{max-width:1200px; margin:0 auto; padding:0 22px 30px; color: var(--muted); font-size:12px}

/* ---- Modal (shortcuts) ---- */
.modal[hidden]{display:none}
.modal{position:fixed; inset:0; z-index:50}
.modal__overlay{position:absolute; inset:0; background: rgba(0,0,0,.55)}
.modal__panel{
  position:relative;
  width:min(720px, calc(100% - 28px));
  margin: 60px auto;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.modal__head{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.modal__head h2{margin:0; font-size:16px}
.kbdList{margin:10px 0 0; padding-left: 18px; line-height:1.55}
.kbdList kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.22);
}

@media (max-width: 980px){
  .card{grid-column: 1 / -1;}
  .top{flex-direction:column; align-items:stretch}
  .top__actions{justify-content:flex-start}
  .form__row{flex-direction:column}
  .stats{grid-template-columns:1fr}
  .modal__panel{margin: 18px auto}
}
