  :root {
     --bg: #020617;               /* near black */
     --bg-alt: #020617;
     --panel: #030712;
     --card: #020617;
     --border-subtle: #1f2937;
     --accent: #0ea5e9;           /* azure */
     --accent-soft: rgba(14, 165, 233, 0.14);
     --accent-strong: rgba(14, 165, 233, 0.4);
     --text-main: #e5e7eb;        /* light grey */
     --text-muted: #9ca3af;       /* mid grey */
     --radius-lg: 14px;
     --radius-md: 10px;
     --radius-pill: 999px;
     --shadow-soft: 0 16px 36px rgba(0, 0, 0, 0.8);
   }

   * {
     box-sizing: border-box;
   }

   body {
     margin: 0;
     font-family: system-ui, -apple-system, BlinkMacSystemFont,
       "Segoe UI", sans-serif;
     background:
       radial-gradient(circle at top, #0b1120 0, #020617 55%, #000000 100%);
     color: var(--text-main);
   }

   .page {
     min-height: 100vh;
     display: flex;
     flex-direction: column;
   }

   /* HEADER */

   .top-bar {
     position: sticky;
     top: 0;
     z-index: 10;
     backdrop-filter: blur(14px);
     background:
       linear-gradient(to bottom,
         rgba(0, 0, 0, 0.96),
         rgba(15, 23, 42, 0.94));
     border-bottom: 1px solid #111827;
     box-shadow: 0 12px 30px rgba(0, 0, 0, 0.9);
   }

   .top-bar-inner {
     max-width: 1080px;
     margin: 0 auto;
     padding: 0.75rem 1rem;
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 0.75rem;
   }

   .brand-block {
     display: flex;
     flex-direction: column;
     gap: 0.1rem;
   }

   .brand-text-title {
     font-size: 1rem;
     font-weight: 700;
     letter-spacing: 0.16em;
     text-transform: uppercase;
     color: #f9fafb;
   }
   /* LAYOUT */

   main.layout {
     max-width: 1080px;
     margin: 1rem auto 2.5rem auto;
     padding: 0 1rem 1.5rem;
     display: flex;
     flex-direction: column;
     gap: 1rem;
   }

   @media (min-width: 900px) {
     main.layout {
       flex-direction: row;
       align-items: flex-start;
       gap: 1.25rem;
     }
   }

   /* TOPICS */

   .topics-panel {
     background: #020617;
     border-radius: var(--radius-lg);
     padding: 0.85rem;
     border: 1px solid #111827;
     box-shadow: var(--shadow-soft);
   }

   @media (min-width: 900px) {
     .topics-panel {
       flex: 0 0 260px;
       position: sticky;
       top: 4rem;
       max-height: calc(100vh - 4.5rem);
       overflow-y: auto;
     }
   }

   .topics-header {
     display: flex;
     align-items: center;
     justify-content: space-between;
     gap: 0.5rem;
     margin-bottom: 0.5rem;
   }

   .topics-title {
     font-size: 0.9rem;
     font-weight: 600;
     letter-spacing: 0.08em;
     text-transform: uppercase;
   }

   .topics-list {
     display: flex;
     flex-direction: column;
     gap: 0.4rem;
     margin: 0.4rem 0;
     padding: 0;
     list-style: none;
   }

   .topic-item button {
     width: 100%;
     text-align: left;
     font-size: 0.85rem;
     padding: 0.45rem 0.7rem;
     border-radius: var(--radius-md);
     border: 1px solid var(--border-subtle);
     background: #020617;
     color: var(--text-main);
     cursor: pointer;
     display: flex;
     justify-content: space-between;
     align-items: center;
     gap: 0.5rem;
     transition:
       background 0.2s ease,
       border-color 0.2s ease,
       box-shadow 0.2s ease,
       transform 0.15s ease;
   }

   .topic-item button span.count {
     font-size: 0.75rem;
     color: var(--text-muted);
   }

   .topic-item button:hover {
     background: #020617;
     border-color: #1f2937;
     box-shadow: 0 6px 18px rgba(0, 0, 0, 0.9);
   }

   .topic-item button.active {
     border-color: var(--accent);
     background: #020617;
     box-shadow: 0 12px 30px rgba(14, 165, 233, 0.45);
     transform: translateY(-1px);
   }

   .topics-footer {
     margin-top: 0.45rem;
     font-size: 0.75rem;
     display: flex;
     justify-content: space-between;
     gap: 0.5rem;
     align-items: center;
     color: var(--text-muted);
   }

   .btn-ghost-xs {
     border-radius: var(--radius-pill);
     border: none;
     padding: 0.3rem 0.7rem;
     background: transparent;
     font-size: 0.75rem;
     cursor: pointer;
     color: var(--text-muted);
   }

   .btn-ghost-xs:hover {
     background: #111827;
     color: #e5e7eb;
   }

   /* CONTENT */

   .content {
     flex: 1;
     min-width: 0;
     display: flex;
     flex-direction: column;
     gap: 1rem;
   }

   /* WRITE PANEL */

   .write-panel {
     background: #020617;
     border-radius: var(--radius-lg);
     padding: 1rem;
     border: 1px solid #111827;
     box-shadow: var(--shadow-soft);
   }

   @media (min-width: 900px) {
     .write-panel {
       padding: 1rem 1.25rem;
     }
   }

   .write-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     gap: 0.6rem;
     margin-bottom: 0.6rem;
     flex-wrap: wrap;
   }

   .write-title {
     font-size: 0.95rem;
     font-weight: 600;
     letter-spacing: 0.08em;
     text-transform: uppercase;
   }

   .message-form {
     display: flex;
     flex-direction: column;
     gap: 0.75rem;
   }

   .field-group {
     display: flex;
     flex-direction: column;
     gap: 0.2rem;
   }

   .field-label {
     font-size: 0.78rem;
     font-weight: 500;
     color: var(--text-muted);
     display: flex;
     justify-content: space-between;
     align-items: center;
     gap: 0.4rem;
   }

   .field-label span.sub {
     font-weight: 400;
     font-size: 0.72rem;
     opacity: 0.8;
   }

   .field-row {
     display: flex;
     gap: 0.75rem;
   }

   @media (max-width: 600px) {
     .field-row {
       flex-direction: column;
     }
   }

   .field-row > .field-group {
     flex: 1;
   }

   input[type="text"],
   select,
   textarea {
     border-radius: 999px;
     border: 1px solid var(--border-subtle);
     padding: 0.5rem 0.8rem;
     font-size: 0.85rem;
     font-family: inherit;
     outline: none;
     background: #020617;
     color: var(--text-main);
     transition:
       border-color 0.18s ease,
       box-shadow 0.18s ease,
       background 0.18s ease;
     width: 100%;
   }

   textarea {
     border-radius: 12px;
     min-height: 90px;
     resize: vertical;
     line-height: 1.4;
   }

   input::placeholder,
   textarea::placeholder {
     color: rgba(156, 163, 175, 0.65);
   }

   input[type="text"]:focus,
   select:focus,
   textarea:focus {
     border-color: var(--accent);
     box-shadow: 0 0 0 1px var(--accent-strong);
     background: #020617;
   }

   .form-actions {
     display: flex;
     justify-content: space-between;
     align-items: center;
     gap: 0.5rem;
     margin-top: 0.25rem;
     flex-wrap: wrap;
   }

   .btn {
     border-radius: var(--radius-pill);
     border: none;
     padding: 0.55rem 1.1rem;
     font-size: 0.85rem;
     font-weight: 500;
     cursor: pointer;
     display: inline-flex;
     align-items: center;
     gap: 0.35rem;
     white-space: nowrap;
   }

   .btn-primary {
     background: #0ea5e9;
     color: #020617;
     box-shadow: 0 14px 30px rgba(15, 23, 42, 0.8);
   }

   .btn-primary:hover {
     filter: brightness(1.06);
   }

   .btn-outline {
     background: transparent;
     color: var(--text-muted);
     border: 1px solid #4b5563;
   }

   .btn-outline:hover {
     background: #111827;
     color: #e5e7eb;
   }

   /* THREAD / POSTS */
   .thread {
     display: flex;
     flex-direction: column;
     gap: 0.7rem;
     min-width: 0;
   }

   .post-card {
     padding: 0.75rem 0.8rem 0.7rem;
     border-radius: var(--radius-lg);
     background: #020617;
     border: 1px solid #111827;
     box-shadow: var(--shadow-soft);
     display: flex;
     flex-direction: column;
     gap: 0.4rem;
     min-width: 0;
     max-width: 100%;
   }

   .post-header {
     display: flex;
     justify-content: space-between;
     gap: 0.4rem;
     align-items: flex-start;
   }

   .post-meta {
     display: flex;
     flex-direction: column;
     gap: 0.1rem;
   }

   .post-author-line {
     display: flex;
     align-items: center;
     gap: 0.35rem;
     flex-wrap: wrap;
   }

   .post-author {
     font-size: 0.9rem;
     font-weight: 600;
     color: #f9fafb;
   }

   .post-date-line {
     font-size: 0.75rem;
     color: var(--text-muted);
     display: flex;
     align-items: center;
     gap: 0.4rem;
     flex-wrap: wrap;
   }

   .post-actions-header {
     display: flex;
     gap: 0.25rem;
   }

   .icon-btn {
     border: none;
     background: transparent;
     padding: 0.1rem 0.35rem;
     border-radius: var(--radius-pill);
     font-size: 0.78rem;
     cursor: pointer;
     color: var(--text-muted);
   }

   .icon-btn:hover {
     background: #111827;
     color: #f9fafb;
   }

   .post-text {
     font-size: 0.9rem;
     line-height: 1.5;
     color: var(--text-main);
     
     width: 100%;
     max-width: 100%;
     min-width: 0;
     display: flex;
     flex-direction: column;
     overflow-wrap: break-word;
     word-wrap: break-word;
     word-break: break-word;
     hyphens: auto;
   }

   .post-text p {
     margin: 0 0 0.3rem 0;
   }

   .post-text p:last-child {
     margin-bottom: 0;
   }

   .post-footer {
     display: flex;
     justify-content: flex-start;
     gap: 0.75rem;
     align-items: center;
     margin-top: 0.2rem;
     flex-wrap: wrap;
     font-size: 0.8rem;
   }

   .link-btn {
     border: none;
     background: transparent;
     padding: 0;
     margin: 0;
     font-size: 0.8rem;
     color: var(--accent);
     cursor: pointer;
   }

   .link-btn:hover {
     text-decoration: underline;
   }

   .post-replies {
     margin-top: 0.45rem;
     border-left: 2px solid #111827;
     padding-left: 0.6rem;
     display: flex;
     flex-direction: column;
     gap: 0.4rem;
   }

   .post-card.reply {
     box-shadow: none;
     background: #020617;
     border-color: #111827;
   }

   .muted {
     color: var(--text-muted);
   }
   