@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@600;700;800&display=swap");

:root {
  --bg: #0a0a0c;
  --panel: rgba(17, 17, 20, 0.78);
  --panel-2: #1a1a1f;
  --line: rgba(255, 255, 255, 0.06);
  --text: #f5f7f8;
  --muted: #8e949f;
  --teal: #00d4aa;
  --cyan: #0ff4c6;
  --danger: #ff4d5e;
  --discord: #5865f2;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "DM Mono", monospace;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--teal) 4%, transparent), transparent 36%),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--cyan) 6%, transparent), transparent 34%),
    var(--bg);
  letter-spacing: 0;
}

h1, h2, h3, strong, .brand {
  font-family: "Syne", sans-serif;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.8rem);
}

h2, h3, p {
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea, select, .btn {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  background: #0e0f12;
  color: var(--text);
  font: inherit;
}

input, textarea, select {
  width: 100%;
  min-height: 54px;
  padding: 13px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 46px;
  background:
    linear-gradient(45deg, transparent 50%, var(--text) 50%) calc(100% - 24px) 50% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--text) 50%, transparent 50%) calc(100% - 19px) 50% / 7px 7px no-repeat,
    #0e0f12;
  line-height: 1.2;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--teal);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

label input, label textarea, label select {
  color: var(--text);
  text-transform: none;
}

.color-pair {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.35fr);
  gap: 14px;
  align-items: end;
  min-width: 0;
}

.color-pair label {
  min-width: 0;
}

.color-pair input[type="color"] {
  min-width: 0;
}

.color-pair input:not([type="color"]) {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: uppercase;
}

.shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(10, 10, 12, 0.86);
  backdrop-filter: blur(12px);
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-block;
  border: 1px solid color-mix(in srgb, var(--cyan) 30%, transparent);
  background:
    linear-gradient(135deg, transparent 25%, var(--teal) 26%, var(--teal) 38%, transparent 39%),
    linear-gradient(315deg, transparent 25%, color-mix(in srgb, var(--cyan) 75%, transparent) 26%, color-mix(in srgb, var(--cyan) 75%, transparent) 38%, transparent 39%),
    #111114;
}

.brand-mark.large {
  width: 58px;
  height: 58px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #111114;
}

.brand-logo.large {
  width: 58px;
  height: 58px;
}

.nav-label, .eyebrow {
  margin: 8px 0;
  color: var(--teal);
  font-size: 0.72rem;
  text-transform: uppercase;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid transparent;
  color: #c6cbd1;
}

nav a.active, nav a:hover {
  border-color: var(--line);
  background: #111114;
  color: var(--text);
}

.dot, .status-dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  background: #343842;
}

