:root {
  /* ===== 案B「Workshop Earth」 ベージュ基調 + アースカラー 4機能 =====
     2026-05-20 適用: サイト全体のベージュ + テラコッタに統一し、 4機能エリアはアース系で識別 */
  --bg:  #ede4d3;   /* メイン背景 (サイトと同じ) */
  --bg2: #f5eee0;   /* カラム背景 (オフホワイト) */
  --bg3: #fbf6ec;   /* カード背景 (ivory) */
  --bg4: #e0d4be;   /* 見出し帯 (深ベージュ) */
  --text:  #2a2218;   /* 本文・濃茶 */
  --text2: #5b4a35;   /* サブ・中茶 */
  --text3: #8b7861;   /* キャプション・淡茶 */
  --accent:  #c8541e;
  --accent2: #b04a18;
  --accent-soft-12: rgba(200,84,30,0.12);
  --accent-soft-18: rgba(200,84,30,0.18);
  --accent-soft-25: rgba(200,84,30,0.25);
  --border:        rgba(42,34,24,0.12);
  --border-strong: rgba(42,34,24,0.22);
  --shadow:        rgba(42,34,24,0.10);
  --danger:  #a14242;   /* ボルドー */
  --success: #6b8e6f;   /* セージグリーン */
  /* 4機能エリア別アクセントカラー (アースパレット) */
  --c-input:  #c8541e;   /* 入力 (dropzone, actions): テラコッタ */
  --c-data:   #6a7c9a;   /* データ (image-list): ダスティブルー */
  --c-config: #b89968;   /* 設定 (settings): マスタード */
  --c-secure: #6b8e6f;   /* セキュリティ: セージグリーン */
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
input, select, textarea { font-size: 16px !important; }
button, a { touch-action: manipulation; }

/* === Header === */
header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
header h1 {
  font-family: "Cormorant Garamond", "Yu Mincho", serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--text);
}
.header-right { display: flex; gap: 10px; align-items: center; }
.header-link {
  color: var(--text2);
  text-decoration: none;
  font-size: 0.82rem;
  font-family: "Cormorant Garamond", "Yu Mincho", serif;
  letter-spacing: 0.12em;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.18s ease;
}
.header-link .em { color: #c8541e; }
.header-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft-12);
}

/* === Layout === */
.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
.lead {
  text-align: center;
  color: var(--text2);
  font-size: 0.92rem;
  margin-bottom: 24px;
  line-height: 1.7;
}

/* === Drop Zone (Orange theme) === */
.dropzone {
  border: 2px dashed rgba(200, 84, 30, 0.45);
  border-radius: 14px;
  padding: 50px 20px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(200, 84, 30, 0.14), rgba(176, 74, 24, 0.04));
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  /* Plan D-Bold: orange-tinted card */
  box-shadow:
    0 6px 20px rgba(200, 84, 30, 0.10),
    0 4px 14px rgba(42, 34, 24, 0.5),
    inset 0 1px 0 rgba(42, 34, 24, 0.05);
}
.dropzone:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(200, 84, 30, 0.22), rgba(176, 74, 24, 0.08));
}
.dropzone.drag-over {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(200, 84, 30, 0.30), rgba(176, 74, 24, 0.12));
  border-style: solid;
}
.dropzone-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  display: block;
}
.dropzone-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--c-input);
}
.dropzone-hint {
  color: var(--text2);
  font-size: 0.85rem;
  line-height: 1.7;
}
.dropzone-hint kbd {
  display: inline-block;
  padding: 2px 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
}

/* === Image List (Cyan theme) === */
.image-list {
  margin-top: 22px;
  display: grid;
  gap: 10px;
  /* Plan D-Bold: cyan-tinted container card */
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(106, 124, 154, 0.10), rgba(106, 124, 154, 0.02));
  border: 1px solid rgba(106, 124, 154, 0.30);
  border-radius: 14px;
  box-shadow:
    0 6px 20px rgba(106, 124, 154, 0.08),
    0 4px 14px rgba(42, 34, 24, 0.5),
    inset 0 1px 0 rgba(42, 34, 24, 0.05);
}
.image-list::before {
  content: "📁 読み込み済み画像";
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--c-data);
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}
.image-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  background: rgba(42, 34, 24, 0.35);
  border: 1px solid rgba(106, 124, 154, 0.18);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.18s ease;
}
.image-item:hover { border-color: rgba(106, 124, 154, 0.5); }
.image-item.processing { border-color: var(--accent); }
.image-item.done { border-color: var(--success); }
.image-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--bg3) center/cover no-repeat;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.image-info { min-width: 0; }
.image-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.image-meta {
  font-size: 0.75rem;
  color: var(--text2);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.image-meta .arrow { color: var(--accent); font-weight: 700; }
.image-actions { display: flex; gap: 6px; flex-shrink: 0; }
.image-action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.18s ease;
}
.image-action-btn:hover {
  background: var(--accent-soft-18);
  color: var(--accent);
  border-color: var(--accent);
}
.image-action-btn.danger:hover {
  background: rgba(161,66,66,0.20);
  color: var(--danger);
  border-color: var(--danger);
}

