/* src/styles.css */
:root {
  --buncss-light: initial;
  --buncss-dark: ;
  color-scheme: light;
  --ink: #171717;
  --muted: #6d6a70;
  --paper: #f8f6f8;
  --panel: #ffffffe0;
  --line: #dedbe0;
  --line-strong: #171717;
  --green: #171717;
  --green-dark: #000;
  --blue: #171717;
  --amber: #f8f6f8;
  --red: #b63c34;
  --red-soft: #fff0ed;
  --shadow: 0 22px 80px #17171724;
  font-family: Avenir Next, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Noto Sans CJK SC, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body, #root {
  touch-action: manipulation;
  min-height: 100%;
}

body {
  color: var(--ink);
  background: linear-gradient(#1717170a 1px, transparent 1px), linear-gradient(90deg, #1717170a 1px, transparent 1px), var(--paper);
  background-size: 28px 28px;
  min-width: 320px;
  margin: 0;
}

button, input, textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.shell {
  position: relative;
  width: min(1160px, 100vw - 32px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 40px 0 52px;
}

.authShell {
  width: min(760px, 100vw - 32px);
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-bottom: 2px solid var(--line-strong);
  align-items:  end;
  gap: 28px;
  margin-bottom: 22px;
  padding-bottom: 18px;
}

.eyebrow {
  color: var(--green-dark);
  letter-spacing: 0;
  text-transform: uppercase;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

h1 {
  color: var(--ink);
  letter-spacing: 0;
  margin: 0;
  font-size: clamp(36px, 6vw, 70px);
  font-weight: 900;
  line-height: .94;
}

.statusChip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 8px 8px 0 var(--ink);
  text-align: right;
  align-items:  center;
  gap: 12px;
  min-width: 230px;
  max-width: 340px;
  padding: 12px 14px;
}

.statusChip span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.35;
}

.statusChip strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1.2;
}

.statusChip small {
  display: block;
  overflow: hidden;
  color: var(--green-dark);
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.studioStatusChip.loggedIn {
  text-align: left;
  min-width: min(390px, 100vw - 32px);
  max-width: 430px;
  padding: 10px 12px;
}

.studioStatusChip.loggedIn strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
  font-size: 17px;
  line-height: 1.25;
}

.studioStatusChip.loggedIn small {
  color: var(--muted);
}

.statusActions {
  display: flex;
  align-items:  center;
  gap: 8px;
}

.statusWalletButton {
  display: inline-flex;
  border: 2px solid var(--line-strong);
  background: var(--green);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  justify-content: center;
  align-items:  center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  transition: transform .12s, box-shadow .12s, background-color .12s;
  font-size: 12px;
  font-weight: 850;
}

.statusWalletButton span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.statusLogoutButton {
  display: grid;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  background: #fff;
  place-items:  center;
  width: 36px;
  height: 36px;
  transition: transform .12s, box-shadow .12s, background-color .12s;
}

.statusWalletButton:hover, .statusLogoutButton:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.announcementBanner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border: 2px solid var(--line-strong);
  background: #f8f6f8;
  align-items:  start;
  gap: 12px;
  margin: -4px 0 22px;
  padding: 14px 16px;
  box-shadow: 6px 6px #181a172e;
}

.announcementBanner span {
  display: grid;
  border: 2px solid var(--line-strong);
  background: var(--green);
  color: #fff;
  place-items:  center;
  width: 34px;
  height: 34px;
}

.announcementBanner p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.6;
}

.playbookBanner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr);
  border: 2px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(135deg, #ffffffad, #f8f6f86b), #ffffffb8;
  align-items:  center;
  gap: 0;
  margin: 0 0 22px;
}

