:root {
  --bg: #f7edf0;
  --surface: #ffffff;
  --ink: #181816;
  --muted: #7a6f70;
  --line: #e3ccd2;
  --accent: #a96f7d;
  --accent-strong: #8f5362;
  --accent-soft: #f3dfe5;
  --surface-soft: #fff8fa;
  --press-shadow: 0 9px 22px rgba(77, 49, 56, 0.09);
  --press-shadow-strong: 0 14px 32px rgba(77, 49, 56, 0.14);
  --focus-ring: 0 0 0 3px rgba(169, 111, 125, 0.22);
  --approved: #276b47;
  --failed: #9d3e36;
  --candidate: #80632f;
  --revision: #b86a18;
  --revised: #2f6572;
}

@font-face {
  font-family: "Blushy Allura";
  src: url("./assets/fonts/allura-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131;
}

@font-face {
  font-family: "Blushy Allura";
  src: url("./assets/fonts/allura-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-024F;
}

@font-face {
  font-family: "Blushy Parisienne";
  src: url("./assets/fonts/parisienne-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131;
}

@font-face {
  font-family: "Blushy Parisienne";
  src: url("./assets/fonts/parisienne-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-024F;
}

@font-face {
  font-family: "Blushy Cormorant";
  src: url("./assets/fonts/cormorant-garamond-italic-500-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131;
}

@font-face {
  font-family: "Blushy Cormorant";
  src: url("./assets/fonts/cormorant-garamond-italic-500-latin-ext.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0100-024F;
}

@font-face {
  font-family: "Blushy Playfair";
  src: url("./assets/fonts/playfair-display-italic-500-latin.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131;
}

@font-face {
  font-family: "Blushy Playfair";
  src: url("./assets/fonts/playfair-display-italic-500-latin-ext.woff2") format("woff2");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0100-024F;
}

@font-face {
  font-family: "Blushy Josefin";
  src: url("./assets/fonts/josefin-sans-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131;
}

@font-face {
  font-family: "Blushy Josefin";
  src: url("./assets/fonts/josefin-sans-400-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0100-024F;
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

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

body.is-loading {
  min-height: 100vh;
}

body.is-loading .shell {
  visibility: hidden;
}

[hidden] {
  display: none !important;
}

.loading-overlay {
  position: fixed;
  inset: 78px 0 0;
  z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.loading-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  min-height: calc(100vh - 78px);
}

.loading-sidebar {
  border-right: 1px solid var(--line);
  background: #fff6f8;
  padding: 24px;
}

.loading-brand {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.loading-brand span,
.loading-brand strong,
.loading-control,
.loading-list span,
.loading-title,
.loading-image,
.loading-versions span {
  position: relative;
  overflow: hidden;
  background: #efdde3;
}

.loading-brand span::after,
.loading-brand strong::after,
.loading-control::after,
.loading-list span::after,
.loading-title::after,
.loading-image::after,
.loading-versions span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: loading-shimmer 1.4s ease-in-out infinite;
}

.loading-brand span {
  width: 72px;
  height: 12px;
}

.loading-brand strong {
  width: 210px;
  height: 30px;
}

.loading-control {
  height: 42px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.loading-control.short {
  width: 78%;
}

.loading-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.loading-list span {
  height: 78px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.loading-detail {
  padding: 24px;
  min-width: 0;
}

.loading-title {
  width: min(420px, 58vw);
  height: 54px;
  margin-bottom: 20px;
  background: #ead6de;
}

.loading-media {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(180px, 300px);
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.loading-image {
  width: min(100%, 430px);
  aspect-ratio: 4 / 5;
  margin: 42px auto;
  border: 1px solid rgba(220, 207, 191, 0.7);
  background: #ffffff;
}

.loading-versions {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border-left: 1px solid var(--line);
}

.loading-versions span {
  height: 124px;
  border: 1px solid var(--line);
  background: #fffdf9;
}

@keyframes loading-shimmer {
  100% {
    transform: translateX(100%);
  }
}

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

button,
a,
select,
input,
textarea,
.nav-card,
.version-button,
.upload-dropzone,
.activity-item.clickable,
.product-row a {
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 120ms ease;
}

button,
a,
.nav-card,
.version-button,
.upload-dropzone,
.activity-item.clickable {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.nav-card:focus-visible,
.version-button:focus-visible,
.upload-dropzone:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

button:active,
.nav-card:active,
.version-button:active,
.upload-dropzone:active,
.activity-item.clickable:active,
.product-row a:active {
  transform: translateY(1px) scale(0.992);
}

.welcome-banner {
  position: relative;
  min-height: 78px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #fff9fb 0%, #f9edf1 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(77, 49, 56, 0.06);
}

.welcome-banner::before,
.welcome-banner::after {
  content: "";
  width: 56px;
  height: 1px;
  margin: 0 18px;
  background: var(--accent);
}

.welcome-banner p {
  margin: 0;
  color: var(--ink);
  font-family: "Bodoni 72", Didot, "Bodoni MT", Georgia, serif;
  font-size: 32px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0;
  text-align: center;
}

.activity-toggle {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 2px;
  min-width: 164px;
  border: 1px solid var(--accent);
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--press-shadow);
}

.profile-toggle {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  gap: 2px;
  min-width: 142px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--press-shadow);
}

.profile-toggle span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-toggle strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.profile-toggle:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  box-shadow: var(--press-shadow-strong);
  transform: translateY(calc(-50% - 1px));
}

.profile-toggle:active {
  transform: translateY(calc(-50% + 1px)) scale(0.992);
}

.activity-toggle span {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.activity-toggle strong {
  font-size: 12px;
  font-weight: 500;
  color: #f7edf0;
}

.activity-toggle:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: var(--press-shadow-strong);
  transform: translateY(calc(-50% - 1px));
}

.activity-toggle:active {
  transform: translateY(calc(-50% + 1px)) scale(0.992);
}

.file-mode-warning {
  border-bottom: 1px solid #d7a252;
  background: #fff2cf;
  color: #5f3b00;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: #fff6f8;
  padding: 18px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}

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

.brand strong {
  font-size: 26px;
  font-weight: 600;
}

.filters {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.filters select,
.filters input,
.secondary-action,
.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.secondary-action {
  cursor: pointer;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--press-shadow);
}

.secondary-action:hover,
.filters select:hover,
.filters input:hover,
.comment-form input:hover,
.comment-form textarea:hover {
  border-color: rgba(169, 111, 125, 0.72);
  background: var(--surface-soft);
}

.filters input:focus,
.filters select:focus,
.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.card-list {
  display: grid;
  gap: 6px;
}

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

.nav-group + .nav-group {
  margin-top: 12px;
}

.nav-group-title {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(169, 111, 125, 0.28);
  background: #f5e5ea;
  padding: 8px 10px;
  color: var(--ink);
}

.nav-group-title strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-group-title span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.nav-group-items {
  display: grid;
  gap: 4px;
}

.nav-card {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84);
}

.nav-card:hover {
  border-color: rgba(169, 111, 125, 0.72);
  background: var(--surface-soft);
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.nav-card.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  background: #fffafb;
}

.nav-card-copy {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 2px 6px;
}

.nav-card-copy strong {
  display: block;
  font-size: 15px;
  white-space: nowrap;
}

.nav-card-copy > span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-status-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  background: #fff;
}

.nav-status-mark strong {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.nav-status-mark.decision-approved {
  border-color: rgba(39, 107, 71, 0.42);
  background: #edf7f1;
}

.nav-status-mark.decision-approved strong {
  background: var(--approved);
}

.nav-status-mark.decision-revision,
.nav-status-mark.status-pending_review {
  border-color: rgba(184, 106, 24, 0.42);
  background: #fff5e7;
}

.nav-status-mark.decision-revision strong,
.nav-status-mark.status-pending_review strong {
  background: var(--revision);
}

.nav-status-mark.status-output_waiting {
  position: relative;
  border-color: rgba(173, 122, 42, 0.26);
  background: #fffaf0;
}

.nav-status-mark.status-output_waiting strong {
  display: none;
}

.nav-status-mark.status-output_waiting::before,
.nav-status-mark.status-output_waiting::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
}

.nav-status-mark.status-output_waiting::before {
  width: 26px;
  height: 26px;
  border: 3px solid #b9852f;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.nav-status-mark.status-output_waiting::after {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #b9852f;
  box-shadow:
    -8px 0 0 #b9852f,
    8px 0 0 #b9852f;
  transform: translate(-50%, -50%);
}

.nav-status-mark.decision-revised,
.nav-status-mark.status-revised {
  border-color: rgba(47, 101, 114, 0.42);
  background: #ebf5f6;
}

.nav-status-mark.decision-revised strong,
.nav-status-mark.status-revised strong {
  background: var(--revised);
  font-size: 17px;
}

.nav-status-mark.status-pending_review strong {
  font-size: 17px;
}

.nav-status-mark.decision-rejected {
  border-color: rgba(157, 62, 54, 0.42);
  background: #fff0ef;
}

.nav-status-mark.decision-rejected strong {
  background: var(--failed);
}

.nav-status-mark.status-current,
.nav-status-mark.status-candidate,
.nav-status-mark.status-unknown {
  border-color: rgba(119, 115, 107, 0.26);
  background: #fbfaf7;
}

.nav-status-mark.status-current strong,
.nav-status-mark.status-candidate strong,
.nav-status-mark.status-unknown strong {
  background: var(--muted);
}

.nav-card .mini-status {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.nav-card .mini-status .tag {
  padding: 2px 4px;
  font-size: 10px;
}

.tag {
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 3px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tag.approved {
  border-color: rgba(39, 107, 71, 0.3);
  color: var(--approved);
}

.tag.failed {
  border-color: rgba(157, 62, 54, 0.3);
  color: var(--failed);
}

.tag.candidate {
  border-color: rgba(128, 99, 47, 0.3);
  color: var(--candidate);
}

.tag.pending_review {
  border-color: rgba(184, 106, 24, 0.38);
  background: #fff8e9;
  color: var(--revision);
  font-weight: 700;
}

.tag.current {
  border-color: rgba(155, 122, 66, 0.32);
  color: var(--accent);
}

.tag.unknown {
  border-color: rgba(119, 115, 107, 0.24);
  color: var(--muted);
}

.tag.review-summary {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
  text-transform: none;
  letter-spacing: 0;
}

.decision-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid currentColor;
  padding: 3px 7px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fff;
}

.decision-tag.approved,
.nav-card .decision-tag.approved {
  color: var(--approved);
}

.decision-tag.revision,
.nav-card .decision-tag.revision {
  color: var(--revision);
}

.decision-tag.revised,
.nav-card .decision-tag.revised {
  color: var(--revised);
}

.decision-tag.rejected,
.nav-card .decision-tag.rejected {
  color: var(--failed);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, min(52vw, 570px)) minmax(250px, 1fr);
  grid-template-areas:
    "header header"
    "media details"
    "composer composer";
  align-items: start;
  gap: 12px 14px;
  padding: 16px;
  min-width: 0;
}

.detail-header {
  grid-area: header;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.detail-header p {
  margin: 0 0 5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
}

.detail-header h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.05;
}

.status-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px 12px;
  color: var(--muted);
  max-width: min(340px, 44vw);
  line-height: 1.3;
  text-align: right;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
  box-shadow: 0 12px 30px rgba(77, 49, 56, 0.06);
}

.media-panel {
  grid-area: media;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(176px, 17vw, 232px);
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 440px;
  margin-bottom: 0;
}

.media-panel.single-version {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
}

.media-panel.single-version .media-main {
  border-right: 0;
}

.media-panel.single-version .version-list {
  display: none;
}

.media-main {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  background: #fff;
  border-right: 1px solid var(--line);
  min-height: 440px;
  min-width: 0;
  overflow: hidden;
}

.image-stage {
  display: grid;
  place-items: center;
  min-height: 300px;
  padding: 12px;
}

.preview-frame {
  width: min(100%, clamp(300px, 31vw, 390px));
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.media-main img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.media-main img.active {
  display: block;
  cursor: zoom-in;
}

.decision-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 0 12px 8px;
}

.decision-bar[hidden] {
  display: none;
}

.decision-button {
  min-height: 40px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 0 rgba(77, 49, 56, 0.08);
}

.decision-button:hover {
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.decision-button span {
  margin-right: 5px;
}

.decision-button.approved:hover,
.decision-button.approved.active {
  border-color: var(--approved);
  background: #eaf4ee;
  color: var(--approved);
}

.decision-button.revision:hover,
.decision-button.revision.active {
  border-color: var(--revision);
  background: #fff2df;
  color: var(--revision);
}

.decision-button.revised:hover,
.decision-button.revised.active {
  border-color: var(--revised);
  background: #e7f2f3;
  color: var(--revised);
}

.decision-button.rejected:hover,
.decision-button.rejected.active {
  border-color: var(--failed);
  background: #fbeceb;
  color: var(--failed);
}

.download-button {
  min-height: 50px;
  margin: 0 12px 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(24, 24, 22, 0.18), var(--press-shadow);
}

.download-button span {
  font-size: 26px;
  line-height: 1;
}

.download-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: 0 7px 0 rgba(77, 49, 56, 0.18), var(--press-shadow-strong);
  transform: translateY(-1px);
}

.download-button:active {
  box-shadow: 0 2px 0 rgba(77, 49, 56, 0.18), var(--press-shadow);
}

.download-button[hidden] {
  display: none;
}

.downloaded-badge {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(39, 107, 71, 0.28);
  background: rgba(234, 244, 238, 0.94);
  color: var(--approved);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}

.downloaded-badge.main {
  top: 54px;
  right: 10px;
  padding: 6px 8px;
  box-shadow: 0 8px 20px rgba(24, 24, 22, 0.08);
}

.downloaded-badge.thumb {
  top: 36px;
  right: 6px;
  padding: 5px 6px;
  font-size: 9px;
}

.downloaded-badge.layout {
  position: static;
  padding: 6px 8px;
  white-space: nowrap;
}

.downloaded-badge.layout[hidden] {
  display: none;
}

.upload-dropzone {
  margin: 10px 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
  place-items: center;
  border: 1px dashed var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.upload-dropzone:hover {
  border-color: rgba(169, 111, 125, 0.72);
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.upload-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--focus-ring);
}

.upload-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-dropzone strong {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-dropzone span,
.upload-status {
  font-size: 12px;
}

.upload-status {
  min-height: 18px;
  margin: 0 12px 12px;
  color: var(--accent);
  text-align: center;
}

.image-modal {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #111;
  color: #fff;
  overflow: hidden;
}

.image-modal::backdrop {
  background: rgba(0, 0, 0, 0.88);
}

.image-modal[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.activity-modal {
  width: min(900px, calc(100vw - 40px));
  max-width: none;
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(77, 49, 56, 0.24);
}

.activity-modal::backdrop {
  background: rgba(24, 24, 22, 0.46);
}

.activity-modal[open] {
  display: block;
}

.profile-modal {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 70px rgba(77, 49, 56, 0.24);
}

.profile-modal::backdrop {
  background: rgba(24, 24, 22, 0.42);
}

.profile-modal[open] {
  display: block;
}

.profile-card {
  display: grid;
}

.profile-card-header {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #fff6f8;
}

.profile-card-header span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-card-header strong {
  font-size: 20px;
  line-height: 1.2;
}

.profile-options {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.profile-options button {
  min-height: 74px;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--press-shadow);
}

.profile-options button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  box-shadow: var(--press-shadow-strong);
  transform: translateY(-1px);
}

.profile-options button strong {
  font-size: 16px;
}

.profile-options button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.activity-modal .activity-panel {
  border: 0;
  min-height: 0;
}

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

.activity-actions [data-close-activity] {
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.activity-modal .activity-list {
  max-height: min(560px, calc(100vh - 210px));
}

.batch-label-modal {
  width: min(620px, calc(100vw - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.batch-label-modal::backdrop {
  background: rgba(24, 24, 22, 0.42);
}

.batch-label-modal .modal-toolbar {
  border-bottom: 1px solid var(--line);
  background: #fff6f8;
}

.batch-label-modal .modal-toolbar > span {
  color: var(--ink);
  font-weight: 700;
}

.batch-label-fields {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.batch-label-row {
  display: grid;
  gap: 6px;
}

.batch-label-row span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.batch-label-row input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 10px 12px;
  outline: none;
}

.batch-label-row input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.batch-label-status {
  min-height: 22px;
  padding: 0 18px;
  color: var(--revision);
  font-size: 13px;
}

.batch-label-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px;
  border-top: 1px solid var(--line);
}

.batch-label-actions button,
.batch-label-modal [data-close-batch-labels] {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--press-shadow);
}

.batch-label-actions button:hover,
.batch-label-modal [data-close-batch-labels]:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.batch-label-actions button[type="submit"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--surface);
}

.batch-label-actions button[type="submit"]:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.delete-confirm-modal {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  border: 1px solid var(--line);
  padding: 0;
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: 0 22px 60px rgba(77, 49, 56, 0.24);
}

.delete-confirm-modal::backdrop {
  background: rgba(24, 24, 22, 0.42);
}

.delete-confirm-modal .modal-toolbar {
  border-bottom: 1px solid var(--line);
  background: #fff6f8;
}

.delete-confirm-modal .modal-toolbar > span {
  color: var(--ink);
  font-weight: 800;
}

.delete-confirm-modal [data-close-delete-confirm] {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: var(--press-shadow);
}

.delete-confirm-box {
  display: grid;
}

.delete-confirm-body {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.delete-confirm-body strong {
  font-size: 18px;
  line-height: 1.25;
}

.delete-confirm-body span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.delete-confirm-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.delete-confirm-status {
  min-height: 18px;
  color: var(--failed);
  font-size: 12px;
  font-weight: 700;
}

.delete-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 18px 18px;
}

.delete-confirm-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--press-shadow);
}

.delete-confirm-actions button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.delete-confirm-actions #deleteConfirmYes {
  background: var(--failed);
  border-color: var(--failed);
  color: #fff;
}

.delete-confirm-actions #deleteConfirmYes:disabled {
  opacity: 0.6;
  cursor: wait;
}

.modal-toolbar {
  min-height: 64px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #353535;
  background: #181818;
}

.modal-toolbar > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #d5d5d5;
  font-size: 13px;
}

.zoom-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.zoom-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid #444;
  background: #242424;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.zoom-controls button:hover {
  background: #363636;
}

.zoom-stage {
  min-width: 0;
  min-height: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.zoom-stage img {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
}

.zoom-stage img.zoomed {
  cursor: grab;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.version-list {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  max-height: 70vh;
  overflow: auto;
  background: #fff6f8;
}

.version-button {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 8px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84);
}

.version-button:hover {
  border-color: rgba(169, 111, 125, 0.72);
  background: var(--surface-soft);
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.version-button.decision-approved {
  border-color: rgba(39, 107, 71, 0.5);
}

.version-button.decision-revision,
.version-button.status-pending_review {
  border-color: rgba(184, 106, 24, 0.5);
}

.version-button.decision-revised,
.version-button.status-revised {
  border-color: rgba(47, 101, 114, 0.5);
}

.version-button.decision-rejected {
  border-color: rgba(157, 62, 54, 0.5);
}

.version-button.active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 10px 28px rgba(77, 49, 56, 0.1);
}

.version-image-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid #eee9df;
  background: #fff;
}

.version-number-badge {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 24, 22, 0.16);
  border-radius: 999px;
  background: rgba(24, 24, 22, 0.88);
  color: #fff;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(24, 24, 22, 0.18);
  pointer-events: none;
}

.version-number-badge.main {
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.version-number-badge.thumb {
  top: 7px;
  right: 7px;
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.version-source-badge {
  position: absolute;
  z-index: 4;
  top: 8px;
  left: 8px;
  border: 1px solid rgba(122, 78, 91, 0.24);
  border-radius: 3px;
  background: rgba(255, 249, 251, 0.94);
  color: #754452;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 6px;
  pointer-events: none;
}

.version-source-badge.thumb {
  top: 5px;
  left: 5px;
  font-size: 9px;
  padding: 4px 5px;
}

.version-button img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #fff;
}

.version-state {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
}

.version-state.decision-approved {
  background: rgba(39, 107, 71, 0.92);
}

.version-state.decision-revision,
.version-state.status-pending_review {
  background: rgba(184, 106, 24, 0.92);
}

.version-state.status-output_waiting {
  background: rgba(173, 122, 42, 0.92);
}

.version-state.decision-revised,
.version-state.status-revised {
  background: rgba(47, 101, 114, 0.92);
}

.version-state.decision-rejected {
  background: rgba(157, 62, 54, 0.92);
}

.version-state.status-current,
.version-state.status-candidate,
.version-state.status-unknown {
  background: rgba(24, 24, 22, 0.62);
}

.version-button small {
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.grid {
  grid-area: details;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-width: 0;
}

.layout-editor {
  grid-area: composer;
  width: 100%;
  margin-top: 2px;
}

.layout-editor-heading {
  align-items: center;
}

.layout-editor-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.layout-editor-heading-actions {
  display: flex !important;
  align-items: center;
  justify-content: end;
  gap: 10px !important;
}

#layoutEditorToggle {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--accent-strong);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}

#layoutEditorToggle:hover {
  background: var(--surface-soft);
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

#layoutEditorToggle:active {
  transform: translateY(1px) scale(0.992);
}

.layout-editor-heading strong {
  font-size: 16px;
}

.layout-editor-heading > div span {
  max-width: min(560px, 60vw);
  text-align: left;
}

#layoutEditorStatus[data-state="dirty"] { color: var(--revision); }
#layoutEditorStatus[data-state="saved"] { color: var(--approved); }
#layoutEditorStatus[data-state="error"] { color: var(--failed); }

.layout-editor-body {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 270px);
  gap: 22px;
  padding: 20px;
  background: var(--surface-soft);
}

.layout-editor-body[hidden] { display: none; }

.layout-stage-column {
  display: grid;
  place-items: center;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.layout-boundary-legend {
  width: min(100%, 540px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.layout-boundary-legend > span {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.layout-boundary-key {
  width: 22px;
  height: 14px;
  flex: 0 0 auto;
  background: #fff;
}

.layout-boundary-key.output { border: 2px solid var(--ink); }
.layout-boundary-key.safe { border: 2px dashed var(--accent-strong); }

.layout-canvas-shell {
  position: relative;
  width: min(100%, 540px);
}

.layout-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--ink);
  box-shadow: 0 10px 28px rgba(77, 49, 56, 0.08);
  touch-action: none;
}

.layout-canvas::before {
  content: "";
  position: absolute;
  inset: 19.2% 17% 16.8%;
  z-index: 10000;
  opacity: 0.4;
  background:
    repeating-linear-gradient(90deg, var(--accent-strong) 0 10px, transparent 10px 26px) top / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--accent-strong) 0 10px, transparent 10px 26px) bottom / 100% 2px no-repeat,
    repeating-linear-gradient(0deg, var(--accent-strong) 0 10px, transparent 10px 26px) left / 2px 100% no-repeat,
    repeating-linear-gradient(0deg, var(--accent-strong) 0 10px, transparent 10px 26px) right / 2px 100% no-repeat;
  pointer-events: none;
}

.layout-output-badge {
  position: absolute;
  z-index: 10002;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
}

.layout-output-badge {
  top: 10px;
  left: 10px;
  border: 1px solid var(--ink);
}

.layout-boundary-note {
  width: min(100%, 540px);
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
}

.layout-boundary-note strong { color: var(--ink); }

.layout-canvas:focus-visible {
  outline: 0;
  border-color: var(--accent);
  box-shadow: var(--focus-ring), 0 10px 28px rgba(77, 49, 56, 0.08);
}

.layout-fixed-template {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.layout-canvas:empty::after {
  content: "Ürünler hazırlanıyor";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 600;
  z-index: 10001;
}

.layout-item {
  --layout-rotation: 0deg;
  --layout-flip-x: 1;
  position: absolute;
  display: block;
  height: auto;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  cursor: grab;
  touch-action: none;
  transform: rotate(var(--layout-rotation)) scaleX(var(--layout-flip-x));
  transform-origin: center;
}

.layout-item:active {
  cursor: grabbing;
  transform: rotate(var(--layout-rotation)) scaleX(var(--layout-flip-x));
}

.layout-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(169, 111, 125, 0.2);
}

.layout-resize-handle {
  position: absolute;
  z-index: 2;
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(77, 49, 56, 0.2);
  touch-action: none;
}

.layout-item.selected .layout-resize-handle { display: block; }
.layout-resize-handle.nw { top: -9px; left: -9px; cursor: nwse-resize; }
.layout-resize-handle.ne { top: -9px; right: -9px; cursor: nesw-resize; }
.layout-resize-handle.se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.layout-resize-handle.sw { bottom: -9px; left: -9px; cursor: nesw-resize; }

.layout-rotate-handle {
  position: absolute;
  top: -48px;
  left: 50%;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: none;
  border: 2px solid var(--accent-strong);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(77, 49, 56, 0.2);
  cursor: grab;
  touch-action: none;
  transform: translateX(-50%);
}

.layout-rotate-handle::before {
  content: "↻";
  color: var(--accent-strong);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
}

.layout-rotate-handle::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 50%;
  width: 1px;
  height: 20px;
  background: var(--accent-strong);
  transform: translateX(-50%);
}

.layout-item-arrow.selected .layout-rotate-handle {
  display: grid;
  place-items: center;
}
.layout-rotate-handle:active { cursor: grabbing; }

.layout-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.layout-item-arrow,
.layout-item-label {
  overflow: visible;
}

.layout-tools {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.layout-source-summary {
  display: grid;
  gap: 4px;
  min-height: 84px;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.layout-source-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.layout-size-control {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.layout-size-control label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

.layout-size-control output {
  color: var(--muted);
  font-weight: 500;
}

.layout-size-control input {
  width: 100%;
  accent-color: var(--accent-strong);
}

.layout-style-control {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.layout-style-control > span {
  font-size: 12px;
  font-weight: 700;
}

.layout-arrow-choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 46px;
  gap: 6px;
}

.layout-arrow-choices button,
.layout-font-choices button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.layout-arrow-choices button {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 100%;
  padding: 5px;
}

.layout-arrow-choices img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.layout-font-choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 62px;
  gap: 6px;
}

.layout-font-choices button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  height: 100%;
  padding: 4px 2px;
  text-align: center;
}

.layout-font-choices strong {
  font-size: 21px;
  line-height: 1;
}

.layout-font-choices small {
  max-width: 100%;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.layout-arrow-choices button:hover,
.layout-font-choices button:hover,
.layout-arrow-choices button.active,
.layout-font-choices button.active {
  border-color: var(--accent-strong);
  background: var(--surface-soft);
  box-shadow: var(--press-shadow);
}

.layout-arrow-choices button.active,
.layout-font-choices button.active {
  outline: 2px solid rgba(169, 111, 125, 0.18);
}

.layout-item-actions,
.layout-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.layout-item-actions button,
.layout-primary-actions button,
.layout-reset {
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}

.layout-item-actions button:last-child { grid-column: 1 / -1; }

#layoutFlip.active {
  border-color: var(--accent-strong);
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.layout-item-actions button:hover:not(:disabled),
.layout-primary-actions button:hover,
.layout-reset:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.layout-item-actions button:disabled,
.layout-size-control input:disabled,
.layout-primary-actions button:disabled,
.layout-reset:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.layout-primary-actions button:first-child {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.layout-primary-actions button:last-child {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.layout-reset {
  margin-top: auto;
  color: var(--ink);
}

.panel-title {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  color: var(--ink);
}

.panel-title span {
  color: var(--muted);
  font-weight: 400;
  font-size: 12px;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
}

.products {
  display: grid;
}

.selected-decision-mark {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.decision-mark {
  min-height: 70px;
  border: 2px solid var(--line);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #fff;
}

.decision-mark strong {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
}

.decision-mark span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.decision-mark.decision-approved {
  border-color: rgba(39, 107, 71, 0.42);
  background: #edf7f1;
}

.decision-mark.decision-approved strong {
  background: var(--approved);
}

.decision-mark.decision-revision,
.decision-mark.status-pending_review {
  border-color: rgba(184, 106, 24, 0.42);
  background: #fff5e7;
}

.decision-mark.decision-revision strong,
.decision-mark.status-pending_review strong {
  background: var(--revision);
}

.decision-mark.status-output_waiting {
  border-color: rgba(173, 122, 42, 0.34);
  background: #fff8e9;
}

.decision-mark.status-output_waiting strong {
  background: #b9852f;
}

.decision-mark.decision-revised,
.decision-mark.status-revised {
  border-color: rgba(47, 101, 114, 0.42);
  background: #ebf5f6;
}

.decision-mark.decision-revised strong,
.decision-mark.status-revised strong {
  background: var(--revised);
  font-size: 28px;
}

.decision-mark.status-pending_review strong {
  font-size: 28px;
}

.decision-mark.decision-rejected {
  border-color: rgba(157, 62, 54, 0.42);
  background: #fff0ef;
}

.decision-mark.decision-rejected strong {
  background: var(--failed);
}

.decision-mark.status-current,
.decision-mark.status-candidate,
.decision-mark.status-unknown {
  border-color: rgba(119, 115, 107, 0.26);
  background: #fbfaf7;
}

.decision-mark.status-current strong,
.decision-mark.status-candidate strong,
.decision-mark.status-unknown strong {
  background: var(--muted);
}

.product-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.product-row > * {
  min-width: 0;
}

.product-row:last-child {
  border-bottom: 0;
}

.product-row .num {
  color: var(--muted);
  text-align: right;
}

.product-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 3px;
  overflow-wrap: anywhere;
}

.product-row span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.product-row a {
  color: var(--accent);
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 7px 9px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.84);
}

.product-row a:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.comments-panel {
  min-height: 360px;
}

.comments {
  display: grid;
  gap: 10px;
  padding: 14px;
  max-height: 320px;
  overflow: auto;
}

.comment {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  padding: 10px;
}

.comment.other-version {
  background: #fff;
}

.comment strong {
  display: block;
  margin-bottom: 4px;
}

.comment p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
}

.comment time {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.comment-version {
  display: inline-block;
  margin-left: 8px;
  color: var(--accent-strong);
  font-weight: 800;
}

.comment-form {
  border-top: 1px solid var(--line);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.comment-form textarea {
  min-height: 92px;
  resize: vertical;
}

.comment-form button {
  background: var(--ink);
  color: white;
  border: 0;
  padding: 11px 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(24, 24, 22, 0.16), var(--press-shadow);
}

.comment-form button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.comment-form button:active {
  box-shadow: 0 1px 0 rgba(77, 49, 56, 0.18), var(--press-shadow);
}

.activity-panel {
  min-height: 300px;
}

.panel-title button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  padding: 6px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--press-shadow);
}

.panel-title button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: translateY(-1px);
}

.activity-intro {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.activity-intro span {
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 600;
}

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

.activity-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: var(--press-shadow);
}

.activity-tabs button:hover {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-1px);
}

.activity-tabs button.active {
  border-color: var(--accent-strong);
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.78), var(--press-shadow);
}

.activity-tabs button:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 0 rgba(77, 49, 56, 0.16), var(--press-shadow);
}

