:root {
  color-scheme: light;
  --canvas: #f7f2e9;
  --canvas-warm: #efe6d9;
  --surface: rgba(255, 251, 245, 0.78);
  --surface-strong: rgba(255, 252, 247, 0.96);
  --surface-muted: rgba(241, 233, 221, 0.86);
  --border: rgba(62, 69, 63, 0.12);
  --border-strong: rgba(36, 65, 61, 0.18);
  --text: #1f2a29;
  --muted: #65706a;
  --accent: #27433c;
  --accent-soft: rgba(39, 67, 60, 0.08);
  --accent-faint: rgba(39, 67, 60, 0.04);
  --gold: #b88c52;
  --rose: #c77b76;
  --shadow: 0 20px 55px rgba(121, 102, 72, 0.12);
  --shadow-soft: 0 12px 30px rgba(121, 102, 72, 0.08);
  --paper-shadow: 0 22px 70px rgba(114, 97, 73, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
}

html {
  font-size: 15px;
  background:
    radial-gradient(circle at 0% 0%, rgba(188, 226, 213, 0.45), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(231, 211, 181, 0.38), transparent 22%),
    radial-gradient(circle at 84% 84%, rgba(203, 228, 217, 0.28), transparent 24%),
    linear-gradient(135deg, #fbf7f1 0%, #f4eee4 56%, #eee4d5 100%);
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  overflow-x: hidden;
  overflow-y: visible;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(188, 226, 213, 0.45), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(231, 211, 181, 0.38), transparent 22%),
    radial-gradient(circle at 84% 84%, rgba(203, 228, 217, 0.28), transparent 24%),
    linear-gradient(135deg, #fbf7f1 0%, #f4eee4 56%, #eee4d5 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: -2px;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(39, 67, 60, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(39, 67, 60, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.7), transparent 95%);
  opacity: 0.35;
}

body::after {
  content: "";
  position: fixed;
  inset: -2px;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.76), transparent 26%),
    radial-gradient(circle at 84% 8%, rgba(255, 248, 239, 0.72), transparent 18%);
  opacity: 0.95;
}

.ui-floating-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 160;
}

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

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
}

::selection {
  background: rgba(39, 67, 60, 0.12);
  color: var(--text);
}

.atelier-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.atelier-panel-crisp {
  background: rgba(255, 251, 245, 0.94);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.atelier-panel-strong {
  background: var(--surface-strong);
  border: 1px solid var(--border-strong);
  box-shadow: var(--paper-shadow);
}

.paper-sheet {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 248, 242, 0.96)),
    repeating-linear-gradient(
      180deg,
      rgba(39, 67, 60, 0.04),
      rgba(39, 67, 60, 0.04) 1px,
      transparent 1px,
      transparent 32px
    );
  border: 1px solid rgba(62, 69, 63, 0.1);
  box-shadow: var(--paper-shadow);
}

.paper-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), transparent 18%),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.8), transparent 28%);
}

.editorial-rule {
  height: 1px;
  background: linear-gradient(90deg, rgba(39, 67, 60, 0.18), rgba(39, 67, 60, 0.04));
}

.brief-item-index {
  background: #27433c;
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  position: relative;
  z-index: 1;
}

.brief-item-bullets {
  list-style: disc;
  color: var(--muted);
  padding-left: 1.25rem;
}

.brief-item-bullets li {
  color: var(--muted);
}

.brief-item-bullets li::marker {
  color: var(--accent);
}

.soft-inset {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(39, 67, 60, 0.04);
}

.command-deck-grid {
  align-items: end;
}

.command-deck-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}

