:root {
  color-scheme: light;
  --bg: #f5f2eb;
  --ink: #161616;
  --muted: #69635a;
  --line: #d9d3c8;
  --panel: #fffdf9;
  --accent: #12695a;
  --shadow: 0 20px 70px rgba(26, 24, 20, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.hero {
  background: #111;
  color: white;
  border-radius: 8px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(32px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: 0;
}

.subhead {
  max-width: 660px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 17px;
  line-height: 1.55;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: transparent;
  color: white;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  border-color: var(--accent);
}

#md {
  display: block;
  width: 100%;
  min-height: 70vh;
  resize: vertical;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 18px 0 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: #211f1b;
  font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

#md:focus {
  outline: 3px solid rgba(18, 105, 90, 0.18);
  border-color: var(--accent);
}

@media (max-width: 720px) {
  .hero {
    padding: 24px;
  }
}

.human-login,
.human-shell {
  --human-bg: #f7f9f8;
  --human-ink: #17211e;
  --human-muted: #6b7470;
  --human-line: #e1e8e4;
  --human-panel: #ffffff;
  --human-sidebar: #f5f8f6;
  --human-sidebar-deep: #ffffff;
  --human-sidebar-soft: #edf4f0;
  --human-sidebar-text: #33413c;
  --human-accent: #087568;
  --human-accent-soft: #e8f5f1;
  --human-shadow: 0 10px 28px rgba(29, 42, 37, 0.05);
}

.human-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background: var(--human-bg);
}

.human-login-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: var(--human-panel);
  box-shadow: var(--human-shadow);
}

.human-login-mark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.human-app-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--human-ink);
  color: white;
  font-weight: 950;
}

.human-login h1 {
  max-width: none;
  margin: 2px 0 0;
  font-size: 30px;
  line-height: 1.05;
}

.human-kicker {
  margin: 0;
  color: var(--human-accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.human-muted,
.human-empty {
  color: var(--human-muted);
}

.human-form,
.human-composer {
  display: grid;
  gap: 12px;
}

.human-form {
  margin-top: 26px;
}

.human-form label,
.human-composer label {
  display: grid;
  gap: 7px;
  color: #343235;
  font-size: 13px;
  font-weight: 850;
}

.human-form input,
.human-composer select,
.human-composer textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: white;
  color: var(--human-ink);
  font: inherit;
}

.human-composer textarea {
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
}

.human-form input:focus,
.human-composer select:focus,
.human-composer textarea:focus {
  outline: 3px solid rgba(18, 105, 90, 0.16);
  border-color: var(--human-accent);
}

.human-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--human-bg);
  color: var(--human-ink);
}

.human-sidebar {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--human-sidebar);
  color: var(--human-sidebar-text);
  border-right: 1px solid #e6ece8;
}

.human-brand-head {
  display: grid;
  gap: 4px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--human-line);
  background: var(--human-sidebar-deep);
}

.human-brand-name {
  color: var(--human-ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.15;
  text-decoration: none;
}

.human-brand-head span,
.human-sidebar-empty {
  color: var(--human-muted);
}

.human-sidebar-person-main strong,
.human-sidebar-person-main small,
.human-sidebar-person-meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-nav {
  display: grid;
  gap: 2px;
  padding: 4px 10px 8px;
}

.human-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--human-sidebar-text);
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  text-align: left;
  cursor: pointer;
}

.human-nav-item:hover {
  background: var(--human-sidebar-soft);
  color: var(--human-ink);
}

.human-nav-item.is-active {
  background: white;
  color: var(--human-ink);
  box-shadow: inset 3px 0 0 var(--human-accent);
}

.human-nav-item.has-alert {
  color: #7f3a2d;
}

.human-nav-item.has-alert.is-active {
  color: white;
}

.human-nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-nav-count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #dce8e3;
  color: var(--human-sidebar-text);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.human-nav-item.is-active .human-nav-count {
  background: var(--human-accent-soft);
  color: var(--human-accent);
}

.human-nav-item.has-alert .human-nav-count {
  background: #f6dcd5;
  color: #7f3a2d;
}

.human-nav-item.has-alert.is-active .human-nav-count {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.human-sidebar-section {
  padding: 14px 8px 20px;
}

.human-sidebar-title {
  padding: 0 10px 8px;
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.human-sidebar-list {
  display: grid;
  gap: 2px;
}

.human-sidebar-person {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--human-sidebar-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.human-sidebar-person:hover {
  background: var(--human-sidebar-soft);
  color: var(--human-ink);
}

.human-sidebar-person.is-active {
  background: white;
  color: var(--human-ink);
  box-shadow: inset 3px 0 0 var(--human-accent);
}

.human-sidebar-person-main,
.human-sidebar-person-meta {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.human-sidebar-person-main strong {
  font-size: 14px;
  font-weight: 850;
}

.human-sidebar-person-main small,
.human-sidebar-person-meta small {
  color: var(--human-muted);
  font-size: 12px;
}

.human-sidebar-person-meta {
  justify-items: end;
}

.human-sidebar-unread {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--human-accent-soft);
  color: var(--human-accent);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.human-sidebar-empty {
  margin: 0;
  padding: 0 10px;
  font-size: 13px;
}

.human-main {
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fbfcfb;
}

.human-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--human-line);
  background: white;
}

.human-section-header div:first-child {
  min-width: 0;
}

.human-section-kicker {
  margin: 0 0 3px;
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.human-section-header h1 {
  max-width: none;
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
}

.human-section-header p {
  margin: 4px 0 0;
  color: var(--human-muted);
  font-size: 13px;
}

.human-header-actions,
.human-row-actions,
.human-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.human-header-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.human-alerts {
  padding: 0 20px;
  background: white;
}

.human-board {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 28px;
  background: var(--human-bg);
}

.human-board.is-chat {
  display: grid;
  overflow: hidden;
  padding: 0;
  background: #f7faf8;
}

.human-content-list {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.human-panel {
  min-width: 0;
  max-width: 1180px;
  margin: 0 auto;
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: white;
  box-shadow: none;
  overflow: hidden;
}

.human-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--human-line);
}

.human-panel-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.human-panel-head > span {
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #eef4f1;
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.human-thread-panel {
  width: 100%;
  height: min(780px, calc(100vh - 210px));
  display: grid;
}

.human-board.is-chat .human-thread-panel {
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.human-thread {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  background: #fbfcfb;
}

.human-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 76px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--human-line);
  background: white;
  z-index: 2;
}

.human-thread-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.human-thread-head div {
  min-width: 0;
}

.human-thread-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.human-thread-head p {
  margin: 4px 0 0;
  color: var(--human-muted);
  font-size: 13px;
}

.human-chat-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 26px min(5vw, 64px) 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.human-date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--human-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.human-date-divider::before,
.human-date-divider::after {
  content: "";
  height: 1px;
  flex: 1 1 auto;
  background: rgba(101, 114, 110, 0.18);
}

.human-date-divider span {
  background: #fbfcfb;
  padding: 0 6px;
}

.human-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(760px, 76%);
}

.human-chat-row.outbound {
  justify-self: end;
}

.human-chat-row.inbound {
  justify-self: start;
}

.human-bubble {
  min-width: 0;
  flex: 1 1 auto;
  padding: 11px 13px;
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: white;
  box-shadow: none;
}

.human-chat-row.outbound .human-bubble {
  border-color: #d1e6df;
  background: #f1faf7;
}

.human-chat-row.is-unread .human-bubble {
  border-color: #b8ddd3;
}

.human-bubble-meta,
.human-message-actions,
.human-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.human-bubble-meta {
  margin-bottom: 6px;
  color: var(--human-muted);
  font-size: 12px;
}

.human-bubble-meta em {
  padding: 2px 7px;
  border-radius: 999px;
  background: #fbebd9;
  color: #8a4f16;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.human-bubble p {
  margin: 0;
  color: #222c29;
  line-height: 1.52;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.human-message-actions {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  opacity: 0.72;
}

.human-chat-row:hover .human-message-actions {
  opacity: 1;
}

.human-button,
.human-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #d4dfda;
  border-radius: 6px;
  background: white;
  color: var(--human-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.human-button:hover,
.human-tab:hover {
  border-color: #b9c9c3;
  background: #f7faf8;
}

.human-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.human-button.primary {
  border-color: var(--human-accent);
  background: var(--human-accent);
  color: white;
}

.human-button.primary:hover {
  border-color: #075f55;
  background: #075f55;
}

.human-button.ghost {
  background: transparent;
}

.human-button.subtle {
  min-height: 28px;
  padding: 0 6px;
  border-color: transparent;
  background: transparent;
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 780;
}

.human-button.subtle:hover {
  border-color: transparent;
  background: transparent;
  color: var(--human-accent);
}

.human-button.small,
.human-tab {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.human-tab.is-active {
  border-color: #cce3dc;
  background: var(--human-accent-soft);
  color: var(--human-accent);
}

.human-error,
.human-notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
}

.human-error {
  border: 1px solid #edc0b7;
  background: #fff4f1;
  color: #8f2e1b;
}

.human-notice {
  border: 1px solid #b6d7ca;
  background: var(--human-accent-soft);
  color: #195f50;
}

.human-list,
.human-message-list,
.human-directory {
  display: grid;
}

.human-item,
.human-message,
.human-agent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border-bottom: 1px solid #edf2ef;
}

.human-item:last-child,
.human-message:last-child,
.human-agent:last-child {
  border-bottom: 0;
}

.human-item {
  justify-content: space-between;
}

.human-item-main,
.human-agent > div,
.human-message-content {
  min-width: 0;
  flex: 1 1 auto;
}

.human-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.human-title-line strong {
  color: var(--human-ink);
  overflow-wrap: anywhere;
}

.human-title-line span,
.human-item small,
.human-message-top small,
.human-attachment span {
  color: var(--human-muted);
}

.human-title-line em {
  padding: 2px 7px;
  border-radius: 999px;
  background: #fbebd9;
  color: #8a4f16;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.human-item p,
.human-agent p,
.human-message-body {
  margin: 7px 0 0;
  color: #2d2c2f;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.human-message {
  position: relative;
}

.human-message.is-unread {
  background: #f2faf7;
}

.human-message.is-unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--human-accent);
}

.human-message-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.human-row-actions {
  justify-content: flex-end;
  flex: 0 0 auto;
  margin-top: 12px;
}

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

.human-agent {
  align-items: center;
  justify-content: space-between;
}

.human-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f1;
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.human-badge.friend {
  background: var(--human-accent-soft);
  color: #195f50;
}

.human-badge.incoming {
  background: #fbebd9;
  color: #8a4f16;
}

.human-badge.outgoing {
  background: #e8eef8;
  color: #254a7c;
}

.human-attachment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dfe9e5;
  border-radius: 8px;
  background: #fafcfb;
}