.dot.on, .status-dot.ok {
  background: var(--teal);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.mini-profile, .account-row, .account-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-profile img, .user-pill img, .avatar {
  width: 38px;
  height: 38px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.mini-profile {
  min-width: 0;
}

.mini-profile div {
  min-width: 0;
}

.mini-profile strong,
.mini-profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-profile small {
  white-space: normal;
}

.avatar.big {
  width: 76px;
  height: 76px;
}

.mini-profile small, .license-chip, .muted, small {
  color: var(--muted);
}

.license-chip {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.license-chip code {
  overflow-x: auto;
  white-space: nowrap;
}

.content {
  padding: 44px 32px;
  overflow: hidden;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.page-head p {
  color: var(--muted);
}

.admin-page-head {
  margin-bottom: 18px;
}

.admin-page-head h1 {
  font-size: clamp(2.1rem, 4vw, 3.8rem);
  line-height: 0.95;
}

.admin-page-head p:not(.eyebrow) {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.roomy-actions {
  margin: 18px 0;
}

.btn, button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover, button:hover {
  border-color: color-mix(in srgb, var(--cyan) 45%, transparent);
}

.btn.primary {
  border-color: color-mix(in srgb, var(--teal) 70%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--teal) 25%, transparent), color-mix(in srgb, var(--cyan) 8%, transparent));
}

.btn.danger {
  border-color: rgba(255, 77, 94, 0.38);
  color: #ffb3bb;
}

.btn.tiny {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.74rem;
}

.discord-login {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  background: var(--discord);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
}

.panel, .auth-card, .hero-band, .stat-card, .action-card, .template-card {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 32px;
}

.hero-band {
  padding: 34px;
  margin-bottom: 18px;
  background:
    linear-gradient(120deg, color-mix(in srgb, var(--teal) 12%, transparent), transparent 55%),
    rgba(17, 17, 20, 0.84);
}

.hero-band h2 {
  max-width: 720px;
  font-size: clamp(2rem, 5vw, 5rem);
}

.stat-grid, .action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card, .action-card {
  min-height: 142px;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.stat-card strong {
  font-size: 2rem;
}

.admin-summary {
  gap: 12px;
  margin-bottom: 14px;
}

.admin-summary .stat-card {
  min-height: 104px;
  padding: 18px;
}

.admin-summary .stat-card strong {
  font-size: 1.55rem;
}

.admin-summary .stat-card small {
  font-size: 0.72rem;
}

.action-card span {
  color: var(--teal);
  font-size: 1.6rem;
}

.section-title {
  margin: 30px 0 14px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
}

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  padding: 8px;
}

.tabs button {
  flex: 0 0 auto;
  background: transparent;
}

.tabs button.active {
  border-color: var(--teal);
  color: var(--cyan);
}

.builder-layout {
  display: grid;
  grid-template-columns: minmax(500px, 1.05fr) minmax(360px, 0.95fr);
  gap: 24px;
  align-items: start;
}

.builder-layout > *,
.builder-form,
.v2-tab-panel,
.component-editor,
.preset-grid,
.v2-add-strip,
.mini-grid,
.row-between {
  min-width: 0;
}

.builder-form, .settings-stack, .stack {
  display: grid;
  gap: 24px;
}

.builder-form.panel {
  padding: 28px;
}

.tab-panel {
  display: none;
  gap: 14px;
}

.tab-panel.active,
.v2-tab-panel.active {
  display: grid;
}

.v2-tab-panel {
  display: none;
  gap: 24px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.builder-item {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.component-editor {
  overflow: visible;
}

.component-editor > .row-between {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.nested-panel {
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.018);
}

.nested-list {
  display: grid;
  gap: 18px;
  padding: 18px 0 0 18px;
  border-left: 1px solid color-mix(in srgb, var(--teal) 18%, transparent);
}

.inline-select {
  width: auto;
  min-width: 190px;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
}

.item-actions button {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
}

.preview-panel {
  position: sticky;
  top: 24px;
}

.live {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
  font-size: 0.72rem;
}

.live.off {
  color: var(--muted);
  border-color: var(--line);
  background: transparent;
}

.discord-preview {
  margin-top: 14px;
  padding: 18px;
  background: #313338;
  color: #dbdee1;
  font-family: "gg sans", "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.375;
}

.discord-preview strong,
.discord-preview h1,
.discord-preview h2,
.discord-preview h3 {
  font-family: inherit;
}

.message-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.message-head strong {
  color: #f2f3f5;
  font-weight: 600;
}

.message-head small {
  color: #949ba4;
}

.bot-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #041110;
  font-weight: 800;
  border-radius: 50%;
  flex: 0 0 auto;
}

.app-badge {
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  border-radius: 3px;
  color: #fff;
  background: #5865f2;
  font-size: 0.7rem;
  font-weight: 700;
}

.embed-preview {
  max-width: 520px;
  padding: 12px 16px;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  background: #2b2d31;
  color: #dbdee1;
}

.v2-preview-surface {
  max-width: 100%;
  padding: 0;
  border-left: 0;
  background: transparent;
}

.discord-heading {
  color: #f2f3f5;
  font-weight: 700;
  line-height: 1.15;
}

.discord-heading.h1 {
  margin: 0 0 12px;
  font-size: 1.8rem;
}

.discord-heading.h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.discord-heading.h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
}

.discord-subtext,
.v2-subtext {
  display: inline-block;
  color: #949ba4;
  font-size: 0.78rem;
  line-height: 1.35;
}

.preview-main {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.preview-author, .preview-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-author img, .preview-footer img {
  width: 20px;
  height: 20px;
  object-fit: cover;
}

.preview-thumb {
  width: 78px;
  height: 78px;
  object-fit: cover;
}

.preview-image {
  max-width: 100%;
  margin-top: 12px;
}

.preview-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.preview-fields div:not(.inline) {
  grid-column: 1 / -1;
}

.preview-fields span {
  display: block;
  color: #d9dde3;
}

.component-preview {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.component-preview button,
.discord-component-button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 4px;
  background: #4e5058;
  color: #fff;
  font-weight: 600;
}

.console {
  min-height: 120px;
  max-height: 220px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  background: #08090a;
}

.console .ok {
  color: var(--teal);
}

.console .error {
  color: var(--danger);
}

.save-confirm {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
  max-width: min(420px, calc(100vw - 32px));
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--teal) 55%, transparent);
  background: color-mix(in srgb, var(--teal) 16%, #111216);
  color: var(--text);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.42);
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.save-confirm.show {
  opacity: 1;
  transform: translateY(0);
}

.filter-bar, .form-grid, .mini-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  margin-bottom: 18px;
}

.mentions-grid, .mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-grid > label {
  min-width: 0;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.template-empty {
  grid-column: 1 / -1;
}

.template-card {
  overflow: hidden;
}

.template-swatch {
  height: 80px;
}

.template-body {
  padding: 16px;
}

.template-body h2 {
  min-width: 0;
  font-size: 1.2rem;
}

.template-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 16px;
}

.template-actions .btn {
  min-width: 0;
  padding: 0 10px;
  font-size: 0.78rem;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  gap: 16px;
}

.list-row {
  padding: 18px;
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.panel-title {
  margin-bottom: 18px;
}

.tabs.compact {
  margin-bottom: 22px;
}

.bot-tab {
  display: none;
  gap: 18px;
}

.bot-tab.active {
  display: grid;
}

.bot-profile {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 8px;
}

.target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 44px;
  align-items: center;
}

.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--teal) 25%, transparent);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

