/* === getriff.org Design System === */
:root {
  --color-paper: #f4f4f0;
  --color-ink: #272048;
  --color-electric: #0808ba;
  --color-alert: #dc2626;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Newsreader", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --shadow-card: 4px 4px 0px 0px var(--color-ink);
  --shadow-hover: 8px 8px 0px 0px var(--color-ink);
}

::selection {
  background: var(--color-electric);
  color: var(--color-paper);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 2px solid var(--color-ink);
  margin-bottom: 24px;
}

.header h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: -0.025em;
}

.header .user-info {
  font-size: 0.9rem;
  color: rgba(39, 32, 72, 0.6);
}

/* Join screen */
.join-screen {
  max-width: 480px;
  margin: 80px auto;
  background: var(--color-paper);
  padding: 40px;
  border-radius: 0;
  border: 1px solid var(--color-ink);
  box-shadow: var(--shadow-card);
}

.join-screen h2 {
  margin-bottom: 24px;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  letter-spacing: -0.025em;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  color: rgba(39, 32, 72, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  font-size: 0.95rem;
  font-family: inherit;
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-electric);
  box-shadow: 0 0 0 2px rgba(8, 8, 186, 0.15);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

button {
  padding: 8px 20px;
  border: 1px solid var(--color-ink);
  border-radius: 0;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  transition: transform 0.1s, box-shadow 0.1s;
}

button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0px 0px var(--color-ink);
}

.btn-primary {
  background: var(--color-ink);
  color: var(--color-paper);
  border-color: var(--color-ink);
}

.btn-primary:hover {
  background: var(--color-electric);
  border-color: var(--color-electric);
}

.btn-secondary {
  background: var(--color-paper);
  color: var(--color-ink);
}

.btn-secondary:hover {
  background: white;
}

.btn-danger {
  background: var(--color-alert);
  color: white;
  border-color: var(--color-alert);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-small {
  padding: 4px 12px;
  font-size: 0.8rem;
}

/* Spec list */
.spec-list {
  margin-top: 20px;
}

.spec-list h3 {
  margin-bottom: 12px;
  font-size: 1rem;
  color: rgba(39, 32, 72, 0.6);
}

.spec-filters {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid var(--color-ink);
}

.spec-filter {
  padding: 6px 14px;
  border: none;
  border-right: 1px solid var(--color-ink);
  background: var(--color-paper);
  border-radius: 0;
  font-size: 0.82rem;
  color: var(--color-ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.spec-filter:last-child {
  border-right: none;
}

.spec-filter:hover {
  background: rgba(39, 32, 72, 0.05);
  transform: none;
  box-shadow: none;
}

.spec-filter--active {
  background: var(--color-ink);
  color: var(--color-paper);
}

.spec-filter--active:hover {
  background: var(--color-ink);
  color: var(--color-paper);
  transform: none;
  box-shadow: none;
}

.spec-card {
  background: var(--color-paper);
  padding: 16px 20px;
  border-radius: 0;
  margin-bottom: 10px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.15s;
  border-left: 3px solid transparent;
}

.spec-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hover);
}

.spec-card--recent {
  border-left-color: var(--color-electric);
}

.spec-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.spec-card__title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  min-width: 0;
}

