:root {
    --ink: #1a1a1a;
    --paper: #ffffff;
    --paper-off: #fafafa;
    --accent: #d94a3a;
    --accent-soft:#ffe2dc;
    --rule-soft: #888888;
    --font-hand: "Yomogi", "Kalam", cursive;
    --font-mono: "DotGothic16", "VT323", ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body {
    margin: 0;
    height: 100%;
    overflow: hidden;
}
body {
    background: #f0eee9;
    font-family: var(--font-hand);
    color: var(--ink);
}

/* 視覚的に隠すが、SEOやアクセシビリティのために構造上は残すためのクラス */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
/* ─── アニメーション ─────────────────────────── */

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0.2; }
}

/* ─── ユーティリティ ─────────────────────────── */

.accent { color: var(--accent); }

.section-title {
  margin: 0;
  font-family: var(--font-hand);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title__decor {
  font-size: 13px;
  color: var(--accent);
}

.scribble-hr {
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0px,
    var(--ink) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.25;
  margin: 6px 0;
}

.blink-new {
  display: inline-block;
  padding: 1px 5px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  animation: blink 1s steps(2) infinite;
}

/* ─── ようこそバナー ──────────────────────────── */

.welcome-banner {
  padding: 12px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}

.welcome-banner__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome-banner__desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.annotation {
  flex-shrink: 0;
  font-family: var(--font-hand);
  font-size: 12px;
  color: var(--accent);
  font-style: italic;
  white-space: nowrap;
}

/* ─── ツール一覧 ─────────────────────────────── */

.tools-section .scribble-hr {
  margin-top: 6px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

a.tool-card {
  color: inherit;
  text-decoration: none;
}

.tool-card {
  position: relative;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  padding: 10px;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow 0.1s;
}

.tool-card:hover:not(.tool-card--disabled) {
  box-shadow: 2px 2px 0 var(--ink);
}

.tool-card--disabled {
  background: var(--paper-off);
  opacity: 0.55;
  cursor: default;
}

.tool-card__icon {
  width: 48px;
  height: 48px;
  border: 1px dashed var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 20px;
  background: var(--paper-off);
}

.tool-card__name {
  font-family: var(--font-hand);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.tool-card__desc {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rule-soft);
  text-align: center;
}

.blink-new--badge {
  position: absolute;
  top: -7px;
  right: -7px;
  transform: rotate(8deg);
}

/* ─── ビジターカウンター ──────────────────────── */

.visitor-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.visitor-counter__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--rule-soft);
}

.visitor-counter__display {
  background: #000;
  color: #3eff7a;
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  letter-spacing: 0.2em;
  border: 1.5px solid var(--ink);
}

/* ─── 更新履歴エリア ──────────────────────────── */

.update-area {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 10px;
}

.update-history {
  border: 1.5px dashed var(--ink);
  border-radius: 4px;
  padding: 10px;
}

.update-list {
  margin: 6px 0 0;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.8;
}

.update-list__item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.update-list__date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
}

.under-construction {
  border: 1.5px dashed var(--ink);
  border-radius: 4px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.under-construction__ascii {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  color: var(--ink);
  text-align: left;
  white-space: pre;
}

.under-construction__text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
  line-height: 1.6;
}

/* ─── 広告ユニット ───────────────────────────── */

.ad-unit {
  overflow: hidden;
}

.ad-unit--sidebar {
  width: 150px;
  height: 150px;
}

.ad-unit--horizontal {
  width: 100%;
  min-height: 90px;
}

/* ─── フッター ───────────────────────────────── */

.site-footer {
  flex-shrink: 0;
  padding: 6px 16px 8px;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-footer__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.access-banner {
  display: inline-flex;
  gap: 8px;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* ─── ツールフォーム ─────────────────────────── */

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  margin-top: 12px;
}

.tool-form__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-form__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
  letter-spacing: 0.05em;
}

.tool-form__input {
  font-family: var(--font-mono);
  font-size: 13px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  padding: 5px 8px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.tool-form__input:focus {
  border-color: var(--accent);
}

.tool-form__input--short {
  width: 110px;
}

.tool-form__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-form__row--center {
  align-items: flex-end;
}

.tool-form__checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.tool-form__btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 7px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: box-shadow 0.1s;
}