.human-attachment div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.human-attachment .human-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.human-attachment strong {
  overflow-wrap: anywhere;
}

.human-preview-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(18, 28, 24, 0.34);
}

.human-preview {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 56px rgba(18, 28, 24, 0.18);
  overflow: hidden;
}

.human-preview header,
.human-preview footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--human-line);
}

.human-preview footer {
  justify-content: flex-end;
  border-top: 1px solid var(--human-line);
  border-bottom: 0;
}

.human-preview h2 {
  margin: 0;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.human-preview p {
  margin: 4px 0 0;
  color: var(--human-muted);
}

.human-preview-body {
  min-height: 260px;
  overflow: auto;
  background: #f7faf8;
}

.human-preview-image {
  display: block;
  max-width: 100%;
  max-height: 620px;
  margin: 0 auto;
  object-fit: contain;
}

.human-preview-frame {
  display: block;
  width: 100%;
  height: min(620px, calc(100vh - 220px));
  border: 0;
  background: white;
}

.human-preview-text {
  margin: 0;
  padding: 16px;
  color: #17211e;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.human-composer {
  margin: 0;
  padding: 16px;
  border-top: 1px solid var(--human-line);
  background: white;
}

.human-composer.chat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label label"
    "body send";
  align-items: end;
  gap: 8px 10px;
  padding: 12px 18px 14px;
  border-top-color: rgba(8, 117, 104, 0.2);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  z-index: 2;
}

.human-composer-label {
  grid-area: label;
  color: var(--human-muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.human-composer-body {
  grid-area: body;
  min-width: 0;
}

.human-composer.chat .human-composer-body > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.human-composer.chat textarea {
  min-height: 46px;
  max-height: 130px;
  resize: vertical;
}

.human-composer.chat .human-button[type="submit"] {
  grid-area: send;
  min-height: 46px;
  min-width: 88px;
}

.human-empty {
  margin: 0;
  padding: 22px 16px;
  border: 0;
}

.human-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.22);
}

.human-avatar.small {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  font-size: 10px;
}

.human-avatar.large {
  width: 40px;
  height: 40px;
}

.human-avatar.tone-1 {
  background: #087568;
}

.human-avatar.tone-2 {
  background: #c8513a;
}

.human-avatar.tone-3 {
  background: #315f8f;
}

.human-avatar.tone-4 {
  background: #7a5a25;
}

.human-avatar.tone-5 {
  background: #5f6b2f;
}

.human-avatar.tone-6 {
  background: #6b5f96;
}

.human-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.human-metrics div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #f6faf8;
}

.human-metrics dt {
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 850;
}

