:root {
  --green: #123836;
  --green-2: #1d4c49;
  --green-3: #dfe9e5;
  --ink: #182321;
  --muted: #68726f;
  --paper: #f6f4ee;
  --white: #fff;
  --sand: #eee8dc;
  --gold: #b98557;
  --rust: #a64f3e;
  --line: rgba(18, 56, 54, .14);
  --shadow: 0 18px 50px rgba(18, 56, 54, .09);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); }
.env-banner { background:#7a3b12; color:#fff8ee; text-align:center; font-size:.78rem; font-weight:700; letter-spacing:.04em; padding:8px 14px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.button { border: 0; padding: 12px 18px; font-weight: 750; transition: .2s ease; }
.button.primary { color: white; background: var(--green); }
.button.primary:hover { background: var(--gold); }
.button.secondary { color: var(--green); background: transparent; border: 1px solid var(--line); }
.button.secondary:hover { border-color: var(--green); }
.button-group { display: flex; gap: 10px; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, .8fr) 1.2fr; background: white; }
.login-panel { width: min(480px, 100%); align-self: center; justify-self: center; padding: 56px; }
.login-brand img { width: 250px; margin-bottom: 58px; }
.login-panel h1 { margin: 0; color: var(--green); font: 400 clamp(2.5rem, 5vw, 4.2rem)/1 Georgia, serif; }
.login-intro { margin: 18px 0 32px; color: var(--muted); line-height: 1.6; }
.login-panel form { display: grid; gap: 18px; }
.login-panel label, .editor-dialog label, .match-controls label { display: grid; gap: 7px; color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
input, select, textarea { width: 100%; min-height: 43px; padding: 11px 12px; color: var(--ink); background: white; border: 1px solid var(--line); outline: 0; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185, 133, 87, .12); }
.form-status { min-height: 1.4em; margin: 0; color: var(--rust); font-size: .82rem; }
.back-link { display: inline-block; margin-top: 28px; color: var(--green); font-size: .84rem; }
.login-story { position: relative; display: grid; align-items: end; overflow: hidden; min-height: 100vh; padding: 7vw; color: white; background: linear-gradient(20deg, rgba(8, 35, 34, .88), rgba(8, 35, 34, .25)), url("assets/hero-lisboa.png") center/cover; }
.login-story div { max-width: 760px; }
.login-story span { color: var(--gold); font: 400 clamp(5rem, 10vw, 11rem)/.8 Georgia, serif; }
.login-story p { margin: 35px 0 0; font: 400 clamp(1.8rem, 3.3vw, 3.7rem)/1.15 Georgia, serif; }

