@font-face {
  font-family: DM;
  src: url("/media/dm-sans.woff2") format("woff2");
  font-display: swap;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: DM, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  color: #1b1920;
  background: #f7f6f4;
}
button,
textarea,
input,
select {
  font: inherit;
}
button {
  color: inherit;
}
.app-shell {
  height: 100dvh;
  display: flex;
}
.rail {
  width: 62px;
  flex: 0 0 62px;
  background: #17151b;
  color: #a8a3ae;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0 11px;
  z-index: 10;
}
.mark {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #7958ff;
  color: white;
  font-weight: 800;
  font-size: 17px;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #ffffff22;
}
.rail nav {
  display: grid;
  gap: 6px;
  margin-top: 25px;
}
.rail-bottom {
  margin-top: auto;
  display: grid;
  gap: 8px;
}
.rail-btn,
.icon-btn {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  color: #85808c;
}
.rail-btn:hover,
.rail-btn.active {
  background: #2b2830;
  color: white;
}
.rail-btn svg,
.icon-btn svg,
.btn svg,
.hint svg {
  width: 18px;
  height: 18px;
}
.avatar {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eee9ff;
  color: #5e42d7;
  font-weight: 800;
  cursor: pointer;
}
.workspace {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 62px;
  flex: 0 0 62px;
  border-bottom: 1px solid #dfdde2;
  background: #fbfaf8;
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 24px;
}
.brand {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.brand span {
  font-weight: 800;
}
.crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: #99949d;
}
.project-title {
  border: 0;
  background: none;
  padding: 3px;
  color: #332f39;
  font-weight: 650;
  cursor: pointer;
}
.save-state {
  padding: 4px 7px;
  border-radius: 6px;
  background: #f0ecff;
  color: #7254dd;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}
.btn {
  height: 36px;
  padding: 0 13px;
  border: 1px solid #dedbe1;
  border-radius: 9px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.btn.dark {
  background: #1d1a21;
  border-color: #1d1a21;
  color: #fff;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9277ff;
}
.main-grid {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: 365px minmax(500px, 1fr);
}
.chat-panel {
  background: #fbfaf8;
  border-right: 1px solid #dedce1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 28px 25px 12px;
}
.chat-head .icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #ddd9e0;
  border-radius: 9px;
  background: #fff;
}
.eyebrow {
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #8067de;
  font-weight: 800;
  margin: 0 0 11px;
}
.chat-head h1 {
  font-size: 29px;
  line-height: 1.08;
  letter-spacing: -1.25px;
  margin: 0;
  font-weight: 650;
}
.messages {
  flex: 1;
  overflow: auto;
  padding: 5px 25px 18px;
  scrollbar-width: thin;
}
.welcome > p {
  font-size: 13px;
  line-height: 1.65;
  color: #77727c;
  margin: 10px 0 17px;
}
.welcome strong {
  color: #4e465a;
}
.suggestions {
  display: grid;
  gap: 7px;
}
.suggestions button {
  border: 1px solid #e3e0e5;
  background: #fff;
  border-radius: 10px;
  text-align: left;
  padding: 11px 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.35;
  cursor: pointer;
  transition: 0.15s;
}
.suggestions button:hover {
  border-color: #a994f4;
  transform: translateY(-1px);
  box-shadow: 0 5px 15px #4e37650b;
}
.suggestions span {
  color: #8168e1;
}
.hint {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: #99939e;
  font-size: 10px;
  line-height: 1.5;
  margin: 17px 4px;
}
.hint svg {
  width: 15px;
  height: 15px;
  color: #8d71f0;
  flex: none;
}
.message {
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.65;
}
.message.user {
  margin-left: 22px;
  padding: 11px 13px;
  border-radius: 13px 13px 3px 13px;
  background: #302b36;
  color: #fff;
}
.message.assistant {
  padding-left: 12px;
  border-left: 2px solid #8a6ff0;
  color: #56505c;
}
.message.error {
  border-color: #d75757;
  color: #a33;
}
.typing {
  display: flex;
  gap: 4px;
  padding: 13px;
}
.typing i {
  width: 5px;
  height: 5px;
  background: #9a83ed;
  border-radius: 50%;
  animation: pulse 1s infinite;
}
.typing i:nth-child(2) {
  animation-delay: 0.15s;
}
.typing i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
    transform: translateY(-2px);
  }
}
.proposal {
  border: 1px solid #dcd4fa;
  background: #f5f1ff;
  border-radius: 12px;
  padding: 12px;
  margin: 12px 0;
}
.proposal b {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
}
.proposal p {
  font-size: 11px;
  color: #6d6676;
}
.proposal-actions {
  display: flex;
  gap: 6px;
}
.proposal button {
  border: 0;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 10px;
  cursor: pointer;
}
.proposal .approve {
  background: #7255df;
  color: #fff;
}
.composer {
  margin: 0 17px 17px;
  border: 1px solid #d7d3da;
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 25px #2015270b;
  padding: 11px 11px 8px;
}
.composer-tools { display:flex; align-items:center; gap:9px; min-width:0; }
.attach { width:32px; height:32px; display:grid; place-items:center; border:0; border-radius:9px; background:transparent; color:var(--muted); cursor:pointer; }
.attach:hover,.attach:focus-visible { background:#eeece8; color:var(--ink); outline:none; }
.attach svg { width:18px; height:18px; }
.file-library-btn { border:0; background:transparent; color:#7d7771; font-size:11px; cursor:pointer; padding:7px 4px; }
.file-library-btn:hover,.file-library-btn:focus-visible { color:#4c4641; text-decoration:underline; outline:none; }
.file-library-list { display:grid; gap:7px; max-height:50vh; overflow:auto; }
.file-library-item { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:11px; border:1px solid #e2ddd7; border-radius:10px; background:#fff; text-align:left; cursor:pointer; }
.file-library-item:hover,.file-library-item:focus-visible { border-color:#9b87e8; outline:none; }
.file-library-item small { color:#827b75; }
.file-hint { margin:7px 2px -1px; color:#88827d; font-size:11px; line-height:1.35; }
.draft-files,.message-files { display:flex; flex-wrap:wrap; gap:7px; }
.draft-files { padding:0 2px 9px; }
.file-chip { display:inline-flex; align-items:center; gap:7px; max-width:100%; padding:6px 9px; border:1px solid #ddd8d1; border-radius:10px; background:#f6f4f1; color:#3c3936; font-size:12px; text-decoration:none; }
.file-chip span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:190px; }
.file-chip small { color:#817b75; }
.file-chip button { border:0; background:none; padding:0 1px; cursor:pointer; color:#6f6963; font-size:16px; line-height:1; }
.message-files { margin-top:8px; }
.message.user .file-chip { background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.22); color:#fff; }
.message.user .file-chip small { color:rgba(255,255,255,.72); }
.responses-table { width:100%; border-collapse:collapse; font-size:13px; }
.responses-table th,.responses-table td { padding:10px; border-bottom:1px solid #e7e3dd; text-align:left; vertical-align:top; }
.responses-table th { color:#716b65; font-weight:600; }
.responses-empty { padding:28px; text-align:center; color:#7c766f; }
.response-scroll { overflow:auto; max-height:min(60vh,560px); }
.response-pager { display:flex; justify-content:flex-end; gap:8px; margin-top:12px; }
.response-pager button { border:1px solid #ddd7d0; border-radius:8px; background:#fff; padding:8px 11px; cursor:pointer; }
.response-pager button:disabled { opacity:.45; cursor:not-allowed; }
.copy-link { margin-top:9px; border:1px solid #ddd7d0; border-radius:8px; background:#fff; padding:7px 10px; cursor:pointer; color:#4e4944; }
.target-chip {
  margin: 0 17px 8px;
  padding: 8px 9px 8px 11px;
  border: 1px solid #d9d0f8;
  border-radius: 10px;
  background: #f5f1ff;
  color: #625779;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.target-chip[hidden] {
  display: none;
}
.target-chip b {
  color: #6f52d8;
}
.target-chip button {
  border: 0;
  background: transparent;
  color: #81798c;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.pick-toggle.active {
  background: #7958ff;
  color: #fff;
}
.pick-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.export-link {
  color: #6e6972;
  text-decoration: none;
}
.composer:focus-within {
  border-color: #9b87e8;
  box-shadow: 0 0 0 3px #8d70f015;
}
.composer textarea {
  width: 100%;
  max-height: 125px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #28232d;
  font-size: 12px;
  line-height: 1.5;
}
.composer textarea::placeholder {
  color: #aaa5ae;
}
.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  color: #aaa5ad;
  font-size: 9px;
}
.send {
  width: 29px;
  height: 29px;
  border: 0;
  border-radius: 9px;
  background: #785bdd;
  color: white;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.send svg {
  width: 15px;
}
.send:disabled {
  opacity: 0.4;
}
.preview-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #edebf0;
}
.preview-toolbar {
  height: 48px;
  flex: 0 0 48px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #d9d6de;
  background: #f8f7f6;
}
.browser-dots {
  display: flex;
  gap: 5px;
}
.browser-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d6d1da;
}
.address {
  height: 29px;
  min-width: 160px;
  max-width: 410px;
  flex: 1;
  margin: auto;
  background: #eeecef;
  border: 1px solid #e3e0e4;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #8c8790;
  font-size: 10px;
}
.address svg {
  width: 11px;
}
.viewport-toggle {
  display: flex;
  background: #ebe8ed;
  border-radius: 8px;
  padding: 2px;
}
.viewport-toggle button {
  width: 29px;
  height: 25px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #928d96;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.viewport-toggle button.active {
  background: #fff;
  color: #3b3540;
  box-shadow: 0 1px 5px #40344815;
}
.viewport-toggle svg {
  width: 14px;
}
.preview-toolbar > .icon-btn {
  width: 29px;
  height: 29px;
  border-radius: 7px;
  color: #6e6972;
}
.pasteboard {
  min-height: 0;
  flex: 1;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
  background: radial-gradient(circle at 50% 35%, #f2f0f5, #e8e6eb);
}
.device {
  position: relative;
  background: #fff;
  box-shadow: 0 16px 45px #2a20301a;
  transition:
    width 0.25s,
    height 0.25s;
  border: 1px solid #d7d3da;
  overflow: hidden;
}
.device.desktop {
  width: min(100%, 1180px);
  height: 100%;
}
.device.mobile {
  width: 390px;
  max-width: 100%;
  height: min(100%, 780px);
  border-radius: 18px;
}
.device iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #fff;
}
.preview-loading {
  position: absolute;
  inset: 0;
  background: #f9f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 11px;
  color: #8b858f;
}
.preview-loading span {
  width: 14px;
  height: 14px;
  border: 2px solid #ddd5f5;
  border-top-color: #785bdd;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}
.preview-loading.hidden {
  display: none;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  transform: translate(-50%, 20px);
  background: #211e25;
  color: #fff;
  padding: 10px 14px;
  border-radius: 9px;
  opacity: 0;
  pointer-events: none;
  font-size: 11px;
  transition: 0.2s;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  background: #17121d88;
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal {
  width: min(440px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fcfbf9;
  border-radius: 18px;
  box-shadow: 0 28px 80px #0004;
  padding: 24px;
}
.modal.wide {
  width: min(650px, 100%);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}
.modal h2 {
  font-size: 20px;
  letter-spacing: -0.5px;
  margin: 0;
}
.modal h3 {
  font-size: 12px;
  margin: 18px 0 7px;
}
.modal .close {
  border: 0;
  background: #eeeaf0;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  cursor: pointer;
}
.modal label {
  display: block;
  font-size: 10px;
  color: #77717b;
  margin: 10px 0 5px;
}
.modal input,
.modal select {
  width: 100%;
  height: 40px;
  border: 1px solid #dcd8df;
  border-radius: 9px;
  background: #fff;
  padding: 0 11px;
  outline: 0;
}
.modal input:focus,
.modal select:focus {
  border-color: #8d74e8;
}
.modal-primary {
  width: 100%;
  height: 41px;
  border: 0;
  border-radius: 10px;
  background: #7254df;
  color: #fff;
  font-weight: 700;
  margin-top: 15px;
  cursor: pointer;
}
.modal-note {
  color: #8c8790;
  font-size: 10px;
  line-height: 1.5;
}
.tabs {
  display: flex;
  gap: 5px;
}
.tabs button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #eeebf0;
  cursor: pointer;
}
.tabs button.active {
  background: #29252e;
  color: #fff;
}
.project-list,
.history-list {
  display: grid;
  gap: 7px;
}
.list-item {
  width: 100%;
  border: 1px solid #e2dee5;
  border-radius: 10px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.list-item small {
  display: block;
  color: #99929c;
  margin-top: 3px;
}
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.template {
  border: 1px solid #dfdbe2;
  border-radius: 10px;
  background: #fff;
  padding: 13px;
  text-align: left;
  cursor: pointer;
}
.template.active {
  border-color: #7658e2;
  box-shadow: inset 0 0 0 1px #7658e2;
}
.template b {
  font-size: 12px;
}
.template span {
  display: block;
  font-size: 9px;
  color: #918b94;
  margin-top: 4px;
}
.mobile-tabbar,
.mobile-only {
  display: none;
}
.empty {
  color: #918b94;
  text-align: center;
  font-size: 11px;
  padding: 25px;
}
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 340px minmax(440px, 1fr);
  }
  .crumb .muted,
  .crumb > span:nth-child(2) {
    display: none;
  }
  .topbar {
    gap: 10px;
  }
  .pasteboard {
    padding: 12px;
  }
}
@media (max-width: 700px) {
  html,
  body {
    overflow: hidden;
  }
  .rail {
    display: none;
  }
  .topbar {
    height: 55px;
    flex-basis: 55px;
    padding: 0 12px;
  }
  .brand {
    font-size: 16px;
  }
  .crumb {
    display: none;
  }
  .mobile-only {
    display: grid;
  }
  .btn-label {
    display: none;
  }
  .btn.subtle {
    width: 36px;
    padding: 0;
    justify-content: center;
  }
  .main-grid {
    display: block;
    position: relative;
  }
  .chat-panel,
  .preview-panel {
    position: absolute;
    inset: 0;
    border: 0;
  }
  .preview-panel {
    display: none;
  }
  .main-grid.show-preview .chat-panel {
    display: none;
  }
  .main-grid.show-preview .preview-panel {
    display: flex;
  }
  .chat-head {
    padding: 22px 20px 10px;
  }
  .chat-head h1 {
    font-size: 27px;
  }
  .messages {
    padding-left: 20px;
    padding-right: 20px;
  }
  .composer {
    margin: 0 12px 12px;
  }
  .file-hint { display:none; }
  .file-chip span { max-width:145px; }
  .response-scroll { max-height:55vh; }
  .preview-toolbar {
    padding: 0 8px;
  }
  .browser-dots {
    display: none;
  }
  .pasteboard {
    padding: 7px 7px 48px;
  }
  .device.desktop {
    width: 100%;
    height: 100%;
  }
  .device.mobile {
    height: 100%;
    border-radius: 13px;
  }
  .mobile-tabbar {
    position: absolute;
    display: flex;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    background: #211e25;
    padding: 3px;
    border-radius: 10px;
    box-shadow: 0 8px 20px #0003;
  }
  .mobile-tabbar button {
    border: 0;
    background: none;
    color: #aaa4af;
    border-radius: 7px;
    padding: 7px 14px;
    font-size: 10px;
  }
  .mobile-tabbar button.active {
    background: #fff;
    color: #211e25;
  }
}
.modal-primary.secondary {
  background: #29252e;
}
.modal-primary.first {
  margin: 0 0 14px;
}
.modal-primary:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.setting-card {
  border: 1px solid #e1dde5;
  border-radius: 12px;
  padding: 13px;
  margin-top: 8px;
  background: #fff;
}
.setting-card strong {
  font-size: 11px;
  display: block;
}
.setting-card .modal-note {
  margin: 5px 0 0;
}
.setting-link {
  display: block;
  color: #6547d6;
  font-size: 10px;
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.state-pill {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #eee9ff;
  color: #6246c9;
  font-size: 9px;
}
