:root{
  --bg:#0f1216;
  --card:#141a20;
  --card2:#10161c;
  --line:rgba(255,255,255,.09);
  --text:rgba(255,255,255,.90);
  --muted:rgba(255,255,255,.60);
  --muted2:rgba(255,255,255,.45);
  --accent:#ffffff;
  --danger:#ff6b6b;
  --radius:14px;
  --hbtn:44px;
  --pad:14px;
  --max:980px;
  --shadow:0 10px 40px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Helvetica Neue",Helvetica,Arial,"Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
  background:linear-gradient(180deg,#0b0e12, var(--bg) 28%, #0b0e12);
  color:var(--text);
  overflow-x:hidden;
  -webkit-tap-highlight-color: transparent;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  padding:16px 14px;
  background:rgba(15,18,22,.86);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
}

.brand__title{
  font-size:18px;
  font-weight:700;
  letter-spacing:.2px;
}
.brand__sub{
  margin-top:2px;
  font-size:12px;
  color:var(--muted);
}

.topbar__actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.main{
  max-width:var(--max);
  margin:0 auto;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.card{
  background:rgba(20,26,32,.92);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
}

.inputCard{padding:var(--pad)}
.row{display:flex; gap:10px; align-items:center}
.row--meta{margin-top:12px; justify-content:space-between; flex-wrap:wrap; gap:10px}
.input{
  width:100%;
  height:var(--hbtn);
  padding:0 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
  font-size:14px;
}
.input::placeholder{color:rgba(255,255,255,.38)}
.input:focus{border-color:rgba(255,255,255,.18)}

.btn{
  height:var(--hbtn);
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.20);
  color:var(--text);
  font-size:14px;
  cursor:pointer;
  user-select:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:active{transform: translateY(1px)}
.btn--primary{
  background:rgba(255,255,255,.92);
  color:#0c1014;
  border-color:rgba(255,255,255,.12);
}
.btn--ghost{
  background:transparent;
}
.btn--small{
  height:36px;
  border-radius:10px;
  padding:0 12px;
  font-size:13px;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  background:rgba(0,0,0,.25);
  border:1px solid rgba(0,0,0,.12);
  font-size:12px;
  font-weight:700;
}

.check{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  color:var(--muted);
}
.check input{transform: scale(1.05)}
.status{
  margin-top:10px;
  font-size:12px;
  color:var(--muted2);
  min-height:16px;
}

.readerCard{padding:0}
.readerHead{
  padding:14px 14px 10px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(0,0,0,.10), transparent);
  border-top-left-radius:var(--radius);
  border-top-right-radius:var(--radius);
}
.readerTitle{
  font-size:17px;
  font-weight:700;
  letter-spacing:.2px;
}
.readerMeta{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

.reader{
  padding:14px;
  font-size:clamp(17px, 1.8vw, 20px);
  line-height:1.8;
  color:rgba(255,255,255,.88);
  white-space: pre-wrap;
  word-break: break-word;
}
.reader:focus{outline:none}
.reader .w{
  border-radius:6px;
  padding:0 2px;
  cursor:pointer;
}
.reader .w:active{
  background:rgba(255,255,255,.10);
}
.reader .w.is-hit{
  background:rgba(255,255,255,.12);
}

.phraseBar{
  position:fixed;
  left:0; right:0;
  bottom:0;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));
  background:rgba(15,18,22,.92);
  backdrop-filter: blur(10px);
  border-top:1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  z-index:50;
}
.phraseBar__text{
  font-size:14px;
  color:var(--muted);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:55%;
}

.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:60;
}

.drawer{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:0;
  width:min(var(--max), 100%);
  max-height:78vh;
  background:rgba(20,26,32,.96);
  border:1px solid var(--line);
  border-bottom:none;
  border-top-left-radius:18px;
  border-top-right-radius:18px;
  box-shadow: var(--shadow);
  z-index:70;
  display:flex;
  flex-direction:column;
}
.drawer__head{
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.drawer__title{font-size:16px; font-weight:700}
.drawer__tools{
  padding:10px 14px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  border-bottom:1px solid var(--line);
  flex-wrap:wrap;
}
.drawer__bulk{display:flex; gap:8px; flex-wrap:wrap}

.seg{
  display:inline-flex;
  border:1px solid var(--line);
  border-radius:12px;
  overflow:hidden;
}
.seg__btn{
  height:36px;
  padding:0 12px;
  background:transparent;
  color:var(--muted);
  border:none;
  cursor:pointer;
  font-size:13px;
}
.seg__btn.is-active{
  background:rgba(255,255,255,.10);
  color:var(--text);
}

.pocketList{
  padding:10px 14px;
  overflow:auto;
}
.item{
  padding:10px 10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(0,0,0,.18);
  margin-bottom:10px;
}
.item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.item__text{
  font-size:16px;
  font-weight:600;
  line-height:1.5;
  word-break:break-word;
}
.item__meta{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.item__actions{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.06);
  font-size:12px;
  color:var(--muted);
}
.pill.is-sent{opacity:.75}
.drawer__foot{
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top:1px solid var(--line);
}
.hint{
  font-size:12px;
  color:var(--muted2);
}

.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
  z-index:90;
  background:rgba(0,0,0,.45);
}
.modal__panel{
  width:min(var(--max), 100%);
  max-height:80vh;
  background:rgba(20,26,32,.96);
  border:1px solid var(--line);
  border-radius:18px;
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.modal__head{
  padding:12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.modal__title{font-size:15px; font-weight:700}
.historyList{
  padding:10px 14px;
  overflow:auto;
}
.hrow{
  padding:12px 10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(0,0,0,.18);
  margin-bottom:10px;
}
.hrow__title{font-size:13px; font-weight:700; line-height:1.35}
.hrow__url{margin-top:6px; font-size:12px; color:var(--muted); word-break:break-all}
.hrow__meta{margin-top:6px; font-size:12px; color:var(--muted2)}
.modal__foot{
  padding:10px 14px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:flex-end;
}

.toast{
  position:fixed;
  left:50%;
  transform:translateX(-50%);
  bottom:18px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(15,18,22,.92);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index:120;
  font-size:13px;
  color:var(--text);
  max-width:min(520px, calc(100% - 28px));
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.hidden{display:none}

@media (max-width:520px){
  .topbar{align-items:flex-start}
  .topbar__actions{align-items:flex-start}
  .phraseBar__text{max-width:48%}
}