.target-chip button {
  min-height: 26px;
  width: 26px;
  padding: 0;
}

.role-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 54px;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.role-chip {
  min-height: 36px;
  padding: 0 12px;
  border-color: color-mix(in srgb, var(--teal) 22%, transparent);
}

.message-content {
  margin-bottom: 14px;
  color: #dbdee1;
}

.ping-line,
.v2-small-header {
  color: #949ba4;
  font-size: 0.82rem;
  margin-bottom: 12px;
}

.mention-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(88, 101, 242, 0.28);
  color: #d7dcff;
  font-weight: 600;
}

.emoji-chip {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  margin-right: 10px;
  padding: 0;
  border: 1px solid #3f4147;
  border-radius: 10px;
  background: #1f2229;
  color: #f2f3f5;
  font-size: 1rem;
  line-height: 1;
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 1px 0 rgba(0, 0, 0, 0.2);
}

.v2-text {
  margin-bottom: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.v2-section {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #3f4147;
  border-radius: 4px;
  background: #2f3136;
}

.v2-split-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 26%, transparent);
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
  font-size: 0.76rem;
}

.v2-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.v2-right-button-row {
  margin-top: 8px;
}

.v2-container .v2-section {
  padding: 0;
  border: 0;
  background: transparent;
}

.v2-section-text strong {
  color: #f2f3f5;
  font-weight: 700;
}

.v2-section-title-line {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 8px;
}

.v2-section-title {
  min-width: 0;
}

.v2-section-title .discord-heading {
  margin: 0;
}

.v2-section-body {
  color: #dbdee1;
}

.v2-action-list {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.v2-action-row-preview {
  min-height: 54px;
}

.action-list-row {
  display: grid;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.action-list-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.action-button-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.85fr) minmax(220px, 1.15fr) minmax(104px, auto);
  gap: 12px;
  align-items: end;
  max-width: 100%;
}

