/* Original Ciprocity forum styles. System fonts only; no external resources. */
:root {
  --canvas: #ffffff;
  --panel: #f3f6fa;
  --text: #18334d;
  --action: #2167ae;
  --action-dark: #184f87;
  --muted: #52677c;
  --shipped: #236b45;
  --danger: #9b1c1c;
  --line: #cfd9e4;
  --focus: #b45309;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--action); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--action-dark); }

:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--canvas);
  color: var(--text);
  border: 2px solid var(--action);
}
.skip-link:focus { top: 0.5rem; }

/* Header */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  min-height: 3.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.brand { margin: 0; font-size: 1.125rem; }
.brand a {
  display: inline-block;
  min-height: 44px;
  line-height: 44px;
  color: var(--text);
  text-decoration: none;
}
.brand-name { font-weight: 700; color: var(--action); }
.brand-section { color: var(--muted); }
.brand-name::after { content: " /"; color: var(--muted); font-weight: 400; }

.account { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.identity { font-size: 0.875rem; color: var(--muted); }
.logout-form { margin: 0; }
.admin-badge {
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--text);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
}

/* Notice and messages */
.notice {
  margin: 1rem 0 0;
  padding: 0.5rem 0.75rem;
  border-left: 4px solid var(--action);
  background: var(--panel);
  font-size: 0.875rem;
}
.messages { list-style: none; margin: 1rem 0 0; padding: 0; }
.message {
  margin: 0 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--action);
  background: var(--panel);
}
.message-error { border-left-color: var(--danger); }
.message-success { border-left-color: var(--shipped); }

.main { padding-top: 1rem; padding-bottom: 3rem; }

/* Typography */
h1 { margin: 1rem 0 0.5rem; font-size: 1.75rem; line-height: 1.2; }
h2 { margin: 1.5rem 0 0.5rem; font-size: 1.25rem; line-height: 1.3; }
h3 { margin: 1rem 0 0.25rem; font-size: 1.125rem; line-height: 1.3; }
p, ul, ol { margin: 0 0 1rem; }
.prose, .prose p { max-width: 72ch; }
.meta, small { font-size: 0.875rem; color: var(--muted); }

/* Controls */
label { display: block; margin: 0 0 0.25rem; font-weight: 600; }
input[type="text"], input[type="search"], input[type="password"], input[type="number"],
select, textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  background: var(--canvas);
  color: var(--text);
  font: inherit;
}
textarea { min-height: 8rem; resize: vertical; }
.field { margin: 0 0 1rem; max-width: 72ch; }
.help { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); }
.field-error { margin: 0.25rem 0 0; color: var(--danger); font-weight: 600; }

.button, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0.5rem 1rem;
  border: 2px solid var(--action);
  border-radius: 4px;
  background: var(--action);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover, button:hover, input[type="submit"]:hover { background: var(--action-dark); border-color: var(--action-dark); color: #ffffff; }
.button-quiet, .button-secondary { background: var(--canvas); color: var(--action); }
.button-quiet:hover, .button-secondary:hover { background: var(--panel); color: var(--action-dark); }
.button-danger { border-color: var(--danger); background: var(--danger); }

/* Error summary */
.error-summary {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 2px solid var(--danger);
  border-radius: 4px;
  background: var(--canvas);
}
.error-summary h2 { margin: 0 0 0.5rem; color: var(--danger); font-size: 1.125rem; }
.error-summary ul { margin: 0; padding-left: 1.25rem; }

/* Board layout: wide list plus compact filter sidebar */
.board { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.5rem; align-items: start; }
.filters { padding: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.filters .field { margin-bottom: 0.75rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }

/* Idea rows */
.idea-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.idea-row { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.idea-main { flex: 1 1 auto; min-width: 0; }
.idea-title { margin: 0 0 0.25rem; font-size: 1.125rem; }
.idea-excerpt { margin: 0 0 0.25rem; max-width: 72ch; }

/* Compact vote block with separate people and organization counts */
.vote-block {
  flex: 0 0 auto;
  width: 5.5rem;
  padding: 0.5rem;
  border: 1px solid var(--action);
  border-radius: 4px;
  background: var(--panel);
  text-align: center;
}
.vote-block form { margin: 0; }
.vote-block button { width: 100%; padding-inline: 0.25rem; font-size: 0.875rem; line-height: 1.2; text-align: center; overflow-wrap: normal; word-break: normal; }
.vote-count { display: block; font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.vote-label { display: block; font-size: 0.875rem; color: var(--muted); }

/* Status text labels (never colour alone) */
.status {
  display: inline-block;
  padding: 0 0.5rem;
  border: 1px solid var(--muted);
  border-radius: 3px;
  background: var(--canvas);
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}
.status-shipped { border-color: var(--shipped); color: var(--shipped); }

/* Detail and comments */
.detail-head { display: flex; gap: 1rem; align-items: flex-start; }
.comment-stream { list-style: none; margin: 0; padding: 0; }
.comment { padding: 0.75rem 0; border-top: 1px solid var(--line); max-width: 72ch; }
.admin-section { margin: 1.5rem 0; padding: 0.75rem 1rem; border: 2px dashed var(--text); border-radius: 4px; background: var(--panel); }
.admin-section h2 { margin-top: 0; font-size: 1rem; }

.empty-state { padding: 1.5rem; border: 1px dashed var(--muted); border-radius: 4px; background: var(--panel); }

/* Narrow screens: single column, no horizontal scrolling */
@media (max-width: 720px) {
  .board { grid-template-columns: minmax(0, 1fr); }
  .filters { order: -1; }
  .header-inner { align-items: flex-start; }
  h1 { font-size: 1.5rem; }
  .idea-row, .detail-head { gap: 0.75rem; }
  .vote-block { width: 5.5rem; }
  img, table, pre { max-width: 100%; }
  pre { overflow-x: auto; }
}

@media (max-width: 400px) {
  .shell { padding-inline: 0.75rem; }
  .account { width: 100%; }
}
