@import url("../design-system/tokens.css");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.experience-page {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  background: var(--aycm-bg-dark);
  color: var(--aycm-text-primary);
  overflow: hidden;
}

.experience-exit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(8, 13, 26, 0.96);
  border-bottom: 1px solid var(--aycm-border);
  flex-shrink: 0;
}

.experience-exit-bar a {
  color: var(--aycm-brand-cyan);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.experience-exit-bar a:hover {
  text-decoration: underline;
}

.experience-exit-note {
  font-size: 12px;
  color: var(--aycm-text-secondary);
}

.chs-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 45px);
  min-height: 620px;
  background: #101820;
}

.chs-hint-banner {
  padding: 8px 16px;
  background: rgba(0, 165, 191, 0.08);
  border-bottom: 1px solid rgba(0, 165, 191, 0.2);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  flex-shrink: 0;
}

.chs-hint-banner strong {
  color: #7dd4e8;
}

.chs-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgb(23, 36, 48);
  flex-shrink: 0;
}

.chs-titlebar-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.chs-kicker {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.chs-window-title {
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chs-save-btn {
  padding: 8px 22px;
  border: none;
  border-radius: 10px;
  background: #269952;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.chs-save-btn:hover {
  filter: brightness(1.08);
}

.chs-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Identity panel */
.chs-identity {
  width: 340px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 20px 18px 24px;
  background: #141b24;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.chs-identity::-webkit-scrollbar,
.chs-tab-body::-webkit-scrollbar {
  width: 4px;
}

.chs-identity::-webkit-scrollbar-thumb,
.chs-tab-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

.chs-photo-wrap {
  position: relative;
  margin-bottom: 16px;
}

.chs-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(255, 140, 0, 0.35), rgba(80, 40, 20, 0.6)),
    linear-gradient(135deg, #2a1810 0%, #1a2430 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 140, 0, 0.25);
}

.chs-photo-inner {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.chs-photo-edit {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.chs-photo-edit:hover {
  background: rgba(0, 0, 0, 0.72);
}

.chs-name-block {
  text-align: center;
  margin-bottom: 20px;
}

.chs-name {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 6px;
}

.chs-edit-name {
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.chs-edit-name:hover {
  color: #7dd4e8;
}

.chs-details-card {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.chs-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chs-details-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
}

.chs-details-edit {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.chs-detail-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chs-detail-row:last-child {
  border-bottom: none;
}

.chs-detail-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  background: rgba(0, 165, 191, 0.15);
}

.chs-detail-icon.role {
  background: rgba(255, 140, 0, 0.18);
}

.chs-detail-meta {
  flex: 1;
  min-width: 0;
}

.chs-detail-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 2px;
}

.chs-detail-value {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

/* Detail column */
.chs-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #161d27;
}

.chs-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  flex-shrink: 0;
}

.chs-tab {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 8px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
}

.chs-tab:hover {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
}

.chs-tab.active {
  color: #ffb366;
  background: rgba(255, 140, 0, 0.1);
  box-shadow: inset 0 -2px 0 #ff8c00;
}

.chs-tab-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
}

.chs-section {
  margin-bottom: 16px;
}

.chs-section-card {
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #00a5bf;
}

.chs-section-card.accent-orange {
  border-left-color: #ff8c00;
}

.chs-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.chs-section-head span:first-child {
  font-size: 14px;
}

.chs-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

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

.chs-field {
  margin-bottom: 10px;
}

.chs-field.full {
  grid-column: 1 / -1;
}

.chs-field-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 5px;
}

.chs-field-value {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  pointer-events: none;
}

.chs-field-value.multiline {
  min-height: 64px;
  line-height: 1.45;
}

.chs-field-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chs-link-btn {
  display: inline-flex;
  margin-top: 4px;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 165, 191, 0.2);
  color: #7dd4e8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chs-link-btn:hover {
  background: rgba(0, 165, 191, 0.3);
}

.chs-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chs-pill {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.chs-pill:hover,
.chs-pill.selected {
  border-color: rgba(255, 140, 0, 0.45);
  background: rgba(255, 140, 0, 0.14);
  color: #ffb366;
}

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

.chs-arc-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.chs-arc-card.wide {
  grid-column: 1 / -1;
}

.chs-arc-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7dd4e8;
  margin-bottom: 6px;
}

.chs-arc-label.orange {
  color: #ffb366;
}

.chs-arc-text {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.chs-moment {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  cursor: pointer;
}

.chs-moment:hover {
  border-color: rgba(0, 165, 191, 0.4);
}

.chs-rel-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
  cursor: pointer;
}

.chs-rel-card:hover {
  border-color: rgba(0, 165, 191, 0.35);
}

.chs-rel-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.chs-rel-type {
  font-size: 10px;
  font-weight: 700;
  color: #ffb366;
  margin-bottom: 6px;
}

.chs-rel-note {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.48);
}

.chs-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chs-status-chip {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.chs-status-chip.active {
  border-color: rgba(0, 165, 191, 0.45);
  background: rgba(0, 165, 191, 0.18);
  color: #7dd4e8;
}

.chs-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.chs-task-row:last-child {
  border-bottom: none;
}

.chs-task-check {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
}

.chs-task-check.done {
  background: #00a5bf;
  border-color: #00a5bf;
}

.chs-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(15, 22, 41, 0.96);
  border: 1px solid rgba(0, 165, 191, 0.3);
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 100;
}

.chs-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 900px) {
  .chs-workspace {
    flex-direction: column;
    overflow-y: auto;
  }

  .chs-identity {
    width: 100%;
    max-height: 420px;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .chs-detail {
    min-height: 480px;
  }

  .chs-field-grid,
  .chs-arc-grid {
    grid-template-columns: 1fr;
  }
}
