.subtitle { font-size: 12px; color: var(--ink-light); font-weight: 300; letter-spacing: 0.1em; border-left: 2px solid var(--accent); padding-left: 10px; }
    .panel-header { padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--bg); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
    .panel-label { font-size: 10px; letter-spacing: 0.2em; color: var(--ink-light); text-transform: uppercase; }
    .panel-body { padding: 18px; }
    .hidden { display:none !important; }
    .tool-note, .mini-note { font-size:12px; color:var(--ink-light); line-height:1.75; }
    .select-input, .number-input, .text-input, .textarea-input {
      width:100%; border:1px solid var(--border); background:#fff; color:var(--ink); font:inherit; font-size:13px;
      padding:10px 12px; border-radius:6px; min-height:44px; line-height:1.45; box-sizing:border-box;
    }
    select.select-input { appearance:auto; }
    .range-value { min-width:64px; text-align:right; font-size:12px; color:var(--ink-light); }
    .fmt-row { display:flex; flex-wrap:wrap; gap:8px; }
    .fmt-btn { min-width: 84px; padding:10px 12px; border:1px solid var(--border); background:#fff; color:var(--ink); border-radius:8px; font:inherit; font-size:12px; cursor:pointer; transition:.2s ease; }
    .fmt-btn:hover { border-color: var(--blue); color: var(--blue); background:#F8FBFF; }
    .fmt-btn.active { background: var(--blue-light); color: var(--blue); border-color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
    .action-bar { display:flex; flex-direction:column; gap:10px; }
    .preview-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(112px,1fr)); gap:12px; }
    .preview-thumb { border:1px solid var(--border); border-radius:10px; padding:10px; background:#fff; display:flex; flex-direction:column; gap:8px; cursor:pointer; transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease; }
    .preview-thumb.active { border-color: var(--blue); box-shadow: 0 0 0 1px rgba(74,108,247,.15); }
    .preview-thumb.dragging-item { opacity:.55; }
    .preview-thumb.drag-over { border-color: var(--blue); background:#F8FBFF; box-shadow: 0 0 0 1px rgba(74,108,247,.15); }
    .preview-thumb img { width:100%; height:92px; object-fit:contain; background:#f7f7f7; border:1px solid var(--border); border-radius:8px; }
    .preview-thumb strong { font-size:12px; color:var(--ink); text-align:center; }
    .preview-thumb span { font-size:11px; color:var(--ink-light); text-align:center; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
    .thumb-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
    .small-btn { padding: 9px 12px; border:1px solid var(--border); background:#fff; color:var(--ink); border-radius:6px; font:inherit; font-size:12px; cursor:pointer; transition:.2s ease; }
    .small-btn:hover { border-color: var(--blue); color: var(--blue); background:#F8FBFF; }
    .small-btn.primary-lite { border-color:#DCE7FF; background:#F8FBFF; color:var(--blue); }
    .small-btn.danger-lite { border-color:#F3D6D6; background:#FFF8F8; color:#C54F4F; }
    .small-btn.arrow-btn { font-size:14px; font-weight:700; }
    .preview-tip { margin-top:10px; }
    .color-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
    .color-row-label { min-width:48px; font-size:12px; color:var(--ink-light); }
    .color-swatch { width:34px; height:34px; border-radius:8px; border:1px solid var(--border); cursor:pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
    input[type="color"] { position:absolute; opacity:0; pointer-events:none; width:0; height:0; }
    .color-hex-input { flex:1 1 140px; min-width:140px; }
    .canvas-stage { position:relative; display:flex; align-items:center; justify-content:center; min-height:420px; padding:16px; background:#fff; overflow:auto; }
    .canvas-stage canvas { max-width:100%; max-height:640px; display:block; touch-action:none; cursor:default; box-shadow: 0 0 0 1px rgba(0,0,0,.04); background:#fff; }
    .canvas-stage canvas.dragging { cursor:grabbing; }
    .section-stack { display:flex; flex-direction:column; gap:12px; }
    .selected-box { border:1px dashed var(--border); border-radius:10px; padding:12px; background:#fff; }
    .selected-box strong { display:block; margin-bottom:4px; font-size:13px; }
    .selected-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
    .template-note { margin-top:6px; }
    .template-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .template-grid .fmt-btn { width:100%; min-width:0; }
    .size-grid { display:grid; grid-template-columns:1fr; gap:10px; align-items:stretch; }
    .size-grid .ctrl-row { margin-bottom:0; align-items:center; min-height:44px; }
    .size-grid .ctrl-label { flex:0 0 54px; line-height:1.45; white-space:nowrap; }
    .size-grid .number-input { width:auto; min-width:160px; flex:1 1 auto; min-height:44px; }
    .meta-chip { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border:1px solid var(--border); border-radius:999px; background:#fff; font-size:11px; color:var(--ink-light); }
    .row-inline { display:flex; gap:8px; flex-wrap:wrap; }
    .row-inline > * { flex:1 1 0; }
    .inline-controls { display:flex; gap:8px; flex-wrap:wrap; }
    .inline-controls .small-btn { flex:1 1 0; }
    .it-tabs { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:0; border:1px solid var(--border); border-radius:10px; overflow:hidden; background:#fff; }
    .it-tab-btn {
      appearance:none; border:none; border-right:1px solid var(--border); background:#fff; color:var(--ink-light);
      font:inherit; font-size:12px; padding:11px 6px; cursor:pointer; transition:background .2s ease,color .2s ease;
    }
    .it-tab-btn:last-child { border-right:none; }
    .it-tab-btn:hover { background:#F8FBFF; color: var(--blue); }
    .it-tab-btn.active { background: var(--blue-light); color: var(--blue); box-shadow: inset 0 -2px 0 var(--blue); }
    .it-tab-panels { min-height: 560px; }
    .it-tab-panel { display:none; }
    .it-tab-panel.active { display:block; }
    .it-tab-panel .sidebar-section + .sidebar-section { border-top:1px solid var(--border); }
    .hr-soft { border:none; border-top:1px solid var(--border); margin:0; }
    .notice-tight { margin:0; }
    .badge-soft { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:999px; background:#F8FBFF; color:var(--blue); border:1px solid #DCE7FF; font-size:11px; }
    @media (max-width: 980px){ .it-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .it-tab-panels { min-height: 0; } }
    @media (max-width: 860px){ .size-grid, .template-grid { grid-template-columns:1fr; } .it-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  
    .template-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
    .template-card {
      min-height:112px; padding:10px; border:1px solid var(--border); background:#fff; color:var(--ink);
      border-radius:10px; display:flex; flex-direction:column; gap:8px; align-items:stretch; text-align:left;
      cursor:pointer; transition:border-color .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
    }
    .template-card:hover { border-color:var(--blue); background:#F8FBFF; color:var(--blue); }
    .template-card.active { border-color:var(--blue); background:var(--blue-light); color:var(--blue); box-shadow:0 0 0 1px rgba(74,108,247,.18); }
    .template-preview {
      height:54px; display:grid; gap:4px; padding:6px; border-radius:8px; border:1px solid var(--border); background:#fff;
    }
    .template-card.active .template-preview { border-color:#BFD0FF; }
    .template-preview span { display:block; border-radius:4px; background:#DCE7FF; border:1px solid #BFD0FF; min-width:0; min-height:0; }
    .template-name { font-size:12px; font-weight:700; line-height:1.35; text-align:center; }
    .template-count { font-size:10px; color:var(--ink-light); text-align:center; line-height:1; }
    .template-card.active .template-count { color:var(--blue); }
    .tpl-grid-auto { grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(2,1fr); }
    .tpl-2x2 { grid-template-columns:repeat(2,1fr); grid-template-rows:repeat(2,1fr); }
    .tpl-3x3 { grid-template-columns:repeat(3,1fr); grid-template-rows:repeat(3,1fr); }
    .tpl-split-v { grid-template-columns:repeat(2,1fr); }
    .tpl-split-h { grid-template-rows:repeat(2,1fr); }
    .tpl-hero-left { grid-template-columns:1.6fr 1fr; grid-template-rows:1fr 1fr; }
    .tpl-hero-left span:first-child { grid-row:1 / span 2; }
    .tpl-hero-right { grid-template-columns:1fr 1.6fr; grid-template-rows:1fr 1fr; }
    .tpl-hero-right span:last-child { grid-column:2; grid-row:1 / span 2; }
    .tpl-hero-top { grid-template-columns:1fr 1fr; grid-template-rows:1.6fr 1fr; }
    .tpl-hero-top span:first-child { grid-column:1 / span 2; }
    .tpl-hero-bottom { grid-template-columns:1fr 1fr; grid-template-rows:1fr 1.6fr; }
    .tpl-hero-bottom span:last-child { grid-column:1 / span 2; }
    .tpl-strip-3 { grid-template-columns:repeat(3,1fr); }
    .tpl-strip-4 { grid-template-columns:repeat(4,1fr); }
    .tpl-mosaic-5 { grid-template-columns:repeat(6,1fr); grid-template-rows:1.2fr 1fr; }
    .tpl-mosaic-5 span:nth-child(1) { grid-column:1 / span 3; }
    .tpl-mosaic-5 span:nth-child(2) { grid-column:4 / span 3; }
    .tpl-mosaic-5 span:nth-child(3) { grid-column:1 / span 2; }
    .tpl-mosaic-5 span:nth-child(4) { grid-column:3 / span 2; }
    .tpl-mosaic-5 span:nth-child(5) { grid-column:5 / span 2; }

  
    .tpl-strip-v-3 { grid-template-rows:repeat(3,1fr); }
    .tpl-strip-v-4 { grid-template-rows:repeat(4,1fr); }
    .tpl-quad-uneven { grid-template-columns:1.35fr 1fr; grid-template-rows:1.25fr 1fr; }
    .tpl-center-focus { grid-template-columns:1fr 1.45fr 1fr; grid-template-rows:1fr 1fr; }
    .tpl-center-focus span:nth-child(1) { grid-column:1; grid-row:1; }
    .tpl-center-focus span:nth-child(2) { grid-column:3; grid-row:1; }
    .tpl-center-focus span:nth-child(3) { grid-column:2; grid-row:1 / span 2; }
    .tpl-center-focus span:nth-child(4) { grid-column:1; grid-row:2; }
    .tpl-center-focus span:nth-child(5) { grid-column:3; grid-row:2; }
    .tpl-magazine-6 { grid-template-columns:1.45fr 1fr 1fr; grid-template-rows:1fr 1fr 1fr; }
    .tpl-magazine-6 span:first-child { grid-row:1 / span 3; }
    .tpl-tall-left-5 { grid-template-columns:1.45fr 1fr 1fr; grid-template-rows:1fr 1fr; }
    .tpl-tall-left-5 span:first-child { grid-row:1 / span 2; }
    .tpl-panorama-top { grid-template-columns:repeat(3,1fr); grid-template-rows:1.45fr 1fr; }
    .tpl-panorama-top span:first-child { grid-column:1 / span 3; }
    .tpl-panorama-bottom { grid-template-columns:repeat(3,1fr); grid-template-rows:1fr 1.45fr; }
    .tpl-panorama-bottom span:last-child { grid-column:1 / span 3; }

  
    /* テンプレートカードをコンパクト化 */
    .template-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; }
    .template-card {
      min-height:86px;
      padding:7px;
      gap:5px;
      border-radius:8px;
    }
    .template-preview {
      height:38px;
      gap:3px;
      padding:4px;
      border-radius:6px;
    }
    .template-preview span { border-radius:3px; }
    .template-name { font-size:11px; line-height:1.25; }
    .template-count { font-size:9px; line-height:1; }