.action-button-grid > * {
  min-width: 0;
}

.action-button-grid .btn {
  width: 100%;
  padding: 0 12px;
}

.v2-section img {
  width: 84px;
  height: 84px;
  object-fit: cover;
}

.v2-media {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: min(100%, 600px);
  margin-bottom: 12px;
}

.v2-media img {
  width: min(100%, 600px);
  max-height: none;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: left center;
  border-radius: 3px;
  background: #1f2229;
}

.v2-media:has(img:nth-child(2)) {
  width: min(100%, 420px);
}

.v2-media:has(img:nth-child(2)) img {
  width: calc(50% - 4px);
  max-height: 140px;
  object-fit: cover;
}

.v2-container {
  max-width: min(100%, 760px);
  margin-bottom: 12px;
  padding: 14px 18px;
  border: 1px solid #3f4147;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #2b2d31;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.v2-container hr {
  border: 0;
  border-top: 1px solid #3f4147;
  margin: 12px 0;
}

.button-config-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.link-button-grid {
  grid-template-columns: minmax(180px, 0.85fr) minmax(260px, 1.4fr) auto;
}

.emoji-title-grid {
  grid-template-columns: minmax(110px, 0.22fr) minmax(260px, 1fr);
  align-items: start;
}

.container-option-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(150px, auto);
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.container-option-grid .color-pair {
  width: 100%;
}

.spoiler-option {
  min-height: 54px;
  align-self: end;
  justify-content: start;
}

.container-add-actions {
  padding: 2px 0 6px;
}

.outside-buttons-editor {
  margin-top: 18px;
}

.outside-button-row {
  align-items: end;
}

.outside-button-row .btn {
  align-self: end;
}

.outside-button-preview {
  max-width: 520px;
  margin-top: -2px;
}

.v2-file {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #3f4147;
  border-radius: 4px;
  background: #26282d;
}

.v2-file span {
  color: #949ba4;
  font-size: 0.72rem;
  font-weight: 700;
}

.v2-file code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.license-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.v2-section-head {
  margin-bottom: 4px;
}

.v2-section-head h2 {
  margin-bottom: 6px;
}

.v2-preset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 100%;
  gap: 16px;
}

.preset-card {
  width: 100%;
  min-width: 0;
  min-height: 128px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  justify-items: start;
  gap: 11px;
  padding: 16px;
  text-align: left;
  line-height: 1.2;
  white-space: normal;
  overflow: hidden;
}

.preset-card:hover {
  background: color-mix(in srgb, var(--teal) 6%, transparent);
}

.preset-card strong,
.preset-card small {
  max-width: 100%;
  pointer-events: none;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.preset-card strong {
  font-size: 0.94rem;
  line-height: 1.22;
}

.preset-card small {
  font-size: 0.74rem;
  line-height: 1.35;
}

.preset-card span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid color-mix(in srgb, var(--teal) 22%, transparent);
  color: var(--teal);
  font-size: 0.72rem;
}

.v2-add-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
}

.empty-builder {
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.014);
}

.duration-pills {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.duration-pill.active {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 14%, transparent);
}

.amount-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  gap: 10px;
  align-items: end;
}

.amount-stepper button {
  padding: 0;
}

.copy-banner {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--teal) 32%, transparent);
  color: var(--teal);
  background: color-mix(in srgb, var(--teal) 8%, transparent);
}

.key-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.key-row code,
.full-key,
.nowrap {
  white-space: nowrap;
}

.key-row code {
  overflow-x: auto;
}

hr.large {
  margin: 26px 0;
}

.account-row img {
  width: 56px;
  height: 56px;
}

