:root {
  color-scheme: light;
  --background: #f8fafc;
  --foreground: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --panel: #ffffff;
  --primary: #111827;
  --primary-foreground: #ffffff;
  --accent: #f1f5f9;
  --ring: #94a3b8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
}

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

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

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
}

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

.brand.large {
  justify-content: center;
}

.brand-mark,
.brand-icon {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-mark {
  place-items: center;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
}

.brand-icon {
  display: block;
  object-fit: contain;
}

.brand strong,
.brand small {
  display: block;
}

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

.nav-stack {
  flex: 1;
  overflow: auto;
}

.product-nav {
  margin-bottom: 8px;
}

.product-nav summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.product-nav summary::-webkit-details-marker {
  display: none;
}

.product-links {
  display: grid;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  font-size: 14px;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--accent);
  color: var(--foreground);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
}

.sidebar-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.content {
  padding: 28px;
}

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

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

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

.page-head h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel,
.empty-state,
.asset-card,
.task-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.panel {
  padding: 18px;
  margin-bottom: 20px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin: 0;
  font-size: 18px;
}

.upload-strip,
.inline-actions,
.member-form,
.product-form,
.status-form,
.revision-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.revision-form {
  align-items: stretch;
  flex-direction: column;
  margin-top: 12px;
}

.primary-button,
.ghost-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.primary-button {
  background: var(--primary);
  color: var(--primary-foreground);
}

.ghost-button {
  border-color: var(--border);
  background: var(--panel);
  color: var(--foreground);
}

.full {
  width: 100%;
}

input,
select,
textarea,
.input {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--foreground);
}

textarea {
  resize: vertical;
}

.form-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
}

.compact-field {
  width: 110px;
}

.check-group {
  display: grid;
  gap: 8px;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: #334155;
  font-size: 14px;
  white-space: nowrap;
}

.check-row input {
  min-height: auto;
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.product-form {
  align-items: end;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) 110px auto auto;
}

.product-list {
  display: grid;
  gap: 12px;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.product-main,
.product-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.product-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.product-title-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-grid,
.task-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.asset-card,
.task-card {
  overflow: hidden;
}

.asset-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--accent);
}

.asset-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.asset-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.asset-title h2 {
  margin: 0;
  font-size: 16px;
}

.asset-body p,
.member-row p,
.review-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent);
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

.review-list,
.member-list {
  display: grid;
  gap: 10px;
}

.review-row,
.member-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.member-row {
  grid-template-columns: 1fr auto auto;
}

.review-row img {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--accent);
}

.review-row h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.empty-state {
  padding: 28px;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--foreground);
  font-size: 18px;
}

.empty-state p {
  margin: 0;
}

