/* Cristal V2: tokens and shell geometry from original-14-screens.html.
   The prototype stage/gallery is removed; the original embedded app remains. */
:root {
  --noite: #1b2951;
  --noite-900: #0f1529;
  --papel: #f7f2e8;
  --calido: #c8764f;
  --calido-hover: #b86843;
  --calido-pressed: #a85a38;
  --salvia: #6b8e7f;
  --salvia-soft: #dde5df;
  --ambar: #c79850;
  --ambar-soft: #f1e3c8;
  --sangria: #a43b2e;
  --sangria-soft: #ecd3ce;
  --pedra-900: #2a2723;
  --pedra-700: #554c44;
  --pedra-500: #8a7f76;
  --pedra-300: #c2b9b0;
  --pedra-200: #dad0c3;
  --pedra-100: #ede6dd;
  --pedra-050: #f2ebdf;
  --stage: #e5dccb;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", "Helvetica Neue", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --r-card: 14px;
  --r-frame: 18px;
  --r-button: 10px;
  --r-input: 8px;
  --r-pill: 999px;
  --shadow-frame:
    0 1px 0 rgba(27, 41, 81, 0.04), 0 30px 80px -20px rgba(27, 41, 81, 0.18),
    0 60px 120px -40px rgba(27, 41, 81, 0.12);
  --shadow-card: 0 1px 0 rgba(27, 41, 81, 0.04);
  --shadow-pop: 0 12px 40px -12px rgba(27, 41, 81, 0.2);
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--sans);
  background: var(--papel);
  color: var(--pedra-900);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[hidden] {
  display: none !important;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--noite);
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
img {
  max-width: 100%;
}
p {
  overflow-wrap: anywhere;
}
h1,
h2,
h3 {
  color: var(--noite);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
}
h2 {
  font-size: 26px;
  margin: 0 0 16px;
}
h3 {
  font-size: 20px;
  margin: 0 0 8px;
}
p {
  margin: 0 0 14px;
}
small {
  font-size: 11px;
}
:focus-visible {
  outline: 3px solid var(--calido);
  outline-offset: 3px;
}
::selection {
  background: var(--ambar-soft);
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 1000;
  background: var(--papel);
  border: 2px solid var(--noite);
  padding: 12px;
}
.skip-link:focus {
  top: 12px;
}
.boot-message {
  max-width: 620px;
  margin: 18vh auto;
  padding: 30px;
}
.screen {
  min-width: 0;
}
/* Reviewed proposals: same paper, ink and local type as the secretary. */
.proposals-space {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--pedra-200);
}
.proposal-composer {
  margin: 24px 0;
}
.proposal-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  align-items: start;
}
.proposal-card {
  min-width: 0;
  border-top: 3px solid var(--calido);
}
.proposal-details {
  display: grid;
  grid-template-columns: minmax(96px, 0.35fr) minmax(0, 1fr);
  gap: 10px 16px;
  padding: 20px 0;
  margin: 0 0 20px;
  border-top: 1px solid var(--pedra-200);
  border-bottom: 1px solid var(--pedra-200);
}
.proposal-details dt {
  color: var(--pedra-700);
}
.proposal-details dd {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.proposal-review {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.proposal-review .proposal-details,
.proposal-review .checkbox-field,
.proposal-review .error {
  width: 100%;
}
.proposal-review .checkbox-field {
  padding: 14px;
  background: var(--pedra-100);
  border-radius: var(--r-input);
}
@media (max-width: 480px) {
  .proposal-details {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }
  .proposal-details dd {
    margin-bottom: 12px;
  }
  .proposal-review button,
  .proposal-composer button {
    width: 100%;
  }
}
.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--papel);
}
.app-sidebar {
  background: var(--noite);
  color: var(--papel);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 242, 232, 0.22) transparent;
}
.lock {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-sidebar .lock {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid rgba(247, 242, 232, 0.1);
}
.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1;
  font-weight: 400;
}
.app-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-sidebar a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: 8px;
  color: rgba(247, 242, 232, 0.78);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
  position: relative;
  min-height: 40px;
}
.app-sidebar a:hover,
.app-sidebar a.active {
  background: rgba(247, 242, 232, 0.08);
  color: var(--papel);
}
.app-sidebar a.active:before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--calido);
  border-radius: 0 3px 3px 0;
}
.app-sidebar .group-label {
  font-family: var(--mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(247, 242, 232, 0.6);
  margin: 18px 12px 6px;
}
.app-sidebar .foot {
  margin-top: auto;
  padding: 22px 12px 0;
  border-top: 1px solid rgba(247, 242, 232, 0.08);
}
.who {
  font-size: 12.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.app-main {
  display: flex;
  flex-direction: column;
  background: var(--papel);
  min-width: 0;
}
.app-top {
  min-height: 64px;
  border-bottom: 1px solid var(--pedra-300);
  display: flex;
  align-items: center;
  padding: 10px 32px;
  gap: 16px;
  background: var(--papel);
}
.greet {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--noite);
}
.right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cristal-status {
  padding: 6px 14px;
  background: var(--pedra-100);
  border: 1px solid var(--pedra-200);
  border-radius: var(--r-pill);
  font-size: 11px;
  color: var(--pedra-700);
}
.menu-button {
  display: none !important;
}
.app-content {
  padding: 36px 40px 56px;
  flex: 1;
  max-width: 1640px;
  width: 100%;
  margin: 0 auto;
}
.page-h {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}
.page-h h1 {
  font-size: 38px;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.05;
}
.page-h p {
  margin: 8px 0 0;
  color: var(--pedra-700);
  font-size: 14px;
  max-width: 640px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-button);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    background 0.15s,
    border-color 0.15s;
  line-height: 1.3;
  min-height: 42px;
  white-space: normal;
  text-align: center;
}
.btn-primary {
  background: var(--calido);
  color: var(--noite-900);
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--calido-hover);
  color: var(--papel);
}
.btn-primary:active {
  background: var(--calido-pressed);
}
.btn-secondary {
  background: transparent;
  color: var(--noite);
  border-color: var(--pedra-300);
}
.btn-secondary:hover {
  background: var(--pedra-100);
}
.btn-danger {
  background: transparent;
  color: var(--sangria);
  border-color: var(--sangria);
}
.btn-danger:hover {
  background: var(--sangria);
  color: var(--papel);
}
.btn-large {
  padding: 14px 24px;
  font-size: 14.5px;
}
.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.4;
}
.pill-neutral {
  background: var(--pedra-100);
  color: var(--pedra-700);
}
.pill-warn {
  background: var(--ambar-soft);
  color: #6b4f1a;
}
.pill-info {
  background: #dde3ee;
  color: var(--noite);
}
.card {
  background: var(--papel);
  border: 1px solid var(--pedra-300);
  border-radius: var(--r-card);
  padding: 22px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-h h2 {
  font-size: 22px;
  margin: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.stat {
  background: var(--papel);
  border: 1px solid var(--pedra-300);
  border-radius: var(--r-card);
  padding: 18px 20px 20px;
  min-width: 0;
}
.stat .label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pedra-700);
  margin-bottom: 8px;
}
.stat .v {
  font-family: var(--serif);
  font-size: clamp(24px, 2.9vw, 38px);
  color: var(--noite);
  line-height: 1.1;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.stat:nth-child(3) {
  border-color: rgba(200, 118, 79, 0.5);
}
.dash-hero {
  background: linear-gradient(
    180deg,
    rgba(200, 118, 79, 0.08),
    transparent 80%
  );
  border: 1px solid var(--pedra-300);
  border-radius: var(--r-card);
  padding: 26px 28px;
  margin-bottom: 30px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: center;
}
.dash-hero h2 {
  font-size: 28px;
  margin: 10px 0;
}
.dash-hero p {
  margin: 0;
  color: var(--pedra-700);
}
.dash-hero > .btn {
  justify-self: end;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--calido-pressed);
}
.two-col-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  align-items: start;
}
.resource-list {
  display: flex;
  flex-direction: column;
}
.resource-row {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--pedra-200);
  min-width: 0;
}
.resource-row:first-child {
  border-top: 0;
}
.row-copy {
  min-width: 0;
  flex: 1;
}
.row-copy h3 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.row-meta {
  font-size: 11px;
  color: var(--pedra-700);
  font-family: var(--mono);
  margin: 0;
  line-height: 1.7;
}
.row-notes {
  font-size: 13px;
  color: var(--pedra-700);
  white-space: pre-wrap;
  margin: 8px 0 0;
}
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.row-actions .btn {
  font-size: 12px;
  padding: 8px 10px;
  min-height: 36px;
}
.two-col-grid .resource-row {
  flex-wrap: wrap;
}
.two-col-grid .row-actions {
  width: 100%;
}
.empty {
  padding: 24px 0;
  color: var(--pedra-700);
  font-size: 13px;
  line-height: 1.7;
  margin: 0;
}
.empty:empty,
.error:empty {
  display: none;
}
.muted {
  color: var(--pedra-700);
  font-size: 13px;
}
.scope-note {
  padding: 14px 18px;
  border-left: 2px solid var(--calido);
  background: var(--pedra-050);
  font-size: 12px;
  color: var(--pedra-700);
  margin: 0 0 22px;
  line-height: 1.7;
}
.error {
  color: var(--sangria);
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notice {
  padding: 12px 24px;
  background: var(--salvia-soft);
  color: #2d5345;
  border-bottom: 1px solid var(--salvia);
}
.notice.error {
  background: var(--sangria-soft);
  color: var(--sangria);
  border-color: var(--sangria);
}
.future {
  padding: 36px;
  max-width: 760px;
}
.future h2 {
  margin-top: 24px;
}
.future p {
  color: var(--pedra-700);
  max-width: 640px;
  margin-bottom: 0;
}
.field,
.login-form > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--pedra-700);
  font-size: 12px;
  font-weight: 500;
}
input,
select,
textarea {
  background: var(--papel);
  border: 1px solid var(--pedra-300);
  border-radius: var(--r-input);
  padding: 12px 14px;
  color: var(--pedra-900);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--calido);
  box-shadow: 0 0 0 3px rgba(200, 118, 79, 0.15);
}
textarea {
  min-height: 94px;
  resize: vertical;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--noite);
}
.checkbox-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-block: 1px solid var(--pedra-200);
}
input[type="file"] {
  font-size: 12px;
  padding: 10px;
}
input[type="file"]::file-selector-button {
  border: 0;
  background: var(--pedra-100);
  color: var(--noite);
  padding: 8px;
  border-radius: 6px;
  margin-right: 10px;
}
.editor {
  border: 1px solid var(--pedra-200);
  border-radius: 10px;
  padding: 20px;
  background: var(--pedra-050);
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
}
.editor h3,
.editor > .error,
.editor > .muted,
.editor .form-actions,
.editor .field:has(textarea),
.editor .field:has(input[type="file"]) {
  grid-column: 1/-1;
}
.editor .field {
  font-size: 11px;
}
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.two-col-grid .editor {
  grid-template-columns: minmax(0, 1fr);
}
.login {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100dvh;
}
.login-art {
  background: var(--noite);
  color: var(--papel);
  padding: 56px 56px 40px;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.login-art:after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(200, 118, 79, 0.3), transparent 60%);
  pointer-events: none;
}
.login-art .wordmark {
  font-size: 26px;
}
.login-art .quote {
  margin-top: auto;
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 540px;
  padding-top: 100px;
}
.attribution {
  margin-top: 28px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 242, 232, 0.7);
}
.login-form {
  background: var(--papel);
  padding: 88px 64px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 660px;
  width: 100%;
  margin: auto;
}
.login-form .eyebrow {
  margin-bottom: 18px;
}
.login-form h1 {
  font-size: 42px;
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}
.login-form .lede {
  color: var(--pedra-700);
  font-size: 16px;
  line-height: 1.55;
  margin: 0 0 36px;
  max-width: 420px;
}
.login-form .footer-note {
  margin-top: 28px;
  font-size: 12.5px;
  color: var(--pedra-700);
  line-height: 1.55;
}
.login-form .error {
  margin-top: 16px;
}
.settings-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.settings-form h2 {
  font-size: 24px;
}
.capability-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--pedra-200);
  padding: 15px 0;
}
.capability-row strong {
  font-size: 12px;
  font-weight: 500;
}
.capability-row small {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--pedra-700);
}
.capability-row:last-of-type {
  margin-bottom: 24px;
}
.filter-bar {
  display: flex;
  align-items: end;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.filter-bar .field {
  margin: 0;
}
.report-paper {
  background: var(--papel);
  border: 1px solid var(--pedra-300);
  padding: 44px 48px;
  max-width: 960px;
  box-shadow: var(--shadow-card);
  border-radius: 4px;
}
.report-paper h2 {
  font-size: 38px;
  margin: 16px 0;
}
.report-paper > .muted {
  font-family: var(--mono);
  font-size: 12px;
  margin-bottom: 32px;
}
.report-totals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.chat-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  border: 1px solid var(--pedra-300);
  border-radius: var(--r-card);
  overflow: hidden;
  min-height: 560px;
}
.chat-side {
  padding: 24px;
  background: var(--pedra-050);
  border-right: 1px solid var(--pedra-300);
}
.chat-side h2 {
  font-size: 25px;
  margin: 20px 0;
}
.chat-side .scope-note {
  padding: 12px;
  font-size: 11px;
  background: var(--papel);
}
.chat-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-messages {
  padding: 24px;
  min-height: 220px;
  max-height: 55dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.message {
  padding: 16px 18px;
  border-radius: 12px;
  max-width: 90%;
  border: 1px solid var(--pedra-200);
  background: var(--pedra-050);
  align-self: flex-start;
}
.message.user {
  background: var(--salvia-soft);
  border-color: var(--salvia-soft);
  align-self: flex-end;
}
.message > strong {
  font-size: 11px;
  color: var(--noite);
  font-weight: 600;
}
.message-content {
  white-space: pre-wrap;
  margin: 8px 0 12px;
  line-height: 1.7;
}
.message-meta {
  font-family: var(--mono);
  color: var(--pedra-700);
  font-size: 9px;
  overflow-wrap: anywhere;
}
.chat-composer {
  padding: 22px;
  border-top: 1px solid var(--pedra-200);
  margin-top: auto;
}
.chat-composer .field {
  margin-bottom: 12px;
}
.chat-composer textarea {
  min-height: 90px;
}
.chat-composer select {
  max-width: 320px;
}
.dictation-control {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 12px;
}
.dictation-control .btn {
  min-height: 36px;
  padding: 6px 10px;
}
.dictation-control [data-dictation-error] {
  flex-basis: 100%;
  margin: 0;
}
.dictation-control [data-dictation-error]:empty {
  display: none;
}
.dictation-control [hidden] {
  display: none;
}
#mobile .two-col-grid {
  grid-template-columns: minmax(0, 1fr);
}
#mobile {
  max-width: 700px;
  margin: auto;
}
#mobile .stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 480px) {
  .app .stats-grid,
  #mobile .stats-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (min-width: 1700px) {
  .app-content {
    padding-top: 48px;
  }
  .stats-grid {
    gap: 20px;
  }
}
@media (max-width: 1180px) {
  .app-content {
    padding: 28px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-col-grid,
  .settings-page {
    grid-template-columns: minmax(0, 1fr);
  }
  .two-col-grid .editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .cristal-status {
    display: none;
  }
  .login-form {
    padding: 56px 40px;
  }
  .report-totals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .row-actions {
    flex-shrink: 1;
  }
}
@media (max-width: 760px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    bottom: 0;
    height: calc(100dvh - 64px);
    width: min(300px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    z-index: 30;
    box-shadow: var(--shadow-pop);
  }
  .app-sidebar.open {
    transform: translateX(0);
    visibility: visible;
  }
  .app-top {
    position: sticky;
    top: 0;
    z-index: 40;
    min-height: 64px;
    padding: 10px 16px;
    gap: 12px;
  }
  .greet {
    font-size: 14px;
  }
  .menu-button {
    display: inline-flex !important;
  }
  .right {
    gap: 8px;
  }
  .app-content {
    padding: 26px 18px 44px;
  }
  .page-h {
    margin-bottom: 24px;
  }
  .page-h h1 {
    font-size: 34px;
  }
  .page-h p {
    font-size: 13px;
  }
  .dash-hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px;
    gap: 18px;
    margin-bottom: 24px;
  }
  .dash-hero > .btn {
    justify-self: start;
  }
  .dash-hero h2 {
    font-size: 26px;
  }
  .stats-grid {
    gap: 10px;
    margin-bottom: 24px;
  }
  .stat {
    padding: 16px 14px;
  }
  .stat .v {
    font-size: 28px;
  }
  .stat .label {
    font-size: 9px;
    letter-spacing: 0.08em;
  }
  .two-col-grid {
    gap: 18px;
  }
  .card {
    padding: 18px;
  }
  .card-h {
    gap: 10px;
    align-items: start;
    flex-wrap: wrap;
  }
  .card-h h2 {
    font-size: 23px;
    margin: 6px 0;
  }
  .btn {
    min-height: 44px;
    padding: 10px 14px;
  }
  .resource-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .row-actions .btn {
    min-height: 44px;
  }
  .row-actions {
    width: 100%;
  }
  .editor,
  .two-col-grid .editor {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .editor .field {
    font-size: 12px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .login {
    grid-template-columns: minmax(0, 1fr);
    min-height: 100dvh;
  }
  .login-art {
    padding: 28px 26px;
    min-height: 250px;
  }
  .login-art .quote {
    font-size: 27px;
    max-width: 440px;
    margin-top: 36px;
    padding-top: 0;
  }
  .login-art .attribution {
    font-size: 9px;
    margin-top: 18px;
  }
  .login-art:after {
    width: 300px;
    height: 300px;
  }
  .login-form {
    padding: 38px 26px 40px;
    max-width: none;
  }
  .login-form h1 {
    font-size: 36px;
  }
  .login-form .lede {
    font-size: 14px;
    margin-bottom: 28px;
  }
  .login-form .footer-note {
    margin-top: 20px;
  }
  .future {
    padding: 26px;
  }
  .future h2 {
    font-size: 25px;
  }
  .chat-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .chat-side {
    border-right: 0;
    border-bottom: 1px solid var(--pedra-300);
    padding: 18px;
  }
  .chat-side h2 {
    margin: 10px 0;
    font-size: 24px;
  }
  .chat-side .scope-note {
    margin-bottom: 12px;
  }
  .chat-side > p:last-child {
    margin-bottom: 0;
  }
  .chat-messages {
    padding: 18px;
    max-height: 55dvh;
  }
  .message {
    max-width: 96%;
    padding: 14px;
  }
  .chat-composer {
    padding: 18px;
  }
  .chat-composer .btn {
    width: 100%;
  }
  .report-paper {
    padding: 26px 20px;
  }
  .report-paper h2 {
    font-size: 30px;
  }
  .report-totals {
    grid-template-columns: minmax(0, 1fr);
  }
  .report-totals .stat {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
  }
  .report-totals .label {
    margin: 0;
  }
  .filter-bar {
    gap: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .filter-bar > .btn {
    grid-column: 1/-1;
  }
  .capability-row {
    align-items: start;
    flex-direction: column;
  }
  .notice {
    padding: 12px 18px;
  }
  .scope-note {
    padding: 12px 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
/* Home: the secretary is the workspace, the summary is context. */
.home-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(280px, 1fr);
  gap: 32px;
  align-items: start;
}
.home-secretary,
.owner-voice { min-width: 0; }
.owner-voice {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border, #d5dce8);
  border-radius: .75rem;
  background: var(--surface, #fff);
}
.owner-voice h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
.voice-consent { display: block; margin-bottom: .75rem; }
.owner-voice button { margin-right: .5rem; margin-bottom: .5rem; }
.voice-audio audio { max-width: 100%; }
.home-secretary,
.home-summary {
  min-width: 0;
}
.home-secretary .chat-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.home-secretary .chat-side {
  padding: 22px 24px 0;
  border: 0;
  background: var(--papel);
}
.home-secretary .chat-side h2 {
  margin: 8px 0;
  font-size: 30px;
}
.home-secretary .chat-side .scope-note {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
  font-size: 12px;
}
.home-secretary .chat-side > p:last-child {
  margin-bottom: 16px;
}
.home-secretary .chat-messages {
  min-height: 160px;
  max-height: 360px;
  border-top: 1px solid var(--pedra-200);
}
.home-secretary .chat-composer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}
.home-secretary .chat-composer > :first-child,
.home-secretary .chat-composer > p,
.home-secretary .chat-composer > button {
  grid-column: 1 / -1;
}
.home-secretary .chat-composer > button {
  justify-self: start;
}
.home-secretary .chat-composer select {
  max-width: none;
  padding: 10px;
  font-size: 13px;
}
.home-secretary .proposals-space {
  margin-top: 24px;
  padding-top: 24px;
}
.home-summary {
  padding: 0 0 0 24px;
  border-left: 1px solid var(--pedra-200);
}
.home-summary h2 {
  font-size: 25px;
  margin: 8px 0 16px;
}
.home-summary .stats-grid {
  display: block;
  margin-bottom: 16px;
}
.home-summary .stat {
  background: none;
  border: 0;
  border-top: 1px solid var(--pedra-200);
  border-radius: 0;
  padding: 16px 0;
}
.home-summary .stat .label {
  font-family: var(--sans);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 6px;
}
.home-summary .stat .v {
  font-size: 26px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.home-summary .stat p {
  font-size: 12px;
  margin: 8px 0 12px;
}
.home-summary .btn {
  min-height: 44px;
}
.attention-preview ul {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.attention-preview li {
  font-size: 13px;
  overflow-wrap: anywhere;
  margin-bottom: 10px;
}
.attention-preview strong {
  font-weight: 500;
}
.home-details {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--pedra-300);
}
.home-detail {
  border-bottom: 1px solid var(--pedra-200);
}
.home-detail > summary {
  padding: 16px 8px;
  cursor: pointer;
  color: var(--noite);
  font-weight: 500;
  min-height: 48px;
}
.home-detail[open] > summary {
  background: var(--pedra-050);
}
.home-detail .resource {
  margin: 12px 0 20px;
}
@media (max-width: 1100px) {
  .home-workspace {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .home-summary {
    padding: 0;
    border-left: 0;
  }
  .home-summary .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
  }
}
@media (max-width: 480px) {
  .home-secretary .chat-side {
    padding: 18px 18px 0;
  }
  .home-secretary .chat-composer {
    display: block;
  }
  .home-secretary .chat-composer select {
    font-size: 16px;
  }
  .home-summary .stats-grid {
    display: block;
  }
}
/* Home command workspace: conversation owns its scroll, not the page. */
#painel .page-h { margin-bottom: 12px; }
#painel .page-h h1 { font-size: 29px; }
#painel .page-h p { margin-top: 2px; }
.home-workspace { height: calc(100dvh - 64px - 36px - 56px - 12px); min-height: 510px; gap: 18px; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); align-items: stretch; }
.home-secretary { display: flex; flex-direction: column; min-height: 0; }
.home-secretary .chat-layout { flex: 1; min-height: 0; height: 100%; background: var(--papel); }
.home-secretary .chat-side { flex: none; padding: 14px 20px 10px; }
.home-secretary .chat-side h2 { font-size: 24px; margin: 2px 0; }
.home-secretary .chat-side > p { display: none; }
.home-secretary .chat-panel { flex: 1; min-height: 0; }
.home-secretary .chat-messages { flex: 1; min-height: 0; max-height: none; padding: 14px 18px; gap: 10px; }
.home-secretary .message { padding: 10px 14px; font-size: 14px; }
.home-secretary .message-content { margin: 5px 0; line-height: 1.5; }
.home-secretary .message-meta { font-size: 11px; }
.home-secretary .chat-composer { display: flex; flex-direction: column; gap: 7px; margin: 0; padding: 12px 18px 14px; flex: none; background: var(--pedra-050); }
.home-secretary .chat-composer .field { margin: 0; min-width: 0; }
.home-secretary .chat-composer textarea { min-height: 64px; height: 72px; resize: vertical; }
.home-secretary .chat-composer select { max-width: none; width: 100%; }
.home-secretary .composer-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.home-secretary .attachment-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; }
.home-secretary .attachment-picker input { min-width: 0; max-width: 100%; font-size: 12px; }
.home-secretary .attachment-hint, .home-secretary .chat-composer > .muted { margin: 0; font-size: 11px; line-height: 1.3; }
.home-secretary .chat-composer .error:empty, .home-secretary .attachment-chips:empty { display: none; }
.home-secretary .chat-composer .error { margin: 0; font-size: 12px; }
.home-secretary .attachment-chips { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 0; }
.home-secretary .attachment-chip { display: flex; align-items: center; gap: 5px; max-width: 100%; font-size: 12px; overflow-wrap: anywhere; background: var(--papel); border: 1px solid var(--pedra-300); border-radius: 8px; padding: 3px 6px; }
.home-secretary .attachment-chip .btn { padding: 5px; }
.home-secretary .composer-dictation > summary { cursor: pointer; font-size: 12px; min-height: 30px; }
.home-secretary .chat-composer > button { align-self: flex-start; min-height: 44px; }
.home-context { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-left: 1px solid var(--pedra-300); padding: 10px 12px 20px 18px; scrollbar-width: thin; }
.home-context-header { display: flex; align-items: center; justify-content: space-between; }
.home-context .home-summary { padding: 0; border: 0; }
.home-context .home-summary h2 { font-size: 21px; margin: 6px 0; }
.home-context .home-summary .stat { padding: 9px 0; }
.home-context .home-summary .stat .v { font-size: 21px; }
.home-context .home-summary .stat p { margin: 4px 0; }
.home-context .home-details { margin-top: 16px; padding-top: 12px; }
.home-context .proposals-space { padding-top: 12px; }
.home-context .proposal-card { min-width: 0; overflow-wrap: anywhere; }
.home-context-toggle, .home-context-close { display: none; }
@media (max-width: 1100px) {
 .home-workspace { grid-template-columns: minmax(0,1fr) minmax(240px,290px); gap: 10px; }
 .home-summary .stats-grid { display: block; }
}
@media (max-width: 760px) {
 #painel .page-h { margin-bottom: 8px; }
 #painel .page-h h1 { font-size: 25px; }
 #painel .page-h p { display: none; }
 .home-context-toggle { display: inline-flex; min-height: 44px; margin-bottom: 8px; }
 .home-workspace { display: block; height: calc(100dvh - 64px - 26px - 44px - 8px - 43px - 16px); min-height: 0; }
 .home-secretary { height: 100%; }
 .home-secretary .chat-side { padding: 10px 14px 8px; }
 .home-secretary .chat-side h2 { font-size: 21px; }
 .home-secretary .chat-messages { padding: 10px 12px; }
 .home-secretary .chat-composer { padding: 8px 12px 10px; gap: 4px; }
 .home-secretary .chat-composer textarea { height: 58px; min-height: 58px; }
 .home-secretary .composer-controls { gap: 5px; }
 .home-secretary .composer-controls select { min-height: 44px; font-size: 13px; }
 .home-secretary .attachment-picker { min-height: 44px; }
 .home-secretary .attachment-hint, .home-secretary .chat-composer > .muted { font-size: 10px; }
 .home-secretary .chat-composer > button { width: 100%; }
 .home-secretary .composer-dictation > summary { min-height: 44px; display: flex; align-items: center; }
 .home-context { display: none; position: fixed; z-index: 60; top: 64px; right: 0; bottom: 0; width: min(390px,100vw); background: var(--papel); box-shadow: var(--shadow-pop); overflow-y: auto; padding: 18px; }
 .home-context.open { display: block; }
 .home-context-close { display: inline-flex; min-height: 44px; }
}
/* Agent Home: command surface, compact until the owner opens more controls. */
.app-content.agent-home-content {
  flex: 1;
  min-height: 0;
  padding: 0;
}
.agent-home-content #painel {
  height: calc(100dvh - 64px);
  min-height: 0;
}
.agent-home-content .home-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.agent-home-content .home-workspace {
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 14px 18px;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
}
.agent-home-content .home-secretary,
.agent-home-content .chat-panel {
  min-height: 0;
}
.agent-home-content .home-secretary .chat-layout {
  height: 100%;
  min-height: 0;
}
.agent-home-content .home-secretary .chat-side {
  padding: 10px 16px;
}
.agent-home-content .chat-side h1 {
  font-size: 22px;
  margin: 2px 0;
  line-height: 1.2;
}
.agent-home-content .home-secretary .chat-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  padding: 14px 18px;
}
.agent-home-content .chat-empty {
  width: min(100%, 560px);
  margin: auto;
  padding: 18px;
}
.agent-home-content .chat-empty h2 {
  margin: 8px 0 10px;
  font-size: clamp(23px, 2.5vw, 31px);
}
.agent-home-content .chat-empty p {
  max-width: 470px;
  font-size: 14px;
  line-height: 1.55;
}
.agent-home-content .chat-starters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.agent-home-content .chat-starters .btn {
  min-height: 44px;
  width: auto;
  font-size: 12px;
}
.agent-home-content .home-secretary .chat-composer {
  display: flex;
  flex-direction: column;
  flex: none;
  gap: 5px;
  padding: 8px 14px 9px;
}
.agent-home-content .chat-composer .field {
  margin: 0;
  min-width: 0;
  font-size: 11px;
}
.agent-home-content .chat-composer textarea {
  height: 52px;
  min-height: 52px;
  max-height: 150px;
  resize: vertical;
}
.agent-home-content .composer-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
}
.agent-home-content .attachment-picker,
.agent-home-content .composer-options > summary,
.agent-home-content .composer-dictation > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid var(--pedra-300);
  border-radius: var(--r-button);
  background: var(--papel);
  color: var(--noite);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}