.account-card {
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.account-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.account-card strong {
  display: block;
  font-size: 1.35rem;
}

.account-details {
  grid-template-columns: 170px minmax(0, 1fr);
}

.account-details dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-actions {
  margin-top: 22px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  text-transform: none;
  color: var(--text);
}

.check input {
  width: 18px;
  min-height: 18px;
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.data-table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
}

.table-panel {
  overflow-x: auto;
  padding: 22px 24px;
}

.table-toolbar {
  min-width: 980px;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 220px auto;
  align-items: end;
  gap: 14px;
  margin-bottom: 16px;
}

.table-count {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.78rem;
}

.license-table {
  min-width: 1400px;
}

.license-table th,
.license-table td {
  white-space: nowrap;
}

.license-table td:nth-child(8) {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  color: var(--teal);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
}

.badge.active {
  color: var(--teal);
}

.badge.banned, .badge.expired {
  color: var(--danger);
}

.row-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.row-actions .btn.tiny {
  min-height: 30px;
  padding: 0 8px;
  font-size: 0.66rem;
}

.detail-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
}

.detail-list dt {
  color: var(--muted);
}

.timeline article {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.admin-detail-layout {
  gap: 18px;
}

.admin-detail-panel {
  padding: 26px;
}

.admin-detail-panel h2 {
  margin-bottom: 22px;
  font-size: 1.45rem;
}

.license-record-list {
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.license-record-list dt,
.license-record-list dd {
  min-width: 0;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.license-record-list dt {
  color: var(--muted);
}

.license-record-list dd {
  overflow-wrap: anywhere;
}

.detail-actions {
  margin-top: 18px;
}

.license-timeline {
  border-top: 1px solid var(--line);
}

.license-timeline article {
  display: grid;
  gap: 6px;
  padding: 14px 0;
}

.license-timeline article div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.license-timeline strong {
  font-size: 0.88rem;
}

.license-timeline small {
  font-size: 0.72rem;
}

.license-timeline p {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.modal {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal-body {
  display: grid;
  gap: 20px;
  padding: 28px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.icon-close {
  min-width: 44px;
  padding: 0;
  font-size: 1.25rem;
}

.generated {
  display: grid;
  gap: 8px;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 34px;
  display: grid;
  gap: 16px;
}

.auth-subtext {
  max-width: 100%;
  font-size: 0.8rem;
  line-height: 1.35;
}

.auth-help {
  font-size: 0.66rem;
  line-height: 1.35;
}

.no-access-line,
.auth-help {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-form {
  display: grid;
  gap: 12px;
}

.tiny {
  color: var(--muted);
  font-size: 0.72rem;
}

.mobile-top, .overlay {
  display: none;
}

@media (max-width: 1280px) {
  .stat-grid, .action-grid, .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .builder-layout, .two-col {
    grid-template-columns: 1fr;
  }

  .preview-panel {
    position: static;
  }

  .v2-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .v2-preset-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .mobile-top {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(10, 10, 12, 0.94);
    backdrop-filter: blur(12px);
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-104%);
    width: min(306px, 86vw);
    transition: transform 0.2s ease;
  }

  .menu-open .sidebar {
    transform: translateX(0);
  }

  .overlay {
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.6);
  }

  .menu-open .overlay {
    display: block;
  }

  .content {
    padding: 24px 14px;
  }

  .page-head {
    display: grid;
  }

  h1 {
    font-size: 2.4rem;
  }

  .hero-band {
    padding: 22px;
  }

  .stat-grid, .action-grid, .template-grid, .filter-bar, .form-grid, .mentions-grid, .mini-grid, .preset-grid, .license-summary {
    grid-template-columns: 1fr;
  }

  .template-actions {
    grid-template-columns: 1fr;
  }

  .duration-pills,
  .table-toolbar,
  .v2-add-strip {
    grid-template-columns: 1fr 1fr;
    min-width: 0;
  }

  .v2-add-strip {
    grid-template-columns: 1fr;
  }

  .table-count {
    grid-column: 1 / -1;
  }

  .preview-main {
    grid-template-columns: 1fr;
  }

  .preview-fields {
    grid-template-columns: 1fr;
  }

  .modal {
    width: 100vw;
    max-width: none;
    height: 100vh;
    max-height: none;
    margin: 0;
  }

  .modal-body {
    padding: 22px 16px;
  }
}