.toast-stack {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.toast {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

.toast.error {
  border-color: #fecaca;
  color: #991b1b;
  background: #fef2f2;
}

.toast.success {
  border-color: #bbf7d0;
  color: #166534;
  background: #f0fdf4;
}

.card-actions {
  display: flex;
  gap: 8px;
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .page-head,
  .upload-strip,
  .inline-actions,
  .member-form,
  .product-form {
    align-items: stretch;
    flex-direction: column;
  }

  .product-form,
  .product-row {
    grid-template-columns: 1fr;
  }

  .compact-field {
    width: auto;
  }

  .review-row,
  .member-row {
    grid-template-columns: 1fr;
  }
}

/* kPilot-inspired application skin */
:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink-panel: #111827;
  --line: #e1e6ee;
  --line-strong: #cfd7e4;
  --text: #121826;
  --muted: #667085;
  --faint: #98a2b3;
  --primary: #1f4f8f;
  --primary-dark: #173b6b;
  --primary-soft: #edf3fa;
  --accent: #dfe7ef;
  --ok: #168a53;
  --ok-soft: #e9f7ef;
  --warn: #b76a00;
  --warn-soft: #fff4df;
  --danger: #c93434;
  --danger-soft: #fff0f0;
  --teal: #087f7a;
  --background: var(--bg);
  --foreground: var(--text);
  --border: var(--line);
  --panel: var(--surface);
  --ring: #9db6d8;
  --primary-foreground: #ffffff;
  --shadow-sm: 0 1px 2px rgba(18, 24, 38, 0.06);
  --shadow-md: 0 18px 44px rgba(18, 24, 38, 0.10);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Inter, sans-serif;
}

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

body {
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

html.is-modal-scroll-locked,
body.is-modal-scroll-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

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

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  gap: 0;
  width: 248px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
}

.brand.large {
  justify-content: center;
}

.brand-icon {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.brand-text {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand strong,
.brand small {
  display: block;
}

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

.sidebar-nav {
  display: grid;
  gap: 22px;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.sidebar-section {
  display: grid;
  gap: 6px;
}

.sidebar-section h2 {
  margin: 0 0 3px;
  padding: 0 10px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 800;
}

.sidebar-subgroup {
  display: grid;
  gap: 5px;
  margin: 0;
}

.sidebar-subgroup > summary {
  list-style: none;
  cursor: pointer;
}

.sidebar-subgroup > summary::-webkit-details-marker {
  display: none;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.sidebar-link.is-active {
  color: var(--text);
  border-color: #cfd8f4;
  background: #e9eefb;
  font-weight: 750;
}

.sidebar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
}

.sidebar-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.product-initial {
  border: 1px solid #d1e0f4;
  background: #f5f9ff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 850;
}

.sidebar-subgroup-arrow {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--faint);
  transition: transform 0.16s ease;
}

.sidebar-subgroup-arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sidebar-subgroup[open] .sidebar-subgroup-arrow {
  transform: rotate(90deg);
}

.sidebar-subgroup-list {
  display: grid;
  gap: 4px;
  padding-left: 12px;
}

.sidebar-subgroup-list .sidebar-link {
  min-height: 34px;
  padding-block: 6px;
}

.sidebar-subgroup-list .sidebar-icon {
  flex-basis: 22px;
  width: 22px;
  height: 22px;
}

.sidebar-subgroup-list .sidebar-icon svg {
  width: 14px;
  height: 14px;
}

.sidebar-empty {
  margin: 0;
  padding: 12px 10px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.account-chip {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.account-chip strong,
.account-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.account-chip span {
  color: var(--muted);
  font-size: 12px;
}

.app-main {
  min-width: 0;
}

.page {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 30px 32px 48px;
}

.content {
  padding: 0;
}

.auth-content {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-panel {
  width: min(430px, 100%);
  display: grid;
  gap: 28px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.page-head {
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head h1 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}

.page-head p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  display: block;
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.panel,
.empty-state,
.asset-card,
.task-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

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

.section-head {
  align-items: center;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.primary-button,
.ghost-button,
.button,
button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-weight: 760;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.primary-button,
.button.primary,
button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover,
.button.primary:hover,
button.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.ghost-button:hover,
.button:hover,
button:hover {
  border-color: #b8c2d3;
  background: var(--surface-soft);
}

.primary-button:active,
.ghost-button:active,
.button:active,
button:active {
  transform: translateY(1px);
}

.full {
  width: 100%;
}

input,
select,
textarea,
.input {
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
}

input:focus,
select:focus,
textarea:focus,
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.12);
}

.kstage-select {
  position: relative;
  min-width: 0;
}

.kstage-select-trigger {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.kstage-select-trigger:hover,
.kstage-select.is-open .kstage-select-trigger {
  border-color: #b8c2d3;
  background: var(--surface);
}

.kstage-select-trigger:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.12);
}

.kstage-select-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kstage-select-trigger i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.7px solid var(--muted);
  border-bottom: 1.7px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 120ms ease;
}

.kstage-select.is-open .kstage-select-trigger i {
  transform: translateY(2px) rotate(225deg);
}

.kstage-select-content[hidden] {
  display: none;
}

.kstage-select-content {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 160px;
  max-height: 240px;
  overflow: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(18, 24, 38, 0.14);
}

.kstage-select-item {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 680;
  text-align: left;
}

.kstage-select-item::before {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: translateY(-1px) rotate(-45deg);
}

.kstage-select-item[aria-selected="true"]::before {
  border-color: var(--primary);
}

.kstage-select-item:hover,
.kstage-select-item:focus-visible {
  outline: none;
  background: var(--surface-soft);
}

.kstage-select-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="file"] {
  min-height: 38px;
  max-width: 320px;
  padding: 7px 10px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
}

input[type="checkbox"] {
  box-shadow: none;
}

textarea {
  resize: vertical;
}

.upload-strip,
.inline-actions,
.member-form,
.status-form {
  gap: 10px;
}

.upload-strip {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.form-field {
  gap: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.compact-field {
  width: 108px;
}

.check-row {
  min-height: 34px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.check-row input {
  accent-color: var(--primary);
}

.product-form {
  align-items: end;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) 180px 108px auto auto;
  gap: 12px;
  margin: 0;
}

.product-list {
  gap: 12px;
}

.product-row {
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.product-title-line {
  padding-bottom: 2px;
}

.product-title-line strong {
  color: var(--text);
  font-size: 16px;
}

.asset-grid,
.task-board {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.asset-card,
.task-card {
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.asset-card:hover,
.task-card:hover {
  border-color: #c7d2e5;
  box-shadow: 0 10px 28px rgba(18, 24, 38, 0.08);
  transform: translateY(-1px);
}

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

.asset-body {
  gap: 10px;
  padding: 14px;
}

.asset-title {
  align-items: flex-start;
}

.asset-title h2 {
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
}

.asset-body p,
.member-row p,
.review-row p {
  color: var(--muted);
  font-size: 13px;
}

.status-pill,
.badge {
  min-height: 25px;
  padding: 3px 9px;
  border: 1px solid #cfd8f4;
  border-radius: 999px;
  background: #eef4ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.status-revision_required {
  border-color: #fed7aa;
  background: #fff4e6;
  color: #b45309;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.14);
}

.status-pill.muted-pill {
  border-color: var(--border);
  background: #f8fafc;
  color: var(--muted);
}

.attention-button {
  border-color: #fdba74;
  background: #fff7ed;
  color: #b45309;
}

.attention-button:hover,
.attention-button:focus-visible {
  border-color: #fb923c;
  background: #ffedd5;
  color: #9a3412;
}

.review-list,
.member-list {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.panel .review-list,
.panel .member-list {
  border: 0;
  border-radius: 0;
}

.review-row,
.member-row {
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.review-row:last-child,
.member-row:last-child {
  border-bottom: 0;
}

.member-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.review-row img {
  width: 84px;
  height: 64px;
  border-radius: 8px;
  background: #eef2f8;
}

.review-row h3 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.inline-actions input[type="text"] {
  width: 220px;
}

.revision-form {
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

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

.empty-state {
  padding: 28px;
  color: var(--muted);
}

.empty-state h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 18px;
}

.empty-state p {
  margin: 0;
}

.toast-stack {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 120;
  display: grid;
  width: min(420px, calc(100vw - 24px));
  gap: 8px;
  margin: 0;
  transform: translateX(-50%);
}

.auth-toast {
  top: 24px;
}

.toast {
  padding: 10px 12px;
  border: 1px solid #c7d8ff;
  border-radius: 8px;
  background: #eef4ff;
  color: #12367d;
  box-shadow: var(--shadow-md);
}

.toast.error {
  border-color: #f2c6cd;
  background: #fff2f4;
  color: #8f1d33;
}

.toast.success {
  border-color: #b9e5cf;
  background: #edf9f2;
  color: #155d3b;
}

.toast.warning {
  border-color: #f2dfb2;
  background: #fff8e9;
  color: #7a4c00;
}

.pixelated {
  image-rendering: pixelated;
}

.pixel-upload-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(160px, 1fr) 140px 150px 130px minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.pixel-files {
  min-width: 0;
}

.pixel-note {
  grid-column: 1 / -2;
}

.pixel-filter {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(180px, 220px));
  gap: 10px;
  align-items: center;
}

.pixel-library-head {
  align-items: flex-end;
}

.pixel-filter-panel {
  padding: 14px;
}

.pixel-prelevel-filter {
  grid-template-columns: minmax(180px, 220px);
}

.pixel-art-filter {
  grid-template-columns: minmax(180px, 220px);
}

.pixel-library-list-shell {
  display: grid;
  gap: 14px;
  transition: opacity 140ms ease;
}

.pixel-library-list-shell.is-loading {
  opacity: 0.56;
  pointer-events: none;
}

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

.pixel-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.pixel-date-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.pixel-list-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) minmax(142px, auto);
  gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.pixel-list-thumb-wrap {
  width: 96px;
}

.pixel-list-thumb-button {
  display: block;
  width: 96px;
  height: 96px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  cursor: zoom-in;
}

.pixel-list-thumb-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.16);
}

.pixel-list-thumb {
  width: 96px;
  height: 96px;
  display: block;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f2f4f7 75%),
    linear-gradient(-45deg, transparent 75%, #f2f4f7 75%);
  background-color: #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.empty-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.pixel-list-main {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.pixel-list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pixel-list-title h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--text-soft);
  font-size: 12px;
}

.pixel-list-meta.muted {
  color: var(--muted);
}

.pixel-color-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pixel-color-chip,
.pixel-upload-color {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 8px 3px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 12px;
}

.pixel-color-chip i,
.pixel-upload-color i,
.pixel-report-colors i {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(18, 24, 38, 0.16);
  border-radius: 5px;
}

.pixel-color-chip b,
.pixel-upload-color b {
  font-weight: 760;
}

.compact-palette {
  gap: 5px;
}

.pixel-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pixel-row-actions form {
  margin: 0;
}

.pixel-row-details {
  position: relative;
}

.pixel-row-details > summary {
  list-style: none;
  cursor: pointer;
}

.pixel-row-details > summary::-webkit-details-marker {
  display: none;
}

.pixel-report-popover,
.upload-revision-details .revision-form {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 8px);
  width: min(420px, 82vw);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.pixel-report-popover p {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 12px;
}

.pixel-report-colors {
  display: grid;
  max-height: 260px;
  overflow: auto;
  gap: 7px;
}

.pixel-report-colors span {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  color: var(--text-soft);
  font-size: 12px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.pixel-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pixel-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.40);
}

.pixel-preview-panel {
  position: relative;
  z-index: 1;
  width: min(1320px, 100%);
  max-height: min(900px, calc(100vh - 48px));
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xl);
}

.pixel-review-notes-modal[hidden] {
  display: none;
}

.pixel-review-notes-modal {
  position: fixed;
  inset: 0;
  z-index: 43;
  display: grid;
  overflow: hidden;
  overscroll-behavior: contain;
  place-items: center;
  padding: 24px;
}

.pixel-review-notes-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.40);
  touch-action: none;
}

.pixel-review-notes-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(860px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xl);
}

.pixel-review-notes-body {
  display: grid;
  gap: 14px;
}

.pixel-review-notes-summary {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pixel-review-notes-thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f2f4f7 75%),
    linear-gradient(-45deg, transparent 75%, #f2f4f7 75%);
  background-color: #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.pixel-review-notes-summary h3 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-review-notes-summary p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.pixel-review-note-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pixel-review-note-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pixel-review-note-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.pixel-review-note-card header div {
  display: grid;
  gap: 2px;
}

.pixel-review-note-card strong {
  color: var(--text);
  font-size: 13px;
}

.pixel-review-note-card span,
.pixel-review-note-card time {
  color: var(--muted);
  font-size: 12px;
}

.pixel-review-note-content {
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.pixel-review-note-content p,
.pixel-review-note-content ul,
.pixel-review-note-content ol,
.pixel-review-note-content blockquote {
  margin: 0 0 10px;
}

.pixel-review-note-content p:last-child,
.pixel-review-note-content ul:last-child,
.pixel-review-note-content ol:last-child,
.pixel-review-note-content blockquote:last-child {
  margin-bottom: 0;
}

.pixel-review-note-content img,
.pixel-review-note-content video {
  display: block;
  max-width: min(100%, 520px);
  height: auto;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.pixel-review-note-content blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  color: var(--muted);
}

.pixel-review-notes-loading,
.pixel-review-notes-error {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.pixel-review-notes-error {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff1f2;
  color: var(--danger);
}

.pixel-preview-body {
  min-height: 280px;
}

.pixel-preview-layout {
  display: grid;
  grid-template-columns: minmax(520px, 1.75fr) minmax(300px, 0.85fr);
  gap: 24px;
  padding-right: 44px;
}

.pixel-preview-media {
  display: grid;
  align-content: start;
  gap: 14px;
}

.pixel-preview-image-frame {
  display: grid;
  height: min(720px, calc(100vh - 220px));
  min-height: min(720px, calc(100vh - 220px));
  overflow: hidden;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f2f4f7 75%),
    linear-gradient(-45deg, transparent 75%, #f2f4f7 75%);
  background-color: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.pixel-preview-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pixel-preview-media-note {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.pixel-preview-media-note strong {
  color: var(--text);
  font-size: 15px;
}

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

.pixel-preview-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.pixel-preview-title-line h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.25;
}

.pixel-preview-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0;
}

.pixel-preview-meta div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pixel-preview-meta dt,
.pixel-preview-meta dd {
  margin: 0;
}

.pixel-preview-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.pixel-preview-meta dd {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-preview-section {
  display: grid;
  gap: 10px;
}

.pixel-preview-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.pixel-preview-colors {
  display: grid;
  max-height: min(500px, calc(100vh - 390px));
  overflow: auto;
  border-top: 1px solid var(--line);
}

.pixel-preview-color-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 86px 72px;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  border-bottom: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
}

.pixel-preview-color-row i {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(18, 24, 38, 0.16);
  border-radius: 5px;
}

.pixel-preview-color-row strong {
  overflow: hidden;
  color: var(--text);
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-preview-color-row b {
  color: var(--text);
  text-align: right;
}

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

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

.pixel-upload-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pixel-use-modal {
  position: fixed;
  inset: 0;
  z-index: 42;
  display: grid;
  place-items: center;
  padding: 24px;
}

.pixel-upload-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.32);
}

.pixel-use-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
}

.pixel-upload-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xl);
}

