/*
  Origin — multi-project enhancement layer
  Loaded after styles.css. It deliberately uses the existing Origin tokens so the
  new spaces feel native to the workspace rather than like a second application.
*/

.project-rail {
  position: sticky;
  top: 88px;
  display: grid;
  align-content: start;
  gap: 11px;
  width: min(248px, 100%);
  max-height: calc(100vh - 108px);
  padding: 12px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(29, 34, 52, 0.84), rgba(11, 14, 24, 0.8)),
    rgba(14, 17, 27, 0.84);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(16px);
}

.project-rail::before {
  width: 100%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(190, 181, 255, 0.36), transparent);
}

.project-rail > header,
.project-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 1px 3px 3px;
}

.project-rail > header h2,
.project-rail > header h3,
.project-rail-header h2,
.project-rail-header h3 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: -0.02em;
}

.project-rail > header small,
.project-rail-header small {
  color: var(--text-subtle);
  font-size: 10px;
}

.project-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid rgba(186, 194, 255, 0.15);
  border-radius: 12px;
  color: var(--text);
  background: rgba(5, 8, 15, 0.32);
}

.project-switcher > :is(button, select) {
  min-width: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 12px;
  font-weight: 770;
  outline: none;
}

.project-switcher > button {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.project-switcher > select {
  width: 100%;
  cursor: pointer;
}

.project-switcher:focus-within {
  border-color: rgba(158, 144, 255, 0.64);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.12);
}