.tool-form__btn:hover:not(:disabled) {
  box-shadow: 2px 2px 0 var(--accent);
}

.tool-form__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.tool-form__btn--download {
  background: var(--accent);
  border-color: var(--accent);
  margin-top: 6px;
}

.tool-form__hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
  margin: 0;
}

/* ─── ツールプレビュー ───────────────────────── */

.tool-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-preview--result {
  border-top: 1px dashed var(--ink);
  padding-top: 14px;
}

.tool-preview__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tool-preview__label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
}

.tool-preview__img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background:
    repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}

.tool-form__preview-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.tool-form__preview-row .tool-preview {
  flex: 1;
  min-width: 0;
}

.tool-form__controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

/* ─── トリミングツール ───────────────────────── */

.crop-workspace {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.crop-preview-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.crop-canvas {
  display: block;
  max-width: 100%;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  cursor: crosshair;
  background:
    repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
}

.crop-loupe-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.crop-loupe {
  display: block;
  width: 120px;
  height: 120px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background:
    repeating-conic-gradient(#e0e0e0 0% 25%, #fff 0% 50%) 0 0 / 16px 16px;
  image-rendering: pixelated;
}

.crop-inputs {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.crop-inputs__group {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.crop-inputs__heading {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rule-soft);
  letter-spacing: 0.05em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  align-self: center;
}

/* ─── 画像変換ツール ─────────────────────────── */

.convert-format-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.convert-format-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: background 0.1s;
}

.convert-format-btn--active {
  background: var(--ink);
  color: var(--paper);
}

.convert-format-btn:hover:not(.convert-format-btn--active) {
  background: var(--paper-off);
}

.convert-quality-slider {
  width: 100%;
  accent-color: var(--ink);
  cursor: pointer;
}

/* ─── GIF作成ツール ──────────────────────────── */

.tool-form__error {
  color: #c0392b;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid #e74c3c;
  border-radius: 3px;
  background: #fdf0ef;
}

/* ─── 3パネルレイアウト ─── */
.animate-layout {
  display: grid;
  grid-template-columns: 1fr 210px;
  grid-template-rows: auto auto;
  gap: 12px;
}

/* ─── プレビューパネル ─── */
.animate-preview-panel {
  grid-column: 1;
  grid-row: 1;
  border: 1.5px solid var(--ink);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.animate-panel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.animate-preview-screen {
  flex: 1;
  min-height: 180px;
  border: 1px solid var(--border);
  background: var(--paper-off);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.animate-preview-img {
  max-width: 100%;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.animate-preview-empty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
}

.animate-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.animate-ctrl-btn {
  width: 36px;
  height: 34px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  font-size: 14px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.animate-ctrl-btn--play {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  width: 52px;
  transition: box-shadow 0.1s;
}

.animate-ctrl-btn--play:hover:not(:disabled) {
  box-shadow: 2px 2px 0 var(--accent);
}

.animate-ctrl-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.animate-frame-counter {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
  margin-left: 4px;
}

/* ─── 設定パネル ─── */
.animate-settings-panel {
  grid-column: 2;
  grid-row: 1;
  border: 1.5px dashed var(--ink);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.animate-settings-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.animate-settings-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.animate-settings-label {
  min-width: 44px;
  font-size: 13px;
}

.animate-settings-val {
  font-family: var(--font-mono);
  font-size: 12px;
}

.animate-settings-select {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 3px 6px;
  font-size: 13px;
  border-radius: 2px;
  cursor: pointer;
}

.animate-settings-note {
  font-size: 11px;
  color: var(--ink-muted);
  margin: 0;
}

.animate-settings-divider {
  border: none;
  border-top: 1.5px solid var(--ink);
  margin: 2px 0;
}


.animate-apply-all-btn {
  position: relative;
  border: 1.5px solid var(--border);
  background: var(--paper-off);
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.animate-apply-all-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.animate-apply-all-btn::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}

.animate-apply-all-btn:hover::after {
  opacity: 1;
}


/* ─── タイムライン ─── */
.animate-timeline-panel {
  grid-column: 1 / -1;
  grid-row: 2;
  border: 1.5px solid var(--ink);
  padding: 10px;
}

.animate-timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.animate-timeline-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.animate-add-btn {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: 2px;
}

.animate-add-btn:hover {
  background: var(--paper-off);
}

.animate-empty-hint {
  min-height: 80px;
  border: 1.5px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 3px;
}

.animate-empty-hint:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.animate-timeline-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.animate-timeline-frame {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 3px;
  user-select: none;
}

.animate-timeline-frame--active {
  border-color: var(--accent);
}

.animate-timeline-frame--drop {
  border-color: var(--ink);
  border-style: dashed;
}

.animate-timeline-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--border);
  pointer-events: none;
}

.animate-timeline-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.animate-timeline-fps {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
}

/* ─── ベーカーズ% ツール ────────────────────── */

.baker-loading {
  padding: 40px;
  font-family: var(--font-mono);
  color: var(--ink-muted);
  text-align: center;
}

.baker-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 4px;
}
.baker-wrap[data-font="mac"] * {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif !important;
}
.baker-wrap[data-font="win"] * {
  font-family: "Segoe UI", "Yu Gothic UI", "Meiryo", sans-serif !important;
}

/* タブバー */
.baker-tab-bar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.baker-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.baker-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  background: var(--paper-off);
  color: var(--ink-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: box-shadow 0.1s;
}

.baker-tab:not(.baker-tab--active):hover { box-shadow: 2px 2px 0 var(--accent); }

.baker-tab--active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.baker-tab-add {
  font-size: 16px;
  line-height: 1;
  padding: 2px 8px;
  border: 1.5px dashed var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
}

.baker-tab-add { transition: box-shadow 0.1s; }
.baker-tab-add:hover { color: var(--ink); border-color: var(--ink); box-shadow: 2px 2px 0 var(--accent); }

/* ツールバー */
.baker-toolbar {
  display: flex;
  gap: 4px;
  align-self: end;
}

.baker-tool-btn {
  font-size: 14px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink-muted);
  cursor: pointer;
}

.baker-tool-btn { transition: box-shadow 0.1s; position: relative; }
.baker-tool-btn:hover { color: var(--ink); border-color: var(--ink); box-shadow: 2px 2px 0 var(--accent); }
.baker-tool-btn--danger:hover { color: var(--accent); border-color: var(--accent); box-shadow: 2px 2px 0 var(--accent); }
.baker-tool-btn--ios-print { cursor: default; opacity: 0.7; }
.baker-tool-btn--ios-print[data-tip]::after { white-space: pre-wrap; max-width: 160px; text-align: center; }

.baker-font-select-wrap {
  position: relative;
  display: inline-flex;
}
.baker-font-select-wrap[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 100;
}
.baker-font-select-wrap[data-tip]:hover::after { opacity: 1; }

.baker-font-select {
  height: 30px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 12px;
  padding: 0 4px;
  cursor: pointer;
}
.baker-font-select:hover { border-color: var(--ink); color: var(--ink); }

.baker-tool-btn[data-tip]::after,
.baker-tab-add[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 100;
}
.baker-tool-btn[data-tip]:hover::after,
.baker-tab-add[data-tip]:hover::after {
  opacity: 1;
}

/* パターン名 */
.baker-pattern-name-wrap { margin-bottom: 16px; }

.baker-pattern-name {
  font-family: inherit;
  font-size: 20px;
  font-weight: 300;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  background: transparent;
  width: 100%;
  padding: 4px 0;
}

.baker-pattern-name:focus { border-bottom-color: var(--ink); }
.baker-print-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }

/* スケール */
.baker-scale-section { margin-bottom: 20px; }

.baker-scale-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.baker-scale-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.baker-scale-btn {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  background: var(--paper);
  cursor: pointer;
}

.baker-scale-btn:hover {
  border-color: var(--ink);
  box-shadow: 2px 2px 0 var(--accent);
}

.baker-scale-custom {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 5px 8px;
  border: 1.5px solid var(--border);
  border-radius: 2px;
  width: 100px;
  outline: none;
}

.baker-scale-custom:focus { border-color: var(--ink); }

/* ヘッダー行 */
.baker-header-row {
  display: grid;
  grid-template-columns: 20px 24px 1fr 68px 80px 24px;
  gap: 8px;
  align-items: center;
  padding: 0 0 4px;
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-muted);
  margin-bottom: 4px;
}

