:where(.hidden) { display: none !important; }
:where(.block) { display: block; }
:where(.inline-block) { display: inline-block; }
:where(.inline-flex) { display: inline-flex; }
:where(.flex) { display: flex; }
:where(.grid) { display: grid; }
:where(.relative) { position: relative; }
:where(.absolute) { position: absolute; }
:where(.fixed) { position: fixed; }
:where(.sticky) { position: sticky; }
:where(.inset-0) { inset: 0; }
:where(.bottom-4) { bottom: 1rem; }
:where(.right-4) { right: 1rem; }
:where(.z-\[100\]) { z-index: 100; }
:where(.mx-auto) { margin-left: auto; margin-right: auto; }
:where(.mb-1) { margin-bottom: .25rem; }
:where(.mb-2) { margin-bottom: .5rem; }
:where(.mb-3) { margin-bottom: .75rem; }
:where(.mb-4) { margin-bottom: 1rem; }
:where(.mb-6) { margin-bottom: 1.5rem; }
:where(.mt-1) { margin-top: .25rem; }
:where(.mt-2) { margin-top: .5rem; }
:where(.mt-3) { margin-top: .75rem; }
:where(.mt-4) { margin-top: 1rem; }
:where(.mt-5) { margin-top: 1.25rem; }
:where(.p-2) { padding: .5rem; }
:where(.p-3) { padding: .75rem; }
:where(.p-4) { padding: 1rem; }
:where(.p-5) { padding: 1.25rem; }
:where(.px-3) { padding-left: .75rem; padding-right: .75rem; }
:where(.px-4) { padding-left: 1rem; padding-right: 1rem; }
:where(.px-5) { padding-left: 1.25rem; padding-right: 1.25rem; }
:where(.py-2) { padding-top: .5rem; padding-bottom: .5rem; }
:where(.py-3) { padding-top: .75rem; padding-bottom: .75rem; }
:where(.py-5) { padding-top: 1.25rem; padding-bottom: 1.25rem; }
:where(.py-6) { padding-top: 1.5rem; padding-bottom: 1.5rem; }
:where(.gap-2) { gap: .5rem; }
:where(.gap-3) { gap: .75rem; }
:where(.gap-4) { gap: 1rem; }
:where(.gap-5) { gap: 1.25rem; }
:where(.gap-6) { gap: 1.5rem; }
:where(.space-y-3 > * + *) { margin-top: .75rem; }
:where(.space-y-4 > * + *) { margin-top: 1rem; }
:where(.space-y-6 > * + *) { margin-top: 1.5rem; }
:where(.min-h-screen) { min-height: 100vh; }
:where(.min-h-\[7rem\]) { min-height: 7rem; }
:where(.min-h-\[10rem\]) { min-height: 10rem; }
:where(.h-5) { height: 1.25rem; }
:where(.h-7) { height: 1.75rem; }
:where(.h-\[2\.65rem\]) { height: 2.65rem; }
:where(.h-\[2\.7rem\]) { height: 2.7rem; }
:where(.w-5) { width: 1.25rem; }
:where(.w-7) { width: 1.75rem; }
:where(.w-full) { width: 100%; }
:where(.max-w-sm) { max-width: 24rem; }
:where(.max-w-3xl) { max-width: 48rem; }
:where(.max-w-4xl) { max-width: 56rem; }
:where(.max-w-\[5\.4rem\]) { max-width: 5.4rem; }
:where(.max-w-\[1680px\]) { max-width: 1680px; }
:where(.max-h-72) { max-height: 18rem; }
:where(.flex-1) { flex: 1 1 0%; }
:where(.shrink-0) { flex-shrink: 0; }
:where(.flex-col) { flex-direction: column; }
:where(.flex-wrap) { flex-wrap: wrap; }
:where(.items-start) { align-items: flex-start; }
:where(.items-center) { align-items: center; }
:where(.items-end) { align-items: flex-end; }
:where(.justify-center) { justify-content: center; }
:where(.justify-between) { justify-content: space-between; }
:where(.self-start) { align-self: flex-start; }
:where(.overflow-auto) { overflow: auto; }
:where(.overflow-scroll) { overflow: scroll; }
:where(.break-words) { overflow-wrap: break-word; }
:where(.whitespace-pre-wrap) { white-space: pre-wrap; }
:where(.cursor-pointer) { cursor: pointer; }
:where(.select-none) { user-select: none; }
:where(.list-none) { list-style: none; }
:where(.text-left) { text-align: left; }
:where(.text-center) { text-align: center; }
:where(.antialiased) { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
:where(.font-mono) { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
:where(.font-semibold) { font-weight: 650; }
:where(.font-bold) { font-weight: 760; }
:where(.font-extrabold) { font-weight: 820; }
:where(.font-black) { font-weight: 900; }
:where(.italic) { font-style: italic; }
:where(.underline) { text-decoration-line: underline; }
:where(.line-through) { text-decoration-line: line-through; }
:where(.uppercase) { text-transform: uppercase; }
:where(.tracking-tight) { letter-spacing: 0; }
:where(.tracking-\[0\.18em\]) { letter-spacing: .18em; }
:where(.tracking-\[0\.2em\]) { letter-spacing: .2em; }
:where(.leading-5) { line-height: 1.25rem; }
:where(.leading-6) { line-height: 1.5rem; }
:where(.leading-1, .leading-none) { line-height: 1; }
:where(.text-\[10px\]) { font-size: 10px; }
:where(.text-xs) { font-size: .75rem; line-height: 1rem; }
:where(.text-sm) { font-size: .875rem; line-height: 1.25rem; }
:where(.text-base) { font-size: 1rem; line-height: 1.5rem; }
:where(.text-lg) { font-size: 1.125rem; line-height: 1.75rem; }
:where(.text-2xl) { font-size: 1.5rem; line-height: 2rem; }
:where(.text-white) { color: #fff; }
:where(.rounded-full) { border-radius: 999px; }
:where(.rounded-xl) { border-radius: .75rem; }
:where(.rounded-2xl) { border-radius: 1rem; }
:where(.rounded-3xl) { border-radius: 1.5rem; }
:where(.rounded-\[1\.75rem\]) { border-radius: 1.75rem; }
:where(.border) { border-width: 1px; border-style: solid; }
:where(.border-0) { border-width: 0; }
:where(.shadow-2xl) { box-shadow: 0 25px 50px rgba(15,23,42,.18); }
:where(.backdrop-blur-md) { backdrop-filter: blur(12px); }

@media (min-width: 640px) {
  :where(.sm\:px-6) { padding-left: 1.5rem; padding-right: 1.5rem; }
  :where(.sm\:py-6) { padding-top: 1.5rem; padding-bottom: 1.5rem; }
  :where(.sm\:p-5) { padding: 1.25rem; }
  :where(.sm\:grid-cols-2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :where(.sm\:grid-cols-3) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :where(.sm\:grid-cols-4) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :where(.sm\:col-span-2) { grid-column: span 2 / span 2; }
  :where(.sm\:flex-row) { flex-direction: row; }
  :where(.sm\:items-end) { align-items: flex-end; }
  :where(.sm\:justify-between) { justify-content: space-between; }
  :where(.sm\:text-3xl) { font-size: 1.875rem; line-height: 2.25rem; }
}

@media (min-width: 1024px) {
  :where(.lg\:px-8) { padding-left: 2rem; padding-right: 2rem; }
  :where(.lg\:py-8) { padding-top: 2rem; padding-bottom: 2rem; }
  :where(.lg\:flex-row) { flex-direction: row; }
  :where(.lg\:items-start) { align-items: flex-start; }
  :where(.lg\:items-center) { align-items: center; }
  :where(.lg\:items-end) { align-items: flex-end; }
  :where(.lg\:justify-between) { justify-content: space-between; }
  :where(.lg\:grid-cols-2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  :where(.xl\:flex-row) { flex-direction: row; }
  :where(.xl\:items-start) { align-items: flex-start; }
  :where(.xl\:items-end) { align-items: flex-end; }
  :where(.xl\:justify-between) { justify-content: space-between; }
  :where(.xl\:grid-cols-2) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :where(.xl\:grid-cols-3) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  :where(.xl\:grid-cols-4) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  :where(.xl\:w-\[320px\]) { width: 320px; }
  :where(.xl\:w-\[430px\]) { width: 430px; }
  :where(.xl\:text-\[2rem\]) { font-size: 2rem; line-height: 2.35rem; }
}

:root {
  color-scheme: light;
  --page: #f3f6fb;
  --page-2: #e9eef6;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --surface-raised: #ffffff;
  --ink: #19202d;
  --ink-soft: #313b4b;
  --muted: #667084;
  --line: #d9e2ee;
  --line-strong: #bcc9d8;
  --accent: #f59e0b;
  --accent-2: #0f9f9a;
  --accent-3: #4157c8;
  --success: #0f9f6e;
  --danger: #d92d4b;
  --warning: #c26a00;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 16px 38px rgba(33, 43, 63, .10);
  --shadow-hover: 0 20px 44px rgba(33, 43, 63, .16);
}

html.dark {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,0) 260px),
    linear-gradient(135deg, #f8fafc 0%, var(--page) 48%, var(--page-2) 100%) !important;
  color: var(--ink) !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html {
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(25, 32, 45, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 32, 45, .035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), rgba(0,0,0,.18));
}

::selection {
  background: rgba(245, 158, 11, .24);
  color: var(--ink);
}

body > .mx-auto {
  max-width: 1540px !important;
}

[class*="rounded-\\[1\\.75rem\\]"],
[class*="rounded-3xl"],
[class*="rounded-2xl"] {
  border-radius: var(--radius) !important;
}

.glass-card,
.template-card,
.table-cell {
  border-radius: var(--radius) !important;
}

.glass-card {
  background: rgba(255, 255, 255, .96) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
  color: var(--ink) !important;
  backdrop-filter: saturate(150%) blur(8px);
}

header.glass-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(20, 25, 36, .98), rgba(32, 43, 60, .98)) !important;
  border-color: rgba(255,255,255,.12) !important;
  color: #f8fafc !important;
}

header.glass-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
}

header.glass-card h1,
header.glass-card .text-white,
header.glass-card .text-slate-100,
header.glass-card .text-slate-200 {
  color: #ffffff !important;
}

header.glass-card p,
header.glass-card .text-slate-300,
header.glass-card .text-slate-400 {
  color: #c8d2df !important;
}

header.glass-card [class*="bg-slate-950"],
header.glass-card [class*="bg-slate-900"] {
  background: rgba(9, 14, 24, .52) !important;
  border-color: rgba(255,255,255,.10) !important;
}

body .text-white,
body .text-slate-100,
body .text-slate-200 {
  color: var(--ink) !important;
}

body .text-slate-300,
body .text-slate-400 {
  color: var(--muted) !important;
}

body .text-slate-600 {
  color: #a7b0bf !important;
}

[class*="border-slate-"] {
  border-color: var(--line) !important;
}

[class*="bg-slate-950"],
[class*="bg-slate-900"],
[class*="bg-slate-800"] {
  background: var(--surface-muted) !important;
}

.chip {
  min-height: 1.7rem;
  border: 1px solid var(--line) !important;
  background: #f7f9fd !important;
  color: var(--ink-soft) !important;
  font-size: .74rem;
  font-weight: 760;
  box-shadow: none !important;
}

.chip.border-amber-500\/30,
.chip.bg-amber-500\/10 {
  border-color: rgba(245, 158, 11, .36) !important;
  background: #fff7e8 !important;
  color: #8a5200 !important;
}

.chip.border-emerald-500\/25,
.chip.bg-emerald-500\/10,
.chip.text-emerald-200 {
  border-color: rgba(15, 159, 110, .28) !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
}

.chip.border-rose-400\/20,
.chip.border-rose-500\/30,
.chip.bg-rose-500\/10,
.chip.text-rose-100 {
  border-color: rgba(217, 45, 75, .25) !important;
  background: #fff1f3 !important;
  color: #b4233d !important;
}

.tool-btn,
.pixel-btn {
  min-height: 2.45rem;
  border-radius: var(--radius) !important;
  border: 1px solid var(--line-strong) !important;
  background: linear-gradient(180deg, #ffffff, #f6f8fb) !important;
  color: var(--ink) !important;
  font-weight: 760;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .04) !important;
}

.tool-btn:hover:not(:disabled),
.pixel-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(15, 159, 154, .52) !important;
  background: #ffffff !important;
  box-shadow: 0 10px 22px rgba(33, 43, 63, .12) !important;
}