.pixel-use-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(440px, 100%);
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xl);
}

.pixel-use-message {
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

.pixel-upload-head {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding-right: 52px;
  margin-bottom: 0;
}

.pixel-upload-head .badge {
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.pixel-upload-dropzone {
  position: relative;
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 18px;
  border: 1.5px dashed #98adc3;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  text-align: center;
}

.pixel-upload-dropzone.is-dragover {
  border-color: var(--accent);
  background: #eef7f2;
}

.pixel-upload-dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.pixel-upload-dropzone-body {
  display: grid;
  gap: 6px;
}

.pixel-upload-dropzone-body strong {
  color: var(--text);
  font-size: 16px;
}

.pixel-upload-dropzone-body span {
  color: var(--muted);
  font-size: 13px;
}

.pixel-upload-progress {
  position: relative;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.pixel-upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #4fb282;
  transition: width 160ms ease;
}

.pixel-upload-progress strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 12px;
}

.pixel-upload-error {
  padding: 10px 12px;
  border: 1px solid #f2c6cd;
  border-radius: 8px;
  background: #fff2f4;
  color: #8f1d33;
  font-size: 13px;
}

.pixel-upload-results {
  display: grid;
  gap: 10px;
}

.pixel-upload-result {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pixel-upload-result.is-failed {
  border-color: #f2c6cd;
  background: #fff8f9;
}

.pixel-upload-preview {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.pixel-upload-result-main {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.pixel-upload-result-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pixel-upload-result-title h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-upload-result-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.pixel-upload-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.pixel-check {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pixel-check strong {
  color: var(--text);
  font-size: 13px;
}

.pixel-check.failed {
  border-color: #f2c6cd;
  background: #fff2f4;
}

.pixel-check.warning {
  border-color: #f2dfb2;
  background: #fff8e9;
}

.pixel-check.passed {
  border-color: #b9e5cf;
  background: #edf9f2;
}

.pixel-check.compact {
  margin-top: 8px;
}

.pixel-check-line {
  color: var(--muted);
  font-size: 12px;
}

.pixel-check-line.error {
  color: var(--danger);
}

.pixel-check-line.warning {
  color: var(--warn);
}

.pixel-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-top: 2px;
}

.pixel-palette span {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(18, 24, 38, 0.16);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.pixel-review-row {
  grid-template-columns: 96px minmax(260px, 1fr) minmax(320px, 0.95fr);
  align-items: start;
}

.pixel-review-row img {
  width: 96px;
  height: 96px;
}

.pixel-review-main {
  min-width: 0;
}

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

.pixel-internal-review-row,
.pixel-art-review-row {
  grid-template-columns: 96px minmax(0, 1fr) minmax(132px, auto);
}

.pixel-review-menu-wrap {
  position: relative;
}

.pixel-review-menu[hidden] {
  display: none;
}

.pixel-review-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  display: grid;
  min-width: 154px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-lg);
}

.pixel-review-menu form {
  margin: 0;
}

.pixel-review-menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.pixel-review-menu button:hover,
.pixel-review-menu button:focus-visible {
  outline: none;
  background: var(--surface-soft);
}

.pixel-review-decision-modal[hidden] {
  display: none;
}

.pixel-review-decision-modal {
  position: fixed;
  inset: 0;
  z-index: 44;
  display: grid;
  overflow: hidden;
  overscroll-behavior: contain;
  place-items: center;
  padding: 24px;
}

.pixel-review-decision-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.44);
  touch-action: none;
}

.pixel-review-decision-panel {
  position: relative;
  z-index: 1;
  width: min(1500px, 100%);
  max-height: min(920px, calc(100vh - 48px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xl);
}

.pixel-review-change-form {
  display: grid;
  gap: 18px;
}

.pixel-review-compose-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(680px, 1.28fr);
  gap: 24px;
  align-items: start;
}

.pixel-review-compose-media,
.pixel-review-compose-editor {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.pixel-review-compose-image-frame {
  display: grid;
  height: min(500px, calc(100vh - 360px));
  min-height: 300px;
  overflow: hidden;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f2f4f7 75%),
    linear-gradient(-45deg, transparent 75%, #f2f4f7 75%);
  background-color: #fff;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.pixel-review-compose-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pixel-review-compose-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.pixel-review-compose-meta div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pixel-review-compose-meta dt,
.pixel-review-compose-meta dd {
  margin: 0;
}

.pixel-review-compose-meta dt {
  color: var(--muted);
  font-size: 12px;
}

.pixel-review-compose-meta dd {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pixel-review-error {
  padding: 10px 12px;
  border: 1px solid rgba(220, 38, 38, 0.28);
  border-radius: 8px;
  background: #fff1f2;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.pixel-review-error[hidden] {
  display: none;
}

.pixel-review-page-error {
  margin-bottom: 12px;
}

.pixel-review-editor-shell .tiptap-toolbar {
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.pixel-review-editor-shell,
.pixel-review-editor-shell .tiptap-editor,
.pixel-review-editor-shell .tiptap-editor .ProseMirror,
.pixel-review-editor-shell .tiptap-editor.is-fallback {
  overscroll-behavior: contain;
}

.pixel-review-editor-shell .tiptap-editor,
.pixel-review-editor-shell .tiptap-editor .ProseMirror,
.pixel-review-editor-shell .tiptap-editor.is-fallback {
  min-height: min(560px, calc(100vh - 420px));
}

.pixel-review-editor-actions {
  margin-top: -2px;
  justify-content: flex-end;
}

.pixel-decision-form {
  display: grid;
  gap: 10px;
}

.pixel-decision-form .card-actions {
  justify-content: flex-end;
}

.pixel-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tiptap-shell {
  display: grid;
  gap: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.tiptap-shell:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(31, 79, 143, 0.12);
}

.tiptap-shell textarea[hidden] {
  display: none;
}

.tiptap-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  min-height: 48px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line-strong);
  background: #fff;
}

.tiptap-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  color: #687386;
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tiptap-toolbar button:hover,
.tiptap-toolbar button.is-active {
  color: var(--primary);
}

.tiptap-toolbar button:hover {
  background: #f7f8fa;
}

.tiptap-toolbar button.is-active {
  background: #edf3fa;
}

.tiptap-toolbar button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.tiptap-toolbar svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.tiptap-toolbar .tiptap-separator {
  width: 1px;
  height: 30px;
  margin: 0 14px;
  background: #dfe3ea;
}

.tiptap-toolbar button[data-tiptap-action="heading"],
.tiptap-toolbar button[data-tiptap-action="listMenu"] {
  width: 46px;
  min-width: 46px;
}

.tiptap-toolbar .tiptap-wide-button {
  gap: 3px;
}

.tiptap-toolbar .tiptap-text-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0;
  background: transparent;
  color: currentColor;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
}

.tiptap-toolbar .tiptap-italic-icon {
  font-style: italic;
  font-weight: 500;
}

.tiptap-toolbar .tiptap-strike-icon {
  position: relative;
  font-weight: 500;
}

.tiptap-toolbar .tiptap-strike-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  right: 3px;
  height: 2px;
  background: currentColor;
}

.tiptap-toolbar .tiptap-underline-icon {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.tiptap-toolbar .tiptap-color-icon {
  font-weight: 600;
  transform: translateY(1px);
}

.tiptap-toolbar button[data-tiptap-action="highlightMenu"] svg {
  width: 21px;
  height: 21px;
  transform: translateY(1px);
}

.tiptap-toolbar .tiptap-chevron {
  width: 12px;
  height: 12px;
}

.tiptap-menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tiptap-floating-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 80;
  display: grid;
  min-width: 170px;
  padding: 10px;
  border: 1px solid #edf1f6;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.13);
  transform-origin: top left;
  animation: tiptap-menu-in 0.14s ease-out;
}

.tiptap-floating-menu[hidden] {
  display: none;
}

.tiptap-floating-menu button {
  justify-content: flex-start;
  gap: 10px;
  width: auto;
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  color: #59616c;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

.tiptap-floating-menu button:hover {
  background: #f6f7fa;
  color: #313844;
}

.tiptap-heading-menu button span,
.tiptap-list-menu button > span {
  width: auto;
  height: auto;
  margin: 0;
  background: transparent;
  color: #646b75;
  font-size: 16px;
}

.tiptap-heading-menu button span {
  min-width: 28px;
  font-weight: 600;
}

.tiptap-heading-menu,
.tiptap-list-menu {
  min-width: 190px;
}

.tiptap-list-menu {
  padding: 12px;
}

.tiptap-list-menu button {
  height: 38px;
  min-height: 38px;
  font-size: 17px;
}

.tiptap-list-menu button > svg {
  width: 22px;
  min-width: 22px;
  height: 22px;
  color: #646b75;
}

.tiptap-color-menu {
  left: auto;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 18px;
}

.tiptap-color-menu button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border: 2px solid #d5dce8;
  border-radius: 999px;
  background: var(--swatch, #fff);
}

.tiptap-color-menu button:hover {
  background: var(--swatch, #fff);
  box-shadow: 0 0 0 4px rgba(31, 79, 143, 0.12);
}

.tiptap-color-menu .tiptap-menu-divider,
.tiptap-link-menu .tiptap-menu-divider {
  width: 1px;
  height: 26px;
  margin: 0 2px;
  background: #e3e7ee;
}

.tiptap-color-menu .tiptap-clear-highlight {
  position: relative;
  border-color: #8a929d;
  background: #fff;
}

.tiptap-color-menu .tiptap-clear-highlight::before,
.tiptap-color-menu .tiptap-clear-highlight::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 14px;
  height: 2px;
  margin: auto;
  border-radius: 999px;
  background: #636b76;
  transform: rotate(45deg);
}

.tiptap-color-menu .tiptap-clear-highlight::after {
  transform: rotate(-45deg);
}

.tiptap-link-menu {
  left: auto;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 360px;
  padding: 12px 14px;
  border-radius: 18px;
}

.tiptap-link-menu input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 2px solid #e3e8f0;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: #303742;
  font: inherit;
  font-size: 16px;
}

.tiptap-link-menu input:focus {
  border-color: #d7dee9;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.04);
}

.tiptap-link-button-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tiptap-link-menu button {
  justify-content: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  color: #7c8490;
  font-size: 18px;
  line-height: 1;
}

.tiptap-link-menu svg {
  display: block;
  width: 19px;
  height: 19px;
}

@keyframes tiptap-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.tiptap-editor {
  min-height: 360px;
  overflow: auto;
  background: #fff;
  color: var(--text);
  line-height: 1.65;
  outline: none;
  cursor: text;
}

.tiptap-editor:focus-within {
  box-shadow: none;
}

.tiptap-editor .ProseMirror,
.tiptap-editor.is-fallback {
  min-height: 360px;
  padding: 14px 16px;
  outline: none;
}

.tiptap-editor p,
.tiptap-editor ul,
.tiptap-editor ol,
.tiptap-editor blockquote {
  margin: 0 0 10px;
}

.tiptap-editor h1,
.tiptap-editor h2,
.tiptap-editor h3,
.tiptap-editor h4 {
  margin: 14px 0 8px;
  color: var(--text);
  line-height: 1.25;
}

.tiptap-editor ul,
.tiptap-editor ol {
  padding-left: 22px;
}

.tiptap-editor blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--line-strong);
  color: var(--text-soft);
}

