/* TaskPad - minimal, responsive, vanilla CSS */
:root{
  --bg:#f6f8ff;
  --panel:#ffffff;
  --panel2:#f3f6ff;
  --text:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.12);
  --primary:#2563eb;
  --danger:#ef4444;
  --amber:#f59e0b;
  --ok:#16a34a;

  --radius:14px;
  --shadow: 0 10px 26px rgba(15,23,42,.10);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--font);
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(37,99,235,.18), transparent 60%),
    radial-gradient(900px 450px at 100% 0%, rgba(245,158,11,.14), transparent 55%),
    radial-gradient(700px 420px at 40% 110%, rgba(22,163,74,.10), transparent 60%),
    var(--bg);
}
#app{min-height:100%; display:flex; flex-direction:column}

.topbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  background: rgba(246,248,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand__title{font-weight:800; letter-spacing:.3px}
.brand__sub{font-size:12px; color:var(--muted); margin-top:2px}

.topbar__actions{display:flex; gap:10px; align-items:center; flex-wrap:nowrap; min-width:0}
.search{
  width:min(38vw, 460px);
  flex: 1 1 240px;
  min-width: 160px;
  background: rgba(255,255,255,.95);
  border: 1px solid var(--line);
  color: var(--text);
  padding:10px 12px;
  border-radius: 999px;
  outline:none;
}
.search::placeholder{color:rgba(71,85,105,.65)}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--line);
  background: rgba(15,23,42,.03);
  color: var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  white-space: nowrap;
}
.btn:hover{filter:brightness(1.1)}
.btn--primary{
  border-color: rgba(37,99,235,.35);
  background: rgba(37,99,235,.12);
}
.btn--ghost{background:transparent}
.btn--danger{
  border-color: rgba(239,68,68,.30);
  background: rgba(239,68,68,.10);
}

.layout{
  flex:1;
  display:grid;
  grid-template-columns: 220px minmax(0,1fr) 360px;
  gap: 12px;
  padding: 12px;
}

.sidebar{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
  padding: 10px;
  height: calc(100vh - 92px);
  position: sticky;
  top: 76px;
  overflow:auto;
}
.navbtn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 12px 12px;
  margin: 6px 0;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor:pointer;
  text-align:left;
}
.navbtn:hover{background: rgba(255,255,255,.05)}
.navbtn.is-active{
  background: rgba(37,99,235,.10);
  border-color: rgba(37,99,235,.25);
}
.badge{
  font-size:12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid var(--line);
  color: var(--muted);
}
.sidebar__hint{
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.hintline{display:flex; align-items:center; gap:8px; margin: 6px 0}
.dot{width:10px; height:10px; border-radius:999px; display:inline-block}
.dot--red{background: var(--danger)}
.dot--amber{background: var(--amber)}

.main{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.70);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.alerts{padding: 12px; border-bottom: 1px solid var(--line)}
.alertrow{display:flex; flex-wrap:wrap; gap:10px}
.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
  cursor:pointer;
}
.pill--danger{border-color: rgba(239,68,68,.30); background: rgba(239,68,68,.10)}
.pill--amber{border-color: rgba(245,158,11,.30); background: rgba(245,158,11,.10)}
.pill__count{font-weight:700}

.list{padding: 12px}
.section{margin: 10px 0 18px}
.section__head{
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 8px;
}
.section__title{font-weight:800}
.section__meta{color: var(--muted); font-size:12px}

.item{
  display:grid;
  grid-template-columns: 18px minmax(0,1fr) auto;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15,23,42,.03);
  margin: 8px 0;
  cursor:pointer;
}
.item:hover{filter:brightness(1.08)}
.item.is-done{opacity:.55}
.item__title{font-weight:700}
.item__sub{color: var(--muted); font-size:12px; margin-top:4px; display:flex; gap:10px; flex-wrap:wrap}
.tag{
  border:1px solid var(--line);
  background: rgba(15,23,42,.03);
  padding: 1px 8px;
  border-radius:999px;
}
.tag--danger{border-color: rgba(239,68,68,.30)}
.tag--amber{border-color: rgba(245,158,11,.30)}
.tag--ok{border-color: rgba(55,214,122,.35)}
.chk{
  width:18px; height:18px;
  border-radius:6px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
}
.chk.is-on{background: rgba(22,163,74,.14); border-color: rgba(22,163,74,.30)}
.item__right{display:flex; gap:6px; align-items:center}

