:root { --portal-ink: #152a37; --portal-muted: #6b7b7d; --portal-green: #b7e5ca; --portal-border: #e5eae7; --portal-paper: #f6f7f3; }
.portal-body { min-height: 100vh; display: flex; flex-direction: column; background: var(--portal-paper); color: var(--portal-ink); }
.portal-header { min-height: 76px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; gap: 22px; background: #fff; border-bottom: 1px solid var(--portal-border); }
.portal-header .brand-mark svg { fill: #102432; stroke: #b7e5ca; }
.portal-header-right { display: flex; align-items: center; gap: 22px; }
.portal-identity { color: #314a53; font-size: 13px; font-weight: 600; }
.portal-home-link { color: #4b6668; font-size: 12px; text-decoration: none; }
.portal-home-link:hover { text-decoration: underline; }
.portal-header .button { padding: 10px 14px; min-height: 40px; }
.button-quiet { border: 1px solid var(--portal-border); border-radius: 999px; background: white; color: #344a52; font: inherit; font-size: 12px; cursor: pointer; }
.portal-main { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 52px clamp(18px, 4.6vw, 68px) 80px; }
.login-card { width: min(100%, 460px); margin: 40px auto 70px; padding: clamp(28px, 5vw, 48px); background: #fff; border: 1px solid var(--portal-border); border-radius: 18px; box-shadow: 0 24px 75px rgba(21,42,55,.07); }
.login-card h1, .view-heading h1 { margin: 0; color: var(--portal-ink); font: 600 clamp(34px, 4.5vw, 48px)/1.08 var(--serif, Georgia, serif); letter-spacing: -.065em; }
.login-intro { max-width: 340px; margin: 15px 0 30px; color: var(--portal-muted); font-size: 14px; line-height: 1.65; }
.portal-form { display: grid; gap: 15px; }
.portal-form label { display: grid; gap: 8px; color: #3f5559; font-size: 12px; font-weight: 600; }
.portal-form input, .portal-form select, .portal-form textarea { width: 100%; min-height: 46px; padding: 12px 13px; border: 1px solid #dce4e0; border-radius: 8px; background: #fff; color: #1b333b; font: 400 14px/1.4 var(--font, Inter, sans-serif); }
.portal-form textarea { min-height: 92px; resize: vertical; }
.portal-form input:focus, .portal-form select:focus, .portal-form textarea:focus { border-color: #4a7a69; outline: 3px solid rgba(74,122,105,.14); }
.portal-form .button { justify-self: start; margin-top: 3px; }
.portal-form .button:disabled { opacity: .55; cursor: wait; }
.portal-support { margin: 25px 0 0; color: #708080; font-size: 11px; line-height: 1.6; }
.portal-support a { color: #254f46; font-weight: 600; }
.form-error, .form-message { margin: 0; color: #4d6d62; font-size: 12px; line-height: 1.55; }
.form-error, .form-message.error { color: #9a3a35; }
.form-message code { display: inline-block; padding: 4px 7px; border-radius: 5px; background: #edf3ee; color: #1e4b3b; font-size: 12px; user-select: all; }
.workspace { min-height: 660px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(26px, 5vw, 70px); }
.portal-sidebar { align-self: start; position: sticky; top: 26px; min-height: 460px; display: flex; flex-direction: column; padding: 16px 0 0; }
.sidebar-eyebrow { margin: 0 0 16px 12px; color: #8a9994; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.portal-nav { display: grid; gap: 4px; }
.portal-nav-item { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: #5a6c6c; font: 500 13px/1 var(--font, Inter, sans-serif); text-align: left; cursor: pointer; }
.portal-nav-item > span { width: 17px; color: #7d9689; font-size: 17px; text-align: center; }
.portal-nav-item:hover, .portal-nav-item.active { background: #eaf0eb; color: #233e38; }
.portal-nav-item.active { font-weight: 700; }
.sidebar-note { display: flex; align-items: center; gap: 8px; margin: auto 12px 0; padding-top: 24px; color: #899690; font-size: 10px; }
.status-dot, .connection-state i { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #79ab8b; }
.portal-content { min-width: 0; }
.portal-banner { margin: 0 0 22px; padding: 13px 16px; border: 1px solid #cfe0d5; border-radius: 8px; background: #edf5ef; color: #395d4b; font-size: 12px; line-height: 1.5; }
.portal-banner.error { border-color: #eccdca; background: #fff3f1; color: #933d36; }
.portal-view { animation: portal-in .2s ease-out; }
@keyframes portal-in { from { opacity: .55; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.view-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 0 31px; }
.view-heading .eyebrow { margin: 0 0 11px; }
.view-heading h1 { font-size: clamp(34px, 4vw, 46px); }
.view-description { margin: 12px 0 0; color: #778581; font-size: 13px; line-height: 1.65; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.stat-card { min-height: 142px; display: flex; flex-direction: column; align-items: flex-start; padding: 21px 22px; border: 1px solid var(--portal-border); border-radius: 12px; background: #fff; }
.stat-card > span { color: #687b78; font-size: 11px; font-weight: 600; }
.stat-card strong { margin: 10px 0 4px; color: #1d343c; font: 600 31px/1 var(--serif, Georgia, serif); letter-spacing: -.05em; }
.stat-card small { color: #9aa5a0; font-size: 10px; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 17px 0; }
.portal-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-panels { align-items: stretch; }
.portal-card { min-width: 0; padding: 23px; border: 1px solid var(--portal-border); border-radius: 12px; background: #fff; }
.portal-card h2 { margin: 0 0 17px; color: #1d343c; font: 600 19px/1.25 var(--serif, Georgia, serif); letter-spacing: -.035em; }
.portal-card h3 { margin: 13px 0 8px; color: #1d343c; font: 600 18px/1.3 var(--serif, Georgia, serif); letter-spacing: -.03em; }
.portal-card p { color: #778581; font-size: 12px; line-height: 1.65; }
.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-heading h2 { margin-bottom: 14px; }
.text-button { padding: 0; border: 0; background: transparent; color: #4a7566; font: 600 11px var(--font, Inter, sans-serif); cursor: pointer; }
.record-list { display: grid; }
.record-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; padding: 12px 0; border-bottom: 1px solid #eef1ee; }
.record-row:last-child { border-bottom: 0; }
.record-row > div { min-width: 0; display: grid; gap: 5px; }
.record-row strong { overflow-wrap: anywhere; color: #2b4146; font-size: 12px; font-weight: 600; }
.record-row small, .record-row time { color: #929e99; font-size: 10px; }
.temporary-password { flex: 1 0 100%; margin: 7px 0 0; color: #4d6d62 !important; font-size: 11px !important; }
.message-summary small { max-width: 350px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 24px; padding: 4px 9px; border-radius: 99px; background: #eff2ef; color: #64746d; font-size: 9px; font-weight: 700; }
.status-pill.complete, .status-pill.paid { background: #e5f3e9; color: #39714e; }
.status-pill.in_progress, .status-pill.checkout_pending { background: #eaf1fb; color: #48668b; }
.status-pill.review { background: #fbf1dc; color: #90753e; }
.status-pill.paused, .status-pill.void { background: #f6e9e6; color: #8f5a51; }
.empty-state { margin: 0; padding: 14px 0; color: #9aa5a0 !important; font-size: 12px !important; line-height: 1.65; }
.payment-setup, .due-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 17px; background: #f1f5f0; }
.payment-setup h2, .due-card h2 { margin: 5px 0 7px; }
.payment-setup p:not(.eyebrow), .due-card p:not(.eyebrow) { max-width: 560px; margin: 0; }
.payment-setup .eyebrow, .due-card .eyebrow { margin: 0; color: #819389; font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.connection-state { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; color: #967845; font-size: 10px; font-weight: 700; }
.connection-state i { background: #d4a74f; }
.connection-state.connected { color: #4b7a5a; }
.connection-state.connected i { background: #6da77d; }
.inline-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; margin-bottom: 4px; }
.inline-form .wide-field { grid-column: 1 / -1; }
.inline-form > .form-message { grid-column: 1 / -1; }
.compact { max-width: 520px; }
.project-admin-card { align-self: start; }
.project-admin-card > p { margin: 5px 0; }
.project-admin-card .client-name { color: #466f61; font-size: 10px; font-weight: 700; }
.project-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.project-card-top small { color: #9ba6a1; font-size: 9px; }
.project-card p { margin: 0; }
.project-card { padding: 14px 0; border-bottom: 1px solid #eef1ee; }
.project-card:last-child { border: 0; }
.project-card h3 { margin: 10px 0 5px; font-size: 16px; }
.project-card .project-card-top { margin-bottom: 2px; }
.status-control { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; color: #83908b; font-size: 10px; }
.status-control select { width: auto; min-height: 34px; padding: 6px 27px 6px 9px; border: 1px solid #e1e8e3; border-radius: 7px; background: #fbfcfa; color: #4d6660; font: 500 11px var(--font, Inter, sans-serif); }
.invoice-list { gap: 10px; }
.invoice-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 21px; border: 1px solid var(--portal-border); border-radius: 11px; background: #fff; }
.invoice-main, .invoice-end { display: flex; align-items: center; gap: 14px; }
.invoice-main > div, .invoice-end { min-width: 0; }
.invoice-main > div { display: grid; gap: 5px; }
.invoice-main strong, .invoice-end > strong { color: #2b4146; font-size: 12px; }
.invoice-main small { color: #929e99; font-size: 10px; }
.invoice-icon { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 50%; background: #eef4ee; color: #60806d; font: 600 17px var(--serif, Georgia, serif); }
.invoice-end { justify-content: flex-end; }
.button-small { padding: 9px 13px !important; min-height: 36px !important; font-size: 10px !important; }
.button-small:disabled { cursor: not-allowed; opacity: .45; }
.message-thread { display: grid; gap: 12px; max-height: 440px; overflow: auto; padding: 3px 5px 18px; }
.message-bubble { max-width: min(82%, 680px); justify-self: start; padding: 14px 16px; border: 1px solid #e5ebe6; border-radius: 4px 14px 14px 14px; background: #fff; }
.message-bubble.mine { justify-self: end; border-color: #d8e8dc; border-radius: 14px 4px 14px 14px; background: #edf5ef; }
.message-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #8b9992; font-size: 9px; }
.message-meta strong { color: #48655a; font-size: 10px; }
.message-meta time { color: #a3ada7; }
.message-bubble p { margin: 9px 0 0; color: #40555a; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.message-form { grid-template-columns: minmax(170px, .35fr) minmax(0, 1fr) auto; align-items: end; margin-top: 12px; padding: 16px; border: 1px solid var(--portal-border); border-radius: 12px; background: #fff; }
.message-form textarea { min-height: 50px; }
.message-form .form-message { grid-column: 1 / -1; }
.inquiry-list { display: grid; gap: 13px; }
.inquiry-card { padding: 21px 23px; border: 1px solid var(--portal-border); border-radius: 12px; background: #fff; }
.inquiry-card.unread { border-color: #a9cdb5; box-shadow: 0 6px 24px rgba(65,119,83,.08); }
.inquiry-card-top { display: flex; align-items: center; gap: 11px; color: #89968f; font-size: 10px; }
.inquiry-card-top time { margin-left: auto; }
.inquiry-source { color: #668173; }
.inquiry-count { margin-left: 4px; padding: 2px 6px; border-radius: 99px; background: #dceddf; color: #37684a; font-size: 9px; }
.inquiry-card h2 { margin: 15px 0 7px; color: #2b4146; font: 600 20px/1.3 var(--serif, Georgia, serif); }
.inquiry-sender { display: flex; flex-wrap: wrap; gap: 8px; color: #526e61; font-size: 11px; }
.inquiry-sender a { color: #668173; }
.inquiry-body { margin: 15px 0; color: #40555a; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.inquiry-actions { display: flex; align-items: center; gap: 17px; }
.inquiry-actions .button { text-decoration: none; }
.inquiry-reply-form { display: grid; gap: 10px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--portal-border); }
.inquiry-reply-form label { display: grid; gap: 7px; color: #526e61; font-size: 11px; }
.inquiry-reply-form textarea { min-height: 74px; }
.inquiry-reply { margin: 14px 0 0 16px; padding: 12px 15px; border-left: 2px solid #a9cdb5; background: #f7faf7; }
.inquiry-reply-meta { display: flex; justify-content: space-between; gap: 12px; color: #668173; font-size: 10px; }
.inquiry-reply p { margin: 8px 0 0; color: #40555a; font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.mail-heading { align-items: center; }
.mail-heading > .button { flex: 0 0 auto; }
.mail-compose { margin-bottom: 16px; padding: 22px; }
.mail-compose-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.mail-compose-heading h2 { margin: 3px 0 0; color: #2b4146; font: 600 20px/1.3 var(--serif, Georgia, serif); }
.mail-compose-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.mail-compose-fields .wide-field, .mail-compose-fields .form-message { grid-column: 1 / -1; }
.mail-compose-fields textarea { min-height: 150px; }
.mail-toolbar { display: flex; flex-direction: column; gap: 11px; padding: 14px 16px 0; border: 1px solid var(--portal-border); border-bottom: 0; border-radius: 12px 12px 0 0; background: #fff; }
.mail-folders { display: flex; gap: 5px; overflow-x: auto; }
.mail-folder { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: #77877e; cursor: pointer; white-space: nowrap; font: 500 11px var(--font, Inter, sans-serif); }
.mail-folder.active { border-bottom-color: #658c73; color: #345d45; }
.mail-folder b { min-width: 17px; padding: 2px 5px; border-radius: 99px; background: #edf3ed; color: #53745e; font-size: 9px; text-align: center; }
.mail-search-row { display: flex; gap: 12px; align-items: center; padding: 0 0 13px; }
.mail-search-row input { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid #e2e9e3; border-radius: 8px; outline-color: #73937c; background: #fbfcfa; color: #354b48; font: 11px var(--font, Inter, sans-serif); }
.mail-workspace { display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.55fr); min-height: 500px; border: 1px solid var(--portal-border); border-radius: 0 0 12px 12px; overflow: hidden; background: #fff; }
.mail-list { border-right: 1px solid var(--portal-border); overflow: auto; max-height: 72vh; }
.mail-empty { padding: 24px; }
.mail-row { position: relative; display: flex; align-items: stretch; border-bottom: 1px solid #edf0ed; background: #fff; }
.mail-row.unread { background: #f7faf7; }
.mail-row.selected { background: #edf4ee; box-shadow: inset 3px 0 #648b70; }
.mail-row-main { display: flex; min-width: 0; flex: 1; gap: 11px; padding: 14px 10px 14px 14px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.mail-avatar, .mail-sender-avatar { width: 33px; height: 33px; flex: 0 0 33px; display: grid; place-items: center; border-radius: 50%; background: #edf2ed; color: #54725e; font-size: 9px; font-weight: 700; }
.mail-row-copy { display: grid; min-width: 0; flex: 1; gap: 5px; }
.mail-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mail-row-top strong { overflow: hidden; color: #3c514c; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-top time { flex: 0 0 auto; color: #9aa69f; font-size: 8px; }
.mail-row-subject { overflow: hidden; color: #394b4b; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mail-row-preview { overflow: hidden; color: #87948d; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.mail-row.unread .mail-row-top strong, .mail-row.unread .mail-row-subject { color: #253f36; font-weight: 700; }
.mail-row-action, .mail-star-large { width: 34px; flex: 0 0 34px; align-self: center; border: 0; background: transparent; color: #9aa69d; cursor: pointer; font-size: 19px; }
.mail-row-action.starred, .mail-star-large.starred { color: #b88735; }
.mail-reading-pane { min-width: 0; padding: 25px clamp(17px, 3vw, 32px); overflow: auto; max-height: 72vh; }
.mail-reading-pane > .empty-state { padding-top: 100px; text-align: center; }
.mail-message-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mail-message-heading h2 { margin: 3px 0 18px; color: #2b4146; font: 600 22px/1.35 var(--serif, Georgia, serif); overflow-wrap: anywhere; }
.mail-message-meta { display: flex; align-items: center; gap: 10px; padding-bottom: 17px; border-bottom: 1px solid #edf0ed; color: #7b8982; font-size: 9px; }
.mail-message-meta > span:nth-child(2) { min-width: 0; line-height: 1.65; }
.mail-message-meta strong { color: #3e554b; font-size: 10px; }
.mail-message-meta a { color: #778b7e; text-decoration: none; }
.mail-message-meta time { margin-left: auto; flex: 0 0 auto; }
.mail-thread { padding: 18px 0; }
.mail-message-body { color: #40555a; font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; white-space: normal; }
.mail-reply { margin-top: 14px; padding: 14px; border: 1px solid #e8eee8; border-radius: 9px; background: #f7faf7; color: #40555a; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.mail-reply-meta { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #668173; font-size: 9px; }
.mail-message-actions { display: flex; gap: 18px; padding: 0 0 14px; border-bottom: 1px solid #edf0ed; }
.mail-message-actions .mail-delete-button { color: #9c5b52; }
.mail-message-actions .mail-delete-forever { color: #a34136; font-weight: 600; }
.mail-reading-pane .inquiry-reply-form { margin-top: 16px; padding-top: 0; border-top: 0; }
.mail-reading-pane .inquiry-reply-form textarea { min-height: 98px; }
.mail-reading-pane .form-message { margin: 0; }
@media (max-width: 800px) {
  .mail-workspace { grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); }
}
@media (max-width: 640px) {
  .mail-heading { align-items: flex-start; }
  .mail-heading > .button { padding: 10px 13px !important; }
  .mail-compose-fields { grid-template-columns: 1fr; }
  .mail-compose-fields .wide-field, .mail-compose-fields .form-message { grid-column: auto; }
  .mail-workspace { grid-template-columns: 1fr; }
  .mail-list { max-height: 35vh; border-right: 0; border-bottom: 1px solid var(--portal-border); }
  .mail-reading-pane { max-height: none; min-height: 340px; padding: 20px 16px; }
  .mail-message-meta time { font-size: 8px; }
}
.password-card { max-width: 500px; }
.portal-footer { min-height: 65px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 0 clamp(20px, 5vw, 72px); border-top: 1px solid var(--portal-border); background: #fff; color: #94a09a; font-size: 10px; }
.portal-footer a { color: #526e61; text-decoration: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noscript-note { width: min(100% - 40px, 600px); margin: 30px auto; color: #8d4237; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; gap: 24px; }
  .portal-sidebar { position: static; min-height: auto; padding: 0; }
  .sidebar-eyebrow, .sidebar-note { display: none; }
  .portal-nav { display: flex; gap: 5px; padding: 4px; overflow-x: auto; border: 1px solid var(--portal-border); border-radius: 10px; background: #fff; }
  .portal-nav-item { width: auto; flex: 0 0 auto; min-height: 39px; padding: 0 11px; }
  .portal-nav-item > span { display: none; }
}
@media (max-width: 640px) {
  .portal-header { min-height: 66px; padding: 0 17px; }
  .portal-header .brand-name { font-size: 12px; }
  .portal-header-right { gap: 10px; }
  .portal-home-link { font-size: 10px; }
  .portal-identity { display: none; }
  .portal-main { padding: 26px 16px 55px; }
  .login-card { margin: 25px auto; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-card { min-height: 120px; padding: 15px 12px; }
  .stat-card strong { font-size: 25px; }
  .stat-card > span { font-size: 9px; }
  .stat-card small { font-size: 8px; line-height: 1.45; }
  .portal-grid, .portal-grid.two-col { grid-template-columns: 1fr; gap: 12px; }
  .portal-card { padding: 18px; }
  .inline-form { grid-template-columns: 1fr; }
  .inline-form .wide-field, .inline-form > .form-message { grid-column: auto; }
  .message-form { grid-template-columns: 1fr; }
  .message-form .form-message { grid-column: auto; }
  .invoice-row { align-items: flex-start; padding: 15px; }
  .invoice-end { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
  .invoice-end > strong { flex-basis: 100%; text-align: right; }
  .invoice-main { gap: 9px; }
  .payment-setup, .due-card { align-items: flex-start; flex-direction: column; }
  .portal-footer { min-height: 58px; padding: 0 17px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .portal-view { animation: none; } }
