:root {
  color-scheme: light;
  --bg: #f4f0e8;
  --ink: #1f2a2e;
  --muted: #657276;
  --line: #d8d0c2;
  --panel: #fffaf1;
  --panel-strong: #ffffff;
  --teal: #2f8f83;
  --coral: #d85b4a;
  --gold: #d99a2b;
  --blue: #4e70b8;
  --shadow: 0 18px 45px rgba(39, 45, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: hidden;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(47, 143, 131, 0.12), transparent 35%),
    linear-gradient(300deg, rgba(216, 91, 74, 0.1), transparent 36%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 270px minmax(420px, 1fr) minmax(300px, 330px);
  gap: 14px;
  height: 100vh;
  padding: 14px;
  overflow: hidden;
}

.sidebar,
.rightbar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.brand,
.topbar,
.panel,
.activity-strip {
  border: 1px solid rgba(31, 42, 46, 0.11);
  background: rgba(255, 250, 241, 0.9);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 16px;
  border-radius: 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.1rem;
}

h2 {
  font-size: 1rem;
}

.panel {
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
}

.compact-panel {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading span,
.muted {
  color: var(--muted);
  font-size: 0.82rem;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 38px;
  padding: 0 10px;
}

input[type="color"] {
  padding: 4px;
}

textarea {
  min-height: 118px;
  padding: 10px;
  resize: vertical;
}

.avatar-preview {
  display: grid;
  place-items: center;
  min-height: 104px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.54);
}

.avatar-preview svg {
  width: 78px;
  height: 94px;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(31, 42, 46, 0.16));
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: #e3dac9;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  transition: width 0.25s ease;
}

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

.stats-grid div {
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
}

.stats-grid span,
.activity-label {
  display: block;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.2rem;
}

.secondary-button,
.chat-form button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: var(--panel);
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  min-width: 0;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
  padding: 16px;
  border-radius: 8px;
}

.topbar h2 {
  font-size: clamp(1.15rem, 2vw, 1.6rem);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 900;
}

