  :root{
    --bg: #08080a;
    --panel: #0f0f12;
    --panel-2: #131316;
    --border: #202024;
    --border-soft: #1a1a1e;
    --text: #e9e9ec;
    --text-dim: #98989f;
    --text-faint: #55555c;
    --accent: #5865f2;
    --accent-dim: #454ec2;
    --danger: #f04747;
    --ok: #3ba55d;
    --radius: 8px;
    --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  }

  *{ box-sizing: border-box; }
  html,body{ height:100%; }
  body{
    margin:0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    font-size:14px;
    line-height:1.5;
  }

  a{ color:inherit; }

  ::selection{ background: var(--accent-dim); color:#fff; }

  /* focus visibility */
  :focus-visible{
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  /* ---------- top bar ---------- */
  .topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-soft);
  }
  .brand{
    display:flex;
    align-items:center;
    gap:10px;
    font-weight:600;
    letter-spacing:-0.01em;
  }
  .brand .mark{
    width:26px; height:26px;
    border-radius:6px;
    background: var(--panel-2);
    border:1px solid var(--border);
    display:flex; align-items:center; justify-content:center;
    font-family: var(--mono);
    font-size:12px;
    font-weight:600;
    color: var(--text);
  }
  .status{
    display:flex;
    align-items:center;
    gap:7px;
    font-family: var(--mono);
    font-size:12px;
    color: var(--text-dim);
  }
  .dot{
    width:6px; height:6px;
    border-radius:50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(59,165,93,0.12);
  }
  .topbar-right{
    display:flex;
    align-items:center;
    gap:14px;
  }

  /* ---------- settings panel ---------- */
  .settings-panel{
    display:none;
    border-bottom: 1px solid var(--border-soft);
    background: var(--panel);
  }
  .settings-panel.show{ display:block; }
  .settings-inner{
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 28px;
    display:flex;
    gap: 40px;
    flex-wrap:wrap;
  }
  .settings-col{
    display:flex;
    flex-direction:column;
    gap:10px;
    min-width: 220px;
  }
  .settings-col-end{
    margin-left:auto;
    justify-content:flex-end;
  }
  @media (max-width: 880px){
    .settings-inner{ padding: 16px 20px; }
    .settings-col-end{ margin-left:0; }
  }
  .checkbox-row{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:13px;
    color: var(--text-dim);
    cursor:pointer;
  }
  .checkbox-row input[type="checkbox"]{
    width:15px; height:15px;
    accent-color: var(--accent);
    cursor:pointer;
  }
  .checkbox-row span{ color: var(--text); }

  /* ---------- profiles ---------- */
  .profiles-row{
    display:flex;
    gap:8px;
  }
  .profile-select{
    flex:1;
    cursor:pointer;
  }

  /* ---------- hero ---------- */
  .hero{
    padding: 64px 28px 40px;
    max-width: 1180px;
    margin: 0 auto;
  }
  .eyebrow{
    font-family: var(--mono);
    font-size:11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin: 0 0 14px;
  }
  h1{
    font-size: 42px;
    line-height:1.08;
    letter-spacing:-0.025em;
    margin: 0 0 16px;
    max-width: 640px;
    font-weight: 700;
  }
  .lede{
    color: var(--text-dim);
    max-width: 560px;
    font-size:15px;
    margin:0;
  }
  .lede strong{ color: var(--text); font-weight:500; }

  /* ---------- layout ---------- */
  .layout{
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px 80px;
    display:grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 20px;
    align-items:start;
  }
  @media (max-width: 880px){
    .layout{ grid-template-columns: 1fr; }
    h1{ font-size:32px; }
    .hero{ padding: 40px 20px 24px; }
    .layout{ padding: 0 20px 60px; }
    .topbar{ padding: 14px 20px; }
  }

  .panel{
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow:hidden;
  }
  .panel-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-soft);
  }
  .panel-head .label-row{ display:flex; flex-direction:column; gap:2px; }
  .eyebrow-sm{
    font-family: var(--mono);
    font-size:10px;
    letter-spacing:0.12em;
    text-transform:uppercase;
    color: var(--text-faint);
  }
  .panel-title{ font-weight:600; font-size:14.5px; }
  .panel-body{ padding: 18px; }

  .btn{
    appearance:none;
    border:1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    font-family: var(--sans);
    font-size:12.5px;
    font-weight:500;
    padding: 7px 13px;
    border-radius: 6px;
    cursor:pointer;
    transition: background .12s ease, border-color .12s ease;
  }
  .btn:hover{ background:#1a1a1f; border-color:#2a2a30; }
  .btn:active{ transform: translateY(1px); }
  .btn-primary{
    background: var(--accent);
    border-color: var(--accent);
    color:#fff;
    font-weight:600;
  }
  .btn-primary:hover{ background: var(--accent-dim); border-color: var(--accent-dim); }
  .btn-primary:disabled{
    opacity:0.45;
    cursor:not-allowed;
  }
  .btn-ghost{
    background:transparent;
    border-color:transparent;
    color: var(--text-faint);
  }
  .btn-ghost:hover{ background: var(--panel-2); color:var(--text-dim); }

  /* ---------- form ---------- */
  .field{ margin-bottom:16px; }
  .field:last-child{ margin-bottom:0; }
  .field-label{
    display:flex;
    justify-content:space-between;
    align-items:baseline;
    font-family: var(--mono);
    font-size:11.5px;
    color: var(--text-dim);
    margin-bottom:7px;
  }
  .field-label .count{ color: var(--text-faint); font-size:10.5px; }
  .field-hint{
    font-size:11.5px;
    color: var(--text-faint);
    margin-top:6px;
  }

  .input, textarea.input{
    width:100%;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--sans);
    font-size:13.5px;
    padding: 9px 12px;
    transition: border-color .12s ease;
  }
  .input::placeholder{ color: var(--text-faint); }
  .input:focus{ border-color:#3a3a42; }
  textarea.input{
    resize: vertical;
    min-height: 130px;
    font-family: var(--sans);
    line-height:1.5;
  }

  .row2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
  @media (max-width:520px){ .row2{ grid-template-columns:1fr; } }

  .input-with-btn{ display:flex; gap:8px; }
  .input-with-btn .input{ flex:1; }

  .divider{
    height:1px;
    background: var(--border-soft);
    margin: 18px 0;
  }

  .embed-toggle{
    display:flex;
    align-items:center;
    justify-content:space-between;
    cursor:pointer;
    padding: 2px 0;
  }
  .switch{
    width:34px; height:19px;
    border-radius:99px;
    background: var(--panel-2);
    border:1px solid var(--border);
    position:relative;
    flex-shrink:0;
    transition: background .15s ease, border-color .15s ease;
  }
  .switch::after{
    content:'';
    position:absolute;
    top:2px; left:2px;
    width:13px; height:13px;
    border-radius:50%;
    background: var(--text-faint);
    transition: transform .15s ease, background .15s ease;
  }
  .switch.on{ background: rgba(88,101,242,0.15); border-color: var(--accent-dim); }
  .switch.on::after{ transform: translateX(15px); background: var(--accent); }

  .embed-fields{
    display:none;
    margin-top:16px;
    padding-top:16px;
    border-top:1px solid var(--border-soft);
  }
  .embed-fields.show{ display:block; }

  .color-row{ display:flex; align-items:center; gap:10px; }
  .color-swatch{
    width:34px; height:34px;
    border-radius:6px;
    border:1px solid var(--border);
    padding:0;
    background:none;
    cursor:pointer;
    overflow:hidden;
  }
  .color-swatch::-webkit-color-swatch-wrapper{ padding:3px; }
  .color-swatch::-webkit-color-swatch{ border-radius:4px; border:none; }

  /* ---------- preview ---------- */
  .discord-msg{
    background: #050506;
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 14px 16px;
    display:flex;
    gap: 12px;
  }
  .avatar{
    width:38px; height:38px;
    border-radius:50%;
    background: var(--panel-2);
    border:1px solid var(--border);
    flex-shrink:0;
    display:flex; align-items:center; justify-content:center;
    font-family: var(--mono);
    font-size:13px;
    font-weight:600;
    color: var(--text-dim);
    object-fit:cover;
  }
  .msg-body{ min-width:0; flex:1; }
  .msg-meta{ display:flex; align-items:baseline; gap:8px; margin-bottom:2px; flex-wrap:wrap; }
  .msg-username{ font-weight:600; font-size:14.5px; color: var(--text); }
  .msg-tag{
    font-size:9px;
    font-weight:600;
    letter-spacing:0.02em;
    color:#fff;
    background: var(--accent);
    padding: 1.5px 4px;
    border-radius:3px;
    text-transform:uppercase;
  }
  .msg-time{ font-size:11px; color: var(--text-faint); }
  .msg-content{
    color: #d8d8dc;
    font-size:14px;
    white-space:pre-wrap;
    word-break:break-word;
    line-height:1.45;
  }
  .msg-content:empty::before, .msg-content.placeholder::before{
    content: attr(data-placeholder);
    color: var(--text-faint);
  }

  .embed-preview{
    margin-top:8px;
    border-left: 3px solid var(--accent);
    background: rgba(255,255,255,0.02);
    border-radius: 0 5px 5px 0;
    padding: 10px 12px;
    max-width: 420px;
  }
  .embed-title{ font-weight:600; font-size:14px; color:var(--text); margin-bottom:4px; }
  .embed-desc{ font-size:13px; color:#c7c7cc; line-height:1.45; white-space:pre-wrap; word-break:break-word; }
  .embed-footer{ font-size:11px; color: var(--text-faint); margin-top:8px; }
  .embed-img{ margin-top:8px; max-width:100%; border-radius:4px; display:block; }

  /* ---------- response ---------- */
  .response-box{
    font-family: var(--mono);
    font-size:12px;
    color: var(--text-dim);
    background: var(--panel-2);
    border: 1px solid var(--border-soft);
    border-radius:6px;
    padding: 12px 14px;
    max-height: 180px;
    overflow:auto;
    white-space:pre-wrap;
    word-break:break-word;
  }
  .response-box.ok{ color:#8fd6a4; border-color: rgba(59,165,93,0.25); }
  .response-box.err{ color:#f2a3a3; border-color: rgba(240,71,71,0.25); }

  .preview-stack{ display:flex; flex-direction:column; gap:16px; }

  footer{
    max-width:1180px;
    margin:0 auto;
    padding: 0 28px 40px;
    color: var(--text-faint);
    font-size:12px;
    display:flex;
    justify-content:space-between;
    flex-wrap:wrap;
    gap:8px;
  }
  footer a{ color: var(--text-dim); text-decoration:none; }
  footer a:hover{ color: var(--text); }

  .sr-only{
    position:absolute; width:1px; height:1px;
    padding:0; margin:-1px; overflow:hidden;
    clip:rect(0,0,0,0); white-space:nowrap; border:0;
  }
  /* ---------- docs page ---------- */
  .docs-layout{
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 28px 80px;
    display:grid;
    grid-template-columns: 220px 1fr;
    gap: 48px;
    align-items:start;
  }
  @media (max-width: 880px){
    .docs-layout{ grid-template-columns: 1fr; padding: 0 20px 60px; }
    .docs-nav{ display:none; }
  }
  .docs-nav{
    position: sticky;
    top: 24px;
    display:flex;
    flex-direction:column;
    gap:4px;
  }
  .docs-nav a{
    font-size:13px;
    color: var(--text-dim);
    text-decoration:none;
    padding: 6px 10px;
    border-radius:6px;
    border-left: 2px solid transparent;
  }
  .docs-nav a:hover{ color: var(--text); background: var(--panel-2); }
  .docs-content{ max-width: 720px; }
  .docs-content section{ margin-bottom: 48px; scroll-margin-top: 24px; }
  .docs-content h2{
    font-size: 22px;
    letter-spacing:-0.015em;
    margin: 0 0 6px;
    font-weight:700;
  }
  .docs-content h3{
    font-size: 15px;
    margin: 24px 0 8px;
    font-weight:600;
    color: var(--text);
  }
  .docs-content p{
    color: var(--text-dim);
    font-size: 14.5px;
    line-height:1.65;
    margin: 0 0 14px;
  }
  .docs-content p code, .docs-content li code{
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 6px;
    color: var(--text);
  }
  .docs-content ul, .docs-content ol{
    color: var(--text-dim);
    font-size: 14.5px;
    line-height:1.7;
    padding-left: 20px;
    margin: 0 0 14px;
  }
  .docs-content li{ margin-bottom: 4px; }
  .docs-content li strong{ color: var(--text); font-weight:600; }
  .docs-intro{
    color: var(--text-dim);
    font-size: 15px;
    max-width: 560px;
    margin: 0 0 8px;
  }
  .docs-pre{
    background: var(--panel-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 14px 16px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--text-dim);
    overflow-x: auto;
    margin: 0 0 14px;
  }
  .docs-callout{
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    background: var(--panel);
    border-radius: 0 6px 6px 0;
    padding: 12px 14px;
    font-size: 13.5px;
    color: var(--text-dim);
    margin: 0 0 14px;
  }
  .docs-callout strong{ color: var(--text); }