.app { min-height: 100vh; display: grid; grid-template-columns: 255px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 5; height: 100vh; display: flex; flex-direction: column; padding: 26px 18px; color: white; background: var(--green); }
.sidebar-brand { display: block; margin: 0 10px 35px; padding: 15px; background: white; }
.sidebar-brand img { display: block; width: 100%; }
.network-label { display: grid; grid-template-columns: auto 1fr; column-gap: 9px; align-items: center; margin: 0 10px 25px; }
.network-label small { grid-column: 2; margin-top: 2px; color: rgba(255,255,255,.58); font-size: .7rem; }
.network-dot { width: 8px; height: 8px; border-radius: 50%; background: #75c594; box-shadow: 0 0 0 5px rgba(117,197,148,.13); }
.sidebar nav { display: grid; gap: 5px; overflow-y: auto; }
.nav-item { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 13px; color: rgba(255,255,255,.72); text-align: left; background: transparent; border: 0; border-left: 2px solid transparent; }
.nav-item span { width: 20px; color: var(--gold); font-size: 1.15rem; text-align: center; }
.nav-count { min-width: 22px; margin-left: auto; padding: 3px 6px; color: var(--green); text-align: center; background: var(--gold); border-radius: 999px; font-size: .62rem; }
.nav-item:hover, .nav-item.active { color: white; background: rgba(255,255,255,.08); border-left-color: var(--gold); }
.sidebar-footer { margin-top: auto; display: grid; gap: 10px; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-footer a, .sidebar-footer button { color: rgba(255,255,255,.7); font-size: .78rem; text-align: left; background: transparent; border: 0; padding: 4px 0; }
.workspace { min-width: 0; }
.topbar { min-height: 106px; display: flex; align-items: center; gap: 22px; padding: 22px clamp(24px, 4vw, 58px); background: white; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 0; color: var(--green); font: 400 2rem/1 Georgia, serif; }
.user-chip { display: flex; align-items: center; gap: 11px; margin-left: auto; }
.user-chip div:last-child { display: grid; gap: 2px; }
.user-chip strong { font-size: .82rem; }
.user-chip span { color: var(--muted); font-size: .7rem; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; color: white; font-size: .72rem; font-weight: 800; background: var(--gold); border-radius: 50%; }
.menu-button { display: none; border: 0; color: var(--green); background: transparent; font-size: 1.4rem; }
.view { display: none; padding: clamp(28px, 4vw, 55px); }
.view.active { display: block; }
.welcome-row, .view-actions, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 25px; }
.welcome-row { margin-bottom: 32px; }
.welcome-row h2, .match-hero h2 { margin: 0; color: var(--green); font: 400 clamp(2rem, 4vw, 3.5rem)/1 Georgia, serif; }
.welcome-row p, .view-description { margin: 8px 0 0; color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; min-height: 150px; padding: 23px; overflow: hidden; background: white; border: 1px solid var(--line); }
.stat-card::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 110px; height: 110px; border: 18px solid var(--green-3); border-radius: 50%; }
.stat-card strong { position: relative; z-index: 1; display: block; color: var(--green); font: 400 2.8rem/1 Georgia, serif; }
.stat-card span { position: relative; z-index: 1; display: block; margin-top: 10px; color: var(--muted); font-size: .78rem; }
.stat-card.highlight { color: white; background: var(--green); }
.stat-card.highlight strong, .stat-card.highlight span { color: white; }
.stat-card.highlight::after { border-color: rgba(255,255,255,.08); }
.overview-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; margin-top: 22px; }
.panel { padding: 26px; background: white; border: 1px solid var(--line); }
.panel-head { margin-bottom: 20px; }
.panel h2 { margin: 0; color: var(--green); font: 400 1.55rem Georgia, serif; }
.text-action { color: var(--green); background: transparent; border: 0; font-size: .75rem; font-weight: 700; }
.mini-row { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line); }
.mini-row:first-child { border-top: 0; }
.mini-icon { width: 35px; height: 35px; display: grid; place-items: center; color: var(--green); background: var(--green-3); border-radius: 50%; font-weight: 800; }
.mini-row strong { display: block; font-size: .82rem; }
.mini-row small { color: var(--muted); }
.mini-row time { color: var(--muted); font-size: .7rem; }

