:root {
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --surface-0: #08111c;
  --surface-1: #0d1826;
  --surface-2: #121f30;
  --surface-3: #18273a;
  --text-1: #f2f5f7;
  --text-2: #aeb9c6;
  --text-3: #758397;
  --accent: #8aa9ff;
  --accent-soft: rgba(138, 169, 255, .13);
  --warm: #e8c578;
  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 18px;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

html { scroll-behavior: smooth; }
body, button, input, textarea, select { font-family: var(--ui-font) !important; }
body { color: var(--text-1); font-weight: 400; letter-spacing: 0; }
h1, h2, h3, h4, h5, h6,
.hero h1, .pricing h2, .workspace-head h2, .detail-panel h3,
.community-header h1, .workflow-shell > header h2, .context-card h2,
.space-principle strong, .focus-brief h3 {
  font-family: var(--ui-font) !important;
  font-style: normal !important;
  font-weight: 560 !important;
  letter-spacing: -.025em !important;
}
strong, b, .primary, .ghost, .danger, .text-button { font-weight: 560 !important; }
p, li, label, input, textarea, select, button { line-height: 1.5; }
.eyebrow { font-weight: 580 !important; letter-spacing: .13em; }

.hero h1 { max-width: 820px; font-size: clamp(42px, 5vw, 68px); line-height: 1.05; text-wrap: balance; }
.hero h1 em { font-weight: 500 !important; }
.workspace-head h2 { font-size: clamp(28px, 2.7vw, 38px); line-height: 1.12; }
.detail-panel h3 { font-size: clamp(28px, 2.5vw, 40px); line-height: 1.12; }
.primary, .ghost, .danger, .icon-btn, .language-select, input, textarea, select {
  border-radius: var(--radius-sm);
}
.primary, .ghost, .danger { min-height: 42px; padding: 9px 15px; }
.workspace-actions { align-items: center; gap: 10px; }
.workspace-actions .search { min-width: min(300px, 32vw); }
.prototype-banner { gap: 7px 9px; line-height: 1.55; }
.prototype-banner strong, .prototype-banner span { display: inline; }
.detail-content, #detailContent { overflow-wrap: anywhere; }
.detail-actions, .connection-head, .assistant-head { gap: 10px; }
.connection-item strong, .suggestion strong { display: block; margin-bottom: 4px; }
.feedback-fab { font-weight: 540 !important; }

.screen.active > *, .screen.active .workspace-shell {
  animation: asteria-enter .44s var(--ease-out) both;
}
.map-node { opacity: 0; animation: asteria-node-in .42s var(--ease-out) forwards; transition: border-color .18s, background .18s, box-shadow .18s, filter .18s; }
.map-node:nth-child(2n) { animation-delay: .06s; }
.map-node:nth-child(3n) { animation-delay: .12s; }
.map-node:hover, .map-node:focus-visible { box-shadow: 0 14px 42px rgba(0, 0, 0, .32), 0 0 0 4px rgba(138,169,255,.08); filter: brightness(1.12); }
.primary, .ghost, .danger, .rail-btn, .space-filter, .social-tab, .social-action, .follow-button {
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s, transform .18s var(--ease-out);
}
.primary:hover:not(:disabled), .ghost:hover:not(:disabled), .danger:hover:not(:disabled), .social-action:hover:not(:disabled), .follow-button:hover:not(:disabled) { transform: translateY(-1px); }
dialog[open] { animation: asteria-dialog-in .26s var(--ease-out) both; }
dialog[open]::backdrop { animation: asteria-backdrop-in .22s ease-out both; }
.toast.show, #advancedToast.show { animation: asteria-toast-in .28s var(--ease-out) both; }

/* Asteria Space v1.5 */
.community-screen { background: var(--surface-0); }
.community-shell { width: min(1440px, 100%); padding: 30px clamp(16px, 3.4vw, 48px) 100px; }
.space-app-head { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 0 0 24px; border-bottom: 1px solid var(--line); }
.space-app-head h1 { margin: 2px 0 5px; font-size: clamp(28px, 3.3vw, 42px); line-height: 1.08; text-wrap: balance; }
.space-app-head p:not(.eyebrow) { max-width: 720px; margin: 0; color: var(--text-2); }
.space-app-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.social-layout { display: grid; grid-template-columns: 210px minmax(0, 690px) minmax(230px, 1fr); gap: 26px; align-items: start; margin-top: 24px; }
.social-tabs { position: sticky; top: 92px; display: grid; gap: 5px; }
.social-tab { width: 100%; min-height: 44px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; padding: 9px 11px; background: transparent; color: var(--text-2); text-align: left; }
.social-tab:hover { color: var(--text-1); background: rgba(255,255,255,.035); }
.social-tab.active { color: var(--text-1); border-color: rgba(138,169,255,.18); background: var(--accent-soft); }
.social-tab-icon { color: var(--accent); font-size: 17px; line-height: 1; text-align: center; }
.social-tab-count { min-width: 22px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--text-3); font-size: 10px; text-align: center; }
.social-main { min-width: 0; }
.social-profile-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; margin-bottom: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(20,34,52,.9), rgba(10,20,32,.9)); }
.social-profile-copy { min-width: 0; }
.social-profile-copy h2 { margin: 0 0 2px; font-size: 19px; }
.social-profile-copy > span, .social-profile-copy p { color: var(--text-2); }
.social-profile-copy p { margin: 7px 0 0; font-size: 12px; }
.social-stats { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 10px; }
.social-stat { display: grid; gap: 0; }
.social-stat strong { font-size: 14px; }
.social-stat span { color: var(--text-3); font-size: 10px; }
.avatar { position: relative; width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 50%; background: linear-gradient(145deg, #284267, #172638); color: #d9e4ff; font-size: 14px; font-weight: 580; }
.avatar.large { width: 72px; height: 72px; font-size: 19px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-edit-button { align-self: start; white-space: nowrap; }
.social-feed-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 4px; padding: 10px 2px; }
.social-feed-toolbar > div { display: grid; }
.social-feed-toolbar small { color: var(--text-3); }
.social-feed-toolbar select { min-width: 130px; }
.community-feed { display: grid; gap: 12px; }
.social-post { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(13,24,38,.78); animation: asteria-card-in .36s var(--ease-out) both; }
.social-post:nth-child(2) { animation-delay: .04s; }
.social-post:nth-child(3) { animation-delay: .08s; }
.social-post-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.social-author { display: flex; gap: 11px; align-items: center; min-width: 0; }
.social-author-copy { min-width: 0; display: grid; }
.social-author-copy > div { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.social-author-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-author-copy span, .social-author-copy time { color: var(--text-3); font-size: 11px; }
.follow-button { min-height: 34px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; background: transparent; color: var(--text-2); }
.follow-button[aria-pressed="true"] { border-color: rgba(138,169,255,.3); background: var(--accent-soft); color: var(--text-1); }
.social-post .status-pill { display: inline-flex; align-items: center; min-height: 28px; border-radius: 999px; padding: 4px 9px; background: rgba(255,255,255,.045); color: var(--text-3); font-size: 10px; }
.social-post-body { margin: 14px 0 12px; color: var(--text-1); font-size: 16px; line-height: 1.58; white-space: pre-wrap; overflow-wrap: anywhere; }
.social-post-topic { display: inline-flex; margin-bottom: 12px; padding: 5px 8px; border-radius: 999px; background: rgba(138,169,255,.09); color: #afc2ff; font-size: 10px; }
.social-media { position: relative; overflow: hidden; margin: 4px 0 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: #050b12; }
.social-media img, .social-media video { display: block; width: 100%; max-height: 560px; object-fit: contain; background: #050b12; }
.social-media-note { display: block; padding: 8px 11px; color: var(--text-3); font-size: 10px; }
.social-post-counts { display: flex; gap: 16px; padding: 8px 1px 10px; border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 11px; }
.social-actions { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; padding-top: 9px; }
.social-action { min-width: 0; min-height: 38px; display: inline-flex; justify-content: center; align-items: center; gap: 5px; border: 0; border-radius: 8px; padding: 7px 5px; background: transparent; color: var(--text-2); font-size: 11px; }
.social-action:hover, .social-action[aria-pressed="true"] { color: var(--text-1); background: rgba(255,255,255,.045); }
.social-action[aria-pressed="true"] .social-action-icon { color: #ff8c91; }
.social-action-icon { color: var(--accent); font-size: 15px; line-height: 1; }
.comment-list { display: grid; gap: 10px; margin-top: 11px; padding-top: 12px; border-top: 1px solid var(--line); }
.comment { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 9px; }
.comment .avatar { width: 34px; height: 34px; font-size: 10px; }
.comment-body { min-width: 0; padding: 9px 11px; border-radius: 10px; background: rgba(255,255,255,.035); }
.comment-body header { display: flex; flex-wrap: wrap; gap: 5px; }
.comment-body header span { color: var(--text-3); font-size: 10px; }
.comment-body p { margin: 3px 0 0; color: var(--text-2); font-size: 12px; overflow-wrap: anywhere; }
.comment-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin-top: 10px; }
.comment-form input { min-width: 0; }
.social-aside { position: sticky; top: 92px; display: grid; gap: 12px; }
.social-side-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(13,24,38,.64); }
.social-side-card h2 { margin: 0 0 8px; font-size: 15px; }
.social-side-card p, .social-side-card li { color: var(--text-2); font-size: 11px; }
.social-side-card ul { display: grid; gap: 7px; margin: 0; padding-left: 18px; }
.social-suggestion { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.social-suggestion:first-of-type { border-top: 0; }
.social-suggestion-copy { min-width: 0; display: grid; }
.social-suggestion-copy span { color: var(--text-3); font-size: 10px; }
.upload-preview { display: grid; grid-template-columns: 84px minmax(0,1fr) auto; gap: 11px; align-items: center; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.upload-preview img, .upload-preview video { width: 84px; height: 64px; border-radius: 7px; object-fit: cover; background: #050b12; }
.upload-preview-copy { min-width: 0; display: grid; }
.upload-preview-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); }
.social-dialog { width: min(650px, calc(100% - 24px)); max-height: min(820px, calc(100dvh - 24px)); overflow: auto; }
.social-dialog form { display: grid; gap: 14px; padding: clamp(20px, 4vw, 34px); }
.social-dialog header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.social-dialog h2 { margin: 0; font-size: 25px; }
.social-dialog label { display: grid; gap: 6px; }
.social-dialog footer { display: flex; justify-content: flex-end; gap: 8px; }
.file-button { position: relative; display: inline-flex !important; align-items: center; justify-content: center; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; color: var(--text-2); cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.social-empty { padding: 44px 20px; border: 1px dashed var(--line); border-radius: var(--radius-md); text-align: center; color: var(--text-2); }

@keyframes asteria-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes asteria-card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes asteria-node-in { from { opacity: 0; filter: blur(3px); } to { opacity: 1; filter: none; } }
@keyframes asteria-dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes asteria-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes asteria-toast-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1120px) {
  .social-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .social-aside { grid-column: 2; position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .workspace-actions { align-items: stretch; }
  .workspace-actions .search { min-width: 0; }
  .space-app-head { display: grid; }
  .space-app-actions { flex-wrap: wrap; }
  .social-layout { grid-template-columns: minmax(0,1fr); }
  .social-tabs { position: static; grid-auto-flow: column; grid-auto-columns: minmax(112px, 1fr); overflow-x: auto; padding-bottom: 7px; }
  .social-tab { grid-template-columns: 21px auto; justify-content: start; }
  .social-tab-count { display: none; }
  .social-aside { grid-column: 1; grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 42px; }
  .community-shell { padding-inline: 12px; }
  .space-app-actions { display: grid; grid-template-columns: 1fr; }
  .space-app-actions button { width: 100%; }
  .social-profile-card { grid-template-columns: auto minmax(0,1fr); padding: 14px; }
  .profile-edit-button { grid-column: 1 / -1; width: 100%; }
  .social-aside { grid-template-columns: 1fr; }
  .social-post { padding: 14px; border-radius: 13px; }
  .social-actions { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .social-action { justify-content: flex-start; }
  .comment-form { grid-template-columns: minmax(0,1fr); }
  .comment-form button { width: 100%; }
  .social-dialog footer { display: grid; grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