.project-card {
  position: relative;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: var(--text-muted);
  background: transparent;
  text-align: left;
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.project-card:hover {
  border-color: rgba(184, 193, 255, 0.15);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.project-card.is-active,
.project-card[aria-current="page"],
.project-card[aria-selected="true"] {
  border-color: rgba(183, 170, 255, 0.29);
  color: #fff;
  background: linear-gradient(105deg, rgba(139, 124, 255, 0.24), rgba(139, 124, 255, 0.075));
  box-shadow: inset 3px 0 var(--accent-strong), 0 7px 18px rgba(36, 27, 111, 0.14);
}

.project-card-icon,
.project-card > :is(.project-icon, .project-mark, .avatar) {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #8171f3, #47b5d1);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.25);
  font-size: 11px;
  font-weight: 860;
}

.project-card-icon img,
.project-card > :is(.project-icon, .project-mark, .avatar) img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card-copy,
.project-card > div:not(.project-card-icon):not(.project-icon):not(.project-mark):not(.avatar) {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.project-card strong {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  font-weight: 790;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card small {
  overflow: hidden;
  color: var(--text-subtle);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card .unread-count,
.project-card .project-count {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 11px rgba(103, 83, 238, 0.34);
  font-size: 9px;
  font-weight: 850;
}

.project-card.is-muted {
  opacity: 0.65;
}

/* Filtered feed / cross-project post view */
.feed-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(22, 27, 42, 0.72);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.feed-controls > :is(button, a, label) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 770;
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}

.feed-controls > :is(button, a, label):hover {
  border-color: rgba(186, 194, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.feed-controls > :is(button, a, label).is-active,
.feed-controls > :is(button, a, label)[aria-pressed="true"] {
  border-color: rgba(182, 169, 255, 0.23);
  color: #fff;
  background: rgba(139, 124, 255, 0.17);
}

.feed-controls input,
.feed-controls select {
  min-height: 31px;
  border: 0;
  color: inherit;
  background: transparent;
  outline: 0;
  font-size: 11px;
}

.feed-controls .feed-search,
.feed-controls label:has(input[type="search"]) {
  flex: 1 1 150px;
  justify-content: flex-start;
  border-color: rgba(186, 194, 255, 0.13);
  background: rgba(4, 7, 14, 0.29);
}

.feed-controls .feed-search input,
.feed-controls label:has(input[type="search"]) input {
  width: 100%;
}

.feed-post {
  position: relative;
  display: grid;
  gap: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(26, 31, 48, 0.88), rgba(14, 18, 29, 0.88));
  box-shadow: 0 13px 35px rgba(0, 0, 0, 0.14), inset 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}

.feed-post:hover {
  border-color: rgba(184, 193, 255, 0.27);
  box-shadow: 0 19px 46px rgba(0, 0, 0, 0.21), inset 0 1px rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.feed-post .project-context,
.feed-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 39px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(202, 209, 255, 0.075);
  color: var(--text-subtle);
  background: rgba(4, 7, 14, 0.2);
  font-size: 10px;
  font-weight: 760;
}

.feed-post .project-context strong,
.feed-post-header strong {
  overflow: hidden;
  color: #d9deec;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-post .project-context::before,
.feed-post-header .project-mark {
  display: grid;
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  place-items: center;
  content: "";
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent-strong), var(--cyan));
}

.feed-post .post-meta,
.feed-post .post-copy,
.feed-post .post-footer {
  padding-right: 14px;
  padding-left: 14px;
}

.feed-post .media-stage,
.feed-post .video-stage {
  border-top: 0;
}

.feed-post.is-featured::after {
  position: absolute;
  top: 0;
  right: 18px;
  width: 26px;
  height: 4px;
  content: "";
  border-radius: 0 0 6px 6px;
  background: var(--warning);
  box-shadow: 0 0 14px rgba(243, 189, 103, 0.54);
}

/* Personal profile */
.profile-page {
  display: grid;
  gap: 18px;
  width: min(980px, 100%);
  margin: 0 auto;
}

.profile-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: clamp(13px, 3vw, 25px);
  align-items: center;
  min-height: 160px;
  padding: clamp(19px, 4vw, 32px);
  overflow: hidden;
  border: 1px solid rgba(186, 174, 255, 0.24);
  border-radius: 23px;
  background:
    radial-gradient(circle at 90% -8%, rgba(100, 221, 239, 0.19), transparent 24rem),
    radial-gradient(circle at 16% 118%, rgba(140, 119, 255, 0.31), transparent 30rem),
    linear-gradient(135deg, rgba(32, 34, 58, 0.93), rgba(13, 17, 29, 0.92));
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.05);
}

.profile-card::after {
  position: absolute;
  right: -50px;
  bottom: -70px;
  width: 230px;
  height: 230px;
  content: "";
  border: 1px solid rgba(202, 195, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 32px rgba(180, 169, 255, 0.025), 0 0 0 66px rgba(180, 169, 255, 0.018);
  pointer-events: none;
}

.profile-card .profile-avatar,
.profile-card > .avatar {
  position: relative;
  z-index: 1;
  display: grid;
  width: clamp(68px, 10vw, 94px);
  height: clamp(68px, 10vw, 94px);
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-radius: 27px;
  color: #fff;
  background: linear-gradient(145deg, #a093ff, #49c9df);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.24), inset 0 1px rgba(255, 255, 255, 0.35);
  font-size: 23px;
  font-weight: 870;
}

.profile-card .profile-avatar img,
.profile-card > .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card > div:not(.profile-avatar):not(.avatar) {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.profile-card h1,
.profile-card h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: clamp(23px, 4vw, 32px);
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.profile-card p {
  max-width: 550px;
  margin: 0;
  color: #c0c7dc;
  font-size: 13px;
}

.profile-card .profile-handle,
.profile-card .profile-role {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 790;
}

.profile-card .profile-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.profile-stat {
  display: grid;
  min-width: 89px;
  gap: 1px;
  padding: 11px 13px;
  border: 1px solid rgba(199, 205, 255, 0.13);
  border-radius: 13px;
  background: rgba(5, 8, 15, 0.24);
}

.profile-stat strong {
  color: #fff;
  font-size: 18px;
  letter-spacing: -0.045em;
}

.profile-stat span,
.profile-stat small {
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 700;
}

.profile-page .profile-stats,
.profile-card .profile-stats {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Conversations in the context of a post */
.comment-thread {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(201, 208, 255, 0.09);
  background: rgba(4, 7, 13, 0.18);
}

.comment-thread > header,
.comment-thread-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-thread > header h3,
.comment-thread-heading h3 {
  margin: 0;
  color: #e8eaf4;
  font-size: 12px;
  letter-spacing: -0.015em;
}

.comment-thread > header small,
.comment-thread-heading small {
  color: var(--text-subtle);
  font-size: 10px;
}

.comment-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.comment-item > .avatar,
.comment-item > .comment-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #8879f5, #57c7e1);
  font-size: 9px;
  font-weight: 850;
}

.comment-item > .avatar img,
.comment-item > .comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comment-item > div:not(.avatar):not(.comment-avatar),
.comment-item .comment-body {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(197, 205, 255, 0.09);
  border-radius: 4px 11px 11px 11px;
  background: rgba(255, 255, 255, 0.038);
}

.comment-item header,
.comment-item .comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  margin-bottom: 3px;
}

.comment-item strong {
  color: #e6e9f4;
  font-size: 11px;
  font-weight: 800;
}

.comment-item time,
.comment-item .comment-time {
  color: var(--text-subtle);
  font-size: 9px;
}

.comment-item p {
  margin: 0;
  color: #bdc4d8;
  font-size: 11px;
  line-height: 1.48;
}

.comment-item .comment-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.comment-item .comment-actions button,
.comment-item .reply-button {
  padding: 0;
  border: 0;
  color: var(--text-subtle);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
}

.comment-item .comment-actions button:hover,
.comment-item .reply-button:hover {
  color: var(--accent-strong);
}

.reply-list {
  display: grid;
  gap: 9px;
  margin: 9px 0 0 17px;
  padding: 0 0 0 11px;
  border-left: 1px solid rgba(166, 154, 255, 0.23);
}

.reply-list .comment-item {
  grid-template-columns: 23px minmax(0, 1fr);
}

.reply-list .comment-item > .avatar,
.reply-list .comment-item > .comment-avatar {
  width: 23px;
  height: 23px;
  border-radius: 7px;
  font-size: 8px;
}

.comment-composer {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid rgba(183, 192, 255, 0.14);
  border-radius: 13px;
  background: rgba(5, 8, 15, 0.26);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.comment-composer:focus-within {
  border-color: rgba(155, 141, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.09);
}

.comment-composer .avatar,
.comment-composer .comment-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #8879f5, #57c7e1);
  font-size: 9px;
  font-weight: 850;
}

.comment-composer textarea,
.comment-composer input[type="text"] {
  width: 100%;
  min-height: 30px;
  padding: 7px 0;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: 0;
  font-size: 11px;
  line-height: 1.35;
  resize: none;
}

.comment-composer textarea::placeholder,
.comment-composer input::placeholder {
  color: var(--text-subtle);
}

.comment-composer button[type="submit"],
.comment-composer .send-comment {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(196, 188, 255, 0.26);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, #9a8eff, #7461e8);
  box-shadow: 0 5px 13px rgba(86, 68, 220, 0.24), inset 0 1px rgba(255, 255, 255, 0.28);
}

.comment-composer button[type="submit"]:hover,
.comment-composer .send-comment:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* Sign-in / create-account surfaces */
.auth-dialog {
  position: relative;
  width: min(430px, 100%);
  padding: clamp(22px, 4vw, 32px);
  overflow: hidden;
  border: 1px solid rgba(185, 174, 255, 0.31);
  border-radius: 21px;
  color: var(--text);
  background:
    radial-gradient(circle at 92% 0%, rgba(104, 215, 236, 0.2), transparent 17rem),
    radial-gradient(circle at 0 108%, rgba(141, 120, 255, 0.24), transparent 18rem),
    linear-gradient(140deg, rgba(34, 37, 59, 0.98), rgba(12, 15, 25, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52), 0 0 50px rgba(105, 85, 236, 0.13), inset 0 1px rgba(255, 255, 255, 0.045);
}

.auth-dialog::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(231, 227, 255, 0.67), transparent);
}

.auth-dialog > header,
.auth-dialog-header {
  margin-bottom: 20px;
  text-align: center;
}

.auth-dialog > header h1,
.auth-dialog > header h2,
.auth-dialog-header h1,
.auth-dialog-header h2 {
  margin: 4px 0 6px;
  color: #fff;
  font-size: 24px;
  letter-spacing: -0.052em;
}

.auth-dialog > header p,
.auth-dialog-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.auth-dialog form,
.auth-form {
  display: grid;
  gap: 13px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field > label,
.auth-field > span:first-child {
  color: #d9deed;
  font-size: 11px;
  font-weight: 780;
}

.auth-field :is(input, select) {
  width: 100%;
  min-height: 43px;
  padding: 9px 11px;
  border: 1px solid rgba(190, 198, 255, 0.16);
  border-radius: 11px;
  color: var(--text);
  background: rgba(4, 7, 14, 0.33);
  outline: 0;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.auth-field :is(input, select):focus {
  border-color: rgba(157, 143, 255, 0.7);
  background: rgba(6, 9, 16, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.13);
}

.auth-field small,
.auth-field .field-error {
  color: var(--text-subtle);
  font-size: 10px;
}

.auth-field.is-invalid :is(input, select),
.auth-field .field-error {
  border-color: rgba(255, 112, 145, 0.62);
  color: #ffb6c7;
}

.auth-dialog .auth-footer {
  margin-top: 16px;
  color: var(--text-subtle);
  font-size: 11px;
  text-align: center;
}

.auth-dialog .auth-footer a,
.auth-dialog a:not(.button) {
  color: var(--accent-strong);
  font-weight: 760;
}

/* Video posts retain a calm, consistent screen footprint. */
.video-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: clamp(195px, 28vw, 325px);
  min-height: 195px;
  max-height: 325px;
  place-items: center;
  overflow: hidden;
  border-top: 1px solid rgba(210, 216, 255, 0.08);
  border-bottom: 1px solid rgba(210, 216, 255, 0.08);
  background:
    radial-gradient(circle at 50% 26%, rgba(66, 82, 128, 0.48), transparent 58%),
    #080a10;
  isolation: isolate;
}

.video-stage video,
.video-stage iframe,
.video-stage > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-stage::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(180deg, rgba(5, 8, 15, 0.06), transparent 46%, rgba(5, 8, 15, 0.37));
}

.video-stage .video-play,
.video-stage button[aria-label*="Play"] {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  padding: 0 0 0 3px;
  border: 1px solid rgba(255, 255, 255, 0.39);
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 16, 31, 0.66);
  box-shadow: 0 12px 27px rgba(0, 0, 0, 0.36), 0 0 0 8px rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(9px);
  transition: transform var(--ease), background var(--ease), box-shadow var(--ease);
}

.video-stage .video-play:hover,
.video-stage button[aria-label*="Play"]:hover {
  background: rgba(120, 102, 235, 0.86);
  box-shadow: 0 15px 32px rgba(0, 0, 0, 0.43), 0 0 0 9px rgba(139, 124, 255, 0.16);
  transform: scale(1.06);
}

.video-stage .video-duration,
.video-stage time,
.video-stage .video-label {
  position: absolute;
  z-index: 2;
  right: 10px;
  bottom: 9px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  color: #fff;
  background: rgba(5, 7, 12, 0.58);
  font-size: 10px;
  font-weight: 780;
  backdrop-filter: blur(6px);
}

/* Short project updates / changelog */
.update-list {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 18, 29, 0.68);
}

.update-list > :is(li, article, .update-item) {
  position: relative;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(201, 208, 255, 0.075);
  transition: background var(--ease);
}

.update-list > :is(li, article, .update-item):last-child {
  border-bottom: 0;
}

.update-list > :is(li, article, .update-item):hover {
  background: rgba(255, 255, 255, 0.035);
}

.update-list > :is(li, article, .update-item)::before {
  width: 7px;
  height: 7px;
  align-self: center;
  content: "";
  border-radius: 50%;
  background: var(--update-color, var(--accent-strong));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--update-color, var(--accent-strong)) 15%, transparent);
}