.playbookBanner:before {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: .85;
  background: linear-gradient(90deg, #1717170f, #0000 34%), repeating-linear-gradient(135deg, #17171709 0 1px, #0000 1px 54px);
  inset: 0;
}

.playbookBanner:after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: linear-gradient(90deg, #0000, #1717173d, #0000);
  height: 1px;
  inset: auto 0 0;
}

.playbookBannerBody {
  position: relative;
  z-index: 1;
  display: grid;
  color: #171717;
  align-content:  start;
  gap: 18px;
  padding: 30px 28px 26px;
}

.playbookBannerTopline {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 10px;
}

.playbookBannerEyebrow {
  display: inline-flex;
  color: #fff;
  background: #171717;
  border: 1px solid #17171729;
  width: -moz-fit-content;
  width: fit-content;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.playbookBannerBody h2 {
  letter-spacing: 0;
  max-width: 9ch;
  margin: 0;
  font-size: clamp(32px, 5.2vw, 56px);
  font-weight: 900;
  line-height: .96;
}

.playbookBannerBody p, .playbookBannerPreviewCopy p, .playbookBannerPlaceholder p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
}

.playbookBannerLead {
  color: #6d6a70;
  max-width: 22ch;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.55;
}

.playbookBannerActions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.playbookPrimaryButton {
  border: 2px solid var(--line-strong);
  color: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  background: #171717;
  min-height: 50px;
  padding: 0 22px;
  font-weight: 850;
}

.playbookBannerActions .miniButton {
  color: #171717;
  box-shadow: none;
  background: #ffffffb8;
  border-color: #17171729;
}

.playbookBannerPreview {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: #f8f6f8;
  border: 1px solid #17171724;
  height: clamp(160px, 19vw, 210px);
  margin: 18px 18px 18px 0;
}

.playbookBannerPreview:after {
  content: "";
  position: absolute;
  pointer-events: none;
  background: linear-gradient(#f8f6f805 0%, #f8f6f81a 38%, #171717a3 100%), linear-gradient(90deg, #17171714, #0000 34%);
  inset: 0;
}

.playbookBannerPreview img {
  display: block;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
  width: 100%;
  height: 100%;
}

.playbookBannerPreviewCopy {
  position: absolute;
  z-index: 1;
  display: grid;
  color: #f8f7f1;
  gap: 10px;
  padding: 60px 16px 16px;
  bottom: 0;
  left: 0;
  right: 0;
}

.playbookBannerPreviewBadge {
  display: flex;
  align-items:  center;
  gap: 10px;
}

.playbookBannerPreviewBadge span {
  color: #f8f7f1d1;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 850;
}

.playbookBannerPreviewCopy strong, .playbookBannerPlaceholder strong {
  font-size: 22px;
  font-weight: 900;
}

.playbookBannerPlaceholder {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
  color: #f8f7f1;
  place-items:  center;
  gap: 10px;
  min-height: 100%;
  padding: 24px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, .94fr);
  align-items:  start;
  gap: 22px;
}

.panel {
  border: 2px solid var(--line-strong);
  box-shadow: var(--shadow);
  background: #fffdf7f5;
}

.panelHeader {
  display: flex;
  border-bottom: 2px solid var(--line-strong);
  justify-content: space-between;
  align-items:  center;
  gap: 16px;
  min-height: 74px;
  padding: 18px 20px;
}

.panelTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.panelHint {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.panelMark {
  display: inline-grid;
  border: 2px solid var(--line-strong);
  background: var(--amber);
  color: var(--ink);
  flex: none;
  place-items:  center;
  min-width: 52px;
  height: 34px;
  font-weight: 900;
}

.presetTrigger {
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
  font-size: 12px;
}

.presetTrigger:hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.conversationPanel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: min(820px, 100svh - 168px);
  min-height: 620px;
}

.conversation {
  display: flex;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 20px;
}

.message {
  display: flex;
  animation: rise .2s ease both;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.bubble {
  border: 2px solid var(--line-strong);
  background: #fff;
  width: -moz-fit-content;
  width: fit-content;
  max-width: min(720px, 90%);
  box-shadow: 5px 5px #181a172e;
}

.message.user .bubble {
  color: #fff;
  background: var(--blue);
}

.message.assistant .bubble {
  color: var(--ink);
  background: #fff;
}

.bubble p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.64;
}

.imageStack, .imageGrid {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.imageGrid {
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  max-width: min(460px, 68vw);
}

.imageFrame {
  position: relative;
  margin: 0;
}

.imagePreviewButton {
  display: block;
  color: inherit;
  cursor: zoom-in;
  background: none;
  border: 0;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.imageFrame img {
  display: block;
  object-fit: contain;
  border: 2px solid var(--line-strong);
  background: #fff;
  width: min(100%, 420px);
  max-height: min(42svh, 460px);
  transition: transform .12s, box-shadow .12s;
}

.imagePreviewButton:hover img {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px #181a174d;
}

.downloadButton, .logoutButton, .iconButton, .sendButton, .draftPreview button {
  display: grid;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  background: #fff;
  place-items:  center;
}

.downloadButton, .logoutButton, .iconButton, .sendButton, .draftPreview button {
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background-color .12s, opacity .12s;
}

.downloadButton {
  position: absolute;
  box-shadow: 4px 4px 0 var(--ink);
  width: 36px;
  height: 36px;
  bottom: 10px;
  right: 10px;
}

.downloadButton:disabled {
  cursor: progress;
  opacity: .78;
}

.downloadButton.loading svg {
  animation: spin .9s linear infinite;
}

.downloadHint {
  color: var(--green-dark);
  background: #f8f6f8;
  border: 2px solid #1717175c;
  width: min(100%, 420px);
  margin-top: 8px;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.downloadButton:not(:disabled):hover, .logoutButton:hover, .iconButton:hover, .sendButton:not(:disabled):hover, .draftPreview button:hover, .authSubmit:not(:disabled):hover {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.accountBar {
  display: flex;
  align-items:  center;
  gap: 10px;
}

.historyToggle {
  display: inline-flex;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  background: #fff;
  align-items:  center;
  gap: 7px;
  min-height: 36px;
  padding: 0 10px;
  transition: transform .12s, box-shadow .12s, background-color .12s;
  font-size: 12px;
  font-weight: 850;
}

.historyToggle:hover, .historyToggle.active {
  box-shadow: 2px 2px 0 var(--ink);
  transform: translate(2px, 2px);
}

.historyToggle.active {
  background: #f8f6f8;
}

.logoutButton {
  width: 36px;
  height: 36px;
}

.logoutButton {
  box-shadow: 4px 4px 0 var(--ink);
}

.historyPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-bottom: 2px solid var(--line-strong);
  background: #fff;
  gap: 0;
  max-height: 360px;
  padding: 0;
}

.historyPanelEmpty {
  display: block;
  padding: 18px;
}

.historyToolbar, .historyConfirm {
  display: flex;
  align-items:  center;
}

.historyToolbar {
  border-bottom: 1px solid var(--line);
  gap: 18px;
  min-height: 48px;
  padding: 0 18px;
}

.historyToolbar button {
  position: relative;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  min-height: 48px;
  padding: 0;
  font-size: 12px;
  font-weight: 850;
}

.historyToolbar button.active {
  color: var(--green-dark);
}

.historyToolbar button.active:after {
  content: "";
  position: absolute;
  background: var(--green-dark);
  border-radius: 999px;
  height: 2px;
  bottom: 0;
  left: 0;
  right: 0;
}

.historyList {
  display: grid;
  overflow-y: auto;
  align-content:  start;
  min-height: 0;
  padding: 8px 18px;
}

.historyListStatus {
  color: var(--muted);
  text-align: center;
  padding: 10px 0 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.historyConfirm span {
  color: var(--red);
  font-size: 12px;
  font-weight: 850;
}

.historyItem {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  align-items:  center;
  gap: 12px;
  min-width: 0;
  padding: 8px 0;
}

.historyItemMain {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  color: inherit;
  cursor: pointer;
  text-align: left;
  background: none;
  border: 0;
  align-items:  center;
  gap: 12px;
  min-width: 0;
  padding: 0;
}

.historyItemMain img, .historyItemThumbPlaceholder {
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 72px;
  height: 72px;
}

.historyItemMain img {
  object-fit: cover;
}

.historyItemThumbPlaceholder {
  display: grid;
  color: var(--muted);
  background-color: #f8f6f8;
  background-image: linear-gradient(#1717170b 1px, #0000 1px), linear-gradient(90deg, #1717170b 1px, #0000 1px), none;
  background-position: 0 0, 0 0, 0 0;
  background-repeat: repeat, repeat, repeat;
  background-size: 12px 12px;
  background-attachment: scroll, scroll, scroll;
  background-origin: padding-box, padding-box, padding-box;
  background-clip: border-box, border-box, border-box;
  place-items:  center;
}

.historyItemMain > span:not(.historyItemThumbPlaceholder) {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.historyItemMain strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.historyItemMain small, .historyEmpty, .historyFooter > span {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.historyMoreButton {
  display: grid;
  color: var(--ink);
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
  place-items:  center;
  width: 34px;
  height: 34px;
}

.historyMoreButton:hover, .historyMoreButton.active {
  background: #f8f6f8;
}

.historyItemMenu {
  position: absolute;
  z-index: 3;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  min-width: 112px;
  top: 52px;
  right: 0;
  box-shadow: 0 16px 36px #12161024;
}

.historyItemMenu button {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  background: #fff;
  border: 0;
  align-items:  center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.historyItemMenu button + button {
  border-top: 1px solid var(--line);
}

.historyItemMenu button:hover:not(:disabled) {
  background: #f8f6f8;
}

.historyItemMenu button:disabled {
  cursor: not-allowed;
  color: var(--muted);
  opacity: .58;
}

.historyItemMenu button.danger {
  color: var(--red);
}

.historyFooter {
  display: flex;
  border-top: 1px solid var(--line);
  background: #fff;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 18px;
}

.historyFooter button, .historyConfirm button {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.historyConfirm {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.historyConfirm button.danger {
  background: var(--red);
  color: #fff;
}

.pending .bubble {
  min-width: min(330px, 82vw);
}

.forgeLoader {
  position: relative;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  overflow: hidden;
  color: var(--muted);
  align-content:  center;
  align-items:  center;
  gap: 12px;
  min-height: 126px;
  padding: 10px 14px 28px 10px;
}

.spriteMascot {
  aspect-ratio: var(--sprite-ratio, 1 / 1);
  image-rendering: pixelated;
  filter: drop-shadow(2px 3px 0 #181a172e);
  background-repeat: no-repeat;
  place-self:  center;
  width: 96px;
}

@keyframes spriteMascotPlay {
  from {
    background-position: var(--sprite-start-x, 0) var(--sprite-y, 0);
  }

  to {
    background-position: var(--sprite-end-x, 0) var(--sprite-y, 0);
  }
}

.blockMascot {
  position: relative;
  image-rendering: pixelated;
  animation: blockMascotStep .92s steps(2, end) infinite;
  width: 46px;
  height: 52px;
}

.blockHead, .blockHair, .blockEye, .blockMouth, .blockBody, .blockArm, .blockLeg, .blockPickaxe, .blockChunk {
  position: absolute;
  display: block;
}

.blockHead {
  border: 2px solid var(--line-strong);
  z-index: 3;
  background: linear-gradient(90deg, #0000 0 6px, #743d1c33 6px 10px, #0000 10px), #e8b07c;
  width: 24px;
  height: 24px;
  top: 2px;
  left: 11px;
  box-shadow: 2px 2px #181a1733;
}

.blockHair {
  border: 2px solid var(--line-strong);
  background: linear-gradient(90deg, #5f351d 0 7px, #704122 7px 15px, #5f351d 15px), #63391f;
  width: 24px;
  height: 10px;
  top: -2px;
  left: -2px;
}

.blockEye {
  animation: blockBlink 4.2s step-end infinite;
  background: #1e4934;
  width: 4px;
  height: 4px;
  top: 12px;
}

.blockEye.left {
  left: 5px;
}

.blockEye.right {
  right: 5px;
}

.blockMouth {
  background: #6f2e23;
  width: 6px;
  height: 2px;
  bottom: 4px;
  left: 9px;
}

.blockBody {
  border: 2px solid var(--line-strong);
  z-index: 2;
  background: linear-gradient(90deg, #ffffff2e 0 6px, #0000 6px), #2a8f91;
  width: 22px;
  height: 16px;
  top: 27px;
  left: 12px;
}

.blockArm {
  border: 2px solid var(--line-strong);
  z-index: 1;
  background: #e8b07c;
  width: 8px;
  height: 18px;
  top: 28px;
}

.blockArm.left {
  animation: blockLeftArm .92s steps(2, end) infinite;
  left: 5px;
}

.blockArm.right {
  transform-origin: 4px 3px;
  animation: blockMineArm .92s steps(2, end) infinite;
  z-index: 4;
  right: 4px;
}

.blockLeg {
  border: 2px solid var(--line-strong);
  z-index: 1;
  background: #334a86;
  width: 10px;
  height: 10px;
  top: 42px;
}

.blockLeg.left {
  animation: blockLeftLeg .92s steps(2, end) infinite;
  left: 12px;
}

.blockLeg.right {
  animation: blockRightLeg .92s steps(2, end) infinite;
  right: 12px;
}

.blockPickaxe {
  border: 1px solid var(--line-strong);
  transform-origin: 50% 78%;
  animation: blockPickaxeHit .92s steps(2, end) infinite;
  z-index: 5;
  background: #7a4b25;
  width: 4px;
  height: 30px;
  top: 8px;
  right: -1px;
}

.blockPickaxe:before, .blockPickaxe:after {
  content: "";
  position: absolute;
  display: block;
  border: 1px solid var(--line-strong);
  background: #aeb7bc;
}

.blockPickaxe:before {
  width: 23px;
  height: 5px;
  top: -3px;
  left: -11px;
}

.blockPickaxe:after {
  background: #d7dddf;
  width: 6px;
  height: 5px;
  top: 1px;
  left: 8px;
}

.blockChunk {
  border: 2px solid var(--line-strong);
  opacity: 0;
  z-index: 6;
  background: linear-gradient(135deg, #3c8f43 0 50%, #775437 50%), #775437;
  width: 7px;
  height: 7px;
}

.blockChunk.one {
  animation: blockChunkPop .92s steps(3, end) infinite;
  top: 13px;
  right: -1px;
}

.blockChunk.two {
  animation: blockChunkPop .92s .18s steps(3, end) infinite;
  top: 4px;
  right: 9px;
}

.progressCopy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.progressCopy span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.progressCopy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.progressCopy em {
  color: var(--green-dark);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.35;
}

.scanlines {
  position: absolute;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  background: #fff;
  height: 8px;
  inset: auto 14px 8px;
}

.scanlines i {
  content: "";
  display: block;
  background: var(--blue);
  box-shadow: 6px 0 0 var(--amber);
  width: 8%;
  height: 100%;
  transition: width .42s;
}

.controlPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.composer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 360px;
  padding: 20px;
}

.dropUploadOverlay {
  position: absolute;
  z-index: 4;
  display: grid;
  color: #171717;
  backdrop-filter: blur(16px);
  pointer-events: none;
  text-align: center;
  background: linear-gradient(135deg, #ffffffe6, #f8f6f8b8), #ffffffd1;
  border: 1px solid #17171729;
  border-radius: 14px;
  align-content:  center;
  justify-items: center;
  gap: 10px;
  inset: 14px;
  box-shadow: 0 24px 64px #1717171f;
}

.dropUploadOverlay span {
  display: grid;
  color: #fff;
  box-shadow: none;
  background: #171717;
  border: 1px solid #17171724;
  border-radius: 12px;
  place-items:  center;
  width: 48px;
  height: 48px;
}

.dropUploadOverlay strong {
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
}

.dropUploadOverlay small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.studioApp .composer.dragActive {
  background: linear-gradient(135deg, #fffffff5, #f8f6f8e6), #ffffffe6;
  border-color: #17171757;
  box-shadow: 0 26px 80px #17171724;
}

.accountPanel {
  border: 2px solid var(--line-strong);
  background: #fff;
  margin: 0 20px 20px;
}

.accountPanelHeader {
  display: flex;
  border-bottom: 2px solid var(--line-strong);
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding: 12px 14px;
}

.accountPanelHeader strong {
  font-size: 15px;
  font-weight: 850;
}

.accountPanelHeader span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.accountPanel .authCard {
  padding: 14px;
}

.accountPanel .authCard > :not(.panelHeader) {
  margin-left: 0;
  margin-right: 0;
}

.walletPanel {
  display: grid;
  border: 2px solid var(--line-strong);
  background: #fff;
  gap: 14px;
  margin: 0 20px 20px;
}

.walletModal .walletPanel {
  border: 0;
  margin: 0;
}

.walletPanelHeader {
  display: flex;
  border-bottom: 2px solid var(--line-strong);
  background: #f8f6f8;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding: 14px;
}

.walletModal .walletPanelHeader {
  padding-right: 58px;
}

.walletPanelHeader div {
  display: grid;
  gap: 3px;
}

.walletPanelHeader span, .ledgerItem span, .ledgerTitle, .adminSectionTitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.walletPanelHeader strong {
  font-size: 24px;
  line-height: 1.15;
}

.walletIconButton, .walletPayButton, .payLink, .rechargeChannels button, .quickAmounts button {
  border: 2px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  font-weight: 850;
}

.walletIconButton {
  display: grid;
  box-shadow: 4px 4px 0 var(--ink);
  place-items:  center;
  width: 38px;
  height: 38px;
}

.walletIconButton:disabled, .walletPayButton:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

.walletIconButton svg, .walletPayButton svg {
  flex: none;
}

.walletIconButton:disabled svg, .walletPayButton:disabled svg {
  animation: spin .9s linear infinite;
}

.rechargeBox {
  display: grid;
  gap: 12px;
  padding: 0 14px;
}

.rechargeChannels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rechargeChannels button, .quickAmounts button {
  min-height: 38px;
  box-shadow: 3px 3px #181a1733;
}

.rechargeChannels button.active, .quickAmounts button.active {
  background: var(--blue);
  color: #fff;
  box-shadow: 3px 3px 0 var(--ink);
}

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

.quickAmounts button {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
  font-size: 12px;
}

.rechargeInputRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items:  end;
  gap: 10px;
}

.walletPayButton, .payLink {
  display: inline-flex;
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
}

.walletPayButton {
  color: #fff;
  background: var(--green);
}

.payLink {
  background: #f8f6f8;
}

.walletNotice {
  border: 2px solid var(--line);
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.walletNotice.ok {
  color: var(--green-dark);
  background: #f8f6f8;
  border-color: #17171773;
}

.walletNotice.error {
  background: var(--red-soft);
  color: var(--red);
  border-color: #b63c3473;
}

.contactFooter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 22px 0 0;
}

.contactTrigger {
  display: inline-flex;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  background: #fff;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  transition: transform .12s, box-shadow .12s, background-color .12s;
  font-weight: 850;
}

.contactTrigger:hover {
  box-shadow: 2px 2px 0 var(--ink);
  background: #f8f6f8;
  transform: translate(2px, 2px);
}

.contactModal {
  width: min(680px, 100vw - 32px);
}

.contactPanel {
  display: grid;
  background: #fff;
  gap: 16px;
  padding: 20px;
}

.contactPanelHeader {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding-right: 46px;
}

.contactPanelHeader strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.contactPanelHeader span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
  font-weight: 750;
}

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

.contactCard {
  display: grid;
  border: 2px solid var(--line-strong);
  background: #ffffffe0;
  align-content:  start;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  box-shadow: 4px 4px #181a172e;
}

.contactCardHeader {
  display: flex;
  align-items:  center;
  gap: 9px;
}

.contactCardHeader span {
  display: grid;
  border: 2px solid var(--line-strong);
  background: var(--amber);
  place-items:  center;
  width: 36px;
  height: 36px;
}

.contactCardHeader strong {
  font-size: 16px;
  font-weight: 900;
}

.contactCard p {
  overflow-wrap: anywhere;
  color: var(--ink);
  white-space: pre-wrap;
  min-height: 48px;
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.contactQr {
  display: block;
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  background: #ffffffe0;
  width: min(180px, 100%);
}

.feedbackModal {
  width: min(940px, 100vw - 32px);
}

.feedbackPanel {
  display: grid;
  background: #fff;
  gap: 14px;
  padding: 20px;
}

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

.feedbackHeader {
  padding-right: 48px;
}

.feedbackHeader div, .feedbackThreadHeader div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.feedbackHeader strong, .feedbackThreadHeader strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.feedbackHeader span, .feedbackThreadHeader span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.feedbackCompose, .feedbackReplyBox {
  display: grid;
  border: 2px solid var(--line-strong);
  background: #ffffffe0;
  gap: 10px;
  padding: 12px;
}

.feedbackCompose textarea, .feedbackReplyBox textarea {
  border: 2px solid var(--line-strong);
  color: var(--ink);
  outline: none;
  resize: vertical;
  background: #fff;
  border-radius: 0;
  width: 100%;
  min-height: 92px;
  padding: 10px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.feedbackCompose textarea:focus, .feedbackReplyBox textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px #17171724;
}

.feedbackCompose input[type="file"], .feedbackReplyBox input[type="file"] {
  display: none;
}

.feedbackComposeActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.feedbackComposeActions .miniButton {
  display: inline-flex;
  justify-content: center;
  align-items:  center;
  gap: 7px;
}

.feedbackPrimaryButton {
  background: var(--green);
  color: #fff;
}

.feedbackFileStrip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedbackFileStrip span {
  display: inline-flex;
  border: 2px solid var(--line);
  overflow-wrap: anywhere;
  background: #fff;
  align-items:  center;
  gap: 7px;
  max-width: 100%;
  min-height: 32px;
  padding: 4px 7px 4px 9px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
}

.feedbackFileStrip button {
  display: grid;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  flex: none;
  place-items:  center;
  width: 22px;
  height: 22px;
}

.feedbackNotice {
  border: 2px solid var(--line);
  background: #fff;
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.feedbackNotice.ok {
  color: var(--green-dark);
  background: #f8f6f8;
  border-color: #17171773;
}

.feedbackNotice.error {
  background: var(--red-soft);
  color: var(--red);
  border-color: #b63c3473;
}

.feedbackLayout {
  display: grid;
  grid-template-columns: minmax(220px, .42fr) minmax(0, 1fr);
  gap: 12px;
}

.feedbackTicketList, .feedbackThread, .adminFeedbackList, .adminFeedbackThread {
  display: grid;
  align-content:  start;
  gap: 10px;
  min-width: 0;
}

.feedbackTicketList button, .adminFeedbackList button {
  display: grid;
  border: 2px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  background: #fff;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 10px;
}

.feedbackTicketList button.active, .adminFeedbackList button.active {
  border-color: var(--line-strong);
  background: #f8f6f8;
  box-shadow: 4px 4px #181a172e;
}

.feedbackTicketList strong, .adminFeedbackList strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.feedbackTicketList span, .adminFeedbackList span, .adminFeedbackList small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
}

.feedbackThread {
  border: 2px solid var(--line-strong);
  background: #fff;
  padding: 12px;
}

.feedbackStatus {
  border: 2px solid var(--line-strong);
  background: #fff;
  flex: none;
  padding: 6px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
}

.feedbackStatus.open, .feedbackStatus.in_progress {
  background: #f8f6f8;
}

.feedbackStatus.resolved {
  color: var(--green-dark);
  background: #f8f6f8;
}

.feedbackStatus.closed {
  color: var(--muted);
  background: #f8f6f8;
}

.feedbackMessages {
  display: grid;
  gap: 10px;
}

.feedbackMessage {
  display: grid;
  border: 2px solid var(--line);
  background: #ffffffe0;
  gap: 8px;
  padding: 10px;
}

.feedbackMessage.admin {
  background: #f8f6f8;
}

.feedbackMessage > div {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
}

.feedbackMessage strong {
  font-size: 13px;
  font-weight: 900;
}

.feedbackMessage span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.feedbackMessage p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.55;
}

.feedbackImageGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.feedbackImageGrid a {
  display: block;
  aspect-ratio: 1;
  border: 2px solid var(--line-strong);
  overflow: hidden;
  background: #fff;
}

.feedbackImageGrid img {
  display: block;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.ledgerGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 14px 14px;
}

.ledgerSection {
  display: grid;
  align-content:  start;
  gap: 8px;
  min-width: 0;
}

.ledgerTitle, .adminSectionTitle {
  display: flex;
  align-items:  center;
  gap: 7px;
}

.ledgerTitle strong, .adminSectionTitle strong {
  color: var(--ink);
  font-size: 13px;
}

.ledgerList {
  display: grid;
  overflow-y: auto;
  scrollbar-gutter: stable;
  gap: 8px;
  max-height: 304px;
  padding-right: 4px;
}

.ledgerItem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 2px solid var(--line);
  background: #ffffffe0;
  align-items:  center;
  gap: 10px;
  padding: 9px 10px;
}

.ledgerItem div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ledgerItem strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
}

.ledgerItem em {
  font-size: 13px;
  font-style: normal;
  font-weight: 900;
}

.ledgerEmpty {
  border: 2px dashed var(--line);
  color: var(--muted);
  margin: 0;
  padding: 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.inputRow {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px;
  align-items:  end;
  gap: 12px;
}

.composerActionControl {
  display: grid;
  align-self:  end;
  justify-items: center;
  gap: 6px;
  min-width: 0;
}

.composerActionControl small {
  color: var(--muted);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.composerActionControl.recommendUpload .iconButton {
  animation: recommendedUploadGrow 1.28s ease-in-out infinite;
  background: #f8f6f8;
}

.iconButton {
  box-shadow: 5px 5px 0 var(--ink);
  width: 48px;
  height: 48px;
}

.iconButton.lit {
  background: #f8f6f8;
}

.sendButton {
  color: #fff;
  background: var(--green);
  box-shadow: 5px 5px 0 var(--ink);
  width: 52px;
  height: 52px;
}

.sendButton svg {
  animation: none;
}

.sendButton.loading svg {
  animation: spin .9s linear infinite;
}

.sendButton:disabled, .authSubmit:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

textarea, .fieldLabel input {
  border: 2px solid var(--line-strong);
  outline: none;
  color: var(--ink);
  background: #fff;
  border-radius: 0;
  width: 100%;
}

textarea {
  resize: vertical;
  min-height: 156px;
  max-height: 300px;
  padding: 14px 15px;
  font-size: 14px;
  line-height: 1.58;
}

textarea:focus, .fieldLabel input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px #17171724;
}

textarea::placeholder, .fieldLabel input::placeholder {
  color: #8a8f84;
}

.composer > input[type="file"] {
  display: none;
}

.modalBackdrop {
  position: fixed;
  z-index: 50;
  display: grid;
  overscroll-behavior: contain;
  background: #181a176b;
  place-items:  center;
  padding: 20px;
  inset: 0;
}

.presetModal {
  position: relative;
  overflow-y: auto;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--ink);
  width: min(620px, 100vw - 32px);
  max-height: min(760px, 100svh - 40px);
}

.presetModal.authModal {
  width: min(480px, 100vw - 32px);
  max-height: min(720px, 100svh - 48px);
}

.presetModal.authModal .accountPanel {
  width: 100%;
  margin: 0;
}

.presetModal.authModal .accountPanelHeader {
  padding: 20px 58px 20px 24px;
}

.presetModal.authModal .accountPanelHeader strong {
  font-size: 20px;
}

.presetModal.authModal .accountPanel .authCard {
  gap: 22px;
  width: 100%;
  padding: 12px 24px 28px;
}

.presetModal.authModal .authCard > :not(.panelHeader) {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.presetModal.authModal .authTabs {
  width: 100%;
}

.presetModal.authModal .authTabs button {
  min-height: 54px;
  font-size: 15px;
}

.presetModal.authModal .fieldLabel {
  width: 100%;
  font-size: 14px;
}

.presetModal.authModal .fieldLabel input {
  width: 100%;
  height: 56px;
  font-size: 15px;
}

.presetModal.authModal .authSubmit {
  display: flex;
  width: 100%;
  min-height: 56px;
  font-size: 15px;
}

.walletModal {
  width: min(760px, 100vw - 32px);
  max-height: min(820px, 100svh - 40px);
}

.imagePreviewBackdrop {
  z-index: 70;
  display: flex;
  background: #181a17b8;
  justify-content: center;
  align-items:  center;
}

.imagePreviewModal {
  position: relative;
  display: flex;
  justify-content: center;
  align-items:  center;
  width: 100%;
  height: 100%;
}

.imagePreviewModal img {
  display: block;
  object-fit: contain;
  border: 2px solid var(--line-strong);
  background: #fff;
  max-width: min(1180px, 100vw - 36px);
  max-height: calc(100svh - 36px);
  box-shadow: 12px 12px #0000006b;
}

.imagePreviewClose {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
}

.modalCloseButton {
  position: absolute;
  z-index: 1;
  display: grid;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  background: #fff;
  place-items:  center;
  width: 36px;
  height: 36px;
  top: 12px;
  right: 12px;
}

.presetPanel {
  display: grid;
  background: #fff;
  border: 0;
  gap: 12px;
  padding: 20px;
}

.presetPanelHeader {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding-right: 46px;
}

.presetPanelHeader strong {
  font-size: 15px;
  font-weight: 850;
}

.presetPanelHeader span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.presetLoginHint {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.55;
}

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

.presetChoiceSection > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.presetChoiceList {
  display: grid;
  overflow-y: auto;
  gap: 10px;
  max-height: 220px;
  padding-right: 4px;
}

.presetChoice {
  display: grid;
  border: 2px solid var(--line-strong);
  color: var(--ink);
  background: #fff;
  gap: 5px;
  box-shadow: 4px 4px #181a1733;
}

.presetChoice.active, .presetChoice:hover {
  box-shadow: 4px 4px 0 var(--ink);
  background: #f8f6f8;
}

.presetChoiceBody {
  display: grid;
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  gap: 5px;
  width: 100%;
  padding: 11px 12px 6px;
}

.presetChoice strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.presetChoice small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.presetChoiceActions {
  display: flex;
  border-top: 2px solid var(--line);
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  padding: 8px 10px 10px;
}

.presetChoiceActions button {
  border: 2px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
  box-shadow: 3px 3px #181a172e;
}

.presetChoiceActions button.active {
  background: var(--green);
  color: #fff;
}

.presetChoiceActions button.danger {
  background: var(--red);
  color: #fff;
}

.presetChoiceActions button:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

.presetEmpty {
  border: 2px dashed var(--line);
  color: var(--muted);
  background: #ffffffe0;
  margin: 0;
  padding: 12px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.presetCreateGrid {
  display: grid;
  gap: 12px;
}

.presetPromptField textarea {
  resize: vertical;
  min-height: 96px;
  max-height: 160px;
  padding: 10px;
  font-size: 13px;
}

.presetSaveButton {
  border: 2px solid var(--line-strong);
  background: var(--blue);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  min-height: 42px;
  font-weight: 850;
}

.presetSaveButton:disabled {
  cursor: not-allowed;
  opacity: .55;
  box-shadow: none;
}

.controlPanelActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.templateTrigger {
  background: var(--green);
  color: #fff;
  min-width: 82px;
}

.templateLibraryModal {
  position: relative;
  overflow: hidden;
  border: 2px solid var(--line-strong);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--ink);
  overscroll-behavior: contain;
  width: min(1080px, 100vw - 32px);
  height: min(820px, 100svh - 40px);
  max-height: min(820px, 100svh - 40px);
}

.templateLibraryLayout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

.templateLibraryRail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 2px solid var(--line-strong);
  background: #f8f6f8;
  gap: 14px;
  min-height: 0;
  padding: 22px 18px 18px;
}

.templateLibraryHeader {
  display: grid;
  gap: 4px;
  padding-right: 46px;
}

.templateLibraryHeader strong {
  font-size: 18px;
  font-weight: 900;
}

.templateLibraryHeader span, .templateLibraryEmpty, .templateModeEmpty, .templateSpotlightMeta span, .templatePreviewHeader span, .adminTemplateFooter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.templateLibraryList {
  display: grid;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-content:  start;
  gap: 10px;
  min-height: 0;
  padding-right: 4px;
}

.templateLibraryCard {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  border: 2px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  background: #fff;
  align-items:  start;
  gap: 12px;
  width: 100%;
  padding: 10px;
  box-shadow: 4px 4px #181a172e;
}

.templateLibraryCard.active, .templateLibraryCard:hover {
  box-shadow: 4px 4px 0 var(--ink);
  background: #f8f6f8;
}

.templateLibraryCard img {
  display: block;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--line-strong);
  object-fit: cover;
  background: #fff;
  width: 100%;
}

.templateLibraryCard div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.templateLibraryCard strong, .templateSpotlightTitleRow h3 {
  overflow-wrap: anywhere;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.templateSpotlightTitleRow h3, .templateLibraryEmpty, .templateModeEmpty {
  margin: 0;
}

.templateLibraryCard p, .templateSpotlightBody p, .templatePromptExcerpt p, .templateLibraryPlaceholder p, .templateModeEmpty {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.templateLibrarySpotlight {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.templateSpotlightHeader {
  display: grid;
  border-bottom: 2px solid var(--line-strong);
  background: #ffffffe0;
  gap: 10px;
  padding: 18px 76px 18px 24px;
}

.templateSpotlightCover {
  position: relative;
  display: grid;
  overflow: hidden;
  border-bottom: 2px solid var(--line-strong);
  contain: paint;
  isolation: isolate;
  background: linear-gradient(135deg, #181a172e, #17171714), #141914;
  place-items:  center;
  height: clamp(240px, 34svh, 340px);
  min-height: 0;
  padding: 16px;
}

.templateSpotlightCover img {
  display: block;
  object-fit: contain;
  object-position: center;
  background: #fffdf714;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
}

.templateSpotlightScroll {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.templateSpotlightBody {
  display: grid;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  align-content:  start;
  gap: 16px;
  min-height: 0;
  padding: 18px 24px 26px;
}

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

.templateSpotlightMeta, .templateVariableChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.templateSpotlightMeta span, .templateVariableChips span {
  background: #fff;
  border: 1px solid #181a172e;
  padding: 4px 8px;
}

.templatePromptExcerpt, .templatePreviewPanel, .adminTemplatePreviewCard {
  display: grid;
  border: 2px solid var(--line-strong);
  background: #fff;
  gap: 10px;
  padding: 14px;
}

.adminTemplatePreviewCard {
  border: 1px solid #dedbe0;
  border-radius: 10px;
}

.templatePromptExcerpt span, .templatePreviewHeader strong {
  font-size: 13px;
  font-weight: 850;
}

.templateApplyButton {
  border: 2px solid var(--line-strong);
  background: var(--green);
  color: #fff;
  box-shadow: 4px 4px 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 850;
}

.templateLibraryPlaceholder {
  display: grid;
  text-align: center;
  place-items:  center;
  gap: 10px;
  padding: 32px;
}

.templateLibraryEmpty {
  border: 2px dashed var(--line);
  background: #fff;
  padding: 12px;
}

.templateLibraryPlaceholder strong {
  font-size: 20px;
}

.activeTemplateCard {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  border: 2px solid var(--line-strong);
  background: #f8f6f8;
  align-items:  center;
  gap: 14px;
  padding: 12px;
  box-shadow: 4px 4px #181a172e;
}

.activeTemplateCard img {
  display: block;
  aspect-ratio: 4 / 5;
  border: 2px solid var(--line-strong);
  object-fit: cover;
  background: #fff;
  width: 100%;
}

.activeTemplateBody, .activeTemplateMeta {
  display: grid;
  gap: 6px;
}

.activeTemplateMeta span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.activeTemplateMeta strong {
  font-size: 20px;
  font-weight: 900;
}

.activeTemplateMeta small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.activeTemplateActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.activeTemplateActions button, .adminTemplateDeleteButton {
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 12px;
  transition: background-color .12s;
  font-size: 12px;
  font-weight: 750;
}

.activeTemplateActions button.danger, .adminTemplateDeleteButton {
  background: var(--red);
  color: #fff;
}

.templateComposer {
  display: grid;
  gap: 14px;
  scroll-margin: 24px;
}

.templateGuideNotice {
  display: flex;
  border: 2px solid var(--line-strong);
  color: var(--green-dark);
  background: #f8f6f8;
  flex-wrap: wrap;
  align-items:  center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 4px 4px #181a172e;
}

.templateGuideNotice span {
  display: inline-flex;
  align-items:  center;
  gap: 6px;
}

.templateComposer.guidePulse .templateField, .templateComposer.guidePulse .templateCustomField, .templateComposer.guidePulse .templateActionSummary, .templateComposer.guidePulse .templateActionRow .iconButton {
  animation: templateGuidePulse 1.2s ease-in-out 3;
  outline: 3px solid #17171747;
  outline-offset: 3px;
}

.templateComposerTabs {
  display: flex;
  justify-content: flex-end;
}

.templateModeToggle {
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.templateModeToggle:hover {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

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

.templateField textarea, .templateCustomField textarea, .templatePreviewPanel textarea, .adminTemplatePreviewCard textarea, .adminTemplateSummaryField textarea, .adminTemplateHintField textarea {
  resize: vertical;
  min-height: 88px;
  max-height: 220px;
  padding: 10px;
  font-size: 13px;
}

.templateCustomField textarea, .adminTemplatePromptField textarea {
  min-height: 168px;
  max-height: 360px;
}

.templatePreviewHeader {
  display: flex;
  justify-content: space-between;
  align-items:  start;
  gap: 10px;
}

.templateActionRow {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 52px;
  align-items:  end;
  gap: 12px;
}

.templateActionSummary {
  display: grid;
  border: 2px solid var(--line-strong);
  background: #fff;
  gap: 4px;
  min-height: 52px;
  padding: 10px 12px;
}

.templateActionSummary strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}

.adminTemplatePanel {
  background: #fffdf7f5;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  margin: 20px 20px 0;
}

.adminTemplateWorkspace {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
}

.adminTemplateList, .adminTemplateEditor, .adminTemplateSideFields, .adminTemplatePreviewGrid {
  display: grid;
  gap: 12px;
}

.adminTemplateList {
  align-content:  start;
}

.adminTemplateListItem {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  gap: 8px;
  padding: 10px;
  box-shadow: 0 1px 4px #0000000a;
}

.adminTemplateListItem.active {
  background: #f8f6f8;
  box-shadow: 0 0 0 2px #171717;
}

.adminTemplateListButton {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  color: inherit;
  cursor: pointer;
  text-align: left;
  background: none;
  border: 0;
  gap: 10px;
  width: 100%;
  padding: 0;
}

.adminTemplateListButton img, .adminTemplateCoverPreview {
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 6px;
  width: 100%;
}

.adminTemplateListButton div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.adminTemplateListButton strong {
  font-size: 14px;
  font-weight: 900;
}

.adminTemplateListButton p, .adminTemplateFormPreview span {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.adminTemplateListButton small {
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.adminTemplateDeleteButton:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.adminTemplateEditor {
  min-width: 0;
}

.adminTemplateEditorGrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.adminTemplatePromptField, .adminTemplateSummaryField, .adminTemplateHintField {
  grid-column: 1 / -1;
}

.adminTemplateSideFields {
  align-content:  start;
}

.adminTemplateCheckbox {
  display: flex;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.adminTemplateCoverField {
  display: grid;
  color: var(--muted);
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
}

.adminTemplateCoverField input[type="file"] {
  display: block;
  width: 100%;
}

.adminTemplateCoverField small {
  color: var(--muted);
  line-height: 1.5;
}

.adminTemplateFormPreview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.adminTemplateFormPreview div {
  display: grid;
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  gap: 4px;
  padding: 10px;
}

.adminTemplateFormPreview strong {
  font-size: 12px;
  font-weight: 850;
}

.adminTemplateFooter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
}

.outputPanel {
  border: 2px solid var(--line-strong);
  background: #fff;
}

.outputPanelHeader {
  display: flex;
  border-bottom: 2px solid var(--line-strong);
  justify-content: space-between;
  align-items:  center;
  gap: 12px;
  padding: 12px 14px;
}

.outputPanelHeader strong {
  font-size: 15px;
  font-weight: 850;
}

.outputPanelHeader span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.ratioPreviewCard {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border-bottom: 2px solid var(--line-strong);
  background: #fff;
  align-items:  center;
  gap: 12px;
  padding: 12px 14px;
}

.ratioPreview {
  display: inline-flex;
  background-color: #f8f6f8;
  background-image: linear-gradient(#181a170d 1px, #0000 1px), linear-gradient(90deg, #181a170d 1px, #0000 1px), none;
  background-position: 0 0, 0 0, 0 0;
  background-repeat: repeat, repeat, repeat;
  background-size: 10px 10px;
  background-attachment: scroll, scroll, scroll;
  background-origin: padding-box, padding-box, padding-box;
  background-clip: border-box, border-box, border-box;
  border: 1px solid #181a1729;
  border-radius: 10px;
  flex: none;
  justify-content: center;
  align-items:  center;
  width: 84px;
  height: 60px;
}

.ratioPreview.compact {
  background-size: 6px 6px;
  border-radius: 6px;
  width: 28px;
  height: 22px;
}

.ratioPreviewShape {
  display: block;
  box-sizing: border-box;
  aspect-ratio: var(--ratio-preview, 1 / 1);
  background: #17171724;
  border: 2px solid #171717;
  border-radius: 4px;
  max-width: 100%;
  max-height: 100%;
  box-shadow: inset 0 0 0 1px #ffffffb8;
}

.ratioPreview.landscape .ratioPreviewShape, .ratioPreview.auto .ratioPreviewShape {
  width: 100%;
  height: auto;
}

.ratioPreview.portrait .ratioPreviewShape, .ratioPreview.square .ratioPreviewShape {
  width: auto;
  height: 100%;
}

.ratioPreview.compact .ratioPreviewShape {
  border-width: 1.5px;
  border-radius: 3px;
}

.ratioPreview.auto .ratioPreviewShape {
  background: #6870641a;
  border-style: dashed;
}

.ratioPreviewCard div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ratioPreviewCard span, .ratioPreviewCard small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.ratioPreviewCard strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.ratioTileField {
  display: grid;
  border-bottom: 2px solid var(--line-strong);
  background: #fff;
  gap: 10px;
  padding: 14px;
}

.ratioTileHeader {
  display: flex;
  color: var(--muted);
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  font-size: 12px;
  font-weight: 750;
}

.ratioTileHeader small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
}

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

.ratioTileGrid.advanced {
  padding-top: 2px;
}

.ratioAdvancedRow {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  min-width: 0;
}

.ratioAdvancedRow small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
}

.ratioAdvancedToggle {
  display: inline-flex;
  border: 2px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  align-items:  center;
  gap: 6px;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.ratioAdvancedToggle:hover, .ratioAdvancedToggle.expanded {
  border-color: var(--green);
  background: #f8f6f8;
}

.ratioAdvancedToggle svg {
  flex: none;
  transition: transform .16s;
}

.ratioAdvancedToggle.expanded svg {
  transform: rotate(180deg);
}

.ratioTile {
  display: grid;
  border: 2px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  background: #fff;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 126px;
  padding: 10px 8px;
}

.ratioTile:hover, .ratioTile.active {
  border-color: var(--green);
  background: #f8f6f8;
}

.ratioTile.active {
  box-shadow: inset 0 0 0 2px #17171724;
}

.ratioTile strong {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.ratioTile span:not(.ratioPreview):not(.ratioPreviewShape) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.outputGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.selectLabel, .rangeLabel {
  display: grid;
  color: var(--muted);
  gap: 7px;
  min-width: 0;
  font-size: 12px;
  font-weight: 750;
}

.selectLabel select, .selectLabel input, .selectLabel textarea {
  border: 2px solid var(--line-strong);
  color: var(--ink);
  outline: none;
  background: #fff;
  border-radius: 0;
  width: 100%;
  min-width: 0;
  padding: 0 10px;
  font-weight: 750;
}

.selectLabel input {
  height: 42px;
}

.selectLabel select:focus, .selectLabel input:focus, .selectLabel textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px #17171724;
}

.customSizeFields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rangeLabel {
  grid-column: 1 / -1;
}

.rangeLabel input {
  accent-color: var(--green);
  width: 100%;
}

.rangeLabel.disabled {
  opacity: .55;
}

.draftTray {
  display: grid;
  gap: 10px;
}

.draftPreviewSummary {
  display: flex;
  color: var(--muted);
  backdrop-filter: blur(12px);
  background: #ffffffd6;
  border: 1px solid #17171724;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.draftPreviewSummary strong {
  color: var(--green-dark);
  flex: none;
  font-size: 14px;
}

.draftPreviewSummary span {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.draftPreviewList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 12px;
}

.draftPreview {
  position: relative;
}

.draftPreview img {
  display: block;
  aspect-ratio: 1;
  object-fit: cover;
  background: #fff;
  border: 1px solid #17171724;
  border-radius: 10px;
  width: 100%;
  box-shadow: 0 8px 20px #17171714;
}

.draftPreviewSize {
  position: absolute;
  display: grid;
  color: var(--ink);
  text-align: right;
  backdrop-filter: blur(10px);
  background: #ffffffe6;
  border: 1px solid #17171729;
  gap: 1px;
  max-width: calc(100% - 8px);
  padding: 3px 5px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.1;
  bottom: 4px;
  right: 4px;
}

.draftPreviewSize small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
}

.draftPreview button {
  position: absolute;
  color: #fff;
  box-shadow: none;
  background: #171717;
  border: 1px solid #17171724;
  width: 28px;
  height: 28px;
  top: -8px;
  right: -8px;
}

.errorText, .authError {
  background: var(--red-soft);
  color: var(--red);
  border: 2px solid #b63c3473;
  margin: 0;
  padding: 12px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.5;
}

.authBonusHint {
  color: #1f6b45;
  background: #22784a14;
  border: 1px solid #22784a40;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.authQuickEntry {
  display: grid;
  gap: 10px;
}

.authQuickEntryButton {
  color: #fff;
  cursor: pointer;
  background: #171717;
  border: 1px solid #171717;
  border-radius: 8px;
  justify-self: start;
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 750;
}

.authQuickEntryButton:hover {
  background: #2a2a2a;
}

.bubble .authQuickEntryButton {
  margin-top: 10px;
}

.authStage {
  width: min(100%, 520px);
}

.authCard {
  display: grid;
  gap: 18px;
  padding: 0 0 22px;
}

.authCard > :not(.panelHeader) {
  margin-left: 20px;
  margin-right: 20px;
}

.authTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.authTabs button {
  border: 2px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink);
  background: #fff;
  min-height: 46px;
  font-weight: 850;
}

.authTabs button.active {
  color: #fff;
  background: var(--blue);
}

.fieldLabel {
  display: grid;
  color: var(--muted);
  gap: 8px;
  font-size: 13px;
  font-weight: 750;
}

.fieldLabel input {
  height: 52px;
  padding: 0 14px;
  font-size: 14px;
}

.fieldHint {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.authCard.inputReminder .fieldLabel input {
  border-color: var(--green);
  outline: 3px solid #1717172e;
  outline-offset: 2px;
  animation: authInputNudge 1.05s ease-in-out 2;
}

.authInputReminder {
  color: var(--green-dark);
  background: #f8f6f8;
  border: 2px solid #1717175c;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.5;
}

.authSubmit {
  display: inline-flex;
  border: 2px solid var(--line-strong);
  color: #fff;
  background: var(--green);
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  justify-content: center;
  align-items:  center;
  gap: 8px;
  min-height: 50px;
  font-weight: 850;
}

.authSubmit svg, .authChecking svg {
  animation: spin .9s linear infinite;
}

.authChecking {
  display: flex;
  color: var(--muted);
  align-items:  center;
  gap: 10px;
  font-size: 13px;
  font-weight: 750;
}

.adminApp {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  overflow: hidden;
  color: #171717;
  background: #f8f6f8;
  height: 100svh;
  min-height: 640px;
}

.adminApp button {
  border-radius: 8px;
}

.adminRail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fffffceb;
  border-right: 1px solid #dedbe0;
  gap: 18px;
  min-height: 0;
  padding: 18px 14px;
}

.adminRailBrand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items:  center;
  gap: 10px;
}

.adminRailBrandLogo {
  object-fit: contain;
  border-radius: 10px;
  width: 38px;
  height: 38px;
}

.adminRailBrand strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.adminRailBrand small {
  color: #6d6a70;
  font-size: 12px;
  line-height: 1.35;
}

.adminRailNav {
  display: grid;
  overflow-y: auto;
  align-content:  start;
  gap: 16px;
  min-height: 0;
}

.adminRailNavSection {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.adminRailNavSection + .adminRailNavSection {
  border-top: 1px solid #dedbe0;
  padding-top: 14px;
}

.adminRailNavLabel {
  color: #8a9086;
  letter-spacing: .02em;
  text-transform: uppercase;
  padding: 0 10px 3px;
  font-size: 11px;
  font-weight: 800;
}

.adminRailNav button {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  color: #171717;
  cursor: pointer;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  transition: background-color .12s;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.adminRailNav button:hover {
  background: #0000000a;
}

.adminRailNav button.active {
  background: #0000000f;
  font-weight: 750;
}

.adminRailNav button svg {
  color: #6d6a70;
}

.adminRailNav button.active svg {
  color: #171717;
}

.adminRailNav button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminRailAccount {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  align-items:  center;
  gap: 10px;
  padding: 12px;
}

.adminRailAccount span, .adminRailAccount small {
  color: #6d6a70;
  font-size: 12px;
  line-height: 1.35;
}

.adminRailAccount strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.adminRailAccount > button {
  display: grid;
  color: #6d6a70;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  place-items:  center;
  width: 36px;
  height: 36px;
  transition: background-color .12s, color .12s;
}

.adminRailAccount > button:hover {
  color: #171717;
  background: #f8f6f8;
}

.adminContent {
  display: flex;
  overflow-y: auto;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 28px 32px;
}

.adminContent > .panel {
  display: flex;
  box-shadow: none;
  background: none;
  border: 0;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.adminApp:has(.adminContentLogin) {
  grid-template-columns: 1fr;
}

.adminContentLogin {
  display: grid;
  align-content:  center;
  place-items:  center;
  min-height: 100svh;
  padding: 40px;
}

.adminContentLogin > .panel {
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  width: min(420px, 100%);
  box-shadow: 0 2px 12px #0000000f;
}

.adminContentLogin .accountPanel {
  background: none;
  border: 0;
  margin: 0;
}

.adminContentLogin .accountPanelHeader {
  display: none;
}

.adminContentLogin .accountPanel .authCard {
  gap: 16px;
  padding: 0 24px 24px;
}

.adminContentLogin .authCard > :not(.panelHeader) {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.adminContentLogin .authTabs, .adminContentLogin .fieldLabel, .adminContentLogin .fieldLabel input, .adminContentLogin .authSubmit {
  width: 100%;
}

.adminContentLogin .authSubmit {
  display: flex;
}

.adminContentLogin .authChecking {
  padding: 24px;
}

.adminMobileTopbar {
  display: none;
  grid-template-columns: auto minmax(0, 1fr) auto;
  position: sticky;
  z-index: 10;
  background: #fffffcf5;
  border-bottom: 1px solid #dedbe0;
  align-items:  center;
  gap: 12px;
  padding: 12px 16px;
  top: 0;
}

.adminMobileTopbar strong {
  font-size: 15px;
  font-weight: 800;
}

.adminMobileTopbar button {
  display: grid;
  color: #171717;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
  place-items:  center;
  width: 36px;
  height: 36px;
}

.adminMobileTopbar button:hover {
  background: #0000000a;
}

.adminMobileMenuBackdrop {
  position: fixed;
  z-index: 900;
  animation: fadeIn .15s ease;
  background: #0000004d;
  inset: 0;
}

.adminMobileMenu {
  position: absolute;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: slideInLeft .18s ease;
  background: #fff;
  gap: 18px;
  width: min(300px, 85vw);
  padding: 18px 14px;
  top: 0;
  bottom: 0;
  left: 0;
  box-shadow: 4px 0 20px #0000001a;
}

.adminMobileMenuHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items:  center;
  padding: 0 4px;
}

.adminMobileMenuHeader strong {
  font-size: 16px;
  font-weight: 850;
}

.adminMobileMenuHeader button {
  display: grid;
  color: #6d6a70;
  cursor: pointer;
  background: none;
  border: 0;
  place-items:  center;
  width: 36px;
  height: 36px;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

.adminPanel {
  box-shadow: none;
  background: none;
  border: 0;
  border-radius: 0;
  min-height: 360px;
}

.adminDashboard {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}

.adminDashboard--creations {
  overflow: hidden;
}

.adminDashboardTabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  align-items:  center;
  gap: 18px;
  min-height: 48px;
  padding: 0 20px;
}

.adminDashboardTabs button {
  position: relative;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: 0;
  min-height: 48px;
  padding: 0;
  font-size: 13px;
  font-weight: 750;
}

.adminDashboardTabs button.active {
  color: var(--green-dark);
}

.adminDashboardTabs button.active:after {
  content: "";
  position: absolute;
  background: var(--green-dark);
  border-radius: 999px;
  height: 2px;
  bottom: 0;
  left: 0;
  right: 0;
}

.adminDashboardContent {
  min-width: 0;
  min-height: 0;
}

.adminContent:has(.adminCreationPanel) {
  overflow: hidden;
}

.adminContent:has(.adminCreationPanel) > .panel {
  overflow: hidden;
}

.adminDashboardContent--creations {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  min-height: 0;
}

.adminDashboardContent--creations .adminCreationPanel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  margin: 0;
}

.adminCreationBody {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  height: calc(100svh - 320px);
  min-height: 320px;
  max-height: calc(100svh - 320px);
  padding-right: 4px;
}

.adminStats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 20px 0;
}

.adminStatCard {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  gap: 7px;
  min-width: 0;
  padding: 14px;
  box-shadow: 0 2px 8px #0000000f;
}

.adminStatIcon {
  display: grid;
  color: #6d6a70;
  background: #f8f6f8;
  border-radius: 8px;
  place-items:  center;
  width: 34px;
  height: 34px;
}

.adminStatCard span, .adminStatCard small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.adminStatCard strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.1;
}

.miniButton, .walletActions button, .walletResetButton {
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  min-height: 40px;
  transition: background-color .12s, opacity .12s;
  font-weight: 750;
}

.miniButton {
  padding: 0 14px;
}

.miniButton.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  border-radius: 8px;
}

.miniButton:hover:not(:disabled), .walletActions button:hover, .walletResetButton:hover {
  background: #f8f6f8;
}

.miniButton:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.adminNotice {
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  margin: 16px 20px 0;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.5;
}

.adminNotice.ok {
  color: var(--green-dark);
  background: #f8f6f8;
  border-color: #17171773;
}

.adminNotice.error {
  background: var(--red-soft);
  color: var(--red);
  border-color: #b63c3473;
}

.walletList {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.adminSettingsPanel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.adminSettingsContent {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
  padding: 20px;
}

.adminSuppliersPanel {
  display: grid;
  gap: 0;
  min-height: 0;
  padding: 0;
}

.adminSuppliersPanel .adminNotice {
  margin: 16px 20px 0;
}

.adminSuppliersWorkspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  padding: 20px;
}

.adminSuppliersList {
  display: grid;
  overflow: auto;
  scrollbar-gutter: stable;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 14px;
  align-content:  start;
  align-self:  start;
  gap: 0;
  min-width: 0;
  max-height: calc(100svh - 240px);
  padding: 0;
}

.adminSuppliersListHeader {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #ece8ec;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  min-width: 960px;
  padding: 14px;
}

.adminSuppliersListHeader strong {
  font-size: 13px;
  font-weight: 850;
}

.adminSuppliersListHeader span {
  color: #6d6a70;
  font-size: 12px;
  font-weight: 750;
}

.adminSuppliersList .templateModeEmpty {
  margin: 14px;
}

.adminSuppliersTableHeader, .adminSupplierTableRow {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) minmax(120px, .9fr) minmax(88px, .6fr) minmax(140px, .9fr) minmax(90px, .6fr) minmax(72px, .5fr) minmax(130px, .8fr) minmax(132px, .7fr);
  align-items:  center;
  min-width: 1060px;
}

.adminSuppliersTableHeader {
  position: sticky;
  z-index: 1;
  color: #8a858d;
  letter-spacing: .02em;
  background: #fbfafb;
  border-bottom: 1px solid #ece8ec;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 850;
  top: 0;
}

.adminSupplierCard {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  gap: 10px;
  padding: 12px;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .16s;
}

.adminSupplierCard:hover, .adminSupplierCard.active {
  background: #fff;
  border-color: #171717;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px #17171714;
}

.adminSupplierTableRow {
  box-shadow: none;
  border: 0;
  border-bottom: 1px solid #ece8ec;
  border-radius: 0;
  gap: 0;
  min-height: 72px;
  padding: 0 14px;
  transform: none;
}

.adminSupplierTableRow:last-child {
  border-bottom: 0;
}

.adminSupplierTableRow:hover, .adminSupplierTableRow.active {
  box-shadow: none;
  background: #fbfafb;
  border-color: #ece8ec;
  transform: none;
}

.adminSupplierCardSelect {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  color: inherit;
  text-align: left;
  cursor: pointer;
  background: none;
  border: 0;
  gap: 10px;
  width: 100%;
  padding: 0;
}

.adminSupplierTableRow .adminSupplierCardSelect {
  align-items:  center;
  min-width: 0;
  padding: 12px 14px 12px 0;
}

.adminSupplierCardBody {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.adminSupplierCardBody strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.3;
}

.adminSupplierCardBody small {
  color: #6d6a70;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.adminSupplierCardBody p {
  display: -webkit-box;
  overflow: hidden;
  color: #6d6a70;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.adminSupplierCardLogo, .adminSupplierCardLogoFallback, .adminSupplierLogoPreview, .adminSupplierLogoPreviewFallback {
  object-fit: cover;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  flex: none;
  width: 44px;
  height: 44px;
}

.adminSupplierCardLogoFallback, .adminSupplierLogoPreviewFallback {
  display: grid;
  color: #171717;
  background: #f8f6f8;
  place-items:  center;
  font-size: 15px;
  font-weight: 850;
}

.adminSupplierCardActions {
  display: flex;
  border-top: 1px solid #ece8ec;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 10px;
}

.adminSupplierTableRow .adminSupplierCardActions {
  border-top: 0;
  align-items:  center;
  padding-top: 0;
}

.adminSupplierTableCell {
  display: inline-flex;
  overflow: hidden;
  color: #464247;
  text-overflow: ellipsis;
  white-space: nowrap;
  align-items:  center;
  min-width: 0;
  padding: 12px 14px 12px 0;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.adminSupplierMutedCell {
  color: #a09aa3;
  font-weight: 700;
}

.adminSupplierStatusPill {
  display: inline-flex;
  color: #6d6a70;
  background: #f8f6f8;
  border: 1px solid #1717171f;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  min-width: 46px;
  min-height: 24px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.adminSupplierStatusPill.enabled {
  color: #fff;
  background: #171717;
}

.adminSupplierStatusPill.disabled {
  color: #8a858d;
  background: #fff;
}

.adminSupplierToggleButton {
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background-color .12s;
}

.adminSupplierToggleButton:hover:not(:disabled) {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.adminSupplierToggleButton:disabled {
  cursor: not-allowed;
  opacity: .78;
}

.adminSupplierToggleButton.loading svg {
  animation: spin .9s linear infinite;
}

.adminSupplierStats {
  display: inline-flex;
  white-space: nowrap;
  align-items:  center;
  gap: 2px;
  font-size: 11px;
  font-weight: 750;
}

.adminSupplierStatsSuccess {
  color: #171717;
  font-weight: 850;
}

.adminSupplierStatsFailure {
  color: var(--red);
  font-weight: 850;
}

.adminSupplierStatsSep {
  color: var(--muted);
  margin: 0 1px;
}

.adminSupplierStatsRate {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.adminSupplierCardGroup {
  display: inline-flex;
  overflow: hidden;
  color: #171717;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
  border: 1px solid #1717171f;
  border-radius: 999px;
  align-items:  center;
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  min-height: 22px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.adminSupplierEditor {
  display: grid;
  align-content:  start;
  gap: 14px;
  min-width: 0;
}

.adminSupplierEditor > .adminSectionTitle {
  justify-content: flex-start;
}

.adminSupplierEditor > .adminSectionTitle .miniButton {
  margin-left: auto;
}

.adminSupplierFormGrid {
  display: grid;
  gap: 14px;
}

.adminSupplierFormGrid .settingsGroupWide {
  grid-column: 1 / -1;
}

.adminSupplierLogoField {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
}

.adminSupplierLogoField > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.adminSupplierLogoField > small {
  color: #6d6a70;
  font-size: 12px;
  line-height: 1.45;
}

.adminSupplierLogoPreviewRow {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 12px;
}

.adminSupplierLogoPreview, .adminSupplierLogoPreviewFallback {
  width: 56px;
  height: 56px;
}

.adminSupplierLogoUploadButton {
  position: relative;
  overflow: hidden;
}

.adminSupplierLogoUploadButton input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  inset: 0;
}

.adminSupplierUsageFields {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  padding-top: 4px;
}

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

.adminSupplierFormActions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.adminSupplierFormActions .settingsSaveButton {
  grid-column: auto;
}

.adminSupplierModal {
  overflow: hidden;
  background: #fff;
  border-color: #17171729;
  border-radius: 18px;
  width: min(860px, 100vw - 32px);
  max-height: min(840px, 100svh - 40px);
  box-shadow: 0 28px 90px #17171738;
}

.adminSupplierModal .modalCloseButton {
  box-shadow: none;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  top: 14px;
  right: 16px;
}

.adminSupplierModal .adminSupplierEditor {
  max-height: inherit;
  overflow-y: auto;
  gap: 0;
  padding: 0;
}

.adminSupplierModal .adminSupplierEditor > .adminSectionTitle {
  position: sticky;
  z-index: 2;
  backdrop-filter: blur(14px);
  background: #fffffff5;
  border-bottom: 1px solid #ece8ec;
  min-height: 66px;
  padding: 20px 64px 18px 24px;
  top: 0;
}

.adminSupplierModal .adminSupplierEditor > .adminSectionTitle strong {
  letter-spacing: -.02em;
  font-size: 18px;
}

.adminSupplierModal .adminSupplierFormGrid {
  background: linear-gradient(#fff 0%, #fbfafb 100%);
  gap: 16px;
  padding: 20px 24px 24px;
}

.adminSupplierModal .settingsGroup {
  border-color: #ece8ec;
  border-radius: 14px;
  gap: 14px;
  padding: 16px;
  box-shadow: 0 10px 30px #1717170a;
}

.adminSupplierModal .settingsGroup .adminSectionTitle {
  padding-bottom: 2px;
}

.adminSupplierModal .settingsGroup .adminSectionTitle strong {
  font-size: 14px;
}

.adminSupplierModal .walletAmount input, .adminSupplierModal .walletAmount select {
  background: #fff;
  border-radius: 10px;
  height: 46px;
}

.adminSupplierModal .walletAmount textarea {
  background: #fff;
  border-radius: 10px;
}

.adminSupplierModal .adminSupplierFormActions {
  position: sticky;
  backdrop-filter: blur(14px);
  background: #fffffff5;
  border-top: 1px solid #ece8ec;
  margin: 4px -16px -16px;
  padding: 14px 16px 16px;
  bottom: 0;
}

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

.supplierChannelFieldLabel {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.supplierChannelPicker {
  display: grid;
  gap: 10px;
}

.supplierChannelPicker.panel, .supplierChannelPicker.sheet {
  box-sizing: border-box;
  background: none;
  border: 0;
  padding: 0;
}

.supplierChannelPicker.compact {
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 8px;
}

.supplierChannelCard {
  display: flex;
  color: #171717;
  text-align: left;
  cursor: pointer;
  background: #fff;
  border: 1px solid #1717171a;
  border-radius: 12px;
  align-items:  flex-start;
  gap: 10px;
  width: 100%;
  padding: 12px;
  transition: border-color .16s, background .16s, box-shadow .16s, transform .16s;
  box-shadow: 0 8px 22px #1717170a;
}

.supplierChannelCard:hover, .supplierChannelCard.active {
  background: #fff;
  border-color: #171717;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px #17171714;
}

.supplierChannelCard:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.supplierChannelLogo, .supplierChannelLogoFallback {
  object-fit: cover;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  flex: none;
  width: 36px;
  height: 36px;
}

.supplierChannelLogoFallback {
  display: grid;
  color: #171717;
  background: #f8f6f8;
  place-items:  center;
  font-size: 14px;
  font-weight: 850;
}

.supplierChannelBody {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.supplierChannelBody strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.supplierChannelBody small {
  display: -webkit-box;
  overflow: hidden;
  color: #6d6a70;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.supplierChannelPrice {
  color: #8a858d;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}

.supplierChannelPicker.compact .supplierChannelCard {
  padding: 8px 10px;
}

.supplierChannelPicker.compact .supplierChannelLogo, .supplierChannelPicker.compact .supplierChannelLogoFallback {
  border-radius: 8px;
  width: 32px;
  height: 32px;
}

.supplierChannelPicker.compact .supplierChannelBody strong {
  font-size: 13px;
}

.supplierChannelPicker.compact .supplierChannelBody small {
  -webkit-line-clamp: 1;
}

.supplierChannelGroups {
  display: flex;
  background: #ffffffb8;
  border: 1px solid #17171714;
  border-radius: 14px;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
}

.supplierChannelGroupTab {
  display: inline-flex;
  color: #6d6a70;
  cursor: pointer;
  white-space: nowrap;
  background: none;
  border: 1px solid #0000;
  border-radius: 999px;
  flex: none;
  align-items:  center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 12px;
  transition: border-color .16s, background .16s, box-shadow .16s, color .16s, transform .16s;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.supplierChannelGroupTab:hover {
  color: #171717;
  background: #fff;
  border-color: #1717171f;
}

.supplierChannelGroupTab.active {
  color: #fff;
  background: #171717;
  border-color: #171717;
  box-shadow: 0 8px 18px #17171729;
}

.supplierChannelGroupCount {
  display: inline-flex;
  color: inherit;
  background: #17171714;
  border-radius: 999px;
  justify-content: center;
  align-items:  center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.supplierChannelGroupTab.active .supplierChannelGroupCount {
  background: #ffffff2e;
}

.priceEstimateHint {
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.settingsSummary, .settingsGroup {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  align-content:  start;
  gap: 12px;
  padding: 14px;
}

.settingsSummary {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #f8f6f8;
  align-items:  end;
  margin: 20px 20px 0;
}

.settingsSummary span, .settingsSummary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.settingsSummary strong {
  grid-row: span 2;
  text-align: right;
  font-size: 24px;
  line-height: 1.1;
}

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

.settingsGroup .adminSectionTitle, .usagePricingGroup > strong, .usagePricingGroup > small {
  grid-column: 1 / -1;
}

.usagePricingControls {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.usagePricingGroup .walletAmount {
  grid-column: 1 / -1;
}

.usagePricePreview {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.adminSettingsContent .settingsGroupWide {
  grid-column: 1 / -1;
}

.settingsSaveButton {
  grid-column: 1 / -1;
  justify-self: end;
}

.walletRow {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, .8fr) minmax(160px, .9fr) auto minmax(160px, .9fr) auto;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  align-items:  end;
  gap: 12px;
  padding: 14px;
}

.walletIdentity, .walletBalance, .walletAmount {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.walletAmount.settingWide {
  grid-column: span 2;
}

.walletAmount.settingAnnouncement {
  grid-column: 1 / -1;
}

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

.loadingMascotUpload {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #ffffffe0;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  gap: 12px;
  padding: 12px;
}

.loadingMascotUpload .settingToggle, .loadingMascotUploadButton {
  align-self:  end;
}

.loadingMascotList {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
}

.loadingMascotItem {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 104px 92px auto;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  padding: 10px;
}

.loadingMascotItem .spriteMascot, .loadingMascotItem .blockMascot {
  justify-self: center;
  width: 58px;
}

.loadingMascotMeta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.loadingMascotMeta strong, .loadingMascotMeta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loadingMascotMeta strong {
  font-size: 13px;
  font-weight: 900;
}

.loadingMascotMeta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.loadingMascotToggle {
  min-height: 38px;
}

.loadingMascotSort input {
  height: 38px;
}

.loadingMascotActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.loadingMascotActions .miniButton {
  min-height: 38px;
  padding: 0 10px;
}

.loadingMascotActions .miniButton.danger {
  width: 38px;
  padding: 0;
}

.walletIdentity span, .walletBalance span, .walletAmount span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.walletIdentity strong, .walletBalance strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
}

.walletIdentity small {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.walletAmount input, .walletAmount textarea, .walletAmount select {
  color: var(--ink);
  outline: none;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  width: 100%;
  font-weight: 750;
}

.walletAmount input, .walletAmount select {
  height: 42px;
  padding: 0 10px;
}

.walletAmount select {
  cursor: pointer;
}

.walletAmount textarea {
  resize: vertical;
  min-height: 92px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.walletAmount input:focus, .walletAmount textarea:focus, .walletAmount select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px #17171724;
}

.settingToggle {
  display: flex;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  min-width: 0;
  min-height: 42px;
  padding: 0 10px;
}

.settingToggle input {
  accent-color: var(--green);
  flex: none;
  width: 18px;
  height: 18px;
}

.settingToggle span {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.walletActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.walletActions button {
  padding: 0 12px;
}

.walletResetButton {
  white-space: nowrap;
  padding: 0 12px;
}

.consumptionRecordsViewer {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.recordsHeader {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  gap: 12px;
  padding: 12px;
}

.backButton {
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  justify-self: start;
  padding: 6px 12px;
  font-size: 14px;
}

.backButton:hover {
  background: var(--line);
}

.recordsUserInfo {
  display: grid;
  gap: 4px;
}

.recordsUserInfo strong {
  font-size: 16px;
}

.recordsUserInfo small {
  color: var(--text-secondary);
  font-size: 12px;
}

.recordsList {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  gap: 10px;
  padding: 12px;
}

.recordsItem {
  display: grid;
  grid-template-columns: 1fr auto;
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  align-items:  center;
  gap: 12px;
  padding: 10px;
}

.recordsItemInfo {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.recordsItemInfo strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.recordsItemInfo span {
  color: var(--text-secondary);
  font-size: 12px;
}

.recordsItemAmount {
  display: grid;
  text-align: right;
  gap: 4px;
}

.recordsItemAmount em {
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
}

.recordsItemAmount small {
  color: var(--text-secondary);
  font-size: 12px;
}

.recordsPagination {
  display: grid;
  grid-template-columns: auto 1fr auto;
  border: 2px solid var(--line-strong);
  background: #fff;
  align-items:  center;
  gap: 12px;
  padding: 12px;
}

.recordsPagination button {
  border: 2px solid var(--line);
  cursor: pointer;
  background: #fff;
  padding: 6px 12px;
  font-size: 14px;
}

.recordsPagination button:hover:not(:disabled) {
  background: var(--line);
}

.recordsPagination button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.recordsPagination span {
  text-align: center;
  font-size: 14px;
}

.recordsLoading, .recordsEmpty, .recordsError {
  text-align: center;
  border: 2px solid var(--line-strong);
  color: var(--text-secondary);
  background: #fff;
  padding: 20px;
}

.recordsError {
  color: var(--error-text, #d32f2f);
  background: var(--error-bg, #ffebee);
}

.adminRechargePanel, .adminRankingPanel, .adminCreationPanel {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  gap: 12px;
  margin: 20px 20px 0;
  padding: 14px;
  box-shadow: 0 2px 8px #0000000f;
}

.adminCreationHeader {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
}

.adminCreationRange {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adminCreationRange button {
  color: var(--ink);
  cursor: pointer;
  background: #ffffffe0;
  border: 1px solid #dedbe0;
  border-radius: 6px;
  min-width: 72px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.adminCreationRange button.active {
  border-color: var(--line-strong);
  background: var(--green);
  color: #fff;
  box-shadow: none;
}

.adminCreationRange button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.adminSectionTitle small {
  color: var(--muted);
  margin-left: auto;
  font-size: 12px;
  font-weight: 750;
}

.adminCreationMasonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  align-content:  start;
  align-items: stretch;
  gap: 14px;
  width: 100%;
}

.adminCreationCard {
  display: flex;
  overflow: hidden;
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 420px;
  box-shadow: 0 2px 8px #0000000d;
}

.adminCreationCover {
  display: block;
  overflow: hidden;
  cursor: zoom-in;
  background: #ece9ee;
  border: 0;
  flex-shrink: 0;
  width: 100%;
  height: 168px;
  padding: 0;
}

.adminCreationCover img {
  display: block;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.adminCreationCover--empty {
  display: grid;
  color: #b8b3ba;
  cursor: default;
  place-items:  center;
}

.adminCreationCardBody {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  min-height: 0;
  padding: 10px 12px 12px;
}

.adminCreationMeta {
  display: grid;
  flex-shrink: 0;
  gap: 6px;
  min-width: 0;
}

.adminCreationMetaCharge {
  display: flex;
  color: var(--muted);
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
}

.adminCreationMetaCharge strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.adminCreationMetaSupplier {
  display: flex;
  color: var(--muted);
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
  font-size: 12px;
  font-weight: 750;
}

.adminCreationMetaSupplier strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
  font-size: 13px;
  font-weight: 850;
}

.adminCreationMetaPrimary, .adminCreationMetaSecondary {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 8px;
  min-width: 0;
}

.adminCreationMetaPrimary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
}

.adminCreationMetaSecondary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.adminCreationMetaSecondary span, .adminCreationMetaSecondary time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.adminCreationInput, .adminCreationReferences, .adminCreationOutput {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.adminCreationInput > span, .adminCreationReferences > span, .adminCreationOutput > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.adminCreationInput p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-box-orient: vertical;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.adminCreationConversation {
  display: grid;
  border: 2px dashed var(--line);
  overflow-y: auto;
  background: #ffffffc2;
  flex: 1;
  gap: 8px;
  min-height: 0;
  padding: 10px;
}

.adminCreationConversationTitle {
  display: flex;
  color: var(--muted);
  justify-content: space-between;
  align-items:  center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
}

.adminCreationConversationTitle strong {
  color: var(--ink);
  font-size: 12px;
}

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

.adminCreationMessage {
  display: flex;
  align-items:  flex-start;
  gap: 8px;
  min-width: 0;
}

.adminCreationMessage--user {
  flex-direction: row-reverse;
}

.adminCreationMessageRole {
  color: var(--muted);
  text-align: center;
  flex: 0 0 36px;
  padding-top: 7px;
  font-size: 12px;
  font-weight: 800;
}

.adminCreationMessageBubble {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  gap: 8px;
  min-width: 0;
  max-width: calc(100% - 44px);
  padding: 9px 10px;
  box-shadow: 0 1px 4px #0000000f;
}

.adminCreationMessage--user .adminCreationMessageBubble {
  color: #fff;
  border-color: var(--line-strong);
  background: var(--blue);
}

.adminCreationMessageBubble p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.adminCreationMessageEmpty, .adminCreationConversationEmpty {
  color: var(--muted);
}

.adminCreationMessage--user .adminCreationMessageEmpty {
  color: #ffffffc7;
}

.adminCreationMessageImages {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.adminCreationMessageImage {
  display: block;
  border: 2px solid var(--line);
  overflow: hidden;
  cursor: zoom-in;
  background: #fff;
  width: 58px;
  height: 58px;
  padding: 0;
}

.adminCreationMessage--user .adminCreationMessageImage {
  border-color: #ffffffc7;
}

.adminCreationMessageImage img {
  display: block;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.adminCreationConversationEmpty {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.adminCreationStatus--succeeded {
  color: #1b7f4a;
}

.adminCreationStatus--archived {
  color: var(--green-dark);
}

.adminCreationStatus--failed {
  color: var(--error-text, #d32f2f);
}

.adminCreationStatus--pending, .adminCreationStatus--running {
  color: #9a6b00;
}

.adminCreationMedia {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 160px);
  align-items:  start;
  gap: 12px;
}

.adminCreationThumbGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adminCreationThumbButton {
  display: block;
  border: 2px solid var(--line);
  overflow: hidden;
  cursor: zoom-in;
  background: #fff;
  width: 72px;
  height: 72px;
  padding: 0;
}

.adminCreationThumbButton img {
  display: block;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.adminCreationError, .adminCreationPending {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.adminCreationError {
  color: var(--error-text, #d32f2f);
}

.adminCreationPending {
  color: var(--muted);
}

.adminRankList {
  display: grid;
  gap: 10px;
}

.adminRankRow {
  display: grid;
  grid-template-columns: 46px minmax(130px, 1.2fr) minmax(96px, .8fr) minmax(76px, .6fr) minmax(120px, .9fr);
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  padding: 10px;
}

.adminRankIndex {
  display: grid;
  background: var(--green);
  color: #fff;
  border: 0;
  border-radius: 6px;
  place-items:  center;
  min-height: 34px;
  font-size: 13px;
  line-height: 1;
}

.adminRankRow div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.adminRankRow span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.adminRankRow strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
}

.adminRechargeList {
  display: grid;
  gap: 10px;
}

.adminRechargeRow {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(88px, .8fr) minmax(88px, .8fr) minmax(70px, .6fr) minmax(70px, .6fr) minmax(92px, .8fr);
  background: #ffffffe0;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  align-items:  center;
  gap: 10px;
  padding: 10px;
}

.adminRechargeRow div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.adminRechargeRow span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.adminRechargeRow strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.25;
}

.adminEmpty {
  background: #ffffffe0;
  border-radius: 8px;
}

.adminFeedbackPanel {
  display: grid;
  grid-template-columns: minmax(220px, .36fr) minmax(0, 1fr);
  gap: 14px;
  padding: 20px;
}

.adminFeedbackList, .adminFeedbackThread {
  border: 2px solid var(--line-strong);
  background: #fff;
  padding: 14px;
}

.adminFeedbackList {
  overflow-y: auto;
  max-height: 720px;
}

.adminFeedbackThread {
  gap: 12px;
}

.feedbackStatusSelect {
  display: grid;
  flex: 0 0 160px;
  gap: 5px;
}

.feedbackStatusSelect span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.feedbackStatusSelect select {
  color: var(--ink);
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  width: 100%;
  height: 40px;
  padding: 0 9px;
  font-weight: 850;
}

.adminReplyBox {
  background: #ffffffe0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0% {
    transform: translateX(-120%);
  }

  55%, 100% {
    transform: translateX(260%);
  }
}

@keyframes blockMascotStep {
  0%, 100% {
    transform: translateY(1px);
  }

  50% {
    transform: translateY(-3px);
  }
}

@keyframes blockLeftArm {
  0%, 100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-2px);
  }
}

@keyframes blockMineArm {
  0%, 100% {
    transform: rotate(-12deg)translateY(0);
  }

  50% {
    transform: rotate(-46deg)translateY(-3px);
  }
}

@keyframes blockPickaxeHit {
  0%, 100% {
    transform: rotate(-20deg);
  }

  50% {
    transform: rotate(-58deg)translate(-2px, -2px);
  }
}

@keyframes blockLeftLeg {
  0% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px);
  }

  100% {
    transform: translateY(0);
  }
}

@keyframes blockRightLeg {
  0% {
    transform: translateY(2px);
  }

  50% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(2px);
  }
}

@keyframes blockChunkPop {
  0% {
    opacity: 0;
    transform: translate(0, 4px)scale(.6);
  }

  35% {
    opacity: 1;
    transform: translate(4px, -3px)scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(11px, -11px)scale(.7);
  }
}

@keyframes blockBlink {
  0%, 94%, 100% {
    height: 4px;
  }

  96% {
    height: 1px;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authInputNudge {
  0%, 100% {
    transform: translateX(0);
  }

  35% {
    transform: translateX(2px);
  }

  70% {
    transform: translateX(-2px);
  }
}

@keyframes recommendedUploadGrow {
  0%, 100% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.08);
  }
}

@keyframes templateGuidePulse {
  0%, 100% {
    box-shadow: 0 0 #17171700;
  }

  45% {
    box-shadow: 0 0 0 6px #17171729;
  }
}

@keyframes templateLibrarySheetIn {
  from {
    opacity: 0;
    transform: translateY(28px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes templateFormSheetIn {
  from {
    opacity: 0;
    transform: translateY(34px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (width <= 900px) {
  .shell, .authShell {
    width: min(100vw - 24px, 680px);
    padding-top: 24px;
  }

  .masthead, .workspace, .playbookBanner {
    grid-template-columns: 1fr;
  }

  .statusChip {
    text-align: left;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .walletRow, .adminStats, .ledgerGrid {
    grid-template-columns: 1fr 1fr;
  }

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

  .adminCreationHeader {
    flex-direction: column;
    align-items: stretch;
  }

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

  .adminRankRow {
    grid-template-columns: 46px repeat(2, minmax(0, 1fr));
  }

  .contactGrid, .feedbackLayout, .adminFeedbackPanel {
    grid-template-columns: 1fr;
  }

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

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

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

  .loadingMascotItem {
    grid-template-columns: 70px minmax(0, 1fr) 96px;
  }

  .loadingMascotActions {
    grid-column: 2 / -1;
  }

  .templateLibraryLayout, .adminTemplateWorkspace, .adminTemplateEditorGrid, .templateFieldGrid {
    grid-template-columns: 1fr;
  }

  .templateLibraryModal {
    overflow: hidden;
    height: calc(100svh - 28px);
    max-height: calc(100svh - 28px);
  }

  .templateLibraryRail {
    grid-template-rows: auto auto;
    border-right: 0;
    border-bottom: 2px solid var(--line-strong);
    gap: 12px;
  }

  .templateLibraryLayout {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
  }

  .templateLibraryList {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    max-height: none;
    padding-bottom: 4px;
    padding-right: 0;
  }

  .templateLibraryCard {
    grid-template-columns: 72px minmax(0, 1fr);
    scroll-snap-align: start;
    flex: 0 0 min(280px, 74vw);
    min-height: 100px;
  }

  .templateLibraryCard p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    white-space: normal;
    -webkit-box-orient: vertical;
  }

  .templateSpotlightScroll {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow-y: auto;
  }

  .templateSpotlightCover {
    border-right: 0;
    border-bottom: 2px solid var(--line-strong);
    height: 240px;
  }

  .templateSpotlightBody {
    overflow: visible;
  }

  .playbookBannerPreview {
    border-top: 1px solid #f8f7f12e;
    border-left: 1px solid #f8f7f12e;
    height: 190px;
    margin: 0 18px 18px;
  }

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

  .walletRow .walletAmount, .walletAmount.settingWide, .walletActions {
    grid-column: 1 / -1;
  }

  h1 {
    font-size: clamp(34px, 13vw, 56px);
  }

  .conversationPanel {
    height: min(760px, 72svh);
    min-height: 520px;
  }

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

  .adminRail {
    display: none;
  }

  .adminMobileTopbar {
    display: grid;
  }

  .adminContent {
    padding: 20px 16px;
  }

  .adminContentLogin {
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  }

  .adminContentLogin > .panel {
    width: min(420px, 100%);
  }

  .adminContentLogin .accountPanel .authCard {
    padding: 0 18px 20px;
  }

  .adminCreationBody {
    height: calc(100svh - 380px);
    min-height: 260px;
    max-height: calc(100svh - 380px);
  }
}

@media (width <= 560px) {
  .shell, .authShell {
    width: 100%;
    padding: 18px 12px 26px;
  }

  .panelHeader {
    min-height: 68px;
    padding: 14px;
  }

  .conversation {
    padding: 14px;
  }

  .bubble {
    max-width: 94%;
  }

  .bubble p {
    font-size: 14px;
  }

  .imageFrame img {
    width: min(100%, 340px);
    max-height: 38svh;
  }

  .composer {
    min-height: 0;
    padding: 14px;
  }

  .dropUploadOverlay {
    inset: 8px;
  }

  .inputRow {
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    gap: 9px;
  }

  .controlPanelActions {
    justify-content: stretch;
    width: 100%;
  }

  .controlPanelActions .panelMark {
    flex: 1 1 0;
    min-width: 0;
  }

  .iconButton {
    width: 44px;
    height: 44px;
  }

  .sendButton {
    width: 48px;
    height: 48px;
  }

  textarea {
    min-height: 120px;
  }

  .templateLibraryModal, .presetModal:not(.authModal) {
    width: 100vw;
    max-width: none;
  }

  .templateLibraryBackdrop {
    place-items:  end stretch;
    padding: 0;
  }

  .templateLibraryModal {
    border-right: 2px solid var(--line-strong);
    border-bottom: 0;
    border-left: 2px solid var(--line-strong);
    width: 100vw;
    height: min(88svh, 760px);
    max-height: calc(100svh - 28px);
    box-shadow: 0 -18px 70px #181a173d;
  }

  .templateLibraryModal:before {
    content: "";
    position: absolute;
    background: #181a1738;
    border: 1px solid #181a1752;
    width: 54px;
    height: 5px;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
  }

  .templateLibraryRail {
    gap: 12px;
    padding: 26px 12px 12px;
  }

  .templateLibraryHeader {
    padding-right: 48px;
  }

  .templateLibraryHeader strong {
    font-size: 17px;
  }

  .templateLibraryCard {
    grid-template-columns: 78px minmax(0, 1fr);
    flex-basis: min(334px, 88vw);
    min-height: 118px;
    padding: 10px;
  }

  .templateLibraryCard strong, .templateSpotlightTitleRow h3 {
    font-size: 16px;
    line-height: 1.2;
  }

  .templateLibraryCard p, .templateSpotlightBody p, .templatePromptExcerpt p, .templateLibraryPlaceholder p, .templateModeEmpty {
    font-size: 12px;
    line-height: 1.55;
  }

  .templateSpotlightTitleRow {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .templateSpotlightHeader, .templateSpotlightBody {
    padding-left: 12px;
    padding-right: 12px;
  }

  .templateSpotlightHeader {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .templateSpotlightBody {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    gap: 12px;
  }

  .templateLibrarySpotlight {
    overflow: hidden;
  }

  .templateSpotlightScroll {
    display: block;
    overflow-y: auto;
    min-height: 0;
  }

  .templateSpotlightCover {
    height: clamp(164px, 48vw, 216px);
    padding: 8px;
  }

  .templateSpotlightCover img {
    object-fit: contain;
  }

  .templateApplyButton {
    box-shadow: 3px 3px 0 var(--ink);
    min-height: 40px;
    padding: 0 12px;
  }

  .templatePromptExcerpt {
    padding: 12px;
  }

  .templatePromptExcerpt p {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 176px;
  }

  .playbookBannerBody {
    padding: 18px 16px;
  }

  .playbookBannerPreview {
    height: 150px;
    margin: 0 16px 16px;
  }

  .playbookBannerActions {
    flex-direction: column;
  }

  .playbookPrimaryButton, .playbookBannerActions .miniButton {
    width: 100%;
  }

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

  .templateActionRow {
    grid-template-columns: 44px minmax(0, 1fr) 48px;
    gap: 9px;
  }

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

  .adminTemplatePanel {
    margin-left: 14px;
    margin-right: 14px;
  }

  .imageGrid {
    grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
    max-width: 78vw;
  }

  .imagePreviewModal img {
    max-width: calc(100vw - 24px);
    max-height: calc(100svh - 24px);
  }

  .imagePreviewClose {
    top: 8px;
    right: 8px;
  }

  .walletRow, .adminStats, .ledgerGrid, .adminRankRow, .adminRechargeRow, .rechargeInputRow, .adminCreationMasonry {
    grid-template-columns: 1fr;
  }

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

  .adminSettingsContent, .settingsGroup, .feedbackHeader, .feedbackThreadHeader {
    grid-template-columns: 1fr;
  }

  .adminSuppliersWorkspace {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .adminSuppliersList {
    max-height: none;
  }

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

  .settingsSummary {
    margin: 16px 16px 0;
  }

  .loadingMascotUpload, .loadingMascotItem {
    grid-template-columns: 1fr;
  }

  .loadingMascotItem .spriteMascot, .loadingMascotItem .blockMascot {
    justify-self: start;
  }

  .loadingMascotActions {
    grid-column: auto;
    justify-content: flex-start;
  }

  .walletRow .walletAmount, .walletAmount.settingWide, .walletActions {
    grid-column: auto;
  }

  .feedbackHeader, .feedbackThreadHeader {
    display: grid;
  }

  .feedbackStatusSelect {
    flex-basis: auto;
    width: 100%;
  }

  .supplierChannelGroups {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding: 4px;
  }

  .supplierChannelGroups::-webkit-scrollbar {
    display: none;
  }

  .supplierChannelGroupTab {
    min-height: 36px;
  }

  .adminSupplierModal {
    border-radius: 16px 16px 0 0;
    width: 100vw;
    max-width: none;
    max-height: calc(100svh - 20px);
  }

  .adminSupplierModal .adminSupplierEditor > .adminSectionTitle {
    min-height: 60px;
    padding: 18px 58px 16px 18px;
  }

  .adminSupplierModal .adminSupplierFormGrid {
    padding: 16px;
  }

  .adminSupplierModal .settingsGroup {
    padding: 14px;
  }
}

@media (width <= 560px) and (prefers-reduced-motion: no-preference) {
  .templateLibraryModal {
    animation: templateLibrarySheetIn .18s ease-out;
  }
}

.studioApp {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 360px;
  overflow: hidden;
  color: #171717;
  background: #f8f6f8;
  height: 100svh;
  min-height: 640px;
}

.studioApp button {
  border-radius: 8px;
}

.studioRail, .studioInspector {
  background: #fffffceb;
  border-color: #dedbe0;
  min-height: 0;
}

.studioRail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-right: 1px solid #dedbe0;
  gap: 18px;
  padding: 18px 14px;
}

.studioBrand {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items:  center;
  gap: 10px;
}

.studioBrandLogo {
  object-fit: contain;
  border-radius: 10px;
  width: 38px;
  height: 38px;
}

.studioBrand strong, .studioAccount strong, .inspectorTitle strong, .studioConversationHeader h1, .studioMobileTopbar strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.studioBrand strong {
  display: block;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.studioBrand small, .studioAccount span, .studioAccount small, .inspectorTitle span, .studioMobileTopbar span, .accountInspector span, .accountInspector small, .studioComposerMeta button {
  color: #6d6a70;
  font-size: 12px;
  line-height: 1.35;
}

.studioNav {
  display: grid;
  overflow-y: auto;
  align-content:  start;
  gap: 16px;
  min-height: 0;
}

.studioNavSection {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.studioNavSection + .studioNavSection {
  border-top: 1px solid #dedbe0;
  padding-top: 14px;
}

.studioNavLabel {
  color: #8a9086;
  letter-spacing: 0;
  padding: 0 10px 3px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.studioNav button, .inspectorAction, .studioHeaderActions button, .studioAccount button, .accountInspector button, .studioMobileTopbar button, .studioMobileMenuHeader button, .studioComposerMeta button {
  display: inline-flex;
  color: #171717;
  cursor: pointer;
  background: none;
  border: 0;
  align-items:  center;
  gap: 10px;
  min-width: 0;
  font-weight: 750;
}

.studioNav button {
  text-align: left;
  min-height: 42px;
  padding: 0 10px;
}

.studioNav button:hover, .studioNav button.active, .inspectorAction:hover, .studioHeaderActions button:hover, .studioComposerMeta button:hover {
  background: #f8f6f8;
}

.studioNav button span, .inspectorAction span, .studioComposerMeta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studioAccount, .accountInspector {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  gap: 12px;
  min-width: 0;
  padding: 12px;
}

.studioAccountTop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items:  start;
  gap: 10px;
}

.studioAccount .studioLogoutButton {
  display: grid;
  color: #6d6a70;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  place-items:  center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
}

.studioAccount .studioLogoutButton:hover {
  color: #171717;
  background: #f8f6f8;
}

.studioAccount strong, .accountInspector strong {
  display: block;
  white-space: nowrap;
  margin: 2px 0;
  font-size: 15px;
  line-height: 1.25;
}

.studioAccount button, .accountInspector button {
  color: #fff;
  background: #171717;
  justify-content: center;
  min-height: 36px;
}

.studioMain {
  display: flex;
  overflow: hidden;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.studioMobileTopbar {
  display: none;
}

.studioConversationHeader {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: 18px;
  width: min(900px, 100% - 48px);
  margin: 0 auto;
  padding: 22px 0 12px;
}

.studioConversationHeader .eyebrow {
  margin-bottom: 5px;
}

.studioConversationHeader h1 {
  white-space: normal;
  max-width: 18ch;
  margin: 0;
  font-size: clamp(26px, 3vw, 42px);
  line-height: 1.05;
}

.studioHeaderActions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.studioHeaderActions button {
  background: #fff;
  border: 1px solid #dedbe0;
  min-height: 38px;
  padding: 0 12px;
}

.studioApp .announcementBanner {
  box-shadow: none;
  border: 1px solid #e4dac0;
  border-radius: 8px;
  width: min(900px, 100% - 48px);
  margin: 10px auto 0;
}

.studioConversation {
  scroll-padding-bottom: 24px;
  flex: auto;
  min-height: 0;
  padding: 20px max(24px, 50% - 450px) 24px;
}

.playbookRecommendations {
  display: grid;
  gap: 14px;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 8px 0 4px;
}

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

.playbookRecommendationsHeader strong {
  font-size: 16px;
  font-weight: 850;
  line-height: 1.2;
}

.playbookRecommendationsHeader button, .playbookRecommendationEmpty button {
  color: #171717;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

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

.playbookRecommendationCard {
  display: grid;
  color: #171717;
  cursor: pointer;
  text-align: left;
  background: none;
  border: 0;
  gap: 7px;
  min-width: 0;
  padding: 0;
}

.playbookRecommendationCard img {
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  width: 100%;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}

.playbookRecommendationCard:hover img, .playbookRecommendationCard.active img {
  border-color: #171717;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px #12161024;
}

.playbookRecommendationCard strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.playbookRecommendationCard span {
  overflow: hidden;
  color: #6d6a70;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.playbookRecommendationDots {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding-top: 3px;
}

.playbookRecommendationDots span {
  background: #d7d4d9;
  border-radius: 999px;
  width: 5px;
  height: 5px;
}

.playbookRecommendationDots span.active {
  background: #17836d;
}

.playbookRecommendationEmpty {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  justify-items: start;
  gap: 8px;
  padding: 16px;
}

.playbookRecommendationEmpty strong {
  font-size: 16px;
  font-weight: 850;
}

.playbookRecommendationEmpty p {
  color: #6d6a70;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.studioApp .bubble {
  box-shadow: none;
  border: 1px solid #dedbe0;
  border-radius: 12px;
}

.studioApp .message.user .bubble {
  background: #171717;
}

.studioApp .message.assistant .bubble {
  background: #fff;
}

.messageRetryButton {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  cursor: pointer;
  background: #fff;
  border-radius: 8px;
  align-items:  center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 750;
}

.messageRetryPanel {
  display: grid;
  gap: 10px;
  margin: 0 14px 14px;
}

.messageRetryHint {
  color: #6b6568;
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.messageRetryActions {
  display: flex;
  flex-wrap: wrap;
  align-items:  flex-end;
  gap: 10px;
}

.messageRetrySupplierSelect {
  display: grid;
  color: #171717;
  flex: 180px;
  gap: 6px;
  min-width: min(100%, 220px);
  font-size: 13px;
  font-weight: 750;
}

.messageRetrySupplierSelect select {
  border: 1px solid var(--line-strong);
  color: inherit;
  background: #fff;
  border-radius: 8px;
  min-height: 40px;
  padding: 0 12px;
  font-size: 14px;
}

.messageRetryButton:disabled {
  cursor: wait;
  opacity: .72;
}

.messageRetryButton:not(:disabled):hover {
  background: #f8f6f8;
}

.messageRetryButton svg {
  flex-shrink: 0;
}

.messageRetryButton.loading svg {
  animation: spin 1s linear infinite;
}

.messageBillingMeta {
  display: grid;
  border-top: 1px solid #ece9ee;
  gap: 4px;
  margin-top: 10px;
  padding-top: 10px;
}

.messageBillingMeta p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.messageBillingSize {
  color: #171717;
  font-weight: 650;
}

.messageBillingTokens {
  color: #6d6a70;
}

.messageBillingCharge {
  display: flex;
  color: #171717;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-weight: 650;
}

.messageBillingTotal {
  color: #8a858d;
  font-size: 11px;
  font-weight: 500;
}

.studioApp .imageFrame img, .studioApp .historyItem img, .studioApp .draftPreview img {
  border: 1px solid #dedbe0;
  border-radius: 8px;
}

.studioComposer {
  overflow-y: auto;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 14px;
  flex: none;
  align-self:  center;
  width: min(900px, 100% - 48px);
  height: auto;
  min-height: 0;
  max-height: min(42svh, 430px);
  margin: 0 auto 20px;
  padding: 12px;
  box-shadow: 0 16px 44px #181c1614;
}

.studioInputRow {
  grid-template-columns: 44px minmax(0, 1fr) 46px;
  align-items:  end;
  gap: 8px;
}

.studioInputRow textarea {
  resize: none;
  background: #f8f6f8;
  border: 0;
  border-radius: 8px;
  min-height: 46px;
  max-height: 170px;
  padding: 12px 14px;
  font-size: 15px;
}

.studioInputRow textarea:focus {
  box-shadow: none;
}

.studioInputRow textarea[readonly] {
  cursor: pointer;
}

.studioApp .iconButton, .studioApp .sendButton, .studioApp .downloadButton, .studioApp .logoutButton, .studioApp .draftPreview button {
  box-shadow: none;
  border: 0;
}

.studioApp .iconButton {
  background: #f8f6f8;
  width: 44px;
  height: 44px;
}

.studioApp .sendButton {
  background: #171717;
  width: 46px;
  height: 46px;
}

.studioComposerMeta {
  display: flex;
  flex-wrap: wrap;
  align-items:  center;
  gap: 8px;
  padding-top: 8px;
}

.studioComposerMeta button {
  background: #f8f6f8;
  max-width: 100%;
  min-height: 32px;
  padding: 0 10px;
}

.studioComposerMeta .composerMetaPill {
  border: 1px solid #dedbe0;
  border-radius: 8px;
}

.studioComposerMeta .composerChannelPill {
  display: flex;
  justify-content: flex-start;
  align-items:  center;
  gap: 6px;
  max-width: min(140px, 34vw);
  height: 32px;
  min-height: 32px;
  padding: 0 8px 0 6px;
}

.studioComposerMeta .composerChannelLogo, .studioComposerMeta .composerChannelLogoFallback, .studioComposerMeta .supplierChannelLogo, .studioComposerMeta .supplierChannelLogoFallback {
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 5px;
  flex: none;
  width: 18px;
  height: 18px;
}

.studioComposerMeta .supplierChannelLogoFallback {
  background: #f8f6f8;
  font-size: 9px;
  font-weight: 850;
}

.studioComposerMeta .composerChannelStack {
  display: grid;
  text-align: left;
  gap: 1px;
  width: 100%;
  min-width: 0;
  line-height: 1.1;
}

.studioComposerMeta .composerChannelName, .studioComposerMeta .composerChannelPrice {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
  font-size: 9px;
  font-weight: 650;
}

.studioComposerMeta .composerChannelName {
  color: #171717;
}

.studioComposerMeta .composerChannelPrice {
  color: #8a858d;
  font-weight: 600;
}

.studioInspector {
  display: grid;
  overflow-y: auto;
  border-left: 1px solid #dedbe0;
  align-content:  start;
  gap: 14px;
  padding: 18px;
}

.inspectorCard {
  display: grid;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

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

.inspectorTitle span {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspectorAction {
  background: #f8f6f8;
  justify-content: flex-start;
  min-height: 38px;
  padding: 0 10px;
}

.accountInspector {
  grid-template-columns: 38px minmax(0, 1fr);
  align-items:  center;
}

.accountInspector button {
  grid-column: 1 / -1;
}

.accountAvatar {
  display: grid;
  color: #171717;
  background: #f8f6f8;
  border-radius: 50%;
  place-items:  center;
  width: 38px;
  height: 38px;
}

.studioApp .outputPanel {
  background: none;
  border: 0;
}

.studioApp .outputPanelHeader {
  display: none;
}

.studioApp .ratioPreviewCard {
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.studioApp .ratioPreviewCard small {
  color: #6d6a70;
}

.studioApp .ratioTileField {
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  margin-bottom: 12px;
  padding: 12px;
}

.studioApp .supplierChannelField {
  background: none;
  border: 0;
  border-radius: 0;
  gap: 8px;
  margin-bottom: 0;
  padding: 0;
}

.studioApp .supplierChannelFieldLabel {
  color: #6d6a70;
  font-size: 12px;
  font-weight: 750;
}

.studioApp .supplierChannelPicker.panel, .studioApp .supplierChannelPicker.sheet {
  box-sizing: border-box;
  background: #f8f6f8;
  border: 1px solid #1717170f;
  border-radius: 14px;
  gap: 10px;
  padding: 12px;
}

.studioApp .supplierChannelCard {
  background: #fff;
  border: 1px solid #1717171a;
  border-radius: 12px;
  box-shadow: 0 8px 22px #1717170a;
}

.studioApp .supplierChannelCard:hover, .studioApp .supplierChannelCard.active {
  background: #fff;
  border-color: #171717;
  box-shadow: 0 12px 30px #17171714;
}

.studioApp .supplierChannelLogo, .studioApp .supplierChannelLogoFallback {
  background: #fff;
  border-color: #dedbe0;
}

.studioApp .supplierChannelBody small {
  color: #6d6a70;
}

.studioApp .supplierChannelPrice {
  color: #8a858d;
  font-weight: 650;
}

.studioApp .ratioTileHeader, .studioApp .ratioTileHeader small {
  color: #6d6a70;
}

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

.studioApp .ratioAdvancedToggle {
  box-shadow: none;
  border: 1px solid #dedbe0;
  border-radius: 999px;
}

.studioApp .ratioAdvancedToggle:hover, .studioApp .ratioAdvancedToggle.expanded {
  background: #f8f6f8;
  border-color: #171717;
}

.studioApp .ratioAdvancedRow small {
  color: #6d6a70;
}

.studioApp .ratioTile {
  box-shadow: none;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  min-height: 104px;
}

.studioApp .ratioTile:hover, .studioApp .ratioTile.active {
  background: #f8f6f8;
  border-color: #171717;
}

.studioApp .outputGrid {
  gap: 10px;
  padding: 0;
}

.studioApp .selectLabel select, .studioApp .selectLabel input, .studioApp .selectLabel textarea {
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  height: 40px;
  font-size: 13px;
}

.studioApp .rangeLabel input {
  height: auto;
}

.studioApp .historyPanel {
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 12px;
  width: min(900px, 100% - 48px);
  max-height: 240px;
  margin: 0 auto 8px;
}

.historyDrawerBackdrop {
  position: fixed;
  z-index: 55;
  display: flex;
  backdrop-filter: blur(9px);
  background: #12141147;
  justify-content: flex-end;
  inset: 0;
}

.historyDrawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  backdrop-filter: blur(20px);
  background: #ffffffe6;
  border-left: 1px solid #dedbe0;
  width: min(390px, 100vw);
  min-width: 0;
  height: 100%;
  box-shadow: -24px 0 70px #1216102e;
}

.historyDrawerHeader {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 72px;
  background: #ffffffeb;
  border-bottom: 1px solid #dedbe0;
  align-items:  center;
  gap: 10px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 14px;
}

.historyDrawerHeader span {
  display: block;
  overflow: hidden;
  color: #6d6a70;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.historyDrawerHeader strong {
  display: block;
  overflow: hidden;
  color: #171717;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
}

.historyDrawerHeader button {
  display: grid;
  color: #171717;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  flex: none;
  place-items:  center;
  width: 38px;
  height: 38px;
}

.studioApp .historyDrawer .historyPanel {
  overflow-y: auto;
  background: none;
  border: 0;
  border-radius: 0;
  width: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
}

.studioApp .historyItem {
  box-shadow: none;
  border-color: #ece8ed;
  border-radius: 0;
}

.studioApp .historyItem button, .studioApp .historyToolbar button, .studioApp .historyFooter button {
  box-shadow: none;
  border: 0;
  border-radius: 8px;
}

.studioApp .historyToolbar {
  background: #fff;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 28px;
}

.studioApp .historyToolbar button {
  background: none;
  min-height: 48px;
}

.studioApp .historyList {
  background: #fff;
  padding: 8px 18px;
}

.studioApp .historyFooter {
  background: #fff;
}

.studioApp .activeTemplateCard, .studioApp .templatePreviewPanel, .studioApp .templateActionSummary {
  box-shadow: none;
  border: 1px solid #dedbe0;
  border-radius: 10px;
}

.studioApp .activeTemplateCard {
  display: flex;
  backdrop-filter: blur(16px);
  cursor: pointer;
  background: #f8f6f8d1;
  align-items:  center;
  gap: 10px;
  padding: 8px 10px;
}

.studioApp .activeTemplateCard img {
  object-fit: cover;
  border: none;
  border-radius: 8px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
}

.studioApp .activeTemplateGuide {
  color: #6d6a70;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
}

.studioApp .activeTemplateClear {
  display: flex;
  color: #9e9aa2;
  cursor: pointer;
  box-shadow: none;
  background: none;
  border: none;
  border-radius: 50%;
  flex-shrink: 0;
  justify-content: center;
  align-items:  center;
  width: 26px;
  height: 26px;
  padding: 0;
}

.studioApp .activeTemplateClear:hover {
  color: #3d3a40;
  background: #0000000f;
}

.studioApp .activeTemplateBody {
  align-content:  center;
  gap: 8px;
  min-width: 0;
}

.studioApp .activeTemplateMeta {
  min-width: 0;
}

.studioApp .activeTemplateMeta span {
  color: #6d6a70;
}

.studioApp .activeTemplateMeta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.25;
}

.studioApp .activeTemplateActions {
  flex-wrap: wrap;
  gap: 8px;
}

.studioApp .activeTemplateActions button {
  box-shadow: none;
  color: #171717;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 8px;
  min-height: 32px;
}

.studioApp .activeTemplateActions button.danger {
  color: #fff;
  background: #171717;
}

.templateFormSheetBackdrop {
  position: fixed;
  z-index: 66;
  display: flex;
  backdrop-filter: blur(8px);
  background: #12141142;
  justify-content: center;
  align-items:  flex-end;
  padding: 18px;
  inset: 0;
}

.templateFormSheet {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  animation: templateFormSheetIn .18s ease-out;
  background: #fffffff5;
  border: 1px solid #dedbe0;
  border-radius: 18px 18px 14px 14px;
  width: min(680px, 100%);
  max-height: min(78svh, 680px);
  box-shadow: 0 -18px 70px #1216102e;
}

.templateFormSheetGrabber {
  background: #d7d4d9;
  border-radius: 999px;
  width: 42px;
  height: 4px;
  margin: 10px auto 2px;
}

.templateFormSheetHeader {
  display: flex;
  border-bottom: 1px solid #dedbe0;
  justify-content: space-between;
  align-items:  center;
  gap: 14px;
  min-width: 0;
  padding: 12px 16px 14px;
}

.templateFormSheetHeader span {
  display: block;
  color: #6d6a70;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.templateFormSheetHeader strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.25;
}

.templateFormSheetHeader button {
  display: grid;
  color: #171717;
  cursor: pointer;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  flex: none;
  place-items:  center;
  width: 38px;
  height: 38px;
}

.templateFormSheetBody {
  overflow-y: auto;
  min-height: 0;
  padding: 16px;
}

.templateFormSheetBody .templateFieldGrid {
  grid-template-columns: 1fr;
}

.templateFormSheetBody .templateModeEmpty {
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  margin: 0;
  padding: 14px;
}

.templateFormSheetFooter {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  padding: 14px 16px max(16px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #dedbe0;
  gap: 10px;
}

.templateFreeEditButton, .templateDoneButton {
  cursor: pointer;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  min-height: 46px;
  font-weight: 850;
}

.templateFreeEditButton {
  color: #171717;
  background: #f8f6f8;
}

.templateDoneButton {
  color: #fff;
  background: #171717;
}

.studioApp .templateGuideNotice {
  box-shadow: none;
  color: #171717;
  background: #f8f6f8e6;
  border: 1px solid #dedbe0;
  border-radius: 10px;
}

.studioApp .templateComposerTabs {
  justify-content: flex-start;
}

.studioApp .templateModeToggle {
  color: #fff;
  background: #171717;
  border: 1px solid #dedbe0;
  border-radius: 999px;
  min-height: 34px;
  font-weight: 800;
}

.studioApp .templateModeToggle:hover {
  color: #fff;
  background: #000;
  border-color: #171717;
}

.studioApp .templateFieldGrid {
  grid-template-columns: 1fr;
}

.studioApp .templateField textarea, .studioApp .templateCustomField textarea, .studioApp .templatePreviewPanel textarea {
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 8px;
}

.studioApp .templatePreviewPanel textarea {
  max-height: 140px;
}

.studioApp .templatePreviewPanel {
  backdrop-filter: blur(14px);
  background: #ffffffd6;
  padding: 12px;
}

.studioApp .templatePreviewHeader strong {
  font-size: 13px;
}

.studioApp .templatePreviewHeader span, .studioApp .templateActionSummary span {
  color: #6d6a70;
  font-size: 12px;
}

.studioApp .templateActionRow {
  grid-template-columns: 44px minmax(0, 1fr) 46px;
  align-items:  end;
  gap: 8px;
}

.studioApp .templateActionSummary {
  background: #f8f6f8;
  min-height: 46px;
  padding: 9px 10px;
}

.studioApp .templateActionSummary strong {
  font-size: 12px;
}

.studioApp .composerActionControl small {
  color: #6d6a70;
}

.studioApp .draftPreviewSummary {
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 8px;
}

.studioSheetPanel {
  display: grid;
  background: #fff;
  gap: 14px;
  padding: 20px;
}

.studioSheetHeader {
  display: grid;
  place-items:  center;
  min-height: 44px;
  padding: 0 58px;
}

.studioSheetHeader strong {
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
  font-weight: 850;
  line-height: 1.2;
}

.studioApplySizeButton {
  color: #fff;
  cursor: pointer;
  background: #171717;
  border: 0;
  border-radius: 10px;
  min-height: 56px;
  font-size: 20px;
  font-weight: 850;
}

.channelActionSheet {
  width: min(480px, 100vw - 32px);
  max-height: min(680px, 100svh - 40px);
}

.channelActionSheet .studioSheetPanel {
  gap: 10px;
  padding: 16px;
}

.channelActionSheet .studioSheetHeader {
  min-height: 36px;
  padding: 0 52px;
}

.channelActionSheet .studioSheetHeader strong {
  font-size: 18px;
}

.channelActionSheet .supplierChannelCard {
  cursor: pointer;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  padding: 14px;
}

.channelActionSheet .supplierChannelCard:hover, .channelActionSheet .supplierChannelCard.active {
  background: #f8f6f8;
  border-color: #171717;
}

.studioApp .presetModal, .studioApp .walletModal, .studioApp .templateLibraryModal {
  border: 1px solid #dedbe0;
  border-radius: 14px;
  box-shadow: 0 24px 80px #12161033;
}

.studioApp .modalCloseButton {
  box-shadow: none;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
}

.studioApp .presetPanelHeader, .studioApp .templateLibraryHeader, .studioApp .templateSpotlightHeader {
  padding-right: 58px;
}

.studioApp .accountPanel {
  background: #fff;
  border: 0;
  margin: 0;
}

.studioApp .accountPanelHeader {
  border-bottom: 1px solid #dedbe0;
  padding: 16px 58px 16px 18px;
}

.studioApp .authCard {
  gap: 14px;
  padding-bottom: 18px;
}

.studioApp .authCard > :not(.panelHeader) {
  margin-left: 18px;
  margin-right: 18px;
}

.studioApp .presetModal.authModal .accountPanelHeader {
  padding: 16px 58px 16px 18px;
}

.studioApp .presetModal.authModal .accountPanel .authCard {
  padding: 12px 18px 24px;
}

.studioApp .presetModal.authModal .authCard > :not(.panelHeader) {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.studioApp .presetModal.authModal .fieldLabel input {
  width: 100%;
  height: 56px;
  font-size: 15px;
}

.studioApp .presetModal.authModal .authSubmit {
  display: flex;
  width: 100%;
  min-height: 56px;
  font-size: 15px;
}

.studioApp .authTabs button, .studioApp .fieldLabel input, .studioApp .authSubmit {
  box-shadow: none;
  border: 1px solid #dedbe0;
  border-radius: 8px;
}

.studioApp .authTabs button.active {
  background: #171717;
}

.studioApp .fieldLabel input {
  background: #f8f6f8;
  height: 48px;
}

.studioApp .authSubmit {
  color: #fff;
  background: #171717;
  min-height: 48px;
}

.studioApp .templateLibraryModal {
  background: #fff;
}

.studioApp .templateLibraryRail {
  background: #fff;
  border-color: #dedbe0;
}

.studioApp .templateLibraryCard {
  box-shadow: none;
  background: #fff;
  border: 1px solid #dedbe0;
  border-radius: 10px;
}

.studioApp .templateLibraryCard.active, .studioApp .templateLibraryCard:hover {
  box-shadow: none;
  background: #f8f6f8;
}

.studioApp .templateLibraryCard img, .studioApp .templateSpotlightCover img {
  border: 1px solid #dedbe0;
  border-radius: 8px;
}

.studioApp .templateSpotlightHeader {
  background: #fff;
  border-color: #dedbe0;
}

.studioApp .templateSpotlightCover {
  background: #f8f6f8;
  border-color: #dedbe0;
}

.studioApp .templateSpotlightMeta span, .studioApp .templateVariableChips span, .studioApp .templatePromptExcerpt {
  background: #fff;
  border-color: #dedbe0;
  border-radius: 8px;
}

.studioApp .templateApplyButton {
  box-shadow: none;
  background: #171717;
  border: 0;
  border-radius: 10px;
}

.studioSheetPanel .outputPanel {
  border: 0;
}

.studioSheetPanel .outputPanelHeader {
  display: none;
}

.studioSheetPanel .outputPanel.sheet {
  display: grid;
  gap: 18px;
}

.sizeModeTabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #f8f6f8;
  border: 1px solid #dedbe0;
  border-radius: 10px;
  gap: 6px;
  padding: 4px;
}

.sizeModeTabs button {
  color: #6b6568;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  font-size: 16px;
  font-weight: 850;
}

.sizeModeTabs button.active {
  color: #171717;
  background: #fff;
  box-shadow: 0 1px 3px #12161014;
}

.sizeModeHint {
  color: #6b6568;
  text-align: center;
  background: #f8f6f8;
  border-radius: 10px;
  margin: 0;
  padding: 18px 16px;
  font-size: 15px;
  line-height: 1.5;
}

.sizeModePanel {
  display: grid;
  gap: 18px;
}

.studioSheetPanel .sizeModeResolutionGrid {
  grid-template-columns: 1fr;
}

.studioSheetPanel .ratioTileField {
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
}

.studioSheetPanel .ratioTileHeader {
  display: none;
}

.studioSheetPanel .ratioTileGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow-x: visible;
  gap: 12px;
  padding: 2px 2px 6px;
}

.studioSheetPanel .ratioTileGrid.advanced {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.studioSheetPanel .ratioTile {
  border-radius: 10px;
  align-content:  center;
  min-width: 0;
  min-height: 134px;
  padding-left: 6px;
  padding-right: 6px;
}

.studioSheetPanel .ratioTile .ratioPreview {
  background: none;
  border: 0;
  width: 48px;
  height: 44px;
}

.studioSheetPanel .ratioTile strong {
  font-size: 18px;
}

.studioSheetPanel .ratioTile span:not(.ratioPreview):not(.ratioPreviewShape) {
  font-size: 14px;
}

.studioSheetPanel .ratioTile.active span:not(.ratioPreview):not(.ratioPreviewShape) {
  color: #171717;
}

.studioSheetPanel .outputGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
}

.studioSheetPanel .selectLabel, .studioSheetPanel .rangeLabel {
  color: #171717;
  gap: 9px;
  font-size: 16px;
  font-weight: 850;
}

.studioSheetPanel .selectLabel select, .studioSheetPanel .selectLabel input, .studioSheetPanel .selectLabel textarea {
  height: 50px;
  font-size: 16px;
}

.studioSheetPanel .rangeLabel {
  margin-top: 16px;
}

.studioMobileMenuBackdrop {
  position: fixed;
  z-index: 60;
  background: #0f120e6b;
  inset: 0;
}

.studioMobileMenu {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #fff;
  gap: 16px;
  width: min(320px, 86vw);
  height: 100%;
  padding: 16px 12px;
  box-shadow: 18px 0 50px #12161038;
}

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

.studioMobileMenuHeader button {
  display: grid;
  background: #f8f6f8;
  place-items:  center;
  width: 38px;
  height: 38px;
}

@media (width <= 1180px) {
  .studioApp {
    grid-template-columns: 232px minmax(0, 1fr) 320px;
  }

  .studioInspector {
    padding: 14px;
  }
}

@media (width <= 980px) {
  .studioApp {
    grid-template-columns: 1fr;
    min-height: 100svh;
  }

  .studioRail, .studioInspector, .studioConversationHeader {
    display: none;
  }

  .studioMain {
    height: 100svh;
  }

  .studioMobileTopbar {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px 42px;
    padding: max(10px, env(safe-area-inset-top)) 12px 8px;
    backdrop-filter: blur(16px);
    background: #fffffcf5;
    border-bottom: 1px solid #dedbe0;
    align-items:  center;
    gap: 10px;
  }

  .studioMobileTopbar--noFullscreen {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .studioMobileTopbar button {
    display: grid;
    background: #f8f6f8;
    place-items:  center;
    width: 42px;
    height: 42px;
  }

  .studioMobileTopbar div {
    display: grid;
    text-align: center;
    min-width: 0;
  }

  .studioMobileTopbar strong, .studioMobileTopbar span {
    white-space: nowrap;
  }

  .studioApp .announcementBanner {
    width: calc(100% - 24px);
    margin-top: 10px;
    padding: 10px 12px;
  }

  .studioApp .announcementBanner p {
    font-size: 12px;
    line-height: 1.45;
  }

  .studioConversation {
    padding: 12px 12px 16px;
  }

  .playbookRecommendations {
    width: 100%;
    padding: 8px 4px 2px;
  }

  .playbookRecommendationGrid {
    gap: 8px;
  }

  .playbookRecommendationCard {
    gap: 6px;
  }

  .playbookRecommendationCard strong {
    font-size: 11px;
  }

  .playbookRecommendationCard span {
    display: none;
  }

  .studioComposer {
    margin-bottom: max(10px, env(safe-area-inset-bottom));
    overflow-y: visible;
    border-radius: 14px;
    width: calc(100% - 20px);
    max-height: none;
    padding: 10px;
  }

  .studioComposer .draftTray {
    gap: 8px;
  }

  .studioComposer .draftPreviewList {
    display: flex;
    overflow-x: auto;
    overflow-y: clip;
    gap: 10px;
    padding: 8px 2px 2px;
  }

  .studioComposer .draftPreview {
    flex: 0 0 72px;
  }

  .studioInputRow {
    grid-template-columns: 42px minmax(0, 1fr) 44px;
  }

  .studioInputRow textarea {
    min-height: 44px;
    padding: 11px 14px;
    font-size: 14px;
  }

  .studioApp .iconButton {
    width: 42px;
    height: 42px;
  }

  .studioApp .sendButton {
    width: 44px;
    height: 44px;
  }

  .studioComposerMeta {
    overflow-x: auto;
    overflow-y: clip;
    flex-wrap: nowrap;
    min-height: 38px;
    padding: 3px 0 2px;
  }

  .studioComposerMeta button {
    flex: none;
    height: 32px;
  }

  .studioApp .bubble {
    max-width: 92%;
  }

  .studioApp .historyPanel {
    width: 100%;
    max-height: none;
    margin-top: 0;
  }

  .historyDrawerBackdrop {
    background: #12141133;
    align-items: stretch;
  }

  .historyDrawer {
    border-left: 0;
    width: 100vw;
  }

  .studioApp .historyDrawer .historyPanel {
    width: 100%;
    max-height: none;
    margin-top: 0;
    padding: 0;
  }

  .studioApp .historyItem {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .studioApp .historyItemMain {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .studioApp .historyItemMain img, .studioApp .historyItemThumbPlaceholder {
    width: 64px;
    height: 64px;
  }

  .studioApp .templateActionRow, .studioApp .inputRow {
    gap: 8px;
  }

  .studioApp .templateLibraryModal {
    overflow: hidden;
    width: 100vw;
    max-width: none;
    height: min(86svh, 760px);
    max-height: calc(100svh - 18px);
  }

  .studioApp .templateLibraryBackdrop {
    justify-items: stretch;
  }

  .studioApp .templateLibraryLayout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
  }

  .studioApp .templateLibraryRail {
    display: grid;
    grid-template-rows: auto auto;
    border-bottom: 1px solid #dedbe0;
    border-right: 0;
    gap: 12px;
    min-height: 0;
    padding: 18px 16px 12px;
  }

  .studioApp .templateLibraryList {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 0 2px 4px 0;
  }

  .studioApp .templateLibraryCard {
    grid-template-columns: 74px minmax(0, 1fr);
    flex: 0 0 min(300px, 78vw);
    min-height: 96px;
    padding: 10px;
  }

  .studioApp .templateLibraryCard strong {
    font-size: 16px;
  }

  .studioApp .templateLibraryCard p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    white-space: normal;
    -webkit-box-orient: vertical;
  }

  .studioApp .templateLibrarySpotlight {
    overflow: hidden;
    min-height: 0;
  }

  .studioApp .templateSpotlightHeader {
    padding: 14px 58px 14px 16px;
  }

  .studioApp .templateSpotlightTitleRow {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .studioApp .templateSpotlightTitleRow h3 {
    font-size: 18px;
  }

  .studioApp .templateApplyButton {
    min-height: 38px;
    padding: 0 12px;
  }

  .studioApp .templateSpotlightScroll {
    display: block;
    overflow-y: auto;
    height: 100%;
    min-height: 0;
  }

  .studioApp .templateSpotlightCover {
    border-bottom: 1px solid #dedbe0;
    border-right: 0;
    height: clamp(120px, 26svh, 170px);
  }

  .studioApp .templateSpotlightBody {
    overflow: visible;
    padding: 12px 16px 22px;
  }

  .dropUploadOverlay {
    border-radius: 12px;
    gap: 8px;
    inset: 8px;
  }

  .dropUploadOverlay strong {
    font-size: 15px;
  }
}

@media (width <= 560px) {
  .studioApp {
    min-width: 320px;
  }

  .studioApp .bubble p {
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.55;
  }

  .studioApp .messageRetryPanel {
    margin: 0 12px 12px;
  }

  .studioApp .imageFrame img {
    width: min(100%, 300px);
    max-height: 34svh;
  }

  .studioApp .forgeLoader {
    grid-template-columns: 70px minmax(0, 1fr);
    min-height: 108px;
  }

  .studioApp .spriteMascot {
    width: 68px !important;
  }

  .studioApp .activeTemplateCard {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 10px;
  }

  .studioApp .activeTemplateActions button {
    flex: 88px;
  }

  .studioApp .templatePreviewPanel textarea {
    max-height: 112px;
  }

  .studioApp .templateLibraryModal, .studioApp .presetModal:not(.authModal), .studioApp .walletModal {
    border-width: 1px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -18px 52px #12161033;
  }

  .studioApp .modalBackdrop {
    align-items:  end;
    padding: 0;
  }

  .studioApp .modalBackdrop:has(.authModal) {
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
    place-items:  center;
  }

  .studioApp .presetModal.authModal {
    border-radius: 14px;
    width: min(480px, 100vw - 32px);
    max-height: min(720px, 100svh - 48px);
    box-shadow: 0 24px 80px #12161033;
  }

  .studioApp .presetModal.authModal .accountPanelHeader {
    padding: 16px 52px 16px 18px;
  }

  .studioApp .presetModal.authModal .accountPanel .authCard {
    padding: 12px 18px 24px;
  }

  .studioSheetPanel {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .studioSheetPanel .outputGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 14px;
  }

  .studioSheetPanel .ratioTileGrid {
    gap: 10px;
  }

  .studioSheetPanel .ratioTile {
    min-height: 132px;
  }

  .studioSheetPanel .ratioTile .ratioPreview {
    width: 42px;
    height: 40px;
  }

  .studioSheetPanel .ratioTile strong {
    font-size: 16px;
  }

  .studioSheetPanel .ratioTile span:not(.ratioPreview):not(.ratioPreviewShape) {
    font-size: 12px;
  }
}
