:root {
  --bg: #111820;
  --panel: #171f2b;
  --panel-2: #202938;
  --line: rgba(255, 255, 255, 0.12);
  --muted: #98a6b8;
  --text: #eef4ff;
  --accent: #ffb34d;
  --blue: #66a7ff;
  --cyan: #65d6cf;
  --violet: #b78cff;
  --green: #73d68b;
  --red: #ff6d6d;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 12%, rgba(101, 214, 207, 0.16), transparent 34%),
    radial-gradient(circle at 70% 60%, rgba(255, 179, 77, 0.1), transparent 34%),
    linear-gradient(145deg, #101620, #1b2331 55%, #121820);
}

.login-visual {
  display: grid;
  place-items: center;
  padding: 48px;
}

.mini-topbar {
  position: absolute;
  top: 38px;
  left: 48px;
  display: flex;
  gap: 10px;
}

.mini-topbar span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #546275;
}

.mini-map {
  position: relative;
  width: min(760px, 88vw);
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    #222733;
  background-size: 56px 56px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.mini-room,
.room {
  position: absolute;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.72);
}

.mini-room {
  display: grid;
  place-items: start;
  padding: 14px;
  font-weight: 800;
}

.mini-room-planning {
  left: 8%;
  top: 12%;
  width: 36%;
  height: 28%;
  background: rgba(255, 179, 77, 0.12);
}

.mini-room-design {
  left: 52%;
  top: 30%;
  width: 38%;
  height: 34%;
  background: rgba(237, 122, 169, 0.12);
}

.mini-room-dev {
  left: 60%;
  top: 68%;
  width: 28%;
  height: 22%;
  background: rgba(101, 214, 207, 0.12);
}

.mini-person,
.avatar-body {
  border-radius: 999px 999px 12px 12px;
  box-shadow: inset 0 -8px rgba(0, 0, 0, 0.12);
}

.mini-person {
  position: absolute;
  width: 42px;
  height: 48px;
  border: 2px solid rgba(255, 255, 255, 0.18);
}

.mini-person::before,
.avatar-head {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #ffd3a6;
}

.mini-person::before {
  width: 22px;
  height: 22px;
  left: 8px;
  top: -16px;
}

.p1 {
  left: 20%;
  top: 48%;
  background: var(--accent);
}

.p2 {
  left: 62%;
  top: 55%;
  background: var(--violet);
}

.p3 {
  left: 72%;
  top: 76%;
  background: var(--cyan);
}

.mini-card {
  position: absolute;
  min-width: 104px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(15, 22, 34, 0.88);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.c1 {
  left: 15%;
  top: 30%;
  border-color: rgba(255, 179, 77, 0.6);
}

.c2 {
  left: 66%;
  top: 36%;
  border-color: rgba(237, 122, 169, 0.6);
}

.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background: rgba(12, 18, 27, 0.72);
  border-left: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #65d6cf, #66a7ff 52%, #ffb46b);
  color: white;
  font-weight: 900;
  font-size: 28px;
  box-shadow: 0 14px 32px rgba(102, 167, 255, 0.26);
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  font-size: 28px;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand h1 span {
  color: var(--muted);
  font-size: 13px;
}

.brand p {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 46px;
}

.login-form label,
.field-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111a26;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.5;
}

.login-form button,
.primary-action,
.new-task button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #18202a;
  font-weight: 900;
}

.google-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.google-login span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: #1a2432;
  font-weight: 900;
}

.google-login:disabled,
.primary-action:disabled,
.new-task button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.login-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.app-shell {
  min-height: 100vh;
  background: #101722;
  overflow-x: hidden;
}

.topbar,
.status-strip,
.bottom-dock {
  border-bottom: 1px solid var(--line);
  background: rgba(14, 21, 31, 0.96);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(250px, 0.85fr) auto minmax(320px, 1.05fr) minmax(300px, 1.25fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 96px;
  padding: 16px 22px;
}

.brand.compact .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 23px;
}