.activity-list {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
}

.activity-item {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  text-align: left;
}

.activity-item.clickable {
  cursor: pointer;
}

.activity-item.clickable:hover {
  border-color: var(--accent);
  background: #fff;
  box-shadow: var(--press-shadow);
  transform: translateY(-1px);
}

.activity-item.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.activity-time {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

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

.activity-body strong {
  font-size: 13px;
}

.activity-body p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.activity-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.activity-chip {
  width: fit-content;
  border: 1px solid currentColor;
  padding: 2px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-chip.approved {
  color: var(--approved);
}

.activity-chip.revision {
  color: var(--revision);
}

.activity-chip.revised {
  color: var(--revised);
}

.activity-chip.rejected {
  color: var(--failed);
}

.approval-confetti {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  overflow: hidden;
}

.approval-confetti-piece {
  position: fixed;
  left: var(--x);
  top: var(--y);
  width: var(--piece-width);
  height: var(--piece-height);
  border-radius: 2px;
  background: var(--piece-color);
  box-shadow: 0 2px 6px rgba(77, 49, 56, 0.14);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7) rotate(0deg);
  animation: approval-confetti-burst 820ms cubic-bezier(0.18, 0.82, 0.28, 1) forwards;
  animation-delay: var(--delay);
}

@keyframes approval-confetti-burst {
  8% {
    opacity: 1;
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1) rotate(var(--rot));
  }
}

