:root {
  --ink: #f4f7fb;
  --muted: #9aa8bd;
  --line: rgba(151, 166, 195, 0.22);
  --surface: rgba(17, 24, 39, 0.82);
  --surface-strong: rgba(22, 31, 49, 0.94);
  --soft: rgba(255, 255, 255, 0.07);
  --accent: #45a3ff;
  --accent-dark: #9ccfff;
  --mint: #26e0b8;
  --coral: #ff7a6b;
  --yellow: #f7c948;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.44);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(69, 163, 255, 0.28), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(38, 224, 184, 0.18), transparent 28%),
    radial-gradient(circle at 58% 92%, rgba(255, 122, 107, 0.15), transparent 32%),
    linear-gradient(135deg, #070b12 0%, #0c1320 44%, #101721 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 82%);
}

button {
  font: inherit;
  color: inherit;
}

.app-shell {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #061019;
  font-weight: 800;
  background: linear-gradient(135deg, var(--mint), var(--accent));
  box-shadow: 0 0 28px rgba(38, 224, 184, 0.28);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.ghost-button,
.primary-button,
.wide-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
}

.ghost-button {
  padding: 12px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.primary-button,
.wide-button {
  padding: 12px 18px;
  color: #061019;
  background: linear-gradient(135deg, var(--mint), var(--accent));
  box-shadow: 0 14px 36px rgba(69, 163, 255, 0.26);
}

.hero {
  display: block;
  padding: 34px 0 28px;
}

.hero-copy {
  padding: 28px 0 32px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 1360px;
  margin-bottom: 24px;
  font-size: clamp(36px, 5.2vw, 64px);
  line-height: 1.16;
  letter-spacing: 0;
  text-wrap: balance;
  text-shadow: 0 0 36px rgba(69, 163, 255, 0.12);
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.hero-description {
  max-width: 980px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
}

.hero-stats strong {
  color: var(--mint);
}

.summary-card,
.checkout-card,
.project-card,
.staff-row {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035)),
    var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 420px;
  gap: 20px;
  align-items: start;
}

.checkout-pane,
.assistant-pane {
  position: sticky;
  top: 20px;
  display: grid;
  gap: 14px;
}

.assistant-pane {
  min-width: 0;
}

.assistant-pane .section-heading {
  display: grid;
  gap: 10px;
  align-items: start;
}

.assistant-pane .section-heading p {
  max-width: none;
}

.summary-card,
.checkout-card {
  border-radius: 8px;
  padding: 18px;
}

.summary-card span,
.summary-card p,
.estimate-lines,
.section-heading p {
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 8px 0;
  font-size: 20px;
}

.summary-card p {
  margin-bottom: 0;
  line-height: 1.55;
}

.config-area {
  display: grid;
  gap: 20px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 14px;
}

.project-card {
  min-height: 160px;
  padding: 18px;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.project-card:hover,
.staff-row:hover {
  transform: translateY(-2px);
}

.project-card.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(69, 163, 255, 0.16), rgba(38, 224, 184, 0.075)),
    var(--surface-strong);
  box-shadow: 0 24px 70px rgba(69, 163, 255, 0.22);
}

.project-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 8px;
  color: #061019;
  background: linear-gradient(135deg, var(--yellow), var(--coral));
  font-weight: 800;
  box-shadow: 0 12px 30px rgba(255, 122, 107, 0.16);
}

.project-card strong,
.project-card small {
  display: block;
}

.project-card small {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.project-section,
.staff-section,
.notes-section,
.assistant-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.assistant-pane .assistant-section {
  padding: 24px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.section-heading p {
  max-width: 440px;
  margin-bottom: 0;
  line-height: 1.55;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-panel {
  display: grid;
  gap: 12px;
  width: 100%;
}

.chat-toolbar {
  display: flex;
  justify-content: flex-end;
}

.chat-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #b8c7dc;
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.chat-toolbar button:hover {
  color: var(--ink);
  border-color: rgba(69, 163, 255, 0.45);
  background: rgba(69, 163, 255, 0.12);
}

.chat-toolbar button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.chat-messages {
  display: grid;
  gap: 10px;
  align-content: start;
  align-items: start;
  width: 100%;
  min-height: 460px;
  max-height: 560px;
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.chat-message {
  width: fit-content;
  max-width: min(780px, 100%);
  margin: 0;
  padding: 11px 13px;
  border-radius: 8px;
  color: #d9e6fa;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-message.user {
  justify-self: end;
  color: #061019;
  background: linear-gradient(135deg, var(--mint), var(--accent));
  border-color: rgba(38, 224, 184, 0.28);
}

.chat-message.assistant {
  justify-self: start;
}

.chat-message.error {
  color: #ffd5cf;
  background: rgba(255, 122, 107, 0.12);
  border-color: rgba(255, 122, 107, 0.25);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  width: 100%;
}

.chat-form textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    rgba(0, 0, 0, 0.18);
  font: inherit;
  line-height: 1.55;
  outline: none;
}

.chat-form textarea::placeholder {
  color: rgba(154, 168, 189, 0.72);
}

.chat-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(69, 163, 255, 0.14);
}

.staff-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.notes-field {
  display: grid;
  gap: 10px;
}

.notes-field span {
  color: #c8d7ef;
  font-size: 14px;
  font-weight: 800;
}

.notes-field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.03)),
    rgba(0, 0, 0, 0.18);
  font: inherit;
  line-height: 1.6;
  outline: none;
}