.update-list h3,
.update-list h4 {
  margin: 0 0 2px;
  color: #e7eaf4;
  font-size: 12px;
  letter-spacing: -0.015em;
}

.update-list p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.42;
}

.update-list time,
.update-list .update-date {
  color: var(--text-subtle);
  font-size: 10px;
  white-space: nowrap;
}

/* Dedicated role creation and safety workbench. */
.role-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 16px;
  min-width: 0;
}

.role-workbench > :is(section, aside, .role-form, .role-summary) {
  min-width: 0;
  border: 1px solid rgba(190, 198, 255, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(35, 40, 61, 0.62), rgba(11, 15, 25, 0.46));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.032);
}

.role-form {
  display: grid;
  gap: 14px;
  padding: clamp(15px, 3vw, 21px);
}

.role-form > header,
.role-form-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.role-form h2,
.role-form h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.035em;
}

.role-form header p,
.role-form-header p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.role-form label {
  display: grid;
  gap: 6px;
  color: #d8ddec;
  font-size: 11px;
  font-weight: 770;
}

.role-form :is(input[type="text"], input[type="number"], textarea, select) {
  width: 100%;
  min-height: 41px;
  padding: 9px 11px;
  border: 1px solid rgba(187, 196, 255, 0.15);
  border-radius: 10px;
  color: var(--text);
  background: rgba(4, 7, 13, 0.32);
  outline: 0;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.role-form textarea {
  min-height: 86px;
  resize: vertical;
}

.role-form :is(input, textarea, select):focus {
  border-color: rgba(157, 143, 255, 0.67);
  background: rgba(7, 9, 16, 0.68);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.12);
}