.spec-card__time {
  font-size: 0.75rem;
  color: rgba(39, 32, 72, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
}

.spec-card__desc {
  font-size: 0.82rem;
  color: rgba(39, 32, 72, 0.6);
  margin: 6px 0 0;
  line-height: 1.4;
}

.spec-card__footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.spec-card__meta {
  font-size: 0.75rem;
  color: rgba(39, 32, 72, 0.5);
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-drafting {
  background: rgba(8, 8, 186, 0.1);
  color: var(--color-electric);
}

.status-finalized {
  background: rgba(22, 163, 74, 0.1);
  color: #166534;
}

/* Spec view */
.spec-view {
  background: var(--color-paper);
  border-radius: 0;
  border: 1px solid rgba(39, 32, 72, 0.2);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.spec-header {
  padding: 20px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.2);
}

.spec-header h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  margin-bottom: 8px;
  letter-spacing: -0.025em;
}

.spec-header .participants {
  font-size: 0.85rem;
  color: rgba(39, 32, 72, 0.6);
}

.spec-header .version-info {
  font-size: 0.85rem;
  color: rgba(39, 32, 72, 0.5);
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid rgba(39, 32, 72, 0.2);
  background: rgba(39, 32, 72, 0.03);
}

.tab {
  padding: 10px 20px;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  color: rgba(39, 32, 72, 0.6);
}

.tab:hover {
  color: var(--color-ink);
}

.tab.active {
  color: var(--color-electric);
  border-bottom-color: var(--color-electric);
  font-weight: 600;
}

/* Content area */
.content-area {
  padding: 20px;
}

.markdown-content {
  line-height: 1.8;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-family: var(--font-serif);
  letter-spacing: -0.025em;
}

.markdown-content h2 {
  font-size: 1.3rem;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.15);
}

.markdown-content p {
  margin-bottom: 12px;
}

.markdown-content ul, .markdown-content ol {
  margin-bottom: 12px;
  padding-left: 24px;
}

.markdown-content code {
  background: rgba(39, 32, 72, 0.06);
  padding: 2px 6px;
  border-radius: 0;
  font-size: 0.9em;
  font-family: var(--font-mono);
}

.markdown-content pre {
  background: var(--color-ink);
  color: #e2e8f0;
  padding: 16px;
  border-radius: 0;
  overflow-x: auto;
  margin-bottom: 16px;
}

.markdown-content pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 0.9em;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid rgba(39, 32, 72, 0.2);
  padding: 8px 12px;
  text-align: left;
}

.markdown-content th {
  background: rgba(39, 32, 72, 0.06);
  font-weight: 600;
}

.markdown-content tr:nth-child(even) {
  background: rgba(39, 32, 72, 0.02);
}

.markdown-content blockquote {
  border-left: 3px solid rgba(39, 32, 72, 0.3);
  padding: 4px 16px;
  margin: 0 0 16px 0;
  color: rgba(39, 32, 72, 0.7);
  background: rgba(39, 32, 72, 0.03);
}

.markdown-content hr {
  border: none;
  border-top: 1px solid rgba(39, 32, 72, 0.15);
  margin: 20px 0;
}

/* Edit mode */
.edit-area {
  padding: 20px;
}

.edit-area textarea {
  width: 100%;
  min-height: 400px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  resize: vertical;
  line-height: 1.6;
}

.edit-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}

.edit-controls input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  font-size: 0.9rem;
}

/* Discussions */
.discussion-list {
  padding: 0;
}

.discussion-item {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.1);
  cursor: pointer;
}

.discussion-item:hover {
  background: rgba(39, 32, 72, 0.03);
}

.discussion-item h4 {
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.discussion-item .disc-meta {
  font-size: 0.8rem;
  color: rgba(39, 32, 72, 0.5);
}

.discussion-thread {
  padding: 20px;
}

.discussion-thread h3 {
  margin-bottom: 4px;
}

.discussion-thread .thread-meta {
  font-size: 0.85rem;
  color: rgba(39, 32, 72, 0.5);
  margin-bottom: 16px;
}

.reply-item {
  padding: 16px 20px;
  margin-bottom: 16px;
  background: rgba(39, 32, 72, 0.03);
  border-radius: 0;
  border-left: 4px solid rgba(39, 32, 72, 0.2);
}

.reply-item .reply-author {
  font-weight: 600;
  font-size: 0.85rem;
}

.reply-item .reply-time {
  font-size: 0.75rem;
  color: rgba(39, 32, 72, 0.5);
  margin-left: 8px;
}

.reply-item .reply-body {
  margin-top: 4px;
  font-size: 0.9rem;
}

.resolution-box {
  padding: 12px 16px;
  background: rgba(22, 163, 74, 0.1);
  border-radius: 0;
  margin-top: 12px;
  border-left: 3px solid #22c55e;
  font-size: 0.9rem;
}

/* Version list */
.version-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.1);
}

