.apg-wrap{display:flex;flex-direction:column;gap:1rem;margin-bottom:2rem;}
.apg-segment{display:flex;flex-wrap:wrap;gap:0.375rem;padding:0.25rem;background:var(--surface-muted, #f1f5f9);border-radius:12px;border:1px solid var(--border, #e2e8f0);}
.apg-segment-btn{appearance:none;border:none;background:transparent;color:var(--text-muted, #64748b);font-size:0.8125rem;font-weight:500;padding:0.5rem 1rem;border-radius:8px;cursor:pointer;white-space:nowrap;transition:color 0.2s, background 0.2s;}
.apg-segment-btn:hover{color:var(--text-main, #1e293b);background:var(--surface, #fff);}
.apg-segment-btn.is-active{color:#fff;background:var(--primary, #ee0000);}
.apg-segment-btn.is-active:hover{background:var(--primary-dark, #cc0000);}
.apg-main{display:grid;grid-template-columns:1fr;gap:1rem;}
.apg-panel{background:var(--surface, #fff);border:1px solid var(--border, #e2e8f0);border-radius:12px;padding:1.25rem;box-shadow:0 1px 3px rgba(0,0,0,0.04);}
.apg-tab{display:none;}
.apg-tab.is-active{display:block;}
.apg-grid{display:grid;grid-template-columns:1fr;gap:1rem;margin-bottom:1rem;}
.apg-field{margin-bottom:1rem;}
.apg-field:last-of-type{margin-bottom:0;}
.apg-field label{display:block;font-size:0.8125rem;font-weight:500;color:var(--text-main, #1e293b);margin-bottom:0.375rem;}
.apg-input,.apg-select,.apg-textarea{width:100%;padding:0.625rem 0.75rem;font-size:0.875rem;line-height:1.5;color:var(--text-main, #1e293b);background:var(--surface, #fff);border:1px solid var(--border, #e2e8f0);border-radius:8px;transition:border-color 0.2s, box-shadow 0.2s;}
.apg-input:focus,.apg-select:focus,.apg-textarea:focus{outline:none;border-color:var(--primary, #ee0000);box-shadow:0 0 0 3px rgba(238,0,0,0.12);}
.apg-textarea{min-height:100px;resize:vertical;font-family:ui-monospace, monospace;}
.apg-check-wrap{display:inline-flex;align-items:center;gap:0.5rem;margin-bottom:1rem;cursor:pointer;}
.apg-checkbox{width:1.125rem;height:1.125rem;accent-color:var(--primary, #ee0000);}
.apg-label-inline{font-size:0.875rem;font-weight:500;color:var(--text-main, #1e293b);}
.apg-modules{display:grid;grid-template-columns:repeat(2, 1fr);gap:0.75rem;margin-bottom:1.25rem;}
.apg-module{display:flex;flex-direction:column;align-items:center;gap:0.375rem;padding:1rem 0.75rem;border:2px solid var(--border, #e2e8f0);border-radius:10px;background:var(--surface, #fff);cursor:pointer;transition:border-color 0.2s, background 0.2s;text-align:center;}
.apg-module:hover{border-color:var(--primary, #ee0000);background:rgba(238,0,0,0.04);}
.apg-module.is-active{border-color:var(--primary, #ee0000);background:rgba(238,0,0,0.08);}
.apg-module-icon{font-size:1.5rem;line-height:1;}
.apg-module-title{font-size:0.8125rem;font-weight:600;color:var(--text-main, #1e293b);}
.apg-module-desc{font-size:0.6875rem;color:var(--text-muted, #64748b);}
.apg-btn{display:inline-flex;align-items:center;justify-content:center;gap:0.5rem;padding:0.625rem 1.25rem;font-size:0.875rem;font-weight:500;border-radius:8px;cursor:pointer;transition:background 0.2s, color 0.2s, border-color 0.2s;border:none;}
.apg-btn-primary{background:var(--primary, #ee0000);color:#fff;}
.apg-btn-primary:hover{background:var(--primary-dark, #cc0000);}
.apg-btn-ghost{background:transparent;color:var(--text-muted, #64748b);border:1px solid var(--border, #e2e8f0);}
.apg-btn-ghost:hover{color:var(--text-main, #1e293b);background:var(--surface-muted, #f8fafc);}
.apg-btn-success{background:#16a34a;color:#fff;}
.apg-btn-success:hover{background:#15803d;}
.apg-btn-sm{padding:0.375rem 0.75rem;font-size:0.8125rem;}
.apg-list{display:flex;flex-direction:column;gap:0.5rem;margin-top:1rem;max-height:260px;overflow-y:auto;}
.apg-item{display:flex;align-items:flex-start;justify-content:space-between;gap:0.75rem;padding:0.75rem 1rem;background:var(--surface-muted, #f8fafc);border:1px solid var(--border, #e2e8f0);border-radius:8px;}
.apg-item-body{flex:1;min-width:0;}
.apg-item-title{font-weight:500;font-size:0.875rem;color:var(--text-main, #1e293b);}
.apg-item-meta{font-size:0.75rem;color:var(--text-muted, #64748b);margin-top:0.25rem;}
.apg-item-remove{flex-shrink:0;padding:0.375rem;font-size:0.75rem;color:var(--text-muted, #64748b);background:transparent;border:none;border-radius:6px;cursor:pointer;transition:color 0.2s, background 0.2s;}
.apg-item-remove:hover{color:#dc2626;background:rgba(220,38,38,0.08);}
.apg-output-wrap{background:var(--surface-muted, #f1f5f9);border:1px solid var(--border, #e2e8f0);border-radius:12px;overflow:hidden;}
.apg-output-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem 1rem;background:var(--surface, #fff);border-bottom:1px solid var(--border, #e2e8f0);}
.apg-output-title{font-size:0.875rem;font-weight:600;color:var(--text-main, #1e293b);}
.apg-output-actions{display:flex;gap:0.5rem;}
.apg-code{margin:0;padding:1rem;font-size:0.8125rem;line-height:1.6;font-family:ui-monospace, monospace;color:#e2e8f0;background:#1e293b;overflow-x:auto;overflow-y:auto;max-height:360px;white-space:pre-wrap;word-break:break-word;}
.apg-note{background:rgba(238,0,0,0.06);border-left:4px solid var(--primary, #ee0000);padding:1rem 1.25rem;margin:1.5rem 0;border-radius:0 8px 8px 0;}
.apg-note h3{font-size:0.9375rem;font-weight:600;color:#991b1b;margin:0 0 0.75rem 0;}
.apg-note p{font-size:0.875rem;color:var(--text-main, #1e293b);margin:0;}
.apg-features{display:grid;grid-template-columns:1fr;gap:1rem;margin-top:1rem;}
.apg-feature{background:var(--surface, #fff);padding:1rem;border-radius:10px;border:1px solid var(--border, #e2e8f0);text-align:center;}
.apg-feature-icon{font-size:1.75rem;margin-bottom:0.5rem;line-height:1;}
.apg-feature h4{font-size:0.9375rem;font-weight:600;margin:0 0 0.375rem 0;}
.apg-feature p{font-size:0.8125rem;color:var(--text-muted, #64748b);margin:0;}
@media (min-width: 480px){.apg-modules{grid-template-columns:repeat(3, 1fr);}}
@media (min-width: 640px){.apg-grid{grid-template-columns:repeat(2, 1fr);}.apg-features{grid-template-columns:repeat(2, 1fr);}}
@media (min-width: 768px){.apg-wrap{gap:1.25rem;}.apg-panel{padding:1.5rem;}.apg-code{max-height:420px;font-size:0.875rem;}.apg-modules{grid-template-columns:repeat(5, 1fr);}.apg-list{max-height:300px;}}
@media (min-width: 1024px){.apg-main{grid-template-columns:1fr 1fr;gap:1.5rem;}.apg-output-wrap{position:sticky;top:1rem;align-self:start;}.apg-code{max-height:500px;}.apg-features{grid-template-columns:repeat(3, 1fr);}}