.tool-btn:focus-visible,
.pixel-btn:focus-visible,
.tool-input:focus-visible,
.tool-select:focus-visible,
.tool-textarea:focus-visible,
#bbcodeEditor:focus-visible,
#visualEditor:focus-visible {
  outline: 3px solid rgba(15, 159, 154, .22);
  outline-offset: 2px;
}

#copyBtn {
  background: linear-gradient(180deg, #1e293b, #111827) !important;
  border-color: #111827 !important;
  color: #ffffff !important;
}

#downloadBtn,
#importToggleBtn {
  background: #ffffff !important;
}

#clearBtn {
  border-color: rgba(217, 45, 75, .34) !important;
  background: #fff1f3 !important;
  color: #b4233d !important;
}

.toolbar-action {
  min-width: 2.55rem;
}

.tool-input,
.tool-select,
.tool-textarea {
  min-width: 0;
  border-radius: var(--radius) !important;
  border: 1px solid var(--line-strong) !important;
  background: #ffffff !important;
  color: var(--ink) !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04) !important;
}

.tool-input::placeholder,
.tool-textarea::placeholder,
#bbcodeEditor::placeholder {
  color: #98a2b3;
}

.tool-input:focus,
.tool-select:focus,
.tool-textarea:focus {
  border-color: var(--accent-2) !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 4px rgba(15, 159, 154, .12) !important;
}