.brand.compact h1 {
  font-size: 22px;
}

.brand.compact p {
  font-size: 13px;
}

.run-controls,
.project-switcher,
.role-tabs,
.status-strip,
.panel-tabs,
.dock-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-btn,
.role-tabs button,
.status-strip button,
.logout-btn,
.panel-tabs button,
.dock-title button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #1a2432;
  color: var(--text);
  font-weight: 800;
}

.control-btn,
.dock-title button {
  width: 42px;
}

.role-tabs,
.panel-tabs {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.role-tabs {
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.role-tabs::-webkit-scrollbar {
  display: none;
}

.role-tabs button,
.status-strip button,
.panel-tabs button {
  padding: 0 14px;
  white-space: nowrap;
}

.role-tabs button {
  min-width: max-content;
}

.role-tabs button.active,
.status-strip button.active,
.panel-tabs button.active {
  border-color: transparent;
  background: var(--accent);
  color: #18202a;
}

.logout-btn {
  padding: 0 16px;
}

.project-switcher {
  min-width: 360px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.04);
}

.project-switcher select,
.project-switcher input {
  min-height: 34px;
  border-radius: 999px;
  background: #121b27;
}

.project-switcher select {
  min-width: 130px;
}

.project-switcher input {
  min-width: 130px;
}

.project-switcher button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--cyan);
  color: #101820;
  font-weight: 900;
  white-space: nowrap;
}

.status-strip {
  flex-wrap: wrap;
  min-height: 58px;
  padding: 10px 22px;
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(320px, 360px);
  min-height: 660px;
}

.workspace {
  position: relative;
  min-height: 660px;
  height: clamp(620px, 62vw, 780px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 30%, rgba(102, 167, 255, 0.12), transparent 36%),
    linear-gradient(180deg, #1d2532 0 42%, #171e2a 42% 100%);
  perspective: 1000px;
}

#workspace3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.95;
}

.room {
  padding: 14px 18px;
  pointer-events: none;
  z-index: 1;
  transform: skewY(-5deg) rotateX(4deg);
  box-shadow: inset 0 0 36px rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(1px);
}

.room strong {
  display: block;
  font-size: 15px;
}

.planning-room {
  left: 8%;
  top: 9%;
  width: 25%;
  height: 20%;
  background: rgba(255, 179, 77, 0.08);
  color: #ffc777;
}

.pm-room {
  left: 43%;
  top: 9%;
  width: 24%;
  height: 20%;
  background: rgba(102, 167, 255, 0.1);
  color: #8ebbff;
}

.marketing-room {
  left: 6%;
  top: 36%;
  width: 40%;
  height: 25%;
  background: rgba(101, 214, 207, 0.08);
  color: #8bf5ef;
}

.design-room {
  left: 55%;
  top: 36%;
  width: 36%;
  height: 25%;
  background: rgba(183, 140, 255, 0.1);
  color: #cba5ff;
}

.client-room {
  left: 3%;
  top: 70%;
  width: 36%;
  height: 18%;
  background: rgba(255, 109, 109, 0.09);
  color: #ffb0b0;
}

.dev-room {
  left: 80%;
  top: 62%;
  width: 18%;
  height: 24%;
  background: rgba(115, 214, 139, 0.1);
  color: #96eba9;
}

.date-card,
.map-sign {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
  z-index: 2;
  background: rgba(14, 21, 31, 0.45);
  backdrop-filter: blur(6px);
}

.date-card {
  top: 36px;
  right: 26px;
  width: 160px;
  height: 68px;
  display: grid;
  place-items: center;
}

.map-sign {
  top: 36px;
  left: 48px;
  width: 160px;
  height: 68px;
  display: grid;
  place-items: center;
  letter-spacing: 4px;
}

