/* ============================================================
 * グレイド サイト自動作成システム — admin 共通スタイル
 * 各テンプレの admin.html から <link> で読み込む（admin-core.js とセット）
 * ============================================================ */
    :root {
      --bg: #1a1d23;
      --panel: #242831;
      --panel-2: #2d323d;
      --panel-3: #343945;
      --line: #3a3f4b;
      --text: #e6e8ec;
      --mute: #8a8f99;
      --accent: #d4a574;
      --accent-2: #c89560;
      --danger: #d96d6d;
      --ok: #6dba8c;
    }
    * { box-sizing: border-box; }
    html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
    body {
      font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
      line-height: 1.5;
    }

    /* topbar */
    header.topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 16px;
      background: var(--panel);
      border-bottom: 1px solid var(--line);
    }
    header.topbar h1 { margin: 0; font-size: 15px; font-weight: 600; }
    header.topbar h1 .ver { color: var(--accent); font-size: 11px; margin-left: 8px; }
    .controls { display: flex; gap: 6px; flex-wrap: wrap; }
    button {
      padding: 7px 12px;
      background: var(--panel-2);
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 6px;
      font-size: 12.5px;
      cursor: pointer;
      font-family: inherit;
    }
    button:hover { background: var(--panel-3); }
    button.primary {
      background: var(--accent);
      color: #1a1d23;
      border-color: var(--accent);
      font-weight: 600;
    }
    button.primary:hover { background: var(--accent-2); }
    button.small { padding: 4px 8px; font-size: 11.5px; }
    button.danger { color: var(--danger); border-color: var(--danger); }
    button.danger:hover { background: var(--danger); color: white; }

    /* split layout */
    .split {
      display: grid;
      grid-template-columns: 1fr 1.1fr;
      height: calc(100vh - 45px);
    }
    .pane {
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border-right: 1px solid var(--line);
    }
    .pane:last-child { border-right: none; }

    /* tabs */
    .tab-strip {
      display: flex;
      overflow-x: auto;
      background: var(--panel);
      border-bottom: 1px solid var(--line);
      flex-shrink: 0;
    }
    .tab {
      padding: 10px 14px;
      background: transparent;
      border: none;
      border-bottom: 2px solid transparent;
      border-radius: 0;
      color: var(--mute);
      font-size: 12.5px;
      cursor: pointer;
      white-space: nowrap;
    }
    .tab:hover { background: var(--panel-2); color: var(--text); }
    .tab.active {
      color: var(--accent);
      border-bottom-color: var(--accent);
    }

    .tab-body {
      flex: 1;
      overflow-y: auto;
      padding: 20px 24px;
    }

    /* forms */
    .form-section {
      margin-bottom: 28px;
      padding-bottom: 24px;
      border-bottom: 1px solid var(--line);
    }
    .form-section:last-child { border-bottom: none; }
    .form-section h3 {
      margin: 0 0 14px;
      font-size: 13px;
      font-weight: 600;
      color: var(--accent);
      letter-spacing: .04em;
    }
    .form-section p.help {
      color: var(--mute);
      font-size: 12px;
      margin: 0 0 14px;
    }
    .form-field {
      margin-bottom: 12px;
    }
    .form-field label {
      display: block;
      font-size: 12px;
      color: var(--mute);
      margin-bottom: 4px;
    }
    .form-field input[type=text],
    .form-field input[type=url],
    .form-field input[type=email],
    .form-field input[type=tel],
    .form-field textarea {
      width: 100%;
      background: var(--panel-2);
      color: var(--text);
      border: 1px solid var(--line);
      border-radius: 5px;
      padding: 7px 10px;
      font-size: 13px;
      font-family: inherit;
    }
    .form-field input:focus,
    .form-field textarea:focus {
      outline: none;
      border-color: var(--accent);
    }
    .form-field textarea {
      resize: vertical;
      min-height: 60px;
      line-height: 1.5;
    }
    .form-field .hint {
      font-size: 11px;
      color: var(--mute);
      margin-top: 3px;
    }
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }
    .form-row-3 {
      display: grid;
      grid-template-columns: 80px 1fr 100px;
      gap: 8px;
    }
    .form-field-inline {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .form-toggle {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 12px;
      background: var(--panel-2);
      border-radius: 6px;
      margin-bottom: 16px;
    }
    .form-toggle input[type=checkbox] { transform: scale(1.2); accent-color: var(--accent); }

    /* list editor */
    .list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .list-item {
      background: var(--panel-2);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px 14px;
    }
    .list-item-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }
    .list-item-title {
      font-size: 12.5px;
      color: var(--accent);
      font-weight: 500;
    }
    .list-add {
      align-self: flex-start;
      background: transparent;
      border: 1px dashed var(--line);
      color: var(--mute);
      padding: 8px 14px;
    }
    .list-add:hover { border-color: var(--accent); color: var(--accent); }

    /* JSON editor */
    #jsonEditor {
      width: 100%;
      height: 100%;
      background: var(--bg);
      color: var(--text);
      border: none;
      padding: 14px;
      font-family: "SF Mono", Menlo, Consolas, monospace;
      font-size: 12.5px;
      line-height: 1.5;
      resize: none;
      outline: none;
      white-space: pre;
    }

    /* preview pane */
    .pane-header {
      padding: 8px 14px;
      background: var(--panel);
      border-bottom: 1px solid var(--line);
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }
    .pane-header h2 {
      margin: 0; font-size: 12px; color: var(--mute);
      font-weight: 500; letter-spacing: .05em;
    }
    select {
      background: var(--panel-2); color: var(--text);
      border: 1px solid var(--line); border-radius: 5px;
      padding: 5px 8px; font-size: 12.5px; font-family: inherit;
    }
    #previewFrame { width: 100%; height: 100%; border: none; background: white; }
    .status {
      font-size: 11.5px; color: var(--mute);
      padding: 6px 14px;
      border-top: 1px solid var(--line); background: var(--panel);
      flex-shrink: 0;
    }
    .status.error { color: var(--danger); }
    .status.ok { color: var(--ok); }

    .notice {
      padding: 24px;
      text-align: center;
      color: var(--mute);
      line-height: 1.8;
    }
    .notice code {
      background: var(--panel-2);
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 12px;
      color: var(--accent);
    }

    /* nested list (リスト内リスト: カテゴリ内の品目など) */
    .nested-list {
      margin: 12px 0 4px 10px;
      padding: 12px 14px;
      border: 1px solid var(--line);
      border-left: 3px solid var(--accent);
      border-radius: 0 8px 8px 0;
      background: var(--panel-2);
    }
    .nested-list > h4 {
      margin: 0 0 8px;
      font-weight: 600;
      font-size: 12px;
      color: var(--accent);
      letter-spacing: .04em;
    }
    .nested-list .list-item { background: var(--panel-3); }

    /* deploy result banner */
    .deploy-banner {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 12px 18px;
      background: var(--ok);
      color: #1a1d23;
      font-size: 13.5px;
      font-weight: 500;
      flex-shrink: 0;
    }
    .deploy-banner.error { background: var(--danger); color: #fff; }
    .deploy-banner .label { font-size: 12px; opacity: .8; letter-spacing: .05em; }
    .deploy-banner a {
      color: inherit;
      text-decoration: underline;
      word-break: break-all;
      font-weight: 600;
    }
    .deploy-banner .spacer { flex: 1; }
    .deploy-banner button {
      background: rgba(0,0,0,.18); color: inherit;
      border: 1px solid rgba(0,0,0,.25);
      padding: 4px 10px; font-size: 12px;
    }
    .deploy-banner button:hover { background: rgba(0,0,0,.3); }

    /* body→flex で banner 出現時に split 自動収縮 */
    body.app { display: flex; flex-direction: column; height: 100vh; }
    body.app .split { height: auto; flex: 1; min-height: 0; }
  
