:root {
  --accent: #0f766e;
  --bg: #f6f7f4;
  --ink: #18211f;
  --muted: #65706c;
  --line: #dce2df;
  --panel: #ffffff;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

img,
svg {
  max-width: 100%;
}

input,
select,
textarea,
button {
  font: inherit;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font-size: 15px;
}

input,
select,
button,
.button,
button.button {
  min-height: 44px;
}

textarea {
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

td small {
  display: block;
  color: var(--muted);
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.ui-icon {
  display: inline-block;
  flex: 0 0 auto;
  font-size: 1.15em;
  line-height: 1;
  vertical-align: -0.12em;
}

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

.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}

code,
pre,
input[readonly] {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.link span {
  text-decoration: underline;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .10), transparent 34%),
    linear-gradient(315deg, rgba(121, 85, 72, .08), transparent 30%),
    var(--bg);
}

.auth.admin-auth,
.auth.install-auth {
  background:
    linear-gradient(135deg, rgba(17, 24, 39, .12), transparent 32%),
    linear-gradient(315deg, rgba(15, 118, 110, .12), transparent 30%),
    #f5f7f6;
}

.auth.member-auth {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .12), transparent 32%),
    linear-gradient(315deg, rgba(197, 138, 34, .16), transparent 32%),
    #fbfcfa;
}

.auth-card {
  width: min(440px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 28px;
  box-shadow: 0 18px 60px rgba(24, 33, 31, .09);
}

.auth-card.admin-auth-card {
  border-top: 5px solid #111827;
}

.auth-card.member-auth-card {
  border-top: 5px solid var(--accent);
}

.member-auth-card {
  box-shadow: 0 18px 60px rgba(15, 118, 110, .12);
}

.admin-auth-card .eyebrow {
  color: #111827;
}

.member-auth-card .eyebrow {
  color: var(--accent);
}

.auth-switch {
  margin: 14px 0 0;
}

.auth-switch a {
  color: var(--muted);
  font-weight: 900;
}

.auth-card h1 {
  margin: 0 0 20px;
  font-size: 32px;
}

.auth-card > .hint {
  margin-top: -10px;
  margin-bottom: 18px;
}

.auth-card form,
.editor-form {
  display: grid;
  gap: 18px;
}

.admin {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 28px;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  text-decoration: none;
}

.brand .ui-icon {
  color: var(--accent);
}

.sidebar nav,
.site-header nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sidebar nav {
  flex-direction: column;
}

.sidebar nav a,
.site-header nav a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  color: var(--muted);
  padding: 9px 10px;
  font-weight: 800;
  text-decoration: none;
}

.sidebar nav a .ui-icon {
  font-size: 20px;
}

.sidebar nav a.active,
.sidebar nav a:hover,
.site-header nav a:hover {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--ink);
}

.site-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 14px auto 0;
}

.site-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
}

.site-subnav a:hover {
  background: color-mix(in srgb, var(--accent) 12%, white);
  color: var(--ink);
}

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

.footer-nav a {
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
  opacity: .85;
}

.footer-nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

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

.topbar,
.admin-head,
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
}

.topbar span,
.topbar a,
.actions a,
.profile-card a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.topbar a,
.actions a,
.profile-card a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.topbar a:hover,
.actions a:hover,
.profile-card a:hover {
  color: var(--ink);
}

.admin-head {
  margin-bottom: 22px;
}

.admin-head h1 {
  margin: 0;
  font-size: 34px;
}

.panel,
.item-card,
.upload-panel,
.media-card,
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
}

.soft-panel {
  background: #fbfcfa;
}

.spaced {
  margin-top: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric strong {
  display: block;
  font-size: 32px;
}

.metric span,
.hint {
  color: var(--muted);
}

.form-grid,
.copy-grid,
.taxonomy-grid,
.inline-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.inline-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

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

.tabs a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 800;
  text-decoration: none;
}

.tabs a.active {
  border-color: var(--accent);
  color: var(--accent);
}

.settings-shell {
  display: grid;
  gap: 18px;
  width: min(100%, 1120px);
  align-content: start;
}

.settings-tabs {
  gap: 6px;
  padding-bottom: 2px;
}

.settings-tabs a {
  min-height: 38px;
  padding: 8px 12px;
}

.settings-panel {
  padding: 24px;
}

.settings-form {
  max-width: 940px;
  gap: 20px;
}

.settings-form h2 {
  margin: 0 0 2px;
  font-size: 22px;
  line-height: 1.2;
}

.settings-form .form-grid {
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 18px 20px;
}

.settings-form > label,
.settings-form > .hint,
.settings-form > .check,
.settings-form > textarea {
  max-width: 900px;
}

.settings-form .hint {
  margin: -4px 0 0;
  max-width: 720px;
  line-height: 1.5;
}

