:root {
  --paper: #fff8ed;
  --ink: #211a1d;
  --muted: #6f6267;
  --line: #2d2529;
  --coral: #ff675d;
  --teal: #15b8a6;
  --yellow: #ffe15a;
  --violet: #8d6bff;
  --green: #8ac75a;
  --white: #fffdf8;
  --shadow: 8px 8px 0 #211a1d;
  --soft-shadow: 0 18px 50px rgba(33, 26, 29, 0.16);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12px 12px, rgba(33, 26, 29, 0.12) 1px, transparent 1.5px),
    linear-gradient(135deg, #fff8ed 0%, #f4fff5 44%, #fff0f0 100%);
  background-size: 24px 24px, auto;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  cursor: pointer;
}

a.icon-button {
  text-decoration: none;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.studio-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.kicker,
.section-label {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2.35rem;
  line-height: 1;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--line);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--line);
  transform: translate(-2px, -2px);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}

.start-screen {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.start-copy,
.person-card,
.start-lane,
.manager-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.start-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.start-lane {
  min-width: 0;
  padding: 16px;
}

.lane-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.lane-number {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
}

.start-lane .people-grid {
  grid-template-columns: 1fr;
}

.maker-entry {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.maker-entry:hover,
.maker-entry:focus-visible {
  box-shadow: 11px 11px 0 var(--line);
  transform: translate(-2px, -2px);
}

.maker-entry-body {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 18px;
  height: 100%;
}

.maker-entry-body > div:last-child {
  display: grid;
  gap: 8px;
}

.maker-entry-body strong,
.maker-entry-body span,
.maker-entry-body em {
  display: block;
}

.maker-entry-body strong {
  font-size: 1.3rem;
}

.maker-entry-body span {
  color: var(--muted);
  line-height: 1.4;
}

.maker-entry-body em {
  font-style: normal;
  font-weight: 900;
}

.garment-mark {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(33, 26, 29, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(33, 26, 29, 0.08) 1px, transparent 1px),
    #dff9f3;
  background-size: 22px 22px;
}

.garment-body,
.garment-sleeve,
.garment-print {
  position: absolute;
  display: block;
  border: 2px solid var(--line);
}

.garment-body {
  left: 50%;
  top: 48px;
  width: 150px;
  height: 190px;
  border-radius: 8px 8px 28px 28px;
  background: var(--white);
  transform: translateX(-50%);
}

.garment-sleeve {
  top: 62px;
  width: 82px;
  height: 92px;
  background: var(--white);
}

.garment-sleeve.left {
  left: calc(50% - 130px);
  transform: rotate(24deg);
}

.garment-sleeve.right {
  right: calc(50% - 130px);
  transform: rotate(-24deg);
}

.garment-print {
  left: 50%;
  top: 96px;
  z-index: 2;
  width: 76px;
  height: 82px;
  border-style: dashed;
  background: var(--coral);
  transform: translateX(-50%) rotate(-4deg);
}

.start-copy {
  position: sticky;
  top: 18px;
  padding: 20px;
}

.start-copy h2 {
  margin-bottom: 12px;
  font-size: 2rem;
}

.start-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.person-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  min-height: 230px;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.person-card:hover,
.person-card:focus-visible {
  box-shadow: 11px 11px 0 var(--line);
  transform: translate(-2px, -2px);
}

.person-image {
  display: block;
  min-height: 230px;
  background: #f0e5ff;
}

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

.person-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.person-copy strong {
  font-size: 1.25rem;
  line-height: 1.1;
}

.person-copy span {
  color: var(--muted);
  line-height: 1.4;
}

.person-copy em {
  margin-top: auto;
  font-style: normal;
  font-weight: 900;
}

.gallery-zone,
.panel-card,
.art-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow);
}

.gallery-zone {
  padding: 18px;
}

.section-topline,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

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

.gallery-subtitle {
  max-width: 62ch;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.count-pill {
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 0.9rem;
  font-weight: 800;
}

.tag-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0;
}

.tag-button,
.reaction-button,
.text-button,
.primary-button {
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tag-button {
  min-height: 38px;
  padding: 8px 13px;
  background: #ecfbff;
}

.tag-button.is-active {
  background: var(--teal);
  color: #071615;
  box-shadow: 3px 3px 0 var(--line);
}

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

.art-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  transform: rotate(var(--tilt));
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.art-card:hover,
.art-card:focus-within {
  box-shadow: 11px 11px 0 var(--line);
  transform: rotate(0deg) translate(-2px, -2px);
}

.art-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.art-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f0e5ff;
}

.art-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.01);
  transition: transform 220ms ease;
}

.art-card:hover .art-media img {
  transform: scale(1.05);
}

.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: var(--white);
}

.favorite-button.is-active {
  background: var(--coral);
  color: var(--white);
}

.art-copy {
  min-height: 124px;
  padding: 13px;
}

.art-copy h3 {
  margin: 0 0 7px;
  font-size: 1.1rem;
  line-height: 1.18;
}

.art-copy p {
  margin-bottom: 12px;
  color: var(--muted);
  line-height: 1.42;
}

