.mtgc{
    --mtgc-bg:#f8fafc;
    --mtgc-card:#ffffff;
    --mtgc-border:#e5e7eb;
    --mtgc-muted:#6b7280;
    --mtgc-primary:#2563eb;
    --mtgc-success:#16a34a;
    --mtgc-warn:#f59e0b;
    --mtgc-danger:#ef4444;
    color:#0f172a;
    font-family:inherit;
}
.mtgc-shell{
    min-height:120px;
    max-width:900px;
    margin:0 auto;
    background:var(--mtgc-bg);
    border:1px solid var(--mtgc-border);
    border-radius:20px;
    padding:28px;
    box-shadow:0 18px 40px rgba(15,23,42,0.08);
}
.mtgc-head{margin-bottom:18px}
.mtgc-title{font-size:24px;font-weight:700;margin-bottom:6px}
.mtgc-sub{color:var(--mtgc-muted);font-size:14px}
.mtgc-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
    margin-bottom:16px;
}
.mtgc-field{display:flex;flex-direction:column;gap:6px}
.mtgc-label{font-size:12px;color:var(--mtgc-muted);font-weight:600;text-transform:uppercase;letter-spacing:0.06em}
.mtgc-select{
    min-width:200px;
    height:42px;
    border-radius:12px;
    border:1px solid var(--mtgc-border);
    padding:0 12px;
    background:#fff;
}
.mtgc-counts{display:flex;gap:16px;font-size:13px;color:var(--mtgc-muted)}
.mtgc-main{
    display:grid;
    grid-template-columns:minmax(0,1.2fr) minmax(0,0.9fr);
    gap:20px;
}
.mtgc-editor{display:flex;flex-direction:column;gap:14px}
.mtgc-input{
    width:100%;
    min-height:260px;
    resize:vertical;
    padding:18px;
    border:1px solid var(--mtgc-border);
    border-radius:16px;
    font-size:15px;
    line-height:1.6;
    background:var(--mtgc-card);
    color:#0f172a;
}
.mtgc-input:focus{outline:none;border-color:#cbd5f5;box-shadow:0 0 0 3px rgba(37,99,235,0.12)}
.mtgc-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.mtgc-btn{
    height:40px;
    border-radius:12px;
    padding:0 16px;
    font-weight:600;
    font-size:14px;
    border:1px solid transparent;
    cursor:pointer;
    background:#fff;
    color:#0f172a;
}
.mtgc-btn--primary{
    background:var(--mtgc-primary);
    color:#fff;
    box-shadow:0 10px 16px rgba(37,99,235,0.18);
}
.mtgc-btn--primary:hover{filter:brightness(0.98)}
.mtgc-btn--ghost{
    background:#fff;
    color:#0f172a;
    border-color:var(--mtgc-border);
}
.mtgc-btn.is-loading{opacity:0.7;pointer-events:none}
.mtgc-status{
    font-size:13px;
    color:var(--mtgc-muted);
}
.mtgc-status.is-success{color:var(--mtgc-success)}
.mtgc-status.is-warn{color:var(--mtgc-warn)}
.mtgc-status.is-error{color:var(--mtgc-danger)}
.mtgc-status.is-loading{color:#1d4ed8}
.mtgc-side{
    border:1px solid var(--mtgc-border);
    border-radius:16px;
    padding:16px;
    background:var(--mtgc-card);
    display:flex;
    flex-direction:column;
    gap:12px;
    min-height:260px;
}
.mtgc-side-head{display:flex;align-items:center;justify-content:space-between}
.mtgc-side-title{font-weight:700}
.mtgc-pill{
    background:#e0e7ff;
    color:#3730a3;
    border-radius:999px;
    padding:2px 10px;
    font-size:12px;
    font-weight:600;
}
.mtgc-tabs{display:flex;flex-wrap:wrap;gap:8px}
.mtgc-tab-btn{
    border:1px solid var(--mtgc-border);
    border-radius:999px;
    padding:6px 12px;
    font-size:12px;
    background:#fff;
    cursor:pointer;
    color:#374151;
}
.mtgc-tab-btn.is-active{
    background:#0f172a;
    color:#fff;
    border-color:#0f172a;
}
.mtgc-list{display:flex;flex-direction:column;gap:12px;max-height:320px;overflow:auto}
.mtgc-empty{font-size:13px;color:var(--mtgc-muted);text-align:center;padding:12px}
.mtgc-item{
    border:1px solid var(--mtgc-border);
    border-radius:12px;
    padding:12px;
    background:#fff;
    cursor:pointer;
}
.mtgc-item.is-active{border-color:#93c5fd;box-shadow:0 0 0 3px rgba(59,130,246,0.12)}
.mtgc-item-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.mtgc-tag{
    border-radius:999px;
    padding:2px 8px;
    font-size:11px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:0.04em;
}
.mtgc-tag--grammar{background:#fee2e2;color:#991b1b}
.mtgc-tag--spell{background:#dcfce7;color:#166534}
.mtgc-tag--clarity{background:#fff7ed;color:#9a3412}
.mtgc-item-msg{font-size:13px;font-weight:600;color:#111827}
.mtgc-item-snippet{font-size:12px;color:#4b5563}
.mtgc-item-replace{font-size:12px;color:#1d4ed8;margin-top:6px}
.mtgc-preview{
    margin-top:20px;
    border:1px solid var(--mtgc-border);
    border-radius:16px;
    padding:16px;
    background:var(--mtgc-card);
}
.mtgc-preview-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.mtgc-preview-title{font-weight:700}
.mtgc-preview-sub{font-size:12px;color:var(--mtgc-muted)}
.mtgc-preview-body{
    min-height:140px;
    font-size:14px;
    line-height:1.6;
    color:#1f2937;
    white-space:pre-wrap;
}
.mtgc-mark{
    background:#fef9c3;
    border-radius:6px;
    padding:0 2px;
    cursor:pointer;
}
.mtgc-suggest{
    border:1px solid var(--mtgc-border);
    border-radius:12px;
    padding:12px;
    background:#f9fafb;
}
.mtgc-suggest-title{font-weight:700;margin-bottom:4px}
.mtgc-suggest-sub{font-size:12px;color:var(--mtgc-muted);text-transform:uppercase;letter-spacing:0.06em;margin-bottom:8px}
.mtgc-suggest-actions{display:flex;flex-wrap:wrap;gap:8px}
.mtgc-suggest-btn{
    height:34px;
    border-radius:10px;
    padding:0 12px;
    border:1px solid var(--mtgc-border);
    background:#fff;
    cursor:pointer;
    font-weight:600;
    font-size:13px;
}
.mtgc-suggest-empty{font-size:13px;color:var(--mtgc-muted)}

@media (max-width: 900px){
    .mtgc-shell{padding:20px}
    .mtgc-toolbar{flex-direction:column;align-items:flex-start}
    .mtgc-main{grid-template-columns:1fr}
    .mtgc-list{max-height:none}
}
