/* Portal overrides — fixed mockup palette (admin Settings theme colours do not apply) */
html:has(body.portal-body) {
  --accent: #d4a853;
  --accent-dim: #e4bc6a;
  --accent-muted: rgba(212, 168, 83, 0.15);
  --gold: #d4a853;
  --gold-dim: #e4bc6a;
  --gold-muted: rgba(212, 168, 83, 0.15);
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-card-hover: #111111;
  --bg-input: #050505;
  --input-text: #ffffff;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --nav-bg: #0a0a0a;
  --btn-on-accent: #1a1208;
  --success: #d4a853;
}

.portal-body {
  margin: 0;
  background: #000000;
  --portal-gold: #d4a853;
  --portal-gold-hover: #e4bc6a;
  --portal-gold-muted: rgba(212, 168, 83, 0.15);
  --portal-gold-text: #1a1208;
  --accent: #d4a853;
  --accent-dim: #e4bc6a;
  --accent-muted: rgba(212, 168, 83, 0.15);
  --gold: #d4a853;
  --gold-dim: #e4bc6a;
  --gold-muted: rgba(212, 168, 83, 0.15);
  --bg: #000000;
  --bg-card: #0a0a0a;
  --bg-card-hover: #111111;
  --bg-input: #050505;
  --input-text: #ffffff;
  --text: #ffffff;
  --text-muted: #9ca3af;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --nav-bg: #0a0a0a;
  --btn-on-accent: #1a1208;
  --success: #d4a853;
}

body.portal-body .app-brand {
  color: #ffffff;
}

body.portal-body .nav-item.active {
  color: var(--portal-gold);
}

body.portal-body .nav-item.active svg {
  stroke: var(--portal-gold);
}

body.portal-body .nav-item.active {
  position: relative;
}

body.portal-body .nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 2px;
  background: var(--portal-gold);
  border-radius: 1px;
}

/* Portal CTAs use brand gold — not the admin theme accent */
body.portal-body .btn-gold {
  background: linear-gradient(135deg, var(--portal-gold-hover), var(--portal-gold));
  color: var(--portal-gold-text);
  font-weight: 600;
  border: none;
}

body.portal-body .btn-outline {
  color: var(--portal-gold);
  border-color: var(--portal-gold);
}