.baker-col-pct,
.baker-col-weight { text-align: right; }

/* 材料行 */
.baker-row {
  display: grid;
  grid-template-columns: 20px 24px 1fr 68px 80px 24px;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.baker-row--dragover { background: var(--paper-off); }

.baker-grip {
  font-size: 16px;
  color: var(--border);
  cursor: grab;
  user-select: none;
  line-height: 1;
}

.baker-grip--hidden { visibility: hidden; }
.baker-grip:hover { color: var(--ink-muted); }

.baker-flour-check-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.baker-flour-check-wrap[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 10px;
  white-space: nowrap;
  padding: 3px 7px;
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
  z-index: 100;
}
.baker-flour-check-wrap[data-tip]:hover::after { opacity: 1; }
.baker-flour-check { width: 14px; height: 14px; cursor: pointer; }

.baker-name-input {
  font-family: inherit;
  font-size: 16px;
  font-weight: 300;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
}

.baker-num-group {
  display: flex;
  align-items: baseline;
  gap: 2px;
  justify-content: flex-end;
}

.baker-pct-input {
  font-family: inherit;
  width: 80px;
  text-align: right;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--ink-muted);
  cursor: default;
}

.baker-weight-input {
  font-family: inherit;
  width: 64px;
  text-align: right;
  border: none;
  border-bottom: 1px solid var(--border);
  outline: none;
  background: transparent;
  font-size: 18px;
  font-weight: 300;
}

