:root {
  color-scheme: dark;
  font-family: "Inter", system-ui, sans-serif;
  background: #101418;
  color: #ecf2f1;
  --canvas: #101418;
  --panel: #171d22;
  --raised: #202931;
  --line: #34424b;
  --muted: #a9b7bc;
  --mint: #82d9ba;
  --mint-bg: #233e36;
  --warning: #f5cb83;
  --warning-bg: #493922;
  --danger: #ffadad;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
h1, h2, p { margin: 0; }
button, input, select, textarea { border-radius: 7px; }
a { color: var(--mint); }

.skip-link { position: fixed; top: -100px; left: 8px; z-index: 2; padding: 10px; background: var(--panel); }
.skip-link:focus { top: 8px; }
.wrapper { width: min(calc(100% - 44px), 1200px); margin-inline: auto; }
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-content { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--mint-bg); color: var(--mint); font-weight: 750; }
.account { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px 14px; color: var(--muted); font-size: 13px; }
#account-name { overflow-wrap: anywhere; }
.primary, .secondary { border: 1px solid transparent; padding: 8px 12px; min-height: 36px; font-size: 13px; font-weight: 600; }
.primary { background: var(--mint); color: #0e211b; }
.primary:hover:not(:disabled) { background: #a2e9ce; }
.secondary { background: var(--raised); border-color: var(--line); color: inherit; }
.secondary:hover:not(:disabled) { border-color: var(--muted); }
.main { padding-block: 30px 42px; }
.page-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.page-heading h1 { font-size: 30px; letter-spacing: -.035em; }
.page-heading time, .section-heading p { color: var(--muted); font-size: 13px; }
#app-status { color: var(--mint); margin-bottom: 12px; font-size: 13px; }
.error { color: var(--danger); font-size: 13px; }
#app-error:not([hidden]) { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); gap: 8px; }
.tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 7px 7px 0 0; color: var(--muted); font-weight: 600; padding: 11px 14px; }
.tabs button[aria-selected="true"] { color: var(--mint); border-bottom-color: var(--mint); }
.tabs button:hover { background: var(--panel); }
.tab-count { margin-left: 7px; font-size: 12px; opacity: .85; }
.filters { display: flex; gap: 10px 14px; align-items: end; flex-wrap: wrap; padding: 16px 0; }
.filters label, form label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea { color: #ecf2f1; min-height: 37px; background: var(--panel); border: 1px solid var(--line); padding: 7px 10px; }
select { padding-right: 25px; }
.result-count { color: var(--muted); font-size: 13px; margin: 0 0 8px auto; }
.table-area { border: 1px solid var(--line); border-radius: 10px; overflow: auto; background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th { color: var(--muted); font-size: 12px; font-weight: 600; background: var(--raised); }
th, td { padding: 13px 12px; }
td { border-top: 1px solid var(--line); }
td:nth-child(4), td:nth-child(5), td:nth-child(6), td:nth-child(7), td:nth-child(8) { font-variant-numeric: tabular-nums; }
td:first-child > *:not(.mobile-label), td:nth-child(5) > *:not(.mobile-label), td:nth-child(8) > *:not(.mobile-label) { display: table; }
td:first-child .badge, td:nth-child(5) .badge, td progress { margin-top: 6px; }
.mobile-label { display: none; }
.project-link { background: none; border: 0; color: #ecf2f1; text-align: left; font-weight: 650; padding: 0; }
.project-link:hover { color: var(--mint); text-decoration: underline; }
.badge { display: inline-block; width: fit-content; padding: 2px 6px; border-radius: 4px; font-size: 11px; line-height: 1.4; font-weight: 600; color: var(--muted); background: var(--raised); }
.badge.active { color: var(--mint); background: var(--mint-bg); }
.badge.paused, .badge.overdue { color: var(--warning); background: var(--warning-bg); }
progress { display: block; width: 52px; height: 4px; border: 0; border-radius: 3px; background: var(--line); accent-color: var(--mint); }
progress::-webkit-progress-bar { border-radius: 3px; background: var(--line); }
progress::-webkit-progress-value { border-radius: 3px; background: var(--mint); }
progress::-moz-progress-bar { border-radius: 3px; background: var(--mint); }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 13px; }
.load { margin-top: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.section-heading h2 { font-size: 17px; }
.weeks { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); list-style: none; margin: 0; padding: 14px 10px; gap: 12px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.weeks li { display: grid; justify-items: center; gap: 7px; font-size: 14px; font-variant-numeric: tabular-nums; }
.weeks time { color: var(--muted); font-size: 11px; text-align: center; }
.week-track { display: flex; align-items: end; width: min(45px, 80%); height: 51px; background: var(--raised); border-radius: 4px; overflow: hidden; }
.week-track span { width: 100%; height: var(--height); background: var(--mint); border-radius: 4px; }
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
.login-card, dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: inherit; padding: 24px; }
.login-card { width: min(100%, 390px); display: grid; gap: 15px; }
.login-card h1, .dialog-header h2 { font-size: 22px; letter-spacing: -.025em; }
#startup-status, .dialog-header p { color: var(--muted); font-size: 13px; }
form { display: grid; gap: 14px; }
textarea { width: 100%; min-height: 82px; resize: vertical; }
dialog { width: min(calc(100% - 24px), 510px); max-height: calc(100dvh - 32px); overflow: auto; }
dialog::backdrop { background: #080c10bc; }
.dialog-header p { margin-top: 5px; }
.project-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.project-facts dt { color: var(--muted); font-size: 12px; }
.project-facts dd { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.client-report { border-block: 1px solid var(--line); padding-block: 16px; margin-bottom: 18px; }
.client-report h3 { margin: 0; font-size: 15px; }
.client-report details { margin-top: 12px; }
.client-report summary { color: var(--mint); cursor: pointer; font-size: 13px; }
.client-report form { margin-top: 14px; }
.client-report .error, .client-report .success { margin-top: 10px; }
.success { color: var(--mint); font-size: 13px; }
.timeline-fields { border: 1px solid var(--line); border-radius: 7px; margin: 0; padding: 12px; min-width: 0; }
.timeline-fields legend { color: var(--muted); font-size: 13px; padding-inline: 5px; }
.timeline-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 14px; }
.timeline-entry input, .timeline-entry select { width: 100%; min-width: 0; }
.timeline-entry > button { justify-self: start; grid-column: 1 / -1; }

@media (max-width: 780px) {
  .wrapper { width: calc(100% - 28px); }
  .main { padding-top: 24px; }
  .page-heading h1 { font-size: 25px; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px 6px; border-top: 1px solid var(--line); }
  tbody tr:first-child { border-top: 0; }
  td { border: 0; padding: 7px 8px; overflow-wrap: anywhere; }
  td:first-child { grid-column: 1 / -1; }
  td:first-child .mobile-label { display: none; }
  .mobile-label { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
  .project-link { min-height: 28px; }
}
@media (max-width: 520px) {
  .header-content { min-height: 58px; padding-block: 6px; }
  .brand { font-size: 16px; }
  .brand-mark { width: 28px; height: 28px; }
  #account-name { display: none; }
  .filters { gap: 10px; }
  .filters label { width: calc(50% - 5px); min-width: 0; }
  .filters select { width: 100%; padding-right: 10px; }
  .weeks { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  dialog, .login-card { padding: 17px; }
  .timeline-entry { grid-template-columns: minmax(0, 1fr); }
}

/* Project planning, communication and referral views. */
.wrapper { width: min(calc(100% - 44px), 1600px); }
.app-nav { display: flex; gap: 5px; margin-right: auto; margin-left: 22px; }
.nav-button { background: none; border: 0; color: var(--muted); padding: 10px 12px; font-size: 13px; }
.nav-button[aria-current] { background: var(--mint-bg); color: var(--mint); }
.eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; }
.muted, .field-help { color: var(--muted); font-size: 12px; }
.field-help { font-weight: 400; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.posted-panel { padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 24px; }
.posted-panel h2 { margin-bottom: 5px; }
.contact-queue { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-height: 360px; overflow: auto; }
.follow-up { display: flex; align-items: start; gap: 10px; justify-content: space-between; padding: 12px; background: var(--canvas); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 7px; min-width: 0; }
.follow-up.overdue { border-left-color: var(--danger); }
.follow-up.today { border-left-color: var(--warning); }
.follow-up-content { display: grid; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.follow-up-content time { color: var(--muted); font-size: 11px; }
.follow-up .project-link { font-size: 13px; }
.follow-up-content .badge { margin: 0; }
.compact { font-size: 11px; padding: 6px 8px; min-height: 30px; white-space: nowrap; }
.projects-heading { align-items: center; margin-bottom: 0; }
.projects-heading .tabs { flex: 1; }
.check-label, form .check-label, .filters .check-label { display: flex; align-items: center; gap: 8px; align-self: center; line-height: 1.5; }
.check-label input { width: 16px; min-width: 16px; height: 16px; min-height: 16px; margin: 0; accent-color: var(--mint); }
.filters { gap: 12px; }
.filters select { max-width: 200px; }
.table-area td { vertical-align: top; }
.address-line { display: block; margin-top: 5px; max-width: 190px; }
#project-rows .badge { display: table; margin-top: 5px; }
.badge.overdue { color: var(--danger); background: #492b31; }
.badge.today, .badge.on_hold, .badge.needs-info { color: var(--warning); background: var(--warning-bg); }
.badge.prep { color: #c6d8e5; background: #334351; }
.badge.update_client, .badge.upcoming, .badge.schedule_start { color: var(--mint); background: var(--mint-bg); }
.planning-weeks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 0; list-style: none; }
.planning-weeks > li { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); padding: 13px; min-width: 0; }
.planning-weeks > li.over-capacity { border-color: #9d6154; }
.planning-weeks header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.planning-weeks strong { font-size: 22px; }
.crew-track { background: var(--raised); height: 6px; margin: 12px 0 8px; border-radius: 4px; overflow: hidden; }
.crew-track span { background: var(--mint); display: block; height: 100%; }
.over-capacity .crew-track span { background: var(--danger); }
.crew-summary, .planning-weeks summary, .planning-weeks ul { font-size: 11px; color: var(--muted); line-height: 1.6; }
.planning-weeks details { margin-top: 8px; }
.planning-weeks summary { cursor: pointer; color: var(--mint); }
.planning-weeks ul { padding-left: 15px; overflow-wrap: anywhere; }
.unknown-heading { color: var(--warning); font-size: 11px; }
.dialog-header { display: flex; gap: 12px; justify-content: space-between; align-items: start; margin-bottom: 18px; }
.dialog-header > div { min-width: 0; overflow-wrap: anywhere; }
.wide-dialog { width: min(calc(100% - 30px), 980px); }
.partner-dialog { width: min(calc(100% - 30px), 700px); }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; min-width: 0; }
.form-grid .check-label input { width: 16px; }
.full-width { grid-column: 1 / -1; }
.detail-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }
.schedule-section { border: 1px solid var(--line); background: var(--canvas); padding: 15px; border-radius: 8px; margin-bottom: 22px; }
.schedule-section h3, .edit-section h3 { font-size: 14px; margin: 0 0 12px; }
.project-timeline { display: grid; gap: 10px; }
.schedule-row { display: grid; grid-template-columns: minmax(120px, 220px) minmax(100px, 1fr); align-items: center; gap: 20px; }
.schedule-label { font-size: 12px; overflow-wrap: anywhere; }
.schedule-label small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.schedule-track { height: 15px; background: var(--raised); border-radius: 3px; position: relative; overflow: hidden; }
.schedule-bar { position: absolute; height: 100%; min-width: 5px; background: #677d88; border-radius: 3px; }
.schedule-bar.prep { background: #a0bacb; }
.schedule-bar.in-progress { background: var(--mint); }
.schedule-bar.done { background: #4d8e77; }
.schedule-bar.end-range { background: #b79157; }
.schedule-bar.marker, .schedule-bar.milestone { background: #f0d3a8; min-width: 5px; }
.edit-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 20px; }
.edit-rows { display: grid; gap: 12px; }
.edit-row { padding: 12px; background: var(--canvas); border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.edit-row input, .edit-row select, .edit-row textarea { width: 100%; min-width: 0; }
.edit-row .check-label input { width: 16px; }
.edit-row h4 { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 11px; }
.edit-row textarea { min-height: 50px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-self: end; }
.edit-row > button { justify-self: end; }
.history-list, .partner-projects { padding: 0; list-style: none; }
.history-list li { border-left: 2px solid var(--line); padding: 3px 0 12px 12px; margin-bottom: 8px; }
.history-list strong { font-size: 12px; }
.history-list time { color: var(--muted); font-size: 11px; margin-left: 10px; }
.history-list p { margin-top: 7px; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.partner-update { background: var(--canvas); border: 1px solid var(--line); padding: 12px; border-radius: 7px; margin-bottom: 10px; }
.partner-update time { font-size: 11px; color: var(--muted); }
.partner-update pre { font: inherit; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.partner-projects li { display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); }
#contact-form { margin-top: 18px; }
#project-save-status, #project-error { margin-block: 3px; }
@media (max-width: 1150px) { .contact-queue { grid-template-columns: repeat(2, minmax(0, 1fr)); } .table-area th, .table-area td { padding: 11px 9px; font-size: 12px; } }
@media (max-width: 780px) {
  .wrapper { width: calc(100% - 28px); }
  .app-nav { margin-left: 4px; gap: 0; }
  .nav-button { padding-inline: 8px; }
  .contact-queue { grid-template-columns: minmax(0, 1fr); max-height: 330px; }
  .planning-weeks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table-area tbody td { padding: 7px 8px; font-size: 13px; }
  .table-area td:first-child > .project-link { font-size: 15px; }
  .table-area .address-line { max-width: none; }
}
@media (max-width: 520px) {
  .header-content { gap: 5px; }
  .account { gap: 4px; }
  .account .secondary { padding-inline: 8px; font-size: 11px; }
  .brand { gap: 6px; font-size: 14px; }
  .brand-mark { width: 25px; height: 25px; }
  .app-nav { margin-left: 0; }
  .nav-button { padding: 8px 7px; font-size: 12px; }
  .posted-panel { padding: 12px; }
  .follow-up { padding: 10px; }
  .filters .check-label { width: 100%; }
  .form-grid, .edit-row { grid-template-columns: minmax(0, 1fr); }
  .full-width, .edit-row h4 { grid-column: auto; }
  .schedule-row { grid-template-columns: minmax(100px, 1fr) minmax(60px, 1fr); gap: 8px; }
  .planning-weeks > li { padding: 10px; }
  .planning-weeks strong { font-size: 19px; }
  .planning-weeks header { flex-wrap: wrap; }
  .row-actions { justify-content: flex-start; }
}

/* Client records and explicit deletion review. */
.client-picker { display: flex; gap: 8px; align-items: end; min-width: 0; }
.client-picker label { min-width: 0; flex: 1; }
.client-picker > button { min-height: 37px; white-space: nowrap; }
.client-dialog { width: min(calc(100% - 30px), 700px); }
.client-dialog .field-help { margin-bottom: 14px; }
.table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.danger, .danger-secondary { border: 1px solid #85515a; padding: 8px 12px; min-height: 36px; font-size: 13px; font-weight: 600; }
.danger { background: #e6a1a9; border-color: transparent; color: #30131a; }
.danger:hover:not(:disabled) { background: #f4b6bd; }
.danger-secondary { color: var(--danger); background: transparent; }
.danger-secondary:hover:not(:disabled) { background: #492b31; }
.danger-secondary.compact { padding: 6px 8px; min-height: 30px; font-size: 11px; }
#delete-project, #delete-client { margin-right: auto; }
#delete-dialog p { line-height: 1.6; overflow-wrap: anywhere; }
#delete-dialog .dialog-actions { margin-top: 20px; }
#delete-error { margin-top: 12px; }
.deletion-projects { max-height: 260px; overflow: auto; padding-left: 20px; }
.deletion-projects li { padding-block: 7px; font-size: 13px; overflow-wrap: anywhere; }
.deletion-projects .badge { margin-left: 7px; }
.crew-help { margin-bottom: 10px; }
@media (max-width: 600px) {
  .header-content { flex-wrap: wrap; padding-block: 9px 4px; }
  .header-content .brand { order: 0; }
  .header-content .account { order: 1; margin-left: auto; }
  .app-nav { order: 2; flex-basis: 100%; margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 4px; }
  .app-nav .nav-button { flex: 1; text-align: center; }
}
@media (max-width: 400px) {
  .client-picker { flex-wrap: wrap; }
  .client-picker > label { flex-basis: 100%; }
  .client-picker > button { margin-left: auto; }
}
