/* ============================================================
   BLACK POPPY CANON — THE ATELIER (Sprint 4.6 · APP-006)
   A beautifully organized artist's drafting table. Warm parchment,
   soft shadows, editorial spacing. No neon. No floating windows.
   ============================================================ */

.atelier { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---- toolbar ---- */

.atelier-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

.atelier-tool { padding: var(--space-1) var(--space-3); font-size: var(--text-sm); }
.atelier-tool.is-active { background: var(--bp-deep-purple); color: var(--bp-full-moon); }

.atelier-toolbar__sep {
  width: 1px; height: 22px;
  background: var(--color-border);
  margin: 0 var(--space-1);
}

.atelier-toolbar__spacer { flex: 1; }
.atelier-switcher { max-width: 180px; }
.atelier-search { min-width: 150px; }
.atelier-filter { max-width: 130px; }

/* ---- main: surface + inspector ---- */

.atelier-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-3);
  min-height: 460px;
}

.atelier-scroll {
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--bp-silver) 30%, transparent) 1px, transparent 0) 0 0 / 28px 28px,
    var(--bp-cream-stone);
  max-height: 72vh;
}

[data-theme="dark"] .atelier-scroll {
  background:
    radial-gradient(circle at 1px 1px, rgba(198,194,204,0.12) 1px, transparent 0) 0 0 / 28px 28px,
    var(--color-surface-2);
}

.atelier-table {
  position: relative;
  width: 2200px;
  height: 1400px;
}

.wt-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.wt-lines__line {
  stroke: var(--bp-ink);
  stroke-width: 1.2;
  opacity: 0.4;
}

[data-theme="dark"] .wt-lines__line { stroke: var(--bp-silver); }

/* ---- objects ---- */

.wt-object {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.wt-object:active { cursor: grabbing; }

.wt-object:focus-visible,
.wt-object.is-selected {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
  box-shadow: var(--shadow-2);
  z-index: 2;
}

.wt-object.is-dimmed { opacity: 0.25; }

.wt-object__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  min-height: 26px;
}

.wt-object__presence { flex-shrink: 0; }

.wt-object__title {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.wt-object__fav { color: var(--bp-hot-pink); }

.wt-object__body {
  flex: 1;
  padding: var(--space-2);
  overflow: auto;
  font-size: var(--text-sm);
}

.wt-object__grip {
  position: absolute;
  right: 0; bottom: 0;
  width: 16px; height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 55%, var(--bp-silver) 55%, var(--bp-silver) 65%,
      transparent 65%, transparent 75%, var(--bp-silver) 75%, var(--bp-silver) 85%, transparent 85%);
}

/* type flavors — paper, not plastic */

.wt-object--sticky { background: color-mix(in srgb, var(--bp-finch) 18%, var(--color-surface)); }
.wt-object--sticky .wt-object__bar { background: color-mix(in srgb, var(--bp-finch) 28%, var(--color-surface)); }

.wt-sticky__text {
  width: 100%; height: 100%;
  border: none; background: transparent; resize: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.5;
}
.wt-sticky__text:focus { outline: none; }

.wt-note__prose { font-size: var(--text-sm); }
.wt-note__prose h1, .wt-note__prose h2, .wt-note__prose h3 { font-size: var(--text-base); margin: 0.4em 0 0.2em; }

.wt-image__img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }

.wt-object--symbol .wt-object__body {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: var(--space-1);
}
.wt-symbol__glyph { font-size: 1.8rem; font-family: var(--font-display); color: var(--color-heading); }
.wt-symbol__name { font-family: var(--font-display); letter-spacing: 0.06em; }

.wt-entry__link { font-family: var(--font-body); }

.wt-swatch__chip {
  height: 60%;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}
.wt-swatch__hex {
  display: block;
  margin-top: var(--space-1);
  font-family: ui-monospace, Menlo, monospace;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.wt-url__link { word-break: break-all; }

.wt-checklist { display: flex; flex-direction: column; gap: var(--space-1); }
.wt-checklist__item { display: flex; gap: var(--space-2); align-items: baseline; cursor: pointer; }
.wt-checklist__item.is-done span { text-decoration: line-through; color: var(--color-text-muted); }

/* ---- inspector ---- */

.atelier-inspector {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow-y: auto;
  max-height: 72vh;
}

.atelier-inspector__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.06em;
  color: var(--color-heading);
  margin: 0 0 var(--space-2);
}

.atelier-inspector__presence {
  font-size: var(--text-sm);
  font-style: italic;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-3);
}

.atelier-inspector__form { display: flex; flex-direction: column; gap: var(--space-3); }

.atelier-inspector__field { display: flex; flex-direction: column; gap: var(--space-1); }

.atelier-inspector__label {
  font-size: var(--text-xs);
  font-style: italic;
  color: var(--color-text-muted);
}

.atelier-inspector__content { font-family: var(--font-body); }

.atelier-inspector__actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}

.atelier-inspector__remove { color: var(--color-accent-quiet); }

/* ---- status bar ---- */

.atelier-statusbar {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-style: italic;
  padding: 0 var(--space-2);
}

.atelier-statusbar__save { flex: 1; text-align: center; }
.atelier-statusbar__hint { text-align: right; }

.atelier-empty { grid-column: 1 / -1; }

/* ---- responsive: the table folds, the inspector moves below ---- */

@media (max-width: 960px) {
  .atelier-main { grid-template-columns: 1fr; }
  .atelier-inspector { max-height: none; }
  .atelier-statusbar__hint { display: none; }
}

@media print {
  .atelier-toolbar, .atelier-inspector, .atelier-statusbar { display: none !important; }
}