.baker-weight-input--flour { border-bottom: 2px solid var(--ink); }
.baker-weight-input:focus  { border-bottom-color: var(--accent); }

.baker-unit {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.baker-remove-btn {
  font-size: 18px;
  line-height: 1;
  color: var(--border);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 0.1s;
}

.baker-remove-btn:hover { color: var(--ink); box-shadow: 2px 2px 0 var(--accent); }

/* 追加ボタン */
.baker-add-btn {
  font-family: inherit;
  display: block;
  margin-top: 16px;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.baker-add-btn { transition: box-shadow 0.1s; }
.baker-add-btn:hover { color: var(--ink); box-shadow: 2px 2px 0 var(--accent); }

/* 合計行 */
.baker-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);
}

.baker-total-label { font-size: 20px; font-weight: 300; }

.baker-total-value {
  font-size: 48px;
  font-weight: 300;
  line-height: 1;
}

.baker-total-unit {
  font-size: 16px;
  color: var(--ink-muted);
  margin-left: 4px;
}

/* メモ行 */
.baker-memo-row{
  display: flex;
  flex-direction: column;
  /* justify-content: space-between; */
  align-items: baseline;
  margin-top: 48px;
  padding-top: 16px;
  border-top: 2px solid var(--ink);

  textarea {
    font-family: inherit;
    font-size: 14px;
    font-weight: 300;
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    min-height: 200px;
    resize: vertical;
  }

  .baker-memo-label { font-size: 20px; font-weight: 300; }
}


/* モーダル */
.baker-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.baker-modal {
  background: var(--paper);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
}

.baker-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.baker-modal-title { font-size: 18px; font-weight: 700; }

.baker-modal-close {
  font-size: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-muted);
  line-height: 1;
}

.baker-modal-close:hover { color: var(--ink); }