/* === Settings Panel (Purple theme) === */
.settings {
  margin-top: 22px;
  background:
    linear-gradient(135deg, rgba(184, 153, 104, 0.10), rgba(184, 153, 104, 0.02));
  border: 1px solid rgba(184, 153, 104, 0.30);
  border-radius: 14px;
  padding: 20px;
  /* Plan D-Bold: purple-tinted card */
  box-shadow:
    0 6px 20px rgba(184, 153, 104, 0.08),
    0 4px 14px rgba(42, 34, 24, 0.5),
    inset 0 1px 0 rgba(42, 34, 24, 0.05);
}
.settings h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--c-config);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}
.setting-row:last-child { margin-bottom: 0; }
.setting-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text2);
}
.setting-control { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.radio-btn {
  padding: 7px 14px;
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.radio-btn:hover { border-color: var(--accent-soft-25); }
.radio-btn.active {
  background: var(--accent);
  color: #fff8ec;
  border-color: var(--accent);
  font-weight: 700;
}
.size-input {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 7px 10px;
  width: 100px;
  text-align: right;
}
.size-input:focus { outline: none; border-color: var(--accent); }
.size-input:disabled { opacity: 0.4; cursor: not-allowed; }
.unit-label { color: var(--text2); font-size: 0.85rem; margin-left: 2px; }
.quality-slider {
  flex: 1;
  min-width: 120px;
  max-width: 260px;
  height: 24px;
  accent-color: var(--accent);
}
.quality-value {
  display: inline-block;
  min-width: 38px;
  text-align: right;
  color: var(--accent);
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

/* === Action Buttons (Orange theme) === */
.actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Plan D-Bold: orange-tinted card panel */
  background:
    linear-gradient(135deg, rgba(200, 84, 30, 0.14), rgba(176, 74, 24, 0.04));
  border: 1px solid rgba(200, 84, 30, 0.35);
  border-radius: 14px;
  padding: 18px;
  box-shadow:
    0 6px 20px rgba(200, 84, 30, 0.10),
    0 4px 14px rgba(42, 34, 24, 0.5),
    inset 0 1px 0 rgba(42, 34, 24, 0.05);
}
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.action-note {
  font-size: 0.78rem;
  color: var(--text2);
  text-align: center;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid rgba(42, 34, 24, 0.06);
}
.action-note strong {
  color: var(--accent);
  font-weight: 700;
}
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff8ec;
  box-shadow: 0 4px 14px rgba(200,84,30,0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(200,84,30,0.5);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--accent-soft-12);
  color: var(--accent);
  border-color: var(--accent);
}

/* === セキュリティ・プライバシーの方針 === */
.security-section {
  margin-top: 22px;
  background: linear-gradient(135deg, rgba(107, 142, 111, 0.08), rgba(107, 142, 111, 0.03));
  border: 1px solid rgba(107, 142, 111, 0.25);
  border-radius: 14px;
  padding: 24px;
}
.security-head {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(107, 142, 111, 0.18);
}
.security-head h2 { font-size: 1.1rem; color: var(--success); }
.security-head .sub { color: var(--text2); font-size: 0.82rem; margin-top: 2px; }
.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.security-item {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px;
}
.security-item h4 { font-size: 0.86rem; margin-bottom: 5px; color: var(--success); }
.security-item p { font-size: 0.8rem; color: var(--text2); line-height: 1.6; }
.security-promise {
  background: rgba(107, 142, 111, 0.06);
  border-left: 3px solid var(--success);
  padding: 12px 16px;
  border-radius: 5px;
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.65;
}
.security-promise .label {
  display: inline-block;
  background: var(--success);
  color: #fff8ec;
  padding: 2px 9px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-right: 8px;
}

/* === Preset Buttons === */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.preset-btn {
  padding: 5px 12px;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}
.preset-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft-12);
}
.preset-btn.active {
  background: var(--accent);
  color: #fff8ec;
  border-color: var(--accent);
  font-weight: 700;
}

/* === Predicted Size === */
.predicted {
  color: var(--accent);
  font-weight: 700;
}
.predicted-loading { opacity: 0.5; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg3);
  color: var(--text);
  padding: 12px 22px;
  border-radius: 50px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  box-shadow: 0 6px 20px var(--shadow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.success { border-color: var(--success); color: var(--success); }

/* === Footer === */
footer {
  text-align: center;
  padding: 30px 20px 20px;
  color: var(--text3);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
footer a { color: var(--text2); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* === Mobile === */
@media (max-width: 768px) {
  header { padding: 10px 14px; }
  header h1 { font-size: 1.05rem; }
  .header-link { padding: 5px 10px; font-size: 0.78rem; }
  .app { padding: 16px 14px 40px; }
  .dropzone { padding: 36px 16px; }
  .dropzone-icon { font-size: 2rem; }
  .dropzone-title { font-size: 0.95rem; }
  .image-item { grid-template-columns: 52px 1fr auto; gap: 10px; padding: 8px 10px; }
  .image-thumb { width: 52px; height: 52px; }
  .image-name { font-size: 0.82rem; }
  .image-meta { font-size: 0.7rem; }
  .settings { padding: 16px; }
  .setting-row { grid-template-columns: 1fr; gap: 6px; }
  .setting-label { font-size: 0.78rem; }
  .btn { padding: 11px 20px; font-size: 0.9rem; }
}
