:root{
  --bg: #121212;
  --card: #1c1c1c;
  --border: #2a2a2a;
  --ink: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --shadow: 0 18px 50px rgba(0,0,0,0.45);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--ink);
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
}

.wrap{ max-width: 980px; margin: 0 auto; padding: 22px 16px 40px; }

.head{ display:flex; align-items:flex-end; justify-content:space-between; gap:16px; margin-bottom: 14px; }
h1{ margin:0; font-size: 22px; letter-spacing: 0.02em; }
.sub{ margin:6px 0 0; color:var(--muted); font-size: 13px; }

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  margin-top: 12px;
}

.label{ font-size: 13px; color: var(--muted); margin-bottom: 8px; }

textarea{
  width:100%;
  min-height: 220px;
  resize: vertical;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 12px;
  color: var(--ink);
  line-height: 1.55;
  outline: none;
}
textarea:focus{
  border-color: rgba(120,180,255,0.55);
  box-shadow: 0 0 0 3px rgba(120,180,255,0.15);
}

.controls{ display:flex; flex-wrap: wrap; align-items:center; gap:10px; margin-top: 10px; }
.spacer{ flex: 1; }

.btn{
  appearance:none;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}
.btn:hover{ background: rgba(255,255,255,0.10); }
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity: .5; cursor:not-allowed; }

.btn.primary{
  border-color: rgba(120,180,255,0.35);
  background: rgba(120,180,255,0.18);
}
.btn.primary:hover{ background: rgba(120,180,255,0.24); }

.btn.mini{ padding: 7px 10px; border-radius: 10px; font-weight: 700; }

.btn.danger{
  border-color: rgba(255,120,120,0.28);
  background: rgba(255,120,120,0.12);
}
.btn.danger:hover{ background: rgba(255,120,120,0.18); }

.check{ display:flex; align-items:center; gap:8px; color: var(--muted); font-size: 13px; user-select:none; }
.check input{ transform: translateY(1px); }

.hint{ margin-top: 10px; color: var(--muted); font-size: 12px; }

.outHead{ display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom: 10px; }
.stats{ margin-top: 4px; color: var(--muted); font-size: 12px; }
.outActions{ display:flex; gap:10px; flex-wrap: wrap; align-items:center; }

.sortBox{ display:flex; gap:10px; align-items:center; }

.select{
  border: 1px solid var(--border);
  background: #161616;
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
  outline:none;
  font-weight: 700;
}
.select.small{ padding: 9px 10px; border-radius: 12px; }

.select:focus{
  border-color: rgba(120,180,255,0.55);
  box-shadow: 0 0 0 3px rgba(120,180,255,0.15);
}

/* ✅ ドロップダウン内もダークに */
.select option{
  color: #e6e6e6;
  background: #121212;
}


.output{ display:flex; flex-direction: column; gap: 8px; }

.row{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;

  background: #171717;
  border: 1px solid var(--border);

  cursor: pointer;        /* ✅ クリックできる */
  user-select: none;      /* ✅ ドラッグ選択されない */

  transition:
    transform .06s ease,
    background .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;
}

.row:hover{
  background: #1b1b1b;
  border-color: #343434;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.row:active{
  transform: translateY(1px) scale(0.995); /* ✅ 押し込み */
}

.row:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(120,180,255,0.20);
  border-color: rgba(120,180,255,0.45);
}

.name{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.name-text{
  font-weight: 650;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.count-badge{
  display: none;               /* 通常は非表示 */
  padding: 4px 10px;
  border-radius: 999px;        /* 丸い枠 */
  border: 1px solid #3a3a3a;
  background: #141414;
  color: rgba(255,255,255,0.80);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.count-badge.show{
  display: inline-flex;        /* x2以上のときだけ表示 */
  align-items: center;
}

.meta{ color: var(--muted); font-size: 12px; min-width: 54px; text-align: right; }
.rowActions{ display:flex; gap: 8px; align-items:center; }

.foot{ margin-top: 14px; color: var(--muted); font-size: 12px; text-align:center; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  max-width: min(92vw, 720px);
  text-align: center;
}
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(-4px); }

.monitorHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
}
.monitorControls{
  display:flex;
  flex-wrap: wrap;
  align-items:center;
  gap:10px;
}
.status{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.status::before{
  content:"";
  width:8px; height:8px; border-radius:999px;
  background: rgba(255,255,255,0.35);
}
.status.live{ color: rgba(180,255,220,0.9); border-color: rgba(180,255,220,0.25); background: rgba(180,255,220,0.10); }
.status.live::before{ background: rgba(180,255,220,0.9); }
.status.err{ color: rgba(255,170,170,0.95); border-color: rgba(255,170,170,0.25); background: rgba(255,170,170,0.10); }
.status.err::before{ background: rgba(255,170,170,0.95); }

.muted{ color: var(--muted); }
