/* NewSpace site chrome: the 2006 look, rebuilt to work on phones. */
:root {
  --ns-blue: #003399;
  --ns-nav: #6699cc;
  --ns-light: #e6eef8;
  --ns-orange: #ff6600;
  --ns-peach: #ffcc99;
  --ns-text: #222;
  --ns-muted: #666;
  --ns-bg: #e5e5e5;
  --ns-white: #fff;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
.site-page {
  background: var(--ns-bg);
  color: var(--ns-text);
  font: 13px/1.45 Verdana, Geneva, sans-serif;
}
a { color: var(--ns-blue); }
img { max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ns-muted); }
.small { font-size: 11px; }
.nowrap { white-space: nowrap; }

/* ---------- top bar (shared by every page, including profiles) ---------- */
.sitebar { background: #fff; font: 12px/1.4 Verdana, Geneva, sans-serif; color: #222; border-bottom: 1px solid #c9d6e8; position: relative; z-index: 20; }
body .sitebar a { color: var(--ns-blue); }
body .sitebar .sitebar-nav a { color: #fff; }
body .sitebar .logo-new { color: #003399; }
body .sitebar .logo-space { color: #6699cc; }
.sitebar-top { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { text-decoration: none; font: bold 28px/1 Arial, Helvetica, sans-serif; letter-spacing: -1px; }
.logo-new { color: #003399; }
.logo-space { color: #6699cc; }
.logo-dot { color: var(--ns-orange); }
.tagline { color: #888; font-size: 11px; font-style: italic; }
.sitebar-search { display: flex; gap: 4px; margin-left: auto; }
.sitebar-search input { width: 180px; padding: 4px 6px; border: 1px solid #7f9db9; font: inherit; }
.sitebar-search button, .btn {
  font: bold 12px Verdana, sans-serif; padding: 5px 12px; border: 1px solid #2f5f9a; border-radius: 3px;
  background: linear-gradient(#7fa7d8, #3a6ea5); color: #fff; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover, .sitebar-search button:hover { background: linear-gradient(#93b6e2, #4a7fb8); }
.btn-big { font-size: 14px; padding: 8px 18px; }
.btn-small { font-size: 11px; padding: 3px 8px; }
.btn-ghost { background: #fff; color: var(--ns-blue); border-color: #9bb4d4; }
.btn-ghost:hover { background: var(--ns-light); }
.btn-danger { background: linear-gradient(#e57373, #b71c1c); border-color: #8e1b1b; }
.sitebar-account { font-size: 11px; }
.inline-form { display: inline; margin: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--ns-blue); text-decoration: underline; cursor: pointer; font: inherit; }
.sitebar-nav { background: var(--ns-nav); padding: 0 16px; display: flex; justify-content: center; flex-wrap: wrap; }
.sitebar-nav a { color: #fff; font-weight: bold; text-decoration: none; padding: 6px 10px; font-size: 12px; }
.sitebar-nav a + a { border-left: 1px solid rgba(255, 255, 255, .45); }
.sitebar-nav a:hover { text-decoration: underline; }

/* ---------- regular pages ---------- */
.site-main { max-width: 980px; margin: 0 auto; padding: 16px; }
.box { background: #fff; border: 1px solid #6699cc; margin-bottom: 16px; padding: 0 12px 12px; }
.box.narrow { max-width: 460px; margin-left: auto; margin-right: auto; }
.box-head { margin: 0 -12px 12px; padding: 5px 12px; background: var(--ns-nav); color: #fff; font-size: 14px; }
.box-head.alt { background: var(--ns-peach); color: var(--ns-orange); }
.box-head a { color: inherit; }
.box-head .muted { color: inherit; opacity: .8; font-weight: normal; }
.stack { display: grid; gap: 10px; }
.stack label { display: grid; gap: 3px; font-weight: bold; font-size: 12px; }
input, select, textarea { font: 13px Verdana, sans-serif; padding: 5px 6px; border: 1px solid #7f9db9; background: #fff; color: #222; max-width: 100%; }
textarea { width: 100%; resize: vertical; }
.row-form { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.row-form input { flex: 1 1 220px; }
.tiny-input { width: 64px; }
.tiny-input.wide { width: 120px; }
.flash { padding: 8px 12px; border: 1px solid; margin: 0 0 12px; }
.flash-ok { background: #eef8e6; border-color: #8bc34a; color: #2e5e0f; }
.flash-error { background: #fdecea; border-color: #e57373; color: #8e1b1b; }
.code-input { text-transform: uppercase; letter-spacing: 2px; font-family: "Courier New", monospace; }

.home-grid, .dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-bottom: 16px; }
.home-grid .box, .dash-grid .box { margin: 0; }
.hero { padding: 20px 24px; }
.hero h1 { font: bold 28px/1.15 Arial, sans-serif; color: var(--ns-blue); margin: 0 0 10px; }
.hero h1 span { color: var(--ns-orange); display: block; }
.hero p { font-size: 14px; }
.hero-points { padding-left: 18px; }
.hero-points li { margin: 4px 0; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.person { text-align: center; text-decoration: none; display: grid; justify-items: center; gap: 3px; font-size: 11px; }
.person img { width: 90px; height: 90px; object-fit: cover; border: 1px solid #ccc; background: #f3f3f3; }
.person-name { font-weight: bold; word-break: break-word; }
.person-online { color: #2e7d32; font-size: 10px; font-weight: bold; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2ecc40; box-shadow: 0 0 4px #2ecc40; vertical-align: middle; }
.pager { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }

.theme-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme-chip { font-size: 12px; }
.theme-chip-art { height: 70px; background: var(--sw-bg); border: 1px solid #bbb; padding: 8px; display: grid; grid-template-columns: 1fr 2fr; gap: 6px; margin-bottom: 4px; }
.theme-chip-art i { background: var(--sw-box); border-top: 8px solid var(--sw-text); border-image: linear-gradient(var(--sw-head), var(--sw-head)) 1; }

.dash-hello { font-size: 20px; color: var(--ns-blue); margin: 12px 0; }
.dash-me-row { display: flex; gap: 14px; }
.dash-me-row > div { display: grid; gap: 4px; align-content: start; }
.dash-avatar { width: 110px; height: 110px; object-fit: cover; border: 1px solid #ccc; }
.dash-url { margin-top: 12px; padding-top: 8px; border-top: 1px dashed #ccc; font-size: 12px; }
.alerts { padding-left: 18px; }
.alert-hot a { color: #d50000; font-weight: bold; }
.small-head { font-size: 12px; color: var(--ns-orange); margin: 12px 0 6px; }
.mini-comments { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 12px; }
.mini-comments .rich img { max-height: 40px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { border-bottom: 1px solid #e3e3e3; padding: 6px; text-align: left; vertical-align: middle; }
.data-table th { background: var(--ns-light); }
.invite-code { font-size: 14px; letter-spacing: 1px; background: #fff7d6; padding: 2px 6px; border: 1px dashed #d4b106; }

.request-list, .friend-manage { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.request-list li, .friend-manage li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.request-who, .friend-manage a { display: flex; align-items: center; gap: 8px; font-weight: bold; }
.request-list img, .friend-manage img { width: 40px; height: 40px; object-fit: cover; border: 1px solid #ccc; }
.top-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; align-items: center; }
.top-picker label { display: flex; gap: 6px; align-items: center; }
.top-picker select { flex: 1; }
.top-num { font-weight: bold; color: var(--ns-orange); width: 30px; }
.top-picker button { grid-column: 1 / -1; justify-self: start; }

.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 10px; line-height: 16px; text-align: center; margin-left: 2px; }
body .sitebar .sitebar-nav a.has-unread { background: rgba(255, 255, 255, .15); }
.notify-purpose { background: #fff8e1; border: 1px solid #ffd54f; padding: 8px 12px; font-size: 12px; }
.notify-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.notify-item { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid #eee; }
.notify-item.is-new { background: #eef4fc; }
.notify-who img { width: 48px; height: 48px; object-fit: cover; border: 1px solid #ccc; display: block; }
.notify-body { min-width: 0; }
.notify-new { background: #ff6600; color: #fff; font-size: 9px; font-weight: bold; padding: 1px 4px; margin-right: 4px; vertical-align: middle; }
.notify-clear { margin-top: 12px; }
.nav-badge[hidden] { display: none; }
.notify-star { margin-right: 3px; }

/* ---------- story rings (Instagram-style) ---------- */
.avatar-wrap { display: inline-block; line-height: 0; border-radius: 4px; }
.avatar-wrap.story-ring { padding: 3px; border-radius: 10px; background: conic-gradient(#feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75); animation: ns-ring 3s linear infinite; }
.avatar-wrap.story-ring img { border: 2px solid #fff; border-radius: 7px; }
@keyframes ns-ring { to { filter: hue-rotate(360deg); } }
.person-fresh { font-size: 9px; font-weight: bold; color: #d62976; }
.story-strip { display: flex; gap: 14px; overflow-x: auto; padding: 10px 12px; margin-bottom: 16px; background: #fff; border: 1px solid #6699cc; }
.story { display: grid; justify-items: center; gap: 4px; text-decoration: none; font-size: 11px; flex: none; width: 74px; text-align: center; }
.story img { width: 62px; height: 62px; object-fit: cover; }
.story .story-ring { border-radius: 50%; }
.story .story-ring img { border-radius: 50%; }
.story-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }

/* ---------- banners, insights, completeness ---------- */
.app-banners { display: grid; gap: 8px; margin-bottom: 16px; }
.app-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 14px; background: linear-gradient(90deg, #fff3e0, #fde7f3); border: 1px solid #ffb74d; font-size: 13px; }
.app-banner[hidden] { display: none; }
.insight-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.insight { background: #f2f6fc; border: 1px solid #c9d6e8; padding: 8px; display: grid; gap: 2px; text-align: center; }
.insight b { font-size: 22px; color: var(--ns-blue); }
.insight span { font-size: 11px; color: #555; }
.insight em { font-style: normal; font-size: 11px; font-weight: bold; }
.insight em.up { color: #2e7d32; }
.insight em.down { color: #c62828; }
.insight-row.compact b { font-size: 18px; }
.complete { margin-top: 12px; display: grid; gap: 4px; }
.complete-label { font-size: 12px; }
.complete-bar { height: 10px; background: #e3e9f2; border-radius: 5px; overflow: hidden; }
.complete-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff6600, #ffb300); }
.memories { margin: 0; padding-left: 18px; font-size: 12px; }

/* ---------- feed ---------- */
.feed-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
.feed-layout .box { margin-bottom: 16px; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eee; }
.feed-item img { width: 52px; height: 52px; object-fit: cover; border: 1px solid #ccc; }
.feed-item > .avatar-wrap { align-self: flex-start; flex: none; }
.feed-body { min-width: 0; display: grid; gap: 4px; }
.feed-changes { display: flex; flex-wrap: wrap; gap: 4px; }
.feed-chip { background: #eef4fc; border: 1px solid #c9d6e8; border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.feed-cta { font-size: 12px; font-weight: bold; }
.feed-title { font-weight: bold; }
.feed-more { text-align: center; padding: 14px; }
.live-bar { position: sticky; top: 8px; z-index: 5; text-align: center; margin-bottom: 8px; }
.live-bar[hidden] { display: none; }
.live-bar .btn { border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 51, 153, .35); animation: ns-pop .3s ease-out; }
@keyframes ns-pop { from { transform: translateY(-10px); opacity: 0; } }
.suggest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.suggest-list li { display: flex; gap: 8px; align-items: flex-start; }
.suggest-list img { width: 48px; height: 48px; object-fit: cover; border: 1px solid #ccc; }
.suggest-info { display: grid; gap: 3px; }

/* ---------- friend groups ---------- */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.group-chip { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid #c9d6e8; border-left: 6px solid var(--gc); background: #fff; text-decoration: none; color: #222; }
.group-chip:hover { background: #f5f8fd; }
.group-emoji, .group-hero-emoji { font-size: 22px; }
.group-faces { display: flex; align-items: center; }
.group-faces img { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; background: #eee; }
.group-faces img:first-child { margin-left: 0; }
.group-count { margin-left: 8px; font-size: 11px; color: #666; }
.gp-pick { display: grid; gap: 4px; font-weight: bold; font-size: 12px; }
.gp-choices { display: flex; flex-wrap: wrap; gap: 4px; }
.gp-choice input { position: absolute; opacity: 0; pointer-events: none; }
.gp-choice span { display: grid; place-items: center; width: 34px; height: 34px; border: 2px solid #ddd; border-radius: 8px; font-size: 18px; cursor: pointer; background: #fff; }
.gp-choice input:checked + span { border-color: #ff6600; box-shadow: 0 0 0 2px #ffcc99; }
.gp-choice input:focus-visible + span { outline: 2px solid #003399; }
.gp-color span { border-radius: 50%; width: 28px; height: 28px; }
.group-hero { border-top: 6px solid var(--gc); padding-top: 12px; }
.group-hero-top { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.group-hero-emoji { font-size: 44px; line-height: 1; }
.group-title { margin: 0; font-size: 24px; color: var(--gc); }
.group-role { font-size: 10px; color: #b8860b; font-weight: bold; }
.group-leave { display: inline-block; margin-top: 10px; }
.member-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; margin-bottom: 10px; }
.member-pick { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #e1e1e1; cursor: pointer; }
.member-pick:has(input:checked) { background: #eef4fc; border-color: #6699cc; }
.member-pick img { width: 36px; height: 36px; object-fit: cover; }
.pending-tag { font-size: 10px; color: #8a6d00; font-style: normal; }
.joined-tag { font-size: 10px; color: #2e7d32; font-style: normal; font-weight: bold; }
.group-invite { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 14px; margin-bottom: 12px; background: #fff; border: 1px solid #c9d6e8; border-left: 6px solid var(--gc); }
.group-invite-actions { display: flex; gap: 6px; }
.invited-tag {font-size: 10px; color: #ff6600; font-style: normal; font-weight: bold; }
.group-settings { margin-top: 14px; }
.group-settings summary { cursor: pointer; font-weight: bold; font-size: 12px; }
.group-delete { margin-top: 10px; }
.group-locked { background: #f2f2f2; border: 1px dashed #aaa; padding: 14px; text-align: center; }
.group-compose { display: grid; gap: 6px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #eee; }
.group-compose-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.group-compose label.btn { cursor: pointer; }
.group-post-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.group-post-img { max-width: 100%; max-height: 420px; border: 1px solid #ddd; margin-top: 4px; }

.site-foot {text-align: center; font-size: 11px; color: #666; padding: 20px 16px 30px; }
.site-foot div { margin-top: 6px; }

@media (max-width: 760px) {
  .home-grid, .dash-grid, .feed-layout { grid-template-columns: 1fr; }
  .insight-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sitebar-search { margin-left: 0; width: 100%; }
  .sitebar-search input { flex: 1; width: auto; }
  .hero h1 { font-size: 22px; }
  .data-table { display: block; overflow-x: auto; }
}
