:root {
  --bg: #09111d;
  --panel: #101b2a;
  --panel-2: #162337;
  --ink: #f2efe8;
  --muted: #aab4c3;
  --line: rgba(231, 235, 241, .14);
  --cyan: #86a8ff;
  --violet: #b9a8ff;
  --lime: #b7d98c;
  --rose: #ff806b;
  --amber: #eec879;
  --paper: #f2efe8;
  --paper-ink: #172033;
}

body {
  background: var(--bg);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: .002em;
}

h1, h2, .focus-brief h3, .community-post blockquote {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

.topbar {
  min-height: 70px;
  background: rgba(9, 17, 29, .96);
  backdrop-filter: none;
}

.orbit { border-radius: 50%; box-shadow: none; }
.top-link-button { border: 0; padding: 6px; background: transparent; }
.primary, .ghost, .danger, .icon-btn, .language-select, input, textarea, select { border-radius: 7px; }
.primary { background: #86a8ff; border-color: #86a8ff; color: #0b1421; }
.primary:hover:not(:disabled) { background: #a4bbff; border-color: #a4bbff; }
.ghost:hover:not(:disabled) { background: rgba(242, 239, 232, .06); border-color: rgba(242, 239, 232, .26); }
.eyebrow { color: var(--amber); letter-spacing: .2em; }
.hero h1 { font-weight: 500; letter-spacing: -.055em; }
.hero h1 em { color: #9db5ff; font-style: italic; }
.product-note { max-width: 560px; margin: 28px 0 0; padding-left: 18px; border-left: 2px solid var(--rose); color: var(--muted); }
.hero-visual, .plan, .loop article, .detail-panel, .canvas-panel { box-shadow: none; }
.hero-visual { border-radius: 2px; }
.sample-node { border-radius: 4px; }
.public-plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 960px; margin-inline: auto; }
.public-plan-grid .plan { min-height: 360px; }

.feedback-fab {
  position: fixed;
  right: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 64;
  border: 1px solid rgba(242, 239, 232, .24);
  border-radius: 999px;
  padding: 10px 15px;
  background: var(--paper);
  color: var(--paper-ink);
  font-weight: 750;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25);
}

.community-screen { min-height: calc(100vh - 70px); }
.community-shell { width: min(1500px, 100%); margin: 0 auto; padding: clamp(34px, 5vw, 76px) clamp(18px, 4vw, 58px) 110px; }
.community-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.community-header h1 { max-width: 820px; margin: 0; font-size: clamp(42px, 6vw, 82px); line-height: .98; font-weight: 500; letter-spacing: -.045em; }
.community-header p:not(.eyebrow) { max-width: 680px; margin: 20px 0 0; color: var(--muted); font-size: 17px; }
.community-header-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.community-grid { display: grid; grid-template-columns: 190px minmax(0, 720px) minmax(230px, 1fr); align-items: start; gap: 28px; margin-top: 32px; }
.space-sidebar { position: sticky; top: 102px; display: grid; gap: 6px; }
.space-filter { width: 100%; border: 0; border-left: 2px solid transparent; padding: 10px 12px; background: none; text-align: left; color: var(--muted); }
.space-filter.active { border-left-color: var(--amber); color: var(--ink); background: rgba(238, 200, 121, .06); }
.space-principle { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.space-principle strong { font-family: "Iowan Old Style", Georgia, serif; font-size: 19px; }
.space-principle p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.feed-column { min-width: 0; }
.feed-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 10px; }
.feed-toolbar > div { display: grid; }
.feed-toolbar span { color: var(--muted); font-size: 11px; }
.community-feed { display: grid; }
.community-post { padding: 26px 4px 24px; border-top: 1px solid var(--line); }
.community-post:last-child { border-bottom: 1px solid var(--line); }
.post-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.post-author { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--amber); font-weight: 850; }
.post-author div { display: grid; }
.post-author span, .post-time { color: var(--muted); font-size: 11px; }
.post-type { color: var(--amber); font-size: 10px; text-transform: uppercase; letter-spacing: .14em; }
.community-post blockquote { margin: 18px 0 14px; padding: 0; border: 0; font-size: 23px; line-height: 1.35; }
.post-spark { display: inline-flex; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: #b7c8f9; font-size: 11px; }
.post-actions { display: flex; gap: 4px; margin-top: 18px; }
.post-actions button { border: 0; padding: 7px 10px; background: none; color: var(--muted); }
.post-actions button:hover, .post-actions button[aria-pressed="true"] { color: var(--ink); background: rgba(242, 239, 232, .05); }
.space-context { display: grid; gap: 14px; }
.context-card { padding: 22px; border: 1px solid var(--line); background: rgba(16, 27, 42, .72); }
.context-card h2 { margin: 12px 0 8px; font: 500 24px/1.1 "Iowan Old Style", Georgia, serif; }
.context-card p, .context-card li { color: var(--muted); font-size: 12px; }
.context-card ul { padding-left: 18px; }
.section-number { color: var(--amber); font-size: 10px; letter-spacing: .18em; }

.workflow-dialog { width: min(1180px, calc(100% - 28px)); max-width: none; overflow-x: hidden; }
.workflow-dialog::backdrop, .composer-dialog::backdrop, .feedback-dialog::backdrop { background: rgba(2, 8, 16, .82); }
.workflow-shell { width: 100%; min-width: 0; padding: clamp(20px, 4vw, 44px); }
.workflow-shell > header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.workflow-shell > header h2 { margin: 0; font: 500 clamp(34px, 5vw, 58px)/1 "Iowan Old Style", Georgia, serif; }
.workflow-shell > header p:not(.eyebrow) { max-width: 680px; color: var(--muted); }
.workflow-grid { min-width: 0; display: grid; grid-template-columns: minmax(270px, .72fr) minmax(0, 1.28fr); border-top: 1px solid var(--line); }
.workflow-grid > * { width: 100%; min-width: 0 !important; max-width: 100%; }
.workflow-controls input, .workflow-controls select { width: 100%; min-width: 0 !important; max-width: 100%; }
.workflow-controls { padding: 26px 28px 0 0; border-right: 1px solid var(--line); display: grid; align-content: start; gap: 14px; }
.workflow-controls label:not(.check-row) { display: grid; gap: 6px; }
.workflow-controls fieldset { border: 1px solid var(--line); padding: 14px; }
.workflow-controls legend { padding: 0 8px; color: var(--muted); font-size: 11px; }
.check-row { display: flex; align-items: flex-start; gap: 9px; margin: 7px 0; }
.check-row input { width: auto; margin-top: 5px; }
.workflow-output { min-height: 540px; padding: 26px 0 0 30px; }
.workflow-empty { min-height: 440px; display: grid; place-items: center; align-content: center; text-align: center; color: var(--muted); }
.workflow-empty > span { color: var(--amber); font-size: 48px; }
.workflow-empty h3 { margin-bottom: 0; color: var(--ink); }
.workflow-empty p { max-width: 470px; }
.focus-brief { padding: 22px; background: var(--paper); color: var(--paper-ink); }
.focus-brief span { font-size: 10px; text-transform: uppercase; letter-spacing: .18em; }
.focus-brief h3 { margin: 8px 0; font-size: 31px; line-height: 1.1; }
.focus-brief p { margin: 0; color: #4d5668; }
.roadmap-list { display: grid; gap: 8px; margin: 20px 0; }
.roadmap-item { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.roadmap-item > span { color: var(--amber); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; }
.roadmap-item strong { display: block; }
.roadmap-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.schedule-board { display: grid; grid-template-columns: repeat(7, minmax(90px, 1fr)); gap: 5px; overflow-x: auto; padding-bottom: 10px; }
.schedule-day { min-width: 96px; padding: 10px; border: 1px solid var(--line); }
.schedule-day > strong { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.schedule-day p { margin: 8px 0 0; font-size: 11px; line-height: 1.45; }
.workflow-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.composer-dialog, .feedback-dialog { width: min(650px, calc(100% - 28px)); }
.composer-dialog form, .feedback-dialog form { padding: clamp(22px, 4vw, 38px); }
.composer-dialog label, .feedback-dialog label { display: grid; gap: 6px; }
.composer-dialog small { justify-self: end; color: var(--muted); }
.feed-empty { padding: 50px 20px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }

@media (max-width: 1180px) {
  .community-grid { grid-template-columns: 160px minmax(0, 1fr); }
  .space-context { grid-column: 2; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .top-actions .top-link-button, .top-actions .top-link { display: none; }
  .public-plan-grid { grid-template-columns: 1fr; }
  .community-header { display: grid; align-items: start; }
  .community-header-actions { flex-wrap: wrap; }
  .community-grid { grid-template-columns: 1fr; }
  .space-sidebar { position: static; display: flex; overflow-x: auto; padding-bottom: 8px; }
  .space-filter { width: auto; flex: 0 0 auto; border-left: 0; border-bottom: 2px solid transparent; }
  .space-filter.active { border-bottom-color: var(--amber); }
  .space-principle { display: none; }
  .space-context { grid-column: 1; grid-template-columns: 1fr; }
  .workflow-grid { grid-template-columns: minmax(0, 1fr); }
  .workflow-controls { padding-right: 0; padding-bottom: 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .workflow-output { padding-left: 0; min-height: 420px; }
}

@media (max-width: 520px) {
  .community-shell { padding-inline: 16px; }
  .community-header h1 { font-size: 44px; }
  .community-header-actions { display: grid; grid-template-columns: 1fr; }
  .community-header-actions button { width: 100%; }
  .community-post blockquote { font-size: 20px; }
  .feedback-fab { right: 12px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .schedule-board { grid-template-columns: repeat(7, 104px); }
  .workflow-actions { display: grid; grid-template-columns: 1fr; }
}

@media print {
  .feedback-fab, .topbar, .rail { display: none !important; }
}
