:root {
  color-scheme: dark;
  --display: "Inter Tight", Inter, system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --night: #0a0a10;
  --ink: #f6f4fa;
  --muted: #c2bccf;
  --lavender: #c7bdfc;
  --primary: #dbd5ff;
  --mint: #a0e7cc;
  --rule: #d6ccfa26;
  --glass-edge: #e6e0ff54;
  --glass: linear-gradient(166deg, #ada7c635, #62577121 34%, #201d2c77 60%, #80729430), #1a1723a6;
  --lens: radial-gradient(ellipse at 23% 0%, #ffffff66, transparent 64%), linear-gradient(145deg, #c7bbef5c, #655a7c45 60%, #d3b8ff38);
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--night);
}
* { box-sizing: border-box; }
body, h1, h2, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
::selection { color: #171224; background: var(--primary); }
.sr-only, .symbols { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.studio {
  --outer: clamp(16px, 2.5vw, 52px);
  --gutter: clamp(18px, 2.35vw, 54px);
  position: relative; isolation: isolate;
  display: grid; grid-template-rows: auto minmax(0, 1fr); gap: clamp(13px, 2.2vh, 27px);
  height: 100vh; height: 100dvh; min-height: 570px;
  padding: max(clamp(12px, 1.9vh, 24px), env(safe-area-inset-top)) max(var(--outer), env(safe-area-inset-right))
           max(clamp(12px, 2.6vh, 32px), env(safe-area-inset-bottom)) max(var(--outer), env(safe-area-inset-left));
  background: #0c0a12;
}
.studio::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(102deg, #0e0c187d 0%, #0c0a1452 32%, #100c1694 74%, #0d0913c7),
              linear-gradient(0deg, #0c09136e, transparent 22%, transparent 84%, #0c091335),
              url("/assets/foil.webp") 47% 44% / cover no-repeat;
  opacity: .53;
}
.mast {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px; justify-self: center; width: min(100%, 1470px);
  min-height: 60px; padding: 6px 17px 6px 13px; border: 1px solid var(--glass-edge); border-radius: 38px;
  background: var(--glass); backdrop-filter: blur(21px) saturate(155%); -webkit-backdrop-filter: blur(21px) saturate(155%);
  box-shadow: inset 0 1px 1px #ffffff4f, inset 0 -1px 1px #c3b3f028, 0 8px 28px #03010938;
}
.mast::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(110deg, #fff8, #ddd4ff16 23%, transparent 49%, #ede5ff70 83%, #fff2);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
}
.brand-lockup, .brand, .release, .view-tools { display: flex; align-items: center; }
.brand-lockup { gap: 12px; white-space: nowrap; }
.brand { gap: 9px; font: 640 1.5rem/1 var(--display); letter-spacing: -.055em; text-decoration: none; }
.brand-lens, .agent-sign {
  display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 13px;
  color: #faf9ff; background: var(--lens); border: 1px solid #e5d9ff6b; box-shadow: inset 0 1px 1px #fff6, 0 3px 7px #0003;
}
.brand-lens { transition: transform .35s cubic-bezier(.22, 1, .32, 1); }
.brand-lens svg { width: 22px; height: 20px; }
.brand:hover .brand-lens { transform: rotate(-7deg) scale(1.05); }
.brand-rule { width: 1px; height: 18px; background: #c2b7d966; transform: rotate(17deg); }
.product-name { color: #d5ccea; font: 510 1.2rem/1 var(--display); letter-spacing: -.035em; }
.release { justify-self: end; gap: 7px; padding: 6px 12px; border: 1px solid #f2eaffaa; border-radius: 20px; color: #30233e; background: #dfd3ee; font-size: .88rem; font-weight: 620; white-space: nowrap; }
.release-mark { width: 6px; height: 6px; border-radius: 50%; background: #6e4d86; }
.mast-end { display: flex; justify-self: end; align-items: center; gap: 10px; }
.own-board {color:#efe5ff;font-weight:600;font-size:.82rem;text-decoration:underline;text-underline-offset:3px;white-space:nowrap}
@media(max-width:530px){.mast-end .mcp-link{display:none}.own-board{font-size:.76rem}}
.mcp-link { display: inline-flex; align-items: center; min-height: 28px; padding: 3px; color: var(--primary); font-size: .8rem; text-decoration: none; white-space: pre; }
.mcp-link:hover { color: white; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 1150px) { .mcp-link span { display: none; } .mast-end { gap: 6px; } }

.shelf { min-width: 0; }
.rack {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  min-width: 0; margin: 0; padding: 3px; border: 1px solid #ebddff24; border-radius: 28px;
  background: #100e196e; box-shadow: inset 0 1px 5px #05030b69;
}
.rack label {
  position: relative; display: flex; justify-content: center; align-items: center; gap: 7px;
  min-width: 0; min-height: 36px; padding: 2px clamp(8px, 1vw, 20px); border: 1px solid transparent;
  border-radius: inherit; color: #cbc5d9; font-size: clamp(.77rem, .93vw, .93rem); font-weight: 520;
  white-space: nowrap; cursor: grab; user-select: none; transition: background-color .2s, border-color .2s, color .2s;
}
.rack label:active { cursor: grabbing; }
.rack input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rack img { display: block; width: 42px; height: 27px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px #03010766); }
.rack label:hover { color: white; background-color: #f0ddff0d; }
.rack label:has(input:checked) {
  color: #fff; border-color: #e4d8ff57; background: linear-gradient(160deg, #efddff35, #c5b7ed1c 62%, #cfc0ee2b);
  box-shadow: inset 0 1px 1px #fff4, 0 2px 4px #06030d38;
}
.rack label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 1px; }
.desk { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(350px, 32vw, 620px); gap: clamp(12px, 1.6vw, 34px); }

.stage {
  isolation: isolate; position: relative; overflow: hidden; min-width: 0; min-height: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
}
.stage::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 53% 35% at 51% 58%, #45405d8c 0%, #302c4459 45%, transparent 100%);
}
.file-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: clamp(12px, 3.6vh, 54px) var(--gutter) 0; }
.file-kind { display: flex; align-items: center; gap: 8px; margin: 0 0 9px 2px; color: #d5cedf; font-size: .73rem; line-height: 1.2; font-weight: 640; letter-spacing: .075em; text-transform: uppercase; }
.file-kind::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #ffac55; box-shadow: 0 0 9px #ff933733; }
h1 { margin: 0; color: #e4deff; font: 570 clamp(2.3rem, 3.65vw, 5.15rem)/1.02 var(--display); letter-spacing: -.055em; }
@supports (background-clip: text) {
  h1 { width: fit-content; background: linear-gradient(116deg, #fbfaff 14%, #e7e1ff 50%, #bfb2ef 100%); background-clip: text; color: transparent; }
}
.view-tools { flex: none; gap: 3px; padding: 3px; border: 1px solid #ded0ff32; border-radius: 22px; background: #16131fa8; box-shadow: inset 0 1px #f8eeff0c; }
.parts-action, .orbit, .suggestions button, .sheet-foot button, dialog header button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: #e7e1f1;
  border: 1px solid #ded0ff38; border-radius: 22px; background: #211d2cc9;
  transition: background-color .2s, border-color .2s, color .2s;
}
.parts-action { min-height: 32px; padding: 4px 9px; font-size: .8rem; font-weight: 520; border-color: transparent; background: transparent; }
.parts-action:hover, .orbit:hover, .suggestions button:hover, .sheet-foot button:hover, dialog header button:hover { border-color: #dacbf16b; color: white; background: #393044; }
.parts-action[aria-pressed="true"] { color: #231c32; background: var(--primary); border-color: #efe9ff; }
.part-count { display: grid; place-items: center; min-width: 19px; height: 18px; padding: 0 4px; border-radius: 6px; color: #e3dafa; background: #c8b9ed22; font-size: .69rem; font-variant-numeric: tabular-nums; }

.plane { position: relative; min-height: 0; margin: 0 clamp(5px, 1vw, 20px); container-type: size; }
.plane canvas { width: 100%; height: 100%; display: block; opacity: 0; position: absolute; inset: 0; pointer-events: none; touch-action: pan-y pinch-zoom; }
.stage[data-ready="3d"] canvas { opacity: 1; pointer-events: auto; cursor: grab; }
.stage[data-ready="3d"] canvas:active { cursor: grabbing; }
.plane canvas:focus-visible { outline-offset: -3px; }
.poster {
  position: absolute; width: min(100cqw, 150cqh); height: min(100cqh, 66.6667cqw); top: 50%; left: 50%;
  transform: translate(-50%, -50%); pointer-events: none; background: url("/atolye/kutu-rpi.webp") 0 0 / 400% 400% no-repeat;
}
.stage[data-ready="3d"] .poster { visibility: hidden; }
.dimensions { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; fill: none; }
.dimensions path { stroke: #e1d5ff; stroke-width: 1.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 1px #120e22); }
.dimensions rect { fill: #1c172a; stroke: #b7a5d8; stroke-width: .85; }
.dimensions text { fill: #f3edff; stroke: none; font: 560 12px/1 var(--mono); letter-spacing: -.04em; }
.markers { position: absolute; inset: 0; pointer-events: none; }
.markers button {
  position: absolute; display: grid; place-items: center; width: 42px; height: 42px;
  transform: translate(-50%, -50%); border: 0; border-radius: 50%; padding: 0; pointer-events: auto; background: transparent;
}
.markers button:nth-child(1) { left: var(--p0x, 49%); top: var(--p0y, 63%); }
.markers button:nth-child(2) { left: var(--p1x, 67%); top: var(--p1y, 46%); }
.markers span {
  display: grid; place-items: center; width: 23px; height: 23px;
  color: white; border: 1px solid #e6ddf7eb; border-radius: 50%; background: #211b30ed;
  box-shadow: 0 0 0 2px #09071077, 0 2px 6px #05030a66; font: 560 .73rem/1 Inter, sans-serif;
}
.markers b, .operation {
  width: max-content; border: 1px solid #c7b5e854; border-radius: 8px; padding: 5px 9px;
  background: #211a2eeb; color: #f3effa; font-size: .75rem; font-weight: 550; line-height: 1.25; box-shadow: 0 3px 8px #07050d3b; pointer-events: none;
}
.markers b { position: absolute; left: 32px; bottom: 27px; opacity: 0; max-width: 150px; }
.markers button:nth-child(2) b { left: auto; right: 32px; }
.markers button:is(:hover, :focus-visible, [data-reading]) b { opacity: 1; }
.markers button[data-reading] span { outline: 2px solid #d6c5fc; outline-offset: 3px; }
.operation { position: absolute; bottom: 8px; left: 50%; max-width: 94%; transform: translateX(-50%); border-radius: 15px; }
.stage:is([data-solid], [data-ready="poster"], [data-review], [data-building]) .markers { visibility: hidden; }
.stage:is([data-building], [data-stage="board"]) .separation { display: none; }
.stage[data-dropping]::after {
  content: "Cihazı buraya bırak"; display: grid; place-items: center; position: absolute; inset: 4px; z-index: 3;
  border: 1.5px dashed var(--lavender); border-radius: 22px; background: #211b36ed; color: #f3edff;
  font: 560 1.4rem/1.2 var(--display); pointer-events: none;
}
.build-status {
  position: absolute; top: 10px; left: var(--gutter); z-index: 1; display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 8px;
  padding: 5px 10px 8px; border: 1px solid var(--rule); border-radius: 12px; background: #171320eb; pointer-events: none;
}
.build-status > span { color: var(--lavender); font: 510 .72rem/1.2 var(--mono); }
.build-status strong { font-size: .82rem; font-weight: 570; }
.build-status i { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #c9b9fb calc(var(--progress) * 100%), #c9b9fb24 0); }
.step-picker { position: relative; display: inline-flex; align-items: center; gap: 9px; min-height: 22px; pointer-events: auto; }
.step-picker::after { content: ""; width: 5px; height: 5px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.step-picker select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; color: var(--ink); background: #211c2e; }
.step-picker:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
#latest-stage { grid-column: 1 / -1; justify-self: start; pointer-events: auto; padding: 3px 7px; border: 1px solid #dacbf252; border-radius: 12px; color: var(--primary); background: #342b47; font-size: .72rem; }
.stage-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 var(--gutter); padding: 13px 0 6px; border-top: 1px solid #d1c7ee30; }
.measure { position: relative; display: flex; align-items: baseline; gap: 10px; padding-left: 31px; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.measure i { position: absolute; left: 0; top: 50%; width: 20px; height: 7px; transform: translateY(-50%); border: solid #c4b7e5; border-width: 0 1px 1px; }
.measure i::after { content: ""; position: absolute; bottom: 0; left: 4px; width: 1px; height: 3px; background: #c4b7e5; box-shadow: 5px 0 #c4b7e5, 10px 0 #c4b7e5; }
.measure strong { color: #eee8fa; font: 540 .85rem/1.3 var(--mono); letter-spacing: -.045em; }
.stage[data-building] .measure { white-space: normal; }
.separation { display: flex; align-items: center; gap: 10px; color: #ddd6eb; font-size: .8rem; }
.separation label { white-space: nowrap; }
.separation input { --fill: 0%; width: clamp(66px, 8vw, 160px); height: 34px; padding: 0; margin: 0; appearance: none; background: transparent; accent-color: var(--lavender); cursor: ew-resize; }
.separation input::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(to right, #cbbcf8 var(--fill), #615969 var(--fill)); }
.separation input::-webkit-slider-thumb { appearance: none; width: 15px; height: 15px; margin-top: -6px; border: 2px solid #eee7ff; border-radius: 50%; background: #c5b4ef; box-shadow: 0 1px 5px #07050e; }
.separation input::-moz-range-track { height: 3px; background: #615969; }
.separation input::-moz-range-progress { height: 3px; background: #cbbcf8; }
.separation input::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid #eee7ff; border-radius: 50%; background: #c5b4ef; }
.orbit { flex: none; width: 36px; height: 36px; border-radius: 50%; }
.orbit:disabled { opacity: .45; }

.consult {
  position: relative; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0; min-height: 0; padding: clamp(19px, 3.2vh, 38px) clamp(17px, 1.9vw, 41px) clamp(16px, 2.5vh, 28px);
  border: 1px solid #c8c1ec47; border-radius: 24px; color: var(--ink);
  background: linear-gradient(135deg, #332e42f2, #1b1825f5 42%, #211b2df0);
  box-shadow: inset 0 1px #ffffff1a, 0 15px 55px #02020b4d;
}
.consult-head { display: flex; align-items: center; gap: 10px; padding-bottom: clamp(12px, 2.1vh, 24px); border-bottom: 1px solid var(--rule); }
.agent-sign { width: 34px; height: 34px; border-radius: 12px; }
.agent-sign svg { width: 19px; height: 17px; }
.consult h2 { font: 570 clamp(1.26rem, 1.72vw, 1.85rem)/1.12 var(--display); letter-spacing: -.04em; }
.sample { margin-left: auto; color: var(--muted); font-size: .74rem; font-weight: 510; }
.activity { display: flex; align-items: center; gap: 8px; min-height: 36px; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.signal { display: inline-flex; align-items: center; gap: 2px; height: 14px; }
.signal i { width: 2px; height: 4px; border-radius: 2px; background: #afa3c7; }
.activity:not([data-state="idle"]) .signal i { background: var(--mint); animation: signal .95s ease-in-out infinite alternate; }
.activity .signal i:nth-child(2) { animation-delay: -.6s; }
.activity .signal i:nth-child(3) { animation-delay: -.32s; }
@keyframes signal { to { transform: scaleY(2.7); } }
.exchange { min-height: 0; min-width: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #666072 transparent; }
#messages { display: flex; flex-direction: column; gap: clamp(16px, 2.7vh, 30px); list-style: none; margin: 0; padding: 9px 5px 14px 0; }
.line { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; overflow-wrap: anywhere; animation: arrive .3s ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(4px); } }
.speaker { color: #beb6ca; font-size: .75rem; font-weight: 580; line-height: 1.25; }
.client { align-items: flex-end; align-self: flex-end; max-width: 94%; }
.client p {
  padding: 9px 14px; border: 1px solid #ded0ff35; border-radius: 16px 5px 16px 16px;
  color: #f4efff; background: linear-gradient(120deg, #3b344c, #342d41); box-shadow: inset 0 1px #ffffff08;
  font-size: clamp(.94rem, 1.04vw, 1.13rem); line-height: 1.48; white-space: pre-wrap;
}
.agent .speaker { display: flex; align-items: center; gap: 7px; color: var(--lavender); }
.agent .speaker::before { content: ""; width: 6px; height: 6px; border-radius: 2px; background: #c9bafb; transform: rotate(45deg); }
.agent p { color: #f2eff8; font: 470 clamp(1.02rem, 1.18vw, 1.28rem)/1.52 var(--display); letter-spacing: -.009em; }
.agent p:empty { display: none; }
.streaming p:not(:empty)::after, #draft-preview i {
  content: ""; display: inline-block; width: 2px; height: .94em; margin-left: 2px; vertical-align: -.08em;
  background: #d5c9fb; animation: caret .9s step-end infinite;
}
@keyframes caret { 55% { opacity: 0; } }
.tool-result {
  position: relative; align-self: stretch; display: grid; grid-template-columns: 14px 6em minmax(0, 1fr);
  align-items: center; gap: 8px; min-height: 24px; font-size: .81rem; line-height: 1.3; animation: arrive .25s ease-out both;
}
.tool-result:has(+ .tool-result)::after { content: ""; position: absolute; left: 6.5px; top: calc(50% + 7px); width: 1px; height: calc(100% - 8px); background: #d0c5ed34; }
.tool-result::before { content: ""; grid-column: 1; justify-self: center; width: 9px; height: 9px; border: 1.5px solid #9a8eb455; border-top-color: #e0ccff; border-radius: 50%; animation: turn .9s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.tool-result[data-phase="done"]::before { width: 8px; height: 4px; border: solid var(--mint); border-width: 0 0 1.5px 1.5px; border-radius: 0; transform: rotate(-45deg) translateY(-1px); animation: none; }
.tool-result:has(.tool-spec) { row-gap: 4px; padding-block: 3px; }
.tool-verb { color: var(--mint); font-weight: 550; }
.tool-result:is([data-kind="read"], [data-kind="measured"]) .tool-verb { color: #c8beef; }
.tool-result[data-kind="edited"] .tool-verb { color: #f1cba8; }
.tool-result:not([data-phase="done"]) .tool-verb { color: var(--muted); }
.tool-part { color: #ece7f5; }
.tool-spec { grid-column: 3; margin-top: -4px; color: #c0b7ce; font: 400 .75rem/1.4 var(--mono); }
.tool-result + p:not(:empty) { margin-top: 6px; }

.editor { display: grid; gap: 12px; padding-top: 14px; }
.design-choices { min-width: 0; margin: 0; padding: 0; border: 0; }
.design-choices legend { margin: 0 0 8px; padding: 0; color: #e5dff0; font: 560 .94rem/1.2 var(--display); letter-spacing: -.01em; }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.choice-grid button {
  display: grid; grid-template-rows: clamp(33px, 5.1vh, 58px) auto; align-content: center; justify-items: center; gap: 5px;
  min-width: 0; padding: 6px 3px 9px; color: #eae5f4; border: 1px solid #d2c6f038; border-radius: 13px;
  background: radial-gradient(ellipse at 48% 10%, #a998cf20, transparent 80%), #201c2a;
  transition: background-color .2s, border-color .2s;
}
.choice-grid button:is(:hover, :focus-visible, [aria-pressed="true"]) { color: white; border-color: #d0bcfa9c; background-color: #3b314c; }
.choice-grid button i { display: block; width: 100%; height: 100%; max-width: 100px; background: var(--forms) 0 0 / 300% 100% no-repeat; filter: drop-shadow(0 3px 4px #0b081147); }
.choice-grid button:nth-child(2) i { background-position: 50% 0; }
.choice-grid button:nth-child(3) i { background-position: 100% 0; }
.choice-grid button span { font-size: .78rem; font-weight: 520; line-height: 1.16; text-align: center; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestions button { min-height: 32px; padding: 6px 11px; font-size: .8rem; line-height: 1.2; }
.stage[data-building] + .consult:has(.activity:not([data-state="idle"])) #suggest-part { display: none; }
.entry {
  display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid #d6c8f958; border-radius: 18px;
  background: linear-gradient(122deg, #231e30, #17141f); box-shadow: inset 0 1px 3px #0b081153;
  transition: border-color .2s, box-shadow .2s;
}
.entry:focus-within { border-color: #c5b5ed; box-shadow: 0 0 0 2px #b5a1e42e; }
.writing-field { min-width: 0; flex: 1; display: grid; align-items: center; }
.writing-field textarea, #draft-preview { grid-area: 1 / 1; min-width: 0; padding: 7px 0; font: 450 1rem/1.4 Inter, system-ui, sans-serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.writing-field textarea { width: 100%; min-height: 36px; max-height: 92px; margin: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--ink); caret-color: var(--lavender); }
.writing-field textarea::placeholder { color: #bcb3cd; opacity: 1; }
.writing-field textarea[data-preview]::placeholder { opacity: 0; }
#draft-preview { color: #f2eefa; pointer-events: none; }
.entry button {
  flex: none; display: grid; place-items: center; width: 35px; height: 35px; border-radius: 12px;
  border: 1px solid #f9f3ffbf; color: #271d37; background: linear-gradient(155deg, #eee5ff, #c6b7ed 78%, #e1d2fb);
  box-shadow: inset 0 1px #fff9; transition: background .2s, transform .2s;
}
.entry button:enabled:hover { transform: translateY(-1px); }
.entry:not(:has(textarea[data-preview])) button:disabled { color: #c4b9d7; background: #37303f; border-color: #d2c3ef2e; box-shadow: none; }
.entry.preview-entry {display:grid;min-height:37px;align-items:center;padding-inline:12px;cursor:default}
.preview-idle {grid-area:1/1;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0;color:#cfc5df;font-size:.8rem}
.preview-idle span {border:1px solid #d0c5eb52;border-radius:20px;padding:2px 8px;color:#eee5fa;font-size:.72rem}
.preview-entry[data-preview] .preview-idle {visibility:hidden}
.preview-entry #draft-preview {grid-area:1/1;padding:5px 0;font-size:clamp(.82rem,1.2vw,1rem)}

dialog {
  width: min(426px, calc(100% - 26px)); max-height: calc(100dvh - 28px); overflow: auto; padding: 22px;
  color: var(--ink); border: 1px solid var(--glass-edge); border-radius: 22px;
  background: linear-gradient(140deg, #332d42, #1c1826 68%); box-shadow: inset 0 1px #ffffff24, 0 25px 90px #030108a1;
  scrollbar-width: thin; scrollbar-color: #71647f transparent;
}
dialog::backdrop { background: #090710b8; backdrop-filter: blur(6px); }
dialog header, .sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
dialog h2 { font: 570 1.55rem/1.2 var(--display); letter-spacing: -.04em; }
dialog header button { width: 34px; height: 34px; }
dialog ol { list-style: none; margin: 16px 0; padding: 0; }
dialog li { display: grid; grid-template-columns: 24px 1fr; gap: 9px; padding: 12px 5px; border-top: 1px solid var(--rule); }
dialog li[data-selected] { background: #c4ace513; }
.part-index { align-self: start; color: var(--lavender); font: 550 .78rem/1.6 var(--mono); }
dialog li a { font-size: 1rem; font-weight: 590; text-underline-offset: 3px; text-decoration-color: #c4b3e56b; }
dialog li p { margin-top: 5px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
#fabricated { margin: 4px 0 16px; padding-top: 12px; border-top: 1px solid var(--rule); }
#fabricated h3 { margin: 0 0 7px; font: 560 1.05rem/1.2 var(--display); }
#fabricated-list { margin: 0; padding: 0; list-style: none; }
#fabricated-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px; border: 0; color: var(--muted); font-size: .84rem; }
#fabricated-list li b { color: var(--primary); font-weight: 520; }
.sheet-foot button { padding: 8px 11px; font-size: .83rem; }
.sheet-foot a { color: var(--lavender); font-size: .78rem; text-underline-offset: 3px; }
.static { padding: 16px 5vw; background: var(--night); color: var(--ink); }
.static img { display: block; width: min(100%, 900px); height: auto; margin: auto; }
.static figcaption { max-width: 900px; margin: 12px auto; color: var(--muted); }
.static a { color: var(--lavender); }
.ghost { position: absolute; z-index: 5; top: 0; left: 0; width: 19px; height: 23px; pointer-events: none; opacity: 0; filter: drop-shadow(0 2px 3px #06030a7d); transition: transform .38s cubic-bezier(.22,.76,.24,1), opacity .16s; }
.ghost svg { width: 100%; height: 100%; fill: #e4dbff; stroke: #241930; stroke-width: 1.5; }
.ghost.visible { opacity: 1; }
.ghost::after { content: ""; position: absolute; top: 1px; left: 1px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--primary); transform: translate(-50%, -50%); opacity: 0; }
.ghost.press::after { animation: click-ring .38s ease-out; }
@keyframes click-ring { from { opacity: 1; transform: translate(-50%, -50%) scale(.45); } to { opacity: 0; transform: translate(-50%, -50%) scale(2.6); } }

@media (min-width: 1750px) {
  .desk { grid-template-columns: minmax(0, 1fr) minmax(510px, 32%); }
  .consult { padding-inline: clamp(33px, 2.35vw, 62px); }
}
@media (max-width: 1150px) {
  .mast { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding-inline: 10px; min-height: 54px; }
  .shelf { justify-self: center; max-width: 100%; }
  .rack label { gap: 4px; padding-inline: 8px; }
  .rack img { width: 31px; height: 25px; }
  .brand { font-size: 1.3rem; }
  .brand-lockup { gap: 8px; }
  .brand-lens { width: 32px; height: 32px; border-radius: 11px; }
  .product-name { font-size: 1.05rem; }
  .desk { grid-template-columns: minmax(0, 1fr) minmax(310px, 35%); }
  .stage-controls { gap: 8px; }
  .measure { flex-wrap: wrap; gap: 2px 6px; }
}
@media (max-width: 850px) and (orientation: portrait), (max-width: 650px) and (min-height: 480px) {
  .studio {
    --outer: clamp(8px, 1.8vw, 16px); --gutter: clamp(11px, 2.9vw, 24px);
    min-height: 0; gap: 8px; padding-block: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-bottom));
  }
  .studio::before { background-size: auto, auto, auto 100%; background-position: center, center, 40% center; opacity: .48; }
  .mast { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand status" "devices devices"; gap: 5px 10px; padding: 6px; border-radius: 21px; }
  .brand-lockup { grid-area: brand; gap: 8px; padding-left: 3px; }
  .mast-end { grid-area: status; }
  .brand { gap: 6px; font-size: 1.17rem; }
  .brand-lens { width: 27px; height: 27px; border-radius: 9px; }
  .brand-lens svg { width: 17px; height: 16px; }
  .product-name { font-size: .98rem; }
  .brand-rule { height: 14px; }
  .release { grid-area: status; margin-right: 3px; padding: 4px 9px; gap: 6px; font-size: .8rem; }
  .shelf { grid-area: devices; justify-self: stretch; }
  .rack { padding: 2px; border-radius: 16px; }
  .rack label { min-height: 34px; padding: 2px; gap: 4px; border-radius: 13px; font-size: clamp(.68rem, 1.7vw, .84rem); }
  .desk { grid-template: minmax(0, .94fr) minmax(0, 1.06fr) / minmax(0, 1fr); gap: 7px; }
  .file-head { padding-top: clamp(5px, 1vh, 13px); gap: 8px; }
  .file-kind { margin: 0 0 3px 1px; gap: 6px; font-size: .65rem; }
  .file-kind::before { width: 5px; height: 5px; }
  h1 { font-size: clamp(1.65rem, 5.25vw, 2.65rem); }
  .view-tools { gap: 0; padding: 2px; }
  .parts-action { min-height: 29px; padding: 3px 7px; gap: 5px; font-size: .75rem; }
  .plane { margin: 0 2px; }
  .stage-controls { margin-inline: var(--gutter); padding: 4px 0 2px; gap: 7px; }
  .measure { gap: 5px; padding-left: 22px; font-size: .7rem; }
  .measure i { width: 15px; }
  .measure i::after { left: 3px; box-shadow: 4px 0 #c4b7e5, 8px 0 #c4b7e5; }
  .measure strong { font-size: .76rem; }
  .stage[data-building] .measure span { display: none; }
  .separation { gap: 7px; font-size: .73rem; }
  .separation input { width: clamp(55px, 14vw, 107px); height: 30px; }
  .orbit { width: 30px; height: 30px; }
  .orbit svg { width: 16px; }
  .build-status { top: 3px; left: var(--gutter); padding: 2px 7px 5px; border-radius: 9px; gap: 2px 6px; }
  .build-status > span, .build-status strong { font-size: .7rem; }
  .step-picker { min-height: 19px; }
  .operation { bottom: 3px; padding: 3px 7px; font-size: .67rem; }
  .consult { padding: clamp(9px, 1.3vh, 16px) var(--gutter); border-radius: 19px; }
  .consult-head { padding: 0 0 6px; gap: 7px; }
  .agent-sign { width: 25px; height: 25px; border-radius: 9px; }
  .agent-sign svg { width: 15px; height: 14px; }
  .consult h2 { font-size: 1.1rem; }
  .sample { font-size: .7rem; }
  .activity { min-height: 25px; font-size: .72rem; }
  #messages { padding: 3px 3px 7px 0; gap: 12px; }
  .line { gap: 5px; }
  .speaker { font-size: .76rem; }
  .client p { padding: 5px 10px; border-radius: 12px 4px 12px 12px; }
  .client p, .agent p { font-family: Inter, system-ui, sans-serif; font-size: clamp(.93rem, 2.1vw, 1.12rem); line-height: 1.38; letter-spacing: 0; }
  .tool-result { min-height: 19px; font-size: .78rem; }
  .tool-spec { font-size: .69rem; }
  .editor { gap: 6px; padding-top: 5px; }
  .design-choices legend { font-size: .86rem; margin-bottom: 4px; }
  .choice-grid { gap: 5px; }
  .choice-grid button { grid-template-rows: clamp(24px, 3.6vh, 37px) auto; gap: 1px; padding: 3px 2px 5px; border-radius: 10px; }
  .choice-grid button i { max-width: 75px; }
  .choice-grid button span { font-size: .74rem; }
  .suggestions button { min-height: 28px; padding: 4px 8px; font-size: .76rem; }
  .entry { padding: 3px 4px 3px 11px; border-radius: 14px; }
  .entry button { width: 31px; height: 31px; border-radius: 10px; }
}
@media (max-width: 500px) {
  .rack { grid-template-columns: 1.04fr 1.19fr .99fr .78fr; }
  .rack label { flex-direction: column; gap: 0; min-height: 39px; padding-inline: 0; font-size: clamp(.65rem, 2.6vw, .76rem); line-height: 1.18; }
  .rack img { width: 34px; height: 20px; }
  #dimension-toggle span { display: none; }
  .view-tools .parts-action { min-width: 30px; }
}
@media (max-width: 500px) and (orientation: portrait) {
  .desk { grid-template-rows: minmax(0, .83fr) minmax(0, 1.17fr); }
  .consult { grid-template-rows: auto minmax(0, 1fr) auto; }
  .consult-head, .activity { grid-area: 1 / 1; }
  .consult-head { padding-inline-end: 43%; }
  .sample { display: none; }
  .activity { justify-self: end; align-self: center; max-width: 41%; min-height: 0; margin-bottom: 5px; gap: 5px; text-align: end; font-size: .69rem; }
  .exchange { grid-row: 2; }
  .editor { grid-row: 3; }
}
@media (max-height: 650px) and (orientation: portrait) {
  .studio { --outer: 6px; --gutter: 10px; gap: 5px; padding-block: max(4px, env(safe-area-inset-top)) max(5px, env(safe-area-inset-bottom)); }
  .mast { gap: 3px; padding: 4px; }
  .rack label { min-height: 30px; font-size: .65rem; }
  .rack img { height: 16px; }
  .desk { grid-template-rows: minmax(0, .88fr) minmax(0, 1.12fr); gap: 4px; }
  .file-head { padding-top: 3px; }
  .file-kind { font-size: .62rem; }
  h1 { font-size: 1.48rem; }
  .measure span { display: none; }
  .consult { padding-block: 6px; }
  .consult-head { padding-bottom: 4px; }
  .activity { min-height: 20px; }
  #messages { gap: 8px; }
  .line { gap: 3px; }
  .client p, .agent p { font-size: .89rem; }
  .editor { gap: 4px; padding-top: 3px; }
  .choice-grid button { grid-template-rows: 21px auto; gap: 0; padding: 1px 2px 3px; }
  .choice-grid button i { max-width: 53px; }
  .choice-grid button span { font-size: .69rem; }
  .suggestions button { min-height: 26px; font-size: .73rem; }
}
@media (max-height: 590px) and (orientation: landscape) {
  .studio {
    --outer: clamp(6px, 1.5vw, 16px); --gutter: clamp(9px, 1.5vw, 18px); min-height: 300px; gap: 6px;
    padding-block: max(5px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-bottom));
  }
  .mast { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 35px; padding: 2px 6px; gap: 7px; }
  .brand-lockup { gap: 6px; }
  .brand { font-size: 1.02rem; gap: 5px; }
  .brand-lens { width: 25px; height: 25px; border-radius: 9px; }
  .brand-lens svg { width: 16px; height: 15px; }
  .product-name { font-size: .88rem; }
  .release { font-size: .77rem; padding: 4px 8px; gap: 5px; }
  .rack { padding: 1px; }
  .rack label { min-height: 26px; padding: 1px 5px; font-size: .66rem; }
  .rack img { width: 26px; height: 19px; }
  .desk { grid-template-columns: minmax(0, 1.28fr) minmax(260px, 1fr); gap: 7px; }
  .file-head { padding-top: 6px; gap: 6px; }
  .file-kind { margin: 0 0 3px 1px; font-size: .61rem; }
  h1 { font-size: 1.55rem; }
  .view-tools { padding: 2px; }
  .parts-action { min-height: 26px; min-width: 28px; padding: 2px 6px; font-size: .71rem; }
  #dimension-toggle span, .measure span { display: none; }
  .stage-controls { padding: 3px 0; }
  .separation { gap: 5px; font-size: .72rem; }
  .separation input { width: 64px; height: 29px; }
  .orbit { width: 28px; height: 28px; }
  .build-status { top: 3px; padding: 1px 6px 4px; gap: 2px 5px; }
  .build-status strong { font-size: .72rem; }
  .consult { padding: 7px 12px; border-radius: 16px; }
  .consult-head { gap: 6px; padding-bottom: 4px; }
  .agent-sign { width: 23px; height: 23px; border-radius: 8px; }
  .agent-sign svg { width: 14px; height: 13px; }
  .consult h2 { font-size: 1.04rem; }
  .sample, .speaker, .activity { font-size: .69rem; }
  .activity { min-height: 21px; }
  #messages { gap: 8px; padding: 2px 3px 4px 0; }
  .line { gap: 3px; }
  .client p { padding: 4px 8px; }
  .client p, .agent p { font: 450 .88rem/1.3 Inter, system-ui, sans-serif; letter-spacing: 0; }
  .tool-result { min-height: 17px; font-size: .74rem; }
  .tool-spec { font-size: .68rem; }
  .editor { gap: 4px; padding-top: 3px; }
  .design-choices legend { font-size: .78rem; margin-bottom: 3px; }
  .choice-grid button { grid-template-rows: 21px auto; gap: 0; padding: 2px; border-radius: 8px; }
  .choice-grid button i { max-width: 52px; }
  .choice-grid button span { font-size: .71rem; }
  .suggestions button { min-height: 25px; padding: 3px 7px; font-size: .72rem; }
  .entry { padding: 2px 3px 2px 9px; border-radius: 12px; }
  .writing-field textarea, #draft-preview { min-height: 28px; padding-block: 3px; }
  .entry button { width: 27px; height: 27px; border-radius: 8px; }
}
@media (max-width: 730px) and (max-height: 479px) and (orientation: landscape) {
  .rack img { display: none; }
  .rack label { min-height: 26px; padding-inline: 3px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation: none !important; transition: none !important; }
  .ghost { display: none; }
}
@media (forced-colors: active) {
  h1 { color: CanvasText; background: none; }
  .rack label:has(input:checked), .parts-action[aria-pressed="true"] { border-color: Highlight; }
  .dimensions path { stroke: CanvasText; }
  .dimensions rect { fill: Canvas; stroke: CanvasText; }
  .dimensions text { fill: CanvasText; }
}