.human-metrics dd {
  margin: 4px 0 0;
  color: var(--human-ink);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.human-home {
  display: grid;
  gap: 14px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.human-home-hero,
.human-home-section {
  min-width: 0;
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: white;
  box-shadow: none;
}

.human-home-hero {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.human-home-agent {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.human-home-agent div {
  min-width: 0;
}

.human-home-agent h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.human-home-agent p,
.human-home-description,
.human-home-feed-item small {
  color: var(--human-muted);
}

.human-home-agent p,
.human-home-description {
  margin: 4px 0 0;
}

.human-home-description {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.human-home-feed {
  display: grid;
}

.human-home-feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 16px;
  border: 0;
  border-bottom: 1px solid #edf2ef;
  background: transparent;
  color: var(--human-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.human-home-feed-item:last-child {
  border-bottom: 0;
}

.human-home-feed-item:hover {
  background: #f7faf8;
}

.human-home-feed-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
}

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

  .human-sidebar,
  .human-main {
    height: auto;
    overflow: visible;
  }

  .human-sidebar {
    min-height: auto;
  }

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

  .human-section-header,
  .human-message-top,
  .human-attachment,
  .human-agent,
  .human-item {
    align-items: stretch;
    flex-direction: column;
  }

  .human-header-actions,
  .human-row-actions {
    justify-content: flex-start;
  }

  .human-board {
    overflow: visible;
    padding: 12px;
  }

  .human-board.is-chat {
    height: calc(100vh - 132px);
    overflow: hidden;
    padding: 0;
  }

  .human-panel {
    max-width: none;
  }

  .human-directory {
    grid-template-columns: 1fr;
  }

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

  .human-home-feed-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .human-home-feed-item small {
    grid-column: 2;
  }

  .human-thread-panel {
    height: auto;
  }

  .human-board.is-chat .human-thread-panel {
    height: 100%;
  }

  .human-thread {
    min-height: 0;
  }

  .human-thread-head {
    flex-wrap: wrap;
  }

  .human-thread-tools {
    width: 100%;
    margin-left: 0;
  }

  .human-chat-scroll {
    align-content: start;
    min-height: 0;
    padding: 18px 12px;
    overflow-y: auto;
  }

  .human-chat-row {
    width: 100%;
  }

  .human-chat-row.outbound {
    padding-left: 34px;
  }

  .human-chat-row.inbound {
    padding-right: 24px;
  }

  .human-preview-backdrop {
    padding: 12px;
  }

  .human-preview {
    max-height: calc(100vh - 24px);
  }
}

/* Human View: minimal Codex-style surface */
.human-login,
.human-shell {
  --human-bg: #fafaf8;
  --human-ink: #1f1f1d;
  --human-muted: #74736e;
  --human-line: #e7e5df;
  --human-panel: #ffffff;
  --human-sidebar: #f5f5f2;
  --human-sidebar-deep: #fafaf8;
  --human-sidebar-soft: #ebebe6;
  --human-sidebar-text: #373732;
  --human-accent: #1f1f1d;
  --human-accent-soft: #eeeeea;
  --human-shadow: none;
  color: var(--human-ink);
}

.human-shell {
  background: var(--human-bg);
  grid-template-columns: 292px minmax(0, 1fr);
}

.human-login,
.human-board,
.human-board.is-chat,
.human-thread,
.human-main {
  background: var(--human-bg);
}

.human-sidebar {
  background: var(--human-sidebar);
  border-right: 1px solid var(--human-line);
}

.human-brand-head {
  min-height: 96px;
  align-content: center;
  padding: 18px 18px;
  border-bottom: 1px solid var(--human-line);
  background: transparent;
}

.human-brand-name {
  font-size: 18px;
  font-weight: 760;
  letter-spacing: 0;
}

.human-brand-head span,
.human-sidebar-title,
.human-section-kicker,
.human-composer-label {
  color: var(--human-muted);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.human-nav {
  gap: 1px;
  padding: 10px 10px 12px;
}

.human-nav-item,
.human-sidebar-person {
  border-radius: 6px;
  color: var(--human-sidebar-text);
  font-size: 13px;
  font-weight: 620;
}

.human-nav-item {
  min-height: 34px;
  padding: 0 10px;
}

.human-nav-item:hover,
.human-sidebar-person:hover {
  background: var(--human-sidebar-soft);
}

.human-nav-item.is-active,
.human-sidebar-person.is-active {
  background: #ffffff;
  color: var(--human-ink);
  box-shadow: none;
}

.human-nav-count,
.human-sidebar-unread,
.human-panel-head > span {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8e7e1;
  color: var(--human-ink);
  font-size: 11px;
  font-weight: 680;
  line-height: 20px;
}

.human-nav-item.is-active .human-nav-count,
.human-nav-item.has-alert.is-active .human-nav-count {
  background: #e8e7e1;
  color: var(--human-ink);
}

.human-nav-item.has-alert,
.human-nav-item.has-alert.is-active {
  color: var(--human-ink);
}

.human-nav-item.has-alert .human-nav-count {
  background: #eee1dc;
  color: #7f3a2d;
}

.human-sidebar-section {
  padding: 10px;
}

.human-sidebar-title {
  padding: 8px 10px;
}

.human-sidebar-list {
  gap: 1px;
}

.human-sidebar-person {
  min-height: 56px;
  padding: 8px 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.human-sidebar-person-main strong {
  font-size: 13px;
  font-weight: 680;
}

.human-sidebar-person-main small,
.human-sidebar-person-meta small,
.human-section-header p,
.human-thread-head p,
.human-bubble-meta,
.human-home-agent p,
.human-home-description,
.human-home-feed-item small {
  color: var(--human-muted);
}

.human-sidebar-person-main small,
.human-sidebar-person-meta small {
  font-size: 12px;
}

.human-main {
  color: var(--human-ink);
}

.human-section-header {
  min-height: 96px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--human-line);
  background: #ffffff;
}

.human-section-header h1 {
  font-size: 24px;
  font-weight: 720;
  line-height: 1.15;
}

.human-section-header p {
  font-size: 13px;
}

.human-alerts {
  padding: 0 24px;
  background: #ffffff;
}

.human-board {
  padding: 18px 24px 24px;
}

.human-panel,
.human-home-hero,
.human-home-section,
.human-login-card {
  border: 1px solid var(--human-line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: none;
}

.human-panel-head {
  min-height: 52px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--human-line);
}

.human-panel-head h2 {
  font-size: 15px;
  font-weight: 680;
}

.human-home {
  gap: 12px;
}

.human-home-hero {
  gap: 14px;
  padding: 18px;
}

.human-home-agent h2 {
  font-size: 18px;
  font-weight: 720;
}

.human-metrics {
  gap: 8px;
}

.human-metrics div {
  padding: 10px 12px;
  border: 1px solid var(--human-line);
  border-radius: 6px;
  background: #fbfbfa;
}

.human-metrics dt {
  color: var(--human-muted);
  font-size: 11px;
  font-weight: 620;
}

.human-metrics dd {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 720;
}

.human-home-feed-item {
  min-height: 46px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--human-line);
}

.human-home-feed-item:hover {
  background: #fbfbfa;
}

.human-home-actions {
  padding: 14px 16px;
}

.human-thread-panel,
.human-board.is-chat .human-thread-panel {
  border: 0;
  background: transparent;
}

.human-thread {
  background: #ffffff;
}

.human-thread-head {
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--human-line);
  background: #ffffff;
}

.human-thread-head h3 {
  font-size: 17px;
  font-weight: 720;
}

.human-thread-head p {
  font-size: 12px;
}

.human-thread-tools {
  gap: 6px;
}

.human-tabs {
  gap: 4px;
}

.human-chat-scroll {
  gap: 10px;
  padding: 24px min(5vw, 56px);
  background: #ffffff;
}

.human-date-divider {
  gap: 10px;
  margin: 2px 0;
  color: var(--human-muted);
  font-size: 10px;
  font-weight: 620;
}

.human-date-divider::before,
.human-date-divider::after {
  background: var(--human-line);
}

.human-date-divider span {
  background: #ffffff;
}

.human-chat-row {
  width: min(760px, 72%);
}

.human-message-stack {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.human-chat-row.inbound .human-message-stack {
  justify-self: start;
}

.human-chat-row.outbound .human-message-stack {
  justify-self: end;
}

.human-bubble {
  width: 100%;
  padding: 10px 12px;
  border-color: var(--human-line);
  border-radius: 7px;
  background: #ffffff;
}

.human-chat-row.outbound .human-bubble {
  border-color: #ddddd6;
  background: #f7f7f4;
}

.human-chat-row.is-unread .human-bubble {
  border-color: #c9c7bd;
}

.human-bubble-meta {
  margin-bottom: 5px;
  font-size: 11px;
}

.human-bubble-meta em,
.human-title-line em {
  padding: 1px 6px;
  border-radius: 999px;
  background: #f1eee7;
  color: #7a5a25;
  font-size: 10px;
  font-weight: 680;
}

.human-bubble p {
  color: var(--human-ink);
  font-size: 14px;
  line-height: 1.5;
}

.human-message-actions {
  flex-direction: row;
  justify-content: flex-end;
  gap: 8px;
  width: 100%;
  opacity: 0.72;
}

.human-button,
.human-tab {
  min-height: 34px;
  padding: 0 10px;
  border-color: #d8d7d1;
  border-radius: 6px;
  background: #ffffff;
  color: var(--human-ink);
  font-size: 13px;
  font-weight: 620;
}

.human-button:hover,
.human-tab:hover {
  border-color: #bebcb4;
  background: #fafaf8;
}

.human-button.primary {
  border-color: var(--human-ink);
  background: var(--human-ink);
  color: #ffffff;
}

.human-button.primary:hover {
  border-color: #111110;
  background: #111110;
}

.human-button.small,
.human-tab {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.human-button.subtle {
  min-height: 26px;
  padding: 0 4px;
  color: var(--human-muted);
  font-size: 11px;
}

.human-button.subtle:hover {
  color: var(--human-ink);
}

.human-tab.is-active {
  border-color: var(--human-line);
  background: #efefeb;
  color: var(--human-ink);
}

.human-composer.chat {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 10px;
  padding: 12px 18px;
  border-top: 1px solid var(--human-line);
  background: #ffffff;
}

.human-composer.chat textarea {
  min-height: 42px;
  max-height: 120px;
  border-color: #d8d7d1;
  border-radius: 6px;
  background: #ffffff;
}

.human-composer.chat textarea:focus {
  outline: 2px solid #ecebe6;
  border-color: #aaa89f;
}

.human-composer.chat .human-button[type="submit"] {
  min-height: 42px;
  min-width: 76px;
}

.human-attachment {
  border-color: var(--human-line);
  background: #fbfbfa;
}

.human-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #e7e7e2;
  color: #5e5d58;
  font-size: 12px;
  font-weight: 720;
  text-shadow: none;
}

.human-avatar.small {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 9px;
}

.human-avatar.large {
  width: 38px;
  height: 38px;
}

.human-avatar.tone-1,
.human-avatar.tone-2,
.human-avatar.tone-3,
.human-avatar.tone-4,
.human-avatar.tone-5,
.human-avatar.tone-6 {
  background: #e7e7e2;
}

.human-directory {
  display: grid;
  grid-template-columns: 1fr;
  background: transparent;
}

.human-agent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-height: 78px;
  padding: 16px 0;
  border-bottom: 1px solid var(--human-line);
  background: transparent;
}

.human-agent:last-child {
  border-bottom: 0;
}

.human-agent > .human-avatar {
  width: 48px;
  height: 48px;
  font-size: 13px;
}

.human-agent > div {
  min-width: 0;
}

.human-agent .human-title-line {
  display: grid;
  gap: 2px;
}

.human-agent .human-title-line strong {
  font-size: 15px;
  font-weight: 720;
  line-height: 1.25;
}

.human-agent .human-title-line span {
  font-size: 13px;
}

.human-agent p {
  max-width: 780px;
  margin-top: 8px;
  color: var(--human-ink);
  font-size: 14px;
  line-height: 1.45;
}

.human-agent .human-button,
.human-agent .human-badge {
  align-self: start;
  margin-top: 2px;
}

.human-error,
.human-notice {
  border-radius: 6px;
  font-size: 12px;
  font-weight: 620;
}

.human-notice {
  border-color: var(--human-line);
  background: #fbfbfa;
  color: var(--human-ink);
}

@media (max-width: 760px) {
  .human-shell {
    grid-template-columns: 1fr;
  }

  .human-brand-head,
  .human-section-header {
    min-height: auto;
  }

  .human-board {
    padding: 12px;
  }

  .human-board.is-chat {
    height: calc(100vh - 118px);
  }

  .human-chat-scroll {
    padding: 16px 12px;
  }

  .human-chat-row {
    width: 100%;
  }

  .human-message-actions {
    opacity: 1;
  }
}

.human-section-header {
  min-height: 58px;
  padding: 10px 24px;
  align-items: center;
}

.human-section-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 720;
  line-height: 1.2;
}

.human-section-header p,
.human-section-kicker {
  display: none;
}

@media (max-width: 760px) {
  .human-section-header {
    min-height: 54px;
    padding: 10px 14px;
  }
}

/* Human View: animal-island-ui inspired theme */
.human-login,
.human-shell {
  --human-bg: #f8f8f0;
  --human-ink: #725d42;
  --human-muted: #9f927d;
  --human-line: #c4b89e;
  --human-line-soft: #e8e2d6;
  --human-panel: rgb(247, 243, 223);
  --human-sidebar: #f3ecd9;
  --human-sidebar-deep: #f8f8f0;
  --human-sidebar-soft: #e9e0c9;
  --human-sidebar-text: #725d42;
  --human-accent: #19c8b9;
  --human-accent-hover: #3dd4c6;
  --human-accent-active: #11a89b;
  --human-accent-soft: #e6f9f6;
  --human-press-shadow: #bdaea0;
  --human-input-shadow: #d4c9b4;
  --human-focus: #ffcc00;
  --human-radius-sm: 12px;
  --human-radius: 18px;
  --human-radius-lg: 24px;
  font-family: Nunito, "Noto Sans SC", "Zen Maru Gothic", -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--human-ink);
}

.human-shell,
.human-login,
.human-main,
.human-board,
.human-board.is-chat {
  background: var(--human-bg);
}

.human-sidebar {
  background: var(--human-sidebar);
  border-right: 2px solid var(--human-line-soft);
}

.human-brand-head {
  background: var(--human-sidebar-deep);
  border-bottom: 2px solid var(--human-line-soft);
}

.human-brand-name {
  color: var(--human-ink);
  font-weight: 800;
}

.human-brand-head span,
.human-sidebar-title,
.human-section-kicker,
.human-composer-label {
  color: #a0936e;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.human-nav-item,
.human-sidebar-person {
  border-radius: var(--human-radius-sm);
  color: var(--human-sidebar-text);
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.human-nav-item:hover,
.human-sidebar-person:hover {
  background: #d6dff0;
  transform: translateY(-1px);
}

.human-nav-item.is-active,
.human-sidebar-person.is-active {
  background: #b7c6e5;
  color: #ffffff;
  box-shadow: none;
}

.human-nav-item.is-active .human-nav-count,
.human-sidebar-person.is-active .human-sidebar-unread {
  background: rgba(255, 255, 255, 0.78);
  color: var(--human-ink);
}

.human-nav-count,
.human-sidebar-unread,
.human-panel-head > span,
.human-badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--human-panel);
  color: var(--human-ink);
  font-weight: 800;
  line-height: 24px;
}

.human-section-header {
  min-height: 60px;
  padding: 10px 24px;
  border-bottom: 2px solid var(--human-line-soft);
  background: #fffdf4;
}

.human-section-header h1 {
  color: var(--human-ink);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.human-alerts {
  background: #fffdf4;
}

.human-panel,
.human-home-hero,
.human-home-section,
.human-login-card {
  border: 2px solid var(--human-line-soft);
  border-radius: 20px;
  background: var(--human-panel);
  color: var(--human-ink);
  box-shadow: 0 4px 10px rgba(107, 92, 67, 0.12);
}

.human-content-list {
  border-radius: 20px;
}

.human-panel-head {
  border-bottom: 2px solid var(--human-line-soft);
}

.human-panel-head h2,
.human-home-agent h2,
.human-thread-head h3,
.human-agent .human-title-line strong,
.human-title-line strong {
  color: var(--human-ink);
  font-weight: 800;
}

.human-metrics div {
  border: 2px solid var(--human-line-soft);
  border-radius: 18px;
  background: #fffdf4;
}

.human-metrics dt,
.human-metrics dd,
.human-home-description,
.human-home-agent p,
.human-home-feed-item small,
.human-sidebar-person-main small,
.human-sidebar-person-meta small,
.human-thread-head p,
.human-bubble-meta {
  color: var(--human-muted);
}

.human-home-feed-item,
.human-item,
.human-agent {
  border-bottom: 2px solid var(--human-line-soft);
}

.human-agent {
  padding: 18px 0;
}

.human-agent p,
.human-bubble p,
.human-item p {
  color: var(--human-ink);
}

.human-thread {
  background: #fffdf4;
}

.human-thread-head {
  border-bottom: 2px solid var(--human-line-soft);
  background: #fffdf4;
}

.human-chat-scroll {
  background: #fffdf4;
}

.human-date-divider {
  color: #a0936e;
  font-weight: 800;
}

.human-date-divider::before,
.human-date-divider::after {
  background: var(--human-line-soft);
}

.human-date-divider span {
  background: #fffdf4;
}

.human-bubble {
  border: 2px solid var(--human-line);
  border-radius: 20px;
  background: var(--human-panel);
  color: var(--human-ink);
}

.human-chat-row.outbound .human-bubble {
  border-color: #9f927d;
  background: #e6f9f6;
}

.human-chat-row.is-unread .human-bubble {
  border-color: var(--human-accent);
}

.human-bubble-meta em,
.human-title-line em {
  border-radius: 999px;
  background: #f7cd67;
  color: var(--human-ink);
  font-weight: 800;
}

.human-button,
.human-tab {
  min-height: 40px;
  padding: 0 18px;
  border: 2px solid var(--human-line);
  border-radius: 50px;
  background: #f8f8f0;
  color: var(--human-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 0 0 var(--human-press-shadow);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.human-button:hover,
.human-tab:hover {
  border-color: var(--human-accent);
  color: var(--human-accent-active);
  background: #f8f8f0;
  box-shadow: 0 5px 0 0 var(--human-press-shadow);
  transform: translateY(-1px);
}

.human-button:active,
.human-tab:active {
  box-shadow: 0 1px 0 0 var(--human-press-shadow);
  transform: translateY(2px);
}

.human-button.primary {
  border-color: #f8f8f0;
  background: #f8f8f0;
  color: var(--human-ink);
  box-shadow: 0 5px 0 0 var(--human-press-shadow);
}

.human-button.primary:hover {
  border-color: #f8f8f0;
  background: #f8f8f0;
  color: var(--human-ink);
  box-shadow: 0 6px 0 0 var(--human-press-shadow);
}

.human-button.ghost,
.human-button.subtle {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: var(--human-ink);
}

.human-button.ghost:hover,
.human-button.subtle:hover {
  border-color: transparent;
  background: rgba(25, 200, 185, 0.08);
  color: var(--human-accent-active);
  box-shadow: none;
}

.human-button.small,
.human-tab {
  min-height: 32px;
  padding: 0 16px;
  border-radius: 16px;
  font-size: 12px;
}

.human-tab.is-active {
  border-color: var(--human-accent-active);
  background: var(--human-accent);
  color: #fff9e3;
  box-shadow: 0 3px 0 0 rgba(61, 52, 40, 0.16);
}

.human-form input,
.human-composer select,
.human-composer textarea {
  border: 2.5px solid var(--human-line);
  border-radius: 28px;
  background: var(--human-panel);
  color: var(--human-ink);
  box-shadow: 0 3px 0 0 var(--human-input-shadow);
  font-weight: 600;
}

.human-composer.chat textarea {
  border-radius: 24px;
  background: var(--human-panel);
}

.human-form input:focus,
.human-composer select:focus,
.human-composer textarea:focus,
.human-composer.chat textarea:focus {
  outline: 3px solid rgba(255, 204, 0, 0.15);
  border-color: var(--human-focus);
  box-shadow: 0 3px 0 0 #e0b800;
}

.human-composer.chat {
  border-top: 2px solid var(--human-line-soft);
  background: #fffdf4;
}

.human-attachment {
  border: 2px dashed var(--human-line);
  border-radius: 18px;
  background: #fffdf4;
}

.human-avatar,
.human-avatar.tone-1,
.human-avatar.tone-2,
.human-avatar.tone-3,
.human-avatar.tone-4,
.human-avatar.tone-5,
.human-avatar.tone-6 {
  background: #f0e8d8;
  color: var(--human-ink);
  border: 2px solid #d4c9b4;
  border-radius: 999px;
  font-weight: 800;
}

.human-preview {
  border: 2px solid var(--human-line);
  border-radius: 24px;
  background: var(--human-panel);
  color: var(--human-ink);
}

.human-preview header,
.human-preview footer {
  border-color: var(--human-line-soft);
}

.human-preview-body,
.human-preview-text {
  background: #fffdf4;
  color: var(--human-ink);
}

.human-error {
  border: 2px solid #e05a5a;
  background: #fff4f0;
  color: #c94444;
}

.human-notice {
  border: 2px solid var(--human-line-soft);
  background: var(--human-panel);
  color: var(--human-ink);
}

@media (max-width: 760px) {
  .human-section-header {
    min-height: 58px;
    padding: 10px 14px;
  }

  .human-agent {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .human-agent .human-button,
  .human-agent .human-badge {
    grid-column: 2;
    justify-self: start;
  }
}

/* Human View: chat breathing room */
.human-chat-scroll {
  padding-right: max(clamp(56px, 6vw, 160px), calc((100% - 1440px) / 2));
  padding-left: max(clamp(56px, 6vw, 160px), calc((100% - 1440px) / 2));
}

.human-composer.chat {
  gap: 8px 16px;
  padding: 14px max(clamp(56px, 6vw, 160px), calc((100% - 1440px) / 2)) 18px;
}

.human-composer.chat {
  display: block;
}

.human-composer.chat .human-composer-label {
  margin-bottom: 10px;
}

.human-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  align-items: stretch;
  gap: 8px;
  padding: 6px;
  border: 2.5px solid var(--human-line);
  border-radius: 30px;
  background: var(--human-panel);
  box-shadow: 0 3px 0 0 var(--human-input-shadow);
}

.human-composer.chat .human-composer-body {
  display: block;
  min-width: 0;
}

.human-composer.chat textarea {
  width: 100%;
  min-height: 52px;
  height: 52px;
  max-height: 52px;
  padding: 13px 16px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  box-shadow: none;
  line-height: 1.45;
  resize: none;
}

.human-composer.chat textarea:focus {
  outline: 0;
  border-color: transparent;
  box-shadow: none;
}

.human-composer.chat:focus-within .human-composer-row {
  border-color: var(--human-focus);
  box-shadow: 0 3px 0 0 #e0b800;
}

.human-composer.chat .human-button[type="submit"] {
  grid-area: auto;
  align-self: stretch;
  min-width: 0;
  min-height: 52px;
  height: 52px;
  margin: 0;
  border-radius: 24px;
  box-shadow: none;
}

@media (max-width: 760px) {
  .human-chat-scroll {
    padding-right: 16px;
    padding-left: 16px;
  }

  .human-composer.chat {
    gap: 8px;
    padding: 12px 14px 14px;
  }

  .human-composer-row {
    grid-template-columns: minmax(0, 1fr) 84px;
  }
}

/* Human View: icon-led softer surfaces */
.human-ui-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 12px;
  color: #fffdf4;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 4px 0 rgba(114, 93, 66, 0.14);
}

.human-ui-icon.small {
  width: 22px;
  height: 22px;
  border-radius: 9px;
  font-size: 11px;
  box-shadow: 0 3px 0 rgba(114, 93, 66, 0.12);
}

.human-ui-icon.large {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  font-size: 15px;
}

.human-ui-icon.tone-sky {
  background: #7fa7ff;
}

.human-ui-icon.tone-sun {
  background: #ffd166;
  color: #725d42;
}

.human-ui-icon.tone-mint {
  background: #19c8b9;
}

.human-ui-icon.tone-coral {
  background: #ff7a6b;
}

.human-ui-icon.tone-leaf {
  background: #8ad77f;
  color: #3f6540;
}

.human-ui-icon.tone-plum {
  background: #b58cff;
}

.human-section-title,
.human-nav-label,
.human-sidebar-title,
.human-panel-head h2,
.human-home-actions .human-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.human-nav-label > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.human-shell,
.human-main,
.human-board,
.human-board.is-chat,
.human-thread,
.human-chat-scroll {
  background: var(--human-bg);
}

.human-sidebar {
  border-right: 0;
  background: linear-gradient(180deg, #f3ecd9 0%, #f7f1df 100%);
}

.human-brand-head,
.human-section-header,
.human-panel-head,
.human-thread-head,
.human-composer.chat {
  border: 0;
}

.human-section-header {
  background: rgba(255, 253, 244, 0.7);
}

.human-alerts {
  background: transparent;
}

.human-nav {
  gap: 7px;
  padding: 8px 14px 10px;
}

.human-nav-item,
.human-sidebar-person {
  border-radius: 18px;
}

.human-nav-item {
  min-height: 44px;
  padding: 0 12px 0 10px;
}

.human-nav-item:hover,
.human-sidebar-person:hover {
  background: rgba(255, 253, 244, 0.68);
  transform: none;
}

.human-nav-item.is-active,
.human-sidebar-person.is-active {
  background: #fffdf4;
  color: var(--human-ink);
  box-shadow: 0 10px 22px rgba(114, 93, 66, 0.08);
}

.human-sidebar-person {
  min-height: 62px;
  padding: 9px 10px;
}

.human-panel,
.human-home-hero,
.human-home-section,
.human-thread-panel,
.human-board.is-chat .human-thread-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.human-content-list,
.human-directory,
.human-list,
.human-home-feed {
  background: transparent;
}

.human-directory,
.human-list,
.human-home-feed {
  gap: 8px;
}

.human-agent,
.human-item,
.human-home-feed-item {
  border-bottom: 0;
  border-radius: 20px;
  background: transparent;
}

.human-agent {
  padding: 15px 18px;
}

.human-item,
.human-home-feed-item {
  padding: 13px 16px;
}

.human-agent:hover,
.human-item:hover,
.human-home-feed-item:hover {
  background: rgba(255, 253, 244, 0.72);
}

.human-metrics {
  gap: 12px;
}

.human-metrics div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  column-gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 24px;
  background: rgba(255, 253, 244, 0.72);
  box-shadow: none;
}

.human-metrics .human-ui-icon {
  grid-area: icon;
}

.human-metrics dt {
  grid-area: label;
}

.human-metrics dd {
  grid-area: value;
}

.human-date-divider {
  justify-content: center;
}

.human-date-divider::before,
.human-date-divider::after {
  display: none;
}

.human-date-divider span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 253, 244, 0.82);
}

.human-bubble {
  border: 0;
  border-radius: 24px;
  background: rgba(255, 253, 244, 0.9);
  box-shadow: 0 12px 28px rgba(114, 93, 66, 0.08);
}

.human-chat-row.outbound .human-bubble {
  border: 0;
  background: #e5faf5;
}

.human-chat-row.is-unread .human-bubble {
  border: 0;
  box-shadow:
    inset 0 0 0 2px var(--human-accent),
    0 12px 28px rgba(114, 93, 66, 0.08);
}

.human-button,
.human-tab {
  border: 0;
  box-shadow: 0 4px 0 rgba(114, 93, 66, 0.16);
}

.human-tab.is-active,
.human-button.primary,
.human-button.primary:hover {
  border: 0;
}

.human-button.ghost,
.human-button.subtle {
  box-shadow: none;
}

.human-composer.chat {
  background: linear-gradient(180deg, rgba(248, 248, 240, 0), var(--human-bg) 28%);
}

.human-composer-row {
  border: 0;
  background: rgba(255, 253, 244, 0.9);
  box-shadow: 0 10px 24px rgba(114, 93, 66, 0.1);
}

.human-composer.chat:focus-within .human-composer-row {
  box-shadow:
    inset 0 0 0 2px var(--human-focus),
    0 10px 24px rgba(114, 93, 66, 0.1);
}

/* Human View: harmony pass and composer reset */
.human-ui-icon {
  color: #fffdf4;
  box-shadow: none;
}

.human-ui-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.human-ui-icon.small svg {
  width: 13px;
  height: 13px;
}

.human-ui-icon.large svg {
  width: 18px;
  height: 18px;
}

.human-ui-icon.tone-sun,
.human-ui-icon.tone-leaf {
  color: #6f5a3e;
}

.human-section-header {
  min-height: 68px;
  padding: 14px 26px;
  background: rgba(255, 253, 244, 0.5);
}

.human-section-title {
  gap: 12px;
}

.human-section-header h1 {
  font-size: 24px;
}

.human-nav-item.is-active,
.human-sidebar-person.is-active {
  box-shadow: none;
}

.human-button,
.human-tab {
  box-shadow: 0 2px 0 rgba(114, 93, 66, 0.14);
}

.human-button:hover,
.human-tab:hover {
  box-shadow: 0 2px 0 rgba(114, 93, 66, 0.14);
}

.human-button.primary,
.human-button.primary:hover {
  box-shadow: 0 2px 0 rgba(114, 93, 66, 0.14);
}

.human-bubble {
  border-radius: 20px;
  box-shadow: 0 8px 18px rgba(114, 93, 66, 0.06);
}

.human-chat-row.is-unread .human-bubble {
  box-shadow:
    inset 0 0 0 1.5px rgba(25, 200, 185, 0.72),
    0 8px 18px rgba(114, 93, 66, 0.06);
}

.human-message-actions {
  padding-right: 10px;
}

.human-composer.chat {
  display: block !important;
  padding-top: 12px;
  padding-bottom: 18px;
  background: linear-gradient(180deg, rgba(248, 248, 240, 0), var(--human-bg) 34%);
}

.human-composer.chat .human-composer-label {
  margin-bottom: 8px;
  padding-left: 8px;
}

.human-composer-row {
  display: flex !important;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  padding: 6px;
  border-radius: 32px;
  background: rgba(255, 253, 244, 0.94);
  box-shadow: 0 8px 18px rgba(114, 93, 66, 0.08);
}

.human-composer.chat .human-composer-body {
  grid-area: auto !important;
  flex: 1 1 auto;
  display: flex !important;
  align-items: center;
  min-width: 0;
  height: 52px;
}

.human-composer.chat .human-composer-body > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.human-composer.chat textarea {
  display: block;
  width: 100%;
  min-height: 52px !important;
  height: 52px !important;
  max-height: 52px !important;
  padding: 14px 16px;
  border: 0 !important;
  border-radius: 26px;
  background: transparent !important;
  box-shadow: none !important;
  overflow-y: hidden;
  resize: none;
}

.human-composer.chat .human-button[type="submit"] {
  grid-area: auto !important;
  flex: 0 0 96px;
  width: 96px;
  min-width: 96px;
  min-height: 52px !important;
  height: 52px !important;
  margin: 0;
  border-radius: 26px;
  background: var(--human-accent);
  color: #fffdf4;
  box-shadow: none;
}

.human-composer.chat .human-button[type="submit"]:hover {
  background: var(--human-accent-hover);
  color: #fffdf4;
  box-shadow: none;
}

.human-composer.chat:focus-within .human-composer-row {
  box-shadow:
    inset 0 0 0 2px rgba(255, 204, 0, 0.72),
    0 8px 18px rgba(114, 93, 66, 0.08);
}

@media (max-width: 760px) {
  .human-section-header {
    min-height: 60px;
    padding: 12px 14px;
  }

  .human-composer-row {
    min-height: 58px;
  }

  .human-composer.chat .human-composer-body,
  .human-composer.chat textarea {
    min-height: 46px !important;
    height: 46px !important;
    max-height: 46px !important;
  }

  .human-composer.chat .human-button[type="submit"] {
    flex-basis: 76px;
    width: 76px;
    min-width: 76px;
    min-height: 46px !important;
    height: 46px !important;
  }
}

.human-brand-head {
  background: transparent;
}

.human-refresh-button {
  gap: 8px;
}

.human-inline-images {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.human-inline-image {
  display: block;
  width: min(100%, 420px);
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 253, 244, 0.86);
  box-shadow: 0 6px 16px rgba(114, 93, 66, 0.08);
}

.human-inline-image img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  background: rgba(255, 253, 244, 0.86);
}

