:root {
  --ink: #16211b;
  --muted: #68736d;
  --line: #d8ded7;
  --paper: #fbfcf8;
  --surface: #ffffff;
  --accent: #1f7a55;
  --accent-dark: #155f41;
  --warm: #c7722f;
  --danger: #b4493f;
  --ok-bg: #e7f4ed;
  --warn-bg: #fff2df;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 90%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px clamp(14px, 3.6vw, 45px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(20px, 2.7vw, 31px);
  line-height: 1.12;
}

h2 {
  font-size: 22px;
  line-height: 1.2;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shell {
  width: min(1062px, calc(100% - 29px));
  margin: 0 auto;
  padding: 25px 0 38px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  min-height: 243px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 55, 41, .68), rgba(20, 55, 41, .24)),
    url("assets/hero-garden.png") center/cover;
  color: #fff;
}

.hero-copy {
  align-self: end;
  padding: clamp(23px, 4.5vw, 45px);
}

.hero-copy h2 {
  max-width: 720px;
  font-size: clamp(20px, 3.15vw, 36px);
}

.hero-copy p:not(.eyebrow) {
  max-width: 690px;
  margin-top: 14px;
  color: rgba(255, 255, 255, .88);
  font-size: 14px;
  line-height: 1.55;
}

.hero .eyebrow {
  color: #bce8cf;
}

.meeting-card {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 28px;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
}

.meeting-card span {
  color: var(--muted);
  font-size: 13px;
}

.meeting-card strong {
  margin-bottom: 11px;
  font-size: 14px;
}

.layout {
  display: block;
  margin-top: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: var(--surface);
}

.muted {
  color: var(--muted);
  line-height: 1.45;
}

button {
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 0 rgba(31, 122, 85, 0);
}

button:hover {
  transform: translateY(-1px);
}

button:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(31, 122, 85, .16), 0 8px 18px rgba(31, 122, 85, .18);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: background .15s ease, box-shadow .15s ease;
  box-shadow: 0 0 0 rgba(31, 122, 85, 0);
}

.button-link:hover {
  background: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(31, 122, 85, .16), 0 8px 18px rgba(31, 122, 85, .18);
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button:hover {
  background: #f2f7f4;
  box-shadow: none;
}

.light-button,
.profile-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: #317ea7;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.light-button:hover,
.profile-link:hover {
  background: transparent;
  color: #1d668a;
  transform: none;
}

.login-form {
  display: grid;
  gap: 13px;
  max-width: 520px;
  margin-top: 20px;
}

.login-note {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.login-note strong {
  font-weight: 800;
}

.login-note span {
  white-space: normal;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  font: inherit;
}

input:focus {
  outline: 3px solid rgba(31, 122, 85, .15);
  border-color: var(--accent);
}

textarea {
  width: 100%;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 13px;
  font: inherit;
  resize: vertical;
}

textarea:focus {
  outline: 3px solid rgba(31, 122, 85, .15);
  border-color: var(--accent);
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  color: var(--danger);
  font-weight: 700;
}

.rights-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fcfdfb;
}

.rights-panel p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.rights-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.rights-actions .button-link,
.rights-actions button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  transform: none;
  box-shadow: 0 0 0 rgba(31, 122, 85, 0);
  transition: background .15s ease, box-shadow .15s ease;
}

.rights-actions .button-link:hover,
.rights-actions button:hover {
  background: var(--accent-dark);
  transform: none;
  box-shadow: 0 0 0 3px rgba(31, 122, 85, .16), 0 8px 18px rgba(31, 122, 85, .18);
}

.hidden {
  display: none;
}

.member-line,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.member-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-link {
  font-size: 13px;
  font-weight: 700;
}

.cadastre-line {
  margin-top: 8px;
  color: var(--muted);
}

.profile-panel {
  margin-top: 16px;
}

.profile-note {
  margin-top: 10px;
}

.profile-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  margin-top: 16px;
}

.consent-line {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.consent-line input {
  width: auto;
  min-height: 0;
}

.consent-line span {
  margin-bottom: 0;
}

.consent-line a,
.legal-panel a,
.modal-body a {
  color: #317ea7;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.inline-link {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #317ea7;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.inline-link:hover {
  background: transparent;
  color: #1d668a;
  transform: none;
  box-shadow: none;
}

.profile-form button {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 190px;
}

.modal-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(22, 33, 27, .54);
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  width: min(760px, 100%);
  max-height: min(720px, 92vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .24);
}

.small-modal-card {
  width: min(460px, 100%);
}

.modal-card h2 {
  padding: 18px 18px 10px;
}

.modal-body {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 0 18px 18px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

.legal-page {
  max-width: 900px;
}

.legal-panel {
  display: grid;
  gap: 14px;
  line-height: 1.6;
}

.legal-panel h2 {
  margin-top: 8px;
  font-size: 18px;
}

.legal-links {
  margin: 0;
  padding-left: 22px;
}

.legal-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--ok-bg);
  color: var(--accent-dark);
  font-weight: 700;
}

.ballot-form {
  display: grid;
  gap: 13px;
  align-content: start;
}

.voting-period {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--ok-bg);
  color: red;
  font-weight: 400;
}

.voting-period.closed {
  background: var(--warn-bg);
  color: red;
}

.ballot-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(324px, 36%);
  column-gap: 25px;
  row-gap: 20px;
  align-items: start;
  margin-top: 20px;
}

.ballot-sidebar {
  display: grid;
  gap: 20px;
  align-content: start;
  align-self: start;
}

.ballot-main {
  display: grid;
  gap: 16px;
  min-width: 0;
  align-self: start;
}