.chip-row,
.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 5px 8px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff4c6;
  font-size: 0.78rem;
  font-weight: 800;
}

.studio-panel {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}

.panel-card {
  padding: 16px;
}

.color-card {
  background: #fbf1ff;
}

.color-card h2 {
  margin-bottom: 16px;
}

.swatch-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.swatch-row span {
  min-height: 46px;
  border: 2px solid var(--line);
  border-radius: 7px;
  background: var(--swatch);
  box-shadow: 3px 3px 0 var(--line);
}

.text-button {
  min-height: 34px;
  padding: 6px 10px;
  background: var(--white);
  box-shadow: 2px 2px 0 var(--line);
  font-size: 0.82rem;
}

.mini-list {
  display: grid;
  gap: 9px;
}

.mini-item {
  min-width: 0;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.mini-item strong,
.mini-item span {
  display: block;
  overflow-wrap: anywhere;
}

.mini-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.empty-state {
  margin: 0;
  padding: 10px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.35;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100% - 28px));
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--line);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.art-dialog {
  width: min(1120px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.art-dialog::backdrop {
  background: rgba(33, 26, 29, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
}

.dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  min-height: 620px;
}

.dialog-art-wrap {
  display: grid;
  place-items: center;
  min-height: 520px;
  padding: 22px;
  background:
    linear-gradient(90deg, rgba(33, 26, 29, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(33, 26, 29, 0.08) 1px, transparent 1px),
    #dff9f3;
  background-size: 22px 22px;
}

.dialog-art-wrap img {
  width: auto;
  height: auto;
  max-width: min(100%, 720px);
  max-height: min(78vh, 760px);
  object-fit: contain;
  border: 2px solid var(--line);
  border-radius: 8px;
  box-shadow: 7px 7px 0 var(--line);
}

.dialog-copy {
  overflow: auto;
  padding: 34px 24px 24px;
}

.dialog-copy h2 {
  margin-bottom: 10px;
  font-size: 1.8rem;
}

.dialog-copy p {
  color: var(--muted);
  line-height: 1.55;
}

.reaction-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 20px 0;
}

.reaction-button {
  min-height: 50px;
  padding: 8px 10px;
  background: #eef7ff;
  box-shadow: 3px 3px 0 var(--line);
}

.reaction-button.is-active {
  background: var(--violet);
  color: var(--white);
}

.comment-form {
  display: grid;
  gap: 9px;
  margin-bottom: 18px;
}

.comment-form label {
  font-weight: 900;
}

.comment-form textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf2;
  color: var(--ink);
}

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

.form-bottom span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.primary-button {
  min-height: 42px;
  padding: 9px 13px;
  background: var(--green);
  box-shadow: 3px 3px 0 var(--line);
}

.tag-button:hover,
.reaction-button:hover,
.text-button:hover,
.primary-button:hover,
.tag-button:focus-visible,
.reaction-button:focus-visible,
.text-button:focus-visible,
.primary-button:focus-visible {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--line);
}

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

.comment {
  padding: 11px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #f5ffe8;
}

.comment p {
  margin-bottom: 8px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.comment time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.manager-shell main {
  display: block;
}

.manager-login {
  max-width: 440px;
}

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

.manager-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.manager-card h2 {
  margin-bottom: 8px;
}

.manager-card label,
.manager-card .check-row {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.manager-card input,
.manager-card select,
.manager-card textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fffaf2;
  color: var(--ink);
}

.manager-card .check-row {
  display: flex;
  align-items: center;
  color: var(--ink);
}

.manager-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.manager-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.maker-manager-products {
  display: grid;
  gap: 8px;
}

.manager-card .product-manager-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 110px;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.manager-card .product-manager-row input[type="number"] {
  padding: 7px 8px;
}

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

.designer-admin-list,
.design-admin-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.danger-button {
  background: #ffe0df;
}

.wide-card {
  grid-column: 1 / -1;
}

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

.manager-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

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

.manager-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.manager-row img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 2px solid var(--line);
  border-radius: 7px;
}

.manager-row strong,
.manager-row span {
  display: block;
  overflow-wrap: anywhere;
}

.manager-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 1040px) {
  .start-screen {
    grid-template-columns: 1fr;
  }

  .start-copy {
    position: static;
  }

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

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

  .studio-panel {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .dialog-copy {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 640px);
    padding-top: 16px;
  }

  .studio-header {
    align-items: flex-start;
  }

  h1 {
    font-size: 1.9rem;
  }

  .gallery-zone,
  .panel-card {
    box-shadow: 5px 5px 0 var(--line);
  }

  .gallery-grid,
  .studio-panel,
  .people-grid,
  .start-paths,
  .manager-grid,
  .manager-list,
  .designer-admin-list,
  .design-admin-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .person-card {
    grid-template-columns: 1fr;
  }

  .section-topline {
    align-items: flex-start;
    flex-direction: column;
  }

  .dialog-grid {
    min-height: auto;
  }

  .dialog-art-wrap {
    min-height: auto;
    padding: 18px;
  }

  .dialog-copy {
    padding: 22px 16px 18px;
  }

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