.smallbtn{
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
  color: var(--text);
  cursor:pointer;
  font-size: 12px;
}
.smallbtn:hover{filter:brightness(1.12)}

.detail{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
  height: calc(100vh - 92px);
  position: sticky;
  top: 76px;
  overflow:auto;
  padding: 14px;
}
.detail__empty{color: var(--muted); padding: 14px}
.field{margin: 10px 0}
.label{font-size:12px; color: var(--muted); margin-bottom:6px}
.input, .select, .textarea{
  width:100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.90);
  color: var(--text);
  padding: 10px 12px;
  outline:none;
}
.textarea{min-height:120px; resize:vertical}
.row{display:flex; gap:10px}
.row > *{flex:1}
.actions{display:flex; flex-wrap:wrap; gap:8px; margin-top: 10px}
.sep{height:1px; background: var(--line); margin: 14px 0}

.bottomnav{
  display:none;
  position: sticky;
  bottom:0;
  z-index:30;
  border-top: 1px solid var(--line);
  background: rgba(246,248,255,.90);
  backdrop-filter: blur(10px);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab{
  flex:1;
  border:1px solid var(--line);
  background: rgba(15,23,42,.03);
  color: var(--text);
  border-radius: 14px;
  padding: 10px 0;
  cursor:pointer;
}
.tab.is-active{border-color: rgba(37,99,235,.35); background: rgba(37,99,235,.12)}
.tab--plus{font-weight:900}

.sheet[hidden]{display:none}
.sheet{
  position:fixed; inset:0;
  z-index:40;
}
.sheet__backdrop{
  position:absolute; inset:0;
  background: rgba(0,0,0,.55);
}
.sheet__panel{
  position:absolute; left:0; right:0; bottom:0;
  border-radius: 18px 18px 0 0;
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: 85vh;
  overflow:auto;
}
.sheet__handle{
  width: 44px; height: 5px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  margin: 10px auto 0;
}
.sheet__content{padding: 10px 14px 18px}

/* Responsive */
@media (max-width: 1020px){
  .layout{grid-template-columns: 220px minmax(0,1fr); }
  .detail{display:none;}
}
@media (max-width: 760px){
  .layout{grid-template-columns: 1fr; padding: 10px;}
  .sidebar{display:none;}
  .search{display:none;}
  .detail{display:none;}
  .bottomnav{display:flex;}
  .topbar{padding-bottom: 10px}
}


.radio{
  display:flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.90);
  border-radius: 999px;
  cursor:pointer;
  user-select:none;
  color: var(--text);
  font-size: 13px;
}
.radio input{ accent-color: var(--primary); }


.select--inline{
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.95);
  min-width: 160px;
  flex: 0 1 220px;
}
.select--sort{ min-width: 160px; }
@media (max-width: 760px){
  .select--inline{ display:none; }
}

.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: rgba(15,23,42,.03);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
}
.chip button{
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
  color: var(--muted);
}
.smallbtn--icon{
  width: 34px;
  justify-content:center;
}

#newBtn{min-width:92px;}

.bottomnav .tab{flex:0 0 auto; min-width:86px}


.sitefooter{
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(8px);
  padding: 14px 12px;
  margin-top: 10px;
}
.sitefooter__inner{
  max-width: 1100px;
  margin: 0 auto;
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}
.sitefooter a{
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dashed rgba(15,23,42,.18);
}
.sitefooter a:hover{ color: var(--text); border-bottom-color: rgba(15,23,42,.35); }
.sitefooter .sep{ opacity: .6; }


.prose{
  color: var(--text);
  line-height: 1.7;
  font-size: 15px;
}
.prose h2{
  margin: 18px 0 8px;
  font-size: 18px;
}
.prose h3{
  margin: 14px 0 6px;
  font-size: 16px;
}
.prose ul{ padding-left: 1.2em; }
.prose li{ margin: 6px 0; }
.prose code{
  background: rgba(15,23,42,.05);
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 0.95em;
}