.version-item .version-num {
  font-weight: 700;
  color: var(--color-electric);
  min-width: 40px;
  font-family: var(--font-mono);
}

.version-item .version-info {
  flex: 1;
  margin-left: 12px;
}

.version-item .version-author {
  font-weight: 600;
  font-size: 0.9rem;
}

.version-item .version-msg {
  font-size: 0.85rem;
  color: rgba(39, 32, 72, 0.6);
}

.version-item .version-time {
  font-size: 0.8rem;
  color: rgba(39, 32, 72, 0.5);
}

/* Diff view — GitHub-style */
.diff-view {
  padding: 20px;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  overflow: hidden;
}

.diff-table td {
  padding: 1px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  vertical-align: top;
  border: none;
}

.diff-line-num {
  width: 1%;
  min-width: 40px;
  padding: 1px 8px;
  text-align: right;
  color: rgba(39, 32, 72, 0.4);
  background: rgba(39, 32, 72, 0.04);
  user-select: none;
  border-right: 1px solid rgba(39, 32, 72, 0.15);
  font-size: 0.75rem;
}

.diff-line-add {
  background: rgba(22, 163, 74, 0.1);
}

.diff-line-add .diff-line-num {
  background: rgba(22, 163, 74, 0.15);
  color: #166534;
}

.diff-line-remove {
  background: rgba(220, 38, 38, 0.08);
}

.diff-line-remove .diff-line-num {
  background: rgba(220, 38, 38, 0.12);
  color: #991b1b;
}

.diff-line-hunk {
  background: rgba(8, 8, 186, 0.06);
  color: var(--color-electric);
  font-weight: 600;
}

.diff-line-hunk td {
  padding: 6px 12px;
}

.diff-line-hunk .diff-line-num {
  background: rgba(8, 8, 186, 0.1);
}

.diff-line-header {
  background: rgba(39, 32, 72, 0.06);
  color: rgba(39, 32, 72, 0.7);
  font-weight: 700;
}

.diff-line-header td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.15);
}

/* Toast / notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
}

.toast {
  background: var(--color-ink);
  color: var(--color-paper);
  padding: 12px 20px;
  border-radius: 0;
  margin-top: 8px;
  font-size: 0.85rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
  box-shadow: var(--shadow-card);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Finalized banner */
.finalized-banner {
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.3);
  color: #166534;
  padding: 12px 20px;
  text-align: center;
  font-weight: 600;
}

/* Back link */
.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--color-electric);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
}

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

/* Inline forms */
.inline-form {
  margin-top: 16px;
  padding: 16px;
  background: rgba(39, 32, 72, 0.03);
  border-radius: 0;
  border: 1px solid rgba(39, 32, 72, 0.1);
}

.inline-form h4 {
  margin-bottom: 12px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 40px;
  color: rgba(39, 32, 72, 0.5);
}

/* Error */
.error-msg {
  color: var(--color-alert);
  background: rgba(220, 38, 38, 0.06);
  padding: 8px 12px;
  border-radius: 0;
  margin: 8px 0;
  font-size: 0.85rem;
  border-left: 3px solid var(--color-alert);
}

/* DM Badge */
.dm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-electric);
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.dm-badge:hover {
  background: rgba(8, 8, 186, 0.06);
}

.dm-badge__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 0;
  background: var(--color-alert);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

/* DM Filters */
.dm-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.dm-filter-pill {
  padding: 5px 12px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  background: var(--color-paper);
  border-radius: 0;
  font-size: 0.8rem;
  color: rgba(39, 32, 72, 0.7);
  cursor: pointer;
  transition: all 0.15s;
  text-transform: capitalize;
}

.dm-filter-pill:hover {
  border-color: rgba(39, 32, 72, 0.4);
  transform: none;
  box-shadow: none;
}

.dm-filter-pill--active {
  background: var(--color-electric);
  color: var(--color-paper);
  border-color: var(--color-electric);
}

.dm-filter-pill--active:hover {
  background: #0606a0;
  transform: none;
  box-shadow: none;
}

.dm-search {
  padding: 5px 12px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  font-size: 0.8rem;
  outline: none;
  min-width: 140px;
  font-family: inherit;
}

.dm-search:focus {
  border-color: var(--color-electric);
  box-shadow: 0 0 0 2px rgba(8, 8, 186, 0.1);
}

/* DM Thread Card */
.dm-thread-card {
  background: var(--color-paper);
  padding: 16px 20px;
  border-radius: 0;
  margin-bottom: 10px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  border-left: 3px solid transparent;
}

.dm-thread-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hover);
}

.dm-thread-card--unread {
  border-left-color: var(--color-electric);
}

/* DM Thread Messages */
.dm-thread-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.dm-message {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.dm-message--mine {
  align-self: flex-end;
  background: var(--color-ink);
  color: var(--color-paper);
}

.dm-message--theirs {
  align-self: flex-start;
  background: rgba(39, 32, 72, 0.06);
  color: var(--color-ink);
}

.dm-message__sender {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 2px;
  opacity: 0.8;
}

.dm-message--mine .dm-message__sender {
  color: rgba(244, 244, 240, 0.8);
}

.dm-message__body {
  white-space: pre-wrap;
  word-break: break-word;
}

.dm-message__meta {
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.7;
}

.dm-message--mine .dm-message__meta .status-badge {
  background: rgba(255,255,255,0.2);
  color: white;
}

/* DM Reply Form */
.dm-reply-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.dm-reply-form textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 48px;
}

.dm-reply-form textarea:focus {
  border-color: var(--color-electric);
  outline: none;
  box-shadow: 0 0 0 2px rgba(8, 8, 186, 0.1);
}

/* Reply-to-specific: quoted block inside message */
.dm-message__quote {
  border-left: 3px solid var(--color-electric);
  padding: 4px 8px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: pointer;
  border-radius: 0;
  background: rgba(8, 8, 186, 0.06);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dm-message--mine .dm-message__quote {
  border-left-color: rgba(244, 244, 240, 0.5);
  background: rgba(244, 244, 240, 0.1);
}

.dm-message__quote:hover {
  background: rgba(8, 8, 186, 0.12);
}

.dm-message--mine .dm-message__quote:hover {
  background: rgba(244, 244, 240, 0.18);
}

.dm-message__quote--missing {
  opacity: 0.5;
  font-style: italic;
  cursor: default;
}

.dm-message__quote-sender {
  font-weight: 600;
  opacity: 0.9;
}

.dm-message__quote-body {
  opacity: 0.75;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Reply button on each message */
.dm-message__reply-btn {
  cursor: pointer;
  margin-left: 8px;
  opacity: 0;
  transition: opacity 0.15s;
  font-size: 0.85rem;
  user-select: none;
}

.dm-message:hover .dm-message__reply-btn {
  opacity: 0.6;
}

.dm-message__reply-btn:hover {
  opacity: 1 !important;
}

@media (max-width: 640px) {
  .dm-message__reply-btn {
    opacity: 0.5;
  }
}

/* Highlight animation on scroll-to */
.dm-message--highlight {
  outline: 2px solid var(--color-electric);
  outline-offset: 2px;
  transition: outline-color 0.3s;
}

/* Replying-to context bar above reply form */
.dm-reply-context {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(8, 8, 186, 0.06);
  border-left: 3px solid var(--color-electric);
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.dm-reply-context__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.dm-reply-context__label {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-electric);
}

.dm-reply-context__text {
  opacity: 0.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dm-reply-context__close {
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.5;
  padding: 2px 6px;
}

.dm-reply-context__close:hover {
  opacity: 1;
}

/* Intent badge colors */
.intent-fyi {
  background: rgba(8, 8, 186, 0.1);
  color: var(--color-electric);
}

.intent-request {
  background: rgba(217, 119, 6, 0.1);
  color: #92400e;
}

.intent-coordination {
  background: rgba(91, 33, 182, 0.1);
  color: #5b21b6;
}

.intent-personal {
  background: rgba(157, 23, 77, 0.1);
  color: #9d174d;
}

/* Actions bar */
.actions-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.15);
  background: rgba(39, 32, 72, 0.03);
}

/* === Decision Feed === */

/* View toggle (segmented control) */
.view-toggle {
  display: flex;
  border: 1px solid var(--color-ink);
  margin-bottom: 20px;
}

.view-btn {
  padding: 8px 20px;
  background: var(--color-paper);
  color: var(--color-ink);
  border: none;
  border-right: 1px solid var(--color-ink);
  border-radius: 0;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.view-btn:last-child {
  border-right: none;
}

.view-btn:hover {
  background: rgba(39, 32, 72, 0.05);
  transform: none;
  box-shadow: none;
}

.view-btn.active {
  background: var(--color-ink);
  color: var(--color-paper);
}

.view-btn.active:hover {
  transform: none;
  box-shadow: none;
}

/* Section headers */
.section-header {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(39, 32, 72, 0.5);
  padding: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-electric);
  display: inline-block;
}

/* Decision cards */
.decision-card {
  background: var(--color-paper);
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  margin-bottom: 10px;
}

.decision-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hover);
}

.decision-card.unread {
  border-left: 3px solid var(--color-electric);
}

.decision-main {
  display: flex;
  gap: 14px;
  padding: 14px 20px;
  align-items: flex-start;
}

