/* Variant — "Editor".
   The application is a source file being filled in. Every answer writes a real
   property into application.tsx, and the question itself appears as an inline
   widget wedged into the code where that property will land — the same place
   an editor puts an inline suggestion.

   Code is system monospace; the widget chrome is Inter, because that is exactly
   how a real editor splits them. */

@font-face {
  font-family: 'Inter'; src: url('/shared/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Inter'; src: url('/shared/fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Inter'; src: url('/shared/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #1e2127;
  --bg-2:    #181a1f;
  --bg-3:    #21252b;
  --line:    #2c313a;
  --fg:      #c3cad6;
  --dim:     #7b8494;
  --faint:   #545c6a;

  --key:     #6cb6ff;   /* property names */
  --str:     #e4b98a;   /* strings */
  --kw:      #c398eb;   /* keywords */
  --type:    #6bd6c4;   /* types */
  --num:     #e8a06a;
  --com:     #5c6773;   /* comments */
  --red:     #e5686b;
  --green:   #79c98a;

  --font: 'Inter', ui-sans-serif, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html { -webkit-text-size-adjust: 100%; }

body {
  height: 100dvh; overflow: hidden;
  background: var(--bg-2); color: var(--fg);
  font-family: var(--font); font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(108, 182, 255, .28); }
:focus-visible { outline: 1px solid var(--key); outline-offset: 2px; }

/* ===================================================================== ide */

.ide { display: flex; height: 100dvh; }

.activity {
  flex: none; width: 48px; background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 10px;
}
.activity .ico {
  width: 44px; height: 42px; display: grid; place-items: center;
  color: var(--faint); font-size: 18px; border-left: 2px solid transparent;
}
.activity .ico.on { color: var(--fg); border-left-color: var(--key); }

.explorer {
  flex: none; width: 210px; background: var(--bg-2);
  border-right: 1px solid var(--line);
  padding: 12px 0; overflow: hidden;
}
.ex-head {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); padding: 0 16px 10px;
}
.ex-group {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  color: var(--fg); padding: 4px 16px;
}
.tree { list-style: none; font-size: 13px; }
.tree li { padding: 3px 16px 3px 26px; color: var(--dim); white-space: nowrap; }
.tree li.file.on { background: var(--bg-3); color: var(--fg); }
.tree .dir { margin-left: -12px; color: var(--fg); }
.tree .dot { color: var(--str); font-size: 9px; vertical-align: middle; }
.tree .dot.saved { color: transparent; }

/* ==================================================================== main */

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

.tabs { flex: none; display: flex; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 13px; color: var(--dim);
  border-right: 1px solid var(--line);
}
.tab.on { background: var(--bg); color: var(--fg); box-shadow: inset 0 2px 0 var(--key); }
.tab .tsx { font-size: 10px; font-weight: 700; color: var(--key); }
.tab .close { font-size: 9px; color: var(--str); }
.tab .close.saved { color: transparent; }

/* ================================================================== editor */

.editor {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-gutter: stable;
  padding: 12px 0 60px;
}
.editor::-webkit-scrollbar { width: 11px; }
.editor::-webkit-scrollbar-thumb { background: #333a45; border-radius: 6px; }

.code { font-family: var(--mono); font-size: 13.5px; line-height: 1.72; }

.line { display: flex; align-items: flex-start; padding-right: 20px; }
.line:hover { background: rgba(255, 255, 255, .018); }
.ln {
  flex: none; width: 56px; padding-right: 18px; text-align: right;
  color: var(--faint); user-select: none;
  border-left: 2px solid transparent;
}
/* Git gutter: lines this session wrote show as modified, like a real diff. */
.line.mod .ln { border-left-color: var(--key); }
.src { flex: 1; min-width: 0; white-space: pre-wrap; word-break: break-word; }

.k  { color: var(--key); }
.s  { color: var(--str); }
.kw { color: var(--kw); }
.ty { color: var(--type); }
.nu { color: var(--num); }
.cm { color: var(--com); font-style: italic; }
.pu { color: var(--dim); }

@keyframes write-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: none; }
}
.line.fresh { animation: write-in 260ms var(--ease) both; }

/* =========================================================== inline widget */

/* The question, wedged into the file where the property will be written. */
#stage[hidden] { display: none; }
.widget {
  margin: 10px 0 12px 56px; margin-right: 24px;
  background: var(--bg-3);
  border: 1px solid var(--line); border-left: 2px solid var(--key);
  border-radius: 6px;
  padding: 16px 18px 18px;
  font-family: var(--font);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  animation: widget-in 280ms var(--ease) both;
}
@keyframes widget-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.widget > * { animation: write-in 240ms var(--ease) both; animation-delay: calc(var(--i, 0) * 42ms); }

.w-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--dim); margin-bottom: 10px;
}
.w-head .spark { color: var(--kw); }
.w-head .prop { font-family: var(--mono); text-transform: none; letter-spacing: 0; color: var(--key); }

h1 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4; color: #e6ebf2; }
.lede { margin-top: 7px; font-size: 13px; color: var(--dim); line-height: 1.55; max-width: 62ch; }
.hint { margin-top: 7px; font-size: 12.5px; color: var(--faint); }

/* ================================================================= choices */

