/* Proposal detail: summary facts, a readable text column, and the decision panel beside it. */

.proposal-head {
  margin-bottom: 26px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 650;
  font-size: 15px;
  text-decoration: none;
  color: var(--ink-2);
}
.back-link::before {
  content: "";
  width: 8px;
  height: 8px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}
.back-link:hover {
  color: var(--accent);
}
.proposal-head h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  line-height: 1.12;
  max-width: 30ch;
}
.pid {
  display: inline-block;
  vertical-align: 0.28em;
  margin-right: 6px;
  padding: 3px 10px 4px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font: 700 0.42em/1.2 var(--body);
  letter-spacing: 0.01em;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
}
.facts > div {
  display: grid;
  gap: 3px;
  padding: 9px 14px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--rule) 70%, transparent);
  box-shadow: var(--shadow-1);
}
.facts dt {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.facts dd {
  margin: 0;
  font-weight: 700;
  font-size: 15.5px;
}

.proposal-grid {
  display: grid;
  gap: 24px;
  align-items: start;
}
@media (min-width: 960px) {
  .proposal-grid {
    grid-template-columns: minmax(0, 1fr) 390px;
    grid-template-areas: "text decide";
  }
  .proposal-text {
    grid-area: text;
  }
  .decide-panel {
    grid-area: decide;
  }
}
/* Sticky only when the whole ~725px panel (plus a field error) fits under the header;
   a taller-than-viewport sticky panel hides Reject until the text ends. */
@media (min-width: 960px) and (min-height: 860px) {
  .decide-panel {
    position: sticky;
    top: 88px;
  }
}

.proposal-text {
  padding: 28px 32px;
}
.section-title {
  margin: 0 0 16px;
  font: 650 19px/1.35 var(--display);
  color: var(--ink-2);
}
.prose {
  font-size: 17px;
  line-height: 1.7;
  max-width: 74ch;
}
.prose ul,
.prose ol {
  padding-left: 1.3em;
}
.prose li {
  margin: 4px 0;
}
.prose li::marker {
  color: var(--ink-3);
}
.prose > ul > li {
  margin-top: 12px;
}
.prose > ul > li > strong:first-child {
  font-family: var(--display);
  font-size: 1.04em;
}
.prose strong {
  color: var(--ink);
}
.prose code {
  font-size: 0.82em;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  border: 1px solid var(--rule);
  overflow-wrap: anywhere;
}

.decide-panel {
  background: var(--surface);
  border-radius: var(--radius-board);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, var(--rule));
  box-shadow: var(--shadow-3);
  padding: 24px 22px 20px;
}
.decide-panel h2 {
  margin: 0 0 14px;
}
.current {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 16px;
}
.current p {
  margin: 0;
}
.current-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-3);
}
.current-value {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin-top: 4px !important;
  font-size: 14.5px;
  color: var(--ink-2);
}
.decide-panel .field label {
  font-weight: 700;
}
.optional {
  font-weight: 500;
  color: var(--ink-3);
}
.decide-panel textarea {
  width: 100%;
  border-radius: 12px;
  border: 1.5px solid var(--rule);
  background: var(--surface-2);
  padding: 10px 12px;
  font: 500 16px/1.5 var(--body);
  color: var(--ink);
  transition:
    border-color 150ms,
    box-shadow 150ms,
    background-color 150ms;
}
.decide-panel textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.field-help {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 6px 0 0;
}
.decide-rows {
  display: grid;
  gap: 12px;
  margin: 18px 0 10px;
}
.decide-row {
  display: grid;
  gap: 4px;
}
.decide-preview {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
  overflow-wrap: anywhere;
}

/* Keycap buttons: they sit on a visible edge and sink when pressed. */
.key {
  --key: var(--ink);
  --key-edge: color-mix(in oklab, var(--key) 62%, black);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px 14px;
  border: 0;
  border-radius: 13px;
  background: var(--key);
  color: #fff;
  font: 720 17px/1 var(--display);
  cursor: pointer;
  box-shadow:
    0 5px 0 var(--key-edge),
    0 12px 22px -10px var(--key-edge);
  transform: translateY(0);
  transition:
    transform 110ms var(--ease-out),
    box-shadow 110ms var(--ease-out),
    filter 150ms;
}
.key:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
  box-shadow:
    0 6px 0 var(--key-edge),
    0 16px 26px -10px var(--key-edge);
}
.key:active,
.key.is-pressed {
  transform: translateY(5px);
  box-shadow:
    0 0 0 var(--key-edge),
    0 4px 10px -6px var(--key-edge);
}
.key:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.key-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.22);
  font-size: 14px;
}
.key-good {
  --key: #10804a;
}
.key-hold {
  --key: #3b4a66;
}
.key-bad {
  --key: #c42430;
}
@media (prefers-color-scheme: dark) {
  .key-good {
    --key: #157f4c; /* white label 5.0:1; #1f9a5c was 3.6:1 */
  }
  .key-hold {
    --key: #56668a;
  }
  .key-bad {
    --key: #d83a45;
  }
}
.is-sending .key:not(.is-pressed) {
  opacity: 0.45;
}
.is-sending .key.is-pressed::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgb(255 255 255 / 0.4);
  border-top-color: #fff;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Notes under the text */
#notes {
  margin-top: 24px;
}
.notes {
  display: grid;
  gap: 10px;
  padding: 0;
  list-style: none;
}
.notes li {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
}
.prose table { border-collapse: collapse; font-size: 15px; }
.prose th { text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); }
.prose th, .prose td { padding: 9px 12px; }