.command-control {
  width: 100%;
  min-height: 3.5rem;
  height: 3.5rem;
  padding: 0 1.2rem;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(62, 69, 63, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(39, 67, 60, 0.04);
  font-size: 1rem;
  line-height: 1.2;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.command-control--input {
  padding: 0 1.35rem;
  border-radius: 22px;
}

.command-deck-field input.command-control--input {
  width: 100%;
  min-height: 3.5rem;
  height: 3.5rem;
  padding: 0 1.35rem;
  border: 1px solid rgba(62, 69, 63, 0.14);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    inset 0 -1px 0 rgba(39, 67, 60, 0.04);
  font-size: 1rem;
  line-height: 1.2;
}

.command-control::placeholder {
  color: rgba(101, 112, 106, 0.7);
}

.command-control:hover {
  border-color: rgba(39, 67, 60, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.command-control:focus {
  outline: none;
  border-color: rgba(39, 67, 60, 0.28);
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 0 0 4px rgba(39, 67, 60, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(39, 67, 60, 0.05);
}

.command-control:disabled,
.soft-inset:disabled,
.command-select__trigger:disabled,
.edit-filter-button:disabled,
.filter-close-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.ui-disabled-shell {
  opacity: 0.68;
}

.ui-disabled-shell,
.ui-disabled-shell * {
  cursor: not-allowed !important;
}

.command-deck-field input.command-control--input:hover {
  border-color: rgba(39, 67, 60, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.command-deck-field input.command-control--input:focus {
  outline: none;
  border-color: rgba(39, 67, 60, 0.28);
  background: rgba(255, 255, 255, 0.97);
  box-shadow:
    0 0 0 4px rgba(39, 67, 60, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    inset 0 -1px 0 rgba(39, 67, 60, 0.05);
}

.command-control--select {
  padding-right: 3rem;
}

.command-select {
  position: relative;
  z-index: 1;
}

.command-select--open {
  z-index: 2;
}

.command-select__trigger {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  text-align: left;
  cursor: pointer;
}

.command-select__value {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding-right: 2.3rem;
}

.command-select__chevron {
  width: 1.05rem;
  height: 1.05rem;
  position: absolute;
  top: 50%;
  right: 1.15rem;
  flex: 0 0 auto;
  color: rgba(39, 67, 60, 0.72);
  will-change: transform;
  backface-visibility: hidden;
  transform: translate3d(0, -50%, 0);
  transition:
    transform 180ms ease,
    color 180ms ease;
}

.command-select__chevron--open {
  transform: translate3d(0, -50%, 0) rotate(180deg);
  color: var(--accent);
}

.command-select__menu {
  position: fixed;
  z-index: 161;
  pointer-events: auto;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

.command-select__menu-shell {
  padding: 0.45rem;
  overflow-y: auto;
  border: 1px solid rgba(39, 67, 60, 0.14);
  border-radius: 1.35rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 246, 239, 0.94));
  box-shadow:
    0 20px 40px rgba(76, 68, 55, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.command-select__option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.82rem 0.9rem;
  border: none;
  border-radius: 1rem;
  background: transparent;
  color: var(--text);
  font-size: 0.97rem;
  font-weight: 600;
  text-align: left;
  will-change: transform, background-color, color;
  backface-visibility: hidden;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.command-select__option:hover,
.command-select__option:focus-visible {
  outline: none;
  background: rgba(39, 67, 60, 0.08);
  color: var(--accent);
  transform: translate3d(1px, 0, 0);
}

.command-select__option--selected {
  background: linear-gradient(135deg, rgba(39, 67, 60, 0.96), rgba(90, 114, 104, 0.92));
  color: #fffdf9;
  box-shadow: 0 10px 22px rgba(39, 67, 60, 0.16);
}

.command-select__option--selected:hover,
.command-select__option--selected:focus-visible {
  background: linear-gradient(135deg, rgba(39, 67, 60, 0.96), rgba(90, 114, 104, 0.92));
  color: #fffdf9;
  transform: none;
}

.command-select__option-label {
  min-width: 0;
  flex: 1 1 auto;
}

.command-select__option-mark {
  width: 0.62rem;
  height: 0.62rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(39, 67, 60, 0.18);
  background: rgba(39, 67, 60, 0.08);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.command-select__option-mark--selected {
  border-color: rgba(255, 248, 239, 0.6);
  background: linear-gradient(135deg, #f5ddad, #cf9f5e);
  transform: scale(1.08);
}

.command-deck-action {
  min-width: 0;
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 1280px) {
  .command-deck-action {
    justify-content: flex-end;
  }
}

.panel-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(39, 67, 60, 0.24) transparent;
}

.panel-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(39, 67, 60, 0.22);
}

.panel-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(39, 67, 60, 0.34);
}

.text-gradient {
  background: linear-gradient(135deg, #223a34 0%, #557066 42%, #b88c52 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-noise {
  position: relative;
}

.page-noise::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    radial-gradient(circle at 10% 20%, rgba(39, 67, 60, 0.04), transparent 20%),
    radial-gradient(circle at 90% 10%, rgba(184, 140, 82, 0.06), transparent 16%);
}

.progress-ribbon {
  background: linear-gradient(90deg, rgba(39, 67, 60, 0.74), rgba(184, 140, 82, 0.78));
  box-shadow: 0 8px 20px rgba(39, 67, 60, 0.14);
  will-change: transform;
  backface-visibility: hidden;
}

.metric-card {
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(62, 69, 63, 0.08);
  box-shadow: var(--shadow-soft);
}

.chip-soft {
  background: rgba(39, 67, 60, 0.06);
  border: 1px solid rgba(39, 67, 60, 0.1);
}

.chip-gold {
  background: rgba(184, 140, 82, 0.08);
  border: 1px solid rgba(184, 140, 82, 0.18);
}

.tone-chip-muted {
  background: rgba(39, 67, 60, 0.06);
  border: 1px solid rgba(39, 67, 60, 0.1);
  color: var(--muted);
}

.tone-chip-soft {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(62, 69, 63, 0.09);
  color: var(--muted);
}

.tone-chip-accent {
  background: rgba(150, 167, 155, 0.16);
  border: 1px solid rgba(150, 167, 155, 0.28);
  color: var(--accent);
}

.tone-chip-gold {
  background: rgba(184, 140, 82, 0.1);
  border: 1px solid rgba(184, 140, 82, 0.18);
  color: #8d6430;
}

.tone-chip-danger {
  background: #fff1f0;
  border: 1px solid #fecaca;
  color: #b42318;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid rgba(39, 67, 60, 0.18);
  box-shadow: 0 18px 34px rgba(39, 67, 60, 0.16);
}

.btn-primary:hover {
  background: #223a34;
}

.btn-neutral {
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  border: 1px solid rgba(62, 69, 63, 0.12);
}

.metric-accent {
  background: rgba(150, 167, 155, 0.16);
  border: 1px solid rgba(150, 167, 155, 0.26);
}

.metric-gold {
  background: rgba(184, 140, 82, 0.1);
  border: 1px solid rgba(184, 140, 82, 0.2);
}

.quiet-dots {
  background-image: radial-gradient(rgba(39, 67, 60, 0.14) 0.8px, transparent 0.8px);
  background-size: 12px 12px;
}

.lift-on-hover {
  will-change: transform, box-shadow;
  backface-visibility: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.lift-on-hover:hover {
  transform: translate3d(0, -1px, 0);
  box-shadow: 0 16px 32px rgba(121, 102, 72, 0.11);
}

.skeleton-wash {
  position: relative;
  overflow: hidden;
  background: rgba(39, 67, 60, 0.07);
}

.skeleton-wash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.68), transparent);
  will-change: transform;
  transform: translate3d(-100%, 0, 0);
  animation: shimmer 1.8s linear infinite;
}

.pencil-loader-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 12.5rem);
  min-height: 13rem;
}

.pencil-loader-frame {
  width: 12.5rem;
  height: 12.5rem;
  border: 0;
  background: transparent;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
  flex: 0 0 auto;
}

.filter-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(39, 67, 60, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 241, 232, 0.88));
  color: rgba(39, 67, 60, 0.72);
  box-shadow:
    0 8px 18px rgba(121, 102, 72, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  line-height: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  will-change: transform, box-shadow, background-color, border-color;
  backface-visibility: hidden;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.filter-close-icon {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
}

.filter-close-button:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(232, 242, 237, 0.92));
  border-color: rgba(39, 67, 60, 0.22);
  color: var(--accent);
  transform: translate3d(0, -1px, 0) scale(1.02);
  box-shadow:
    0 12px 22px rgba(39, 67, 60, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.filter-close-button:focus-visible {
  outline: none;
  border-color: rgba(39, 67, 60, 0.32);
  box-shadow:
    0 0 0 4px rgba(39, 67, 60, 0.12),
    0 12px 24px rgba(39, 67, 60, 0.1);
}

.edit-filter-button {
  --edit-bg: linear-gradient(135deg, #2a463f 0%, #35554c 46%, #b88c52 100%);
  --edit-bg-hover: linear-gradient(135deg, #b88c52 0%, #9f7a49 34%, #2a463f 100%);
  --edit-ring: rgba(39, 67, 60, 0.16);
  --edit-text: #fffdf9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  box-sizing: border-box;
  border: none;
  border-radius: 999px;
  background: var(--edit-bg);
  color: var(--edit-text);
  box-shadow:
    0 14px 26px rgba(39, 67, 60, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  text-decoration: none !important;
  will-change: width, transform, box-shadow, background;
  contain: layout paint;
  backface-visibility: hidden;
  transition:
    width 220ms cubic-bezier(0.16, 1, 0.3, 1),
    gap 220ms cubic-bezier(0.16, 1, 0.3, 1),
    padding 220ms cubic-bezier(0.16, 1, 0.3, 1),
    border-radius 220ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 180ms ease,
    box-shadow 180ms ease,
    background 220ms ease;
}

.edit-filter-button__label {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  will-change: transform, opacity, max-width;
  backface-visibility: hidden;
  transform: translate3d(8px, 0, 0);
  transition:
    max-width 220ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.edit-filter-button__icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  will-change: transform;
  backface-visibility: hidden;
  transition:
    transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
    width 220ms cubic-bezier(0.16, 1, 0.3, 1),
    height 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.edit-filter-button__icon path {
  fill: currentColor;
}

.edit-filter-button:hover {
  width: 11.5rem;
  gap: 0.42rem;
  justify-content: flex-start;
  padding: 0 0.72rem 0 0.96rem;
  border-radius: 999px;
  background: var(--edit-bg-hover);
  transform: translate3d(0, -1px, 0);
  box-shadow:
    0 18px 28px rgba(184, 140, 82, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.edit-filter-button:hover .edit-filter-button__label,
.edit-filter-button:focus-visible .edit-filter-button__label {
  flex: 1 1 auto;
  max-width: 8.5rem;
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.edit-filter-button:hover .edit-filter-button__icon,
.edit-filter-button:focus-visible .edit-filter-button__icon {
  transform: rotate(360deg);
}

.edit-filter-button:focus-visible {
  outline: none;
  width: 11.5rem;
  gap: 0.42rem;
  justify-content: flex-start;
  padding: 0 0.72rem 0 0.96rem;
  border-radius: 999px;
  background: var(--edit-bg-hover);
  box-shadow:
    0 0 0 4px var(--edit-ring),
    0 18px 28px rgba(184, 140, 82, 0.2);
}

@keyframes shimmer {
  100% {
    transform: translate3d(100%, 0, 0);
  }
}

@media (max-width: 1280px) {
  html {
    font-size: 14px;
  }
}

.workspace-shell,
.workspace-grid {
  min-height: 100vh;
  height: auto;
}

.workspace-grid {
  grid-template-rows: auto auto auto !important;
  align-content: start;
}

.workspace-main {
  min-height: auto;
  align-items: start;
}

.workspace-main > * {
  min-width: 0;
}

.workspace-pane {
  min-height: 32rem;
  overflow: visible !important;
}

.workspace-pane-body {
  min-height: auto;
  overflow: visible !important;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  html,
  body,
  #root {
    overflow: auto;
  }

  html {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