.opts { margin-top: 14px; display: grid; gap: 5px; }
.opt {
  display: flex; align-items: center; gap: 11px; width: 100%;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  padding: 9px 12px;
  font: inherit; font-size: 13.5px; color: var(--fg);
  text-align: left; cursor: pointer;
  transition: background 130ms ease, border-color 130ms ease, transform 130ms var(--ease);
}
.opt:hover { background: #262b33; border-color: #3a4150; transform: translateX(2px); }
.opt.chosen { background: rgba(108, 182, 255, .16); border-color: var(--key); }
.opt .n {
  flex: none; font-family: var(--mono); font-size: 11px; color: var(--faint);
  border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px;
}
.opt.chosen .n { color: var(--key); border-color: var(--key); }
.opt .v { font-family: var(--mono); font-size: 12.5px; color: var(--str); margin-left: auto; }

.tools { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; }
.tool {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 5px;
  padding: 7px 10px;
  font: inherit; font-size: 13px; color: var(--dim);
  text-align: left; cursor: pointer; transition: all 130ms ease;
}
.tool .box {
  flex: none; width: 14px; height: 14px; border-radius: 3px;
  border: 1px solid var(--faint); display: grid; place-items: center;
  font-size: 9px; color: transparent;
}
.tool:hover { color: var(--fg); border-color: #3a4150; }
.tool.on { color: var(--fg); border-color: var(--key); background: rgba(108, 182, 255, .1); }
.tool.on .box { background: var(--key); border-color: var(--key); color: var(--bg-2); }

/* =================================================================== forms */

.fields { margin-top: 14px; display: grid; gap: 13px; }
.field label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 5px; }
.field .opt-tag { color: var(--str); }

.field input, .field textarea {
  width: 100%; background: var(--bg);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 9px 11px;
  font-family: var(--mono); font-size: 13px; color: var(--str);
  outline: none; transition: border-color 150ms ease;
}
.field textarea { resize: vertical; min-height: 82px; line-height: 1.65; color: var(--fg); }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus { border-color: var(--key); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--red); }

.counter { font-size: 11.5px; color: var(--faint); text-align: right; margin-top: 4px; font-family: var(--mono); }

/* Errors live in the Problems panel, so inside the widget they stay quiet. */
.err { color: var(--red); font-size: 12.5px; margin-top: 5px; }
.err:empty { display: none; }

/* ================================================================== upload */

.drop {
  display: block; margin-top: 14px;
  border: 1px dashed var(--line); border-radius: 6px;
  padding: 22px 16px; text-align: center; cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.drop:hover, .drop.over { border-color: var(--key); background: rgba(108, 182, 255, .06); }
.drop strong { display: block; font-size: 13.5px; font-weight: 500; color: var(--fg); }
.drop span { font-size: 12px; color: var(--faint); }
.drop input[type=file] { display: none; }

.file-card {
  margin-top: 14px; display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line); border-left: 2px solid var(--type);
  border-radius: 5px; padding: 11px 13px;
}
.file-card .doc { font-family: var(--mono); font-size: 11px; color: var(--type); flex: none; }
.file-card .name { font-family: var(--mono); font-size: 12.5px; color: var(--str); word-break: break-all; }
.file-card .size { font-size: 11.5px; color: var(--faint); }

/* =================================================================== offer */

.offer {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(160deg, rgba(195, 152, 235, .12), transparent 65%);
  padding: 16px 18px;
}
.offer .amount { font-size: clamp(26px, 5vw, 36px); font-weight: 600; letter-spacing: -.03em; color: #e6ebf2; line-height: 1.1; }
.offer .per { font-size: 13px; font-weight: 400; color: var(--dim); }
.offer ul { list-style: none; margin-top: 13px; display: grid; gap: 8px; }
.offer li { display: flex; gap: 9px; font-size: 13px; color: var(--dim); line-height: 1.5; }
.offer li::before { content: '//'; font-family: var(--mono); color: var(--com); flex: none; }

/* ================================================================= actions */

.acts { margin-top: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.btn {
  background: var(--key); color: #12161c; border: 0; border-radius: 5px;
  padding: 8px 16px;
  font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: filter 140ms ease, transform 140ms var(--ease);
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

.btn-plain {
  background: none; border: 0; padding: 5px 0;
  font: inherit; font-size: 12.5px; color: var(--dim); cursor: pointer;
}
.btn-plain:hover { color: var(--key); }

.turnstile-slot { margin-top: 14px; min-height: 66px; }
.legal { margin-top: 12px; font-size: 11.5px; color: var(--faint); line-height: 1.55; max-width: 66ch; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ================================================================== panels */

.panel { flex: none; border-top: 1px solid var(--line); background: var(--bg-2); }
.panel-tabs { display: flex; gap: 18px; padding: 8px 16px 0; }
.panel-tabs span {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint); padding-bottom: 6px; border-bottom: 1px solid transparent;
}
.panel-tabs .on { color: var(--fg); border-bottom-color: var(--fg); }

.problems {
  padding: 10px 16px 12px; min-height: 42px; max-height: 96px; overflow-y: auto;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.7;
}
.problems .clean { color: var(--faint); font-family: var(--font); }
.problems .row { color: var(--fg); display: flex; gap: 9px; }
.problems .row .x { color: var(--red); flex: none; }
.problems .row .where { color: var(--faint); }

.status {
  flex: none; display: flex; align-items: center; gap: 18px;
  padding: 5px 16px; background: var(--key); color: #12161c;
  font-size: 11.5px; font-weight: 500;
}
.status .grow { flex: 1; }

/* ================================================================= closing */

.done-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(121, 201, 138, .16); border: 1px solid var(--green);
  color: var(--green); border-radius: 5px; padding: 6px 12px;
  font-size: 12.5px; font-weight: 500; margin-bottom: 12px;
}

.noscript {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg-2); color: var(--dim); padding: 24px; text-align: center;
}

/* The chrome is the joke, but it can't cost a phone user the actual form. */
@media (max-width: 900px) {
  .explorer { display: none; }
}
@media (max-width: 620px) {
  .activity { display: none; }
  .ln { width: 34px; padding-right: 10px; }
  .widget { margin-left: 34px; margin-right: 10px; }
  .panel { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