input[type="color"].tool-input {
  flex: 0 0 4.6rem;
  padding: .38rem !important;
  border-radius: var(--radius) !important;
}

.flex > .tool-input:not([type="color"]),
.flex > .tool-select,
.flex > .tool-textarea {
  flex: 1 1 0;
}

.grid > *,
.flex > * {
  min-width: 0;
}

.progress-track {
  height: .55rem;
  border: 1px solid #d5dde8 !important;
  background: #eef2f7 !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .06);
}

.progress-fill {
  background: linear-gradient(90deg, var(--success), var(--accent-2)) !important;
}

.tiny-kbd {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
  color: #334155 !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .05);
}

.tooltip .tip {
  border-color: rgba(25, 32, 45, .14) !important;
  background: rgba(255, 255, 255, .98) !important;
  color: var(--ink-soft) !important;
  box-shadow: 0 18px 38px rgba(33, 43, 63, .16) !important;
}

.signature-shell {
  border-radius: var(--radius) !important;
  border: 1px solid #c7d0dd !important;
  background:
    linear-gradient(180deg, #ffffff, #f9fbfe) !important;
  padding: .9rem 1rem;
  box-shadow: 0 8px 20px rgba(33, 43, 63, .08), inset 0 1px 0 rgba(255,255,255,.8) !important;
}

.post-divider {
  background: linear-gradient(90deg, rgba(116, 128, 150, .18), rgba(116, 128, 150, .7), rgba(116, 128, 150, .18)) !important;
}

#visualEditor,
.sig-render {
  color: #202938 !important;
}

#visualEditor {
  caret-color: var(--accent-2) !important;
}

