@font-face {
  font-family: Manrope;
  src: url('/assets/fonts/manrope-0.ttf') format('truetype');
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #0d0a13;
  --surface: #16111f;
  --raised: #1b1526;
  --line: #362a46;
  --line-soft: #2b2238;
  --text: #f4effb;
  --muted: #b5a9c3;
  --purple: #c9a6ff;
  --green: #91e1bb;
  --amber: #eeca8d;
  font-family: Manrope, system-ui, sans-serif;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}
*,*::before,*::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 79% 0%, #251734 0%, transparent 48rem), var(--bg); }
a { color: inherit; text-decoration: none; }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 3px; }
.builder-header { border-bottom: 1px solid #ffffff14; background: #100c18d9; }
.header-wrap { display: flex; align-items: center; justify-content: space-between; max-width: 1328px; min-height: 66px; padding: 0 26px; margin: auto; gap: 18px; }
.brand { display: flex; gap: 9px; align-items: center; font-weight: 850; letter-spacing: -.04em; }
.brand sup { font-size: .61em; margin-left: 2px; color: var(--purple); }
.top-links { display: flex; gap: clamp(12px,3vw,28px); align-items: center; color: var(--muted); font-size: .83rem; }
.top-links [aria-hidden],.control [aria-hidden] { font-family: system-ui, sans-serif; }
.top-links a:hover,.back-link:hover { color: var(--text); }
.workspace { width: min(100%, 1328px); margin: 0 auto; padding: clamp(24px,4vw,50px) 26px 70px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 30px; }
.section-title h2 { scroll-margin-top: 16px; }
.back-link { display: inline-block; color: var(--muted); font-size: .82rem; margin-bottom: 13px; }
h1,h2,h3,p { margin: 0; }
.intro h1 { font-size: clamp(2.55rem, 5.9vw, 4.85rem); font-weight: 850; line-height: 1.01; letter-spacing: -.067em; }
.intro h1 span { color: var(--purple); }
.hero-break { display: none; }
.intro p { color: var(--muted); max-width: 40rem; margin-top: 15px; font-size: clamp(.87rem,1.4vw,1.02rem); }
.intro-actions { flex: 0 0 auto; }
.account-status { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.account-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px #91e1bb65; }
.editor-layout { display: grid; grid-template-columns: minmax(300px, 354px) minmax(0,1fr); align-items: start; gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: 0 14px 56px #0003; min-width: 0; }
.brief { display: grid; padding: 20px; gap: 19px; }
.section-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section-icon { display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 auto; border: 1px solid #674a89; border-radius: 11px; background: #2a1c3b; color: var(--purple); font-size: 1.12rem; }
.design-icon { background: #21182d; }
.section-title h2 { font-size: 1.09rem; letter-spacing: -.027em; line-height: 1.22; }
.section-title p { color: var(--muted); font-size: .75rem; margin-top: 3px; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend,.brief label { display: block; font-size: .79rem; font-weight: 750; margin-bottom: 7px; color: #e9dff2; }
.presets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
.choice,.palette-choice { position: relative; }
.choice input,.palette-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.brief .choice,.brief .palette-choice { margin: 0; }
.choice span { display: flex; align-items: center; justify-content: center; min-height: 37px; border: 1px solid var(--line); border-radius: 8px; background: #100d17; color: var(--muted); cursor: pointer; font-size: .7rem; padding: 4px; }
.choice input:checked + span { background: #311f47; border-color: #8564b0; color: #f5ebff; }
.choice input:focus-visible + span,.palette-choice input:focus-visible + span { outline: 2px solid var(--purple); outline-offset: 2px; }
textarea,select,input[type="text"],input[type="color"],.server-name input { width: 100%; min-width: 0; color: var(--text); border: 1px solid var(--line); background: #100d17; border-radius: 8px; }
textarea { resize: vertical; min-height: 93px; padding: 10px; font-size: .83rem; }
textarea::placeholder,input::placeholder { color: #9a8baa; }
.prompt-footer { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); font-size: .69rem; margin-top: 4px; }
.text-button { background: transparent; color: var(--purple); border: 0; padding: 3px 0; text-align: left; font-size: .75rem; font-weight: 750; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.brief-filters { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.brief-filters label,.form-label { display: grid; gap: 6px; min-width: 0; }
select,input[type="text"] { min-height: 37px; padding: 5px 8px; font-size: .79rem; }
.palettes { display: flex; gap: 7px; flex-wrap: wrap; }
.palette-choice > span { display: grid; width: 34px; height: 34px; padding: 4px; background: #100d17; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.palette-choice > span::before { content: ""; border-radius: 5px; background: linear-gradient(135deg,var(--p1) 47%,var(--p2) 49% 72%,var(--p3) 73%); }
.palette-choice input:checked + span { border-color: var(--purple); box-shadow: inset 0 0 0 1px var(--purple); }
.style-sample { color: var(--muted); border-top: 1px solid var(--line-soft); padding-top: 9px; font-size: .75rem; overflow-wrap:anywhere; }
.control { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 39px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: .79rem; font-weight: 800; letter-spacing: -.01em; }
.control.primary { background: #be9bf6; color: #1c102b; border-color: #d5b8ff; }
.control.primary:hover:not(:disabled) { background: #dcc5ff; }
.control.secondary { background: #21182e; color: #f3eafa; border-color: #4b385e; }
.control.secondary:hover:not(:disabled) { border-color: #a987d3; background: #2b1e3a; }
.brief-actions { display: grid; grid-template-columns: 1.15fr 1fr; gap: 7px; }
.brief-note { font-size: .73rem; color: var(--muted); min-height: 2em; }
.brief-note[data-error],.deploy-status[data-error] { color: #ffbdbd; }
.design { overflow: hidden; }
.design-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; }
.server-strip { display: flex; align-items: center; gap: 12px; padding: 13px 20px; background: radial-gradient(ellipse at top right,#3b2754,transparent 90%),#20172e; border-block: 1px solid var(--line); }
.server-avatar { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 10px; background: #b38aef; color: #271338; font-size: 1rem; font-weight: 850; }
.server-name { flex: 1; min-width: 0; }
.server-name label { display: block; color: var(--muted); font-size: .65rem; line-height: 1; }
.server-name input { border: 1px solid transparent; background: transparent; border-radius: 5px; min-height: 30px; font-size: 1.03rem; padding: 2px 0; font-weight: 850; letter-spacing: -.03em; }
.server-name input:focus { border-color: #8b6cb3; }
.server-kind { color: #e6d5fc; font-size: .73rem; white-space: nowrap; }
.tabs { display: flex; gap: 4px; margin: 0; border-bottom: 1px solid var(--line); padding: 7px 18px 0; }
.tabs button { padding: 11px 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 750; font-size: .79rem; white-space: nowrap; }
.tabs [aria-selected="true"] { border-color: var(--purple); color: #f4e7ff; }
.tab-content { padding: 18px 20px 22px; min-height: 345px; }
.design-footer { padding: 11px 20px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .72rem; }
.structure { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); align-items: start; gap: 13px; }
.structure-column,.message-grid,.module-grid { display: grid; gap: 8px; min-width: 0; }
.column-heading { display: flex; justify-content: space-between; align-items: center; gap: 5px; flex-wrap: wrap; margin-bottom: 3px; }
.column-heading h3,.module-grid h3 { margin: 0; font-size: .87rem; letter-spacing: -.02em; }
.column-heading .text-button { font-size: .72rem; white-space: nowrap; }
.category { border: 1px solid var(--line-soft); border-radius: 8px; background: #120f1a; overflow: visible; }
.category-top { display: flex; align-items: center; gap: 7px; padding: 5px 7px; }
.category-top input[type="text"], .channel-row input[type="text"],.role-row input[type="text"] { padding: 3px 5px; min-height: 28px; border-color: transparent; background: transparent; }
.category-top input { font-weight: 800; }
.category-top input:focus,.channel-row input:focus,.role-row input:focus { border-color: #634982; }
.icon-button { color: var(--muted); border: 1px solid transparent; background: transparent; border-radius: 7px; width: 27px; height: 27px; flex: 0 0 auto; line-height: 1; padding: 0; }
.icon-button:hover { background: #34253e; color: #fff; }
.category .category-top > .icon-button:first-child { font-size: .9rem; }
.category-settings { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 4px 9px 6px; }
.category-settings select,.channel-row select { width: auto; min-height: 27px; padding: 2px 4px; font-size: .7rem; }
.channel-list { padding: 0 7px 6px; }
.channel-row { display: flex; align-items: center; gap: 3px; margin-top: 2px; min-width: 0; padding: 2px 0; }
.channel-row > span:first-child { color: #917da5; width: 15px; text-align: center; flex: 0 0 auto; }
.channel-row .icon-button { width: 24px; height: 24px; font-size: .86rem; }
.channel-add { margin: 5px 3px 2px; display: flex; gap: 11px; flex-wrap: wrap; }
.role-row { display: flex; align-items: center; gap: 3px; border: 1px solid var(--line-soft); border-radius: 8px; background: #120f1a; padding: 4px; }
input[type="color"] { padding: 1px; width: 24px; height: 24px; border: 0; flex: 0 0 auto; border-radius: 7px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 2px; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 5px; }
input[type="color"]::-moz-color-swatch { border: 0; border-radius: 5px; }
.hint,.empty { color: var(--muted); font-size: .76rem; line-height: 1.55; }
.empty { padding: 13px; border: 1px dashed var(--line); border-radius: 9px; }
.message-card,.module-card { border: 1px solid var(--line-soft); background: #120f1a; border-radius: 10px; padding: 10px; }
.message-card { border-left: 2px solid #a278f5; display: grid; gap: 8px; }
.message-top { display: flex; align-items: center; gap: 8px; }
.message-top input { flex:1; }
.message-card label { display: grid; gap: 4px; color: var(--muted); font-size: .74rem; }
.module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.module-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 7px; cursor: pointer; }
.module-card p { color: var(--muted); font-size: .74rem; margin-top: 4px; }
.module-card input { accent-color: #bd98fa; width: 17px; height: 17px; cursor: pointer; }
.deploy { width: min(100% - 24px,640px); max-height: min(90dvh,790px); padding: 0; color: var(--text); }
#replace-draft { width: min(100% - 24px, 420px); padding: 18px; }
#replace-draft p { color: var(--muted); margin: 8px 0 16px; }
.deploy::backdrop { background: #08060bd9; backdrop-filter: blur(4px); }
.deploy-header { display: flex; justify-content: space-between; gap: 14px; padding: 17px 20px; border-bottom: 1px solid var(--line); }
.deploy-header h2 { font-size: 1.08rem; letter-spacing: -.025em; }
.deploy-header p { color: var(--muted); margin-top: 3px; font-size: .76rem; }
.deploy-header .icon-button { font-size: 1.3rem; }
#deploy-content { display: grid; gap: 12px; padding: 17px 20px; }
.deploy-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.deploy-status { color: var(--muted); font-size: .79rem; overflow-wrap: anywhere; }
.deploy-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.deploy-summary span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; font-size: .73rem; }
.deploy-rows { padding: 0; margin: 0; list-style: none; max-height: 250px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.deploy-rows li { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 1px 7px; padding: 6px 9px; font-size: .76rem; overflow-wrap: anywhere; background: #130e1b; }
.deploy-rows li + li { border-top: 1px solid var(--line-soft); }
.deploy-rows small { color: var(--muted); grid-column: 1/-1; }
.deploy-rows [data-state="collision"],.deploy-rows [data-state="blocked"] { color: var(--amber); }
.deploy-rows [data-state="create"],.deploy-rows [data-state="publish"],.deploy-rows [data-state="enable"] { color: var(--green); }
.confirmation { display: flex; gap: 6px; align-items: start; font-size: .78rem; }
.confirmation input { accent-color: var(--purple); }
progress { width: 100%; accent-color: #bc96fa; }
.no-script { margin: 20px; color: var(--amber); }
@media (max-width: 850px) {
  .editor-layout { grid-template-columns: 1fr; }
  .brief { gap: 14px; }
  .intro h1 { font-size: clamp(2.6rem, 7.6vw, 4.6rem); }
  .brief-filters { gap: 10px; }
}
@media (max-width: 550px) {
  .header-wrap { padding: 0 12px; min-height: 56px; }
  .top-links a:first-child { display: none; }
  .workspace { padding-inline: 12px; padding-top: 20px; }
  .intro { display: grid; align-items: start; margin-bottom: 20px; }
  .intro h1 { font-size: clamp(2.3rem,9vw,3.5rem); }
  .intro p { margin-top: 10px; }
  .brief,.tab-content { padding: 14px; }
  .design-header,.server-strip,.design-footer { padding-inline: 12px; }
  .tabs { padding-inline: 7px; }
  .structure { grid-template-columns: 1fr; gap: 15px; }
  .module-grid { grid-template-columns: 1fr; }
  .channel-row select { max-width: 90px; }
  .intro-actions { margin-top: 2px; }
  .deploy-header,#deploy-content { padding-inline: 13px; }
}
@media (max-width: 355px) {
  .brief-actions { grid-template-columns: 1fr; }
  .tabs button { font-size: .7rem; }
  .server-kind { display: none; }
}

.audience-switch { display:flex; justify-content:flex-end; align-items:center; gap:8px; margin-bottom:12px; color:var(--muted); font-size:.74rem; }
.audience-switch select { width:auto; min-height:30px; }
.audience-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.audience-list article { padding:10px; }
.audience-list h3 { font-size:.82rem; padding-bottom:4px; }
.audience-list p { font-size:.75rem; margin:3px 0; color:var(--muted); overflow-wrap:anywhere; }
@media (max-width:480px) { .audience-list { grid-template-columns:1fr; } }