.role-form .role-colors,
.role-form .color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-form .role-colors button,
.role-form .color-option {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--role-color, var(--accent-strong));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.17) inset;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.role-form .role-colors button:hover,
.role-form .color-option:hover {
  transform: scale(1.1);
}

.role-form .role-colors button.is-selected,
.role-form .color-option.is-selected,
.role-form .color-option[aria-pressed="true"] {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.25);
}

.role-summary {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: clamp(15px, 3vw, 21px);
}

.role-summary > header,
.role-summary-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.role-summary .role-symbol,
.role-summary > header > :first-child:not(div) {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(135deg, var(--role-color, var(--accent-strong)), color-mix(in srgb, var(--role-color, var(--accent-strong)) 65%, var(--cyan)));
  box-shadow: 0 7px 17px color-mix(in srgb, var(--role-color, var(--accent-strong)) 30%, transparent), inset 0 1px rgba(255, 255, 255, 0.28);
}

.role-summary h3,
.role-summary h4 {
  margin: 0;
  color: #fff;
  font-size: 13px;
}

.role-summary p {
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.48;
}

.role-summary .summary-permissions,
.role-summary ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.role-summary .summary-permissions li,
.role-summary li {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 29px;
  padding: 6px 8px;
  border: 1px solid rgba(187, 196, 255, 0.1);
  border-radius: 8px;
  color: #c9cfdf;
  background: rgba(4, 7, 14, 0.24);
  font-size: 10px;
  font-weight: 720;
}

.role-summary .summary-permissions li::before,
.role-summary li::before {
  width: 6px;
  height: 6px;
  content: "";
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(102, 217, 164, 0.1);
}

.role-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  width: fit-content;
  margin-top: 2px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 109, 140, 0.25);
  border-radius: 10px;
  color: #ffc1cf;
  background: rgba(255, 91, 127, 0.09);
  font-size: 11px;
  font-weight: 800;
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}

.role-delete:hover {
  border-color: rgba(255, 109, 140, 0.5);
  color: #fff;
  background: rgba(255, 91, 127, 0.18);
  transform: translateY(-1px);
}

.role-delete:disabled {
  border-color: rgba(187, 196, 255, 0.1);
  color: var(--text-subtle);
  background: rgba(255, 255, 255, 0.025);
}

/* New-surface focus treatment stays obvious without competing with the design. */
.project-card:focus-visible,
.feed-controls > :is(button, a, label):focus-visible,
.comment-item .comment-actions button:focus-visible,
.role-delete:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 3px;
}

