/* Markwright studio. Framed-sheet style: one tinted L-frame, the work on a white sheet. */
:root {
  --frame: #f3f5f1;
  --sheet: #ffffff;
  --well: #eef1ec;
  --edge: #e6e9e3;
  --control: #e9ece6;
  --control-hover: #dfe3dc;
  --ink: #0a0a0a;
  --muted: #5d625c;
  --accent: #1f6b3a;
  --accent-ink: #ffffff;
  --mint: #c3edce;
  --pink: #f8c7c9;
  --danger: #b4232c;
  --radius: 10px;
  --sheet-radius: 16px;
  --ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'League Spartan', 'Figtree', system-ui, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--frame);
  color: var(--ink);
  font: 14px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--mint); }

.app {
  display: grid;
  grid-template-columns: 252px 1fr;
  grid-template-rows: 48px 1fr;
  height: 100dvh;
}

/* Top bar on the frame, no rule */
.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 16px;
}
.brandmark { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brandmark svg { width: 22px; height: 22px; display: block; }
.brandmark b { font: 700 19px/1 var(--display); letter-spacing: -0.03em; padding-top: 3px; }
.top .project { margin: 0; font-weight: 600; font-size: 16px; margin-left: 20px; max-width: 26ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill { font-size: 13px; padding: 2px 8px; border-radius: 99px; background: var(--control); color: var(--muted); }
.pill.ok { background: var(--mint); color: #0e3b1f; }
.top .spacer { flex: 1; }
.top .host { font-size: 13px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 0; border-radius: 8px;
  background: var(--control); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, transform .1s ease;
}
.btn:hover { background: var(--control-hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2a2a2a; }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--control); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn.danger { color: var(--danger); }

/* Brand panel, on the frame */
.side {
  overflow-y: auto;
  padding: 8px 12px 24px 16px;
}
.side h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 20px 0 8px; }
.side h2:first-child { margin-top: 4px; }
.field { display: block; margin-bottom: 8px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.input, select.input, textarea.input {
  width: 100%; height: 32px; padding: 0 10px;
  border: 1px solid var(--edge); border-radius: 8px;
  background: var(--sheet);
}
textarea.input { height: auto; min-height: 84px; padding: 8px 10px; resize: vertical; line-height: 1.45; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.concept {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center;
  padding: 6px; margin: 0 -6px 4px; border-radius: var(--radius); cursor: pointer;
}
.concept:hover { background: var(--control); }
.concept[aria-current="true"] { background: var(--sheet); }
.concept .thumb { width: 56px; height: 40px; border-radius: 6px; background: var(--sheet); display: grid; place-items: center; overflow: hidden; }
.concept .thumb svg { max-width: 46px; max-height: 30px; }
.concept .name { font-weight: 600; }
.concept .meta { font-size: 13px; color: var(--muted); }
.concept .chosen { font-size: 13px; color: var(--accent); font-weight: 600; }

.drop {
  display: block; margin-top: 6px; padding: 14px 12px; border-radius: var(--radius);
  background: var(--sheet); border: 1px dashed #c8cdc5; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer;
}
.drop.over { border-color: var(--accent); background: var(--mint); color: var(--ink); }
.drop b { color: var(--ink); }

.swatch { display: grid; grid-template-columns: 28px 1fr 84px 24px; gap: 6px; align-items: center; margin-bottom: 6px; }
.swatch input[type=color] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--edge); border-radius: 6px; background: none; cursor: pointer; }
.swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }
.swatch .input { height: 28px; padding: 0 8px; font-size: 13px; }
.swatch .hex { font-variant-numeric: tabular-nums; }
.iconbtn { width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.iconbtn:hover { background: var(--control); color: var(--ink); }
.row { display: flex; gap: 6px; flex-wrap: wrap; }

/* The sheet */
.sheet {
  margin: 0 8px 8px 0;
  background: var(--sheet);
  border: 1px solid var(--edge); /* taste-skill-ignore: the framed-sheet style's one edge */
  border-radius: var(--sheet-radius);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0; min-width: 0;
  overflow: hidden;
}
.tabs { display: flex; gap: 4px; padding: 0 16px; }
.tabs button {
  border: 0; background: none; cursor: pointer;
  padding: 14px 10px 10px; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.work { display: grid; grid-template-columns: 1fr 288px; min-height: 0; }
.canvas {
  background: var(--well);
  margin: 0 0 12px 12px;
  border-radius: 12px;
  overflow: auto;
  position: relative;
  min-height: 0;
}
.stage { padding: 24px; display: grid; place-items: center; min-height: 100%; }
.stage > svg, .stage .art svg { width: 100%; height: auto; max-height: calc(100dvh - 170px); display: block; background: #fff; }
.stage .art { width: 100%; max-width: 1100px; }
.caption { font-size: 13px; color: var(--muted); margin-top: 10px; }

.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; padding: 20px; align-content: start; }
.pages figure { margin: 0; cursor: pointer; }
.pages figure svg { width: 100%; height: auto; display: block; border-radius: 4px; background: #fff; transition: transform .15s ease; }
.pages figure:hover svg { transform: translateY(-2px); }
.pages figure[aria-current="true"] svg { outline: 2px solid var(--accent); outline-offset: 2px; }
.pages figcaption { font-size: 13px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; gap: 8px; }
.pages figcaption span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.viewer { position: absolute; inset: 0; background: var(--well); display: grid; grid-template-rows: auto 1fr; }
.viewer[hidden] { display: none; }
.viewer .bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.viewer .bar .title { font-weight: 600; flex: 1; }
.viewer .big { padding: 0 24px 24px; display: grid; place-items: center; min-height: 0; }
.viewer .big svg { width: 100%; height: 100%; max-height: 100%; background: #fff; }

/* Inspector */
.inspector { overflow-y: auto; padding: 0 16px 16px; }
.inspector h3 { font-size: 16px; font-weight: 600; margin: 4px 0 4px; }
.inspector .lede { color: var(--muted); margin: 0 0 16px; }
.inspector h4 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 18px 0 6px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--control); border-radius: 8px; padding: 2px; gap: 2px; }
.seg.wrap { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
.seg button { border: 0; background: transparent; border-radius: 6px; height: 28px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); }
.range { display: grid; grid-template-columns: 1fr 44px; gap: 8px; align-items: center; }
.range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.actions { display: grid; gap: 6px; margin-top: 20px; }
.finding { background: var(--frame); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0 0; }
.finding b { display: block; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.tree { font-size: 13px; padding: 20px 24px; line-height: 1.7; columns: 2 300px; column-gap: 32px; }
.tree div { break-inside: avoid; }
.tree .dir { font-weight: 600; margin-top: 10px; }
.tree .dir:first-child { margin-top: 0; }
.tree .file { color: var(--muted); padding-left: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.progress { height: 4px; background: var(--control); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

.hubs { display: grid; gap: 8px; margin-top: 8px; }
.hub { background: var(--frame); border-radius: var(--radius); padding: 10px 12px; }
.hub a { color: var(--accent); font-weight: 600; word-break: break-all; }
.hub .meta { font-size: 13px; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.18); /* taste-skill-ignore: the toast floats over the work */
  max-width: min(520px, calc(100vw - 32px));
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Narrow hosts: the Figma plugin window and the Illustrator panel */
@media (max-width: 980px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr; height: auto; min-height: 100dvh; }
  .top { flex-wrap: wrap; padding: 8px 12px 8px 16px; gap: 8px; }
  .top .pill { display: none; }
  .side { max-height: none; padding: 0 16px 8px; }
  .sheet { margin: 0 8px 8px; }
  .work { grid-template-columns: minmax(0, 1fr); }
  .canvas { margin: 0 12px 12px; min-height: 360px; }
  .inspector { padding: 0 16px 16px; }
  .top .host { display: none; }
  .top .project { margin-left: 8px; max-width: 12ch; }
  .tabs { overflow-x: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