.settings-form .check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.settings-form .check input {
  width: auto;
  min-height: auto;
}

.settings-form input[type="color"] {
  width: 180px;
  max-width: 100%;
  height: 44px;
  padding: 6px;
}

.settings-form .button.primary {
  justify-self: start;
  width: auto;
  min-width: 220px;
  padding-inline: 20px;
}

.commerce-ia {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.commerce-parent-tabs,
.commerce-child-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.commerce-parent-tabs {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.commerce-parent-tabs a {
  flex: 0 0 auto;
  color: var(--ink);
}

.commerce-parent-tabs a.active {
  background: color-mix(in srgb, var(--accent) 12%, white);
}

.commerce-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-bottom: 0;
  padding-bottom: 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.commerce-tabs a {
  flex: 0 0 auto;
}

.commerce-child-tabs a {
  border-color: transparent;
  background: transparent;
  padding: 7px 10px;
  font-size: 13px;
}

.commerce-child-tabs a.active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: #fff;
}

.setting-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.narrow {
  max-width: 640px;
}

.code-area {
  min-height: 320px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.meta-fields {
  display: grid;
  gap: 12px;
}

.meta-row {
  display: grid;
  grid-template-columns: minmax(180px, .35fr) minmax(0, .65fr);
  gap: 12px;
  align-items: start;
}

.content-editor-form {
  gap: 0;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 20px;
  align-items: start;
}

.editor-canvas {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.editor-content-panel {
  display: grid;
  gap: 18px;
}

.content-editor-form .code-area {
  min-height: 460px;
}

.product-description-area {
  min-height: 280px;
}

.editor-sidebar {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.editor-widget {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

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

.widget-head h2,
.editor-canvas h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.widget-actions {
  display: grid;
  gap: 10px;
}

.widget-actions a,
.featured-widget a {
  color: var(--muted);
  font-weight: 900;
  text-decoration: none;
}

.editor-sidebar .button {
  width: 100%;
}

.editor-sidebar .taxonomy-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.editor-sidebar .taxonomy-grid h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.featured-preview img,
.featured-preview .file-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  object-fit: cover;
}

.editor-stat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.editor-stat-grid strong {
  color: var(--ink);
}

.compact-copy-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.compact-copy-grid code {
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 9px 10px;
}

.template-taxonomy {
  display: grid;
  gap: 7px;
}

.template-taxonomy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.template-taxonomy code {
  display: block;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 8px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-warning {
  border-left: 3px solid #d92d20;
  padding-left: 10px;
  color: #b42318;
  font-weight: 800;
}

.template-structure-warning {
  border-color: #fecdca;
  background: #fff7f6;
}

.template-structure-warning ul {
  margin: 14px 0;
  padding-left: 20px;
}

.template-structure-warning li + li {
  margin-top: 8px;
}

.compact-check-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.product-image-component {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 16px;
}

.image-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-image-stage {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

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

.product-gallery-slot {
  position: relative;
  flex: 0 0 156px;
  width: 156px;
  min-width: 156px;
  scroll-snap-align: start;
}

.image-slot {
  display: grid;
  min-width: 0;
  width: 100%;
  height: 100%;
  gap: 8px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.image-slot.is-empty {
  border-style: dashed;
  color: var(--muted);
}

.image-slot.is-filled,
.image-slot:focus-visible,
.media-picker-item:focus-visible {
  border-color: var(--accent);
  outline: 0;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 16%, transparent);
}

.image-slot-preview {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #eef2f1;
  color: var(--muted);
  font-size: 30px;
}

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

.image-slot-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.image-slot-meta strong,
.image-slot-meta small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-slot-meta strong {
  font-size: 15px;
  line-height: 1.3;
}

.image-slot-meta small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.image-slot.is-empty .image-slot-meta small {
  display: none;
}

.image-slot-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}

.image-slot-remove:hover {
  border-color: #f4c7c3;
  color: var(--danger);
}

.product-gallery-slot > .image-slot-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

.app-image-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.app-image-meta strong,
.app-image-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-image-meta small {
  color: var(--muted);
}

.app-image-empty {
  display: grid;
  gap: 10px;
}

.app-image-empty .file-preview {
  max-width: 220px;
}

body.media-picker-open {
  overflow: hidden;
}

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

.media-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(24, 33, 31, .46);
  padding: 18px;
}

.media-picker-dialog {
  display: grid;
  gap: 14px;
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 24px 70px rgba(24, 33, 31, .24);
}

.media-picker-item {
  display: grid;
  min-width: 0;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.media-picker-item img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #eef2f1;
  object-fit: cover;
}

.media-picker-item.is-hidden {
  display: none;
}

.variant-fields {
  display: grid;
  gap: 14px;
}

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

.variant-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.mini-form {
  display: grid;
  grid-template-columns: minmax(92px, .6fr) minmax(120px, .8fr) minmax(140px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.return-form {
  grid-template-columns: minmax(140px, .8fr) minmax(180px, 1fr) minmax(120px, .6fr) auto;
}

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

.item-card,
.media-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.theme-card {
  align-items: stretch;
}

.theme-card > div {
  display: grid;
  gap: 8px;
}

.profile-layout,
.profile-hero {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.commerce-grid,
.checkout-layout,
.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 18px;
  align-items: start;
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-list a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.action-list a:hover {
  border-color: color-mix(in srgb, var(--accent) 36%, var(--line));
  color: var(--accent);
}

.profile-card {
  display: grid;
  justify-items: center;
  text-align: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, white);
  color: var(--accent);
  font-weight: 950;
}

.avatar.large {
  width: 96px;
  font-size: 30px;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.social-row a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 7px 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

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

.author-byline a {
  display: block;
  font-weight: 900;
  text-decoration: none;
}

.content-featured-image {
  margin: 0 0 18px;
}

.content-featured-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8;
  border-radius: 8px;
  object-fit: cover;
}

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

.actions form {
  margin: 0;
}

.actions .button,
.actions a,
.actions button {
  min-width: max-content;
}

.pill {
  display: inline-flex;
  margin: 2px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef2f1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.pill.good {
  background: color-mix(in srgb, var(--accent) 14%, white);
  color: var(--accent);
}

.pill.muted {
  background: #eef2f1;
  color: var(--muted);
}

.pill.danger {
  background: #fff1f0;
  color: #b42318;
}

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

.upload-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.media-grid.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  margin-top: 14px;
}

.media-card {
  align-items: flex-start;
  flex-direction: column;
}

.media-card.compact-media {
  gap: 10px;
  padding: 12px;
}

.media-card img,
.file-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  background: #eef2f1;
  object-fit: cover;
}

.compact-media img {
  aspect-ratio: 1;
  border-radius: 6px;
}

.file-preview {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.flash {
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, white);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, white);
  padding: 12px 14px;
  font-weight: 800;
}

.flash.error {
  border-color: #f4c7c3;
  background: #fff4f2;
  color: var(--danger);
}

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

.check input {
  width: auto;
}

.public {
  background: #fbfcfa;
}

.admin,
.public {
  overflow-x: hidden;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .9);
  padding: 16px clamp(18px, 5vw, 64px);
  backdrop-filter: blur(12px);
}

.page-shell {
  width: min(1080px, calc(100% - 36px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.veeba-hero {
  min-height: 58vh;
  display: grid;
  align-content: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
}

.veeba-hero.compact {
  min-height: 28vh;
}

.veeba-hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 108px);
  line-height: .92;
}

.veeba-hero p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(18px, 2.5vw, 24px);
}

.veeba-panel {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: clamp(22px, 4vw, 38px);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.product-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.product-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #eef2f1;
  object-fit: cover;
}

.product-card h2,
.product-detail h1,
.checkout-summary h2 {
  margin-top: 0;
}

.product-card h2 a {
  text-decoration: none;
}

.product-card-foot,
.checkout-summary {
  display: grid;
  gap: 12px;
}

.product-card-foot {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.product-card-foot strong,
.checkout-summary > strong {
  font-size: 24px;
}

.checkout-summary {
  align-self: start;
}

.checkout-summary table td {
  padding: 10px 0;
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.cart-summary > strong {
  font-size: 26px;
}

.cart-actions {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.cart-actions .button {
  width: 100%;
}

.product-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f1;
  object-fit: cover;
}

.product-gallery img:first-child {
  grid-column: span 2;
  grid-row: span 2;
}

.archive-item h2 a {
  text-decoration: none;
}

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

.search-list {
  display: grid;
  gap: 0;
}

.search-result h2 a {
  text-decoration: none;
}

.variant-list {
  margin-top: 22px;
}

.variant-list ul {
  display: grid;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.variant-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.term-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
}

.comments {
  display: grid;
  gap: 18px;
}

.comment {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.comment small {
  display: block;
  color: var(--muted);
}

.comment-form {
  display: grid;
  gap: 14px;
}

.hidden-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.veeba-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  font-weight: 900;
  text-decoration: none;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 24px clamp(18px, 5vw, 64px);
}

@media (max-width: 960px) {
  .admin {
    display: block;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: auto;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 12px;
  }

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

  .sidebar form {
    justify-self: end;
  }

  .sidebar nav {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    max-width: 100%;
    overflow-x: auto;
    padding: 2px 0 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar nav a {
    flex: 0 0 auto;
    min-height: 42px;
    border: 1px solid transparent;
    background: #fff;
    white-space: nowrap;
  }

  .sidebar nav a.active {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  }

  .admin-main {
    width: 100%;
    padding: 18px;
  }

  .site-header {
    align-items: stretch;
    flex-direction: column;
    padding: 14px 16px;
  }

  .site-header nav {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .site-header nav a {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }

  .page-shell {
    width: min(100% - 24px, 1080px);
    padding: 24px 0 54px;
  }

  .veeba-hero {
    min-height: 44vh;
  }

  .veeba-hero.compact {
    min-height: 18vh;
  }

  .veeba-panel,
  .panel,
  .item-card,
  .upload-panel,
  .media-card,
  .metric {
    padding: 16px;
  }

  .admin-head,
  .topbar,
  .upload-panel,
  .item-card {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-head h1 {
    font-size: 29px;
    line-height: 1.05;
  }

  .admin-head .button,
  .topbar a {
    width: 100%;
  }

  .actions {
    width: 100%;
    align-items: stretch;
    gap: 8px;
  }

  .actions .button,
  .actions a,
  .actions button {
    min-width: 0;
    justify-content: center;
  }

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

  .metric strong {
    font-size: 26px;
  }

  .form-grid,
  .copy-grid,
  .taxonomy-grid,
  .inline-form,
  .meta-row,
  .search-form,
  .variant-row,
  .mini-form,
  .return-form {
    grid-template-columns: 1fr;
  }

  .settings-shell {
    width: 100%;
    gap: 14px;
  }

  .settings-tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .settings-tabs a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .settings-panel {
    padding: 16px;
  }

  .settings-form {
    max-width: none;
    gap: 16px;
  }

  .settings-form .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-form .button.primary {
    justify-self: stretch;
    width: 100%;
  }

  .inline-form .button,
  .mini-form .button,
  .search-form .button,
  .editor-form > .button {
    width: 100%;
  }

  .profile-layout,
  .profile-hero,
  .commerce-grid,
  .checkout-layout,
  .product-detail,
  .editor-layout {
    grid-template-columns: 1fr;
  }

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

  .publish-widget {
    grid-column: 1 / -1;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 760px) {
  .editor-sidebar {
    grid-template-columns: 1fr;
  }

  .content-editor-form .code-area {
    min-height: 360px;
  }
}

@media (max-width: 700px) {
  table.responsive-table {
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  table.responsive-table thead {
    display: none;
  }

  table.responsive-table tbody,
  table.responsive-table tr,
  table.responsive-table td {
    display: block;
    width: 100%;
  }

  table.responsive-table tr {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 12px;
  }

  table.responsive-table td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 0;
    padding: 8px 0;
  }

  table.responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  table.responsive-table td.unlabeled,
  table.responsive-table td.table-empty,
  table.responsive-table td.actions {
    grid-template-columns: 1fr;
  }

  table.responsive-table td.unlabeled::before,
  table.responsive-table td.table-empty::before,
  table.responsive-table td.actions::before {
    display: none;
  }

  table.responsive-table td.table-empty {
    color: var(--muted);
    font-weight: 800;
  }

  table.responsive-table td.actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-top: 10px;
  }

  table.responsive-table td.actions a {
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
  }

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

  table.responsive-table td.actions form {
    display: grid;
  }

  table.responsive-table td.actions .link {
    justify-content: center;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 12px;
  }

  .key-value-table td {
    padding: 11px 0;
  }
}

@media (max-width: 820px) {
  .product-gallery img:first-child {
    grid-column: auto;
    grid-row: auto;
  }

  .product-card-foot {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

  .cart-summary .actions,
  .product-card-foot .button {
    width: 100%;
  }

  .cart-summary .actions .button,
  .cart-summary .actions button {
    flex: 1 1 160px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .auth {
    padding: 14px;
    place-items: stretch;
    align-content: center;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-card h1 {
    font-size: 27px;
  }

  .sidebar {
    padding: 10px;
  }

  .brand {
    font-size: 20px;
  }

  .sidebar form .link span {
    display: none;
  }

  .sidebar form .link {
    justify-content: center;
    width: 44px;
    min-height: 44px;
  }

  .admin-main {
    padding: 14px;
  }

  .panel,
  .item-card,
  .upload-panel,
  .media-card,
  .metric,
  .veeba-panel {
    padding: 14px;
  }

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

  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .tabs a {
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
  }

  .product-grid,
  .media-grid,
  .media-grid.compact-grid {
    grid-template-columns: 1fr;
  }

  .cart-summary .actions {
    flex-direction: column;
  }

  .cart-summary .actions .button,
  .cart-summary .actions button {
    width: 100%;
  }

  .veeba-hero h1 {
    font-size: clamp(40px, 14vw, 62px);
  }

  .veeba-hero p {
    font-size: 17px;
  }

  .variant-list li {
    display: grid;
  }
}