@media (max-width: 1050px) {
  .project-rail {
    width: 218px;
  }

  .role-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .project-rail {
    position: static;
    display: flex;
    width: 100%;
    max-height: none;
    padding: 9px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .project-rail::before,
  .project-rail > header,
  .project-rail-header {
    display: none;
  }

  .project-switcher {
    min-width: 180px;
  }

  .project-card {
    min-width: 192px;
  }

  .feed-post .media-stage,
  .feed-post .video-stage,
  .video-stage {
    height: clamp(205px, 48vw, 310px);
  }

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

  .profile-card .profile-actions,
  .profile-card .profile-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .feed-controls {
    gap: 6px;
    padding: 8px;
  }

  .feed-controls > :is(button, a, label) {
    min-height: 30px;
    padding: 5px 8px;
  }

  .feed-post {
    border-radius: 17px;
  }

  .feed-post .post-meta,
  .feed-post .post-copy,
  .feed-post .post-footer {
    padding-right: 12px;
    padding-left: 12px;
  }

  .profile-page {
    gap: 13px;
  }

  .profile-card {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 13px;
    min-height: 0;
    padding: 18px;
    border-radius: 18px;
  }

  .profile-card .profile-avatar,
  .profile-card > .avatar {
    width: 61px;
    height: 61px;
    border-radius: 20px;
    font-size: 17px;
  }

  .profile-card h1,
  .profile-card h2 {
    font-size: 24px;
  }

  .profile-stat {
    min-width: 78px;
    padding: 9px 10px;
  }

  .profile-stat strong {
    font-size: 16px;
  }

  .comment-thread {
    padding: 12px;
  }

  .comment-composer {
    grid-template-columns: 24px minmax(0, 1fr) auto;
  }

  .comment-composer .avatar,
  .comment-composer .comment-avatar {
    width: 24px;
    height: 24px;
  }

  .video-stage,
  .feed-post .video-stage {
    height: clamp(190px, 65vw, 280px);
    min-height: 190px;
  }

  .update-list > :is(li, article, .update-item) {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .update-list time,
  .update-list .update-date {
    grid-column: 2;
  }

  .role-form,
  .role-summary {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .project-card,
  .feed-post,
  .video-stage .video-play,
  .video-stage button[aria-label*="Play"],
  .role-delete {
    transition: none;
  }
}

/* -------------------------------------------------------------------------
   Origin frontend reconciliation — exact markup emitted by origin.js
   ------------------------------------------------------------------------- */

.home-layout {
  display: grid;
  grid-template-columns: minmax(210px, 244px) minmax(0, 1fr);
  gap: clamp(16px, 2.7vw, 32px);
  align-items: start;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.feed-main,
.feed-stack {
  display: grid;
  min-width: 0;
}

.feed-main {
  gap: 14px;
}

.feed-stack {
  gap: 14px;
}

.project-rail {
  gap: 6px;
  padding: 11px;
}

.project-rail .side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 1px 3px 7px;
}

.project-rail .side-label {
  margin: 0;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail-add {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(190, 181, 255, 0.24);
  border-radius: 8px;
  color: #fff;
  background: rgba(139, 124, 255, 0.16);
  font-size: 18px;
  line-height: 1;
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}

.rail-add:hover {
  border-color: rgba(197, 188, 255, 0.5);
  background: var(--accent);
  transform: translateY(-1px);
}

.project-switcher {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  width: 100%;
  min-height: 55px;
  padding: 8px;
  text-align: left;
}

.project-switcher > span:last-child {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.project-monogram {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #897af3, #4fc9df);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.27);
  font-size: 10px;
  font-weight: 870;
}

.project-switcher.is-selected {
  transform: none;
}

.rail-view-all {
  width: 100%;
  min-height: 33px;
  margin-top: 4px;
  padding: 7px 9px;
  border: 1px dashed rgba(188, 197, 255, 0.18);
  border-radius: 9px;
  color: var(--text-muted);
  background: transparent;
  font-size: 11px;
  font-weight: 760;
  text-align: left;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}

.rail-view-all:hover {
  border-color: rgba(174, 161, 255, 0.46);
  color: #fff;
  background: rgba(139, 124, 255, 0.1);
}

.feed-controls {
  align-items: end;
  justify-content: space-between;
  min-height: 110px;
  padding: clamp(16px, 3vw, 23px);
  border-color: rgba(189, 196, 255, 0.13);
  background:
    radial-gradient(circle at 88% 5%, rgba(86, 208, 229, 0.12), transparent 18rem),
    linear-gradient(135deg, rgba(31, 35, 54, 0.83), rgba(14, 17, 29, 0.75));
}

.feed-controls > div {
  min-width: 0;
}

.feed-controls h1 {
  margin: 2px 0 4px;
  color: #fff;
  font-size: clamp(24px, 3vw, 31px);
  letter-spacing: -0.055em;
  line-height: 1.06;
}

.feed-controls p:not(.eyebrow) {
  max-width: 500px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.feed-controls > .quiet-button {
  flex: 0 0 auto;
}

.feed-stack > .feed-post {
  width: 100%;
}

.feed-post .post-meta {
  display: flex;
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 54px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.feed-post .post-author {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.feed-post .post-author > div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  min-width: 0;
}

.text-link,
.post-author-name {
  padding: 0;
  border: 0;
  color: #f0f2fa;
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
}

.text-link:hover,
.post-author-name:hover {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-project-separator {
  color: var(--text-subtle);
  font-size: 10px;
}

.feed-post .role-badge {
  padding: 3px 7px;
  border: 1px solid rgba(99, 215, 237, 0.2);
  color: #b9f4ff;
  background: rgba(89, 209, 234, 0.1);
  font-size: 10px;
  font-weight: 740;
}

.avatar-button {
  cursor: pointer;
  transition: transform var(--ease), box-shadow var(--ease), filter var(--ease);
}

.avatar-button:hover {
  filter: brightness(1.13);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.16);
  transform: translateY(-1px);
}

.post-engagement {
  justify-content: flex-start;
  gap: 5px;
  min-height: 43px;
  border-top: 1px solid rgba(202, 209, 255, 0.065);
}

.engagement-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 29px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-subtle);
  background: transparent;
  font-size: 11px;
  font-weight: 760;
  transition: border-color var(--ease), color var(--ease), background var(--ease), transform var(--ease);
}

.engagement-button:hover {
  border-color: rgba(189, 196, 255, 0.14);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.engagement-button.is-liked {
  border-color: rgba(255, 119, 160, 0.22);
  color: #ff9ebc;
  background: rgba(255, 92, 138, 0.1);
}

.engagement-button.is-liked:hover {
  color: #ffd0dc;
  background: rgba(255, 92, 138, 0.16);
}

.post-media-count {
  margin-left: auto;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 700;
}

.empty-feed {
  display: grid;
  min-height: 210px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 28px;
  border: 1px dashed rgba(189, 197, 255, 0.19);
  border-radius: 18px;
  color: var(--text-muted);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0, rgba(139, 124, 255, 0.12), transparent 14rem),
    rgba(255, 255, 255, 0.017);
}

.empty-feed h2 {
  margin: 0;
  color: #e7e9f4;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.empty-feed p {
  max-width: 350px;
  margin: 0;
  font-size: 12px;
}

.empty-feed .primary-button {
  margin-top: 7px;
}

/* Project directory */
.projects-page,
.updates-page {
  display: grid;
  gap: 19px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding: clamp(4px, 1vw, 10px) 2px 0;
}

.page-heading h1 {
  margin: 3px 0 0;
  color: #fff;
  font-size: clamp(27px, 4vw, 39px);
  letter-spacing: -0.06em;
  line-height: 1.05;
}

.page-heading p:not(.eyebrow) {
  max-width: 530px;
  margin: 7px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

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

.project-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 11px;
  min-height: 202px;
  padding: 16px;
  border-color: rgba(188, 196, 255, 0.13);
  border-radius: 17px;
}

.project-card:hover {
  transform: translateY(-3px);
}

.project-card-top,
.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-card-top .project-monogram {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 12px;
}

.project-card-count,
.header-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(187, 196, 255, 0.13);
  border-radius: 999px;
  color: #c7cde0;
  background: rgba(4, 7, 14, 0.25);
  font-size: 10px;
  font-weight: 750;
}

.project-card h2 {
  margin: 2px 0 0;
  color: #f3f4fb;
  font-size: 16px;
  letter-spacing: -0.035em;
}

.project-card p {
  margin: -5px 0 auto;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.project-card-footer {
  padding-top: 9px;
  border-top: 1px solid rgba(198, 205, 255, 0.08);
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 720;
}

.project-card-footer .quiet-button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 10px;
}

/* Updates combines a short project index with full cards. */
.updates-layout {
  display: grid;
  grid-template-columns: minmax(205px, 250px) minmax(0, 1fr);
  gap: clamp(16px, 2.7vw, 30px);
  align-items: start;
}

.updates-layout .update-list {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 17px;
}

.updates-layout .update-list > .side-label {
  margin: 1px 3px 4px;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.updates-layout .update-list > p:not(.side-label) {
  margin: 4px 3px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.updates-layout .update-list .project-switcher {
  min-height: 50px;
}

/* Profile surfaces are a cover/header rather than a generic three-column card. */
.profile-page {
  width: min(1120px, 100%);
}

.profile-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
  padding: 0;
  border-color: rgba(190, 181, 255, 0.25);
}

.profile-card::after {
  display: none;
}

.profile-cover {
  position: relative;
  display: grid;
  height: clamp(125px, 19vw, 172px);
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 73% 27%, rgba(93, 220, 239, 0.28), transparent 24%),
    radial-gradient(circle at 22% 102%, rgba(150, 128, 255, 0.5), transparent 41%),
    linear-gradient(115deg, #2c2968, #112d49 69%, #142038);
}

.profile-cover::before,
.profile-cover::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(238, 236, 255, 0.18);
  border-radius: 50%;
}

.profile-cover::before {
  width: 210px;
  height: 210px;
  transform: translate(40%, 20%);
}

.profile-cover::after {
  width: 128px;
  height: 128px;
  transform: translate(-95%, -55%);
}

.profile-cover-mark {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.31);
  border-radius: 17px;
  color: #fff;
  background: rgba(7, 11, 24, 0.32);
  box-shadow: 0 10px 28px rgba(5, 8, 18, 0.22), inset 0 1px rgba(255, 255, 255, 0.24);
  font-size: 25px;
  font-weight: 900;
}

.profile-main {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 15px;
  align-items: end;
  padding: 0 clamp(18px, 3.5vw, 32px);
  margin-top: -39px;
}

.profile-card .profile-main .profile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 25px;
  font-size: 22px;
}

.profile-identity {
  min-width: 0;
  padding: 43px 0 0;
}

.profile-identity .eyebrow {
  margin: 0 0 3px;
}

.profile-identity h1 {
  margin: 0 0 5px;
}

.profile-identity p:not(.eyebrow) {
  margin: 0;
}

.profile-main > :is(.quiet-button, .primary-button) {
  margin-bottom: 2px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 22px clamp(18px, 3.5vw, 32px) 26px;
}

.profile-stat {
  min-width: 0;
  padding: 10px 11px;
  border-radius: 12px;
}

.profile-stat strong {
  overflow: hidden;
  font-size: clamp(15px, 2vw, 19px);
  text-overflow: ellipsis;
}

.profile-stat span {
  font-size: 9px;
  line-height: 1.25;
}

.profile-columns {
  display: grid;
  grid-template-columns: minmax(245px, 0.72fr) minmax(0, 1.28fr);
  gap: clamp(16px, 2.7vw, 28px);
  align-items: start;
}

.profile-columns > section {
  display: grid;
  gap: 11px;
  min-width: 0;
}

.profile-columns .section-heading {
  margin: 0 2px;
}

.profile-columns .section-heading > span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 5px;
  border: 1px solid rgba(187, 196, 255, 0.13);
  border-radius: 999px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 780;
}

.profile-columns > section:first-child > .project-card {
  min-height: 185px;
}

.profile-posts {
  display: grid;
  gap: 13px;
  min-width: 0;
}

.section-empty {
  margin: 0;
  padding: 20px;
  border: 1px dashed rgba(190, 198, 255, 0.17);
  border-radius: 14px;
  color: var(--text-subtle);
  font-size: 12px;
  text-align: center;
}

/* Exact discussion markup. */
.comment-thread {
  gap: 12px;
  padding: 14px;
}

.comment-thread-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.comment-thread-head strong {
  color: #e7eaf4;
  font-size: 12px;
  letter-spacing: -0.015em;
}

.comment-thread-head span {
  color: var(--text-subtle);
  font-size: 10px;
  text-align: right;
}

.comment-list {
  display: grid;
  gap: 10px;
}

.comment-content {
  display: grid;
  min-width: 0;
  gap: 0;
}

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  margin-bottom: 3px;
}

