:root {
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    sans-serif;
  color: #171717;
  background: #fff;
  font-synthesis: none;
  --muted: #737373;
  --line: #e7e7e7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
}
button {
  color: inherit;
}
button,
textarea,
input {
  -webkit-tap-highlight-color: transparent;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid #777;
  outline-offset: 4px;
}
button {
  border: 0;
}
svg {
  display: block;
}
h1,
h2,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.app-shell {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.topbar {
  height: 72px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}
.page-name {
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.4px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.header-meta {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}
.boot-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.onboarding {
  width: min(100%, 740px);
  margin: auto;
  overflow: auto;
  padding: 40px 32px;
  scrollbar-width: thin;
}
.role-view {
  text-align: center;
  padding-bottom: 85px;
}
.welcome-symbol {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 29px;
}
.onboarding h1 {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -1.15px;
}
.intro {
  font-size: 15px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 560px;
  margin: 17px auto 0;
  text-align: left;
  letter-spacing: -0.25px;
}
.intro p + p {
  margin-top: 12px;
}
.role-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 530px;
  margin: 36px auto 0;
}
.role-card {
  position: relative;
  background: white;
  border: 1px solid #dedede;
  border-radius: 18px;
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  transition:
    background 0.16s,
    border-color 0.16s,
    transform 0.16s;
}
.role-card:hover {
  background: #fafafa;
  border-color: #aaa;
  transform: translateY(-2px);
}
.role-card:disabled {
  opacity: 0.45;
}
.role-card svg {
  width: 31px;
  height: 31px;
  margin-bottom: 22px;
}
.role-title {
  font-size: 18px;
  font-weight: 550;
  margin-bottom: 8px;
}
.role-description {
  font-size: 12px;
  color: #777;
  letter-spacing: -0.25px;
}
.role-arrow {
  position: absolute;
  right: 22px;
  top: 24px;
  color: #999;
  font-size: 19px;
}
.welcome-footnote {
  font-size: 11px;
  color: #9a9a9a;
  margin-top: 27px;
  line-height: 1.8;
}
.closed-message {
  font-size: 14px;
  margin-top: 18px;
}
.profile-view {
  width: min(100%, 720px);
  margin: 0 auto;
  padding-top: 15px;
  padding-bottom: 45px;
}
.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #777;
  background: none;
  padding: 10px 0;
  margin-bottom: 22px;
}
.domain-badge {
  font-size: 11px;
  background: #f1f1f1;
  border-radius: 20px;
  padding: 6px 10px;
  display: inline-block;
  margin-bottom: 12px;
}
.profile-view h1 {
  font-size: 26px;
  letter-spacing: -0.8px;
}
.form-intro {
  font-size: 12px;
  color: #777;
  line-height: 1.8;
  margin: 10px 0 27px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 18px;
}
.field {
  font-size: 12px;
  display: block;
  position: relative;
  font-weight: 500;
}
.required-label,
.optional-label {
  font-size: 10px;
  font-weight: 400;
  color: #999;
  margin-left: 4px;
}
.field input,
.field textarea {
  display: block;
  width: 100%;
  border: 1px solid #dedede;
  border-radius: 10px;
  background: #fff;
  margin-top: 9px;
  padding: 13px 14px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: #222;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #a4a4a4;
}
.field textarea {
  resize: vertical;
  min-height: 77px;
  max-height: 160px;
}
.full-width {
  grid-column: 1/-1;
}
.input-suffix {
  position: relative;
}
.input-suffix input {
  padding-right: 32px;
}
.input-suffix > span {
  position: absolute;
  right: 16px;
  top: 15px;
  color: #888;
  font-size: 12px;
  font-weight: 400;
}
.consent-box {
  background: #f9f9f9;
  border: 1px solid #ededed;
  border-radius: 13px;
  margin-top: 27px;
  padding: 21px 22px;
}
.consent-box h2 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 9px;
}
.consent-box p {
  font-size: 11px;
  line-height: 1.8;
  color: #777;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 12px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.6;
  color: #444;
}
.checkbox-row input {
  accent-color: #171717;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin: 1px 0 0;
}
.primary-button {
  background: #171717;
  color: #fff;
  border-radius: 11px;
  padding: 14px 21px;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
}
.primary-button:hover {
  background: #333;
}
.primary-button:disabled {
  background: #aaa;
}
.profile-view .primary-button {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 13px;
  margin-top: 23px;
}
.form-error {
  color: #aa3333;
  font-size: 12px;
  line-height: 1.7;
  margin-top: 15px;
}
.demo-banner,
.connection-banner {
  text-align: center;
  background: #f7f4e9;
  color: #806d35;
  font-size: 11px;
  line-height: 1.6;
  padding: 8px 16px;
  flex-shrink: 0;
}
.connection-banner {
  background: #f5f5f5;
  color: #777;
}
.chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.chat-scroll {
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}
.chat-inner {
  width: min(100%, 800px);
  padding: 13px 28px 25px;
  margin: 0 auto;
}
.session-intro {
  text-align: center;
  font-size: 10px;
  color: #a3a3a3;
  margin: 4px 0 39px;
}
.session-intro .separator {
  margin: 0 7px;
}
.session-intro p {
  margin-top: 8px;
  color: #8a8a8a;
  font-size: 12px;
}
.message {
  margin: 0 0 32px;
  font-size: 15px;
  line-height: 1.95;
  overflow-wrap: anywhere;
  letter-spacing: -0.15px;
}
.message.user {
  display: flex;
  justify-content: flex-end;
}
.user-bubble {
  max-width: 85%;
  background: #f4f4f4;
  padding: 10px 18px;
  border-radius: 23px;
  white-space: pre-wrap;
  line-height: 1.8;
}
.message.assistant {
  padding: 0 3px;
}
.message.assistant p + p {
  margin-top: 14px;
}
.message.assistant h2,
.message.assistant h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 20px 0 8px;
}
.message.assistant ul,
.message.assistant ol {
  padding-left: 23px;
  margin: 12px 0;
}
.message.assistant li {
  padding-left: 3px;
  margin: 5px 0;
}
.message.assistant code {
  font-size: 13px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #f4f4f4;
}
.message.assistant strong {
  font-weight: 600;
}
.thinking {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 36px;
  color: #888;
  font-size: 13px;
  margin: 0 3px 19px;
}
.loading-dot {
  height: 12px;
  width: 12px;
  background: #171717;
  border-radius: 50%;
  display: inline-block;
  animation: breathe 1.1s ease-in-out infinite;
}
.composer-area {
  width: min(100%, 800px);
  padding: 0 24px 16px;
  margin: 0 auto;
  flex-shrink: 0;
  background: linear-gradient(transparent, #fff 16px);
  position: relative;
}
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px;
  font-size: 10px;
  color: #999;
  gap: 10px;
}
.chat-toolbar > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.saved-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #999;
}
.chat-toolbar button {
  background: none;
  color: #888;
  font-size: 11px;
  padding: 3px;
}
.chat-toolbar button:hover {
  color: #171717;
  text-decoration: underline;
}
.chat-toolbar button:disabled {
  color: #ccc;
  text-decoration: none;
}
.composer {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  background: #f4f4f4;
  border-radius: 28px;
  padding: 13px 13px 13px 21px;
}
.composer textarea {
  resize: none;
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none !important;
  background: transparent;
  font-size: 15px;
  line-height: 1.7;
  padding: 6px 0;
  max-height: 180px;
  min-height: 39px;
  scrollbar-width: thin;
  color: #222;
}
.composer textarea::placeholder {
  color: #929292;
}
.send-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 37px;
  height: 37px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #171717;
  color: white;
  margin-bottom: 1px;
}
.send-button svg {
  width: 21px;
  height: 21px;
}
.send-button:disabled {
  background: #d7d7d7;
  color: #fafafa;
}
.composer-footnote {
  font-size: 10px;
  color: #999;
  text-align: center;
  margin-top: 12px;
}
.chat-error {
  font-size: 12px;
  line-height: 1.8;
  color: #925353;
  background: #fcf7f7;
  padding: 13px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.retry-button {
  background: white;
  border: 1px solid #e3d5d5;
  border-radius: 8px;
  padding: 7px 11px;
  color: #555;
  white-space: nowrap;
  font-size: 11px;
}
.completed-note {
  text-align: center;
  margin: 35px auto 25px;
  padding: 26px;
  background: #fafafa;
  border-radius: 18px;
}
.completion-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 31px;
  height: 31px;
  background: #ededed;
  margin-bottom: 12px;
  font-size: 16px;
}
.completed-note h2 {
  font-size: 15px;
  font-weight: 550;
  margin-bottom: 10px;
}
.completed-note p {
  font-size: 12px;
  line-height: 1.9;
  color: #888;
}
.finish-dialog {
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  padding: 28px;
  width: min(90vw, 390px);
  box-shadow: 0 20px 80px #0002;
}
.finish-dialog::backdrop {
  background: #0004;
}
.finish-dialog h2 {
  font-size: 19px;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.finish-dialog p {
  font-size: 13px;
  line-height: 1.9;
  color: #777;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 27px;
}
.secondary-button {
  background: #f0f0f0;
  border-radius: 11px;
  padding: 14px 21px;
  font-size: 13px;
}
.fatal-error {
  position: absolute;
  inset: 72px 0 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  gap: 20px;
  text-align: center;
  font-size: 14px;
  color: #777;
}
@keyframes breathe {
  0%,
  100% {
    transform: scale(0.8);
    opacity: 0.65;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
}
@media (min-width: 1500px) {
  .role-view {
    padding-bottom: 120px;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 60px;
    padding: 0 20px;
  }
  .page-name {
    font-size: 16px;
  }
  .header-meta {
    font-size: 11px;
  }
  .onboarding {
    padding-left: 23px;
    padding-right: 23px;
  }
  .role-view {
    padding-bottom: 80px;
  }
  .onboarding h1 {
    font-size: 26px;
  }
  .intro {
    font-size: 13px;
  }
  .role-options {
    gap: 11px;
    margin-top: 29px;
  }
  .role-card {
    padding: 21px 17px;
  }
  .role-card svg {
    margin-bottom: 22px;
  }
  .role-title {
    font-size: 17px;
  }
  .role-description {
    font-size: 10px;
  }
  .role-arrow {
    right: 16px;
    top: 22px;
  }
  .welcome-footnote {
    font-size: 10px;
  }
  .profile-view {
    padding-top: 8px;
  }
  .profile-view h1 {
    font-size: 23px;
  }
  .form-grid {
    gap: 18px 12px;
  }
  .form-intro {
    font-size: 11px;
  }
  .field input,
  .field textarea {
    font-size: 16px;
    padding: 12px;
  }
  .field input::placeholder,
  .field textarea::placeholder {
    font-size: 12px;
  }
  .input-suffix > span {
    top: 18px;
  }
  .consent-box {
    padding: 18px 16px;
  }
  .checkbox-row {
    font-size: 11px;
  }
  .chat-inner {
    padding: 9px 21px 20px;
  }
  .session-intro {
    margin-bottom: 30px;
  }
  .message {
    font-size: 15px;
    margin-bottom: 26px;
  }
  .user-bubble {
    max-width: 90%;
    padding: 10px 15px;
  }
  .composer-area {
    padding: 0 14px max(12px, env(safe-area-inset-bottom));
  }
  .composer {
    padding-left: 17px;
    border-radius: 25px;
  }
  .composer textarea {
    font-size: 16px;
  }
  .composer-footnote {
    font-size: 9px;
  }
  .chat-toolbar {
    font-size: 9px;
    padding: 0 6px 10px;
  }
  .fatal-error {
    left: 0;
    top: 60px;
  }
  .chat-error {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }
}
@media (max-width: 390px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .full-width {
    grid-column: auto;
  }
  .onboarding h1 {
    font-size: 23px;
  }
  .role-description {
    font-size: 9px;
  }
  .role-card {
    padding: 20px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
