/* Focused PULSE polish for server-rendered admin workflows. */

/* Forms are a two-pane editor, not a legacy gold card inside another card. */
body.miki-pulse .admin-screen--forms .dyn-builder-panel { padding: 24px; }
body.miki-pulse .admin-screen--forms .dyn-form-builder { gap: 20px; }
body.miki-pulse .admin-screen--forms .dyn-builder-intro {
  display: grid; gap: 18px; padding: 0 0 20px; border: 0;
  border-bottom: 1px solid #303249; border-radius: 0; background: none;
}
body.miki-pulse .admin-screen--forms .dyn-builder-intro h3 { font-size: 23px; line-height: 1.3; margin: 6px 0 10px; }
body.miki-pulse .admin-screen--forms .dyn-builder-intro p { max-width: 780px; color: #aeb2c9; line-height: 1.65; }
body.miki-pulse .admin-screen--forms .dyn-builder-intro .kicker { color: #ba9af9; font-size: 10px; letter-spacing: .13em; }
body.miki-pulse .admin-screen--forms .dyn-builder-steps { grid-template-columns: repeat(4,minmax(0,1fr)); min-width: 0; }
body.miki-pulse .admin-screen--forms .dyn-builder-steps span {
  background: #171928; border-color: #303249; border-radius: 8px; color: #b8bad0;
  font-size: 11px; font-weight: 600; padding: 10px 12px;
}
body.miki-pulse .admin-screen--forms .dyn-template-row { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
body.miki-pulse .admin-screen--forms .dyn-template {
  display: grid; width: 100%; min-width: 0; min-height: 76px; padding: 14px;
  align-content: center; justify-content: stretch; gap: 6px; border: 1px solid #34374d;
  border-radius: 12px; background: #171928; box-shadow: none; color: #edf0fa;
  font: inherit; text-align: left; cursor: pointer; white-space: normal;
}
body.miki-pulse .admin-screen--forms .dyn-template b { font-size: 14px; font-weight: 750; }
body.miki-pulse .admin-screen--forms .dyn-template span { font-size: 11px; font-weight: 450; color: #a7acc5; line-height: 1.4; }
body.miki-pulse .admin-screen--forms .dyn-template.active { border-color: #9270da; background: #2b2340; color: #f3edff; }
body.miki-pulse .admin-screen--forms .dyn-template.active span { color: #c4b4e6; }
body.miki-pulse .admin-screen--forms .dyn-template:hover { border-color: #9270da; }
body.miki-pulse .admin-screen--forms .dyn-main-grid { grid-template-columns: minmax(0,1.35fr) minmax(280px,.85fr); gap: 20px; }
body.miki-pulse .admin-screen--forms .dyn-editor { padding: 0; border: 0; background: none; gap: 18px; }
body.miki-pulse .admin-screen--forms .dyn-section-title h3 { font-size: 16px; line-height: 1.3; }
body.miki-pulse .admin-screen--forms .dyn-section-title p { font-size: 12px; line-height: 1.55; color: #a7acc5; }
body.miki-pulse .admin-screen--forms .dyn-section-title:not(:first-child) { padding-top: 16px; border-top: 1px solid #303249; }
body.miki-pulse .admin-screen--forms .dyn-editor > .split { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
body.miki-pulse .admin-screen--forms .dyn-editor label { display: grid; gap: 8px; min-width: 0; font-size: 12px; color: #b9bdd3; }
body.miki-pulse .admin-screen--forms .dyn-editor :is(input,select,textarea) { width: 100%; min-width: 0; border: 1px solid #34384f; border-radius: 9px; background: #101320; color: #eef0fb; font: inherit; padding: 11px 12px; }
body.miki-pulse .admin-screen--forms .dyn-editor textarea { min-height: 100px; resize: vertical; }
body.miki-pulse .admin-screen--forms .dyn-field-card { padding: 14px; border-color: #34374d; background: #171a2a; box-shadow: none; border-radius: 12px; }
body.miki-pulse .admin-screen--forms .dyn-field-card-head b { font-size: 10px; color: #b697f2; }
body.miki-pulse .admin-screen--forms .dyn-field-grid { grid-template-columns: minmax(0,1fr) 118px; gap: 12px; }
body.miki-pulse .admin-screen--forms .dyn-field-grid .check-line { display: flex; grid-column: 1/-1; align-items: center; height: auto; min-height: 32px; padding: 0; border: 0; background: none; }
body.miki-pulse .admin-screen--forms .dyn-field-grid input[type=checkbox] { width: 16px; height: 16px; accent-color: #a17bfa; }
body.miki-pulse .admin-screen--forms .dyn-field-actions button { width: 34px; min-height: 34px; padding: 0; border: 1px solid #40445c; background: #22263a; color: #e9e6f8; box-shadow: none; font: inherit; border-radius: 8px; cursor: pointer; }
body.miki-pulse .admin-screen--forms .dyn-field-actions button:disabled { opacity: .35; cursor: not-allowed; }
body.miki-pulse .admin-screen--forms .dyn-preview { position: sticky; top: 90px; grid-template-columns: minmax(0,1fr); gap: 14px; }
body.miki-pulse .admin-screen--forms :is(.dyn-phone,.dyn-modal-preview) { padding: 18px; background: #151827; border: 1px solid #35374f; border-radius: 14px; box-shadow: none; }
body.miki-pulse .admin-screen--forms .dyn-embed-preview { background: #1d2030; border-color: #34374d; border-left-color: #a17bfa; border-radius: 8px; }
body.miki-pulse .admin-screen--forms .dyn-embed-preview p { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
body.miki-pulse .admin-screen--forms .dyn-embed-preview h3 { font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
body.miki-pulse .admin-screen--forms .dyn-preview-flow { border-color: #3c3c53; font-size: 11px; }
body.miki-pulse .admin-screen--forms .dyn-modal-preview h3 { font-size: 14px; line-height: 1.4; }
body.miki-pulse .admin-screen--forms .dyn-modal-preview > div > p { color: #a7acc5; font-size: 11px; }
body.miki-pulse .admin-screen--forms .dyn-preview-field { background: #1c2031; border-color: #33394f; border-radius: 8px; padding: 10px; }
body.miki-pulse .admin-screen--forms .dyn-preview-field b { font-size: 12px; overflow-wrap: anywhere; }
body.miki-pulse .admin-screen--forms .dyn-preview-field span { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
body.miki-pulse .admin-screen--forms .dyn-preview-note { margin: 10px 0 0; color: #a7acc5; font-size: 11px; }
body.miki-pulse .admin-screen--forms .dyn-discord-button,
body.miki-pulse .admin-screen--forms .dyn-submit { display: inline-flex; justify-content: center; align-items: center; width: auto; min-height: 42px; padding: 11px 16px; border: 1px solid #b397ee; border-radius: 9px; background: linear-gradient(125deg,#bf9cff,#8960de); color: #181024; font: inherit; font-size: 13px; font-weight: 750; box-shadow: none; cursor: pointer; }
body.miki-pulse .admin-screen--forms .dyn-publish-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid #303249; }
body.miki-pulse .admin-screen--forms .dyn-publish-footer p { margin: 0; color: #a7acc5; font-size: 12px; }
body.miki-pulse .admin-screen--forms .dyn-raw { background: #151827; border-color: #40445c; border-radius: 9px; }
body.miki-pulse .admin-screen--forms :is(button,input,select,textarea):focus-visible,
body.miki-pulse .dyn-preview-dialog :is(button,input,textarea):focus-visible { outline: 2px solid #c4a6ff; outline-offset: 3px; }
body.miki-pulse .dyn-preview-dialog { width: min(520px,calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 24px; border: 1px solid #695287; border-radius: 18px; background: #191b2c; color: #eff0fb; box-shadow: 0 24px 80px #0009; }
body.miki-pulse .dyn-preview-dialog::backdrop { background: #080914c9; backdrop-filter: blur(5px); }
body.miki-pulse .dyn-dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; }
body.miki-pulse .dyn-dialog-head h2 { margin: 0; font-size: 20px; overflow-wrap: anywhere; }
body.miki-pulse .dyn-dialog-head button { flex: none; width: 34px; height: 34px; border: 1px solid #44465d; border-radius: 8px; background: #282a40; color: #e9e6f8; font-size: 20px; cursor: pointer; }
body.miki-pulse .dyn-preview-dialog > p { color: #b7a5d9; font-size: 12px; margin: 12px 0 20px; }
body.miki-pulse .dyn-dialog-fields { display: grid; gap: 16px; }
body.miki-pulse .dyn-dialog-fields label { display: grid; gap: 8px; color: #bec2d8; font-size: 12px; }
body.miki-pulse .dyn-dialog-fields :is(input,textarea) { width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #41445c; border-radius: 9px; background: #101320; color: #eff0fb; font: inherit; resize: vertical; }
@media (max-width: 1100px) {
  body.miki-pulse .admin-screen--forms .dyn-main-grid { grid-template-columns: minmax(0,1fr); }
  body.miki-pulse .admin-screen--forms .dyn-preview { position: static; grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  body.miki-pulse .admin-screen--forms .dyn-builder-panel { padding: 16px; }
  body.miki-pulse .admin-screen--forms .dyn-builder-intro h3 { font-size: 20px; }
  body.miki-pulse .admin-screen--forms :is(.dyn-template-row,.dyn-builder-steps) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  body.miki-pulse .admin-screen--forms .dyn-template { padding: 12px; }
  body.miki-pulse .admin-screen--forms .dyn-template b { font-size: 13px; }
  body.miki-pulse .admin-screen--forms :is(.dyn-editor > .split,.dyn-field-grid,.dyn-preview) { grid-template-columns: minmax(0,1fr); }
  body.miki-pulse .admin-screen--forms .dyn-section-title { display: grid; }
  body.miki-pulse .admin-screen--forms .dyn-field-actions button { width: 40px; min-height: 40px; }
  body.miki-pulse .admin-screen--forms .dyn-publish-footer { align-items: stretch; flex-direction: column; }
  body.miki-pulse .admin-screen--forms .dyn-submit { width: 100%; }
  body.miki-pulse .dyn-preview-dialog { padding: 20px; }
}

body.miki-pulse .mode-admin .pulse-screen-users .admin-section--users .admin-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

body.miki-pulse .mode-admin .pulse-screen-users .admin-section--users .admin-section__actions,
body.miki-pulse .mode-admin .pulse-screen-users .admin-section__toolbar-form {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

body.miki-pulse .mode-admin .pulse-screen-users .member-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

body.miki-pulse .mode-admin .pulse-screen-users .member-search-form > label {
  min-width: 0;
}

body.miki-pulse .mode-admin .pulse-screen-users .member-search-form input[type="search"] {
  width: 100%;
}

body.miki-pulse .mode-admin .pulse-screen-users .admin-filter-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-users .admin-section__toolbar-form > button,
  .pulse-screen-users .admin-filter-bar__actions > button,
  .pulse-screen-users .admin-inline-editor form.form-card > button,
  .pulse-screen-news form[action="/admin/news/action"] > button,
  .pulse-screen-publish form[action="/admin/announce"] > button,
  .pulse-screen-economy form[action="/admin/points"] > button,
  .pulse-screen-economy form[action="/admin/miki-points"] > button
) {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  max-width: 100%;
  padding: 9px 16px;
  border: 1px solid rgba(var(--accent-rgb), .55);
  border-radius: 10px;
  background: linear-gradient(145deg, #cfb3ff 0%, var(--accent) 45%, #7454d2 100%);
  box-shadow: inset 0 1px rgba(255, 255, 255, .35), 0 6px 18px rgba(var(--accent-rgb), .12);
  color: #160f2d;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: filter .18s ease, transform .18s ease, border-color .18s ease;
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-users .admin-section__toolbar-form > button,
  .pulse-screen-news form[action="/admin/news/action"] > button
) {
  border-color: #46506e;
  background: linear-gradient(160deg, #282d40, #1a2030);
  box-shadow: inset 0 1px rgba(255, 255, 255, .07);
  color: #e8eaf6;
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-users .admin-section__toolbar-form > button,
  .pulse-screen-users .admin-filter-bar__actions > button,
  .pulse-screen-users .admin-inline-editor form.form-card > button,
  .pulse-screen-news form[action="/admin/news/action"] > button,
  .pulse-screen-publish form[action="/admin/announce"] > button,
  .pulse-screen-economy form[action="/admin/points"] > button,
  .pulse-screen-economy form[action="/admin/miki-points"] > button
):is(:hover, :focus-visible) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

body.miki-pulse .mode-admin .pulse-screen-access .access-hero {
  min-height: 0;
  align-items: center;
  gap: 28px;
  padding: 20px 0 30px;
}

body.miki-pulse .mode-admin .pulse-screen-audit .admin-screen--audit > .panel:first-of-type > .empty {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

@media (max-width: 640px) {
  body.miki-pulse .mode-admin .pulse-screen-users .admin-section--users .admin-section__head {
    align-items: stretch;
    flex-direction: column;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-section--users .admin-section__actions,
  body.miki-pulse .mode-admin .pulse-screen-users .admin-section__toolbar-form,
  body.miki-pulse .mode-admin .pulse-screen-users .admin-section__toolbar-form > button {
    width: 100%;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .member-search-form {
    grid-template-columns: 1fr;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-filter-bar__actions > button {
    flex: 1 1 auto;
  }

  /* Keep every player statistic and the profile action visible without sideways scrolling. */
  body.miki-pulse .mode-admin .pulse-screen-users .admin-section--users .admin-table-scroll {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll table,
  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin: 0 0 10px;
    overflow: hidden;
    border: 1px solid #323952;
    border-radius: 12px;
    background: #111626;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid #272e43;
    color: var(--text);
    font-size: 13px;
    text-align: left;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td:nth-child(odd):not(:first-child) {
    border-left: 1px solid #272e43;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td:first-child,
  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td:last-child {
    grid-column: 1 / -1;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td:first-child::before {
    display: none;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td:last-child {
    border-bottom: 0;
  }

  body.miki-pulse .mode-admin .pulse-screen-users .admin-table-scroll tbody td:last-child .button {
    width: 100%;
    justify-content: center;
  }

  body.miki-pulse .mode-admin .pulse-screen-access .access-hero {
    gap: 20px;
    padding: 16px 0 24px;
  }

  body.miki-pulse .mode-admin :is(
    .pulse-screen-audit .panel-head h2,
    .pulse-screen-service .service-control-panel .panel-head h2
  ) {
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.16;
  }
}

/* Keep high-consequence and search actions legible in their exact admin workflows. */
/* The VPN access card is narrow even on desktop: two columns collapse the
   destructive action into a vertical strip. Keep both full-width in order. */
body.miki-pulse .mode-admin .pulse-screen-vpn .vpn-admin-access {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.miki-pulse .mode-admin .pulse-screen-vpn .vpn-admin-access > .split {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  min-width: 0 !important;
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-vpn .vpn-admin-access .split > button,
  .pulse-screen-doctor .doctor-action-grid form[action="/admin/doctor/action"] > button,
  .pulse-screen-lsc_archive .lsc-admin-filters > button
) {
  appearance: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: 44px !important;
  padding: 10px 14px !important;
  border: 1px solid #b79bfa !important;
  border-radius: 10px !important;
  background: linear-gradient(125deg, #c7afff, #895de9) !important;
  color: #171124 !important;
  box-shadow: 0 8px 22px rgba(116, 73, 211, .18) !important;
  font: inherit !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  text-align: center !important;
  white-space: normal !important;
  cursor: pointer !important;
}

body.miki-pulse .mode-admin .pulse-screen-vpn .vpn-admin-access .split > button[value="block"] {
  border-color: #f17e8f !important;
  background: linear-gradient(125deg, #b73b59, #80233c) !important;
  color: #fff5f6 !important;
  box-shadow: 0 8px 20px rgba(150, 39, 68, .18) !important;
}

body.miki-pulse .mode-admin .pulse-screen-vpn .vpn-admin-access .split > button[value="unblock"] {
  border-color: #4dcda4 !important;
  background: linear-gradient(125deg, #154738, #123b35) !important;
  color: #d5ffed !important;
  box-shadow: 0 8px 20px rgba(22, 130, 95, .13) !important;
}

body.miki-pulse .mode-admin .pulse-screen-doctor .doctor-action-grid form:has(input[value="vpn_cleanup"]) > button,
body.miki-pulse .mode-admin .pulse-screen-doctor .doctor-action-grid form:has(input[value="rotate_logs"]) > button {
  border-color: #d5a45b !important;
  background: linear-gradient(125deg, #49351f, #352a21) !important;
  color: #ffe8bd !important;
  box-shadow: 0 8px 20px rgba(126, 82, 26, .13) !important;
}

body.miki-pulse .mode-admin .pulse-screen-doctor .doctor-action-grid form:has(input[value="shop_version"]) > button {
  border-color: #46506e !important;
  background: linear-gradient(160deg, #282d40, #1a2030) !important;
  color: #e8eaf6 !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, .07) !important;
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-vpn .vpn-admin-access .split > button,
  .pulse-screen-doctor .doctor-action-grid form[action="/admin/doctor/action"] > button,
  .pulse-screen-lsc_archive .lsc-admin-filters > button
):hover:not(:disabled) {
  filter: brightness(1.1);
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-vpn .vpn-admin-access .split > button,
  .pulse-screen-doctor .doctor-action-grid form[action="/admin/doctor/action"] > button,
  .pulse-screen-lsc_archive .lsc-admin-filters > button
):focus-visible {
  outline: 2px solid #f0e2ff !important;
  outline-offset: 3px !important;
}

body.miki-pulse .mode-admin :is(
  .pulse-screen-vpn .vpn-admin-access .split > button,
  .pulse-screen-doctor .doctor-action-grid form[action="/admin/doctor/action"] > button,
  .pulse-screen-lsc_archive .lsc-admin-filters > button
):disabled {
  border-color: #44485b !important;
  background: #292c3c !important;
  color: #a2a5b9 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
}

/* Owner registry uses semantic grid rows; the legacy inline stylesheet is
   intentionally removed by PULSE, so its layout belongs in this asset. */
body.miki-pulse .owner-guild-summary { display:flex; flex-wrap:wrap; gap:8px 20px; margin:12px 0; font-size:12px; }
body.miki-pulse .owner-guild-summary small { flex-basis:100%; color:var(--muted); }
body.miki-pulse .owner-guild-registry { width:100%; min-width:0; }
body.miki-pulse :is(.owner-guild-row,.owner-guild-registry-head) { display:grid; grid-template-columns:minmax(140px,1.3fr) minmax(130px,1fr) 110px minmax(120px,1fr) 70px 85px minmax(125px,.8fr); gap:12px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
body.miki-pulse .owner-guild-registry-head { color:var(--muted); font-size:11px; }
body.miki-pulse .owner-guild-cell { min-width:0; font-size:12px; overflow-wrap:anywhere; }
body.miki-pulse .owner-guild-name { display:flex; gap:10px; align-items:center; }
body.miki-pulse .owner-guild-icon { width:34px; height:34px; border-radius:9px; object-fit:cover; flex:none; }
body.miki-pulse :is(.owner-guild-name,.owner-guild-owner) small { display:block; margin-top:4px; color:var(--muted); font-size:11px; }
body.miki-pulse .owner-guild-cell code { font-size:11px; }
body.miki-pulse .owner-guild-action .button { padding:7px 9px; font-size:11px; min-height:36px; }
@media(max-width:1350px) {
  body.miki-pulse .owner-guild-registry-head { display:none; }
  body.miki-pulse .owner-guild-registry { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  body.miki-pulse .owner-guild-row { grid-template-columns:repeat(2,minmax(0,1fr)); padding:14px; border:1px solid var(--line); border-radius:12px; gap:10px; }
  body.miki-pulse .owner-guild-primary { grid-column:1/-1; }
  body.miki-pulse .owner-guild-cell:not(.owner-guild-primary)::before { content:attr(data-label); display:block; margin-bottom:4px; color:var(--muted); font-size:10px; }
  body.miki-pulse .owner-guild-action .button { min-height:44px; }
}
@media(max-width:600px) { body.miki-pulse .owner-guild-registry { grid-template-columns:minmax(0,1fr); } }