#visualEditor:empty::before {
  color: #7b8798 !important;
}

.sig-render td,
#visualEditor td {
  border-color: rgba(102, 112, 132, .28) !important;
}

.sig-render a,
#visualEditor a {
  color: #1663c7 !important;
}

.sig-fade {
  background: linear-gradient(180deg, rgba(249,251,254,0), rgba(249,251,254,.98)) !important;
}

.height-line {
  border-top-color: rgba(217, 45, 75, .7) !important;
}

.height-tag {
  border-color: rgba(217, 45, 75, .35) !important;
  background: #b4233d !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(217, 45, 75, .18) !important;
}

#bbcodeEditor {
  min-height: 19rem;
  border-radius: var(--radius) !important;
  border: 1px solid #172033 !important;
  background:
    linear-gradient(180deg, rgba(17, 24, 39, .98), rgba(11, 18, 32, .98)) !important;
  color: #e5eefb !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 28px rgba(33,43,63,.12) !important;
}

#bbcodeEditor:focus {
  border-color: rgba(15, 159, 154, .68) !important;
  box-shadow: 0 0 0 4px rgba(15, 159, 154, .16), 0 12px 28px rgba(33,43,63,.14) !important;
}

.template-card {
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 8px 22px rgba(33, 43, 63, .06) !important;
}

.template-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 159, 154, .42) !important;
  box-shadow: var(--shadow-hover) !important;
}

.table-cell {
  border-color: var(--line) !important;
  background: #f8fafc !important;
}

#warningPanel {
  border-color: rgba(245, 158, 11, .32) !important;
  background: #fff8eb !important;
}

#warningPanel .text-amber-100,
#warningPanel .text-amber-50\/90 {
  color: #7a4600 !important;
}

#overflowCard,
[class*="bg-rose-950"] {
  border-color: rgba(217, 45, 75, .22) !important;
  background: #fff5f6 !important;
}

#overflowCard .text-rose-100,
#overflowCard .text-rose-50\/85 {
  color: #9f1f36 !important;
}

.toast {
  border-radius: var(--radius) !important;
  border-color: rgba(15, 159, 110, .30) !important;
  background: #ecfdf5 !important;
  color: #047857 !important;
  box-shadow: 0 18px 38px rgba(33, 43, 63, .18) !important;
}

.control-panel__body {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.control-panel__main {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  align-items: start;
}

.metric-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
  align-items: stretch;
}

.metric-card {
  min-width: 0;
}

.metric-card > .mb-2 {
  flex-wrap: wrap;
  row-gap: .35rem;
  letter-spacing: .16em;
}

.metric-card > .flex {
  align-items: flex-start !important;
  gap: .75rem !important;
}

