body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; margin: 0; background: #f6f7fb; color:#111; }

/* ===== Public (一般ユーザ) ===== */
.public-wrap { min-height: 100vh; display:flex; align-items:flex-start; justify-content:center; padding: 0; }
.public-container { width: 100%; max-width: 1200px; }
.card { background:#fff; border-radius: 12px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); margin: 10px 0; }

.field {
    margin: 14px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border: 1px solid #d8e2f3;
    /* border-left: 6px solid #2a62ff; */
    border-radius: 14px;
    /* background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%); */
    box-shadow: 0 1px 6px rgba(42, 98, 255, 0.06);
}

.field > label { font-size: 20px; font-weight: 800; line-height: 12px; }
.field + .field { margin-top: 18px; }
input, textarea, select, button { font-size: 16px; padding: 10px; border-radius: 10px; border: 1px solid #d6d9e3; }
button { cursor:pointer; border: none; background: #2a62ff; color: white; font-weight: 800; }
button:hover { opacity: .92; }
textarea { min-height: 100px; }
.muted { color:#666; }
.timer { margin: 10px 0; font-size: 18px; }
.qbox { line-height: 1.6; }
.notice { background:#fff7d6; padding: 10px; border-radius: 10px; }
.advice { margin-top: 10px; padding: 10px; background:#eef6ff; border-radius: 10px;font-size: 140%; font-weight: 700;  }
.chat { background:#fff; border-radius: 12px; padding: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 30px;}
.chat-log { height: 700px; overflow:auto; border:1px solid #e6e8f0; border-radius: 10px; padding: 10px; }
.line { margin: 6px 0; }
.system { color:#555; }
.warn { color:#b45309; }
.chat-input { display:flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; }
.chat-input textarea { flex: 1; width: calc(100% - 24px);height: 40px; min-height: 40px !important;}
.chat #send{ margin-top: 10px;}

#chat-log .line,
.line {
  white-space: pre-wrap;   /* 改行を反映 + 折り返し */
  word-break: break-word;  /* 長い文字列も崩れにくく */
}

.chat-log{
  background: #f2f3f5;
  padding: 12px;
}

/* 1メッセージ（縦に：名前 → 吹き出し） */
.chat-row{
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 10px 0;
}

/* 相手は左 / 自分は右 */
.chat-row.other{ align-items: flex-start; }
.chat-row.me{ align-items: flex-end; }

/* 吹き出しの外に表示する名前 */
.chat-name{
  font-size: 12px;
  color: #6b7280;               /* muted */
  padding: 0 6px;
}

/* 吹き出し */
.bubble{
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.06);
  background: #fff;
}

/* 自分はLINE風の淡いグリーン */
.chat-row.me .bubble{
  background: #e0fbf7;          /* 強烈じゃない薄い緑 */
  border-color: rgba(0,0,0,.05);
}

/* 相手は白（デフォ） */
.chat-row.other .bubble{
  background: #fff;
}

/* 本文：改行OK */
.body{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 15.5px;
  color: #111;
}

/* 自分/相手で名前の位置を少し内側に寄せる */
.chat-row.me .chat-name{ text-align: right; }
.chat-row.other .chat-name{ text-align: left; }

/* システム/警告は中央のピル */
.sys-row{
  display: flex;
  justify-content: center;
  margin: 10px 0;
}
.sys-pill{
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.08);
  background: rgba(255,255,255,.7);
  color: #374151;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
}
.sys-row.warn .sys-pill{
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

/* ===== 吹き出しのしっぽ ===== */

.bubble{
  position: relative; /* しっぽ配置の基準 */
}

/* 相手（左）しっぽ */
.chat-row.other .bubble::after{
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  width: 12px;
  height: 12px;
  background: #fff;                 /* 相手は白 */
  transform: rotate(45deg);
  border-left: 1px solid rgba(0,0,0,.06);
  border-bottom: 1px solid rgba(0,0,0,.06);
  border-bottom-left-radius: 2px;
}

/* 自分（右）しっぽ */
.chat-row.me .bubble::after{
  content: "";
  position: absolute;
  right: -6px;
  top: 12px;
  width: 12px;
  height: 12px;
  background: #e0fbf7;              /* 自分の薄い緑と同じ */
  transform: rotate(45deg);
  border-right: 1px solid rgba(0,0,0,.05);
  border-top: 1px solid rgba(0,0,0,.05);
  border-top-right-radius: 2px;
}

.dropout { margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { border-bottom: 1px solid #e6e8f0; padding: 8px; text-align: left; vertical-align: top; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.pre { background:#0b1020; color:#e6e8f0; padding: 10px; border-radius: 10px; overflow:auto; max-height: 320px; }

/* ===== Admin (管理) ===== */
.layout { display: grid; grid-template-columns: 280px 1fr; min-height: 100vh; }
.sidebar { background: #0b1020; color: #e6e8f0; padding: 16px; position: sticky; top: 0; height: 100vh; overflow:auto; }
.sidebar-brand { font-weight: 900; font-size: 18px; margin-bottom: 14px; }
.sidebar-brand-link { color: inherit; text-decoration: none; }
.sidebar-section { margin: 16px 0; }
.sidebar-title { font-size: 12px; letter-spacing: .08em; color: #9aa4bf; margin-bottom: 10px; text-transform: uppercase; }
.sidebar-link { display:block; padding: 10px 10px; border-radius: 10px; color: #e6e8f0; text-decoration:none; margin: 6px 0; background: rgba(255,255,255,.04); }
.sidebar-link:hover { background: rgba(255,255,255,.08); }
.sidebar-footer { margin-top: 24px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-muted { font-size: 12px; color: #9aa4bf; }

.content { padding: 18px 22px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-bottom: 12px; }
.topbar-title { font-weight: 900; font-size: 18px; }
.topbar-link { color:#2a62ff; text-decoration:none; font-weight:800; }
.topbar-link:hover { text-decoration: underline; }
.content-inner { max-width: 1400px; }


/* ===== Form Preview Enhancements ===== */
.req { color:#dc2626; font-weight:700; }
.scale-value { color:#111; }
.radio-group { display:flex; flex-wrap:wrap; gap:10px; margin-top:6px; }
.radio-option { display:flex; align-items:center; gap:6px; padding:6px 10px; border:1px solid #e5e7eb; border-radius:10px; background:#fff; }
.radio-option input { margin:0; }


/* ===== Range Slider ===== */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: #dbe3f3;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2a62ff;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 6px rgba(0,0,0,.18);
  margin-top: -7px;
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: #dbe3f3;
}

input[type="range"]::-moz-range-progress {
  height: 10px;
  border-radius: 999px;
  background: #2a62ff;
}

input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2a62ff;
  border: 3px solid #ffffff;
  box-shadow: 0 1px 6px rgba(0,0,0,.18);
  cursor: pointer;
}

.scale-wrap {
  margin-top: 6px;
}

.scale-top-labels {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  font-size: 18px;
  color: #334155;
  line-height: 1.45;
  margin-bottom: 6px;
  font-weight: 700;
}

.scale-top-label {
  min-height: 1.2em;
  max-width: 48%;
}

.scale-top-label-left {
  text-align: left;
}

.scale-top-label-right {
  text-align: right;
  margin-left: auto;
}

.scale-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.scale-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 180px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #eef4ff;
  color: #1741b6;
  font-weight: 800;
  font-size: 18px;
  line-height: 1;
  text-align: center;
}

.scale-current-label {
  font-size: 20px;
  font-weight: 700;
  color: #4b5563;
}

.scale-value {
  color:#111;
  font-weight: 800;
  font-size: 1.05em;
}

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 20px;
  color: #4b5563;
  font-weight: 700;
}
.info {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    background: #fff7d6;
    padding: 10px;
    border-radius: 10px;
}