.revision-thanks {
  position: fixed;
  inset: 0;
  z-index: 121;
  pointer-events: none;
  overflow: hidden;
}

.revision-thanks span {
  position: fixed;
  left: var(--x);
  top: var(--y);
  padding: 5px 8px;
  border: 1px solid rgba(184, 106, 24, 0.24);
  background: rgba(255, 248, 250, 0.94);
  color: var(--revision);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(77, 49, 56, 0.12);
  opacity: 0;
  transform: translate(-50%, -50%) scale(var(--scale));
  animation: revision-thanks-float 760ms cubic-bezier(0.17, 0.8, 0.28, 1) forwards;
  animation-delay: var(--delay);
}

@keyframes revision-thanks-float {
  10% {
    opacity: 1;
  }

  65% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.96);
  }
}

@media (max-width: 1180px) {
  .detail {
    grid-template-columns: minmax(0, min(50vw, 520px)) minmax(230px, 1fr);
  }

  .preview-frame {
    width: min(100%, clamp(280px, 30vw, 360px));
  }

  .version-list {
    max-height: 64vh;
  }
}

@media (max-width: 1040px) {
  .shell,
  .loading-shell {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  }

  .detail {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "header"
      "media"
      "details"
      "composer";
  }

  .media-panel {
    margin-bottom: 0;
  }

  .layout-editor-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .layout-tools {
    width: min(100%, 540px);
    justify-self: center;
  }
}