.tiptap-editor img,
.tiptap-editor video {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tiptap-editor .tiptap-resizable-media {
  position: relative;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 10px 0;
  line-height: 0;
}

.tiptap-editor .tiptap-resizable-media img,
.tiptap-editor .tiptap-resizable-media video {
  display: block;
  max-width: 100%;
  margin: 0;
}

.tiptap-editor .tiptap-resizable-media[data-media-kind="video"] video:not([width]) {
  width: min(100%, 720px);
}

.tiptap-editor .tiptap-resizable-media.is-selected img,
.tiptap-editor .tiptap-resizable-media.is-selected video,
.tiptap-editor .tiptap-resizable-media:hover img,
.tiptap-editor .tiptap-resizable-media:hover video {
  border-color: var(--primary);
}

.tiptap-media-resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  display: none;
  width: 14px;
  min-width: 0;
  height: 14px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-right: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  border-radius: 0 0 5px 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  cursor: nwse-resize;
  appearance: none;
  -webkit-appearance: none;
  transition: none;
}

.tiptap-media-delete-button {
  position: absolute;
  top: -9px;
  right: -9px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  min-width: 0;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.5);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.12);
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
  transition: none;
}

.tiptap-media-resize-handle:hover,
.tiptap-media-resize-handle:active {
  border-color: var(--primary);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.tiptap-media-delete-button:hover,
.tiptap-media-delete-button:active {
  border-color: rgba(248, 113, 113, 0.45);
  background: #fff;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.14);
  color: #dc2626;
  transform: none;
}

.tiptap-editor .tiptap-resizable-media:hover .tiptap-media-resize-handle,
.tiptap-editor .tiptap-resizable-media.is-selected .tiptap-media-resize-handle,
.tiptap-editor .tiptap-resizable-media.is-resizing .tiptap-media-resize-handle,
.tiptap-editor .tiptap-resizable-media:hover .tiptap-media-delete-button,
.tiptap-editor .tiptap-resizable-media.is-selected .tiptap-media-delete-button,
.tiptap-editor .tiptap-resizable-media.is-resizing .tiptap-media-delete-button {
  display: flex;
}

.tiptap-upload-placeholder {
  display: grid;
  gap: 8px;
  width: min(100%, 520px);
  margin: 10px 0;
  padding: 12px;
  border: 1px solid #cfe0ff;
  border-radius: 8px;
  background: #f7faff;
  color: var(--text);
  cursor: default;
}

.tiptap-upload-placeholder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 800;
}