.agent-home-content .attachment-picker {
  position: relative;
  flex: none;
}
.agent-home-content .attachment-picker input {
  position: absolute;
  width: 1px;
  max-width: 1px;
  min-width: 0;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
.agent-home-content .attachment-picker:focus-visible,
.agent-home-content .composer-options > summary:focus-visible {
  outline: 3px solid var(--calido);
  outline-offset: 2px;
}
.agent-home-content .composer-options {
  min-width: 0;
  margin-right: auto;
}
.agent-home-content .composer-options > summary {
  list-style: none;
}
.agent-home-content .composer-options > summary::-webkit-details-marker {
  display: none;
}
.agent-home-content .composer-options[open] {
  align-self: stretch;
}
.agent-home-content .composer-options[open] .composer-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}
.agent-home-content .composer-options .muted {
  margin: 4px 0;
  font-size: 11px;
}
.agent-home-content .composer-actions > button[type="submit"] {
  flex: none;
  width: auto;
  min-height: 44px;
  margin-left: auto;
  padding: 8px 18px;
  white-space: nowrap;
}
.agent-home-content .composer-keyboard-help {
  color: var(--pedra-700);
  font-size: 11px;
  text-align: right;
}
.agent-home-content .attachment-hint:empty,
.agent-home-content .attachment-chips:empty,
.agent-home-content .chat-composer .error:empty {
  display: none;
}
.agent-home-content .attachment-hint {
  margin: 0;
  font-size: 11px;
}
.agent-home-content .home-context .home-summary .stat {
  padding: 8px 0;
}
@media (max-width: 760px) {
  .agent-home-content #painel {
    height: calc(100dvh - 64px);
  }
  .agent-home-content .home-context-toggle {
    flex: none;
    margin: 8px 10px 6px;
  }
  .agent-home-content .home-workspace {
    display: block;
    flex: 1;
    height: auto;
    min-height: 0;
    padding: 0 8px 8px;
  }
  .agent-home-content .home-secretary {
    height: 100%;
  }
  .agent-home-content .home-secretary .chat-side {
    padding: 8px 12px;
  }
  .agent-home-content .home-secretary .chat-messages {
    padding: 10px 12px;
  }
  .agent-home-content .home-secretary .chat-composer {
    padding: 7px 11px 9px;
  }
  .agent-home-content .chat-composer textarea {
    height: 48px;
    min-height: 48px;
  }
  .agent-home-content .composer-actions {
    gap: 5px;
  }
  .agent-home-content .composer-actions .btn,
  .agent-home-content .composer-options > summary {
    width: auto;
    padding: 7px 9px;
    font-size: 12px;
  }
  .agent-home-content .composer-keyboard-help {
    font-size: 10px;
  }
}
@media print {
  .app {
    display: block;
  }
  .app-sidebar,
  .app-top,
  .page-h,
  .filter-bar,
  .skip-link,
  .notice,
  .report-paper .btn {
    display: none !important;
  }
  .app-content {
    padding: 0;
  }
  .report-paper {
    border: 0;
    padding: 20px;
    box-shadow: none;
  }
  .report-totals {
    grid-template-columns: repeat(3, 1fr);
  }
}
