.personality-page { min-height: 100vh; background: #071017; }
.studio-backdrop { position: fixed; inset: 0; opacity: .68; pointer-events: none; background: radial-gradient(circle at 18% 12%, rgba(70, 139, 132, .2), transparent 30%), radial-gradient(circle at 82% 3%, rgba(189, 151, 74, .1), transparent 24%), linear-gradient(rgba(144, 195, 192, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(144, 195, 192, .025) 1px, transparent 1px); background-size: auto, auto, 52px 52px, 52px 52px; }
.studio-login { position: relative; z-index: 1; display: grid; place-items: center; min-height: 100vh; padding: 110px 24px 60px; }
.studio-login > .login-brand { position: absolute; top: 28px; left: 32px; }
.studio-login-nav { position: absolute; top: 43px; right: 32px; }
.studio-login-card { width: min(500px, 100%); }
.studio-login-card > p:not(.card-kicker, .form-error) { color: var(--muted); font: 13px/1.65 var(--serif); }
.studio-shell { position: relative; z-index: 1; min-height: 100vh; }
.studio-header { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 86px; padding: 16px clamp(22px, 4vw, 58px); border-bottom: 1px solid var(--line-cool); background: rgba(6, 15, 20, .92); backdrop-filter: blur(18px); }
.studio-account { display: flex; align-items: center; gap: 11px; }
.studio-site-nav { justify-content: center; margin-left: auto; }
.studio-account > strong { max-width: 170px; overflow: hidden; color: #dce5e0; font-size: 10px; text-overflow: ellipsis; }
.studio-account .secondary-button { margin: 0; text-decoration: none; }
.studio-main { width: min(1480px, calc(100% - 64px)); margin: 0 auto; padding: 44px 0 80px; }
.studio-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 24px; }
.studio-intro h1 { max-width: 760px; margin: 0; font: 500 clamp(32px, 4vw, 52px)/1.05 var(--serif); }
.studio-intro > div > p:last-child { max-width: 720px; margin: 15px 0 0; color: var(--muted); font: 13px/1.65 var(--serif); }
.studio-intro-actions { display: flex; flex: 0 0 auto; gap: 9px; align-items: center; }
.studio-intro-actions .primary-button, .studio-intro-actions .secondary-button { width: auto; margin: 0; text-decoration: none; }
.studio-workspace-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.studio-workspace-tabs button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 13px; min-height: 72px; padding: 15px 18px; border: 1px solid var(--line-cool); color: var(--muted); background: rgba(5, 14, 18, .58); text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.studio-workspace-tabs button:hover { border-color: rgba(217, 185, 110, .28); }
.studio-workspace-tabs button.active { border-color: rgba(217, 185, 110, .4); color: #e5e8df; background: linear-gradient(120deg, rgba(217, 185, 110, .11), rgba(20, 58, 61, .13)); box-shadow: inset 2px 0 var(--gold); }
.studio-workspace-tabs button > span { grid-row: 1 / 3; align-self: center; color: var(--gold); font: 500 23px var(--serif); }
.studio-workspace-tabs button strong { align-self: end; font: 500 17px var(--serif); }
.studio-workspace-tabs button small { align-self: start; margin-top: 3px; color: var(--muted-dark); font-size: 8px; }
.studio-workspace.hidden { display: none; }
.studio-grid { display: grid; grid-template-columns: minmax(260px, .68fr) minmax(460px, 1.32fr); gap: 16px; }
.template-panel, .editor-panel, .assignment-panel { min-width: 0; }
.template-panel { overflow: hidden; }
.studio-panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 25px 25px 18px; }
.studio-panel-heading h2, .assignment-heading h2 { margin: 0; font: 500 24px var(--serif); }
.studio-panel-heading > span { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid var(--line); color: var(--gold); font-size: 9px; }
.studio-search { display: flex; align-items: center; min-height: 43px; margin: 0 25px 15px; border: 1px solid var(--line-cool); background: rgba(2, 10, 14, .65); }
.studio-search > span { padding-left: 13px; color: var(--muted-dark); font-size: 18px; }
.studio-search input { min-height: 41px; border: 0; background: transparent; }
.template-list { height: 475px; overflow-y: auto; border-top: 1px solid var(--line-cool); scrollbar-width: thin; scrollbar-color: rgba(217, 185, 110, .25) transparent; }
.template-option { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px; padding: 11px 24px; border: 0; border-bottom: 1px solid rgba(130, 181, 190, .08); color: #aebbb8; background: transparent; text-align: left; cursor: pointer; }
.template-option:hover { background: rgba(97, 151, 150, .04); }
.template-option.active { color: var(--gold-bright); background: linear-gradient(90deg, rgba(204, 171, 94, .12), rgba(204, 171, 94, .02)); box-shadow: inset 2px 0 var(--gold); }
.template-option strong { overflow: hidden; font-size: 10px; letter-spacing: .05em; text-overflow: ellipsis; }
.template-option small { flex: 0 0 auto; color: var(--muted-dark); font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.editor-panel { padding-bottom: 28px; }
.editor-panel form { height: 100%; }
.editor-heading { border-bottom: 1px solid var(--line-cool); }
.studio-panel-heading .save-state { width: auto; border-color: rgba(115, 201, 154, .22); color: var(--green); }
.editor-empty { display: grid; place-items: center; align-content: center; min-height: 450px; padding: 50px; color: var(--muted-dark); text-align: center; }
.editor-empty span { color: rgba(217, 185, 110, .22); font: 64px var(--serif); }
.editor-empty p { max-width: 320px; font: 13px/1.6 var(--serif); }
.editor-fields { display: flex; flex-direction: column; gap: 9px; padding: 23px 28px 0; }
.editor-fields textarea { width: 100%; min-height: 238px; padding: 14px; resize: vertical; border: 1px solid var(--line-cool); color: #d9e1dd; background: rgba(3, 11, 15, .74); font: 12px/1.65 var(--sans); }
.editor-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.editor-label-row small, .editor-note { color: var(--muted-dark); font-size: 8px; }
.editor-note { margin: 1px 0 4px; line-height: 1.5; }
.editor-fields .primary-button { margin-top: 4px; }
.assignment-panel { overflow: hidden; }
.assignment-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 25px; padding: 26px 26px 20px; }
.assignment-heading > div > p:last-child { margin: 7px 0 0; color: var(--muted-dark); font-size: 9px; }
.assignment-heading > div > p:last-child a { color: var(--gold); }
.bot-search { width: min(340px, 100%); margin: 0; }
.bot-table-wrap { overflow-x: auto; border-top: 1px solid var(--line-cool); }
.bot-identity { display: flex; flex-direction: column; gap: 3px; }
.bot-identity strong { color: #e0e7e2; font-size: 11px; }
.bot-identity-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bot-identity small { color: var(--muted-dark); font-size: 8px; }
.bot-identity .table-status { font-size: 7px; }
.bot-faction-badge { padding: 2px 5px; border: 1px solid; font-size: 7px; font-weight: 800; letter-spacing: .08em; line-height: 1; text-transform: uppercase; }
.bot-faction-badge.is-alliance { border-color: rgba(91, 149, 205, .42); color: #93bee8; background: rgba(50, 102, 158, .13); }
.bot-faction-badge.is-horde { border-color: rgba(190, 76, 67, .42); color: #e39a92; background: rgba(135, 43, 38, .13); }
.bot-personality-select, .bot-guild-select { width: min(330px, 100%); min-height: 38px; font-size: 9px; }
.bot-guild-select { min-width: 230px; }
.bot-personality-select:disabled, .bot-guild-select:disabled { opacity: .55; }
.bot-assignment-actions { display: grid; gap: 7px; }
.bot-response-button { width: fit-content; margin: 0; padding: 7px 9px; font-size: 7px; }
.bot-target-editor { padding: 24px 26px; border-top: 1px solid rgba(217, 185, 110, .22); background: rgba(24, 27, 23, .52); }
.bot-target-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.bot-target-heading h3 { margin: 3px 0 5px; font: 500 23px var(--serif); }
.bot-target-heading p:last-child { margin: 0; color: var(--muted-dark); font-size: 9px; }
.bot-target-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 13px; margin-top: 18px; }
.bot-target-form .wide { grid-column: 1 / -1; }
.bot-target-form textarea { resize: vertical; }
.bot-target-form-actions { display: flex; gap: 9px; align-items: center; }
.bot-target-form-actions .primary-button, .bot-target-form-actions .secondary-button { width: auto; margin: 0; }
.bot-target-list { display: grid; gap: 8px; margin-top: 18px; }
.bot-target-rule { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-cool); }
.bot-target-rule strong { font-size: 10px; }
.bot-target-rule span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.bot-target-rule-actions { display: flex; gap: 7px; align-items: center; }
.bot-target-rule button { margin: 0; }
.studio-pagination { min-height: 56px; }
.studio-pagination span { color: var(--muted); }
.assignment-error { color: #c87b6d; }
.bot-guild-dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid rgba(217, 185, 110, .28); color: #d9e1dd; background: #0a1419; box-shadow: 0 25px 80px rgba(0, 0, 0, .65); }
.bot-guild-dialog::backdrop { background: rgba(1, 7, 10, .78); backdrop-filter: blur(4px); }
.bot-guild-dialog form { display: grid; gap: 11px; padding: 28px; }
.bot-guild-dialog h2 { margin: 0; font: 500 28px var(--serif); }
.bot-guild-dialog form > p:not(.card-kicker, .form-error) { margin: 0 0 8px; color: var(--muted); font: 12px/1.6 var(--serif); }
.bot-guild-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }
.bot-guild-dialog-actions .primary-button, .bot-guild-dialog-actions .secondary-button { width: auto; margin: 0; }

@media (max-width: 920px) {
  .studio-header { align-items: flex-start; }
  .studio-account { flex-wrap: wrap; justify-content: flex-end; }
  .studio-site-nav { order: 3; justify-content: flex-start; width: 100%; padding-top: 12px; overflow-x: auto; border-top: 1px solid var(--line-cool); }
  .studio-main { width: calc(100% - 32px); padding-top: 30px; }
  .studio-grid { grid-template-columns: 1fr; }
  .template-list { height: 310px; }
  .studio-intro { align-items: flex-start; }
  .studio-workspace-tabs { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  .studio-login { padding-top: 165px; }
  .studio-login > .login-brand { left: 16px; }
  .studio-login-nav { top: 94px; right: 16px; left: 16px; justify-content: flex-start; padding-top: 12px; overflow-x: auto; border-top: 1px solid var(--line-cool); }
  .studio-header { position: relative; flex-direction: column; align-items: stretch; padding: 16px; }
  .studio-account { justify-content: flex-start; }
  .studio-account > strong { order: -1; }
  .studio-intro, .assignment-heading { flex-direction: column; align-items: stretch; }
  .studio-intro-actions { flex-direction: column; align-items: stretch; }
  .studio-intro-actions .primary-button, .studio-intro-actions .secondary-button { width: 100%; }
  .studio-main { width: calc(100% - 20px); padding-top: 24px; }
  .studio-panel-heading, .assignment-heading { padding-right: 19px; padding-left: 19px; }
  .studio-search { margin-right: 19px; margin-left: 19px; }
  .bot-search { width: 100%; margin: 0; }
  .editor-fields { padding-right: 19px; padding-left: 19px; }
  .bot-table-wrap table, .bot-table-wrap tbody, .bot-table-wrap tr, .bot-table-wrap td { display: block; width: 100%; }
  .bot-table-wrap thead { display: none; }
  .bot-table-wrap tr { padding: 17px 18px; border-bottom: 1px solid var(--line-cool); }
  .bot-table-wrap td { padding: 0; border: 0; }
  .bot-table-wrap td + td { margin-top: 11px; }
  .bot-personality-select, .bot-guild-select { width: 100%; min-width: 0; }
  .bot-response-button { width: 100%; }
  .bot-target-form { grid-template-columns: 1fr; }
  .bot-target-form .wide { grid-column: auto; }
  .bot-target-form-actions { align-items: stretch; flex-direction: column; }
  .bot-target-form-actions .primary-button, .bot-target-form-actions .secondary-button { width: 100%; }
  .bot-target-rule { grid-template-columns: 1fr; }
  .bot-target-rule-actions { flex-wrap: wrap; }
  .bot-guild-dialog form { padding: 22px 18px; }
  .bot-guild-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .bot-guild-dialog-actions .primary-button, .bot-guild-dialog-actions .secondary-button { width: 100%; }
}