.people-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.person {
  position: absolute;
  width: 160px;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.person.dimmed {
  opacity: 0.18;
}

.person.selected {
  z-index: 9;
  transform: translate(-50%, -50%) scale(1.03);
}

.avatar {
  position: relative;
  width: 58px;
  height: 74px;
  margin: 0 auto 8px;
}

.avatar-head {
  width: 28px;
  height: 28px;
  left: 15px;
  top: 0;
}

.avatar-head::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 6px;
  left: 5px;
  top: -1px;
  border-radius: 999px 999px 3px 3px;
  background: #2a1f1b;
}

.avatar-body {
  position: absolute;
  left: 4px;
  bottom: 0;
  width: 50px;
  height: 48px;
  background: var(--blue);
}

.avatar::after {
  content: "";
  position: absolute;
  left: 23px;
  top: 41px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.78);
}

.task-card {
  border: 2px solid var(--blue);
  border-radius: 8px;
  background: rgba(17, 25, 38, 0.94);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  padding: 10px 12px 12px;
  text-align: left;
  color: var(--text);
  backdrop-filter: blur(8px);
}

.task-card button {
  all: unset;
  display: block;
  cursor: pointer;
  width: 100%;
}

.task-card .status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
}

.task-card h3 {
  margin: 8px 0 4px;
  font-size: 15px;
  letter-spacing: 0;
}

.task-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.task-card small {
  display: block;
  margin-top: 8px;
  color: #c6d3e4;
  line-height: 1.35;
}

.task-card i {
  display: block;
  height: 5px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.task-card i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
}

.role-PM .avatar-body,
.role-PM .task-card {
  border-color: var(--blue);
}

.role-기획-분석 .avatar-body,
.role-기획-분석 .task-card {
  border-color: var(--accent);
}

.role-기획-분석 .avatar-body {
  background: var(--accent);
}

.role-UI-UX .avatar-body {
  background: var(--violet);
}

.role-UI-UX .task-card {
  border-color: var(--violet);
}

.role-프론트엔드 .avatar-body,
.role-프론트엔드 .task-card {
  border-color: var(--cyan);
}

.role-프론트엔드 .avatar-body {
  background: var(--cyan);
}

.role-백엔드 .avatar-body,
.role-백엔드 .task-card {
  border-color: var(--green);
}

.role-백엔드 .avatar-body {
  background: var(--green);
}

.role-QA .avatar-body,
.role-QA .task-card {
  border-color: var(--red);
}

.role-QA .avatar-body {
  background: var(--red);
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
  background: #121b27;
  border-left: 1px solid var(--line);
}

.panel-section,
.role-setup,
.new-task {
  display: grid;
  gap: 14px;
}

.role-setup {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.role-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #172231;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.role-checks input {
  width: 14px;
  min-height: 14px;
  accent-color: var(--accent);
}

.report-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.report-actions button:first-child {
  min-height: 46px;
  border: 1px solid rgba(101, 214, 207, 0.4);
  border-radius: 8px;
  background: rgba(101, 214, 207, 0.1);
  color: #a8fffa;
  font-weight: 900;
}

.panel-section h2,
.role-setup h2,
.new-task h2,
.dock-title h2 {
  margin: 0;
  font-size: 16px;
}

.selected-task {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #172231;
}