.human-chat-row.outbound .human-inline-image {
  margin-left: auto;
}

.human-alerts {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.human-alerts:empty {
  display: none;
}

.human-alerts .human-error,
.human-alerts .human-notice {
  margin: 0;
  border: 0;
  border-radius: 18px;
  box-shadow: 0 12px 30px rgba(114, 93, 66, 0.16);
  pointer-events: auto;
}

.human-alerts .human-notice {
  background: #e5faf5;
  color: var(--human-accent-active);
}

.human-alerts .human-error {
  background: #fff0eb;
  color: #a94331;
}

@media (max-width: 760px) {
  .human-inline-image {
    width: 100%;
  }

  .human-alerts {
    top: 12px;
    right: 14px;
    left: 14px;
    width: auto;
  }
}

/* Human View: interactive Agent world */
.human-board.is-world {
  overflow: auto;
  padding: 18px clamp(16px, 3vw, 34px) 34px;
  background:
    radial-gradient(circle at 82% 8%, rgba(25, 200, 185, 0.08), transparent 30%),
    radial-gradient(circle at 12% 88%, rgba(255, 209, 102, 0.18), transparent 28%),
    var(--human-bg);
}

.human-world {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(300px, 360px);
  gap: 20px;
  width: min(1500px, 100%);
  margin: 0 auto;
}

.human-world-stage,
.human-world-panel {
  min-width: 0;
}

.human-world-stage {
  display: grid;
  gap: 12px;
}

.human-world-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.human-world-summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: rgba(255, 253, 244, 0.78);
  color: var(--human-muted);
  font-size: 12px;
  font-weight: 800;
}