.comment-meta .text-link {
  color: #e6e9f4;
  font-size: 11px;
}

.comment-meta span {
  color: var(--text-subtle);
  font-size: 9px;
}

.comment-item .comment-reply-action {
  width: fit-content;
  margin-top: 6px;
  padding: 0;
  border: 0;
  color: var(--text-subtle);
  background: transparent;
  font-size: 10px;
  font-weight: 780;
}

.comment-item .comment-reply-action:hover {
  color: var(--accent-strong);
}

.reply-list {
  gap: 8px;
  margin: 10px 0 0 6px;
  padding: 0 0 0 10px;
}

.reply-item {
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.reply-item > .avatar {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 7px;
  font-size: 8px;
}

.reply-item > div {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(191, 199, 255, 0.08);
  border-radius: 4px 9px 9px 9px;
  background: rgba(255, 255, 255, 0.028);
}

.reply-item > div > span {
  color: var(--text-subtle);
  font-size: 9px;
}

.reply-item strong {
  color: #dfe3ee;
  font-size: 10px;
}

.reply-item p {
  margin: 2px 0 0;
  color: #bac1d4;
  font-size: 10px;
  line-height: 1.4;
}

.reply-composer {
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 8px;
  padding: 7px;
  border-radius: 10px;
}

.reply-composer input {
  padding: 6px 0;
}

.comment-loading,
.comment-empty {
  margin: 0;
  padding: 9px 0;
  color: var(--text-subtle);
  font-size: 11px;
}

/* Account and sign-in visual hierarchy. */
.auth-page {
  display: grid;
  min-height: calc(100vh - 68px);
  place-items: center;
  padding: clamp(20px, 5vw, 60px) 18px;
}

.auth-page .auth-dialog {
  width: min(430px, 100%);
}

.auth-brand {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  margin: 0 0 24px;
}

.auth-brand > span:last-child {
  display: grid;
  gap: 1px;
}

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

.auth-brand strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: -0.035em;
}

