/* ============================================================
   ヤンヤン — 縦積み棒グラフ生成
   style.css（ミンミンデザイン準拠）
   ============================================================ */

*, *::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;
  --danger-bg:    rgba(214,69,69,0.09);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: 400;
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }

/* ── ヘッダー ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.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 { height: 38px; width: auto; border-radius: var(--radius-sm); display: block; }
.logo-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  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-title-group { display: flex; align-items: center; gap: 10px; flex: 1; }
.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;
  font-family: 'Noto Sans JP', sans-serif;
  flex-shrink: 0;
}

.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;
  flex-shrink: 0;
}

.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; display: inline-block; }
.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: 1060px;
  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;
}

/* ── エディタレイアウト ── */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}
.tool-left {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* ── パネル共通 ── */
.panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.75rem;
  box-shadow: 0 2px 12px rgba(73,167,206,0.06);
}
#preview-panel { padding: 0; overflow: hidden; }
.tool-left .panel + .panel {
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.25rem 1.75rem;
}
.panel__title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel__title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1em;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.panel__desc { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.75rem; line-height: 1.6; }

/* ── プレビューエリア ── */
.preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 1.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.preview-bg-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
}
.preview-bg-label { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.preview-bg-color {
  width: 26px; height: 22px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 2px;
  cursor: pointer;
  background: var(--surface);
  flex-shrink: 0;
}
.preview-bg-hex {
  width: 76px;
  padding: 3px 6px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-family: 'IBM Plex Mono', monospace;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.preview-bg-hex:focus { border-color: var(--accent); }
.preview-bg-presets { display: flex; gap: 4px; align-items: center; }
.bg-preset {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
  padding: 0;
}
.bg-preset.active { border-color: var(--accent); }
.bg-preset--white   { background: #fff; box-shadow: inset 0 0 0 1px #ddd; }
.bg-preset--black   { background: #111; }
.bg-preset--gray    { background: #888; }
.bg-preset--checker {
  background-image: repeating-conic-gradient(#ccc 0% 25%, #fff 0% 50%);
  background-size: 10px 10px;
}

#preview-canvas {
  position: relative;
  padding: 32px 28px 48px;
  width: 100%;
  overflow: auto;
  transition: background 0.2s;
  min-height: 200px;
  background: #ffffff;
}
#preview-canvas.checker {
  background-image: repeating-conic-gradient(#e8e0d5 0% 25%, #f5ead8 0% 50%);
  background-size: 20px 20px;
  background-color: transparent;
}
.preview-undo-redo {
  position: absolute;
  bottom: 10px;
  right: 12px;
  display: flex;
  gap: 6px;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--surface2); }
.btn-icon:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── 項目設定 ── */
.items-textarea-wrap {
  display: flex;
  gap: 12px;
}
.items-textarea-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.items-textarea-col--val { flex: 0 0 110px; }

/* ── DLパネル ── */
.dl-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.dl-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  transition: all 0.15s;
}
.dl-option:hover { background: var(--accent-light); border-color: var(--border2); }
.dl-option input[type="radio"] { accent-color: var(--accent); cursor: pointer; }
.dl-option__label { font-size: 0.82rem; }

.dl-img-width-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 4px;
}
.dl-img-note {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.dl-img-note__title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.dl-img-note__text {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.7;
}
.dl-img-note__text kbd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-family: 'Outfit', sans-serif;
  color: var(--text);
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.02em;
}
.btn-primary:hover  { background: var(--accent-dark); }
.btn-primary:active { transform: scale(0.98); }

/* ── コードコピーエリア ── */
.code-tabs-wrap { margin-bottom: 10px; }
.code-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 3px;
  border-radius: var(--radius-sm);
  width: fit-content;
}
.code-tab {
  padding: 4px 14px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.code-tab:hover { color: var(--accent-dark); }
.code-tab.active { background: var(--surface); color: var(--accent-dark); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.code-block-wrap {}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  background: #1e2130;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.code-block-lang {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.btn-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255,255,255,0.6);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.68rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy:hover { background: rgba(255,255,255,0.1); color: #fff; }
.btn-copy.copied { background: var(--success); border-color: var(--success); color: #fff; }
pre.code-area {
  margin: 0;
  padding: 14px;
  background: #252838;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow-x: auto;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
  font-family: 'IBM Plex Mono', 'Consolas', 'Monaco', monospace;
  font-size: 0.72rem;
  line-height: 1.7;
  color: #e8eaf0;
  white-space: pre;
}
pre.code-area .tok-tag   { color: #79b8ff; }
pre.code-area .tok-attr  { color: #ffab70; }
pre.code-area .tok-val   { color: #9ecbff; }
pre.code-area .tok-prop  { color: #79b8ff; }
pre.code-area .tok-num   { color: #f8c555; }
pre.code-area .tok-color { color: #f97583; }
pre.code-area .tok-str   { color: #9ecbff; }
pre.code-area .tok-at    { color: #c8a0f0; }

/* ── 右カラム：設定パネル ── */
.tool-right { position: sticky; top: 76px; min-width: 0; }
.settings-panel {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(73,167,206,0.07);
}

/* タブ */
.settings-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--border2);
  background: var(--surface2);
}
.settings-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  color: var(--muted);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.3;
}
.settings-tab:hover { color: var(--accent); background: rgba(73,167,206,0.08); }
.settings-tab.is-active {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  background: var(--surface);
}

.settings-tab-body {
  display: none;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
}
.settings-tab-body.is-active { display: block; }

/* ── フォーム共通 ── */
.form-row { margin-bottom: 12px; }
.form-row:last-child { margin-bottom: 0; }
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 5px;
}
.form-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.form-section-title + .form-row { margin-top: 0; }
.form-section-title:not(:first-child) { margin-top: 20px; }

.form-select,
.form-input,
input.form-input,
select.form-select {
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.15s;
}
.form-select:focus,
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-color {
  width: 36px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--surface);
  flex-shrink: 0;
}
.color-input-row { display: flex; align-items: center; gap: 8px; }
/* スライダー行：バー・数値・太さを横並び */
.range-row { display: flex; align-items: center; gap: 6px; }
.range-row .form-range { flex: 1; min-width: 0; accent-color: var(--accent); cursor: pointer; height: 4px; }
.range-row .form-input--num {
  width: 60px !important;
  min-width: 60px !important;
  flex: 0 0 60px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.2rem;
}
.range-row .form-select--weight {
  width: 50px !important;
  min-width: 50px !important;
  flex: 0 0 50px;
  padding: 0.35rem 0.2rem;
  font-size: 0.78rem;
}
.form-range { flex: 1; accent-color: var(--accent); cursor: pointer; height: 4px; }
.form-unit { font-size: 0.72rem; color: var(--muted); white-space: nowrap; }
.form-value-display { color: var(--accent); font-weight: 600; }

/* テキストエリア */
.form-textarea {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text);
  background: var(--surface);
  resize: vertical;
  line-height: 1.8;
  outline: none;
  transition: border-color 0.15s;
}
.form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* ラジオトグル */
.toggle-group {
  display: flex;
  gap: 3px;
  background: var(--surface2);
  padding: 3px;
  border-radius: var(--radius-sm);
}
.toggle-btn {
  flex: 1;
  padding: 5px 10px;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.15s;
  white-space: nowrap;
  text-align: center;
}
.toggle-btn:hover { color: var(--accent); }
.toggle-btn.active {
  background: var(--surface);
  color: var(--accent-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ラジオ inline */
.radio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  cursor: pointer;
}
.radio-label input { accent-color: var(--accent); cursor: pointer; }

/* セパレーター */
.separator { height: 1px; background: var(--border); margin: 0.75rem 0; }

/* ── コンテンツセクション ── */
.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 */
.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-card__icon {
  width: 44px; height: 44px;
  background: var(--accent-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}
.feature-card__title { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.feature-card__desc  { font-size: 0.83rem; color: var(--muted); line-height: 1.65; }

/* usecase */
.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-item__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__body strong { display: block; font-size: 0.92rem; font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.usecase-item__body p { font-size: 0.84rem; color: var(--muted); line-height: 1.65; margin: 0; }

/* cost table */
.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 td:nth-child(2), .cost-table td:nth-child(3) { text-align: right; }
.cost-table th:nth-child(2), .cost-table th:nth-child(3) { text-align: right; }
.cost-table__total td { font-weight: 600; color: var(--text); background: var(--accent-light); border-top: 2px solid var(--border2); border-bottom: none; }

/* ── グラフ出力CSS ── */
.yy-graph { font-family: 'Noto Sans JP', sans-serif; display: inline-block; position: relative; width: 100%; }
.yy-graph__title { font-weight: 600; }
.yy-graph__title--top-left    { text-align: left;   margin-bottom: 12px; }
.yy-graph__title--top-center  { text-align: center; margin-bottom: 12px; }
.yy-graph__title--top-right   { text-align: right;  margin-bottom: 12px; }
.yy-graph__title--bottom-left   { text-align: left;   margin-top: 12px; }
.yy-graph__title--bottom-center { text-align: center; margin-top: 12px; }
.yy-graph__title--bottom-right  { text-align: right;  margin-top: 12px; }
.yy-graph__bars { display: flex; flex-direction: column; gap: 10px; }
/* グリッドで左端を揃える */
.yy-graph__item {
  display: grid;
  grid-template-columns: var(--label-col-width, 80px) 1fr;
  align-items: center;
  gap: 12px;
}
/* 棒グラフ＋数値をflex で並べる（グリッド1セル内） */
.yy-graph__bar-with-val {
  display: flex;
  align-items: center;
  min-width: 0;
}
.yy-graph__label-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.yy-graph__val-label {
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
}
.yy-graph__fill { border-radius: 4px; overflow: hidden; flex-shrink: 0; }
/* 数値の場所：グラフの中 — fillの右にぴったり付ける（負のmarginでfillに重ねる） */
.yy-graph__val-inside-outer {
  white-space: nowrap;
  font-weight: 600;
  flex-shrink: 0;
  padding: 0 8px;
  margin-left: -9999px; /* 初期値、JSがpaddingで上書き */
  pointer-events: none;
}
.yy-graph__val-right { white-space: nowrap; font-weight: 600; padding-left: 8px; flex-shrink: 0; }
/* 単位：グラフの四隅 */
.yy-graph__unit-corner {
  position: absolute;
  font-size: 12px;
}
.yy-graph__unit-corner--top-left    { top: 0;    left:  0;  }
.yy-graph__unit-corner--top-right   { top: 0;    right: 0;  }
.yy-graph__unit-corner--bottom-left  { bottom: 0; left:  0;  }
.yy-graph__unit-corner--bottom-right { bottom: 0; right: 0;  }
.yy-graph__bars-wrap { position: relative; width: 100%; }

/* 単位行（グラフ外・上下に配置） */
.yy-graph__unit-row { display: flex; justify-content: flex-start; margin-bottom: 4px; }
.yy-graph__unit-row--right { justify-content: flex-end; }
.yy-graph__unit-row + * { } /* 下に来るbarsとの間は margin-bottom で制御 */
/* アニメーション */
@keyframes yy-slide {
  from { width: 0; }
  to   { width: var(--bar-w); }
}
@keyframes yy-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── レスポンシブ ── */
@media (max-width: 900px) {
  .editor-grid { grid-template-columns: 1fr; }
  .tool-right { position: static; order: -1; }
  .settings-tab-body { max-height: none; }
}
@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; }
  .content-section { padding: 2rem 1rem; }
  .preview-controls { gap: 4px; }
  .items-textarea-col--val { flex: 0 0 90px; }
  .header-usage-count { display: none; }
}