.human-world-summary strong {
  color: var(--human-ink);
  font-size: 15px;
}

.human-world-map {
  position: relative;
  min-height: 590px;
  height: min(720px, calc(100vh - 160px));
  overflow: hidden;
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 241, 148, 0.7) 0 8%, transparent 9%),
    radial-gradient(circle at 78% 22%, rgba(182, 224, 128, 0.8) 0 9%, transparent 10%),
    radial-gradient(circle at 62% 84%, rgba(255, 218, 132, 0.55) 0 8%, transparent 9%),
    linear-gradient(rgba(255, 253, 244, 0.24) 2px, transparent 2px) 0 0 / 54px 54px,
    linear-gradient(90deg, rgba(255, 253, 244, 0.24) 2px, transparent 2px) 0 0 / 54px 54px,
    #cfeea7;
  box-shadow:
    inset 0 0 0 8px rgba(255, 253, 244, 0.58),
    0 20px 50px rgba(114, 93, 66, 0.12);
}

.human-world-water {
  position: absolute;
  left: -12%;
  bottom: -14%;
  width: 58%;
  height: 34%;
  border-radius: 52% 48% 0 0;
  background:
    repeating-linear-gradient(-12deg, rgba(255, 253, 244, 0.2) 0 8px, transparent 8px 20px),
    #a7d8f4;
}