.selected-task h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.selected-task p {
  margin: 0 0 6px;
  color: var(--muted);
  line-height: 1.45;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.new-task {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.new-task button {
  background: #233148;
  color: var(--text);
  border: 1px solid var(--line);
}

.bottom-dock {
  display: grid;
  grid-template-columns: minmax(360px, 1.25fr) minmax(300px, 0.75fr);
  gap: 1px;
  min-height: 220px;
  border-top: 1px solid var(--line);
}

.event-log,
.report-feed {
  padding: 14px 18px;
  background: #111a26;
}

.dock-title {
  justify-content: space-between;
  margin-bottom: 12px;
}

.log-list,
.feed-list {
  display: grid;
  gap: 7px;
  max-height: 170px;
  overflow: auto;
}

.log-row,
.feed-item {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.log-row {
  grid-template-columns: 78px 90px 94px 1fr;
  align-items: center;
  color: #d7e3f4;
}

.log-row span:first-child,
.feed-item time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.log-row strong {
  color: var(--accent);
}

.feed-item strong {
  color: var(--text);
}

.feed-item p {
  margin: 0;
  color: #c6d3e4;
  line-height: 1.45;
}

@media (max-width: 1320px) {
  .topbar {
    grid-template-columns: minmax(240px, 1fr) auto minmax(360px, 1.2fr) auto;
    align-items: start;
  }

  .role-tabs {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand.compact,
  .project-switcher,
  .role-tabs {
    grid-column: 1 / -1;
  }

  .project-switcher {
    width: 100%;
    min-width: 0;
    border-radius: 8px;
    flex-wrap: wrap;
  }

  .project-switcher select,
  .project-switcher input,
  .project-switcher button {
    flex: 1 1 140px;
    border-radius: 8px;
  }

  .workspace-layout,
  .bottom-dock {
    grid-template-columns: 1fr;
  }

  .workspace {
    min-height: 720px;
    height: 720px;
  }

  .side-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .topbar {
    gap: 12px;
    padding: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand h1 {
    white-space: normal;
  }

  .brand.compact .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand.compact h1 {
    font-size: 20px;
  }

  .run-controls,
  .logout-btn {
    justify-self: end;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 42vh;
    padding: 64px 18px 24px;
  }

  .login-panel {
    padding: 28px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .role-tabs,
  .status-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .status-strip {
    padding: 10px 14px;
  }

  .workspace-layout {
    min-height: auto;
    overflow: visible;
  }

  .workspace {
    min-width: 0;
    min-height: 560px;
    height: clamp(560px, 118vw, 680px);
  }

  .room {
    padding: 10px 12px;
  }

  .room strong {
    font-size: 12px;
  }

  .planning-room {
    left: 5%;
    top: 10%;
    width: 34%;
  }

  .pm-room {
    left: 48%;
    top: 10%;
    width: 32%;
  }

  .marketing-room {
    left: 5%;
    top: 37%;
    width: 42%;
  }

  .design-room {
    left: 52%;
    top: 37%;
    width: 42%;
  }

  .client-room {
    left: 5%;
    top: 70%;
    width: 42%;
  }

  .dev-room {
    left: 56%;
    top: 68%;
    width: 38%;
  }

  .date-card {
    top: 18px;
    right: 14px;
    width: 118px;
    height: 48px;
    font-size: 12px;
  }

  .map-sign {
    top: 18px;
    left: 14px;
    width: 118px;
    height: 48px;
    font-size: 12px;
    letter-spacing: 2px;
  }

  .person {
    width: min(146px, 36vw);
  }

  .task-card {
    padding: 9px 10px;
  }

  .task-card h3 {
    font-size: 14px;
  }

  .side-panel,
  .event-log,
  .report-feed {
    padding: 14px;
  }

  .panel-tabs {
    width: 100%;
    border-radius: 8px;
  }

  .panel-tabs button {
    flex: 1;
  }

  .field-grid,
  .log-row {
    grid-template-columns: 1fr;
  }

  .bottom-dock {
    min-height: auto;
  }
}

@media (max-width: 520px) {
  .mini-topbar {
    top: 22px;
    left: 18px;
  }

  .mini-map {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .login-panel {
    padding: 24px 18px 32px;
  }

  .project-switcher {
    gap: 6px;
  }

  .project-switcher select,
  .project-switcher input,
  .project-switcher button {
    flex-basis: 100%;
  }

  .workspace {
    height: 590px;
  }

  .date-card,
  .map-sign {
    width: 104px;
  }

  .person {
    width: 132px;
  }

  .report-actions {
    grid-template-columns: 1fr;
  }
}
