@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Manrope:wght@400;500;600;700&display=swap");

:root {
  --bg: #eadfce;
  --bg-deep: #d4c2ab;
  --panel: rgba(253, 250, 244, 0.82);
  --panel-strong: rgba(255, 252, 247, 0.96);
  --panel-dark: rgba(34, 23, 14, 0.92);
  --line: rgba(72, 55, 38, 0.14);
  --line-strong: rgba(72, 55, 38, 0.24);
  --text: #22170e;
  --muted: #685746;
  --soft: rgba(104, 87, 70, 0.74);
  --accent: #8c4f30;
  --accent-soft: rgba(140, 79, 48, 0.12);
  --cream: #fff9f1;
  --shadow: 0 26px 80px rgba(42, 26, 11, 0.12);
  --shadow-soft: 0 14px 34px rgba(42, 26, 11, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.8), transparent 25%),
    radial-gradient(circle at bottom right, rgba(197, 140, 84, 0.18), transparent 28%),
    linear-gradient(180deg, #f5ecdf 0%, var(--bg) 62%, var(--bg-deep) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(96, 74, 53, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 74, 53, 0.03) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at center, black 32%, transparent 88%);
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  width: min(1600px, calc(100vw - 34px));
  margin: 0 auto;
  padding: 20px 0 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 6px 4px 22px;
}

.brand-lockup {
  max-width: 720px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(104, 87, 70, 0.82);
}

.topbar h1,
.board-head h2,
.work-card h2,
.chat-head h2,
.sidebar-card h3 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  letter-spacing: -0.04em;
}

.topbar h1 {
  font-size: clamp(2.8rem, 5vw, 5.4rem);
  line-height: 0.9;
}

.topbar-copy {
  margin: 14px 0 0;
  max-width: 42rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.status-pile {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.82);
  box-shadow: var(--shadow-soft);
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, #c77743, #88401e);
  box-shadow: 0 0 0 5px rgba(199, 119, 67, 0.16);
}

.topbar-hint {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(104, 87, 70, 0.74);
}

.studio-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 430px);
  gap: 18px;
  min-height: calc(100vh - 150px);
}

.layout-pane,
.chat-pane {
  min-width: 0;
}

.layout-pane {
  display: grid;
  gap: 16px;
}

.board-shell,
.work-card,
.chat-shell {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.94), rgba(247, 239, 228, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.board-shell {
  padding: 18px;
  border-radius: 34px;
}

.board-head,
.section-head,
.chat-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.board-head {
  margin-bottom: 14px;
}

.board-head h2,
.work-card h2,
.chat-head h2 {
  font-size: 2rem;
}

.board-role {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}

.board-stage {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  min-height: 680px;
}

.board-sidebar {
  display: grid;
  gap: 14px;
}

.sidebar-card {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.54), rgba(255, 248, 239, 0.86));
  box-shadow: var(--shadow-soft);
}

.sidebar-card h3 {
  font-size: 1.9rem;
  margin-bottom: 8px;
}

.lede {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.move-rail {
  display: grid;
  gap: 10px;
}

.move-card {
  border-radius: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.move-card strong,
.chat-bubble strong,
.brief-summary strong,
.agent-meta strong {
  display: block;
}

.move-card strong {
  margin-bottom: 6px;
  color: var(--text);
}

.move-card p {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}

.canvas-shell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 12px;
}

.canvas-frame {
  position: relative;
  min-height: 0;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background:
    linear-gradient(180deg, rgba(32, 22, 14, 0.98), rgba(15, 10, 7, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.canvas-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(212, 157, 101, 0.18), transparent 26%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.14) 100%);
  pointer-events: none;
}

#mainImage {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 680px;
  object-fit: contain;
  object-position: center;
  padding: 18px;
}

.image-notes {
  margin: 0;
  padding: 0 6px;
  color: var(--muted);
  line-height: 1.55;
}

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

.thumb-card {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.56);
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.thumb-card img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 10px;
}

.thumb-card strong {
  margin-bottom: 4px;
}

.thumb-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.thumb-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(140, 79, 48, 0.36);
  background: rgba(140, 79, 48, 0.1);
  box-shadow: 0 14px 32px rgba(42, 26, 11, 0.12);
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
}

.work-card {
  padding: 20px;
  border-radius: 28px;
}

.lock-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  gap: 10px;
}

.lock-list li,
.brief-summary article,
.agent-meta article {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.58);
}

.lock-list li {
  padding: 14px 16px;
  line-height: 1.5;
  color: var(--muted);
}

.prompt-output {
  margin: 12px 0 0;
  min-height: 260px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  white-space: pre-wrap;
  line-height: 1.58;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.88rem;
}

.chat-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 14px;
  height: 100%;
  min-height: calc(100vh - 150px);
  padding: 18px;
  border-radius: 34px;
}

.agent-meta {
  display: grid;
  gap: 8px;
  min-width: 180px;
}

.agent-meta article {
  padding: 12px;
}

.fact-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: rgba(104, 87, 70, 0.82);
}

.chat-brief {
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.brief-summary {
  display: grid;
  gap: 10px;
}

.brief-summary article {
  padding: 14px;
}

.brief-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.chat-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 12px;
  padding-right: 4px;
}

.chat-bubble {
  max-width: 92%;
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.55;
  box-shadow: var(--shadow-soft);
}

.chat-bubble p {
  margin: 6px 0 0;
}

.chat-bubble small {
  display: block;
  margin-top: 8px;
  color: rgba(104, 87, 70, 0.76);
}

.chat-bubble.user {
  margin-left: auto;
  background: linear-gradient(180deg, #9a5a35, #7f4422);
  color: #fff7ee;
}

.chat-bubble.user small {
  color: rgba(255, 242, 228, 0.72);
}

.chat-bubble.assistant {
  margin-right: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.quick-row {
  display: grid;
  gap: 8px;
}

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

.quick-chip,
.ghost-button,
.chat-form button {
  border-radius: 999px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.quick-chip,
.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  padding: 10px 14px;
}

.quick-chip:hover,
.ghost-button:hover,
.chat-form button:hover,
.thumb-card:hover {
  transform: translateY(-1px);
}

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

.chat-form label {
  color: var(--muted);
  font-size: 0.92rem;
}

.chat-form textarea {
  width: 100%;
  padding: 14px 15px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
}

.chat-form textarea:focus {
  outline: none;
  border-color: rgba(140, 79, 48, 0.4);
  box-shadow: 0 0 0 4px rgba(140, 79, 48, 0.12);
}

.chat-form button {
  justify-self: start;
  border: 0;
  padding: 12px 18px;
  background: linear-gradient(180deg, #9a5b36, #7e4322);
  color: #fff7ee;
  box-shadow: 0 14px 28px rgba(126, 67, 34, 0.18);
}

.is-entering {
  animation: fade-slide 280ms ease both;
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .chat-shell {
    min-height: auto;
  }
}

@media (max-width: 980px) {
  .board-stage,
  .work-grid {
    grid-template-columns: 1fr;
  }

  #mainImage {
    min-height: 440px;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 14px;
  }

  .topbar,
  .board-head,
  .chat-head {
    flex-direction: column;
    align-items: start;
  }

  .status-pile {
    justify-items: start;
  }

  .thumb-rail {
    grid-template-columns: 1fr;
  }
}