.baker-modal-body p { margin-bottom: 8px; font-weight: 300; }
.baker-modal-section { margin-top: 16px !important; }
.baker-modal-section-warning { margin-top: 16px !important; color: #c0392b; }

.baker-modal-list {
  margin: 4px 0 8px 20px;
  font-weight: 300;
  line-height: 1.8;
}

.baker-modal-list-warning {
  margin: 4px 0 8px 20px;
  font-weight: 300;
  line-height: 1.8;
  color: #c0392b;
}

.baker-modal-footer { margin-top: 20px; text-align: right; }

/* 印刷 */
@media print {
  .print-hidden { display: none !important; }
  .print-only   { display: block !important; }
}

.print-only { display: none; }

/* ─── 静的ページ共通 ────────────────────────────── */

.static-page { max-width: 720px; padding: 8px 0 24px; line-height: 1.8; }
.static-page h2 { margin: 24px 0 8px; font-size: 1rem; font-weight: bold; border-left: 3px solid var(--accent); padding-left: 8px; }
.static-page p { margin: 0 0 12px; }
.static-page a { color: var(--accent); }
.static-page__lead { font-weight: bold; margin-bottom: 20px; }
.static-page__date { margin-top: 32px; font-size: 0.85rem; color: #888; }

.info-table { border-collapse: collapse; width: 100%; max-width: 480px; }
.info-table th, .info-table td { padding: 10px 12px; border-bottom: 1px solid #eee; text-align: left; vertical-align: top; }
.info-table th { width: 120px; color: #888; font-weight: normal; font-size: 0.9rem; }

/* ─── お問い合わせフォーム ──────────────────────── */

.contact-form { max-width: 560px; margin-top: 16px; }
.form-group { margin-bottom: 20px; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.9rem; font-weight: bold; }
.form-input, .form-textarea { width: 100%; padding: 10px 12px; border: 2px solid #ddd; border-radius: 4px; font-size: 1rem; font-family: inherit; box-sizing: border-box; transition: border-color 0.2s; }
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--accent); }
.form-textarea { resize: vertical; }
.form-submit { display: inline-block; padding: 10px 28px; background: var(--accent); color: #fff; border: none; border-radius: 4px; font-size: 1rem; font-family: inherit; cursor: pointer; transition: opacity 0.2s; }
.form-submit:hover { opacity: 0.85; }
.form-errors { background: #fff0f0; border: 1px solid #f99; border-radius: 4px; padding: 12px 16px; margin-bottom: 16px; }
.form-errors__item { margin: 0 0 4px; font-size: 0.9rem; color: #c0392b; }

.btn-link { display: inline-block; margin-top: 16px; color: var(--accent); text-decoration: underline; }

/* ─── フッターリンク ────────────────────────────── */

.site-footer__links { display: flex; gap: 16px; flex-wrap: wrap; padding: 8px 0; font-size: 0.8rem; }
.site-footer__links a { color: #aaa; text-decoration: none; }

/* ─── 文字数カウント ────────────────────────────── */

.count-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.count-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  min-width: 120px;
  background: var(--paper);
  box-shadow: 2px 2px 0 var(--ink);
}

.count-stat__value {
  font-size: 2rem;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.02em;
}

.count-stat__label {
  font-size: 0.72rem;
  color: #666;
  text-align: center;
}

/* ─── 画像回転 ────────────────────────────── */

.rotate-angle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rotate-angle-btn {
  padding: 8px 20px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--paper);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: background 0.1s;
}

.rotate-angle-btn--active {
  background: var(--ink);
  color: var(--paper);
}

.rotate-custom {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.rotate-range {
  flex: 1;
  min-width: 160px;
  accent-color: var(--ink);
}

.rotate-custom__input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rotate-custom__unit {
  font-size: 1rem;
}

/* ─── 文字数カウント ────────────────────────────── */

.count-textarea {
  width: 100%;
  min-height: 260px;
  padding: 12px;
  border: 2px solid var(--ink);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  resize: vertical;
  box-sizing: border-box;
  background: var(--paper);
}
.site-footer__links a:hover { color: var(--accent); }
.page-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--paper);
}
/* サイドバー */
.sidebar {
    width: 150px;
    flex-shrink: 0;
    border-right: 1.5px solid var(--ink);
    background: var(--paper-off);
    display: flex;
    flex-direction: column;
    padding: 12px;
    gap: 10px;
}
/* サイドバー右側: スクロール領域 + フッターを縦に並べる */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
/* メイン: スクロール領域 */
.main-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--paper);
}
/* ─── レスポンシブ ──────────────────────────────────────── */

/* ─── モバイルヘッダー (PC では非表示) ─── */
.mobile-header {
  display: none;
}

/* ─── サイドバーオーバーレイ ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}
.sidebar-overlay--active {
  display: block;
}

/* ─── ハンバーガーボタン ─── */
.hamburger-btn {
  background: none;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s, opacity 0.2s;
}

/* ─── スクロールロック ─── */
body.menu-open {
  overflow: hidden;
}

/* ─── タブレット・スマホ共通 (≤ 1024px) ─── */
@media (max-width: 1024px) {
  /* モバイルヘッダー表示 */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1.5px solid var(--ink);
    background: var(--paper-off);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
  }

  /* モバイルヘッダー分のスペースを確保 */
  .right-panel {
    padding-top: 44px;
  }

  .mobile-header__logo {
    font-family: var(--font-hand);
    font-size: 15px;
    font-weight: 700;
  }

  /* ページ全体をスクロール可能に */
  html, body {
    overflow: auto;
    height: auto;
  }

  .page-wrapper {
    height: auto;
    overflow: visible;
  }

  .right-panel {
    overflow: visible;
    min-height: 100svh;
    background: var(--paper);
  }

  /* サイドバーをドロワー化 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: 200px;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    border-right: 1.5px solid var(--ink);
  }

  .sidebar--open {
    transform: translateX(0);
  }

  /* メインコンテンツ: フル幅 */
  .main-content {
    overflow: visible;
    padding: 12px 12px 160px; /* フッター(メタ行+広告)分の余白 */
  }

  /* フッター: ビューポート下部に固定 */
  .site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
  }

  /* ツール: 2列 */
  .tool-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* 更新履歴: 1列 */
  .update-area {
    grid-template-columns: 1fr;
  }

  /* フッター */
  .site-footer__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* ツールページ: プレビューと操作パネルを縦積み */
  .tool-form__preview-row {
    flex-direction: column;
  }

  .tool-form__controls {
    width: 100%;
  }

  /* トリミングツール: ルーペをフローティング表示（タッチ中のみ） */
  .crop-loupe-wrap {
    display: none;
    position: fixed;
    top: 56px; /* モバイルヘッダー下 */
    left: 8px;
    z-index: 300;
    background: var(--paper);
    border: 1.5px solid var(--ink);
    border-radius: 4px;
    padding: 4px;
  }

  .crop-loupe-wrap--visible {
    display: flex;
  }

}

