/* ============================================================
   SuruRi — デザインシステム
   ============================================================ */

/* 見出し・本文フォント: LINE Seed JP（SIL Open Font License・商用OK）
   同梱ウェイト: Regular(400) / Bold(700) / ExtraBold(800)。読み込みは各ウェイトが
   実際に使われたときだけ（未使用のThinは同梱せず）。表示はまず端末のフォントで出し、
   読み込めたら差し替える（font-display: swap）ので、文字が見えない時間を作らない。 */
@font-face {
  font-family: "LINE Seed JP";
  src: url("assets/fonts/LINESeedJP_Rg.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINE Seed JP";
  src: url("assets/fonts/LINESeedJP_Bd.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "LINE Seed JP";
  src: url("assets/fonts/LINESeedJP_Eb.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --hairline: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.12);
  --radius: 22px;
  --ease-sheet: cubic-bezier(0.32, 0.72, 0, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "LINE Seed JP", -apple-system, BlinkMacSystemFont, "SF Pro JP",
    "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, canvas { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; }

:focus-visible {
  outline: 3px solid rgba(0, 113, 227, 0.55);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- ナビゲーションバー ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 253, 0.78);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.005em;
}
.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  transform-origin: bottom center; /* 足元を軸に傾く＝歩いてるみたいに見える */
  transition: transform 0.25s var(--ease-sheet);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
/* カーソルを乗せる（スマホはタップ）と、左右に揺れながら少し右に出て戻る＝トコトコ歩く */
.brand:hover .brand-mark,
.brand:active .brand-mark { animation: suru-walk 0.6s ease-in-out infinite; }
@keyframes suru-walk {
  0%   { transform: translateX(0)    rotate(0deg); }
  25%  { transform: translateX(1.5px) rotate(7deg); }
  50%  { transform: translateX(2.5px) rotate(0deg); }
  75%  { transform: translateX(1.5px) rotate(-7deg); }
  100% { transform: translateX(0)    rotate(0deg); }
}
/* 「SuruRi」の i の点だけ、ブランドの青グラデにする（点なしのi＝ıに丸を重ねる） */
.brand-name { display: inline-flex; align-items: baseline; }
.brand-i { position: relative; display: inline-block; }
.brand-i-dot {
  position: absolute;
  left: 50%;
  top: 0.16em;
  transform: translateX(-50%);
  width: 0.28em;
  height: 0.28em;
  border-radius: 50%;
  background: linear-gradient(135deg, #6a5cff, #0090f7 55%, #00b8c8);
}
.nav-note {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-note svg { flex: none; }
/* ヘッダーの「料金」リンク（remove.bg / iLovePDF方式：右上に枠つきで目立たせる） */
.nav-link {
  flex: none;
  margin-left: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  border: 1.5px solid var(--blue);
  text-decoration: none;
  padding: 6px 15px;
  border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { background: rgba(0, 113, 227, 0.08); }

/* ---------- ヒーロー ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 0 22px 80px; }

.hero { text-align: center; padding: 72px 0 34px; }

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.eyebrow svg { flex: none; }

h1 {
  font-size: clamp(38px, 6.4vw, 68px);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.12;
}
h1 .grad {
  background: linear-gradient(92deg, #6a5cff 0%, #0090f7 48%, #00b8c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin: 20px auto 0;
  max-width: 620px;
  font-size: 18px;
  color: var(--ink-2);
}

/* ---------- スマートドロップゾーン（シグネチャー） ---------- */
.dropzone {
  position: relative;
  margin: 38px auto 0;
  max-width: 720px;
  border: 2px dashed rgba(0, 0, 0, 0.16);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.7);
  padding: 40px 24px 34px;
  transition: border-color 0.25s, background 0.25s, transform 0.25s, box-shadow 0.25s;
}
/* ドロップ枠の上端を、マスコットがトコトコ往復（右行き＝正面、左行き＝反転） */
.dz-stroller {
  position: absolute;
  top: -25px;          /* 足が枠の上端の縁に乗る位置 */
  left: 4px;
  width: 32px;
  height: 26px;
  pointer-events: none; /* 枠のクリック（ファイル選択）を邪魔しない */
  z-index: 2;
  /* 枠が広いほど移動距離が長い＝速く見える。広い画面ではゆっくりに（スマホ側で上書き） */
  animation: dz-stroll 20s linear infinite;
}
.dz-walk {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: bottom center;
  animation: dz-walk 1.1s ease-in-out infinite;
}
.dz-walk img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* 横移動＋進む向きで左右反転（右→正面、左→反転） */
@keyframes dz-stroll {
  0%   { left: 4px;                    transform: scaleX(1); }
  48%  { left: calc(100% - 36px);      transform: scaleX(1); }
  50%  { left: calc(100% - 36px);      transform: scaleX(-1); }
  98%  { left: 4px;                    transform: scaleX(-1); }
  100% { left: 4px;                    transform: scaleX(1); }
}
/* 歩くときの小刻みな体の揺れ（上下は動かさない） */
@keyframes dz-walk {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(6deg); }
  75%      { transform: rotate(-6deg); }
}
.dropzone.drag {
  border-color: var(--blue);
  background: rgba(0, 113, 227, 0.06);
  transform: scale(1.012);
  box-shadow: 0 0 0 6px rgba(0, 113, 227, 0.08);
}
.dropzone .dz-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(160deg, #eef2ff, #e4f3ff);
  display: grid;
  place-items: center;
  color: var(--blue);
}
.dropzone p strong { font-size: 19px; font-weight: 650; }
.dropzone .sub { font-size: 14px; color: var(--ink-2); margin: 6px 0 18px; }

.drop-badge {
  display: none;
  margin: 0 auto 16px;
  max-width: 460px;
  background: #e9f5ec;
  color: #1d7a35;
  font-size: 14px;
  font-weight: 600;
  border-radius: 999px;
  padding: 7px 18px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.drop-badge.show { display: inline-flex; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 500;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn.primary {
  background: var(--blue);
  color: #fff;
  padding: 12px 28px;
  font-size: 17px;
}
.btn.primary:hover { background: var(--blue-hover); }
.btn.primary:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn.secondary {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink);
  padding: 10px 22px;
  font-size: 15px;
}
.btn.secondary:hover { background: rgba(0, 0, 0, 0.1); }
.btn.big {
  width: 100%;
  padding: 15px 28px;
  font-size: 17px;
  font-weight: 600;
  /* 「筆でなおす（消しすぎ・残りすぎをその場で修正）」のような説明つきの長い文言が
     枠から飛び出していたため、入り切らなければ折り返して収める */
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.btn.small { padding: 7px 16px; font-size: 14px; }

/* ---------- ツールカード ---------- */
.tools-head { margin: 56px 0 6px; text-align: center; }
.tools-head h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.015em; }
.tools-head p { color: var(--ink-2); font-size: 15px; margin-top: 4px; }

.tools {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
/* 通常のタイルは「正方形」にそろえる（幅と同じ高さにする）。
   主役カード(hero)・帯カード(banner)・横長カード(wide)は大きさが違うので対象外。 */
.card:not(.card-hero):not(.card-banner):not(.card-wide) {
  aspect-ratio: 1 / 1;
  align-self: start; /* 背の高い行に並んでも上寄せで正方形を保つ */
  overflow: hidden;
}
/* 正方形の中に収まるよう、説明文は最大3行まで（はみ出しは…で省略） */
.card:not(.card-banner):not(.card-hero) p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.03);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.28s var(--ease-sheet), box-shadow 0.28s, opacity 0.3s;
  position: relative;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card h3 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; }
.card p { font-size: 14px; color: var(--ink-2); line-height: 1.6; }

.card .icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 4px;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.28s var(--ease-sheet);
}
.card:hover .icon { transform: scale(1.08) rotate(-7deg) translateY(-2px); }

/* 道具箱のギミック: ファイルを置くと、使える道具がカタカタッと鳴る */
@keyframes rattle {
  0%, 100% { transform: translateY(-4px) rotate(0deg); }
  18% { transform: translateY(-8px) rotate(-1.6deg); }
  38% { transform: translateY(-3px) rotate(1.4deg); }
  58% { transform: translateY(-7px) rotate(-1deg); }
  78% { transform: translateY(-4px) rotate(0.7deg); }
}
.card.rattle {
  animation: rattle 0.6s cubic-bezier(0.36, 0.07, 0.19, 0.97);
  animation-delay: var(--rattle-delay, 0s);
}

/* ファイルを置いたときのハイライト */
body.picking .card { opacity: 0.35; }
body.picking .card.match {
  opacity: 1;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.45), var(--shadow-lg);
  transform: translateY(-4px);
}

/* 横長カード（新機能用） */
.card-wide { grid-column: span 2; }

/* 全幅バナーカード（QRコード作成など、道具箱の最後に置く帯） */
.card-banner {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
}
.card-banner .icon { margin-bottom: 0; }
.card-banner .banner-text { flex: 1; min-width: 0; }
.card-banner .banner-text h3 { margin-bottom: 2px; }
.card-banner .banner-cta {
  flex: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}
/* 注目バナー（消しゴムマジックなど、目玉機能用） */
.card-banner-hot {
  background: linear-gradient(115deg, #fdf3ff, #f0f4ff 55%, #edfbff);
  border: 1px solid rgba(150, 90, 240, 0.22);
}
/* AIを使う道具のタイル色（色＝AI という視覚ルール。バッジとセットで一目で分かる） */
.card-ai {
  background: linear-gradient(115deg, #fdf3ff, #f0f4ff 55%, #edfbff);
  border: 1px solid rgba(150, 90, 240, 0.22);
}
.hot-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(120deg, #ff5fa2, #8a3ff2);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: 2px;
  margin-left: 6px;
}

/* 消しゴムマジックの処理中表示 */
.er-busy[hidden] { display: none; } /* display:flex が hidden 属性に勝つ罠を防ぐ */
.er-busy {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(251, 251, 253, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 6;
}
.er-busy-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  padding: 9px 16px;
  box-shadow: var(--shadow-sm);
}

/* ファイルを置いた後の「使える道具」近道パネル */
.suggest {
  max-width: 760px;
  margin: 14px auto 0;
  padding: 14px 16px 16px;
  background: var(--card);
  border: 1px solid rgba(74, 99, 242, 0.22);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
  animation: suggestIn 0.32s var(--ease-sheet);
}
@keyframes suggestIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.suggest-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.suggest-title { font-size: 15px; font-weight: 800; }
/* 「ここにない場合は道具箱へ」の全幅ボタン（見落とされないよう下部に大きく） */
.suggest-more {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px dashed rgba(74, 99, 242, 0.4);
  border-radius: 12px;
  background: rgba(74, 99, 242, 0.05);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  transition: background 0.2s, border-color 0.2s;
}
.suggest-more:hover { background: rgba(74, 99, 242, 0.1); border-color: rgba(74, 99, 242, 0.6); }
.suggest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.suggest-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-align: left;
  transition: transform 0.2s var(--ease-sheet), box-shadow 0.2s, border-color 0.2s;
}
.suggest-chip:hover { transform: translateY(-2px); border-color: rgba(74, 99, 242, 0.4); box-shadow: var(--shadow-sm); }
.suggest-chip .s-icon {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
}
.suggest-chip .s-icon svg { width: 16px; height: 16px; }
.suggest-chip .s-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  .suggest { padding: 12px 12px 14px; border-radius: 16px; }
  .suggest-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .suggest { animation: none; } }

/* セクション見出し（画像の道具／PDFの道具） */
.tools-group {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 11px;
  scroll-margin-top: 72px; /* ファイルを置いた時、貼り付きナビの下にぴったり収まる位置へ */
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin: 24px 0 2px;
}
/* 見出しの左の細い青アクセント（区切りを分かりやすく） */
.tools-group::before {
  content: "";
  flex: none;
  width: 4px;
  height: 22px;
  border-radius: 3px;
  background: linear-gradient(180deg, #4a63f2, #3ba0ff);
}
/* アイコンを青いミニチップに入れて存在感を出す */
.tools-group svg {
  width: 18px; height: 18px;
  padding: 7px;
  box-sizing: content-box;
  border-radius: 10px;
  background: linear-gradient(150deg, #4a63f2, #3ba0ff);
  color: #fff;
  box-shadow: 0 3px 8px rgba(74, 99, 242, 0.28);
}
.tools-group:first-child { margin-top: 0; }
.tools-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--hairline);
  margin-left: 2px;
}
/* ファイルを置いたとき、該当の見出しがふわっと光って「ここへ」を知らせる */
@keyframes groupLit {
  0%   { box-shadow: 0 3px 8px rgba(74, 99, 242, 0.28), 0 0 0 0 rgba(74, 99, 242, 0.5); }
  35%  { box-shadow: 0 3px 8px rgba(74, 99, 242, 0.28), 0 0 0 8px rgba(74, 99, 242, 0.14); }
  100% { box-shadow: 0 3px 8px rgba(74, 99, 242, 0.28), 0 0 0 0 rgba(74, 99, 242, 0); }
}
.tools-group.group-lit svg { animation: groupLit 1.1s ease-out 2; }
@media (prefers-reduced-motion: reduce) {
  .tools-group.group-lit svg { animation: none; }
}

/* ツールごとのアイコン色（iOSアプリアイコン風グラデーション） */
.i-bg       { background: linear-gradient(150deg, #8a7bff, #4a63f2 60%, #3ba0ff); }
.i-logobg   { background: linear-gradient(150deg, #3fd2c0, #12a3b8 60%, #4a63f2); }
.i-eraser   { background: linear-gradient(150deg, #ff7ab8, #b04ef0 60%, #7a3ff2); }
.i-convert  { background: linear-gradient(150deg, #ffb340, #ff8c1a); }
.i-icompress{ background: linear-gradient(150deg, #4cd471, #22a94d); }
.i-resize   { background: linear-gradient(150deg, #3fd2e0, #0e9fbf); }
.i-img2pdf  { background: linear-gradient(150deg, #ff7d6b, #f43e4f); }
.i-pdf2img  { background: linear-gradient(150deg, #ffcf3d, #f5a623); }
.i-merge    { background: linear-gradient(150deg, #55a9ff, #1f6ef2); }
.i-split    { background: linear-gradient(150deg, #43c6b8, #14998f); }
.i-protate  { background: linear-gradient(150deg, #5fb6ff, #2a7de1); }
.i-porg     { background: linear-gradient(150deg, #6bb6ff, #3a5fd8); }
.i-ptrim    { background: linear-gradient(150deg, #4fcbb0, #179f96); }
.i-pedit    { background: linear-gradient(150deg, #ffab5e, #e46e1f); }
.i-idphoto  { background: linear-gradient(150deg, #58b5ff, #2f6ef2 60%, #6a5cff); }
.i-roundcrop{ background: linear-gradient(150deg, #ffa94d, #f76707); }
.i-pcompress{ background: linear-gradient(150deg, #9a8cf5, #6a55d8); }
.i-adjust   { background: linear-gradient(150deg, #ff8fb1, #e0447e); }
.i-imgtext  { background: linear-gradient(150deg, #ffd15c, #f59e0b); }
.i-upscale  { background: linear-gradient(150deg, #7f7aff, #4b3fd6); }
.i-crop     { background: linear-gradient(150deg, #9aa3b5, #5c6675); }
.i-wm       { background: linear-gradient(150deg, #c9976b, #96603c); }
.i-mosaic   { background: linear-gradient(150deg, #6d87c2, #2f4a7d); }
.i-ocr      { background: linear-gradient(150deg, #b0bd62, #77862c); }
.i-imerge   { background: linear-gradient(150deg, #6d87c2, #2f4a7d); }
.i-exif     { background: linear-gradient(150deg, #9aa3b5, #5c6675); }
.i-qr       { background: linear-gradient(150deg, #55565e, #232329); }
.i-picker   { background: conic-gradient(from 210deg, #f8605f, #f6a54c, #ffd44d, #63d471, #3fb3e0, #7a6cf0, #f8605f); }

/* AIを使う道具の「AI」バッジ（どのカードにも付けられる） */
.ai-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(120deg, #7a5cff, #2f89ff);
  border-radius: 999px;
  padding: 3px 9px 3px 7px;
  box-shadow: 0 2px 7px rgba(90, 90, 255, 0.4);
  z-index: 2;
}
.ai-badge svg { width: 11px; height: 11px; }
/* バナー見出しの中に置くAIバッジ（右上固定でなく、タイトルの横に流し込む） */
.ai-badge-inline {
  position: static;
  vertical-align: middle;
  margin-left: 5px;
  box-shadow: none;
  padding: 2px 8px 2px 6px;
  font-size: 10.5px;
}

/* 背景透過カード（大） */
.card-hero { grid-column: span 2; grid-row: span 2; padding-bottom: 20px; }
.card-hero .badge {
  position: absolute;
  top: 22px;
  right: 22px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fff;
  background: linear-gradient(120deg, #7a5cff, #2f89ff);
  border-radius: 999px;
  padding: 4px 12px;
}
.card-hero .demo {
  margin-top: auto;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- フッター ---------- */
footer {
  margin-top: 72px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
  line-height: 2;
}
.foot-lead { max-width: 620px; margin: 0 auto; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  margin: 16px 0 8px;
}
.foot-links a {
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.foot-links a:hover { color: var(--blue); text-decoration: underline; }
.foot-copy { font-size: 12px; color: var(--ink-3); }

/* ---------- 規約・情報などの文章ページ ---------- */
.nav a.brand { text-decoration: none; color: inherit; }
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 22px 90px;
  line-height: 1.95;
}
.legal-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 16px;
}
.legal-back:hover { color: var(--blue); }
.legal h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 4px; }
.legal-updated { color: var(--ink-3); font-size: 13px; margin-bottom: 26px; }
.legal h2 { font-size: 19px; font-weight: 700; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--ink-2); font-size: 15px; }
.legal ul, .legal ol { margin: 6px 0 6px 1.4em; }
.legal li { margin: 5px 0; }
.legal a { color: var(--blue); }
.legal strong { color: var(--ink); font-weight: 700; }
.legal .fill { background: rgba(255, 200, 0, 0.16); border-radius: 5px; padding: 1px 6px; color: var(--ink-2); }
.legal .note {
  background: rgba(0, 0, 0, 0.035);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--ink-2);
  margin: 16px 0;
  line-height: 1.8;
}
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal-table th, .legal-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.legal-table th { color: var(--ink-3); font-weight: 700; white-space: nowrap; }
.legal-table td { color: var(--ink-2); }
.legal-wrap { overflow-x: auto; }

/* ---------- シート（モーダル） ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s;
}
.scrim.show { opacity: 1; }

.sheet {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 24px);
  width: min(720px, 100vw);
  max-height: min(92vh, 92dvh);
  background: #fbfbfd;
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: transform 0.42s var(--ease-sheet), opacity 0.3s;
}
.sheet.show { transform: translate(-50%, 0); opacity: 1; }

/* hidden指定のときは完全に消す（display:flexがhiddenに勝ってしまうのを防ぐ） */
.sheet[hidden] { display: none; }
.scrim[hidden] { display: none; }
/* 閉じるアニメーション中の透明なシートがクリックを吸わないように */
.sheet:not(.show) { pointer-events: none; }

@media (min-width: 760px) {
  .sheet {
    bottom: auto;
    top: 50%;
    transform: translate(-50%, calc(-50% + 30px));
    border-radius: 26px;
    max-height: 88vh;
  }
  .sheet.show { transform: translate(-50%, -50%); }
}

.sheet-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--hairline);
  flex: none;
}
.sheet-head .icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.sheet-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.sheet-head p { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.sheet-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: background 0.2s;
  flex: none;
}
.sheet-close:hover { background: rgba(0, 0, 0, 0.12); }

.sheet-body { padding: 20px 24px 26px; overflow-y: auto; }

.sheet-drop {
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: 18px;
  background: #fff;
  padding: 26px 18px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}
.sheet-drop.drag { border-color: var(--blue); background: rgba(0, 113, 227, 0.05); }
.sheet-drop p { font-size: 15px; font-weight: 600; }
.sheet-drop .sub { font-size: 13px; color: var(--ink-2); font-weight: 400; margin-top: 2px; }

/* ファイルリスト */
.filelist { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 14px;
}
/* 並べ替え（ドラッグ） */
.reorder-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 2px 4px 8px;
}
.file-row.draggable { cursor: grab; }
.file-row.drag-src { opacity: 0.4; }
.file-row.drag-over { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.35); }
.drag-handle { color: var(--ink-3); flex: none; display: grid; place-items: center; cursor: grab; touch-action: none; }
.file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  background:
    repeating-conic-gradient(#ececf1 0% 25%, #ffffff 0% 50%) 50% / 12px 12px;
  border: 1px solid var(--hairline);
  flex: none;
}
.file-thumb.pdf {
  display: grid;
  place-items: center;
  color: #e2574c;
  background: #fdf1f0;
  font-size: 11px;
  font-weight: 800;
}
.file-meta { min-width: 0; flex: 1; }
.file-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size { font-size: 12px; color: var(--ink-3); }
.file-actions { display: flex; gap: 4px; flex: none; }
.mini-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: background 0.15s;
}
.mini-btn:hover { background: rgba(0, 0, 0, 0.1); }
.mini-btn:disabled { opacity: 0.3; cursor: default; }
/* スマホ(指で押す端末)では押しやすいよう44px角に広げる（誤タップ防止） */
@media (pointer: coarse) {
  .mini-btn { width: 44px; height: 44px; font-size: 16px; }
}

/* オプション */
.options { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.opt-group .opt-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.seg {
  display: flex;
  flex-wrap: wrap; /* 選択肢が多い道具（証明写真など）は無理に1行に詰めず折り返す */
  background: rgba(0, 0, 0, 0.055);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  flex: 1 1 auto;
  min-width: 96px; /* これ以下に潰れると文字が変な位置で折れるため */
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  line-height: 1.35;
  /* 端末の書体によっては文字が枠から溢れるため、意味の切れ目で折り返して収める
     （keep-all＝単語の途中で切らない／anywhere＝それでも入らないときは折り返す） */
  word-break: keep-all;
  overflow-wrap: anywhere;
}
/* 選択肢が4つ以上の列（証明写真のサイズ・背景色など）：
   全チップ同じ幅の格子（スマホ2列・広い画面3列）＋薄い輪郭で切れ目を明確に */
.seg-roomy {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 6px;
}
.seg-roomy button {
  min-width: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}
.seg-roomy button.on {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--blue), 0 1px 4px rgba(0, 0, 0, 0.1);
}
@media (min-width: 700px) {
  .seg-roomy { grid-template-columns: repeat(3, 1fr); }
}
.seg button small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
}
.seg button.on {
  background: #fff;
  color: var(--blue);
  /* 白いだけだと、どれを選んでいるか分かりにくかったので青い枠を足す
     （選択肢が4つ以上の列 .seg-roomy と同じ見せ方に揃えた） */
  box-shadow: inset 0 0 0 1.5px var(--blue), 0 1px 4px rgba(0, 0, 0, 0.12);
}
.seg button.on small { color: var(--blue); opacity: 0.8; }
/* 結果画面の手直しボタン（筆でなおす／なぞって選び直す）
   以前はグレー一色・黒文字・小さな絵記号で、何のボタンか分かりにくかった。
   絵記号を大きく青くし、見出しと説明を上下に分けて読み取りやすくしている。 */
.act-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 13px 15px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 15px;
  text-align: left;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.act-btn:hover {
  background: #f5f9ff;
  border-color: var(--blue);
  box-shadow: 0 3px 12px rgba(0, 113, 227, 0.12);
}
.act-btn:active { transform: scale(0.99); }
.act-ic {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eaf2ff;
  color: var(--blue);
}
.act-ic svg { width: 22px; height: 22px; }
.act-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.act-title { font-size: 15.5px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.act-txt small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-3);
  line-height: 1.4;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
@media (max-width: 420px) {
  .act-btn { gap: 11px; padding: 12px 13px; }
  .act-ic { width: 38px; height: 38px; border-radius: 11px; }
  .act-ic svg { width: 20px; height: 20px; }
  .act-title { font-size: 15px; }
}

.opt-text {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  background: #fff;
}
.opt-text:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,113,227,.15); }
.opt-hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* QRの色（パレット＋HEX番号） */
.color-row { display: flex; align-items: center; gap: 10px; }
.color-swatch {
  width: 46px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 12px;
  background: none;
  cursor: pointer;
  flex: none;
}
.color-swatch::-webkit-color-swatch-wrapper { padding: 4px; }
.color-swatch::-webkit-color-swatch { border: none; border-radius: 8px; }
.color-hex { flex: 1; text-transform: uppercase; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.color-warn { font-size: 12px; color: #c26a00; margin-top: 7px; min-height: 1px; }

/* QRの中央ロゴ選択（アイコン付き・折り返し） */
.logo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.logo-btn {
  flex: 1 1 84px;
  min-width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 8px 9px;
  border: 1.5px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}
.logo-btn:hover { background: rgba(0, 0, 0, 0.03); }
.logo-btn.on { border-color: var(--blue); background: rgba(0, 113, 227, 0.06); }
.logo-img { width: 30px; height: 30px; object-fit: contain; display: block; }
.logo-none {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  color: var(--ink-3);
}
.logo-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.logo-btn.on .logo-label { color: var(--blue); }
/* スマホでは「なし」を上に全幅で大きく、その下にX・Instagram・Facebookを1列 */
@media (max-width: 560px) {
  .logo-btn-none {
    flex: 1 1 100%;
    flex-direction: row;
    justify-content: center;
    gap: 9px;
    padding: 15px;
  }
  .logo-btn-none .logo-none, .logo-btn-none .logo-none svg { width: 24px; height: 24px; }
  .logo-btn-none .logo-label { font-size: 15px; }
}

.run-area { margin-top: 20px; }

/* 進捗 */
/* ファイル選択の入力欄は display:none だと一部ブラウザでダイアログが開かないため、
   画面外に置いて「見えないが押せる」状態にする */
.sr-only-file {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.progress { margin-top: 18px; }
/* AIの道具のときだけ出る「ロゴ＋待ち案内」（通常の道具では非表示） */
.progress-brand { display: none; justify-content: center; margin-bottom: 12px; }
.progress-brand img { width: 46px; height: 46px; display: block; }
.progress-wait { display: none; margin-top: 10px; font-size: 13px; color: var(--ink-3); text-align: center; line-height: 1.5; }
.progress.ai .progress-brand { display: flex; }
.progress.ai .progress-brand img { animation: sururi-bob 1.5s ease-in-out infinite; }
.progress.ai .progress-wait { display: block; }
@keyframes sururi-bob {
  0%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(-7px) scale(1.06) rotate(-4deg); }
  60% { transform: translateY(-2px) scale(1.03) rotate(3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .progress.ai .progress-brand img { animation: sururi-fade 1.6s ease-in-out infinite; }
  @keyframes sururi-fade { 0%,100% { opacity: 0.55; } 50% { opacity: 1; } }
}
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6a5cff, #0090f7);
  transition: width 0.3s;
}
.progress-fill.indeterminate {
  width: 40%;
  animation: slide 1.2s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}

/* 結果 */
.results { margin-top: 20px; }
/* できあがり後の完了モード：入力部を隠して、結果と保存ボタンに集中させる */
#sheet.sheet-done #sheetDrop,
#sheet.sheet-done #fileList,
#sheet.sheet-done #optArea,
#sheet.sheet-done #runBtn,
#sheet.sheet-done #modelNote { display: none; }
.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -4px 0 12px;
}
.result-hint { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.result-bar .btn { flex: none; }
.result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1d7a35;
  margin-bottom: 12px;
}
.result-rows { display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 10px 14px;
}
.result-note { font-size: 12px; color: var(--ink-3); }
.result-note .save { color: #1d7a35; font-weight: 700; }
.zip-area { margin-top: 12px; }

/* 結果のファイル名（クリックで書き換えられる） */
.file-name-row { display: flex; align-items: center; min-width: 0; }
.name-edit {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 2px 6px;
  margin-left: -7px;
  background: transparent;
  min-width: 0;
  flex: 1;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.name-edit:hover { border-color: rgba(0, 0, 0, 0.14); background: #fff; }
.name-edit:focus {
  outline: none;
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.12);
}
.name-ext { font-size: 14px; font-weight: 600; color: var(--ink-3); flex: none; }

/* 処理中スピナー（実行ボタン内） */
.spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: -3px;
  margin-right: 4px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-box {
  margin-top: 16px;
  background: #fdf0ef;
  border: 1px solid rgba(226, 87, 76, 0.25);
  color: #c0392b;
  font-size: 14px;
  border-radius: 14px;
  padding: 12px 16px;
  line-height: 1.6;
}

/* 比較スライダー（背景透過の結果） */
.compare {
  position: relative;
  margin-bottom: 14px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background:
    repeating-conic-gradient(#e9e9ee 0% 25%, #ffffff 0% 50%) 50% / 18px 18px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.compare img { width: 100%; height: auto; pointer-events: none; }
.compare .layer-before {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #fff;
}
.compare .layer-before img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.compare .divider {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.35);
  cursor: ew-resize;
}
.compare .knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.compare .tag {
  position: absolute;
  top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 2px 10px;
  color: rgba(0, 0, 0, 0.55);
}
.tag-before { left: 10px; }
.tag-after { right: 10px; }

/* 結果の画像プレビュー（QRコードなど） */
.result-preview { padding: 2px 0 10px; }
.result-preview img {
  max-width: 220px;
  max-height: 220px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: #fff;
  padding: 8px;
}

/* 色の抽出（スポイト） */
.cp-bar { align-items: center; gap: 10px 14px; }
.cp-current {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-3);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  transition: background 0.15s, color 0.15s;
}
.cp-current.has { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), var(--shadow-sm); }
.cp-current-swatch {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: repeating-conic-gradient(#d0d0d6 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  flex: none;
}
.cp-current-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.cp-hex { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.cp-rgb { font-size: 12px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.cp-copyicon { margin-left: 2px; opacity: 0.75; }
.cp-copied { font-size: 13px; font-weight: 700; color: #22a94d; min-width: 96px; }
.cp-copied.ng { color: #e0447e; }
.cp-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.cp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 9px;
  padding: 6px 10px;
  font-variant-numeric: tabular-nums;
}
.cp-chip:hover { background: rgba(0, 0, 0, 0.1); }
.cp-swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: none;
}

/* OCRの読み取り結果（その場で読める・コピーできる欄） */
.ocr-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 0 10px;
}
.ocr-text {
  width: 100%;
  min-height: 140px;
  max-height: 320px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.8;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: rgba(0, 0, 0, 0.03);
  color: var(--ink);
  font-family: inherit;
}
.ocr-block .btn { align-self: flex-end; }

/* モデル読み込みの注意書き */
.model-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-3);
  background: rgba(0, 0, 0, 0.035);
  border-radius: 12px;
  padding: 10px 14px;
  line-height: 1.7;
}

/* ---------- 手動お直しブラシ（編集画面） ---------- */
/* ---------- PDFページ整理 ---------- */
.po-top { padding: 12px 16px; border-bottom: 1px solid var(--hairline); background: #fff; }
.po-title { font-weight: 700; font-size: 16px; }
.po-hint { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.po-grid { flex: 1; overflow: auto; padding: 18px; display: flex; flex-wrap: wrap; gap: 18px; align-content: flex-start; justify-content: center; }
.po-card { position: relative; width: 178px; background: #fff; border: 1px solid var(--hairline); border-radius: 12px; padding: 10px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); cursor: grab; }
.po-card.po-dragging { opacity: 0.4; }
/* ドロップ位置の線：ドラッグ中、ここに入るという場所に薄い縦線を出す */
.po-card.po-drop-before::before,
.po-card.po-drop-after::after {
  content: ""; position: absolute; top: 6px; bottom: 6px; width: 3px;
  border-radius: 3px; background: var(--blue); opacity: 0.7; z-index: 6; pointer-events: none;
}
.po-card.po-drop-before::before { left: -9px; }
.po-card.po-drop-after::after { right: -9px; }
/* サムネイル: 縦向き・横向きどちらのページも全体が収まる固定の入れ物（object-fitで自動フィット） */
.po-thumb { position: relative; width: 100%; height: 196px; display: grid; place-items: center; background: #f4f4f6; border-radius: 8px; overflow: hidden; }
.po-thumb img { max-width: 92%; max-height: 92%; object-fit: contain; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.po-loading { color: var(--ink-3); }
/* ページ番号バッジ（画像の左上）と削除ボタン（右上） */
.po-num { position: absolute; top: 7px; left: 7px; z-index: 2; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: rgba(20, 20, 28, 0.62); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.po-del { position: absolute; top: 6px; right: 6px; z-index: 2; width: 30px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #c0392b; font-size: 15px; display: grid; place-items: center; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22); }
.po-del:hover { background: #ffe0e0; }
/* 操作ボタンは大きめ・押しやすく（移動◀▶・回転⟲⟳を横一列で均等に） */
.po-cardbar { display: flex; gap: 6px; margin-top: 10px; }
.po-mini { flex: 1; height: 40px; border-radius: 9px; background: rgba(0, 0, 0, 0.05); display: grid; place-items: center; font-size: 17px; }
.po-mini:hover { background: rgba(0, 0, 0, 0.1); }
/* PCなど広い画面では、タイルを大きくして見やすく・押しやすくする */
@media (min-width: 760px) {
  .po-grid { gap: 24px; padding: 26px; }
  .po-card { width: 232px; padding: 12px; border-radius: 14px; }
  .po-thumb { height: 272px; }
  .po-num { min-width: 28px; height: 28px; font-size: 14px; }
  .po-del { width: 36px; height: 36px; font-size: 16px; }
  .po-cardbar { gap: 8px; margin-top: 12px; }
  .po-mini { height: 48px; font-size: 20px; border-radius: 11px; }
}
/* スマホでは横幅いっぱいを2列で使う（余白を出さない） */
@media (max-width: 560px) {
  .po-grid { gap: 12px; padding: 12px; }
  .po-card { width: calc(50% - 6px); }
  .po-thumb { height: 176px; }
}
.po-empty { color: var(--ink-2); padding: 30px; width: 100%; text-align: center; }
.po-bottom { justify-content: space-between; align-items: center; }
.po-actions { display: flex; gap: 10px; }
.po-status { color: var(--ink-2); font-size: 13px; }
@media (pointer: coarse) { .po-mini { height: 46px; font-size: 18px; } .po-del { width: 34px; height: 34px; } }

/* ---------- PDF余白カット ---------- */
.pt-stage { flex: 1; overflow: hidden; background: #e7e7ec; display: grid; place-items: center; }
.pt-page { position: relative; }
.pt-canvas { display: block; box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }
.pt-crop { position: absolute; border: 1.5px solid #fff; outline: 1px solid var(--blue); box-sizing: border-box; cursor: move; touch-action: none; }
.pt-handle {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  touch-action: none; cursor: nwse-resize;
}
.pt-handle::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #fff;
  border: 2px solid var(--blue); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.be-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #f0f0f3;
  display: flex;
  flex-direction: column;
  /* iPhoneでボタン連打時に画面全体が拡大されるのを防ぐ */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
.be-top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(251, 251, 253, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  flex: none;
}
.be-group { display: flex; align-items: center; gap: 4px; }
.be-group .be-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-right: 4px; }
.be-top button {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 9px;
  padding: 7px 12px;
  transition: background 0.15s;
  white-space: nowrap;
}
.be-top button:hover { background: rgba(0, 0, 0, 0.1); }
.be-top button.on { background: var(--blue); color: #fff; }
.be-top button:disabled { opacity: 0.35; }
.be-size-slider { width: 110px; accent-color: var(--blue); }
.be-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  touch-action: none;
}
.be-stage.bg-checker { background: repeating-conic-gradient(#e4e4e9 0% 25%, #f7f7fa 0% 50%) 50% / 22px 22px; }
.be-stage.bg-white { background: #fff; }
.be-stage.bg-black { background: #17171a; }
.be-canvas { display: block; }
.be-cursor {
  position: absolute;
  border: 1.5px solid rgba(0, 113, 227, 0.9);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8) inset, 0 0 0 1px rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  pointer-events: none;
}
/* 調整エディタの折りたたみパネル */
.ae-right { margin-left: auto; }
.ae-panel {
  flex: none;
  background: rgba(251, 251, 253, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
}
.ae-panel-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.ae-chevron { transition: transform 0.2s; font-size: 16px; }
.ae-panel.closed .ae-chevron { transform: rotate(180deg); }
.ae-panel-body {
  max-height: 34vh;
  overflow-y: auto;
  padding: 2px 18px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 22px;
  transition: max-height 0.2s ease, padding 0.2s ease;
}
.ae-panel.closed .ae-panel-body { max-height: 0; padding-top: 0; padding-bottom: 0; overflow: hidden; }
.ae-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 0;
}
.ae-slider-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  width: 86px;
  flex: none;
}
.ae-slider-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--blue); }
@media (max-width: 700px) {
  .ae-panel-body { grid-template-columns: 1fr; }
}
.ae-busy {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 7px;
  box-shadow: var(--shadow-sm);
}
.spinner.dark { border-color: rgba(0, 0, 0, 0.15); border-top-color: var(--blue); margin: 0; display: block; }

/* 切り抜きエディタの操作バー（比率・傾き） */
.ce-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 8px 16px;
  background: rgba(251, 251, 253, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  flex: none;
}
.ce-bar-label { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-right: 2px; }
.ce-ratios { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ce-bar button {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 9px;
  padding: 6px 10px;
  transition: background 0.15s;
  white-space: nowrap;
}
.ce-bar button:hover { background: rgba(0, 0, 0, 0.1); }
.ce-bar button.on { background: var(--blue); color: #fff; }
.ce-angle { display: flex; align-items: center; gap: 8px; }
.ce-angle input { width: 150px; accent-color: var(--blue); }
.ce-angle-val { font-size: 12px; color: var(--ink-2); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.ce-size { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .ce-bar { gap: 6px 12px; padding: 8px 10px; }
  .ce-angle { flex: 1; }
  .ce-angle input { flex: 1; width: auto; min-width: 90px; }
  .ce-size { margin-left: 0; width: 100%; text-align: right; }
}

/* 統合編集エディタ（パレット） */
.ie-panel { max-height: 34vh; overflow-y: auto; justify-content: center; }
/* 画像の四隅に浮かべる操作ボタン */
.ie-float { position: absolute; display: flex; gap: 6px; z-index: 5; }
.ie-float button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  border-radius: 11px;
  padding: 9px 11px;
  transition: background 0.15s;
}
.ie-float button:hover { background: #fff; }
.ie-float button:disabled { opacity: 0.35; }
.ie-float button.on { background: var(--blue); color: #fff; }
.ie-float-tl { top: 12px; left: 12px; }
.ie-float-tr { top: 12px; right: 12px; }
.ie-float-br { bottom: 14px; right: 12px; flex-direction: column; }
.ie-busy-center { top: 12px; left: 50%; transform: translateX(-50%); right: auto; }
/* 機能タブ（下） */
.ie-tabbar {
  display: flex;
  justify-content: center;
  /* 語の長い言語（スペイン語など）でも切れないよう、入り切らなければ折り返す */
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(251, 251, 253, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  flex: none;
}
.ie-tabbar button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 11px;
  padding: 9px 16px;
  transition: background 0.15s;
  /* 文字が長い言語でも切れないよう、入り切らなければ折り返す */
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-align: center;
}
.ie-tabbar button:hover { background: rgba(0, 0, 0, 0.1); }
.ie-tabbar button.on { background: var(--blue); color: #fff; }
.ie-tabbar button svg, .ce-bar button svg, .ie-float button svg { flex: none; vertical-align: -2px; }
.ce-bar button { display: inline-flex; align-items: center; gap: 5px; }
/* 編集画面のAIボタン（顔をAIでぼかす）＝目立たせる */
.ie-ai-btn {
  color: #fff !important;
  background: linear-gradient(120deg, #7a5cff, #2f89ff) !important;
  box-shadow: 0 2px 8px rgba(90, 90, 255, 0.4);
  font-weight: 700;
}
.ie-ai-btn:hover { filter: brightness(1.06); background: linear-gradient(120deg, #7a5cff, #2f89ff) !important; }
@media (max-width: 640px) {
  .ie-tabbar { gap: 5px; padding: 8px 6px; }
  .ie-tabbar button { padding: 8px 10px; font-size: 12px; gap: 5px; }
  .ie-float button { padding: 8px 9px; font-size: 12px; }
}
.ie-sliders {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 26px;
}
@media (max-width: 900px) { .ie-sliders { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .ie-sliders { grid-template-columns: 1fr; } }
.ie-tabs button.on { background: var(--blue); color: #fff; }

.be-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(251, 251, 253, 0.9);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--hairline);
  flex: none;
}
.be-hint { font-size: 12px; color: var(--ink-3); }
.be-actions { display: flex; gap: 8px; }

/* 「筆でなおす」修正画面だけ: 上に「修正中」の帯を出し、操作ボタンを下へ移す
   （.be-overlay は縦フレックスなので order で並びを入れ替える。画像編集など他の .be-overlay には影響しない） */
.be-fix .be-banner {
  order: 0;
  flex: none;
  padding: 9px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  color: #7a4e00;
  background: #ffe08a;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.be-fix .be-stage { order: 1; }
.be-fix .be-top {
  order: 2;
  border-bottom: none;
  border-top: 1px solid var(--hairline);
}
.be-fix .be-bottom { order: 3; }

/* なぞって選び直す（KeepEditor）: 進捗・お知らせの表示 */
.ke-status {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(29, 29, 31, 0.85);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  padding: 8px 16px;
  border-radius: 999px;
  max-width: 86%;
  text-align: center;
}
.ke-status.err { background: #b3261e; }
/* hidden属性が display:flex に負けないようにする（プレビュー切替用） */
.be-bottom[hidden] { display: none; }

/* ---------- PDFに書き込み（PdfEditEditor） ---------- */
.pe-top {
  position: relative;
  z-index: 20; /* backdrop-filterで重なり階層ができるため、ステージより前面に上げてポップが隠れないようにする */
  background: rgba(251, 251, 253, 0.94);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--hairline);
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}
.pe-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pe-top button {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 9px;
  padding: 7px 11px;
  min-height: 36px;
  transition: background 0.15s;
  white-space: nowrap;
}
.pe-top button:hover { background: rgba(0, 0, 0, 0.1); }
.pe-top button.on { background: var(--blue); color: #fff; }
.pe-top button:disabled { opacity: 0.35; }
.pe-top select {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--hairline);
  background: #fff;
  min-height: 36px;
}
/* ページ切り替え（前・ページ番号・次をひとまとまりに見せる） */
.pe-pager {
  display: flex;
  align-items: stretch;
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.pe-pager button {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--blue);
  background: #fff;
  padding: 0 10px;
  min-height: 34px;
  border-radius: 0;
}
.pe-pager button:disabled { color: #b9b9c2; }
.pe-pageno-box {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border-left: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  background: #f4f6fa;
}
.pe-pageno-box small { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.pe-pageno { font-size: 13.5px; font-weight: 800; min-width: 38px; text-align: center; color: var(--ink); }
.pe-swatches { display: inline-flex; flex-wrap: wrap; gap: 5px; max-width: 220px; }
.pe-swatches button {
  width: 22px; height: 22px; min-height: 22px;
  padding: 0; border-radius: 50%;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
}
.pe-color, .pe-fillcolor { width: 30px; height: 26px; padding: 0; border: none; background: none; cursor: pointer; }
.pe-fontsize, .pe-stroke { width: 60px; text-align: center; }
.pe-fill-none, .pe-color-none { font-size: 12.5px; }
.pe-opacity { width: 96px; vertical-align: middle; accent-color: var(--blue); }
.pe-opacity-val { min-width: 34px; display: inline-block; text-align: right; }
.pe-lockratio.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.pe-aligns { display: inline-flex; gap: 2px; }
.pe-align { padding: 5px 7px; display: inline-flex; align-items: center; }
.pe-align.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.be-group[hidden] { display: none; }

/* 畳めるメニュー（図形・色・塗り） */
.pe-menu { position: relative; display: inline-flex; }
.pe-menu-btn.open { background: var(--blue) !important; color: #fff; }
.pe-menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  padding: 10px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-width: 190px; max-width: 250px;
}
.pe-menu-pop[hidden] { display: none; }
.pe-menu-pop button { font-size: 13px; padding: 8px 10px; border-radius: 9px; background: rgba(0,0,0,0.05); white-space: nowrap; }
.pe-menu-pop button:hover { background: rgba(0,0,0,0.1); }
.pe-menu-pop .pe-swatches { max-width: 100%; }
.pe-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); width: 100%; }
/* 選択中の色を示す丸 */
.pe-curbtn { display: inline-flex; align-items: center; gap: 5px; }
.pe-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,0.25); display: inline-block; }
.pe-dot.none {
  background:
    linear-gradient(45deg, transparent 44%, #e33 44%, #e33 56%, transparent 56%),
    #fff !important;
}

/* 右クリックの文脈メニュー */
.pe-ctxmenu {
  position: fixed;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: 6px;
  min-width: 150px;
  display: flex;
  flex-direction: column;
}
.pe-ctxmenu button {
  text-align: left;
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  white-space: nowrap;
}
.pe-ctxmenu button:hover { background: rgba(0, 0, 0, 0.06); }
.pe-ctxmenu button.danger { color: #c0392b; }
.pe-selbar { background: #eaf2ff; border-radius: 10px; padding: 4px 6px; }
.pe-selbar[hidden] { display: none; }
.pe-stage { position: relative; flex: 1; overflow: hidden; background: #e7e7ec; display: flex; }
/* 左のページ全体像（PCのみ。スマホでは隠す） */
.pe-thumbs {
  flex: none;
  width: 156px;
  overflow: auto;
  background: #f2f2f6;
  border-right: 1px solid var(--hairline);
  padding: 10px;
}
.pe-thumb {
  position: relative;
  margin: 0 auto 10px;
  width: 132px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.15);
  line-height: 0;
}
.pe-thumb.cur { border-color: var(--blue); }
.pe-thumb canvas { width: 132px; height: auto; display: block; border-radius: 2px; }
.pe-thumb-no {
  position: absolute; left: 4px; top: 4px;
  font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px; border-radius: 999px;
}
@media (max-width: 820px) { .pe-thumbs { display: none; } }
.pe-scroll {
  position: relative;
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px;
  display: flex;
}
.pe-objs { touch-action: none; }
.pe-page {
  position: relative;
  margin: auto;
  flex: none;
  background: #fff;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.2);
}
.pe-canvas { display: block; }
.pe-objs { position: absolute; inset: 0; }
.pe-obj { position: absolute; box-sizing: border-box; touch-action: none; }
div.pe-obj { cursor: move; }
svg.pe-obj { overflow: visible; }
.pe-obj.sel { outline: 1.5px dashed var(--blue); outline-offset: 2px; }
.pe-handle {
  position: absolute;
  width: 22px; height: 22px;   /* 当たり判定（指でも押せるよう見た目より広め） */
  margin: -11px 0 0 -11px;
  background: transparent;
  border: none;
  touch-action: none;
  z-index: 5;
  cursor: nwse-resize;
}
.pe-handle::before {            /* 見える丸は小さめに */
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 12px; height: 12px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--blue);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.pe-selrect {                      /* 文字マーカーのなぞり枠 */
  position: absolute;
  z-index: 6;
  background: rgba(37, 99, 235, 0.12);
  border: 1.5px dashed var(--blue);
  pointer-events: none;
}
.pe-roth { cursor: grab; }        /* 回転ハンドルは緑の取っ手で見分ける */
.pe-angle {
  position: absolute; z-index: 9; transform: translate(-50%, -50%);
  background: rgba(20, 20, 28, 0.82); color: #fff; font-size: 12px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}
.pe-roth::before {
  width: 14px; height: 14px;
  border-color: #16a34a;
  background: #eafff1;
}
/* 電子サイン */
.pe-sigpanel {
  position: absolute; top: 96px; right: 16px; z-index: 20;
  width: 260px; max-height: 70vh; overflow: auto;
  background: #fff; border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2); padding: 12px;
}
.pe-sig-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; margin-bottom: 10px; }
.pe-sig-head button { background: rgba(0, 0, 0, 0.05); width: 28px; height: 28px; border-radius: 7px; }
.pe-sig-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.pe-sig-empty { color: var(--ink-2); font-size: 13px; padding: 12px; text-align: center; }
.pe-sig-item { position: relative; border: 1px solid var(--hairline); border-radius: 8px; padding: 6px; background: #fafafa; }
.pe-sig-item img { display: block; max-width: 100%; max-height: 70px; margin: 0 auto; cursor: pointer; }
.pe-sig-del { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 6px; background: rgba(255, 255, 255, 0.9); font-size: 12px; }
.pe-sig-del:hover { background: #ffe0e0; color: #c0392b; }
.pe-sig-new { width: 100%; padding: 10px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 600; }
.pe-sigpad-wrap { position: absolute; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.4); display: grid; place-items: center; }
.pe-sigpad-box { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); max-width: 92vw; }
.pe-sigpad { display: block; background: #fff; border: 1.5px dashed var(--hairline); border-radius: 8px; max-width: 86vw; touch-action: none; cursor: crosshair; }
.pe-sigpad-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.pe-sigpad-clear { padding: 9px 16px; border-radius: 10px; background: rgba(0, 0, 0, 0.06); font-weight: 600; }
.pe-sigpad-ok { padding: 9px 18px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 700; }

.pe-editta {
  position: absolute;
  z-index: 6;
  background: transparent; /* 入力中も下の内容が透けて見えるように */
  border: 1.5px dashed var(--blue);
  border-radius: 4px;
  padding: 2px 4px;
  min-height: 1.7em;
  resize: both;
}
.pe-bottom select.pe-outfmt {
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: #fff;
  /* スマホの狭い幅では選択欄が縮んで、保存ボタンが画面外に押し出されないようにする */
  flex: 1 1 120px;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.pe-bottom .btn { flex: none; } /* キャンセル・保存は縮めない（保存が必ず見える） */
/* 部品を包む内側の箱ごと縮められるようにする（これが無いと select が縮まず保存がはみ出す） */
.pe-bottom .be-actions { flex: 1 1 auto; min-width: 0; align-items: center; }
.pe-orderpanel {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  min-width: 260px;
  max-height: 70%;
  overflow: auto;
}
.pe-order-title { font-size: 13px; font-weight: 700; }
.pe-order-hint { font-size: 11.5px; color: var(--ink-2); margin: 2px 0 10px; }
/* ページのサムネイル一覧（見たまま並べ替え） */
.pe-order-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-width: min(76vw, 460px);
}
.pe-order-card {
  position: relative;
  width: 96px;
  padding: 4px;
  border: 2px solid var(--hairline);
  border-radius: 10px;
  background: #fafafc;
  cursor: pointer;
}
.pe-order-card.cur { border-color: var(--blue); background: #eef4ff; }
.pe-order-num {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 2;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(20, 20, 28, 0.65);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.pe-order-thumb {
  height: 110px;
  display: grid;
  place-items: center;
  background: #f1f1f4;
  border-radius: 7px;
  overflow: hidden;
}
.pe-order-thumb img { max-width: 100%; max-height: 100%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.pe-order-loading { color: var(--ink-3); }
.pe-order-move { display: flex; gap: 4px; margin-top: 4px; }
.pe-order-move button {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 7px;
  min-height: 30px;
}
.pe-order-move button:disabled { opacity: 0.3; }
.pe-order-actions { text-align: right; margin-top: 8px; }
.pe-order-actions button { background: rgba(0, 0, 0, 0.06); border-radius: 8px; padding: 6px 14px; font-size: 13px; font-weight: 600; }
@media (max-width: 700px) {
  .pe-row { gap: 6px; }
  .pe-top { padding: 6px 8px; }
  .pe-top button { padding: 7px 9px; font-size: 12.5px; }
}

/* ---------- 画像に文字入れ（ImgTextEditor） ---------- */
.it-top { flex-direction: column; align-items: stretch; gap: 8px; }
.it-toolrow { display: flex; align-items: center; gap: 8px; }
.it-toolrow .it-add { margin-right: auto; } /* 「文字を追加」を左、戻す等を右へ */
.it-proprow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.it-mini {
  font-size: 14px; font-weight: 700; color: var(--ink);
  background: rgba(0, 0, 0, 0.05); border-radius: 8px; padding: 6px 10px; min-height: 34px;
}
.it-mini:hover { background: rgba(0, 0, 0, 0.1); }
.it-mini:disabled { opacity: 0.35; }
.it-font { font-size: 13px; font-weight: 600; padding: 7px 8px; border-radius: 9px; border: 1px solid var(--hairline); background: #fff; max-width: 44vw; }
.it-grp { display: inline-flex; align-items: center; gap: 6px; }
.it-grp small { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.it-size { font-size: 13px; font-weight: 700; min-width: 30px; text-align: center; }
.it-aligns, .it-styles, .it-widths { display: inline-flex; gap: 3px; background: rgba(0, 0, 0, 0.05); border-radius: 9px; padding: 3px; }
.it-align, .it-style, .it-width { font-size: 13px; font-weight: 700; color: var(--ink-2); background: transparent; border-radius: 7px; padding: 5px 9px; min-height: 30px; }
.it-align.on, .it-style.on, .it-width.on { background: var(--blue); color: #fff; }
.it-curband { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--ink); background: rgba(0,0,0,0.05); border-radius: 9px; padding: 5px 9px; min-height: 34px; }
.it-curband small { font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.it-band-auto { display: block; width: 100%; text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 6px 4px; margin-bottom: 6px; border-bottom: 1px solid var(--hairline); }
.it-angle {
  position: absolute; z-index: 9; transform: translate(-50%, -50%);
  background: rgba(20, 20, 28, 0.82); color: #fff; font-size: 12px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; pointer-events: none; white-space: nowrap;
}
.it-menu { position: relative; display: inline-flex; }
.it-curcolor { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; background: rgba(0,0,0,0.05); border-radius: 9px; padding: 5px 9px; min-height: 34px; }
.it-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(0, 0, 0, 0.25); display: inline-block; }
.it-menu-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 10;
  background: #fff; border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18); padding: 10px; width: max-content; max-width: 260px;
}
.it-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.it-swatches button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, 0.12); }
.it-pick { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.it-opac { min-width: 150px; }
.it-opacity { flex: 1; accent-color: var(--blue); min-width: 80px; }
.it-opacity-val { font-size: 12px; font-weight: 700; color: var(--ink-2); min-width: 38px; text-align: right; }
.it-stage { display: grid; place-items: center; padding: 12px; }
.it-page { position: relative; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22); }
.it-img { display: block; user-select: none; -webkit-user-drag: none; }
.it-objs { position: absolute; inset: 0; }
.it-obj {
  position: absolute; z-index: 2; cursor: move; line-height: 1.22;
  white-space: pre; user-select: none; touch-action: none;
}
.it-obj.sel { outline: 1.5px dashed var(--blue); outline-offset: 3px; }
.it-imgobj { background-repeat: no-repeat; background-position: center; }
.it-toolspace { flex: 1; }
/* レイヤー一覧パネル */
.it-layerpanel {
  position: absolute; top: 10px; right: 10px; z-index: 12; width: 230px; max-height: 78%;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--hairline); border-radius: 14px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22); overflow: hidden;
}
.it-lyr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 12.5px; font-weight: 800; border-bottom: 1px solid var(--hairline); }
.it-lyr-close { font-size: 14px; color: var(--ink-2); padding: 2px 6px; }
.it-lyr-list { overflow: auto; padding: 6px; }
.it-lyr-empty { color: var(--ink-3); font-size: 12.5px; padding: 18px 8px; text-align: center; }
.it-lyr-row { display: flex; align-items: center; gap: 3px; padding: 3px; border-radius: 8px; }
.it-lyr-row.cur { background: #eef4ff; }
.it-lyr-sel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; text-align: left; padding: 5px 4px; }
.it-lyr-ic { flex: none; width: 26px; height: 26px; border-radius: 6px; background-size: cover; background-position: center; background-color: #f1f1f4; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.it-lyr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; }
.it-lyr-eye, .it-lyr-up, .it-lyr-down, .it-lyr-del { flex: none; width: 26px; height: 30px; border-radius: 7px; font-size: 12px; color: var(--ink-2); }
.it-lyr-eye:hover, .it-lyr-up:hover, .it-lyr-down:hover, .it-lyr-del:hover { background: rgba(0, 0, 0, 0.06); }
.it-lyr-up:disabled, .it-lyr-down:disabled { opacity: 0.3; }
.it-lyr-del:hover { background: #ffe0e0; color: #c0392b; }
@media (max-width: 560px) { .it-layerpanel { width: 200px; } }
.it-editta {
  position: absolute; z-index: 6; line-height: 1.22; resize: none; overflow: hidden;
  background: rgba(255, 255, 255, 0.14); border: 1.5px dashed var(--blue); border-radius: 4px;
  padding: 0; min-height: 1.2em;
}
.it-handle { position: absolute; z-index: 8; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #fff; border: 2px solid var(--blue); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); touch-action: none; }
.it-scale { cursor: nwse-resize; }
.it-roth { cursor: grab; border-color: #22a04b; }
.it-status { color: var(--ink-2); font-size: 13px; }
.it-status.err { color: #c0392b; font-weight: 700; }
.it-bottom { justify-content: space-between; }
.it-bottom select.it-outfmt { font-size: 13.5px; font-weight: 600; padding: 10px; border-radius: 12px; border: 1px solid var(--hairline); background: #fff; flex: 0 1 auto; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .it-proprow { gap: 6px 8px; }
  .it-font { max-width: 40vw; }
  .it-opac { min-width: 120px; }
}
/* 白紙から作る（サイズ・背景の選択画面） */
.it-setupov { z-index: 320; background: rgba(0, 0, 0, 0.4); align-items: center; justify-content: center; padding: 16px; }
.it-setup {
  width: min(520px, 100%); max-height: 100%; overflow: auto;
  background: #fff; border-radius: 18px; padding: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}
.it-setup h2 { font-size: 17px; font-weight: 800; margin: 0 0 4px; }
.it-setup-note { color: var(--ink-3); font-size: 12.5px; margin: 0; }
.it-setup-label { font-size: 12.5px; font-weight: 800; color: var(--ink-2); margin: 16px 0 8px; }
.it-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.it-sizebtn { border: 1.5px solid var(--hairline); border-radius: 12px; padding: 8px 12px; font-size: 13px; font-weight: 700; background: #fff; text-align: center; }
.it-sizebtn small { display: block; font-weight: 500; color: var(--ink-3); font-size: 11px; }
.it-sizebtn.on { border-color: var(--blue); background: #eef4ff; color: var(--blue); }
.it-sizebtn.on small { color: var(--blue); }
.it-freewh { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.it-freewh input { width: 86px; padding: 7px 9px; border: 1px solid var(--hairline); border-radius: 9px; font-size: 14px; }
.it-bgrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.it-bgsw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.12); }
.it-bgsw.on { outline: 2.5px solid var(--blue); outline-offset: 2px; }
.it-bgsw.tr { background: repeating-conic-gradient(#d9d9df 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.it-bgrow .it-pick { margin-top: 0; }
/* ＋画像の「そのまま／背景を透過して」メニュー */
.it-imgchoice { display: block; width: 100%; text-align: left; font-size: 13px; font-weight: 700; color: var(--ink); padding: 8px 6px; border-radius: 8px; }
.it-imgchoice:hover { background: rgba(0, 0, 0, 0.05); }
.it-imgchoice small { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); margin-top: 2px; }
.it-imgchoice + .it-imgchoice { border-top: 1px solid var(--hairline); border-radius: 0 0 8px 8px; }
.it-setup-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

@media (max-width: 700px) {
  .be-hint { display: none; }
  .be-top { gap: 8px; padding: 8px 10px; }
  /* 幅の狭いスマホでは、下バーのボタンが画面外にはみ出さないよう縮められるようにする
     （長いボタン名は…で省略。ボタン自体は必ず画面内に残る） */
  .be-bottom .be-actions { flex: 1 1 auto; min-width: 0; justify-content: flex-end; }
  .be-bottom .be-actions .btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 960px) {
  .tools { grid-template-columns: repeat(2, 1fr); }
  .card-hero { grid-column: span 2; grid-row: span 1; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  /* スマホは枠が狭く移動距離も短いので、歩く時間は短めでちょうどいい */
  .dz-stroller { animation-duration: 9s; }
  /* スマホは2列のコンパクト表示（説明文は省いて半分サイズに） */
  .tools { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* タイルの高さを揃える（タイトル・説明が1行でも2行でも同じ高さに） */
  .card { padding: 16px 14px 14px; gap: 6px; border-radius: 18px; min-height: 166px; justify-content: flex-start; }
  .card .icon { width: 40px; height: 40px; border-radius: 11px; }
  .card h3 { font-size: 15px; line-height: 1.35; }
  /* 説明文はスマホでも表示（2行に収める） */
  .card p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.55;
  }
  /* バナーカードはスマホでも横並び・全幅のまま（薄くなりすぎないように） */
  .card-banner { flex-direction: row; min-height: 0; padding: 20px 16px; }
  .card-banner .icon { width: 46px; height: 46px; }
  .card-banner .banner-text p { display: block; font-size: 12px; line-height: 1.55; }
  .card-banner .banner-cta { display: none; }
  .card-hero { grid-column: span 2; grid-row: span 1; }
  .card-hero p { display: block; font-size: 13px; }
  .card-hero .demo { margin-top: 4px; }
  .card-hero .badge { top: 14px; right: 14px; font-size: 11px; }
  .card-wide { grid-column: span 1; }
  .hero { padding-top: 48px; }
  .nav-note span { display: none; }
  /* AIバッジはスマホの小さいカードでも収まるよう小さく */
  .ai-badge { top: 10px; right: 10px; font-size: 10px; padding: 2px 7px 2px 6px; gap: 3px; }
  .ai-badge svg { width: 9px; height: 9px; }
}

/* ---------- スライダー（画像の調整） ---------- */
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type="range"] { flex: 1; accent-color: var(--blue); }
.slider-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  min-width: 42px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* プレビューはシートの上部に貼り付き、スライダーを触っている間も見え続ける */
.preview-wrap {
  position: sticky;
  top: -20px;
  z-index: 5;
  background: #fbfbfd;
  padding: 6px 0 10px;
  margin-bottom: 4px;
  box-shadow: 0 8px 12px -10px rgba(0, 0, 0, 0.18);
}
.live-preview {
  margin: 6px auto 0;
  width: fit-content;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background:
    repeating-conic-gradient(#ececf1 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
  display: flex;
  justify-content: center;
}
.live-preview canvas {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 34vh;
}
.live-preview-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

/* ファイルを入れたあとの小さく畳んだドロップ枠 */
.sheet-drop.compact { padding: 9px 14px; }
.sheet-drop.compact p { font-size: 13px; color: var(--ink-2); }
.sheet-drop.compact .sub { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* タッチ端末（iPhoneなど）: 文字入力欄にフォーカスした時の勝手な画面拡大を防ぐ */
@media (pointer: coarse) {
  .name-edit, .opt-text { font-size: 16px; }
  .card, .btn, .seg button { touch-action: manipulation; }
}

/* ============================================================
   多言語対応（i18n）: 言語切替UI・言語別フォント・改行の自然化
   ============================================================ */

/* --- ヘッダーの並び：ブランド左／プライバシー表記＋言語切替を右へ --- */
.nav-inner { justify-content: flex-start; }
.nav-note { margin-left: auto; }

/* --- 言語切替（🌐） --- */
.lang-switch { position: relative; margin-left: 12px; flex: none; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: rgba(0, 0, 0, 0.05); border-radius: 999px;
  padding: 6px 11px; cursor: pointer; transition: background 0.15s;
}
.lang-btn:hover { background: rgba(0, 0, 0, 0.09); }
.lang-btn svg { flex: none; }
.lang-cur { white-space: nowrap; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 400;
  margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--hairline); border-radius: 12px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.16); min-width: 156px;
}
.lang-menu li {
  padding: 9px 12px; border-radius: 8px; font-size: 14px;
  cursor: pointer; white-space: nowrap; color: var(--ink);
}
.lang-menu li:hover { background: rgba(0, 0, 0, 0.05); }
.lang-menu li.on { color: var(--blue); font-weight: 700; }
@media (max-width: 560px) {
  .lang-cur { display: none; }          /* スマホは地球アイコンだけ（省スペース） */
  .lang-btn { padding: 7px 9px; }
  .lang-switch { margin-left: 8px; }
}

/* --- 言語別フォント（中国語・韓国語はOS標準の美しいフォントを使う＝軽い） --- */
html[lang="zh-Hant"] body {
  font-family: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Hiragino Sans CNS", "LINE Seed JP", sans-serif;
}
html[lang="ko"] body {
  font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "LINE Seed JP", sans-serif;
}

/* --- 改行の自然化（特にスマホ） --- */
/* 見出しは行のバランスを取る（短い見出しの不格好な折り返しを防ぐ） */
h1, .tools-head h2, .card h3 { text-wrap: balance; }
/* 本文は「最後の行が1語だけ」などを減らす */
.lede, .card p, .sub, .banner-text p { text-wrap: pretty; }
/* 長い単語やURLがはみ出さないように */
.card h3, .card p, .lede, .sub, .banner-text p { overflow-wrap: break-word; }
/* 日本語：文節（意味のまとまり）の切れ目で改行する */
html[lang="ja"] h1,
html[lang="ja"] .tools-head h2,
html[lang="ja"] .card h3,
html[lang="ja"] .card p,
html[lang="ja"] .lede,
html[lang="ja"] .sub,
html[lang="ja"] .banner-text p { word-break: auto-phrase; line-break: strict; }
/* 中国語：約物（句読点など）の禁則処理を正しく */
html[lang="zh-Hant"] h1,
html[lang="zh-Hant"] .card h3,
html[lang="zh-Hant"] .card p,
html[lang="zh-Hant"] .lede,
html[lang="zh-Hant"] .banner-text p { line-break: strict; }
/* ラテン系（特にドイツ語）は自動ハイフネーションで自然に折る */
html[lang="de"] .card p, html[lang="de"] .lede, html[lang="de"] .banner-text p,
html[lang="es"] .card p, html[lang="es"] .banner-text p,
html[lang="pt-BR"] .card p, html[lang="pt-BR"] .banner-text p { hyphens: auto; }

/* ---------- 料金プラン ---------- */
.pricing { max-width: 1060px; margin: 0 auto; padding: 64px 22px 24px; }
/* 料金ページの「トップへ戻る」 */
.back-link {
  display: inline-block;
  margin-bottom: 26px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.04);
  transition: color 0.2s, background 0.2s;
}
.back-link:hover { color: var(--blue); background: rgba(0, 113, 227, 0.08); }
.pricing-head { text-align: center; margin-bottom: 40px; }
.pricing-eyebrow {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.pricing-head h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.022em; }
.pricing-head > p { color: var(--ink-2); margin-top: 10px; font-size: 16px; }

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan {
  position: relative;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 30px 26px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.plan.featured {
  border: 2px solid var(--blue);
  box-shadow: var(--shadow-lg);
  transform: translateY(-6px);
}
.plan-flag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(92deg, #6a5cff 0%, #0090f7 55%, #00b8c8 100%);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.28);
}
.plan-name { font-size: 19px; font-weight: 700; }
.plan-for { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.price-row { margin: 18px 0 4px; display: flex; align-items: baseline; gap: 3px; }
.price-cur { font-size: 20px; font-weight: 700; }
.price-num { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.price-unit { font-size: 15px; color: var(--ink-2); font-weight: 600; margin-left: 2px; }
.price-sub { font-size: 13px; color: var(--ink-3); min-height: 18px; }
.price-alt { font-size: 15px; color: var(--ink-2); margin-top: 4px; }
.price-alt b { font-size: 21px; font-weight: 800; color: var(--ink); letter-spacing: -0.01em; }
.plan .btn { width: 100%; margin: 22px 0 4px; }
.btn.ghost { background: transparent; color: var(--blue); border: 1.5px solid var(--blue); }
.btn.ghost:hover { background: rgba(0, 113, 227, 0.06); }
.plan-note { font-size: 12px; color: var(--ink-3); text-align: center; }
.plan-soon {
  margin-top: 12px;
  font-size: 13px;
  color: var(--blue);
  background: rgba(0, 113, 227, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
}

.feat { list-style: none; margin: 20px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.feat li { display: flex; gap: 10px; font-size: 14px; color: var(--ink); line-height: 1.45; text-align: left; }
.feat li svg { flex: 0 0 auto; margin-top: 2px; color: var(--blue); }
.feat li b { font-weight: 700; }
.feat li.no { color: var(--ink-3); }
.feat li.no svg { color: var(--ink-3); }

@media (max-width: 860px) {
  .plans { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .plan.featured { transform: none; }
  .pricing { padding-top: 48px; }
}

/* ---------- 画面内の確認ダイアログ ----------
   ブラウザ標準の confirm が出ない端末でも確実に確認できるようにするためのもの */
.ask-ov {
  position: fixed;
  inset: 0;
  z-index: 500; /* 全画面の編集画面（300番台）より前に出す */
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.ask-box {
  width: min(380px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}
.ask-msg {
  margin: 0 0 18px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.ask-row { display: flex; gap: 10px; }
.ask-row .btn { flex: 1; padding: 12px 16px; font-size: 15.5px; justify-content: center; }
