:root {
  --ink: #1d2430;
  --muted: #667085;
  --line: #e6e8ec;
  --surface: #ffffff;
  --soft: #f7f8fa;
  --soft-2: #eef1f5;
  --brand: #2f5f8f;
  --brand-strong: #23486d;
  --accent: #8a94a6;
  --sidebar: #fbfcfd;
  --danger: #b53232;
  --ok: #247a54;
  --shadow: 0 18px 45px rgba(20, 30, 45, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a { color: inherit; }

button, .button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 11px 15px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

button:disabled {
  cursor: wait;
  opacity: .72;
}

.generate-submit {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.generate-submit.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .38);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}

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

.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

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

.sidebar {
  background: var(--sidebar);
  color: var(--ink);
  padding: 26px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid var(--line);
}

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

.brand.compact { margin-bottom: 28px; }

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #1f2937;
  padding: 9px;
}

.brand-mark img {
  width: 24px;
  height: 24px;
  display: block;
  object-fit: contain;
}

.brand small, .topbar small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-account-menu {
  display: none;
}

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

.nav a {
  color: #344054;
  text-decoration: none;
}

.nav-link,
.nav-section {
  padding: 10px 12px;
  border-radius: 8px;
}

.nav-section {
  color: #98a2b3;
  font-size: 12px;
  text-transform: uppercase;
  margin-top: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}

.nav-link {
  display: block;
  border: 1px solid transparent;
}

.nav-link:hover,
.nav-sub a:hover,
.nav-tool-head:hover {
  background: #f0f3f7;
}

.nav-link.is-active,
.nav-sub a.is-active {
  background: #eaf1f8;
  border-color: #cfdbe8;
  color: #1f3c5d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
}

.nav-tool {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 4px;
}

.nav-tool.is-open {
  background: #f7f9fb;
  border-color: #e1e6ed;
}

.nav-tool-head {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.nav-tool-head.is-active {
  color: #203a57;
  background: #fff;
  border-color: #dfe6ee;
}

.nav-tool-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #dfe7f0;
  color: #294766;
  font-size: 11px;
  font-weight: 800;
}

.nav-tool-head strong {
  display: block;
  font-size: 14px;
}

.nav-tool-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.nav-sub {
  display: grid;
  gap: 3px;
  margin: 5px 0 2px 16px;
  padding-left: 15px;
  border-left: 1px solid #d9e0e8;
}

.nav-sub a {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  color: #475467;
  font-size: 14px;
}

.main {
  padding: 34px;
  max-width: 1280px;
  width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.account-menu {
  position: relative;
}

.account-trigger {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  min-width: 214px;
  padding: 7px 9px;
  border-radius: 8px;
  border-color: #e2e8ef;
  background: #fff;
  text-align: left;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  background: #f7f9fb;
  border-color: #cfdbe8;
}

.account-trigger:focus {
  outline: none;
}

.account-trigger:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 95, 143, .12);
}

.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e6edf5;
  color: #294766;
  font-size: 12px;
  font-weight: 800;
}

.account-copy {
  display: grid;
  gap: 1px;
}

.account-copy strong {
  font-size: 14px;
  font-weight: 700;
}

.account-copy small {
  margin-top: 0;
  font-size: 12px;
  font-weight: 400;
}

