:root {
  color-scheme: light;
  --ink: #25282d;
  --muted: #606770;
  --brand: #4285f4;
  --blue: #2464c9;
  --table-head: #fafbfc;
  --pale-blue: #edf4ff;
  --line: #dedfe2;
  --paper: #fff;
  --page: #f7f8fa;
  --gutter: clamp(16px, 4vw, 64px);
  --width: 1380px;
  font: 16px/1.55 "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--page);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
button, select, input, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #3680d9; outline-offset: 3px; }
h1, h2, h3, p, ul, dl, dd { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.3; letter-spacing: -.04em; }
h2 { font-size: 20px; line-height: 1.5; }
h3 { font-size: 16px; }
.skip-link { position: fixed; z-index: 20; left: 16px; top: -80px; background: white; padding: 10px; }
.skip-link:focus { top: 8px; }
.masthead { background: var(--brand); color: white; border-bottom: 3px solid var(--brand); }
.masthead-inner, #workspace, .total-inner {
  width: min(calc(100% - 2 * var(--gutter)), var(--width));
  margin-inline: auto;
}
.masthead-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 72px; }
.brand, .cover-wordmark { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; line-height: 1.35; }
.brand-mark { position: relative; flex: none; display: inline-block; height: 30px; width: 28px; }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; width: 20px; height: 23px;
  border: 2px solid currentColor; border-radius: 2px; transform: skewY(-13deg);
}
.brand-mark::before { left: 1px; top: 6px; opacity: .55; }
.brand-mark::after { left: 7px; top: 1px; background: var(--brand); }
.operator { margin-left: 5px; padding-left: 17px; border-left: 1px solid #a8caff; color: #fff; font-weight: 400; font-size: 14px; }
#session { display: flex; align-items: center; gap: 16px; min-width: 0; font-size: 14px; }
#session-name { overflow-wrap: anywhere; }
#logout { color: white; border: 1px solid #85a4c7; border-radius: 5px; background: transparent; padding: 6px 12px; white-space: nowrap; }
#logout:hover { background: #306ed3; }
#workspace { padding-block: 32px 64px; }
#workspace:focus, h1[tabindex]:focus { outline: none; }
.loading, .retry-panel { padding: 32px; }
.card, .report-lines { background: white; border: 1px solid var(--line); border-radius: 8px; }
.muted, .quiet, .empty { color: var(--muted); }
.quiet { font-size: 14px; }
.primary, .secondary { border: 1px solid transparent; border-radius: 5px; padding: 9px 20px; font-weight: 600; line-height: 1.5; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: #306ed3; }
.secondary { color: var(--blue); background: white; border-color: #a8bdd7; }
.secondary:hover { background: var(--pale-blue); }
.form-error, .return-note { color: #89341d; background: #fff4ed; border-left: 3px solid #c15b39; padding: 8px 12px; overflow-wrap: anywhere; }
#notice { position: fixed; top: 84px; right: var(--gutter); max-width: min(380px, 88vw); z-index: 10; padding: 12px 20px; border-radius: 6px; color: white; background: #1c3854; box-shadow: 0 4px 16px #162f491f; }

/* The login cover echoes a printed quarterly ledger. */
#workspace.login-workspace { display: grid; place-items: center; min-height: calc(100svh - 75px); padding-block: 32px; }
.login-panel { display: grid; grid-template-columns: .85fr 1fr; width: min(880px, 100%); border-radius: 12px; overflow: hidden; background: white; border: 1px solid var(--line); box-shadow: 0 16px 54px #21374d12; }
.login-cover { position: relative; display: flex; flex-flow: column; justify-content: space-between; overflow: hidden; min-height: 436px; padding: 34px; background: var(--brand); color: white; }
.login-cover::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent 0 31px, #ffffff10 31px 32px), repeating-linear-gradient(90deg, transparent 0 31px, #ffffff10 31px 32px); }
.login-cover > * { position: relative; }
.login-cover p { font-size: 14px; color: #e0edff; }
.ledger-art { width: 192px; height: 164px; align-self: center; transform: rotate(-12deg) skewY(3deg); }
.ledger-back, .ledger-front { position: absolute; inset: 0 16px 18px 0; border-radius: 5px; border: 1.5px solid #a4c7f0; }
.ledger-back { transform: translate(10px, 14px); background: #649bf7; box-shadow: 7px 7px 0 -1px var(--brand), 7px 7px 0 0 #87acd8; }
.ledger-front { padding: 28px 19px 12px 35px; background: #e3efff; border-left: 14px solid #8bb6e7; box-shadow: -4px 5px 0 #12396555; }
.ledger-front i { display: block; height: 15px; margin: 0 0 3px; border-top: 1px solid #9ab3ce; background: linear-gradient(90deg, transparent 65%, #adc7e1 65% 66%, transparent 66%); }
.ledger-front i:first-child { width: 58%; border-top: 4px solid #346997; margin-bottom: 7px; background: transparent; }
.login-form { padding: clamp(28px, 5vw, 56px); align-self: center; }
.login-form > p.muted { margin: 7px 0 26px; font-size: 14px; }
.login-form label { display: block; margin: 15px 0 6px; font-size: 14px; font-weight: 600; }
.login-form input, .line-table input[data-amount], #status-filter {
  border: 1px solid #b9c8d8; border-radius: 4px; padding: 9px 12px; color: var(--ink); background: white;
}
.login-form input { width: 100%; }
.login-form .form-error { margin-top: 12px; font-size: 14px; }
.login-form button { width: 100%; margin-top: 24px; }
.page-heading { margin: 5px 0 24px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(230px, .8fr) minmax(0, 2.6fr); align-items: start; gap: clamp(16px, 2vw, 28px); }
.company-heading { padding: 24px; border-top: 3px solid var(--blue); border-radius: 8px 8px 0 0; background: linear-gradient(120deg, #eff5fe, white); }
.company-heading p, .aside-label, .meta-list dt { color: var(--muted); font-size: 13px; }
.company-heading h2, .report-aside h2 { margin-top: 6px; overflow-wrap: anywhere; }
.project-nav { padding: 15px 14px 20px; }
.project-nav h3, .project-nav summary { margin: 18px 10px 8px; font-size: 14px; }
.project-nav .quiet { margin: 6px 10px; }
.project-nav summary { color: var(--muted); cursor: pointer; }
.project-choice { display: flex; align-items: baseline; text-align: left; gap: 10px; width: 100%; border: none; border-radius: 4px; padding: 10px; background: transparent; color: var(--ink); overflow-wrap: anywhere; }
.project-choice:hover, .task-row:hover { background: #f5f8fc; }
.project-choice[aria-pressed=true] { color: var(--blue); background: var(--pale-blue); font-weight: 650; }
.project-choice small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.folder-icon { display: inline-block; position: relative; flex: none; width: 15px; height: 10px; border: 1.5px solid currentColor; border-radius: 2px; color: #54779b; }
.folder-icon::before { content: ""; position: absolute; width: 7px; height: 3px; border: 1.5px solid currentColor; border-bottom: none; border-radius: 2px 2px 0 0; left: -1.5px; top: -4px; }
.task-sections { display: grid; gap: 20px; }
.card-heading { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 24px; border-bottom: 1px solid var(--line); }
.card-heading h2 { display: flex; align-items: center; gap: 9px; }
.count { min-width: 24px; padding: 1px 6px; text-align: center; font-size: 13px; color: var(--blue); background: #edf4fe; border-radius: 4px; }
#status-filter { font-size: 14px; padding: 6px 9px; }
.task-list, .file-list { list-style: none; padding: 0; }
.task-list li + li { border-top: 1px solid var(--line); }
.task-row { display: flex; width: 100%; align-items: center; gap: 16px; padding: 18px 24px; border: 0; background: transparent; color: var(--ink); text-align: left; }
.task-info { flex: 1; min-width: 0; }
.task-info strong, .task-info span, .task-info small { display: block; overflow-wrap: anywhere; }
.task-info span { color: var(--muted); font-size: 14px; }
.task-info small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.quarter-tile { display: grid; justify-items: center; min-width: 54px; padding: 4px 0 3px; border-top: 3px solid var(--brand); border-radius: 3px; color: var(--blue); background: #eff5fd; line-height: 1.3; }
.quarter-tile small { font-size: 11px; }
.quarter-tile strong { font-size: 21px; font-variant-numeric: tabular-nums; }
.chevron { width: 8px; height: 8px; border: solid #67819b; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.status { display: inline-block; flex: none; padding: 3px 9px; font-size: 13px; border-radius: 4px; font-weight: 550; background: #eef3f8; }
.status-draft { color: #20599b; background: #eaf3ff; }
.status-returned { color: #93401f; background: #fff0e7; }
.status-submitted { color: #66530d; background: #fff7d9; }
.status-approved { color: #1a7053; background: #e6f5ee; }
.empty { padding: 30px 24px; font-size: 14px; }
.back-link { display: inline-flex; align-items: center; gap: 8px; border: none; background: none; color: var(--blue); padding: 0; font-size: 14px; }
.report-heading { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.report-view { padding-bottom: 110px; }
.report-view .dashboard-grid { grid-template-columns: minmax(210px, .70fr) minmax(0, 2.9fr); }
.report-aside, .project-meta { padding: 22px; }
.project-meta { border-top: 1px solid var(--line); }
.meta-list > div { margin-top: 14px; }
.meta-list dd { margin-top: 2px; font-size: 14px; overflow-wrap: anywhere; }
.contract { border-block: 1px solid var(--line); padding: 16px 0; margin-top: 20px; }
.contract h3 { font-size: 14px; margin-bottom: 8px; }
.contract-link { display: flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; }
.contract-link:hover, .upload-control:hover span { text-decoration: underline; }
.pdf-icon { color: #9c4138; border: 1px solid #d9b3ad; border-radius: 2px; padding: 4px 3px; font-size: 10px; font-weight: 750; }
.report-lines { min-width: 0; padding: clamp(14px, 1.7vw, 24px); }
.lines-intro { margin-bottom: 17px; }
.lines-intro p { margin-top: 3px; font-size: 13px; color: var(--muted); }
.return-note { margin-bottom: 18px; }
.return-note h2 { font-size: 15px; }
.return-note p { font-size: 14px; white-space: pre-line; }
.line-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; font-variant-numeric: tabular-nums; }
.line-table col:nth-child(1) { width: 14%; }
.line-table col:nth-child(2) { width: 17%; }
.line-table col:nth-child(3) { width: 20%; }
.line-table col:nth-child(4) { width: 10%; }
.line-table col:nth-child(5) { width: 18%; }
.line-table col:nth-child(6) { width: 21%; }
.line-table :is(th, td) { border: 1px solid #cbd8e7; padding: 12px 10px; text-align: left; overflow-wrap: anywhere; }
.line-table thead th { background: var(--table-head); color: #354e68; }
.line-table thead small { font-size: 12px; font-weight: 400; }
.line-table tbody th { background: #fafbfd; }
.line-table input[data-amount] { width: 100%; min-width: 0; font-size: 14px; padding: 7px 8px; }
input[aria-invalid=true] { border-color: #ae412d !important; }
.fee-cell { color: var(--blue); }
.evidence { display: grid; justify-items: start; gap: 5px; }
.evidence small { color: var(--muted); }
.file-list a { overflow-wrap: anywhere; }
.upload-control { position: relative; color: var(--blue); cursor: pointer; }
.upload-control input { position: absolute; width: 100%; height: 100%; inset: 0; opacity: 0; cursor: pointer; }
.upload-control:focus-within { outline: 2px solid var(--blue); }
.total-bar { position: fixed; z-index: 4; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid #c7d6e7; box-shadow: 0 -4px 18px #2339510b; padding-bottom: env(safe-area-inset-bottom); }
.total-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; padding-block: 13px; }
.total-inner .form-error { flex-basis: 100%; font-size: 14px; }
.total-value, .total-actions { display: flex; align-items: center; gap: 14px; }
.total-value span { font-weight: 600; }
.total-value small { display: block; color: var(--muted); font-size: 12px; }
.total-value output { color: var(--blue); font-weight: 750; font-size: clamp(22px, 2.5vw, 32px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 940px) {
  .dashboard-grid, .report-view .dashboard-grid { grid-template-columns: minmax(185px, .7fr) minmax(0, 2fr); gap: 14px; }
  .report-view .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .report-aside { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
  .report-aside h2, .report-aside .contract, .report-aside .meta-list > div { margin: 0; }
  .report-aside .meta-list { display: flex; flex-wrap: wrap; gap: 12px; }
  .report-aside .contract { border: 0; padding: 0; }
}
@media (max-width: 680px) {
  .masthead-inner { min-height: 68px; gap: 8px; }
  .brand { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; font-size: 17px; }
  .brand-mark { grid-row: span 2; }
  .operator { padding: 0; margin: 1px 0 0; border: 0; font-size: 11px; }
  #session { gap: 6px; font-size: 12px; }
  #session-name { max-width: 7em; }
  #logout { padding: 5px 7px; }
  #workspace { padding-block: 20px 36px; }
  .login-panel { display: block; max-width: 430px; }
  .login-cover { min-height: 88px; padding: 22px; justify-content: center; }
  .login-cover p, .login-cover .ledger-art { display: none; }
  .login-form { padding: 28px 24px; }
  .page-heading { margin-bottom: 16px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .task-row { padding: 14px; gap: 10px; }
  .card-heading, .company-heading, .report-aside { padding: 16px; }
  .quarter-tile { min-width: 43px; }
  .report-heading { align-items: flex-start; }
  .report-heading h1 { font-size: clamp(21px, 5.7vw, 26px); text-wrap: balance; }
  .report-view { padding-bottom: 175px; }
  .report-aside { display: block; }
  .report-aside .meta-list { margin-top: 10px; }
  .report-aside .contract { margin-top: 12px; }
  .report-lines { padding: 14px; }
  .line-table, .line-table tbody, .line-table tr { display: block; }
  .line-table colgroup { display: none; }
  .line-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .line-table tr { border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
  .line-table tr + tr { margin-top: 13px; }
  .line-table tr > th { display: block; border: none; background: var(--pale-blue); }
  .line-table td { display: grid; grid-template-columns: 67px minmax(0, 1fr); gap: 10px; align-items: baseline; border: 0; border-top: 1px solid var(--line); padding: 9px 10px; }
  .line-table td::before { content: attr(data-label); color: var(--muted); }
  .total-inner { gap: 8px; padding-block: 9px; }
  .total-value { flex: 1 1 100%; justify-content: space-between; }
  .total-actions { width: 100%; gap: 8px; }
  .total-actions:empty { display: none; }
  .total-actions button { flex: 1; padding: 7px; }
}

.home-nav,#home-search{display:none}
body:has(.home-portal) .home-nav,body:has(.home-portal) #home-search{display:flex;align-items:center;gap:18px}
.home-nav a{color:white;text-decoration:none;white-space:nowrap}
.home-nav a:hover{text-decoration:underline}
#home-search{background:white;border-radius:30px;padding:3px 5px 3px 14px}
#home-search input{width:145px;border:0;background:transparent}
#home-search button{background:#2464c9;color:white;border:0;border-radius:18px;padding:4px 12px}
.home-portal{max-width:1190px;margin:auto}
.home-grid{display:grid;grid-template-columns:minmax(0,39fr) minmax(0,61fr);gap:16px;grid-template-areas:"company tasks" "projects tasks"}
.home-box{background:white;padding:23px;border-radius:4px;box-shadow:0 3px 14px #2835480d;min-width:0}
.home-company{grid-area:company}
.home-company h1{font-size:23px;letter-spacing:0}.home-company div{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;color:var(--muted);margin-top:15px;font-size:14px}
#home-projects{grid-area:projects;min-height:200px}#home-projects nav,.home-services h2{border-top:1px solid var(--line);margin-top:14px;padding-top:8px}
#home-tasks{grid-area:tasks}
.home-task-head,.home-tabs{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.home-task-head{border-bottom:1px solid var(--line);padding-bottom:6px}
.home-tabs button,.home-table-wrap button,.clear-query,.home-services button{border:0;background:transparent;color:var(--blue);cursor:pointer}
.home-tabs button{padding:8px 2px;color:var(--muted);border-bottom:3px solid transparent}.home-tabs [aria-pressed=true]{color:var(--blue);border-color:var(--brand)}
.home-table-wrap{overflow-x:auto;margin-top:12px}.home-table-wrap table{width:100%;border-collapse:collapse;font-size:14px}.home-table-wrap th,.home-table-wrap td{text-align:left;padding:13px 8px;border-bottom:1px solid #eee}.home-table-wrap th{background:var(--table-head);color:var(--muted);font-weight:500}.home-table-wrap small{display:block;color:var(--muted)}.home-table-wrap td:last-child{white-space:nowrap}
.home-empty{text-align:center;padding:60px 10px;color:var(--muted)}.home-services{margin-top:16px}.home-services h2{border:0;border-bottom:1px solid var(--line);margin:0;padding:0 0 14px}.home-services>div{display:grid;grid-template-columns:repeat(4,1fr);padding:16px 0}.home-services button{display:grid;justify-items:center;gap:10px;padding:12px;color:var(--ink);font-weight:600}.home-services button:hover{background:var(--pale-blue)}.home-services svg{width:38px;height:38px;fill:none;stroke:var(--brand);stroke-width:1.4;stroke-linejoin:round;stroke-linecap:round}
@media(max-width:1080px){body:has(.home-portal) #home-search{display:none}}
@media(max-width:760px){body:has(.home-portal) .home-nav{display:none}.home-grid{grid-template-columns:minmax(0,1fr);grid-template-areas:"company" "tasks" "projects"}.home-box{padding:16px}#home-projects{min-height:0}.home-services>div{grid-template-columns:repeat(2,1fr)}.home-table-wrap th,.home-table-wrap td{padding:8px 4px}}