.human-world-path {
  position: absolute;
  z-index: 1;
  border-radius: 999px;
  background: #f6df94;
  box-shadow: inset 0 0 0 5px rgba(255, 253, 244, 0.35);
}

.human-world-path.path-main {
  left: 8%;
  top: 48%;
  width: 84%;
  height: 44px;
  transform: rotate(-4deg);
}

.human-world-path.path-cross {
  left: 45%;
  top: 10%;
  width: 44px;
  height: 74%;
  transform: rotate(8deg);
}

.human-world-place {
  position: absolute;
  z-index: 2;
  display: grid;
  gap: 2px;
  min-width: 116px;
  padding: 12px 14px;
  border-radius: 24px;
  background: rgba(255, 253, 244, 0.82);
  color: var(--human-ink);
  box-shadow: 0 10px 24px rgba(114, 93, 66, 0.1);
}

.human-world-place strong {
  font-size: 13px;
  line-height: 1.1;
}

.human-world-place span {
  color: var(--human-muted);
  font-size: 11px;
  font-weight: 700;
}

.place-hub {
  left: 42%;
  top: 37%;
}

.place-mail {
  left: 14%;
  top: 16%;
}

.place-market {
  right: 11%;
  top: 18%;
}

.place-archive {
  right: 16%;
  bottom: 14%;
}

