:root{
  --bg:#0b1220;
  --text:#e8eefc;
  --muted:rgba(232,238,252,.72);
  --line:rgba(232,238,252,.14);
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --paper:#e7d8b6; /* 中性紙っぽい黄ばみ */
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Meiryo", sans-serif;
  background: radial-gradient(1200px 600px at 20% 0%, rgba(88,101,242,.16), transparent 60%),
              radial-gradient(900px 500px at 80% 10%, rgba(167,243,208,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

.wrap{max-width:1100px; margin:0 auto; padding:0 14px;}

.topbar{
  position:sticky; top:0; z-index:10;
  background:rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-inner{display:flex; align-items:center; justify-content:space-between; padding:12px 0;}
.brand-title{font-weight:900; letter-spacing:.02em}
.brand-sub{color:var(--muted); font-size:12px; margin-top:2px}

.topbar-right{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.stat{
  border:1px solid var(--line);
  border-radius:14px;
  padding:8px 10px;
  background:rgba(255,255,255,.03);
  min-width:90px;
}
.stat-label{font-size:11px; color:var(--muted)}
.stat-value{font-size:18px; font-weight:900}

.panel{
  margin-top:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(255,255,255,.03);
  padding:12px;
  box-shadow:var(--shadow);
}

.grid2{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
@media (max-width: 840px){ .grid2{grid-template-columns:1fr} }

.row{display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px;}
.row-tight{margin-top:8px}
.spacer{flex:1}

.label{display:block; font-weight:800; font-size:13px; margin:0 0 6px 0; color:rgba(232,238,252,.86)}
.micro{font-size:12px; color:var(--muted); line-height:1.5}

.select, .textarea, .input{
  width:100%;
  border-radius:14px;
  border:1px solid var(--line);
  background:rgba(0,0,0,.12);
  color:var(--text);
  padding:10px 12px;
  font-size:15px;
  outline:none;
}
.textarea{resize:vertical; min-height:120px}
.select{padding-right:34px}
.select:focus,.textarea:focus,.input:focus{
  border-color:rgba(167,243,208,.6);
  box-shadow:0 0 0 4px rgba(167,243,208,.12);
}

.btn{
  border:1px solid rgba(167,243,208,.35);
  background:rgba(167,243,208,.12);
  color:var(--text);
  padding:10px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
}
.btn:hover{filter:brightness(1.05)}
.btn:active{transform:translateY(1px)}
.btn.ghost{
  border-color:var(--line);
  background:rgba(255,255,255,.03);
}
.btn.small{padding:8px 10px; font-size:13px; border-radius:12px}

.chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  font-size:13px;
  color:rgba(232,238,252,.88);
  user-select:none;
}
.chip input{accent-color:#a7f3d0}

/* ads */
.adbox{
  margin-top:14px;
  border:1px dashed rgba(232,238,252,.18);
  border-radius:18px;
  padding:14px;
  background:rgba(255,255,255,.02);
  text-align:center;
}

/* report / preview */
.report-head{display:flex; align-items:flex-end; justify-content:space-between; gap:10px; flex-wrap:wrap}
.report-title{font-weight:900; font-size:18px}

.warnbox{
  margin-top:10px;
  border:1px solid rgba(255,211,122,.35);
  background:rgba(255,211,122,.10);
  border-radius:16px;
  padding:10px 12px;
  color:#ffe4ad;
  white-space:pre-wrap;
  line-height:1.6;
}

.previewWrap{
  margin-top:10px;
  border:1px solid var(--line);
  border-radius:18px;
  background:rgba(0,0,0,.10);
  padding:12px;
}

/* “中性紙”プレビュー */
.preview{
  border-radius:16px;
  padding:16px;
  background: linear-gradient(180deg, rgba(231,216,182,.92), rgba(231,216,182,.84));
  color:#1e1b16;
  line-height:1.9;
  font-size:16px;
  overflow:auto;
  max-height:520px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

/* ruby */
.preview ruby{ruby-position: over;}
.preview rt{font-size: .55em; letter-spacing: .08em;}

/* vertical */
.preview.vertical{
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1.7;
  letter-spacing: .02em;
  max-height:560px;
}

/* tcy: 縦中横 */
.preview .tcy{
  text-combine-upright: all;
  -webkit-text-combine: horizontal;
  writing-mode: horizontal-tb;
  display:inline-block;
  padding:0 .05em;
}

/* ruby dict */
.dictHead{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.dictTitle{font-weight:900}
.dictActions{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

.dictGrid{
  margin-top:10px;
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:10px;
}
@media (max-width: 760px){
  .dictGrid{grid-template-columns:1fr}
  .dictGrid .addbtn .btn{width:100%}
}

.field{display:flex; flex-direction:column; gap:6px}

.dictList{margin-top:10px;display:flex;flex-direction:column;gap:8px}
.dictItem{
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(0,0,0,.12);
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.dictText{color:var(--muted);font-size:13px;line-height:1.6;word-break:break-word}
.dictText strong{color:var(--text)}
.dictBtns{display:flex;gap:10px;flex-wrap:wrap}

/* footer */
.footer{
  margin-top:20px;
  border-top:1px solid var(--line);
  background:rgba(11,18,32,.72);
  backdrop-filter: blur(10px);
}
.footer-inner{
  padding:14px 0;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px; flex-wrap:wrap;
}
.footer-links{display:flex; gap:12px; flex-wrap:wrap}
.link{color:rgba(232,238,252,.86); text-decoration:none}
.link:hover{text-decoration:underline}