#charCounter,
#heightCounter {
  white-space: nowrap;
  font-size: clamp(1.35rem, 1.9vw, 1.85rem) !important;
  line-height: 1.05 !important;
}

#charDetail,
#heightCounter + .mt-1 {
  max-width: 14rem;
}

#charState,
#heightState {
  flex-shrink: 0;
}

.control-actions {
  display: grid !important;
  width: 100% !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)) !important;
  align-self: start;
}

.control-actions .tool-btn {
  white-space: nowrap;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-top: 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .72);
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(33, 43, 63, .06);
}

.app-footer__brand {
  color: var(--ink);
  font-size: .95rem;
  font-weight: 820;
}

.app-footer__identity {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-width: 0;
}

.app-footer__logo {
  width: 104px;
  height: 70px;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: transparent;
}

.app-footer__copy {
  margin: .2rem 0 0;
  max-width: 42rem;
  font-size: .86rem;
  line-height: 1.45;
}

.app-footer__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.scroll-thin,
#bbcodeEditor,
#visualEditor,
.tool-textarea,
.overflow-scroll {
  scrollbar-color: #aeb9c8 #edf2f7;
}

.scroll-thin::-webkit-scrollbar-track,
#bbcodeEditor::-webkit-scrollbar-track,
#visualEditor::-webkit-scrollbar-track,
.tool-textarea::-webkit-scrollbar-track,
.overflow-scroll::-webkit-scrollbar-track {
  background: #edf2f7 !important;
}

.scroll-thin::-webkit-scrollbar-thumb,
#bbcodeEditor::-webkit-scrollbar-thumb,
#visualEditor::-webkit-scrollbar-thumb,
.tool-textarea::-webkit-scrollbar-thumb,
.overflow-scroll::-webkit-scrollbar-thumb {
  background: #aeb9c8 !important;
}

#bbcodeEditor::-webkit-scrollbar-track {
  background: #111827 !important;
}

#bbcodeEditor::-webkit-scrollbar-thumb {
  background: #475467 !important;
}

aside.\\32xl\\:sticky {
  top: 1.25rem !important;
}

#topEditorPreview > div,
#lowerContentGrid > section,
#lowerContentGrid > aside {
  min-width: 0;
}

.right-work-pane {
  align-self: start;
}

.sticky-preview-card {
  align-self: start;
}

@media (min-width: 1024px) {
  header.glass-card > div {
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
  }

  header.glass-card > div > div:first-child {
    max-width: 54rem !important;
  }

  header.glass-card > div > div:last-child {
    width: 430px !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #topEditorPreview {
    display: grid !important;
    grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr) !important;
    align-items: start;
  }

  .right-work-pane {
    position: sticky;
    top: 1rem;
    align-self: start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: .15rem;
    z-index: 10;
  }

  #toolbarButtons + .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #toolbarButtons + .grid + .grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
  }

  #toolbarButtons + .grid > div,
  #toolbarButtons + .grid + .grid > div {
    min-width: 0;
  }

  #lowerContentGrid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.18fr) minmax(340px, .82fr) !important;
    align-items: start;
  }
}

@media (max-width: 900px) {
  body,
  body > .mx-auto,
  header.glass-card,
  .glass-card,
  main,
  #topEditorPreview,
  #lowerContentGrid {
    width: 100% !important;
    max-width: 100% !important;
  }

  body > .mx-auto {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  header.glass-card {
    padding: 1.2rem !important;
  }

  header.glass-card h1 {
    font-size: 1.85rem !important;
    line-height: 1.08 !important;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  header.glass-card .chip {
    max-width: 100%;
    white-space: normal;
    line-height: 1.2;
  }

  .glass-card {
    padding: 1rem !important;
  }

  #topEditorPreview,
  #lowerContentGrid,
  main {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .control-panel__body,
  .control-panel__main,
  .metric-grid,
  .control-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .right-work-pane {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
    order: -1;
  }

  .sticky-preview-card {
    position: static;
  }

  #toolbarButtons {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tool-btn {
    min-height: 2.55rem;
    min-width: 0;
    padding-left: .55rem;
    padding-right: .55rem;
  }

  #bbcodeEditor {
    min-height: 15rem;
  }

  .signature-shell {
    padding: .75rem;
  }

  .tooltip .tip {
    display: none;
  }

  .tooltip:hover .tip,
  .tooltip:focus-within .tip {
    display: block;
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    width: auto;
    transform: none;
  }

  .app-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .app-footer__identity {
    align-items: flex-start;
  }

  .app-footer__logo {
    width: 88px;
    height: 60px;
  }

  .app-footer__meta {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}