.account-caret {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid #667085;
  border-bottom: 1.5px solid #667085;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}

.account-trigger[aria-expanded="true"] .account-caret {
  transform: rotate(225deg) translateY(-1px);
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 240px;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.account-summary {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.account-summary strong,
.account-summary small {
  display: block;
}

.account-summary strong {
  font-size: 14px;
  font-weight: 700;
}

.account-summary small {
  color: var(--muted);
  margin-top: 4px;
  font-size: 12px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.account-dropdown a,
.account-dropdown button {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #344054;
  padding: 9px 10px;
  text-decoration: none;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
  background: #f2f5f8;
}

.account-dropdown .is-disabled {
  color: #98a2b3;
  font-weight: 500;
  cursor: default;
}

.account-dropdown .is-disabled:hover {
  background: transparent;
}

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

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 32px; margin-bottom: 8px; letter-spacing: 0; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { color: var(--muted); line-height: 1.55; }

.panel, .metric, .admin-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

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

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

.tool-card {
  min-height: 230px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  text-decoration: none;
  display: grid;
  gap: 12px;
  align-content: start;
  position: relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: #cfd5dd;
  box-shadow: var(--shadow);
}

.tool-status {
  justify-self: start;
  border: 1px solid #d7dce3;
  background: #fff;
  color: #475467;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #e8eef5;
  color: #294766;
  font-weight: 800;
  margin-top: 12px;
}

.tool-card strong {
  font-size: 20px;
}

.tool-card p {
  margin-bottom: 0;
}

.metric span { color: var(--muted); }
.metric strong { display: block; font-size: 34px; margin-top: 8px; }

.panel-head, .row.spread {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.panel-head h2,
.row.spread h3 {
  margin-bottom: 0;
}

.form, .stack {
  display: grid;
  gap: 18px;
}

.generator-form {
  display: grid;
  gap: 26px;
}

.adapt-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.adapt-form label {
  min-width: min(360px, 100%);
}

.generator-form .panel {
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 18px;
  row-gap: 22px;
}

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

label {
  display: grid;
  gap: 12px;
  font-weight: 700;
  line-height: 1.25;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 15px;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  background: #fff;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 48px;
}

input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 0;
  accent-color: var(--brand);
}

input[type="file"] {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  background: #fff;
}

input[type="file"]::file-selector-button {
  border: 1px solid #d8e0e9;
  border-radius: 7px;
  background: #f6f8fb;
  color: #344054;
  padding: 8px 11px;
  margin-right: 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: #edf2f7;
}

textarea {
  resize: vertical;
  line-height: 1.55;
  min-height: 132px;
}

input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
  color: #6f7784;
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #b5beca;
  box-shadow: 0 0 0 3px rgba(47, 95, 143, .09);
}

.article-panel {
  display: grid;
  gap: 24px;
}

.article-panel textarea {
  min-height: 340px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.form > button {
  justify-self: start;
}

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

.section-title h2 {
  margin-bottom: 5px;
}

.section-title p {
  margin-bottom: 0;
}

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

.style-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  min-height: 176px;
  cursor: pointer;
  display: grid;
  gap: 11px;
  align-content: start;
  position: relative;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.style-card[hidden] {
  display: none;
}

.style-card:hover {
  border-color: #bcc3cc;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.style-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.style-card:has(input:checked) {
  border-color: #202733;
  box-shadow: 0 0 0 2px rgba(32, 39, 51, .12), var(--shadow);
}

.style-preview {
  height: 138px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, #f7f8fa 0%, #e9edf1 100%);
  border: 1px solid #e1e5ea;
  display: block;
  overflow: hidden;
  position: relative;
}

.style-preview.has-image {
  background: #eef1f5;
}

.style-preview.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.style-preview.has-image::before,
.style-preview.has-image::after {
  content: none;
}

.style-preview::before,
.style-preview::after,
.style-preview span {
  content: "";
  position: absolute;
  background: #cdd3db;
  border-radius: 4px;
}

.style-preview::before {
  width: 44%;
  height: 48%;
  left: 12px;
  bottom: 12px;
}

.style-preview::after {
  width: 28%;
  height: 62%;
  right: 12px;
  bottom: 12px;
}

.style-preview span {
  width: 34%;
  height: 8px;
  left: 12px;
  top: 14px;
  background: #aeb6c1;
}

.style-card strong {
  font-size: 15px;
}

.style-card small {
  color: var(--muted);
  line-height: 1.4;
  font-weight: 400;
}

.checks {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.checks input { width: auto; }

.inline-checks {
  display: grid;
  gap: 8px;
}

.inline-checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.inline-checks input { width: auto; }

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

.recent-work-panel .panel-head {
  margin-bottom: 18px;
}

.thumb, .company-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.thumb div, .company-card { padding: 14px; }
.thumb small, .company-card span { display: block; color: var(--muted); margin-top: 4px; }

.linked-card {
  display: grid;
  gap: 6px;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.linked-card:hover {
  border-color: #cfd8e3;
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.linked-card p {
  margin: 6px 0 0;
}

.linked-card small {
  color: var(--brand);
  font-weight: 700;
}

.history-list { display: grid; gap: 16px; }
.history-item {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.history-image {
  min-height: 150px;
  background: var(--soft);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  align-self: start;
}

.history-image img {
  width: 100%;
  height: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
}

.history-meta,
.meta-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 12px 0 0;
}

.history-meta div,
.meta-list div {
  display: grid;
  gap: 3px;
}

.history-meta dt,
.meta-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-meta dd,
.meta-list dd {
  margin: 0;
  color: var(--ink);
}

.result-panel {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, .9fr);
  gap: 24px;
}

.result-preview {
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.result-preview img {
  width: 100%;
  display: block;
}

.result-details {
  display: grid;
  align-content: start;
  gap: 18px;
}

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

.button-row form {
  display: contents;
}

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

.table-actions form {
  display: inline-flex;
}

.compact-button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.danger-button {
  color: var(--danger);
  border-color: #efc7c7;
  background: #fff8f8;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid #d7dce3;
  border-radius: 999px;
  padding: 3px 8px;
  color: #475467;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.status-pill.is-ok {
  color: var(--ok);
  border-color: #c9ead9;
  background: #effaf5;
}

.status-pill.is-muted {
  color: #667085;
  background: #f4f6f8;
}

.download-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.history-actions {
  display: grid;
  grid-template-columns: 132px 130px;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  justify-self: end;
}

.history-open {
  grid-column: 1 / -1;
  justify-content: center;
  width: 100%;
}

.history-download-control {
  display: contents;
}

.history-download-control select,
.history-download-control .button {
  width: 100%;
}

.subtle-button {
  background: #f8fafc;
  color: #475467;
  border-color: #e1e6ed;
  font-weight: 600;
}

.is-disabled-button {
  cursor: default;
  opacity: .68;
  pointer-events: none;
}

.download-control select {
  width: auto;
  min-width: 86px;
  min-height: 42px;
  padding: 9px 30px 9px 11px;
  font-size: 14px;
  font-weight: 700;
}

.download-control .button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
}

.filter-panel {
  padding: 18px 24px;
}

.filter-form {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-form label {
  min-width: min(360px, 100%);
}

details { margin-top: 12px; }
pre {
  white-space: pre-wrap;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 12px; }
th { color: var(--muted); font-size: 13px; }

.layout-builder { display: grid; gap: 12px; }
.layout-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  align-items: start;
}

.preset-editor {
  display: grid;
  gap: 16px;
}

.preset-edit-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.preset-edit-card h3 {
  margin-bottom: 0;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.brand-kit-panel {
  display: grid;
  gap: 22px;
}

.preview-upload {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: end;
}

.preset-preview-box {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f8fa;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
}

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

.panel-head .inline-toggle,
.row.spread .inline-toggle {
  justify-self: end;
}

.layout-row.three {
  grid-template-columns: minmax(140px, 200px) minmax(170px, 240px) minmax(180px, 240px) 1fr;
}

.preset-create-row {
  grid-template-columns: 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.preset-create-row textarea {
  width: 100%;
  min-height: 150px;
}

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

.admin-tile {
  display: grid;
  gap: 8px;
  text-decoration: none;
}

.admin-tile span, .empty { color: var(--muted); }

.flash {
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: #f0f3f7;
  border: 1px solid #d8dde5;
}

.flash.error, .error-text {
  color: var(--danger);
  background: #fff2f2;
  border-color: #f2c8c8;
}

.flash.success {
  color: var(--ok);
  background: #effaf5;
  border-color: #c9ead9;
}

.guest-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef0f3;
}

.guest-card {
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.turnstile-wrap {
  min-height: 65px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 30, 45, .32);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(480px, 100%);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: #667085;
}

@media (min-width: 901px) and (max-width: 1300px) {
  .shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .sidebar {
    padding: 22px 14px;
  }

  .main {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 28px 22px;
  }

  .history-item {
    grid-template-columns: 220px minmax(0, 1fr);
    align-items: start;
  }

  .row.spread {
    align-items: flex-start;
  }

  .history-body .row.spread {
    flex-direction: column;
  }

  .history-actions {
    justify-self: start;
    grid-template-columns: minmax(120px, 132px) minmax(120px, 130px);
  }

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

  .form-grid,
  .tool-grid,
  .gallery,
  .style-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-panel,
  .preview-upload,
  .layout-row.three {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-width: 100%;
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fff;
  }

  .table-wrap td {
    border-bottom: 0;
    padding: 0;
    margin-bottom: 13px;
  }

  .table-wrap td:last-child {
    margin-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .table-wrap td input:not([type="checkbox"]):not([type="radio"]),
  .table-wrap td select {
    width: 100%;
  }

  .table-actions {
    align-items: stretch;
  }

  .table-actions form,
  .table-actions button,
  .table-actions .button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  body {
    font-size: 14px;
    overflow-x: hidden;
  }

  .shell {
    display: block;
    min-width: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 10px 24px rgba(20, 30, 45, .05);
  }

  .sidebar .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    padding: 8px;
  }

  .brand-mark img {
    width: 22px;
    height: 22px;
  }

  .mobile-menu-toggle {
    width: 38px;
    height: 38px;
    min-height: 38px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    border-color: #dfe6ee;
    background: #fff;
    color: #344054;
    font-size: 14px;
  }

  .mobile-menu-toggle span:first-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .mobile-menu-icon {
    width: 16px;
    height: 12px;
    border-top: 2px solid #344054;
    border-bottom: 2px solid #344054;
    position: relative;
    transition: transform .16s ease;
  }

  .mobile-menu-icon::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 16px;
    border-top: 2px solid #344054;
  }

  .mobile-menu-toggle[aria-expanded="true"] .mobile-menu-icon {
    transform: scale(.92);
  }

  .sidebar .nav {
    grid-column: 1 / -1;
    display: none;
    padding-top: 6px;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }

  .sidebar.is-open .nav {
    display: grid;
  }

  .nav-section {
    margin-top: 8px;
  }

  .nav-sub {
    margin-left: 8px;
  }

  .main {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 18px 14px 26px;
  }

  .topbar {
    display: none;
  }

  .mobile-account-menu {
    display: block;
    grid-column: 2;
    grid-row: 1;
    width: 38px;
    position: relative;
    justify-self: end;
  }

  .mobile-account-menu .account-trigger {
    width: 38px;
    height: 38px;
    min-width: 38px;
    grid-template-columns: 1fr;
    padding: 0;
    place-items: center;
  }

  .mobile-account-menu .account-trigger .account-copy,
  .mobile-account-menu .account-trigger .account-caret {
    display: none;
  }

  .mobile-account-menu .account-avatar {
    width: 30px;
    height: 30px;
  }

  .mobile-account-menu .account-dropdown {
    position: fixed;
    top: 62px;
    right: 14px;
    width: min(280px, calc(100vw - 28px));
  }

  .page-head {
    gap: 10px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 27px;
  }

  .panel, .metric, .admin-tile {
    padding: 18px;
    margin-bottom: 18px;
  }

  .form-grid, .form-grid.two, .compact-grid, .metric-grid, .admin-grid, .gallery, .company-list, .style-grid, .tool-grid {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 0;
  }

  .history-item {
    grid-template-columns: 1fr;
  }

  .layout-row { grid-template-columns: 1fr; }
  .layout-row.three, .preview-upload, .result-panel, .history-meta, .meta-list { grid-template-columns: 1fr; }
  .page-head,
  .panel-head,
  .row.spread {
    flex-direction: column;
    align-items: stretch;
  }

  .history-actions {
    justify-self: start;
    grid-template-columns: minmax(92px, 1fr) minmax(112px, 1fr);
    width: 100%;
  }

  .download-control {
    white-space: normal;
  }

  .button-row,
  .filter-form,
  .adapt-form {
    align-items: stretch;
  }

  .button-row > *,
  .filter-form > *,
  .adapt-form > *,
  .actions button,
  .actions .button {
    width: 100%;
  }

  .download-control {
    width: 100%;
  }

  .download-control select,
  .download-control .button {
    flex: 1 1 0;
  }

  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-width: 0;
  }

  .table-wrap {
    max-width: 100%;
    overflow: visible;
  }

  .table-wrap table,
  .table-wrap thead,
  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap th,
  .table-wrap td {
    display: block;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
    background: #fff;
  }

  .table-wrap td {
    border-bottom: 0;
    padding: 0;
    margin-bottom: 13px;
  }

  .table-wrap td:last-child {
    margin-bottom: 0;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .table-wrap td input:not([type="checkbox"]):not([type="radio"]),
  .table-wrap td select {
    width: 100%;
  }

  .inline-checks {
    grid-template-columns: 1fr;
  }

  .inline-checks label,
  .checks label {
    min-height: 34px;
  }

  .table-actions {
    align-items: stretch;
  }

  .table-actions form,
  .table-actions button,
  .table-actions .button {
    width: 100%;
  }

  .modal-panel {
    padding: 18px;
  }

  .guest-card {
    padding: 24px;
  }
}