/* ─── スマホ縦持ち (≤ 600px) ─── */
@media (max-width: 600px) {

  /* GIF作成ツール: 縦積みレイアウト */
  .animate-layout {
    grid-template-columns: 1fr;
  }

  .animate-preview-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .animate-settings-panel {
    grid-column: 1;
    grid-row: 2;
  }

  .animate-timeline-panel {
    grid-column: 1;
    grid-row: 3;
  }

  /* タイムライン: サムネを小さく */
  .animate-timeline-thumb {
    width: 52px;
    height: 52px;
  }

}
/* ─── サイドバー ─────────────────────────────── */

.sidebar-logo {
  text-align: center;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--ink);
}

.logo-char {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--rule-soft);
  margin-bottom: 4px;
}

.logo-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.logo-title .accent {
  color: var(--accent);
}

.logo-version {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rule-soft);
  margin-top: 2px;
}

/* ナビ */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-label {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rule-soft);
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.nav-link {
  display: block;
  font-family: var(--font-hand);
  font-size: 13px;
  color: #1a4ed8;
  text-decoration: underline;
  cursor: pointer;
  padding: 1px 0;
}

.nav-link:visited {
  color: #7a3a8a;
}

.nav-link.active {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.nav-category {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--rule-soft);
  letter-spacing: 0.05em;
  margin-top: 6px;
  margin-bottom: 1px;
}

/* アコーディオン */
.nav-accordion {
  border: none;
}

.nav-accordion > summary {
  list-style: none;
}

.nav-accordion > summary::-webkit-details-marker {
  display: none;
}

.nav-category--toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

.nav-category--toggle:hover {
  color: var(--ink);
}

.nav-category__arrow {
  display: inline-block;
  transition: transform 0.15s ease;
  font-size: 8px;
}

.nav-accordion[open] .nav-category__arrow {
  transform: rotate(90deg);
}

.nav-accordion__body {
  display: flex;
  flex-direction: column;
}

.nav-link--sub {
  padding-left: 8px;
  font-size: 12px;
}

/* キャラクター枠 */
.sidebar-mimi {
  margin-top: auto;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--rule-soft);
  padding-top: 8px;
}

/* 区切り線 */
.scribble-hr {
  width: 100%;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--ink) 0px,
    var(--ink) 4px,
    transparent 4px,
    transparent 8px
  );
  opacity: 0.3;
  margin: 2px 0;
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */
