/* Demand reading order: problem, status, participation, place, records, source. */
.obras-site .obras-demand-page .obras-detail-hero { padding-block: 24px; }
.obras-site .obras-demand-page .obras-detail-hero h1 { max-width: 36ch; font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.2rem); text-wrap: balance; overflow-wrap: anywhere; }
.obras-site .obras-demand-address { max-width: 70ch; margin: 12px 0; font-size: 1.05rem; line-height: 1.5; color: #fff; }
.obras-site .obras-demand-description { max-width: 70ch; line-height: 1.6; }
.obras-site .obras-demand-layout { display: block; max-width: 1100px; }
.obras-demand-main, .obras-demand-sidebar { min-width: 0; }
.obras-site .obras-demand-current { padding: 24px; border: 1px solid #d4c5e4; border-left: 4px solid #68458c; border-radius: 6px; background: #fff; }
.obras-site .obras-demand-current .eyebrow { color: #68458c; margin: 0 0 10px; }
.obras-site .obras-demand-current h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.65rem); margin-bottom: 10px; }
.obras-site .obras-demand-current p { max-width: 75ch; line-height: 1.55; }
.obras-demand-latest { border-top: 1px solid #e4dde9; margin-top: 18px; padding-top: 16px; }
.obras-demand-latest strong { font-size: .875rem; }
.obras-demand-latest p { margin-block: 8px; }
.obras-demand-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.obras-site .obras-demand-page .obras-demand-actions a { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; text-align: center; margin: 0; }
.obras-demand-page details > summary { cursor: pointer; padding-block: 12px; min-height: 44px; box-sizing: border-box; }
.obras-demand-page :is(p, li, blockquote, .obras-demand-comments, .obras-public-contributions) { overflow-wrap: anywhere; }
.obras-site .obras-demand-sidebar { position: static; display: block; max-width: 720px; margin-top: 28px; }
.obras-site .obras-demand-sidebar > section { margin-bottom: 16px; }
.obras-site .obras-demand-sidebar > section:first-child { background: #fff; }
.obras-site .obras-demand-page .obras-context-map { height: 320px; min-height: 260px; }
.obras-demand-page .obras-demand-section { scroll-margin-top: 88px; }
.obras-demand-page a:focus-visible, .obras-demand-page summary:focus-visible { outline: 3px solid #68458c; outline-offset: 4px; }
@media (max-width: 640px) {
  .obras-site .obras-demand-current { padding: 18px; }
  .obras-demand-actions { flex-direction: column; }
  .obras-site .obras-demand-page .obras-demand-actions a { width: 100%; }
  .obras-site .obras-demand-page .obras-detail-hero h1 { font-size: 1.6rem; }
  .obras-site .obras-demand-page .obras-context-map { height: 280px; }
  .obras-site .obras-demand-document { padding: 16px; }
  .obras-demand-page .obras-demand-meta { flex-wrap: wrap; }
  .obras-demand-page .obras-demand-section__heading > a { min-height: 44px; display: inline-flex; align-items: center; }
}

.obras-site .obras-demand-document .obras-source-document { font-size: 1rem; }
.obras-site .obras-demand-page .obras-source-document > div { max-height: none; overflow: visible; max-width: 75ch; }

/* Editorial header: context at a glance, without duplicating citizen reports. */
.obras-site .obras-demand-page .obras-demand-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 32px; align-items: center; }
.obras-demand-hero-copy { min-width: 0; }
.obras-site .obras-demand-page .obras-demand-estimate { padding: 24px; border: 1px solid #d7c9e6; border-radius: 10px; background: #f6f2fa; min-width: 0; }
.obras-site .obras-demand-page .obras-demand-estimate :is(p, small, summary, h2) { color: #30213d; }
.obras-site .obras-demand-page .obras-demand-estimate .eyebrow { margin: 0 0 10px; color: #62467b; font-size: .8rem; }
.obras-site .obras-demand-page .obras-demand-estimate h2 { font-size: 1.5rem; line-height: 1.25; margin: 0 0 12px; }
.obras-site .obras-demand-page .obras-demand-estimate p { font-size: .94rem; line-height: 1.5; margin: 10px 0; }
.obras-site .obras-demand-page .obras-demand-estimate small { display: block; font-size: .8rem; line-height: 1.5; }
.obras-site .obras-demand-page .obras-demand-estimate a { color: #553579; }
.obras-site .obras-demand-page .obras-demand-estimate summary { font-size: .9rem; font-weight: 650; }
.obras-site .obras-demand-sidebar:empty { display: none; }
/* Source metadata has its own spacing and reading hierarchy. */
.obras-site .obras-demand-page .obras-demand-document { padding: 28px; }
.obras-site .obras-demand-document__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.obras-site .obras-demand-document__heading .eyebrow { font-size: .8rem; margin: 0 0 10px; }
.obras-site .obras-demand-document__heading h3 { font-size: 1.35rem; margin: 0; }
.obras-document-date { display: grid; gap: 6px; flex: 0 0 auto; }
.obras-document-date span, .obras-site .obras-document-label { font-size: .8rem; color: #65546e; }
.obras-site .obras-demand-document .obras-document-label { margin: 0 0 10px; }
.obras-site .obras-demand-document .obras-source-authors { margin: 0 0 24px; gap: 12px; }
.obras-site .obras-demand-document .obras-source-authors a { padding: 10px 14px; gap: 12px; }
.obras-site .obras-demand-document .obras-source-authors small { margin-top: 4px; }
.obras-site .obras-demand-document .obras-demand-document__subject { font-size: 1rem; line-height: 1.6; max-width: 75ch; margin: 0 0 24px; }
.obras-site .obras-demand-document .obras-source-document { margin: 16px 0 0; }
.obras-site .obras-demand-document .obras-source-document summary { padding: 16px; min-height: 52px; background: #f7f4fa; border-radius: 6px; line-height: 1.5; }
.obras-site .obras-demand-document .obras-source-document > div { padding: 16px; }
.obras-site .obras-demand-page .obras-demand-document .obras-source-official-link { margin-top: 24px; min-height: 44px; }
.obras-site .obras-demand-page .obras-demand-timeline { margin-top: 24px; }
/* Native dialogs: focus/Escape handled by the browser; never show a composer initially. */
body.obras-compose-open { overflow: hidden; }
.obras-compose-dialog { width: min(640px, calc(100% - 32px)); max-height: 90vh; max-height: 90dvh; box-sizing: border-box; padding: 28px; border: 1px solid #d7c9e6; border-radius: 12px; color: #261e30; background: #fff; overflow-y: auto; }
.obras-compose-dialog::backdrop { background: #160b26b3; }
.obras-compose-heading { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.obras-compose-heading h2 { margin: 0; font-size: 1.4rem; line-height: 1.35; }
.obras-compose-heading > button { background: #f2edf6; border: 1px solid #d7c9e6; border-radius: 6px; min-width: 44px; min-height: 44px; font-size: 1.5rem; cursor: pointer; }
.obras-posting-as { display: grid; gap: 10px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid #e9e2ee; }
.obras-posting-as > span { color: #65546e; font-size: .875rem; }
.obras-compose-dialog .obras-contribution-form { display: grid; gap: 18px; }
.obras-compose-dialog .obras-contribution-form p { margin: 0; }
.obras-compose-dialog :is(textarea, input:not([type=checkbox]):not([type=hidden])) { width: 100%; box-sizing: border-box; font-size: 1rem; }
.obras-compose-dialog textarea { min-height: 112px; resize: vertical; }
.obras-compose-dialog :is(label, small) { line-height: 1.5; }
.obras-compose-dialog .participant-consent { display: flex; align-items: flex-start; gap: 10px; font-size: .875rem; }
.obras-compose-dialog .participant-consent input { flex: 0 0 auto; margin-top: 4px; width: 20px; height: 20px; }
.obras-compose-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.obras-site .obras-compose-dialog .obras-compose-actions button { min-height: 44px; }
.obras-compose-dialog :is(a, button, input, textarea):focus-visible { outline: 3px solid #68458c; outline-offset: 3px; }
@media (max-width: 760px) {
  .obras-site .obras-demand-page .obras-demand-hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .obras-site .obras-demand-page .obras-demand-estimate { padding: 20px; }
  .obras-site .obras-demand-page .obras-demand-document { padding: 20px; }
  .obras-site .obras-demand-document__heading { flex-direction: column; gap: 16px; }
  .obras-document-date { display: flex; align-items: center; gap: 10px; }
  .obras-compose-dialog { padding: 20px; }
  .obras-compose-actions { flex-direction: column; }
  .obras-site .obras-compose-dialog .obras-compose-actions button { width: 100%; }
}

/* Citizen reports share a clear, calm card rather than floating metadata. */
.obras-site .obras-demand-comments { display: grid; gap: 16px; margin-bottom: 20px; }
.obras-site .obras-demand-page .obras-community-card { padding: 24px; border: 1px solid #cdbfdd; border-left: 4px solid #79579a; border-radius: 10px; background: #eee8f5; color: #30213d; }
.obras-community-card__header { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.obras-site .obras-community-card__header .participant-author { display: inline-flex; align-items: center; gap: 12px; margin: 0; min-width: 0; color: #30213d; }
.obras-site .obras-community-card__header .participant-author img { width: 44px; height: 44px; flex: 0 0 44px; object-fit: cover; border-radius: 50%; }
.obras-community-card__meta { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; color: #614a70; font-size: .85rem; line-height: 1.5; }
.obras-community-card__meta > span { font-weight: 650; }
.obras-site .obras-community-card h3 { margin: 0 0 12px; font-size: 1.1rem; line-height: 1.4; color: #30213d; }
.obras-site .obras-community-card__text { max-width: 75ch; font-size: 1rem; line-height: 1.65; }
.obras-site .obras-community-card__text p { margin: 0 0 12px; }
.obras-site .obras-community-card__text p:last-child { margin-bottom: 0; }
.obras-site .obras-community-card .obras-public-response { margin: 18px 0 0; padding: 14px 16px; background: #fff; border-radius: 6px; }
.obras-compose-attachment summary { cursor: pointer; min-height: 44px; display: list-item; padding-block: 12px; box-sizing: border-box; color: #553579; }
.obras-compose-attachment[open] p { margin-top: 14px; }
@media (max-width: 640px) {
  .obras-site .obras-demand-page .obras-community-card { padding: 18px; }
  .obras-community-card__header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

.obras-community-card { scroll-margin-top: 88px; }
.obras-site .obras-record-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #cdbfdd; background: transparent; }
.obras-site .obras-record-votes { display: flex; gap: 8px; margin: 0; }
.obras-site .obras-record-actions :is(button, a) { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 8px 12px; box-sizing: border-box; border: 1px solid #baa6ce; border-radius: 6px; background: #fff; color: #4c3167; font: inherit; font-size: .875rem; font-weight: 650; text-decoration: none; cursor: pointer; }
.obras-site .obras-record-votes button[aria-pressed="true"] { background: #563778; color: #fff; border-color: #563778; }
.obras-record-votes button > span { font-size: 1.15rem; }
.obras-site .obras-record-actions :is(a, button):focus-visible { outline: 3px solid #563778; outline-offset: 3px; }
.obras-site .obras-record-thread { margin-top: 20px; padding: 20px; border-radius: 8px; background: #fff; }
.obras-site .obras-record-reply { padding-block: 16px; border-top: 1px solid #e1d7eb; }
.obras-record-reply header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.obras-record-reply time { font-size: .8rem; color: #614a70; }
.obras-record-reply p { line-height: 1.6; }
.obras-comment-context { margin: 0 0 20px; padding: 12px 16px; border-left: 3px solid #79579a; background: #eee8f5; line-height: 1.5; }
@media (max-width: 640px) { .obras-site .obras-record-thread { padding: 14px; } }
