  :root {
    --bg: #f4f5f0;
    --surface: #ffffff;
    --surface-alt: #ebede4;
    --border: #d7dbce;
    --border-strong: #c2c9b6;
    --text: #232922;
    --text-muted: #667062;
    --accent: #2f6f5e;
    --accent-strong: #204a3f;
    --on-accent: #ffffff;
    --danger: #b54b3a;
    --danger-bg: #f8e6e1;
    --danger-border: #dda293;
    --success: #4c7a3d;
    --success-bg: #e6efdf;
    --success-border: #b6d2a4;
    --shadow-md: 0 6px 20px rgba(35, 41, 34, 0.08), 0 2px 6px rgba(35, 41, 34, 0.05);
    --font-display: "BIZ UDPGothic", "Hiragino Maru Gothic ProN", "Yu Gothic UI", "Meiryo UI", "Segoe UI", sans-serif;
    --font-body: "Hiragino Kaku Gothic ProN", "Yu Gothic Medium", "Yu Gothic", "Meiryo", "Segoe UI", sans-serif;
    color-scheme: light;
  }

  @media (prefers-color-scheme: dark) {
    :root {
      --bg: #1a201a;
      --surface: #232a22;
      --surface-alt: #2a322a;
      --border: #3b453a;
      --border-strong: #4c584a;
      --text: #ecefe6;
      --text-muted: #a3ad9a;
      --accent: #5cb298;
      --accent-strong: #7fcab1;
      --on-accent: #0f1a15;
      --danger: #e0846f;
      --danger-bg: #3a231e;
      --danger-border: #7a4638;
      --success: #8fc27a;
      --success-bg: #24331f;
      --success-border: #4c6a3f;
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
      color-scheme: dark;
    }
  }

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

  h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
  a { color: var(--accent); }

  /* ---------- Auth screens (login / pending / index) ---------- */
  .auth-body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
  }
  .auth-box {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    padding: 28px 26px 24px;
  }
  .auth-logo { text-align: center; margin-bottom: 18px; }
  .auth-logo img { max-height: 32px; margin-bottom: 10px; }
  .auth-logo h1 { font-size: 19px; font-family: var(--font-display); }
  .auth-sub { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }
  .auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
  .auth-tabs a {
    flex: 1; text-align: center; padding: 10px 4px; font-size: 13.5px; font-weight: 700;
    color: var(--text-muted); text-decoration: none; border-bottom: 3px solid transparent;
  }
  .auth-tabs a.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
  .auth-form { display: flex; flex-direction: column; gap: 14px; }
  .auth-form label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
  .auth-form label input, .auth-form label select { margin-top: 5px; }
  .auth-form .hp { position: absolute; left: -9999px; }
  .auth-radio-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; font-size: 13.5px; }
  .auth-radio-label { font-weight: 700; width: 100%; }
  .auth-radio { display: flex; align-items: center; gap: 5px; font-weight: 500; }
  .auth-note { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin: 0; }
  .auth-footer { text-align: center; font-size: 12.5px; color: var(--text-muted); margin: 18px 0 0; }
  .alert { border-radius: 8px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 14px; line-height: 1.6; }
  .alert-error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-border); }
  .alert-ok { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

  select, input[type="text"], input[type="password"], input[type="email"], textarea {
    width: 100%;
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    border-radius: 10px;
    padding: 11px 13px;
  }
  select:focus, input:focus, textarea:focus { border-color: var(--accent); }

  .btn-main {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15.5px;
    padding: 12px 20px;
    cursor: pointer;
    border: 1.5px solid transparent;
    background: var(--accent);
    color: var(--on-accent);
    min-height: 46px;
  }
  .btn-main:hover { background: var(--accent-strong); }

  /* ---------- Editor dashboard ---------- */
  .app {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100%;
  }
  .app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .app-header-top {
    max-width: 900px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
  }
  .brand { display: flex; align-items: center; gap: 10px; }
  .brand-mark {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--accent); color: var(--on-accent);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 700; font-size: 15px; flex-shrink: 0;
  }
  .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
  .brand-tag { font-size: 12px; color: var(--text-muted); }
  .org-badge {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-alt); border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 14px 6px 10px; font-size: 13.5px; color: var(--text-muted);
  }
  .org-badge strong { color: var(--text); font-weight: 700; }
  .org-avatar {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--surface-alt); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
  }

  main { max-width: 900px; margin: 0 auto; padding: 24px 20px 80px; }
  .page-intro { margin-bottom: 20px; }
  .page-intro h1 { font-size: 22px; }
  .page-intro p { color: var(--text-muted); margin: 8px 0 0; font-size: 14.5px; }

  .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px 22px 22px;
    box-shadow: var(--shadow-md);
    margin-bottom: 18px;
  }
  .card h2 { font-size: 17px; margin-bottom: 3px; }
  .card .card-desc { color: var(--text-muted); font-size: 13.5px; margin: 0 0 16px; }
  .field-group { display: flex; flex-direction: column; gap: 14px; }
  .field-label { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 6px; color: var(--text); }
  .field-label input, .field-label textarea, .field-label select { margin-top: 6px; }
  .key-row { display: flex; gap: 10px; }
  .key-row > * { flex: 1; }
  .inline-note {
    background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 8px; padding: 10px 13px; font-size: 13px; line-height: 1.6; margin-top: 4px;
  }

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: 10px; font-weight: 700; font-size: 14.5px; padding: 10px 18px;
    cursor: pointer; border: 1.5px solid transparent; min-height: 40px; text-decoration: none;
  }
  .btn-primary { background: var(--accent); color: var(--on-accent); }
  .btn-primary:hover { background: var(--accent-strong); }
  .btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
  .btn-secondary:hover { border-color: var(--accent); color: var(--accent-strong); }
  .btn-ghost { background: transparent; color: var(--text-muted); border-color: var(--border-strong); }
  .btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
  .btn-lg { font-size: 16px; padding: 13px 26px; min-height: 48px; width: 100%; }
  .row-actions-top { display: flex; justify-content: flex-end; margin: 24px 0 60px; }

  .tpl-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
  .tpl-list-item {
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  }
  .tpl-item-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
  .tpl-item-actions { flex-shrink: 0; }

  #toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(10px);
    background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px;
    font-size: 14px; font-weight: 600; box-shadow: var(--shadow-md);
    opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 50; max-width: 90vw; text-align: center;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  #toast.show.error { background: var(--danger); color: #fff; }

  .app-footer { text-align: center; color: var(--text-muted); font-size: 12.5px; padding: 10px 20px 30px; }

  /* ---------- 写真アップロード ---------- */
  .photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
  .photo-slot { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
  .photo-slot-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
  .photo-slot-preview {
    width: 100%; aspect-ratio: 4/3; border-radius: 8px; background: var(--surface-alt);
    display: flex; align-items: center; justify-content: center; overflow: hidden;
  }
  .photo-slot-preview:empty::after { content: "未設定"; font-size: 12px; color: var(--text-muted); }
  .photo-slot-preview img { width: 100%; height: 100%; object-fit: cover; }
  .photo-slot-actions { display: flex; gap: 8px; }
  .inline-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
  .key-row { display: flex; gap: 12px; flex-wrap: wrap; }

  /* ---------- カラーピッカー ---------- */
  .color-row { display: flex; gap: 8px; align-items: center; }
  .color-row input[type="color"] {
    width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border-strong);
    border-radius: 8px; background: var(--surface); cursor: pointer; flex: none;
  }
  .color-row input[type="text"] { flex: 1; }

  /* ---------- スタッフインタビューのQ&Aペア入力 ---------- */
  .qa-pairs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
  .qa-pair {
    border: 1px dashed var(--border-strong); border-radius: 8px; padding: 12px;
    display: flex; flex-direction: column; gap: 8px; background: var(--surface-alt);
  }
  .qa-pair-label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
  .btn-qa-remove { align-self: flex-end; font-size: 12px; padding: 4px 12px; min-height: auto; }