body.portal-body .form-group input,
body.portal-body .form-group select,
body.portal-body .form-group textarea {
  background: #050505;
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body.portal-body .form-group input:focus,
body.portal-body .form-group select:focus,
body.portal-body .form-group textarea:focus {
  border-color: var(--portal-gold);
  box-shadow: 0 0 0 2px var(--portal-gold-muted);
}

body.portal-body .portal-logo-upload-btn,
body.portal-body .file-picker-btn {
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
}

.portal-header-min .app-sub {
  display: none;
}

.portal-header--back {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.portal-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.portal-header-back:hover,
.portal-header-back:focus {
  background: var(--bg-card);
  color: var(--portal-gold);
}

.portal-header-back svg {
  display: block;
}

.portal-login.login-screen {
  min-height: 100vh;
  box-sizing: border-box;
}

.portal-login .login-form {
  width: 100%;
  max-width: 360px;
}

.portal-login .login-form .form-group input {
  width: 100%;
  box-sizing: border-box;
}

/* Home hub */
.portal-home {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-bottom: 0.5rem;
}

.portal-hub-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.portal-hub-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.95rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.portal-hub-row:hover,
.portal-hub-row:focus {
  border-color: rgba(212, 168, 83, 0.45);
  outline: none;
}

.portal-hub-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-hub-icon svg {
  width: 22px;
  height: 22px;
}

.portal-hub-icon--blue {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.portal-hub-icon--green {
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
}

.portal-hub-icon--yellow {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
}

.portal-hub-icon--red {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.portal-hub-icon--teal {
  background: var(--portal-gold-muted);
  color: var(--portal-gold-hover);
}

.portal-hub-icon--purple {
  background: rgba(167, 139, 250, 0.15);
  color: #a78bfa;
}

.portal-hub-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.portal-hub-title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
}

.portal-hub-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-hub-badge {
  flex-shrink: 0;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
  font-size: 0.78rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-hub-dot {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.portal-home-brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1rem;
  text-align: center;
}

.portal-brand-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  border-radius: 20px;
  background: linear-gradient(145deg, #c0392b, #e74c3c);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  overflow: hidden;
}

.portal-brand-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.portal-brand-hero-letter {
  font-size: 2.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.portal-brand-hero--has-img {
  background: transparent;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.portal-brand-hero--has-img .portal-brand-hero-img {
  border: 1px solid var(--border);
}

.portal-draft-chip {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.82rem;
  text-align: center;
  border: 1px solid rgba(251,191,36,0.35);
  background: rgba(251,191,36,0.1);
  color: var(--text-muted);
}

.portal-identity-color-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.portal-identity-color-row input[type="color"] {
  width: 3rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.portal-identity-color-preview {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.portal-identity-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.portal-draft-chip--submitted {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  color: var(--text);
}

.identity-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.identity-actions--split {
  flex-direction: row;
  gap: 0.65rem;
}

.identity-actions--split .btn {
  flex: 1 1 0;
  margin: 0;
}

.portal-home--with-bar {
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.portal-workspace--submit {
  padding-bottom: calc(var(--nav-h, 64px) + 4.75rem + env(safe-area-inset-bottom, 0px));
}

.portal-draft-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h, 64px) + env(safe-area-inset-bottom, 0px));
  z-index: 40;
  display: flex;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: rgba(10, 10, 10, 0.98);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.portal-draft-bar .btn {
  flex: 1 1 0;
  margin: 0;
}

.portal-draft-bar .btn-gold.btn--faded,
.portal-draft-bar .btn-gold:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.portal-onboarding-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.portal-onboarding-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--border);
}

.portal-onboarding-item:last-child {
  border-bottom: none;
}

.portal-onboarding-check {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: transparent;
  margin-top: 0.15rem;
}

.portal-onboarding-item--done .portal-onboarding-check {
  background: var(--portal-gold-muted);
  border-color: rgba(212, 168, 83, 0.45);
  color: var(--portal-gold);
}

.portal-onboarding-body {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.portal-onboarding-title {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
}

.portal-onboarding-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.portal-onboarding-optional {
  font-weight: 500;
  color: var(--text-muted);
}

.portal-onboarding-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.portal-onboarding-actions {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.portal-onboarding-actions .btn {
  margin: 0;
}

.portal-onboarding-actions .portal-onboarding-hint {
  margin: 0.55rem 0 0;
}

.portal-workspace .portal-onboarding-card {
  margin-bottom: 0.85rem;
}

.portal-project-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.portal-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.portal-project-row--active {
  border-color: rgba(212, 168, 83, 0.35);
  background: rgba(212, 168, 83, 0.06);
}

.portal-project-row--static {
  cursor: default;
}

.portal-project-row-name {
  font-weight: 600;
  font-size: 0.92rem;
}

.portal-project-row-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.portal-project-row-main .portal-project-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-project-row-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.portal-thanks-card {
  margin-bottom: 1rem;
}

.portal-feature--editable {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.65rem 0.75rem;
  display: flex;
  gap: 0.65rem;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.portal-feature-edit-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.portal-todo-project {
  font-size: 0.72rem;
  color: var(--portal-gold);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.portal-todo--aggregate {
  margin-bottom: 0.45rem;
}

.identity-submit-status {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}

.identity-actions-hint {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.portal-home-brand-hint {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Sub-pages (features, tasks, files, identity) */
.portal-sub {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-sub-back {
  align-self: flex-start;
  margin-bottom: 0.25rem;
}

.portal-sub-intro {
  margin: -0.35rem 0 0.25rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.portal-sub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.portal-sub-head .page-title {
  margin: 0;
}

.portal-workspace-head {
  text-align: center;
  margin: 0.35rem 0 0.85rem;
}

.portal-workspace-head .page-title {
  margin: 0;
  font-size: 1.45rem;
}

.portal-workspace .portal-hub-list {
  margin-top: 0;
}

.portal-todo-add-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.portal-todo-check {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  border: 2px solid var(--portal-gold);
  background: var(--portal-gold-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--portal-gold);
  line-height: 1;
}

.portal-todo--done,
.portal-todo--readonly {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.portal-todo--readonly {
  cursor: pointer;
  opacity: 0.92;
}

.portal-todo--readonly .portal-todo-hint {
  color: var(--text-muted);
}

.portal-identity-card .form-group label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.portal-identity-value {
  margin: 0.25rem 0 0;
  font-size: 1rem;
  font-weight: 600;
}

.portal-identity-brief {
  font-weight: 400;
  white-space: pre-wrap;
  line-height: 1.45;
}

.portal-identity-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin: 0.35rem 0 0.75rem;
  display: block;
}

.portal-logo-field > label {
  line-height: 1.4;
}

.portal-logo-upload {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 1.1rem 1rem;
  text-align: center;
  background: var(--bg-input);
}

.portal-logo-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.portal-logo-upload-btn:active {
  opacity: 0.85;
}

.label-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.portal-identity-link {
  display: block;
  margin-top: 0.35rem;
  color: var(--portal-gold);
  word-break: break-all;
  font-size: 0.9rem;
}

.portal-files-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-file-row {
  display: block;
  padding: 0.75rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.portal-file-thumb {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.portal-file-thumb img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.portal-home-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.05rem;
}

.portal-home-card--muted {
  opacity: 0.92;
}

.portal-home-card--project {
  padding: 0;
  overflow: visible;
}

.portal-home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-home-card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.portal-home-badge {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--portal-gold);
  background: var(--portal-gold-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  line-height: 1.3;
}

.portal-home-empty {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Main features checklist */
.portal-feature-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.portal-features-add-wrap {
  display: flex;
  justify-content: center;
  margin-top: 0.85rem;
}

.portal-features-add {
  min-width: 168px;
  max-width: 220px;
  width: auto;
  padding: 0.65rem 1.35rem;
  border-radius: 999px;
}

.portal-step-footer,
.portal-features-footer {
  position: static;
  margin: 0;
  z-index: auto;
}

.portal-step-footer .btn,
.portal-features-footer .btn {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
}

.portal-step-footer--split {
  display: flex;
  gap: 0.65rem;
}

.portal-step-footer--split .btn {
  flex: 1 1 0;
}

body.portal-body .btn-portal-green.btn--faded {
  opacity: 0.38;
  cursor: pointer;
  filter: grayscale(0.2);
}

body.portal-body .btn-portal-green:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.portal-dashboard-section {
  margin-bottom: 0.75rem;
}

.portal-dashboard-sections {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.portal-dashboard-new {
  margin-top: 0.5rem;
}

.portal-dashboard-new--top {
  margin: 0.85rem 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: 12px;
  padding: 0.95rem 1rem;
}

.portal-dashboard-new-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border: 2px solid currentColor;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
}

.portal-dashboard-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.portal-dashboard-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.portal-dashboard-panel-icon {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--portal-gold);
}

.portal-dashboard-panel-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.portal-dashboard-panel-title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
}

.portal-dashboard-panel-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-input);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  min-width: 1.25rem;
  text-align: center;
}

.portal-dashboard-panel-chevron {
  flex-shrink: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--text-muted);
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.portal-dashboard-panel--open .portal-dashboard-panel-chevron {
  transform: rotate(180deg);
}

.portal-dashboard-panel-body {
  padding: 0 0.65rem 0.65rem;
}

.portal-dashboard-panel-body .portal-project-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.portal-dashboard-empty {
  margin: 0;
  padding: 0.55rem 0.35rem 0.65rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.portal-dashboard-empty[data-nav] {
  cursor: pointer;
}

.portal-dashboard-empty[data-nav]:hover {
  color: var(--portal-gold);
}

.portal-dashboard-quotes-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--text);
}

.portal-dashboard-quotes-row:hover,
.portal-dashboard-quotes-row:focus {
  border-color: var(--portal-gold);
}

.portal-dashboard-quotes-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.portal-dashboard-quotes-sub {
  font-size: 0.92rem;
  font-weight: 600;
}

.portal-dashboard-quotes-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-dashboard-quotes-arrow {
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
}

.portal-dashboard-status-dot {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--text-muted);
}

.portal-dashboard-status-dot--active {
  background: var(--portal-gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 83, 0.25);
}

.portal-dashboard-process {
  margin-top: 1.75rem;
  padding-top: 0.25rem;
}

.portal-dashboard-process-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 600;
}

.portal-dashboard-steps {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
}

.portal-dashboard-step {
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 0;
}

.portal-dashboard-step-join {
  flex: 0 0 0.5rem;
  align-self: center;
  height: 1px;
  border-top: 1px dashed var(--border);
}

.portal-dashboard-step-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 0.55rem 0.3rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 0.72rem;
  line-height: 1.25;
  color: var(--text-muted);
}

.portal-dashboard-step-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.portal-dashboard-step-title {
  display: block;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  white-space: normal;
  word-break: break-word;
  hyphens: auto;
}

.portal-dashboard-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1px solid var(--portal-gold);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--portal-gold);
}

.portal-dashboard-step-icon {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  color: var(--portal-gold);
}

.portal-dashboard-step-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chat-subhead {
  flex-shrink: 0;
  padding: 0.35rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.chat-subhead h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.chat-subhead p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.portal-dashboard-more {
  margin-top: 0.65rem;
}

body.portal-body .btn-portal-green {
  background: linear-gradient(135deg, var(--portal-gold-hover), var(--portal-gold));
  color: var(--portal-gold-text);
}

body.portal-body .btn-portal-green:active {
  opacity: 0.9;
}

.portal-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
}

.portal-feature--done {
  border-color: rgba(212, 168, 83, 0.35);
  background: rgba(212, 168, 83, 0.08);
}

.portal-feature-check {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  margin-top: 0.05rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: transparent;
  line-height: 1;
}

.portal-feature--done .portal-feature-check {
  border-color: var(--portal-gold);
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
}

.portal-feature-title {
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
}

.portal-feature--done .portal-feature-title {
  color: var(--text-muted);
}

.portal-feature-notes {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.project-switcher-wrap {
  position: relative;
  width: 100%;
}

.project-switcher-wrap--card {
  max-width: none;
}

.project-switcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
  max-width: 100%;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.28rem;
  font-weight: 600;
  cursor: pointer;
}

.project-switcher--card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 1rem 1.05rem;
  text-align: left;
  gap: 0.65rem;
}

.project-switcher-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.project-switcher-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.project-switcher--card .project-switcher-name {
  font-size: 1.15rem;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-switcher--card .project-switcher-chevron {
  transform: rotate(90deg);
  flex-shrink: 0;
}

.project-switcher-name {
  margin-right: 0.15rem;
}

.project-switcher-chevron {
  display: inline-block;
  transform: rotate(90deg);
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1;
  margin-left: 0.1rem;
}

.project-switcher-wrap--card .project-switcher-menu {
  left: 0;
  right: 0;
  transform: none;
  min-width: 0;
}

.project-switcher-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: min(300px, 92vw);
  padding: 0.35rem 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  z-index: 50;
  max-height: 50vh;
  overflow-y: auto;
}

.project-switcher-menu.hidden {
  display: none;
}

.project-switcher-item {
  display: block;
  width: 100%;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
}

.project-switcher-item:hover,
.project-switcher-item:focus {
  background: var(--portal-gold-muted);
  outline: none;
}

.project-switcher-new {
  color: var(--portal-gold);
  font-weight: 600;
  border-top: 1px solid var(--border);
  margin-top: 0.25rem;
  padding-top: 0.85rem;
}

.portal-todo-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-home-card .portal-todo-list .portal-todo {
  background: var(--bg-input);
}

.portal-todo {
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.portal-todo--open {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.portal-todo--open:hover,
.portal-todo--open:focus {
  border-color: var(--portal-gold);
  outline: none;
}

.portal-todo-done {
  opacity: 0.85;
}

.portal-todo-hint {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.portal-todo-readonly-field {
  margin-bottom: 1rem;
}

.portal-todo-readonly-field label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.portal-todo-readonly-field p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.portal-todo-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.portal-todo-done .portal-todo-title,
.portal-todo--done .portal-todo-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.portal-todo-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  white-space: pre-wrap;
}

.portal-todo-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.portal-empty-active {
  text-align: center;
  padding: 1rem;
}

.portal-section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.5rem;
}

.portal-request-list-card {
  margin-bottom: 0.5rem;
}

.portal-request-details-block {
  margin: 1rem 0;
}

.portal-request-details-body {
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.portal-request-files {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}

.portal-request-thumb {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.portal-request-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portal-request-file-link {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--portal-gold);
  text-decoration: none;
}

.portal-request-card {
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.portal-request-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.portal-request-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.portal-request-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  white-space: nowrap;
}

.portal-request-status--pending {
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
}

.portal-request-status--accepted {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
}

.portal-request-status--rejected {
  background: rgba(156, 163, 175, 0.2);
  color: var(--text-muted);
}

.portal-request-date {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.portal-request-preview {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.portal-request-note {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  color: var(--portal-gold-hover);
}

.portal-add-task-wrap {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0;
}

.portal-add-task-btn {
  min-width: 200px;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 1rem;
}

/* Chat sits above bottom nav (Messages tab stays visible) */
body.portal-body #app:has(.chat-page) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  height: calc(100dvh - var(--nav-h, 64px) - env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - var(--nav-h, 64px) - env(safe-area-inset-bottom, 0px));
}

body.portal-body #app:has(.chat-page) .app-header {
  flex-shrink: 0;
}

body.portal-body .chat-page {
  flex: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  margin: 0;
}

body.portal-body .chat-composer {
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

/* Start new project form */
body.portal-body #app:has(.new-project-page) {
  padding-bottom: 0;
}

.new-project-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - 56px);
}

.new-project-scroll {
  flex: 1;
  padding-bottom: 1rem;
}

.new-project-intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem;
  line-height: 1.45;
}

.portal-details-textarea,
.new-project-details {
  min-height: 11rem;
  resize: vertical;
  line-height: 1.45;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.portal-task-form .file-picker {
  margin-top: 0.25rem;
}

.modal-sheet .portal-details-textarea {
  min-height: 9rem;
}

.modal-backdrop.modal-backdrop--confirm {
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 250;
}

.modal-sheet.modal-sheet--confirm {
  border-radius: 16px;
  max-width: min(360px, calc(100% - 2rem));
  padding: 1.35rem 1.15rem 1.15rem;
}

.modal-sheet--confirm h2 {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
}

.portal-confirm-message {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.portal-confirm-actions {
  display: flex;
  gap: 0.6rem;
}

.portal-confirm-actions .btn {
  flex: 1 1 0;
  margin: 0;
}

.portal-confirm-actions--single .btn {
  flex: 1 1 auto;
  width: 100%;
}

.label-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.file-picker {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 1.25rem 1rem;
  text-align: center;
  background: var(--bg-input);
  transition: border-color 0.15s, background 0.15s;
}

.file-picker--has-files {
  border-style: solid;
  text-align: left;
  padding-bottom: 0.75rem;
}

.file-picker-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 280px;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 999px;
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.file-picker-btn:active {
  opacity: 0.85;
}

.file-picker-hint {
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-picker-list {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.file-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
}

.file-picker-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.file-picker-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.new-project-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h, 64px) + env(safe-area-inset-bottom, 0px));
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 90;
  box-sizing: border-box;
}

.new-project-bar .btn {
  margin: 0;
}

.new-project-scroll.page-wrap {
  padding-bottom: calc(5.5rem + var(--nav-h, 64px));
}

/* Thank you screen */
.new-project-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  max-width: 400px;
  margin: 0 auto;
  min-height: calc(100dvh - var(--nav-h, 64px) - 120px);
  justify-content: center;
}

.new-project-thanks-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--portal-gold-muted);
  color: var(--portal-gold);
  margin-bottom: 1.25rem;
}

.new-project-thanks-text {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 2rem;
}

.new-project-thanks .btn-block {
  width: 100%;
  max-width: 320px;
}