.map-wrap {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.workspace-map {
  position: relative;
  width: min(100%, calc((100vh - 202px) * 1.52));
  max-width: 1180px;
  aspect-ratio: 1.52 / 1;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(31, 42, 46, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(31, 42, 46, 0.04) 1px, transparent 1px) 0 0 / 48px
      48px,
    linear-gradient(rgba(31, 42, 46, 0.04) 1px, transparent 1px) 0 0 / 48px 48px,
    #fbf6ec;
  box-shadow: var(--shadow);
  outline: none;
}

.workspace-map:focus-visible {
  border-color: var(--teal);
}

.zone {
  position: absolute;
  display: grid;
  place-items: start;
  padding: 12px;
  border: 2px solid rgba(31, 42, 46, 0.09);
  border-radius: 8px;
  color: rgba(31, 42, 46, 0.48);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.zone-lounge {
  left: 4%;
  top: 8%;
  width: 34%;
  height: 38%;
  background: rgba(47, 143, 131, 0.11);
}

.zone-focus {
  right: 5%;
  top: 7%;
  width: 32%;
  height: 42%;
  background: rgba(78, 112, 184, 0.11);
}

.zone-meeting {
  left: 27%;
  bottom: 7%;
  width: 42%;
  height: 30%;
  background: rgba(216, 91, 74, 0.1);
}

.desk,
.plant {
  position: absolute;
  border-radius: 8px;
}

.desk {
  width: 110px;
  height: 42px;
  background: #c8a46f;
  box-shadow: inset 0 -8px 0 rgba(31, 42, 46, 0.08);
}

.desk-a {
  right: 10%;
  top: 26%;
}

.desk-b {
  left: 10%;
  bottom: 15%;
}

.plant {
  width: 48px;
  height: 48px;
  background:
    radial-gradient(circle at 33% 35%, #5ca66b 0 25%, transparent 27%),
    radial-gradient(circle at 64% 32%, #2f8f83 0 26%, transparent 28%),
    linear-gradient(#b77852 0 0) center bottom / 24px 22px no-repeat;
}

.plant-a {
  left: 44%;
  top: 12%;
}

.plant-b {
  right: 20%;
  bottom: 12%;
}

.avatar {
  position: absolute;
  display: grid;
  place-items: center;
  width: 58px;
  height: 74px;
  margin: -37px 0 0 -29px;
  transform: translateZ(0);
  transition:
    left 0.12s linear,
    top 0.12s linear,
    filter 0.2s ease,
    opacity 0.2s ease;
}

.avatar.nearby {
  filter: drop-shadow(0 0 12px rgba(47, 143, 131, 0.45));
}

.avatar.away {
  opacity: 0.48;
}

.avatar.self {
  transition:
    filter 0.2s ease,
    opacity 0.2s ease;
}

.avatar svg {
  width: 46px;
  height: 54px;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(31, 42, 46, 0.16));
}

.avatar-name {
  width: 72px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  position: absolute;
  right: 5px;
  top: 8px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--panel-strong);
  border-radius: 50%;
  background: var(--teal);
}

.bubble {
  position: absolute;
  left: 50%;
  bottom: 67px;
  width: max-content;
  min-width: 72px;
  max-width: 118px;
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--panel);
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transform: translateX(-50%);
  box-shadow: 0 12px 24px rgba(31, 42, 46, 0.16);
}

.activity-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  border-radius: 8px;
}

.activity-strip strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.members-panel {
  min-height: 220px;
}

.profile-panel {
  min-height: 190px;
}

.selected-profile {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.selected-profile-head,
.modal-profile-head {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 12px;
}

.selected-profile-head svg,
.modal-profile-head svg {
  width: 48px;
  height: 58px;
  overflow: visible;
  filter: drop-shadow(0 8px 10px rgba(31, 42, 46, 0.16));
}

.selected-profile-head strong,
.selected-profile-head span,
.modal-profile-head h3,
.modal-profile-head span {
  display: block;
}

.modal-profile-head h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.selected-profile-head span,
.modal-profile-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.selected-profile dl,
#modal-profile-content dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.selected-profile dl div,
#modal-profile-content dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(216, 208, 194, 0.8);
}

.selected-profile dt,
.selected-profile dd,
#modal-profile-content dt,
#modal-profile-content dd {
  margin: 0;
  font-size: 0.82rem;
}

.selected-profile dt,
#modal-profile-content dt {
  color: var(--muted);
  font-weight: 800;
}

.selected-profile dd,
#modal-profile-content dd {
  text-align: right;
  overflow-wrap: anywhere;
}

.selected-profile p,
#modal-profile-content p {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(47, 143, 131, 0.09);
  font-size: 0.86rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 42, 46, 0.38);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(420px, 100%);
  border: 1px solid rgba(31, 42, 46, 0.14);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(31, 42, 46, 0.28);
}

.modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
}

#modal-profile-content {
  display: grid;
  gap: 14px;
  padding: 22px;
  padding-right: 58px;
}

.member-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.member-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--ink);
  text-align: left;
}

.member-row.selected,
.member-row:hover {
  border-color: rgba(47, 143, 131, 0.55);
  background: rgba(47, 143, 131, 0.08);
}

.member-row svg {
  width: 32px;
  height: 34px;
}

.member-row strong,
.member-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row span {
  color: var(--muted);
  font-size: 0.76rem;
}

.chat-log {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 132px;
  margin: 14px 0 10px;
  overflow: auto;
}

.chat-message {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(78, 112, 184, 0.1);
}

.chat-message strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
}

.chat-message p {
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 8px;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 260px minmax(460px, 1fr);
  }

  .rightbar {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
    padding: 12px;
  }

  .sidebar,
  .rightbar,
  .workspace {
    margin-bottom: 12px;
  }

  .rightbar {
    display: flex;
  }

  .workspace {
    grid-template-rows: auto auto auto;
  }

  .map-stage {
    min-height: 420px;
  }

  .activity-strip {
    grid-template-columns: 1fr;
  }
}