.tiptap-upload-placeholder-head strong {
  color: var(--primary);
  font-size: 12px;
}

.tiptap-upload-placeholder-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3ebf8;
}

.tiptap-upload-placeholder-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 160ms ease;
}

.pixel-reasons > span {
  flex-basis: 100%;
  color: var(--text);
  font-weight: 760;
}

.pixel-reasons label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.pixel-usage-list {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.pixel-settings-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 14px;
  align-items: end;
}

@media (max-width: 980px) {
  .page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .upload-strip,
  .inline-actions,
  .member-form,
  .product-form {
    align-items: stretch;
    flex-direction: column;
  }

  .product-form,
  .product-row,
  .status-form {
    grid-template-columns: 1fr;
  }

  .compact-field {
    width: auto;
  }

  .inline-actions input[type="text"] {
    width: 100%;
  }

  .pixel-upload-form,
  .pixel-filter,
  .pixel-list-row,
  .pixel-preview-layout,
  .pixel-upload-result,
  .pixel-review-row,
  .pixel-review-compose-grid,
  .pixel-settings-form {
    grid-template-columns: 1fr;
  }

  .pixel-note {
    grid-column: auto;
  }

  .pixel-list-thumb-wrap,
  .pixel-list-thumb-button,
  .pixel-list-thumb,
  .pixel-upload-preview {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }

  .pixel-preview-panel {
    padding: 20px;
  }

  .pixel-review-decision-panel {
    padding: 20px;
  }

  .pixel-preview-layout {
    padding-right: 0;
  }

  .pixel-preview-image-frame {
    height: 320px;
    min-height: 260px;
  }

  .pixel-preview-meta,
  .pixel-preview-color-row {
    grid-template-columns: 1fr;
  }

  .pixel-preview-color-row {
    gap: 4px;
    align-items: start;
    padding: 10px 0;
  }

  .pixel-preview-color-row b {
    text-align: left;
  }

  .pixel-review-compose-image-frame {
    height: 360px;
    min-height: 280px;
  }

  .pixel-review-compose-meta {
    grid-template-columns: 1fr;
  }

  .pixel-row-actions,
  .modal-actions {
    justify-content: flex-start;
  }

  .pixel-report-popover,
  .upload-revision-details .revision-form {
    position: static;
    width: auto;
    margin-top: 8px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    display: none;
  }

  .page {
    max-width: none;
    padding: 16px 12px 28px;
  }

  .asset-grid,
  .task-board {
    grid-template-columns: 1fr;
  }

  .review-row,
  .member-row {
    grid-template-columns: 1fr;
  }

  .review-row img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }
}
