:root {
  color-scheme: light;
  --ink: #171717;
  --muted: #777;
  --line: #e7e7e7;
  --soft: #f4f4f4;
  --surface: rgba(255, 255, 255, .94);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.shell-header {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 2147483647;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.tab-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  background: rgba(239, 239, 239, .88);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  backdrop-filter: blur(18px);
  pointer-events: auto;
}

.tab-button {
  min-width: 110px;
  border: 0;
  border-radius: 9px;
  padding: 8px 13px;
  background: transparent;
  cursor: pointer;
  color: #707070;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.tab-button:hover { color: var(--ink); }
.tab-button.is-active { color: var(--ink); background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .11); }
.tab-button:focus-visible, .submit-button:focus-visible, textarea:focus-visible { outline: 2px solid #171717; outline-offset: 2px; }

.workspace, .panel { position: fixed; inset: 0; }
.site-canvas { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

.history-panel {
  overflow-y: auto;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(22px);
}
.history-wrap { width: min(100% - 40px, 720px); margin: 0 auto; padding: 88px 0 160px; }
.history-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.history-heading h1 { margin: 0; font-size: 22px; line-height: 1.1; letter-spacing: -.035em; }
.history-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.history-list { display: grid; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--line); }
.history-prompt { margin: 0; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.history-meta { display: flex; gap: 9px; margin-top: 8px; color: #929292; font-size: 12px; }
.history-status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px; background: var(--soft); color: #626262; font-size: 11px; font-weight: 600; white-space: nowrap; }
.history-status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #aaa; }
.history-status.is-live::before { background: #27a45b; }
.history-empty { margin: 0; padding: 48px 0; color: #999; text-align: center; font-size: 13px; }

.composer-dock {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 2147483647;
  width: min(calc(100% - 32px), 760px);
  transform: translateX(-50%);
}
.prompt-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 16px 50px rgba(0, 0, 0, .1);
  backdrop-filter: blur(22px);
}
textarea {
  width: 100%;
  min-height: 42px;
  max-height: 132px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  padding: 10px 9px 8px;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  line-height: 1.5;
}
textarea::placeholder { color: #9a9a9a; }
.submit-button {
  height: 42px;
  border: 0;
  border-radius: 11px;
  padding: 0 18px;
  color: #fff;
  background: #171717;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: opacity .16s ease, transform .16s ease;
}
.submit-button:hover { transform: translateY(-1px); }
.submit-button:disabled { cursor: wait; opacity: .45; transform: none; }
.composer-note { margin: 7px 13px 0; color: #999; font-size: 10px; letter-spacing: .01em; }

.status-toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0 auto 10px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .1);
  backdrop-filter: blur(18px);
  color: #626262;
  font-size: 12px;
  line-height: 1.45;
}
.status-dot { flex: 0 0 auto; width: 6px; height: 6px; margin-top: 5px; border-radius: 50%; background: #171717; animation: pulse 1.2s ease-in-out infinite; }
.status-toast.is-complete .status-dot { background: #27a45b; animation: none; }
.status-toast.is-error .status-dot { background: #d54d4d; animation: none; }
.status-lines { display: grid; gap: 2px; min-width: 0; }
#status-request, #status-site { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#status-site { color: #888; font-size: 11px; }
.status-toast.is-deploying #status-site { display: block; }
.website-field { position: absolute; width: 1px; height: 1px; opacity: 0; clip-path: inset(50%); pointer-events: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes pulse { 50% { opacity: .25; transform: scale(.76); } }
@media (max-width: 600px) {
  .shell-header { top: 12px; }
  .tab-button { min-width: 96px; padding-inline: 10px; }
  .history-wrap { width: min(100% - 28px, 720px); padding-top: 92px; }
  .history-heading { display: block; }
  .history-heading p { margin-top: 7px; }
  .history-item { grid-template-columns: 1fr; gap: 10px; }
  .history-status { justify-self: start; }
  .composer-dock { bottom: 10px; width: min(calc(100% - 20px), 760px); }
  .prompt-composer { border-radius: 16px; }
  .submit-button { padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