.notes-field textarea::placeholder {
  color: rgba(154, 168, 189, 0.72);
}

.notes-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(69, 163, 255, 0.14);
}

.staff-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 8px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.staff-row.active {
  border-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(69, 163, 255, 0.14), rgba(38, 224, 184, 0.055)),
    var(--surface-strong);
  box-shadow: 0 18px 44px rgba(69, 163, 255, 0.15);
}

.role-meta {
  min-width: 0;
}

.role-meta strong,
.role-meta small,
.role-price {
  display: block;
}

.role-meta small {
  margin-top: 4px;
  color: var(--muted);
}

.role-price {
  margin-top: 3px;
  color: #c8d7ef;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.role-controls {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.grade-selector {
  display: inline-grid;
  grid-template-columns: repeat(4, 28px);
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.grade-selector button {
  display: grid;
  width: 28px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.grade-selector button:hover,
.grade-selector button.active {
  color: #061019;
  background: var(--mint);
}

.counter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.counter button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.counter button:hover {
  color: #061019;
  background: var(--mint);
}

.counter output {
  min-width: 24px;
  text-align: center;
  font-weight: 800;
}

.checkout-card {
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(38, 224, 184, 0.14), rgba(69, 163, 255, 0.055)),
    var(--surface-strong);
}

.total-price {
  display: block;
  margin: 12px 0 18px;
  font-size: 36px;
  line-height: 1;
  color: var(--mint);
}

.estimate-lines {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.estimate-lines div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.estimate-lines dt,
.estimate-lines dd {
  margin: 0;
}

.estimate-lines dd {
  color: var(--ink);
  font-weight: 800;
}

.duration-line dd {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.duration-line input {
  width: 74px;
  height: 36px;
  border: 1px solid rgba(69, 163, 255, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  text-align: center;
}

.duration-line input:focus {
  outline: 2px solid rgba(38, 224, 184, 0.28);
  border-color: var(--mint);
}

.duration-line input:disabled {
  color: var(--muted);
  opacity: 0.78;
  cursor: not-allowed;
}

.grand-total-line {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.grand-total-line dd {
  color: var(--mint);
  font-size: 20px;
}

.selected-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 38px;
  margin-bottom: 18px;
}

.selected-roles span {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(69, 163, 255, 0.1);
  color: #c8d7ef;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(69, 163, 255, 0.18);
}

.wide-button {
  width: 100%;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .checkout-pane,
  .assistant-pane {
    position: static;
  }

  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 24px, 1480px);
    padding-top: 12px;
  }

  .topbar,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions {
    width: 100%;
  }

  .nav-actions button {
    flex: 1;
  }

  .hero {
    padding-top: 18px;
  }

  .hero-copy {
    padding: 18px 0 0;
  }

  h1 {
    font-size: 38px;
    line-height: 1.18;
  }

  .project-grid,
  .staff-list,
  .summary-strip {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: auto;
  }

  .project-section,
  .staff-section,
  .notes-section,
  .assistant-section {
    padding: 16px;
  }

  .assistant-pane .assistant-section {
    padding: 16px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .brand span:last-child {
    display: none;
  }

  .hero-stats {
    display: grid;
  }

  .staff-row {
    grid-template-columns: 1fr;
  }

  .role-controls {
    justify-items: stretch;
  }

  .grade-selector {
    width: 100%;
    grid-template-columns: repeat(4, 1fr);
  }

  .counter {
    justify-content: space-between;
  }
}