.view-actions { margin-bottom: 24px; }
.filters { flex: 1; display: flex; gap: 10px; }
.filters input { max-width: 360px; }
.filters select { width: auto; min-width: 160px; }
.data-list { display: grid; gap: 11px; }
.data-row { display: grid; grid-template-columns: minmax(0, 1.8fr) repeat(3, minmax(120px, .65fr)) auto; gap: 18px; align-items: center; padding: 15px 18px; background: white; border: 1px solid var(--line); }
.data-main { display: flex; align-items: center; gap: 15px; min-width: 0; }
.data-main > div { min-width: 0; }
.property-thumb { flex: 0 0 76px; width: 76px; height: 58px; display: grid; place-items: center; object-fit: cover; color: var(--gold); background: var(--sand); font: 2rem Georgia, serif; }
.data-main h3 { overflow: hidden; margin: 3px 0; color: var(--green); font: 400 1.08rem Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.data-main p, .data-cell small { margin: 0; color: var(--muted); font-size: .72rem; }
.data-cell strong { display: block; margin-bottom: 3px; color: var(--green); font-size: .8rem; }
.badge { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 4px 8px; color: #2d6443; background: #e3f0e8; border-radius: 999px; font-size: .62rem; font-weight: 800; text-transform: uppercase; }
.badge.warning { color: #895e28; background: #f5ead9; }
.badge.muted { color: #66706d; background: #eceeec; }
.badge.network { color: #315c7b; background: #e2edf4; }
.row-actions { display: flex; gap: 7px; justify-content: flex-end; }
.icon-action { padding: 8px 10px; color: var(--green); background: transparent; border: 1px solid var(--line); font-size: .72rem; font-weight: 700; }
.icon-action:hover { border-color: var(--gold); }
.empty-state { padding: 65px 20px; color: var(--muted); text-align: center; background: white; border: 1px dashed var(--line); }

.match-hero { padding: clamp(28px, 5vw, 58px); color: white; background: var(--green); }
.match-hero .eyebrow { color: #d9ae89; }
.match-hero h2 { color: white; }
.match-hero > p:not(.eyebrow) { max-width: 660px; color: rgba(255,255,255,.7); line-height: 1.6; }
.match-controls { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 15px; align-items: end; margin-top: 30px; }
.match-controls label { color: rgba(255,255,255,.7); }
.match-controls > span { align-self: center; padding-top: 20px; color: var(--gold); }
.match-controls select { border: 0; }
.match-controls .button { min-height: 43px; background: var(--gold); }
.match-results { display: grid; gap: 12px; margin-top: 22px; }
.match-row { display: grid; grid-template-columns: 74px 1fr 1fr; gap: 20px; align-items: center; padding: 20px; background: white; border: 1px solid var(--line); }
.score-ring { --score: 0; width: 64px; height: 64px; display: grid; place-items: center; color: var(--green); background: radial-gradient(closest-side, white 72%, transparent 73%), conic-gradient(var(--gold) calc(var(--score) * 1%), var(--green-3) 0); border-radius: 50%; font-weight: 850; }
.match-row h3 { margin: 0 0 5px; color: var(--green); font: 400 1.2rem Georgia, serif; }
.match-row p { margin: 4px 0; color: var(--muted); font-size: .76rem; }
.match-reasons { display: flex; flex-wrap: wrap; gap: 6px; }

.opportunity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.opportunity-card { display: flex; flex-direction: column; min-height: 270px; padding: 23px; background: white; border: 1px solid var(--line); }
.opportunity-card h3 { margin: 18px 0 10px; color: var(--green); font: 400 1.35rem/1.2 Georgia, serif; }
.opportunity-card p { color: var(--muted); font-size: .82rem; line-height: 1.55; }
.opportunity-meta { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.opportunity-meta strong, .opportunity-meta small { display: block; }
.opportunity-meta small { margin-top: 4px; color: var(--muted); }
.team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.team-card { padding: 22px; background: white; border: 1px solid var(--line); }
.team-card .avatar { width: 46px; height: 46px; margin-bottom: 16px; }
.team-card h3 { margin: 0 0 5px; color: var(--green); font: 400 1.25rem Georgia, serif; }
.team-card p { margin: 4px 0; color: var(--muted); font-size: .76rem; }
.agencies-panel { margin-top: 25px; }
.agency-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid var(--line); }
.agency-row p { margin: 3px 0 0; color: var(--muted); font-size: .76rem; }
.timeline { background: white; border: 1px solid var(--line); }
.timeline-row { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 25px; padding: 18px 22px; border-top: 1px solid var(--line); }
.timeline-row:first-child { border-top: 0; }
.timeline-row time { color: var(--muted); font-size: .72rem; }
.timeline-row strong { color: var(--green); }
.timeline-row p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.lead-select { min-width: 135px; font-size: .72rem; }
.document-shell { padding: clamp(24px, 4vw, 42px); }
.document-shell form { padding: 0; }
.document-actions { position: static; margin: 18px 0 0; padding: 16px 0; }
.document-section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.document-section-head h3 { margin: 3px 0 0; color: var(--green); font: 400 1.55rem Georgia, serif; }
.document-section-head > span { color: var(--muted); font-size: .72rem; }
.requirement-manager { margin-bottom: 30px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.document-upload-section { padding-top: 2px; }
.document-inline-actions { display: flex; align-items: center; justify-content: flex-end; gap: 15px; margin-top: 15px; }
.document-inline-actions .form-status { margin-right: auto; }
.requirement-list { display: grid; gap: 10px; margin-top: 20px; }
.requirement-row { padding: 15px; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--gold); }
.requirement-row[data-status="valid"], .requirement-row[data-status="obtained_by_team"] { border-left-color: #3b806a; }
.requirement-row[data-status="incorrect"], .requirement-row[data-status="illegible"], .requirement-row[data-status="expired"] { border-left-color: var(--rust); }
.requirement-row-head { display: flex; justify-content: space-between; gap: 16px; }
.requirement-row-head strong, .requirement-row-head small { display: block; }
.requirement-row-head small, .requirement-row p { margin: 4px 0 0; color: var(--muted); font-size: .74rem; }
.requirement-row p { white-space: pre-wrap; }
.requirement-controls { display: grid; grid-template-columns: 1fr 155px repeat(3, auto); gap: 10px; align-items: end; margin-top: 13px; }
.requirement-controls label { min-width: 0; }
.requirement-controls select, .requirement-controls input[type="date"] { width: 100%; }
.requirement-controls .check-label { min-height: 38px; font-size: .68rem; }
.requirement-delegated { display: inline-block; margin-top: 9px; padding: 5px 8px; color: var(--green); background: var(--green-3); font-size: .7rem; font-weight: 700; }
.document-list { display: grid; gap: 9px; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.document-row { display: grid; grid-template-columns: 1fr auto auto; gap: 15px; align-items: center; padding: 14px; background: var(--paper); border: 1px solid var(--line); }
.document-row strong, .document-row small { display: block; }
.document-row small { margin-top: 4px; color: var(--muted); }
.document-hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.document-hub-panel { min-width: 0; }
.document-hub-copy { min-height: 44px; margin: -7px 0 22px; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.document-hub-list { display: grid; gap: 10px; }
.document-hub-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; background: var(--paper); border: 1px solid var(--line); }
.document-hub-row > div { min-width: 0; }
.document-hub-row strong, .document-hub-row small { display: block; }
.document-hub-row strong { overflow: hidden; margin: 7px 0 4px; color: var(--green); font: 400 1.05rem Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.document-hub-row small { color: var(--muted); font-size: .72rem; }
.document-hub-row .button { flex: 0 0 auto; min-height: 39px; padding: 10px 13px; }
.documents-onboarding { display: grid; justify-items: start; min-height: 280px; align-content: center; padding: 32px; background: var(--paper); border: 1px dashed var(--gold); }
.documents-onboarding.compact { border-color: var(--line); }
.documents-onboarding-icon { color: var(--gold); font: 400 3rem/1 Georgia, serif; }
.documents-onboarding h3 { margin: 15px 0 8px; color: var(--green); font: 400 1.45rem Georgia, serif; }
.documents-onboarding p { max-width: 520px; margin: 0 0 20px; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.quote-lines-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 30px 0 14px; }
.quote-lines-head h3 { margin: 3px 0 0; color: var(--green); font: 400 1.55rem Georgia, serif; }
.quote-lines { display: grid; gap: 9px; }
.quote-line { display: grid; grid-template-columns: minmax(180px,2fr) repeat(4,minmax(90px,.6fr)) auto; gap: 9px; align-items: end; padding: 13px; background: var(--paper); border: 1px solid var(--line); }
.quote-line label { min-width: 0; }
.quote-line input { min-width: 0; }
.quote-line .remove-quote-line { min-height: 43px; }
.quote-totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 20px; margin: 20px 0 5px; padding: 18px; color: var(--muted); background: var(--green-3); }
.quote-totals span { display: grid; gap: 3px; font-size: .7rem; text-transform: uppercase; }
.quote-totals strong { color: var(--green); font-size: 1rem; }
.quote-totals .grand-total { padding-left: 20px; border-left: 1px solid rgba(18,56,54,.2); }
.quote-totals .grand-total strong { font: 400 1.5rem Georgia,serif; }
.quote-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.quote-row { grid-template-columns: minmax(260px, 1.6fr) repeat(3, minmax(120px, .65fr)); align-items: start; }
.quote-row .data-main h3 { overflow: visible; line-height: 1.25; text-overflow: clip; white-space: normal; }
.quote-row .quote-actions { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.invite-link-label { display: grid; gap: 8px; margin: 24px 0; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.invite-link-label input { width: 100%; padding: 13px; color: var(--green); background: var(--paper); border: 1px solid var(--line); }
.client-message-list { display: grid; gap: 12px; max-height: 430px; overflow-y: auto; margin-bottom: 24px; padding: 4px; }
.client-message { max-width: 78%; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); }
.client-message.internal { justify-self: end; background: var(--green-3); border-color: rgba(18,56,54,.18); }
.client-message strong, .client-message time { display: block; }
.client-message p { margin: 7px 0; white-space: pre-wrap; }
.client-message time { color: var(--muted); font-size: .68rem; }
#process-message-form label { display: grid; gap: 7px; color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
#process-message-form textarea { width: 100%; padding: 13px; border: 1px solid var(--line); font: inherit; }
.notification-list { display: grid; gap: 10px; }
.notification-row { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 19px; background: white; border: 1px solid var(--line); }
.notification-row.unread { border-left: 4px solid var(--gold); }
.notification-symbol { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green); background: var(--green-3); border-radius: 50%; font-weight: 800; }
.notification-copy { min-width: 0; }
.notification-title { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; color: var(--green); font: 400 1.08rem Georgia, serif; }
.notification-row p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.notification-row time { display: block; margin-top: 7px; color: var(--muted); font-size: .7rem; }
.notification-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.notification-deliveries { display: grid; gap: 8px; margin: 18px 0 8px; }
.notification-deliveries .eyebrow { margin: 0; }
.delivery-row { display: grid; grid-template-columns: 110px 150px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; background: var(--sand); border: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.delivery-row strong { color: var(--green); }
.delivery-row[data-status="delivered"] { border-left: 3px solid var(--gold); }
.delivery-row[data-status="skipped_unconfigured"], .delivery-row[data-status="skipped_preference"] { opacity: .92; }
.empty-inline { margin: 0; color: var(--muted); font-size: .8rem; }
#reports-conversion .access-note { margin-top: 12px; }
@media (max-width: 800px) {
  .delivery-row { grid-template-columns: 1fr 1fr; }
}
.access-note { margin: -8px 0 22px; padding: 14px 16px; color: var(--green); background: var(--green-3); border-left: 3px solid var(--gold); font-size: .8rem; }
.process-condition { align-self: end; min-height: 43px; padding: 11px 13px; color: var(--muted); background: var(--sand); border-left: 3px solid var(--gold); font-size: .74rem; }
.process-condition strong { display: block; color: var(--green); }
.process-condition span { display: block; margin-top: 3px; }
.integration-panel { display: flex; align-items: center; justify-content: space-between; gap: 35px; margin-bottom: 26px; padding: clamp(24px, 4vw, 42px); color: white; background: var(--green); }
.integration-panel h2 { margin: 6px 0 12px; color: white; font: 400 clamp(2.2rem, 5vw, 4rem) Georgia, serif; }
.integration-panel p:not(.eyebrow) { max-width: 700px; margin: 0; color: rgba(255,255,255,.72); }
.integration-panel > div:last-child { display: grid; justify-items: end; gap: 14px; }
.integration-panel .button.secondary { color: var(--green); background: white; }
.mail-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 17px 19px; background: white; border: 1px solid var(--line); }
.mail-toolbar label { display: grid; gap: 6px; min-width: min(360px, 100%); color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.mail-toolbar select { width: 100%; }
.mail-toolbar .mail-search { flex: 1 1 300px; min-width: min(420px, 100%); }
.mail-toolbar .mail-search input { width: 100%; }
.mail-folders { display: flex; flex-wrap: wrap; gap: 7px; }
.mail-folder { padding: 10px 14px; color: var(--green); background: var(--paper); border: 1px solid var(--line); font: 700 .75rem Arial, sans-serif; }
.mail-folder.active { color: white; background: var(--green); border-color: var(--green); }
.mail-list { display: grid; gap: 8px; }
.mail-row { display: grid; grid-template-columns: minmax(150px,.7fr) minmax(260px,1.7fr) auto; gap: 20px; align-items: center; padding: 17px 19px; color: inherit; text-align: left; background: white; border: 1px solid var(--line); cursor: pointer; }
.mail-row:hover { border-color: var(--gold); }
.mail-row.unread { border-left: 4px solid var(--gold); }
.mail-row strong, .mail-row span, .mail-row small, .mail-row time { display: block; }
.mail-row strong { overflow: hidden; color: var(--green); text-overflow: ellipsis; white-space: nowrap; }
.mail-row span { overflow: hidden; margin-bottom: 5px; color: var(--green); text-overflow: ellipsis; white-space: nowrap; }
.mail-row small, .mail-row time, .mail-from { color: var(--muted); font-size: .72rem; }
.mail-message-shell { padding: clamp(24px,4vw,42px); }
.mail-message-meta { display: grid; gap: 7px; margin-bottom: 24px; padding-bottom: 18px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .8rem; }
.mail-message-body { min-height: 180px; color: var(--ink); line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.mail-delivery-state { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; }
#mail-preview-frame { width: 100%; min-height: 560px; border: 1px solid var(--line); border-radius: 12px; background: #f5f2ec; }
.mail-attachments { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 25px; }
.mail-attachment { padding: 10px 13px; color: var(--green); background: var(--sand); border: 1px solid var(--line); font-size: .75rem; text-decoration: none; }
.mail-message-actions { justify-content: flex-end; margin-top: 28px; }
.mail-tasks-panel { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.mail-task-row { display: grid; grid-template-columns: minmax(220px,1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; background: white; border: 1px solid var(--line); }
.mail-task-row p { margin: 5px 0 0; color: var(--muted); }
.mail-task-row select { min-width: 145px; }
.mail-template-list { margin-top: 22px; }
.mail-template-row { display: grid; grid-template-columns: minmax(200px,1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); }
.mail-template-row p { margin: 4px 0 0; color: var(--muted); }
.mail-smtp-result { min-height: 46px; margin-top: 18px; padding: 13px 15px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); line-height: 1.5; }
.mail-smtp-result.success { color: var(--green); border-left: 4px solid var(--green); }
.mail-smtp-result.error { color: #842b2b; border-left: 4px solid #a43b3b; }
.agenda-actions { align-items: center; }
.agenda-navigation, .agenda-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.agenda-navigation h2 { margin: 0 0 0 10px; color: var(--green); font: 400 clamp(1.45rem, 3vw, 2.15rem) Georgia, serif; }
.agenda-navigation .button { min-width: 46px; padding-inline: 13px; }
.agenda-privacy-note { margin-top: 0; }
.agenda-filters { margin: 0 0 18px; padding: 14px 16px; background: white; border: 1px solid var(--line); }
.agenda-filters label { display: grid; min-width: 180px; gap: 6px; color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.agenda-filters select { width: 100%; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .32fr); gap: 18px; align-items: start; }
.agenda-calendar-panel, .agenda-upcoming-panel { background: white; border: 1px solid var(--line); }
.agenda-weekdays, .agenda-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.agenda-weekdays { color: var(--green); background: var(--sand); border-bottom: 1px solid var(--line); font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.agenda-weekdays span { padding: 11px 5px; }
.agenda-day { min-width: 0; min-height: 128px; padding: 9px; color: inherit; text-align: left; background: white; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.agenda-day:nth-child(7n) { border-right: 0; }
.agenda-day:hover { background: #fbfaf6; }
.agenda-day.outside { background: #f6f3eb; }
.agenda-day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.agenda-day-add { display: block; width: 100%; padding: 0; color: inherit; text-align: left; background: transparent; border: 0; cursor: pointer; }
.agenda-day-number { display: block; margin-bottom: 7px; color: var(--green); font-size: .72rem; font-weight: 800; }
.agenda-day.outside .agenda-day-number { opacity: .42; }
.agenda-event-chip { display: block; overflow: hidden; width: 100%; margin-top: 4px; padding: 5px 6px; color: var(--green); text-align: left; background: var(--green-3); border: 0; border-left: 3px solid var(--green); font-size: .67rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.agenda-event-chip.personal { background: #f8eee4; border-left-color: var(--gold); }
.agenda-event-chip.completed { opacity: .6; text-decoration: line-through; }
.agenda-event-chip.cancelled { opacity: .45; }
.agenda-more { display: block; margin-top: 6px; color: var(--muted); font-size: .66rem; }
.agenda-upcoming-panel { position: sticky; top: 112px; max-height: calc(100vh - 140px); overflow-y: auto; padding: 22px; }
.agenda-upcoming-panel h2 { margin: 4px 0 18px; color: var(--green); font: 400 1.45rem Georgia, serif; }
.agenda-upcoming { display: grid; gap: 9px; }
.agenda-upcoming-row { width: 100%; padding: 13px 14px; color: inherit; text-align: left; background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--green); cursor: pointer; }
.agenda-upcoming-row.personal { border-left-color: var(--gold); }
.agenda-upcoming-row:hover { border-color: var(--gold); }
.agenda-upcoming-row strong, .agenda-upcoming-row small, .agenda-upcoming-row time { display: block; }
.agenda-upcoming-row strong { margin: 5px 0; color: var(--green); }
.agenda-upcoming-row small, .agenda-upcoming-row time { color: var(--muted); font-size: .69rem; }
.agenda-upcoming-row time { font-weight: 800; }
.agenda-linked-fields { padding: 14px; background: var(--paper); border: 1px solid var(--line); }
.agenda-dialog-privacy { margin: 0; padding: 12px 14px; color: var(--green); background: var(--green-3); border-left: 3px solid var(--gold); font-size: .76rem; line-height: 1.5; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 420px; padding: 15px 19px; color: white; background: var(--green); box-shadow: var(--shadow); border-left: 4px solid var(--gold); }

dialog { width: min(1050px, calc(100% - 28px)); max-height: 94vh; padding: 0; border: 0; box-shadow: 0 35px 110px rgba(7,35,33,.35); }
dialog::backdrop { background: rgba(8,34,33,.72); backdrop-filter: blur(2px); }
.editor-dialog form { padding: clamp(24px, 4vw, 42px); }
.compact-dialog { width: min(850px, calc(100% - 28px)); }
.small-dialog { width: min(690px, calc(100% - 28px)); }
.dialog-head { display: flex; justify-content: space-between; gap: 30px; align-items: start; margin-bottom: 28px; }
.dialog-head h2 { margin: 0; color: var(--green); font: 400 2.3rem Georgia, serif; }
.close-button { padding: 0; color: var(--green); background: transparent; border: 0; font-size: 2rem; }
fieldset { margin: 0 0 24px; padding: 22px; border: 1px solid var(--line); }
legend { padding: 0 10px; color: var(--green); font: 400 1.25rem Georgia, serif; }
.private-fieldset { background: #faf8f2; border-color: rgba(185,133,87,.3); }
.fieldset-note { margin: -5px 0 18px; color: var(--muted); font-size: .75rem; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.span-2 { grid-column: span 2; }
.span-4 { grid-column: 1 / -1; }
.check-label { display: flex !important; flex-direction: row; align-items: center; align-self: end; min-height: 43px; text-transform: none !important; letter-spacing: 0 !important; }
.check-label input { width: auto; min-height: 0; }
.upload-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-field span { padding: 20px; color: var(--green); text-align: center; background: var(--sand); border: 1px dashed var(--gold); cursor: pointer; }
.listing-status, .listing-history { margin: 8px 0 14px; padding: 12px 14px; background: var(--sand); border-radius: 12px; }
.listing-status p, .listing-history p, .listing-history li { margin: 0 0 6px; font-size: .82rem; }
.listing-history ol { margin: 0; padding-left: 18px; }
.listing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.preview-image { position: relative; }
.preview-image img { width: 105px; height: 76px; object-fit: cover; }
.preview-image button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; padding: 0; color: var(--rust); background: white; border: 0; border-radius: 50%; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 11px; position: sticky; bottom: -42px; margin: 25px -42px -42px; padding: 17px 42px; background: white; border-top: 1px solid var(--line); }
.dialog-actions .form-status { margin-right: auto; }

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .document-hub-grid { grid-template-columns: 1fr; }
  .data-row { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(110px, .7fr)) auto; }
  .data-row .data-cell.hide-medium { display: none; }
  .opportunity-grid, .team-grid { grid-template-columns: repeat(2, 1fr); }
  .match-controls { grid-template-columns: 1fr 1fr; }
  .quote-line { grid-template-columns: 2fr repeat(2,1fr); }
  .quote-line > :nth-child(4), .quote-line > :nth-child(5), .quote-line > :nth-child(6) { grid-column: auto; }
  .match-controls > span { display: none; }
  .agenda-layout { grid-template-columns: 1fr; }
  .agenda-upcoming-panel { position: static; max-height: none; }
}
@media (max-width: 820px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-story { display: grid; min-height: 220px; padding: 28px 22px; }
  .login-story span { font-size: 3.2rem; }
  .login-story p { margin-top: 12px; font-size: 1.15rem; }
  .access-scene { position: relative; left: 0; top: 0; width: 180px; height: 90px; margin-bottom: 12px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -280px; width: 255px; transition: left .2s; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .menu-button { display: block; }
  .topbar { min-height: 88px; }
  .user-chip div:last-child { display: none; }
  .view { padding: 24px 18px; }
  .view-actions, .welcome-row { align-items: flex-start; flex-direction: column; }
  .mail-toolbar { align-items: stretch; flex-direction: column; }
  .mail-row { grid-template-columns: 1fr auto; }
  .mail-row > :nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .mail-task-row, .mail-template-row { grid-template-columns: 1fr; }
  .mail-task-row select { width: 100%; }
  .integration-panel { align-items: flex-start; flex-direction: column; }
  .integration-panel > div:last-child { justify-items: start; }
  .filters { width: 100%; flex-wrap: wrap; }
  .filters input, .filters select { max-width: none; width: 100%; }
  .data-row { grid-template-columns: 1fr auto; }
  .notification-row { grid-template-columns: auto 1fr; align-items: start; }
  .notification-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .data-cell { display: none; }
  .match-row { grid-template-columns: 65px 1fr; }
  .match-row > :last-child { grid-column: 1 / -1; }
  .requirement-controls { grid-template-columns: 1fr 1fr; }
  .agenda-actions { align-items: stretch; }
  .agenda-navigation h2 { width: 100%; margin: 8px 0 0; }
  .agenda-day { min-height: 94px; padding: 6px; }
  .agenda-event-chip { padding: 4px; font-size: .6rem; }
}
@media (max-width: 560px) {
  .login-panel { padding: 30px 24px; }
  .login-brand img { margin-bottom: 40px; }
  .stats-grid, .opportunity-grid, .team-grid, .match-controls { grid-template-columns: 1fr; }
  .stat-card { min-height: 125px; }
  .topbar { padding: 18px; }
  .topbar h1 { font-size: 1.6rem; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .span-4 { grid-column: 1; }
  fieldset { padding: 17px; }
  .dialog-actions { position: static; flex-wrap: wrap; margin: 22px -24px -24px; padding: 16px 24px; }
  .dialog-actions .form-status { width: 100%; }
  .timeline-row { grid-template-columns: 1fr; gap: 6px; }
  .document-section-head, .document-inline-actions { align-items: flex-start; flex-direction: column; }
  .requirement-controls { grid-template-columns: 1fr; }
  .document-hub-row { align-items: stretch; flex-direction: column; }
  .document-hub-row .button { width: 100%; }
  .documents-onboarding { min-height: 240px; padding: 24px; }
  .quote-lines-head { align-items: flex-start; flex-direction: column; }
  .quote-line { grid-template-columns: 1fr 1fr; }
  .quote-line > :first-child { grid-column: 1 / -1; }
  .quote-line .remove-quote-line { grid-column: 1 / -1; }
  .quote-totals { justify-content: flex-start; }
  .quote-row { grid-template-columns: 1fr; }
  .quote-row .data-cell { display: block; }
  .quote-row .quote-actions { justify-content: flex-start; }
  .agenda-filters { align-items: stretch; flex-direction: column; }
  .agenda-filters label { width: 100%; }
  .agenda-calendar-panel { overflow-x: auto; }
  .agenda-weekdays, .agenda-calendar { min-width: 665px; }
}

.skip { position: fixed; left: 16px; top: -120px; z-index: 80; background: white; padding: 12px 16px; min-height: 44px; }
.skip:focus { top: 16px; }
.timezone-note { margin: 16px 0 0; color: var(--muted); font-size: .78rem; }
.locale-switch { display: inline-flex; gap: 6px; margin: 0 0 18px; }
.locale-switch button { min-width: 44px; min-height: 44px; border: 1px solid var(--line); background: white; color: var(--green); font-weight: 800; }
.locale-switch button[aria-pressed="true"] { background: var(--green); color: white; }
.topbar-locale { margin: 0 0 0 auto; flex: 0 0 auto; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 0; padding: 12px 0; }
.pager[hidden] { display: none; }
.pager p { margin: 0; color: var(--muted, #5b6b6a); font-size: .85rem; }
.pager .button { min-height: 44px; }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 4; background: rgba(8, 35, 34, .45); }
.icon-action, .close-button, .menu-button, .text-action { min-height: 44px; min-width: 44px; }
.preview-remove { min-width: 44px; min-height: 44px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(185, 133, 87, .18); }

.access-scene { position: absolute; top: 12%; left: 8%; width: min(280px, 40vw); height: 140px; }
.access-mark { display: block; width: min(280px, 40vw); height: auto; max-height: 92px; object-fit: contain; object-position: left center; }
.login-screen.ready .access-mark { animation: access-mark-arrive .65s ease both; }
.access-scene.unlocked .access-mark { animation: access-mark-unlock .55s ease both; }
.access-scene.denied .access-mark { animation: access-mark-denied .4s ease; }
@keyframes access-mark-arrive { from { opacity: .35; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes access-mark-unlock { from { transform: scale(1); } 50% { transform: scale(1.035); } to { transform: scale(1); } }
@keyframes access-mark-denied { 0%,100% { transform: translateX(0); } 35% { transform: translateX(-5px); } 70% { transform: translateX(5px); } }

body.nav-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .login-screen.ready .access-mark, .access-scene.unlocked .access-mark, .access-scene.denied .access-mark { animation: none; }
}

.nav-group { border-bottom:1px solid rgba(255,255,255,.12); padding:.35rem 0; }
.nav-group[hidden] { display:none; }
.nav-group summary { cursor:pointer; padding:.65rem .8rem; color:inherit; font-size:.85rem; font-weight:600; }
.nav-group summary:focus-visible { outline:2px solid #c8a977; outline-offset:2px; }
.nav-group-items { padding-left:.45rem; }
.action-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.8rem; }
.action-card { display:flex; flex-direction:column; align-items:flex-start; text-align:left; padding:1rem; background:#f6f4ef; color:#123836; border:1px solid #ddd6c8; border-radius:8px; cursor:pointer; font:inherit; gap:.3rem; }
.action-card strong { font-size:1.9rem; }
.action-card small { font-size:.78rem; line-height:1.4; }
.action-card:hover, .action-card:focus-visible { border-color:#123836; outline:2px solid #c8a977; }
@media(max-width:1050px){.action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:520px){.action-grid{grid-template-columns:1fr}}

.section-spaced { margin-top: 1rem; }
.contract-spaced { margin-bottom: 1.25rem; }
.align-end { align-self: end; }