.ballot-main > :first-child,
.ballot-sidebar > :first-child {
  margin-top: 0;
}

.proposals-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fcfdfb;
}

.proposals-panel .section-head {
  align-items: flex-start;
}

.proposal-form {
  display: grid;
  gap: 13px;
  margin-top: 13px;
}

.proposal-form button {
  justify-self: start;
  min-width: 221px;
}

.proposals-list {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.proposal-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fcfdfb;
}

.proposal-highlight {
  outline: 3px solid rgba(31, 122, 85, .22);
  border-color: var(--accent);
}

.proposal-duplicate-highlight {
  outline-color: rgba(180, 73, 63, .26);
  border-color: var(--danger);
}

.message.duplicate-message,
.message.duplicate-message a {
  color: var(--danger);
}

.message a {
  color: var(--accent-dark);
  font-weight: 800;
}

.proposal-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.proposal-body {
  margin-top: 7px;
  line-height: 1.5;
}

.proposal-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  justify-self: start;
}

.proposal-like.liked {
  background: var(--accent-dark);
}

.proposal-like-duplicate,
.proposal-like-duplicate:hover {
  background: var(--danger);
}

.chat-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 8px 8px 0 0;
  padding: 13px 14px;
  background: #1f7a55;
  color: #fff;
}

.chat-head .eyebrow {
  color: rgba(255, 255, 255, .74);
}

.chat-status {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-window {
  display: flex;
  flex-direction: column;
  gap: 7px;
  height: clamp(306px, 38vh, 414px);
  overflow-y: auto;
  padding: 16px;
  background:
    linear-gradient(rgba(238, 236, 222, .78), rgba(232, 240, 229, .78)),
    url("assets/chat-pattern.png") center/260px auto repeat;
}

.chat-bubble {
  width: fit-content;
  max-width: 86%;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 7px;
  padding: 7px 9px 5px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}

.chat-bubble.mine {
  align-self: flex-end;
  background: #d9fdd3;
}

.chat-bubble.theirs {
  align-self: flex-start;
  background: #fff;
}

.chat-author {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.chat-text {
  margin-top: 4px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.chat-delete {
  min-height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #7fb7d8;
  font: inherit;
  font-weight: 600;
}

.chat-checks {
  color: #39a9e0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -3px;
}

.chat-delete:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
  text-decoration: underline;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 9px;
  align-items: end;
  border-top: 1px solid var(--line);
  padding: 11px;
  background: #f0f2ef;
}

.chat-form textarea {
  min-height: 40px;
  max-height: 108px;
  border-radius: 20px;
  resize: vertical;
}

.chat-form button {
  border-radius: 20px;
}

.question {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fcfdfb;
}

.question h3 {
  font-size: 16px;
}

.question p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.5;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 13px;
}

.choice-row label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.choice-row input {
  width: auto;
  min-height: 0;
  margin-right: 8px;
}

.choice-row input:disabled {
  cursor: not-allowed;
}

.results-panel {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fcfdfb;
}

.results-list {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.bars {
  display: grid;
  gap: 7px;
}

.bar {
  display: grid;
  grid-template-columns: minmax(94px, max-content) minmax(108px, 1fr) 29px;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
}

.bar span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.bar span:last-child {
  text-align: right;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1ee;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
}

.bar:nth-child(2) .bar-fill {
  background: var(--danger);
}

.bar:nth-child(3) .bar-fill {
  background: var(--warm);
}

.decision {
  align-self: start;
  border-radius: 8px;
  padding: 11px;
  background: var(--warn-bg);
  font-weight: 800;
}

.decision.accepted {
  background: var(--ok-bg);
  color: var(--accent-dark);
}

@media (max-width: 860px) {
  .topbar,
  .member-line,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .hero,
  .result-item,
  .ballot-content {
    grid-template-columns: 1fr;
  }

  .meeting-card {
    align-content: start;
  }

  .choice-row {
    grid-template-columns: 1fr;
  }

  .proposal-item {
    grid-template-columns: 1fr;
  }

  .proposal-form button,
  .proposal-like,
  .chat-form button,
  .profile-form button {
    width: 100%;
  }

  .member-actions,
  .profile-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chat-head,
  .chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .bar {
    grid-template-columns: minmax(96px, max-content) minmax(72px, 1fr) 28px;
  }
}

@media (max-width: 520px) {
  :root {
    font-size: 78%;
  }

  .topbar {
    padding: 12px 14px;
  }

  .topbar .eyebrow,
  .hero,
  .meeting-card {
    display: none;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  .shell {
    width: min(100% - 18px, 520px);
    padding: 12px 0 24px;
  }

  .panel {
    padding: 12px;
    border-radius: 7px;
  }

  .ballot-content,
  .ballot-main,
  .ballot-sidebar,
  .ballot-form,
  .results-list {
    gap: 10px;
  }

  .ballot-content {
    margin-top: 12px;
  }

  .question {
    padding: 12px;
    border-radius: 7px;
  }

  .question h3 {
    font-size: 17px;
    line-height: 1.25;
  }

  .question p {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.38;
  }

  .choice-row {
    gap: 7px;
    margin-top: 10px;
  }

  .choice-row label {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 24px;
    justify-content: stretch;
    justify-items: center;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    font-size: 15px;
    text-align: center;
  }

  .choice-row input {
    justify-self: start;
    flex: 0 0 auto;
    margin-right: 0;
  }

  button {
    min-height: 40px;
  }

  .results-panel,
  .proposals-panel {
    padding: 12px;
  }

  .result-item {
    padding: 12px;
    gap: 10px;
  }

  .chat-window {
    height: 300px;
    padding: 12px;
  }
}