.auth-brand small {
  color: var(--text-subtle);
  font-size: 9px;
  font-weight: 790;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.auth-dialog > h1 {
  margin: 5px 0 7px;
  color: #fff;
  font-size: 25px;
  letter-spacing: -0.052em;
  line-height: 1.1;
}

.auth-intro {
  margin: 0 0 19px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.auth-field textarea {
  width: 100%;
  min-height: 88px;
  padding: 10px 11px;
  border: 1px solid rgba(190, 198, 255, 0.16);
  border-radius: 11px;
  color: var(--text);
  background: rgba(4, 7, 14, 0.33);
  outline: 0;
  resize: vertical;
}

.auth-field textarea:focus {
  border-color: rgba(157, 143, 255, 0.7);
  background: rgba(6, 9, 16, 0.7);
  box-shadow: 0 0 0 3px rgba(139, 124, 255, 0.13);
}

.auth-switch {
  width: 100%;
  margin-top: 12px;
  padding: 7px 4px;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 11px;
  font-weight: 760;
}

.auth-switch:hover {
  color: #d7d1ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.small-dialog {
  width: min(460px, 100%);
}

.modal-x {
  position: absolute;
  top: 13px;
  right: 13px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
}

.modal-x:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.identity-card {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  padding: 4px 8px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-align: left;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.identity-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.identity-meta {
  display: grid;
  gap: 0;
}

.identity-meta strong {
  max-width: 124px;
  overflow: hidden;
  color: #f0f2fa;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-meta small {
  color: var(--text-subtle);
  font-size: 9px;
}

.account-signout {
  margin-left: 6px;
  color: var(--text-subtle);
}

.account-signout:hover {
  border-color: rgba(255, 123, 151, 0.27);
  color: #ffc1cf;
  background: rgba(255, 91, 127, 0.09);
}

/* Project side switcher also appears inside an individual project workspace. */
.project-rail-inline {
  display: grid;
  gap: 5px;
  margin-top: 3px;
  padding-top: 12px;
  border-top: 1px solid rgba(202, 209, 255, 0.09);
}

.project-rail-inline > .side-label {
  margin: 0 3px 2px;
  color: var(--text-subtle);
  font-size: 10px;
  font-weight: 840;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-rail-inline .project-switcher {
  min-height: 47px;
}

@media (max-width: 1040px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-columns {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
  }
}

@media (max-width: 820px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-layout > .project-rail {
    display: flex;
    gap: 7px;
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .home-layout > .project-rail::before {
    display: none;
  }

  .home-layout > .project-rail .side-heading {
    display: flex;
    width: auto;
    min-width: 30px;
    padding: 0;
  }

  .home-layout > .project-rail .side-label {
    display: none;
  }

  .home-layout > .project-rail .project-switcher {
    width: 190px;
    min-width: 190px;
  }

  .home-layout > .project-rail .rail-view-all {
    width: auto;
    min-width: 112px;
    margin: 0;
    text-align: center;
  }

  .updates-layout {
    grid-template-columns: 1fr;
  }

  .updates-layout .update-list {
    position: static;
    display: flex;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .updates-layout .update-list > .side-label,
  .updates-layout .update-list > p:not(.side-label) {
    display: none;
  }

  .updates-layout .update-list .project-switcher {
    width: 184px;
    min-width: 184px;
  }

  .profile-columns {
    grid-template-columns: 1fr;
  }

  .profile-columns > section:first-child {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-columns > section:first-child > .section-heading {
    grid-column: 1 / -1;
  }
}

@media (max-width: 590px) {
  .feed-controls,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .feed-controls {
    min-height: 0;
    padding: 16px;
  }

  .feed-controls > .quiet-button {
    width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card {
    min-height: 178px;
  }

  .page-heading > .primary-button {
    width: 100%;
  }

  .profile-card {
    border-radius: 18px;
  }

  .profile-cover {
    height: 118px;
  }

  .profile-main {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 11px;
    padding: 0 15px;
    margin-top: -30px;
  }

  .profile-card .profile-main .profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    font-size: 17px;
  }

  .profile-identity {
    padding-top: 32px;
  }

  .profile-identity h1 {
    font-size: 24px;
  }

  .profile-main > :is(.quiet-button, .primary-button) {
    grid-column: 1 / -1;
    width: 100%;
    margin-top: 4px;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 17px 15px 19px;
  }

  .profile-columns > section:first-child {
    grid-template-columns: 1fr;
  }

  .comment-thread {
    padding: 12px;
  }

  .comment-thread-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .comment-thread-head span {
    text-align: left;
  }

  .post-media-count {
    display: none;
  }

  .identity-meta,
  .account-signout {
    display: none;
  }

  .identity-card {
    padding: 3px;
  }

  .auth-page {
    min-height: calc(100vh - 104px);
    padding: 18px 12px;
  }

  .auth-page .auth-dialog {
    padding: 22px 19px;
    border-radius: 18px;
  }
}
.or-role-icon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.or-role-icon-row strong,
.or-role-icon-row small {
  display: block;
}

.or-role-icon-row strong {
  color: #fff;
  font-size: 0.875rem;
}

.or-role-icon-row small {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.or-role-icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.or-role-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.875rem;
}

.or-role-icon span {
  font-size: 0.75rem;
  text-transform: capitalize;
}

.or-role-icon.is-selected {
  border-color: rgba(167, 156, 255, 0.62);
  color: #fff;
  background: rgba(139, 124, 255, 0.16);
}

/* The first two feed cards are from different projects and sit side by side. */
.home-layout .feed-stack {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.home-layout .feed-stack .post-card {
  min-width: 0;
}

.home-layout .feed-stack .media-stage {
  height: clamp(190px, 20vw, 255px);
}

.pin-button {
  color: var(--text-subtle);
}

.pin-button:hover,
.pin-button.is-pinned {
  border-color: rgba(243, 189, 103, 0.4);
  color: #ffdc94;
  background: rgba(243, 189, 103, 0.1);
}

@media (max-width: 1100px) {
  .home-layout .feed-stack {
    grid-template-columns: 1fr;
  }
}

@media (hover: none) {
  .media-stage .carousel-arrow {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
  }

  .media-stage .media-remove {
    opacity: 1;
    transform: none;
  }
}

/* Keep frequently used controls readable in the denser project layout. */
body {
  font-size: 1rem;
}

.post-copy p,
.feed-controls p,
.project-card p,
.profile-identity p,
.comment-content p,
.reply-item p {
  font-size: 0.875rem;
}

.post-copy h3 {
  font-size: 1.125rem;
}

.post-author strong,
.post-author-name,
.field-label,
.preview-panel-heading,
.composer-footer,
.settings-nav > button,
.project-switcher strong,
.project-card-footer,
.comment-thread-head,
.auth-field {
  font-size: 0.875rem;
}

.post-author small,
.post-footer,
.media-count,
.project-switcher small,
.profile-stat span,
.comment-meta,
.reply-item span,
.member-management-top p {
  font-size: 0.75rem;
}

.or-role-basics label,
.or-role-color-row strong,
.or-role-icon-row strong,
.or-role-permission strong,
.or-role-group-heading h4,
.or-role-list-item strong,
.or-role-preview strong,
.or-role-action-buttons button {
  font-size: 0.8125rem !important;
}

.or-role-basics input,
.or-role-basics textarea,
.or-role-permission small,
.or-role-helper,
.or-role-preview p,
.or-role-summary p,
.or-role-list-item small,
.or-role-template small {
  font-size: 0.75rem !important;
}

@media (max-width: 650px) {
  .or-role-icon-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Account recovery and verification states. */
.auth-dialog .auth-feedback {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.auth-dialog .auth-feedback[hidden] {
  display: none !important;
}

.auth-dialog .auth-feedback-error {
  border-color: rgba(255, 126, 152, 0.5);
  color: #ffd4de;
  background: rgba(173, 43, 82, 0.18);
}

.auth-dialog .auth-feedback-success {
  margin-bottom: 15px;
  border-color: rgba(91, 219, 176, 0.42);
  color: #d5ffef;
  background: rgba(27, 128, 94, 0.18);
}

.auth-dialog .auth-feedback-warning {
  margin-bottom: 15px;
  border-color: rgba(255, 203, 114, 0.45);
  color: #ffe8bd;
  background: rgba(160, 104, 29, 0.18);
}

.auth-password-toggle {
  justify-self: end;
  margin-top: -9px;
  padding: 3px 0;
  border: 0;
  color: #c3b7ff;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: #e2dbff;
  text-decoration: underline;
}

.auth-links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.auth-links button {
  padding: 4px 0;
  border: 0;
  color: #c3b7ff;
  background: transparent;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.auth-links button:hover {
  color: #e2dbff;
  text-decoration: underline;
}

.auth-pending {
  display: grid;
  gap: 12px;
}

.auth-pending > p:not(.auth-feedback) {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.8125rem;
  text-align: center;
}

.profile-verification {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px 17px;
  border: 1px solid rgba(255, 203, 114, 0.3);
  border-radius: 13px;
  color: #ffe8bd;
  background: rgba(160, 104, 29, 0.12);
}

.profile-verification strong {
  display: block;
  font-size: 0.875rem;
}

.profile-verification p {
  margin: 3px 0 0;
  color: #e4d3bc;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.profile-verification .quiet-button {
  flex: 0 0 auto;
}

.profile-email-pending {
  border-color: rgba(106, 210, 235, 0.35);
  color: #d4f7ff;
  background: rgba(36, 128, 155, 0.13);
}

.profile-email-pending p {
  color: #c6dfe7;
}

.profile-security-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(190, 198, 255, 0.16);
}

.profile-security-controls p {
  flex: 0 0 100%;
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.8125rem;
}

.profile-security-controls p strong {
  color: var(--text);
  font-weight: 700;
}

.profile-security-controls button {
  padding: 7px 10px;
  border: 1px solid rgba(190, 198, 255, 0.19);
  border-radius: 9px;
  color: #d9d0ff;
  background: rgba(139, 124, 255, 0.09);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.profile-security-controls button:hover {
  border-color: rgba(190, 198, 255, 0.4);
  background: rgba(139, 124, 255, 0.18);
}

@media (max-width: 650px) {
  .profile-verification {
    align-items: stretch;
    flex-direction: column;
  }
}