@media (max-width: 900px) {
  .shell,
  .loading-shell,
  .media-panel,
  .loading-media,
  .grid {
    grid-template-columns: 1fr;
  }

  .loading-overlay {
    position: absolute;
  }

  .loading-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .image-stage {
    place-items: center;
  }

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

  .media-main {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .loading-versions {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .welcome-banner {
    flex-wrap: wrap;
    gap: 10px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .activity-toggle {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    max-width: 340px;
    text-align: center;
  }

  .profile-toggle {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    max-width: 340px;
    text-align: center;
  }

  .activity-toggle:hover {
    transform: translateY(-1px);
  }

  .activity-toggle:active {
    transform: translateY(1px) scale(0.992);
  }

  .profile-toggle:hover {
    transform: translateY(-1px);
  }

  .profile-toggle:active {
    transform: translateY(1px) scale(0.992);
  }
}

@media (max-width: 620px) {
  .welcome-banner {
    min-height: 118px;
    padding: 18px 16px;
  }

  .loading-overlay {
    inset: 118px 0 0;
  }

  .loading-shell {
    min-height: calc(100vh - 118px);
  }

  .welcome-banner::before,
  .welcome-banner::after {
    width: 26px;
    margin: 0 10px;
  }

  .welcome-banner p {
    font-size: 28px;
  }

  .detail,
  .loading-detail,
  .sidebar {
    padding: 16px;
  }

  .product-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .activity-intro {
    display: grid;
  }

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

  .image-stage {
    min-height: 380px;
    padding: 12px;
  }

  .preview-frame {
    width: min(100%, 360px);
  }

  .download-button {
    margin: 0 12px 12px;
  }

  .decision-bar {
    grid-template-columns: 1fr;
    margin: 0 12px 12px;
  }

  .modal-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .zoom-controls {
    width: 100%;
  }

  .zoom-controls button {
    flex: 1;
  }

  .zoom-stage {
    padding: 12px;
  }

  .product-row a {
    grid-column: 2;
    justify-self: start;
  }

  .layout-editor-body {
    gap: 16px;
    padding: 12px;
  }

  .layout-editor-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .layout-editor-heading-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .layout-boundary-legend { grid-template-columns: 1fr; }

  .layout-item-actions,
  .layout-primary-actions { grid-template-columns: 1fr; }

  .layout-item-actions button:last-child { grid-column: auto; }
}

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

  button:active,
  .nav-card:active,
  .version-button:active,
  .upload-dropzone:active,
  .activity-item.clickable:active,
  .product-row a:active,
  .activity-toggle:hover,
  .activity-toggle:active,
  .profile-toggle:hover,
  .profile-toggle:active {
    transform: none;
  }
}
