:root{
  --bg: #f6f7f8;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: rgba(17,24,39,0.08);
  --shadow: 0 10px 30px rgba(17,24,39,0.06);
  --shadow2: 0 6px 16px rgba(17,24,39,0.06);
  --accent: #22c55e;         /* noteっぽいグリーン */
  --accent2: #16a34a;
  --ring: rgba(34,197,94,0.25);
  --code: #f3f4f6;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }
body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container{
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
}

.siteHeader{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(246,247,248,0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 14px 0;
}

.brandDot{
  width: 12px; height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px var(--ring);
}

.brandTitle{
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brandSub{
  font-size: 12px;
  color: var(--muted);
}

main{ padding: 18px 0 36px; }

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 16px;
  margin-top: 14px;
}

.cardHead{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 860px){
  .grid{ grid-template-columns: 1fr; }
}

.h2{
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.textarea{
  width: 100%;
  height: 170px;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 12px 12px;
  font-size: 14px;
  outline: none;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(17,24,39,0.03);
}
.textarea:focus{
  border-color: rgba(34,197,94,0.35);
  box-shadow: 0 0 0 6px var(--ring);
}

.row{
  display:flex;
  gap: 12px;
  align-items:center;
  flex-wrap: wrap;
  margin: 10px 0 12px;
}
.rowSlim{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

.btn{
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(17,24,39,0.03);
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow2); }
.btn:active{ transform: translateY(0px); }

.btn.primary{
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  border-color: rgba(0,0,0,0);
  color: #fff;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.7);
}

.seg{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.7);
}
.segLabel{ font-size: 12px; color: var(--muted); }
.segItem{ font-size: 13px; display:inline-flex; align-items:center; gap:6px; }

.kpi{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.kpi .pill b{ font-weight: 800; }

.muted{ color: var(--muted); font-size: 13px; }
.small{ font-size: 12px; }

.out{
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  padding: 12px;
  background: #fafafa;
  border: 1px solid var(--border);
}

/* Hints */
.hint{
  border: 1px solid rgba(17,24,39,0.08);
  background: #fbfbfb;
  border-radius: 14px;
  padding: 12px;
  margin: 10px 0;
}
.hint h4{
  margin: 0 0 8px;
  font-size: 14px;
}
.hint ul{ margin: 6px 0 0 18px; }
.hint code{
  background: var(--code);
  padding: 2px 6px;
  border-radius: 8px;
}

/* Highlights */
mark{
  padding: 0 2px;
  border-radius: 6px;
}
.hl-vague { background: #fff7cc; }
.hl-conj  { background: #dff5ff; }
.hl-repeat{ background: #e8e9ff; }
.hl-long  { background: #ffe3e6; }
.hl-style { background: #e4fbe9; }

.break{
  padding: 0 4px;
  border-radius: 8px;
  border: 1px dashed rgba(17,24,39,0.35);
  font-size: 12px;
  background: rgba(255,255,255,0.6);
}

/* Style list */
.styleList{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top: 10px;
}

.styleItem{
  border: 1px solid rgba(17,24,39,0.08);
  border-radius: 14px;
  padding: 12px;
  display:flex;
  gap: 12px;
  align-items:flex-start;
  background: #fff;
}

.styleItem .snip{ flex:1; min-width: 220px; }
.styleItem .actions{ display:flex; flex-direction:column; gap:8px; }

.badge{
  display:inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(17,24,39,0.08);
  font-size: 12px;
  white-space: nowrap;
  font-weight: 700;
}

.badge.polite{ background: #eef7ff; }
.badge.plain{ background: #fff5ee; }
.badge.unknown{ background: #f5f5f5; }
.badge.mixed{ background: #ffeef0; border-color: rgba(239,68,68,0.25); }

.focused{
  box-shadow: 0 0 0 6px rgba(34,197,94,0.18);
  border-color: rgba(34,197,94,0.22);
}

.conv{
  margin-top: 8px;
  border-top: 1px dashed rgba(17,24,39,0.12);
  padding-top: 8px;
  color: rgba(17,24,39,0.85);
  font-size: 13px;
}
.conv .from{ color: var(--muted); }
.conv .to{ font-weight: 800; }
.conv code{
  background: var(--code);
  padding: 2px 6px;
  border-radius: 8px;
}

.footer{
  margin-top: 18px;
  padding: 10px 0;
}