.human-world-tree,
.human-world-flower {
  position: absolute;
  z-index: 1;
  display: block;
  border-radius: 999px;
}

.human-world-tree {
  width: 34px;
  height: 34px;
  background: #80c978;
  box-shadow: inset -7px -6px 0 rgba(68, 125, 72, 0.18), 0 16px 0 -10px #896f45;
}

.tree-1 {
  left: 9%;
  top: 35%;
}

.tree-2 {
  left: 24%;
  top: 14%;
}

.tree-3 {
  right: 8%;
  top: 42%;
}

.tree-4 {
  right: 28%;
  bottom: 12%;
}

.tree-5 {
  left: 13%;
  bottom: 20%;
}

.human-world-flower {
  width: 14px;
  height: 14px;
  background: #ff7a6b;
  box-shadow: 18px 10px 0 #ffd166, -14px 16px 0 #b58cff, 8px -14px 0 #fffdf4;
}

.flower-1 {
  left: 34%;
  top: 28%;
}

.flower-2 {
  right: 28%;
  top: 62%;
}

.flower-3 {
  left: 21%;
  bottom: 12%;
}

.human-world-agent {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 5;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--human-ink);
  font: inherit;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.human-world-agent:hover {
  z-index: 8;
}

.human-avatar.world {
  width: 42px;
  height: 42px;
  background: #f0e8d8;
  border: 3px solid rgba(255, 253, 244, 0.92);
  box-shadow: 0 8px 14px rgba(114, 93, 66, 0.18);
}

.human-world-agent-label {
  display: grid;
  justify-items: center;
  max-width: 132px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 253, 244, 0.84);
  box-shadow: 0 8px 18px rgba(114, 93, 66, 0.1);
}