.decision-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.decision-icon.decided {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.decision-icon.proposed {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

.decision-icon.contested {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-alert);
}

.decision-icon.message {
  background: rgba(39, 32, 72, 0.08);
  color: var(--color-ink);
}

.decision-content {
  flex: 1;
  min-width: 0;
}

.decision-headline {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.decision-detail {
  font-size: 0.82rem;
  color: rgba(39, 32, 72, 0.6);
  margin: 0 0 2px;
  line-height: 1.4;
}

.decision-context {
  font-size: 0.75rem;
  color: rgba(39, 32, 72, 0.5);
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 4px;
}

/* Status tags */
.status-tag {
  border-radius: 0;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  font-weight: 700;
  padding: 2px 6px;
  display: inline-block;
}

.status-tag.decided {
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
}

.status-tag.proposed {
  background: rgba(217, 119, 6, 0.12);
  color: #92400e;
}

.status-tag.contested {
  background: rgba(220, 38, 38, 0.1);
  color: var(--color-alert);
}

.status-tag.message {
  background: rgba(39, 32, 72, 0.08);
  color: rgba(39, 32, 72, 0.7);
}

/* Decision trace */
.trace-toggle {
  color: var(--color-electric);
  font-size: 0.8rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 20px 10px;
  font-weight: 500;
  font-family: inherit;
}

.trace-toggle:hover {
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.trace-steps {
  display: none;
  padding: 0 20px 14px;
}

.trace-steps.open {
  display: block;
}

.trace-step {
  border-left: 2px solid rgba(39, 32, 72, 0.2);
  padding: 6px 0 6px 14px;
  font-size: 0.82rem;
  color: rgba(39, 32, 72, 0.7);
}

.trace-step.rejected {
  border-left-color: var(--color-alert);
}

.trace-step.accepted {
  border-left-color: #22c55e;
}

.trace-step-author {
  font-weight: 600;
  color: var(--color-ink);
}

.trace-step-time {
  font-size: 0.72rem;
  color: rgba(39, 32, 72, 0.4);
  margin-left: 8px;
}

/* Filter pills (Messages tab) */
.filter-pill {
  padding: 5px 14px;
  border: 1px solid rgba(39, 32, 72, 0.2);
  background: transparent;
  border-radius: 0;
  font-size: 0.8rem;
  color: rgba(39, 32, 72, 0.7);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.filter-pill:hover {
  border-color: rgba(39, 32, 72, 0.4);
  transform: none;
  box-shadow: none;
}

.filter-pill.active {
  background: var(--color-electric);
  color: var(--color-paper);
  border-color: var(--color-electric);
}

.filter-pill.active:hover {
  transform: none;
  box-shadow: none;
}

/* Feed items (Messages tab) */
.feed-item {
  background: var(--color-paper);
  border: 1px solid rgba(39, 32, 72, 0.2);
  border-radius: 0;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  margin-bottom: 10px;
  padding: 14px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.feed-item:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-hover);
}

.feed-type-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  font-weight: 700;
  border: 1px solid rgba(39, 32, 72, 0.2);
}

.feed-type-icon.type-riff {
  background: rgba(8, 8, 186, 0.08);
  color: var(--color-electric);
}

.feed-type-icon.type-group {
  background: rgba(91, 33, 182, 0.08);
  color: #5b21b6;
}

.feed-type-icon.type-spec {
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

.feed-item-content {
  flex: 1;
  min-width: 0;
}

.feed-item-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 2px;
}

.feed-item-preview {
  font-size: 0.82rem;
  color: rgba(39, 32, 72, 0.6);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-item-meta {
  font-size: 0.72rem;
  color: rgba(39, 32, 72, 0.5);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.feed-type-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(39, 32, 72, 0.5);
}

.empty-state p {
  font-size: 0.9rem;
}

/* === Media Attachments === */

.msg-attachments {
  margin-top: 6px;
}

.msg-attachment {
  margin-bottom: 4px;
}

.msg-attachment__img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 8px;
  cursor: pointer;
  object-fit: contain;
  background: rgba(0,0,0,0.03);
}
.msg-attachment__img:hover {
  opacity: 0.9;
}

.msg-attachment__file {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0,0,0,0.04);
  color: var(--color-electric);
  font-size: 0.82rem;
  text-decoration: none;
}
.msg-attachment__file:hover {
  background: rgba(0,0,0,0.08);
}

.attach-area {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.btn-attach {
  background: none;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.btn-attach:hover {
  background: rgba(0,0,0,0.05);
}

.attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--color-electric);
  color: white;
  font-size: 0.75rem;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-chip__remove {
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
  margin-left: 2px;
}
.attach-chip__remove:hover {
  opacity: 1;
}

/* Gear icon button */
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  color: rgba(39, 32, 72, 0.5);
  transition: color 0.15s;
  line-height: 1;
}
.btn-icon:hover {
  color: var(--color-ink);
}

/* Preferences overlay */
.prefs-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.prefs-panel {
  background: var(--color-bg);
  border: 2px solid var(--color-ink);
  border-radius: 8px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.prefs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(39, 32, 72, 0.1);
}

.prefs-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-ink);
}

.prefs-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: rgba(39, 32, 72, 0.4);
  padding: 0 4px;
  line-height: 1;
}
.prefs-close:hover {
  color: var(--color-ink);
}

.prefs-list {
  padding: 8px 0;
}

.prefs-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
}
.prefs-item:hover {
  background: rgba(39, 32, 72, 0.03);
}

.prefs-label {
  font-size: 0.9rem;
  color: var(--color-ink);
}

/* Toggle switch */
.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: rgba(39, 32, 72, 0.15);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch.on {
  background: var(--color-ink);
}
.toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
}
.toggle-switch.on .toggle-knob {
  transform: translateX(18px);
}
