/* ===== TAL図形配置ツール [tal_kotei] ===== */

.tal-kotei { font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', sans-serif; }

.tal-kotei-header {
  background: #3AAFA9;
  color: #fff;
  text-align: center;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: bold;
  border-radius: 8px 8px 0 0;
}

.tal-kotei-question {
  background: #f0fafa;
  border-left: 4px solid #3AAFA9;
  margin: 14px 0;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.7;
  border-radius: 0 6px 6px 0;
}

/* 本体レイアウト */
.tal-kotei-body {
  display: flex;
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  min-height: 360px;
}

/* 左パレット */
.tal-kotei-palette {
  width: 110px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 2px dashed #ccc;
  padding: 10px 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-content: start;
}

.tal-kotei-shape {
  width: 30px;
  height: 30px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: opacity .15s, transform .15s;
}
.tal-kotei-shape:hover:not(.tal-kotei-shape--used) {
  transform: scale(1.12);
  background: rgba(58,175,169,.1);
}
.tal-kotei-shape--used { opacity: .2; cursor: not-allowed; pointer-events: none; }

/* 右キャンバス */
.tal-kotei-canvas {
  flex: 1;
  position: relative;
  background: #fff;
  min-height: 360px;
  overflow: hidden;
}
.tal-kotei-canvas--over { background: #edfaf9; }

.tal-kotei-bg-figure {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.tal-kotei-canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #b0c8c7;
  font-size: 12px;
  pointer-events: none;
  line-height: 2;
  z-index: 1;
}

/* フッター */
.tal-kotei-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 14px;
  flex-wrap: wrap;
}
.tal-kotei-count { font-size: 13px; color: #666; flex: 1; }
.tal-kotei-timer { font-size: 15px; font-weight: bold; color: #3AAFA9; letter-spacing: .05em; }
.tal-kotei-timer--warning { color: #e53935; animation: tal-kotei-pulse 1s infinite; }
@keyframes tal-kotei-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

.tal-kotei-submit {
  padding: 10px 24px;
  background: #3AAFA9;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: background .15s;
}
.tal-kotei-submit:hover { background: #2d9090; }
.tal-kotei-submit:disabled { background: #ccc; cursor: not-allowed; }

/* 結果エリア */
.tal-kotei-result { display: none; padding-top: 16px; }

.tal-kotei-type-reveal {
  font-size: 13px;
  color: #3AAFA9;
  font-weight: bold;
  margin-bottom: 12px;
  line-height: 1.6;
}

/* ===== 結果本体（ゲート解除後） ===== */
.tal-kotei-rb { padding-top: 4px; }

.tal-kotei-rb-eyebrow {
  font-size: 13px;
  font-weight: bold;
  color: #138F83;
  text-align: center;
  letter-spacing: .04em;
  margin: 0 0 12px;
}
.tal-kotei-rb-eyebrow--mt { margin-top: 24px; }

/* あなたの回答（回答画面のスナップショット） */
.tal-kotei-rb-answer {
  background: #f7f9f9;
  border: 1px solid #e3e8e7;
  border-radius: 14px;
  padding: 12px;
}
.tal-kotei-rb-snap {
  display: flex;
  justify-content: center;
}
.tal-kotei-rb-snapbox {
  position: relative;
  overflow: hidden;
}
.tal-kotei-canvas--snapshot {
  position: relative;
  pointer-events: none;
  background: #fff;
  border: 1px solid #d4ecea;
  border-radius: 8px;
}
.tal-kotei-canvas--snapshot .tal-kotei-placed { cursor: default !important; }
.tal-kotei-rb-answer-meta {
  font-size: 12.5px;
  color: #666;
  text-align: center;
  margin: 10px 0 0;
}

/* 総評 */
.tal-kotei-rb-verdict {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.75;
  border-radius: 12px;
  padding: 14px 16px;
}
.tal-kotei-rb-verdict--good { background: #E4F8F6; border: 1px solid #b8e8e3; color: #1f8a80; }
.tal-kotei-rb-verdict--mid  { background: #eef4fd; border: 1px solid #cdddf6; color: #3a63a8; }
.tal-kotei-rb-verdict--low  { background: #fff7ed; border: 1px solid #fad9ad; color: #c2740a; }
.tal-kotei-rb-verdict--bad  { background: #fdecec; border: 1px solid #f5c2c2; color: #d23b3b; }

/* 詳しい講評 */
.tal-kotei-rb-review { margin-top: 14px; }
.tal-kotei-rb-review p {
  font-size: 13.5px;
  color: #444;
  line-height: 1.9;
  margin: 0 0 12px;
}
.tal-kotei-rb-review p:last-child { margin-bottom: 0; }

/* 評価リスト（ul/li を使わずテーマの重複bulletを回避） */
.tal-kotei-rb-eval-list { margin: 0; padding: 0; }
.tal-kotei-rb-eval-item {
  position: relative;
  font-size: 13px;
  color: #444;
  line-height: 1.8;
  padding: 0 0 0 18px;
  margin-bottom: 9px;
}
.tal-kotei-rb-eval-item:last-child { margin-bottom: 0; }
.tal-kotei-rb-eval-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #26A69A;
}

.tal-kotei-rb-company {
  margin-top: 22px;
  border: 1px solid #e3e8e7;
  border-radius: 14px;
  overflow: hidden;
}
.tal-kotei-rb-company-head {
  background: #138F83;
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  padding: 11px 14px;
  letter-spacing: .03em;
}
.tal-kotei-rb-block {
  padding: 14px 16px;
  border-top: 1px solid #eef1f1;
}
.tal-kotei-rb-block:first-of-type { border-top: none; }
.tal-kotei-rb-block-label {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}
.tal-kotei-rb-block p {
  font-size: 13.5px;
  color: #444;
  line-height: 1.85;
  margin: 0;
}
.tal-kotei-rb-block--good .tal-kotei-rb-block-label    { background: #E4F8F6; color: #1f8a80; }
.tal-kotei-rb-block--caution .tal-kotei-rb-block-label { background: #fff3e0; color: #d97706; }
.tal-kotei-rb-block--tip .tal-kotei-rb-block-label     { background: #eef4fd; color: #4a7fd0; }

.tal-kotei-rb-ex {
  margin-top: 22px;
  border: 1px solid #e3e8e7;
  border-radius: 14px;
  overflow: hidden;
}
.tal-kotei-rb-ex-head {
  background: #f0fafa;
  color: #1f8a80;
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  padding: 11px 14px;
  border-bottom: 1px solid #e3e8e7;
}
.tal-kotei-rb-ex-body { padding: 16px; }
.tal-kotei-rb-ex-lead {
  font-size: 13.5px;
  color: #444;
  line-height: 1.85;
  margin: 0 0 14px;
}
.tal-kotei-rb-ex-item {
  margin: 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #eef1f1;
}
.tal-kotei-rb-ex-item:last-of-type { border-bottom: none; padding-bottom: 4px; }
.tal-kotei-rb-ex-figcap {
  font-size: 13.5px;
  color: #1f8a80;
  font-weight: bold;
  margin: 0 0 8px;
  line-height: 1.5;
}
.tal-kotei-rb-ex-img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 0 auto 10px;
  border: 1px solid #e3e8e7;
  border-radius: 8px;
}
.tal-kotei-rb-ex-desc {
  font-size: 13px;
  color: #444;
  line-height: 1.85;
  margin: 0;
}
.tal-kotei-rb-ex-foot {
  font-size: 13px;
  color: #444;
  line-height: 1.85;
  background: #f7f9f9;
  border-radius: 9px;
  padding: 12px 14px;
  margin: 14px 0 0;
}

.tal-kotei-rb-note {
  font-size: 11px;
  color: #999;
  line-height: 1.6;
  text-align: center;
  margin: 16px 4px 0;
}

/* ===== スマホ ===== */
@media (max-width: 540px) {
  .tal-kotei-body {
    flex-direction: column;
    min-height: unset;
  }
  .tal-kotei-canvas {
    order: 1;
    min-height: 260px;
    border-bottom: 2px dashed #ccc;
  }
  .tal-kotei-palette {
    order: 2;
    width: 100%;
    border-right: none;
    border-top: 2px dashed #ccc;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    padding: 10px 8px;
  }
  .tal-kotei-shape { width: 100%; aspect-ratio: 1; height: auto; }
}

/* ===== 結果ローディング（「結果を集計しています」くるくる）===== */
.tal-kotei-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 240px;
  padding: 48px 20px;
  text-align: center;
}
.tal-kotei-loader[hidden] { display: none; }
.tal-kotei-loader-spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid #e8f9f7;
  border-top-color: #3AAFA9;
  animation: tal-kotei-spin .8s linear infinite;
}
.tal-kotei-loader-text {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #138F83;
  letter-spacing: .04em;
}
@keyframes tal-kotei-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .tal-kotei-loader-spinner { animation-duration: 1.8s; }
}