.human-world-agent-label strong,
.human-world-agent-label small {
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-world-agent-label strong {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.human-world-agent-label small {
  display: none;
  color: var(--human-muted);
  font-size: 10px;
  font-weight: 800;
}

.human-world-agent:hover .human-world-agent-label small,
.human-world-agent.is-selected .human-world-agent-label small {
  display: block;
}

.human-world-agent.is-selected .human-avatar.world {
  box-shadow:
    0 0 0 4px rgba(25, 200, 185, 0.5),
    0 12px 22px rgba(114, 93, 66, 0.22);
}

.human-world-agent.has-unread .human-avatar.world {
  box-shadow:
    0 0 0 4px rgba(255, 122, 107, 0.36),
    0 10px 18px rgba(114, 93, 66, 0.2);
}

.human-world-agent em {
  position: absolute;
  top: -8px;
  left: calc(50% + 12px);
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ff7a6b;
  color: #fffdf4;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.human-world-panel {
  position: sticky;
  top: 16px;
  display: grid;
  align-content: start;
  gap: 14px;
  height: fit-content;
}

.human-world-card {
  min-width: 0;
  padding: 18px;
  border-radius: 28px;
  background: rgba(255, 253, 244, 0.82);
  box-shadow: 0 16px 38px rgba(114, 93, 66, 0.1);
}

.human-world-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.human-world-card-head div {
  min-width: 0;
}

.human-world-card h2 {
  margin: 0;
  color: var(--human-ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.human-world-card-head p,
.human-world-description,
.human-world-empty {
  color: var(--human-muted);
}

.human-world-card-head p {
  margin: 3px 0 0;
  font-size: 13px;
}

.human-world-description {
  margin: 14px 0 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.human-world-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 0;
}

.human-world-stats div {
  min-width: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(248, 248, 240, 0.78);
}

.human-world-stats dt {
  color: var(--human-muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.human-world-stats dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--human-ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-world-latest {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 20px;
  background: rgba(25, 200, 185, 0.1);
  color: var(--human-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.human-world-latest span,
.human-world-latest small {
  color: var(--human-muted);
  font-size: 11px;
  font-weight: 800;
}

.human-world-latest strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-world-empty {
  margin: 14px 0 0;
}

.human-world-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.human-world-feed {
  padding: 10px;
}

.human-world-feed .human-panel-head {
  min-height: 42px;
  padding: 6px 8px 10px;
}

.human-world-feed-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 8px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: var(--human-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.human-world-feed-item:hover {
  background: rgba(248, 248, 240, 0.78);
}

.human-world-feed-item span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.human-world-feed-item strong,
.human-world-feed-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.human-world-feed-item strong {
  font-size: 13px;
}

.human-world-feed-item small,
.human-world-feed-item em {
  color: var(--human-muted);
  font-size: 11px;
}

.human-world-feed-item em {
  font-style: normal;
  font-weight: 800;
}

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

  .human-world-panel {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .human-board.is-world {
    padding: 14px;
  }

  .human-world-panel {
    grid-template-columns: 1fr;
  }

  .human-world-map {
    min-height: 520px;
    height: 70vh;
    border-radius: 26px;
  }

  .human-world-agent {
    min-width: 78px;
  }

  .human-world-agent-label {
    max-width: 94px;
    padding: 4px 7px;
  }

  .human-world-agent-label strong,
  .human-world-agent-label small {
    max-width: 78px;
  }

  .human-world-stats {
    grid-template-columns: 1fr;
  }
}

/* Human View: immersive world mode */
.human-shell.is-world-mode {
  grid-template-columns: 1fr;
  overflow: hidden;
}

.human-shell.is-world-mode .human-main {
  height: 100vh;
  overflow: hidden;
  background: #cfeea7;
}

.human-shell.is-world-mode .human-board.is-world {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: #cfeea7;
}

.human-shell.is-world-mode .human-world {
  position: relative;
  display: block;
  width: 100%;
  height: 100vh;
  margin: 0;
  overflow: hidden;
}

.human-shell.is-world-mode .human-world-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
}

.human-world-back,
.human-shell.is-world-mode .human-world-summary,
.human-shell.is-world-mode .human-world-panel {
  position: absolute;
  z-index: 20;
}

.human-world-back {
  top: 22px;
  left: 22px;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 10px;
  border-radius: 999px;
  background: rgba(255, 253, 244, 0.9);
  box-shadow: 0 12px 30px rgba(114, 93, 66, 0.12);
}

.human-shell.is-world-mode .human-world-summary {
  top: 22px;
  right: 22px;
  justify-content: flex-end;
  max-width: min(720px, calc(100vw - 190px));
}

.human-shell.is-world-mode .human-world-summary span,
.human-shell.is-world-mode .human-world-card {
  background: rgba(255, 253, 244, 0.82);
  backdrop-filter: blur(16px);
}

.human-shell.is-world-mode .human-world-panel {
  top: 94px;
  right: 22px;
  width: min(380px, calc(100vw - 44px));
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.human-shell.is-world-mode .human-world-card {
  box-shadow: 0 20px 52px rgba(114, 93, 66, 0.14);
}

.human-shell.is-world-mode .human-alerts {
  top: 22px;
  right: 50%;
  transform: translateX(50%);
  width: min(520px, calc(100vw - 240px));
}

.human-shell.is-world-mode .human-world-agent {
  z-index: 8;
}

.human-shell.is-world-mode .human-world-place {
  z-index: 5;
}

@media (max-width: 1040px) {
  .human-shell.is-world-mode .human-world-summary {
    top: auto;
    right: 16px;
    bottom: 16px;
    max-width: calc(100vw - 32px);
  }

  .human-shell.is-world-mode .human-world-panel {
    top: 82px;
    right: 16px;
    width: min(340px, calc(100vw - 32px));
    max-height: calc(100vh - 170px);
  }

  .human-shell.is-world-mode .human-alerts {
    right: 16px;
    left: 16px;
    width: auto;
    transform: none;
  }
}

@media (max-width: 760px) {
  .human-world-back {
    top: 14px;
    left: 14px;
    min-height: 40px;
  }

  .human-shell.is-world-mode .human-world-panel {
    top: auto;
    right: 12px;
    bottom: 82px;
    left: 12px;
    width: auto;
    max-height: 42vh;
  }

  .human-shell.is-world-mode .human-world-summary {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: center;
  }

  .human-shell.is-world-mode .human-world-summary span {
    min-height: 34px;
    font-size: 11px;
  }

  .human-shell.is-world-mode .human-world-map {
    min-height: 0;
    height: 100%;
  }
}

/* Human View: Smallville-style pixel world */
.human-world-map {
  background: #8cff67;
  cursor: crosshair;
}

.human-world-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, calc(100vh * 1.4));
  height: max(100%, calc(100vw / 1.4));
  transform: translate(-50%, -50%);
  background:
    linear-gradient(rgba(33, 31, 27, 0.02), rgba(33, 31, 27, 0.02)),
    url("/world-assets/smallville-map.png") center / cover no-repeat,
    #8cff67;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.human-world-map-tone {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 0 48%, rgba(30, 34, 20, 0.12) 100%),
    linear-gradient(180deg, rgba(255, 253, 244, 0.04), rgba(24, 40, 22, 0.04));
}

.human-world-pixel-sign {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 1px;
  min-width: 86px;
  padding: 7px 9px 8px;
  border: 3px solid #6f6143;
  border-radius: 3px;
  background: #fff8d9;
  color: #4f432d;
  box-shadow:
    0 4px 0 #4c3f2e,
    0 10px 0 rgba(34, 28, 20, 0.18);
  image-rendering: pixelated;
}

.human-world-pixel-sign strong {
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.human-world-pixel-sign span {
  color: #7b7056;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.1;
}

.sign-inbox {
  left: 18%;
  top: 31%;
}

.sign-directory {
  right: 14%;
  top: 30%;
}

.sign-hub {
  left: 48%;
  top: 42%;
}

.sign-archive {
  right: 20%;
  bottom: 18%;
}

.human-world-character {
  position: relative;
  display: block;
  width: 42px;
  height: 54px;
  filter: drop-shadow(0 5px 1px rgba(35, 31, 25, 0.28));
}

.human-world-character::after {
  position: absolute;
  right: 8px;
  bottom: 2px;
  left: 8px;
  height: 7px;
  border-radius: 999px;
  background: rgba(25, 23, 18, 0.28);
  content: "";
}

.human-world-sprite {
  --sprite-row: 0px;
  --sprite-frame: -32px;
  position: absolute;
  left: 50%;
  bottom: 4px;
  z-index: 1;
  display: block;
  width: 32px;
  height: 32px;
  background-image: var(--sprite);
  background-position: var(--sprite-frame) var(--sprite-row);
  background-repeat: no-repeat;
  background-size: 96px 128px;
  image-rendering: pixelated;
  transform: translateX(-50%) scale(1.65);
  transform-origin: 50% 100%;
}

.human-world-agent.facing-down .human-world-sprite {
  --sprite-row: 0px;
}

.human-world-agent.facing-left .human-world-sprite {
  --sprite-row: -32px;
}

.human-world-agent.facing-right .human-world-sprite {
  --sprite-row: -64px;
}

.human-world-agent.facing-up .human-world-sprite {
  --sprite-row: -96px;
}

.human-world-agent.is-walking .human-world-sprite {
  animation: human-world-walk 420ms steps(3) infinite;
}

@keyframes human-world-walk {
  from {
    background-position-x: 0;
  }

  to {
    background-position-x: -96px;
  }
}

.human-world-agent {
  z-index: 8;
  gap: 4px;
  min-width: 78px;
  outline: 0;
  cursor: pointer;
  will-change: left, top;
}

.human-world-agent:hover,
.human-world-agent.is-selected {
  z-index: 14;
}

.human-world-agent.is-selected .human-world-character {
  filter:
    drop-shadow(0 0 0 #ffffff)
    drop-shadow(0 0 5px rgba(255, 255, 255, 0.95))
    drop-shadow(0 8px 1px rgba(35, 31, 25, 0.28));
}

.human-world-agent.is-self {
  z-index: 18;
}

.human-world-agent.is-self .human-world-character {
  width: 48px;
  height: 60px;
  filter:
    drop-shadow(0 0 6px rgba(255, 248, 218, 0.95))
    drop-shadow(0 7px 1px rgba(35, 31, 25, 0.32));
}

.human-world-agent.is-self .human-world-sprite {
  transform: translateX(-50%) scale(1.86);
}

.human-world-agent.is-self .human-world-agent-label {
  position: relative;
  border: 3px solid #fffdf4;
  background: #087568;
  color: #fffdf4;
  box-shadow:
    0 0 0 4px rgba(25, 200, 185, 0.38),
    0 5px 0 rgba(20, 85, 76, 0.55),
    0 14px 20px rgba(20, 85, 76, 0.24);
}

.human-world-agent.is-self .human-world-agent-label::before {
  position: absolute;
  top: -18px;
  left: 50%;
  padding: 2px 7px;
  border: 2px solid #fffdf4;
  border-radius: 999px;
  background: #ff6d5f;
  color: #fffdf4;
  content: "YOU";
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: translateX(-50%);
}

.human-world-agent.is-self .human-world-agent-label strong,
.human-world-agent.is-self .human-world-agent-label small {
  color: #fffdf4;
}

.human-world-agent-label {
  max-width: 130px;
  padding: 4px 8px 5px;
  border: 2px solid rgba(105, 92, 63, 0.28);
  border-radius: 3px;
  background: rgba(255, 250, 218, 0.94);
  color: #4f432d;
  box-shadow: 0 3px 0 rgba(70, 58, 38, 0.24);
}

.human-world-agent-label strong,
.human-world-agent-label small {
  max-width: 112px;
}

.human-world-agent-label strong {
  font-size: 11px;
  letter-spacing: 0;
}

.human-world-agent-label small {
  color: #7b7056;
  font-size: 9px;
}

.human-world-agent em {
  top: -2px;
  left: calc(50% + 16px);
  min-width: 18px;
  height: 18px;
  border: 2px solid #fff8d9;
  background: #ff6d5f;
  font-size: 10px;
  box-shadow: 0 3px 0 rgba(70, 58, 38, 0.22);
}

.human-world-back,
.human-shell.is-world-mode .human-world-summary span,
.human-shell.is-world-mode .human-world-card {
  border: 3px solid rgba(103, 89, 60, 0.3);
  border-radius: 4px;
  background: rgba(255, 250, 225, 0.93);
  box-shadow:
    0 4px 0 rgba(87, 73, 48, 0.2),
    0 12px 30px rgba(38, 33, 24, 0.18);
  backdrop-filter: none;
}

.human-world-back {
  min-height: 40px;
  border-radius: 4px;
}

.human-shell.is-world-mode .human-world-summary {
  gap: 8px;
}

.human-shell.is-world-mode .human-world-summary span {
  min-height: 38px;
}

.human-shell.is-world-mode .human-world-panel {
  top: 92px;
}

.human-shell.is-world-mode .human-world-card {
  padding: 16px;
}

.human-world-stats div,
.human-world-latest {
  border: 2px solid rgba(103, 89, 60, 0.12);
  border-radius: 4px;
  background: rgba(255, 253, 244, 0.62);
}

.human-world-feed-item {
  border-radius: 4px;
}

.human-world-feed-item:hover {
  background: rgba(255, 248, 218, 0.72);
}

@media (max-width: 760px) {
  .human-world-pixel-sign {
    display: none;
  }

  .human-world-character {
    transform: scale(0.9);
  }

  .human-world-agent-label {
    max-width: 98px;
  }

  .human-world-agent-label strong,
  .human-world-agent-label small {
    max-width: 82px;
  }
}
