/* ============================================================
   CSSで矢印や「＞」を作るんだコジロー — style.css
   デザインはナズナ（CSSクリップパスMakerナズナ）に準拠
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #FDF4EA;
  --surface:      #FFFFFF;
  --surface2:     #F5EAD8;
  --border:       rgba(73,167,206,0.15);
  --border2:      rgba(73,167,206,0.30);
  --text:         #2C2C2C;
  --muted:        #7A7A7A;
  --accent:       #49A7CE;
  --accent-dark:  #3388AD;
  --accent-light: rgba(73,167,206,0.10);
  --accent-glow:  rgba(73,167,206,0.20);
  --success:      #2DA870;
  --warning:      #D48A10;
  --danger:       #D64545;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.7;
}

/* ── ヘッダー ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo-link { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.logo-img { width: 38px; height: 38px; border-radius: var(--radius-sm); display: block; }
.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.logo-text small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  letter-spacing: 0;
}
.header-free-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}
.header-spacer { flex: 1; }

.header-usage-count {
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  white-space: nowrap;
}

.header-usage-count strong {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--accent-dark);
}

/* ── ヒーロー ── */
.hero {
  background: linear-gradient(135deg, #FDF4EA 0%, #FEF1DA 50%, #FDF4EA 100%);
  border-bottom: 2px solid rgba(73,167,206,0.15);
  overflow: hidden;
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.8rem 2rem 0;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
}
.hero-text { flex: 1; padding-bottom: 2.5rem; }
.hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-lead { font-size: 0.92rem; color: var(--muted); line-height: 1.8; max-width: 560px; margin-bottom: 1.4rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.hero-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--border2);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
}
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: #AAAAAA; flex-shrink: 0; }
.hero-chara { flex-shrink: 0; width: 300px; height: 300px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.hero-chara img { width: 300px; height: 300px; object-fit: contain; object-position: bottom; display: block; }

/* ── ツール本体ラッパー ── */
.tool-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
}
.tool-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tool-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── ツールカード ── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
}

/* ── タイプ選択エリア ── */
.type-select-area {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
}
.type-tabs-horizontal {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 0.75rem;
}
.type-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  width: 100%;
  color: var(--text);
}
.type-tab:hover { border-color: var(--accent); background: var(--accent-light); }
.type-tab.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent-dark); }
.type-tab-preview {
  width: 40px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.type-tab.active .type-tab-preview { color: var(--accent-dark); }
.type-tab-preview svg { overflow: visible; }
.type-tab-label { font-size: 0.78rem; font-weight: 500; }
.type-tab.active .type-tab-label { color: var(--accent-dark); }

/* ── 2カラムレイアウト ── */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.75rem;
  align-items: start;
}

/* ── 左：エディタカラム ── */
.editor-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* プレビューエリア */
.preview-wrap {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.preview-area {
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  /* 市松模様（透過柄） */
  background-color: #e0e0e0;
  background-image:
    linear-gradient(45deg, #c8c8c8 25%, transparent 25%),
    linear-gradient(-45deg, #c8c8c8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c8c8c8 75%),
    linear-gradient(-45deg, transparent 75%, #c8c8c8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  padding: 40px;
}
.preview-area.bg-white { background: #fff; background-image: none; }
.preview-area.bg-dark  { background: #1E2433; background-image: none; }

.preview-bg-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.bg-btn {
  padding: 3px 9px;
  border: none;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
  font-family: 'Noto Sans JP', sans-serif;
}
.bg-btn.active { background: var(--accent); color: #fff; }

#arrow-preview { transition: all 0.1s; }

/* Undo / Redo ボタン */
.undo-redo-btns {
  position: absolute;
  bottom: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
}
.undo-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.78rem;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  white-space: nowrap;
}
.undo-btn:hover:not(:disabled) { background: var(--accent-light); border-color: var(--accent); color: var(--accent-dark); }
.undo-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* CSSコードパネル */
.code-panel {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border2);
}
.code-panel-header {
  background: #12122a;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.code-dots { display: flex; gap: 5px; }
.code-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.code-label { font-size: 0.75rem; color: #888; font-family: 'Outfit', sans-serif; }
.code-display {
  background: #1a1a2e;
  padding: 1rem 1.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  color: #ffd9a0;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 54px;
  margin: 0;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #ccc;
  font-size: 0.75rem;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.copy-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* ── 右：サイドバー ── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 20px;
}
.sidebar-section {
  padding: 1rem 1.25rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 0.75rem;
}
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-label {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  margin-bottom: 0.85rem;
  display: inline-block;
}

/* 向きボタン */
.dir-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
.dir-btn {
  aspect-ratio: 1;
  border: 1.5px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
  color: var(--muted);
}
.dir-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.dir-btn.active { border-color: var(--accent); background: var(--accent); color: #fff; }

/* スライダー行 */
.ctrl-row-group { display: flex; flex-direction: column; gap: 0.55rem; }
.ctrl-row { display: flex; align-items: center; gap: 8px; }
.ctrl-label-s {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 62px;
  flex-shrink: 0;
  font-family: 'Noto Sans JP', sans-serif;
}
.ctrl-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  cursor: pointer;
  -webkit-appearance: none;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
}
.ctrl-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* 数値入力欄 */
.slider-num {
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.4rem;
  width: 52px;
  text-align: right;
  outline: none;
  flex-shrink: 0;
  -moz-appearance: textfield;
}
.slider-num:focus { border-color: var(--accent); }
.slider-num::-webkit-inner-spin-button,
.slider-num::-webkit-outer-spin-button { opacity: 1; cursor: pointer; }

/* カラーピッカー */
.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border2);
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.color-swatch input[type="color"] {
  width: 100%;
  height: 100%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: none;
}
.color-hex {
  font-family: 'Outfit', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  width: 88px;
  outline: none;
  flex-shrink: 0;
}
.color-hex:focus { border-color: var(--accent); }

/* ══ コンテンツセクション ══ */
.content-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}
.section-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-heading::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1.2em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-lead { color: var(--muted); font-size: 0.875rem; margin-bottom: 1.75rem; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  transition: box-shadow 0.15s;
}
.feature-card:hover { box-shadow: 0 4px 16px rgba(73,167,206,0.10); }
.feature-icon { font-size: 1.5rem; margin-bottom: 0.6rem; }
.feature-title { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.feature-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.65; }

.usecase-list { display: flex; flex-direction: column; gap: 1rem; }
.usecase-item {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.usecase-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  margin-top: 1px;
}
.usecase-item h3 { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.usecase-item p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin: 0; }

/* ══ レスポンシブ ══ */
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.4rem; }
  .hero-chara { display: none; }
  .features-grid { grid-template-columns: 1fr; }
  .tool-section { padding: 1.5rem 1rem; }
  .tool-card { padding: 1.25rem 1rem; }
  .type-tabs-horizontal { grid-template-columns: repeat(2, 1fr); }
  .tool-layout { gap: 1rem; }
  .header-usage-count { display: none; }
}

/* ── 開発コスト表 ── */
.cost-table-wrap { overflow-x: auto; }
.cost-table { width: 100%; max-width: 480px; border-collapse: collapse; font-size: 0.9rem; }
.cost-table th,
.cost-table td { padding: 0.7rem 1.1rem; text-align: left; border-bottom: 1px solid var(--border); background: var(--surface); }
.cost-table th {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface2);
  text-transform: uppercase;
}
.cost-table .total-row { font-weight: 600; background: var(--accent-light); border-top: 2px solid var(--border2); }
