@font-face {
  font-family: "Lattice Mission Brush";
  src: url("/assets/fonts/lattice-mission-brush.woff") format("woff");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
/* Official Lattice Final V2: gold #FFD700, graphite #2B2F36,
   warm white #F7F6F2, auxiliary grey #D9DBE0. */
:root {
  --gold: #FFD700;
  --gold-dark: #716000;
  --ink: #2B2F36;
  --dark: #2B2F36;
  --bg: #F7F6F2;
  --line: #e5e6e9;
  --muted: #7a7e87;
}
body { color: var(--ink); }
.page-heading .mission-title {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;
  font-weight: 900;
  font-size: 34px;
  letter-spacing: 1px;
  line-height: 1.4;
  margin: 9px 0 10px;
  color: #2B2F36;
  -webkit-text-stroke: .45px currentColor;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sidebar { color: #D9DBE0; }
.brand { display: flex; flex-direction: column; gap: 9px; margin: 0 0 29px; letter-spacing: normal; }
.lattice-logo { width: 184px; height: auto; display: block; }
.brand-cross { color: #FFD700; font-size: 18px; line-height: 1; font-weight: 400; }
.hanchu-logo-frame { display: block; background: #fff; padding: 9px 12px; border-radius: 5px; width: 184px; }
.hanchu-logo-frame img { width: 100%; height: auto; display: block; }
.brand-caption { font-size: 9px; letter-spacing: 1.4px; font-weight: 400; color: #b6b9c0; margin-top: 4px; }
.sidebar-label { color: #a4a8b1; }
.nav, .person { color: #D9DBE0; }
.nav.active { color: #FFD700; background: #FFD70014; border-color: #FFD70040; }
.people-heading button, .clear-owner { color: #FFD700; }
.person .count { color: #b4b7bf; }
.person-row { display: flex; align-items: center; min-width: 0; }
.person-row .person { flex: 1; min-width: 0; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-edit-button { flex-shrink: 0; border: 0; background: transparent; color: #b4b7bf; border-radius: 4px; min-width: 32px; min-height: 40px; font-size: 18px; }
.person-edit-button:hover { color: #FFD700; background: #ffffff0e; }
.people-heading #add-person { font-size: 11px; letter-spacing: 0; padding: 5px 8px; border: 1px solid #FFD70040; border-radius: 4px; }
.sidebar-bottom { color: #b4b7bf; }
.sidebar-bottom small { color: #959aa6; }
.button.primary { color: #2B2F36; background: #FFD700; border-color: #FFD700; box-shadow: 0 3px 8px #2B2F360a; }
.button.primary:hover { background: #f2cc00; border-color: #f2cc00; }
.button:focus-visible, a:focus-visible { outline-color: #FFD700; }
.tabs button.selected { color: #716000; border-color: #FFD700; }
.stat-icon { color: #716000; background: #FFD70020; }
.plan-key { background: #FFD70026; }
.actual-key { background: #FFD70077; }
.day-label.today { color: #716000; background: #FFD7001f; }
.today-line { border-color: #ad9300; }
.task-row.highlight .task-label, .filter-note, .segment button.selected { background: #fffbe8; }
.filter-note, .segment button.selected { color: #716000; }
.toast { background: #2B2F36; }
.mobile-gantt-hint { display: none; }
.project-line > div, .page-heading > div, .toolbar-actions { min-width: 0; }
.detail-title, .detail-grid span { overflow-wrap: anywhere; }
.task-label { width: var(--label-width); }
.task-heading { width: var(--label-width); }
.dependency-layer { left: var(--label-width); }
.task-name-controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-name-controls .task-title { min-width: 0; }
.task-details-button { flex-shrink: 0; border: 1px solid #e2e4e8; border-radius: 4px; background: #fff; color: #716000; padding: 4px 7px; min-width: 40px; min-height: 32px; font-size: 11px; line-height: 1.3; }
.task-details-button:hover { background: #fffbe8; border-color: #cfb739; }
.task-label .task-title { min-width: 0; }
.task-branch-title { cursor: pointer; min-height: 40px; border-radius: 3px; }
.task-branch-title:hover { color: #716000; background: #ffd70010; }
.toggle { display: inline-flex; justify-content: center; align-items: center; width: 28px; height: 36px; border: 1px solid #e5dfc1; border-radius: 4px; background: #fff9df; color: #766615; }
.toggle:hover { background: #ffed95; border-color: #c5ad2b; }
.chevron-icon { width: 16px; height: 16px; transition: transform .15s; }
.toggle.is-expanded .chevron-icon { transform: rotate(90deg); }
.task-leaf-mark { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 28px; height: 36px; }
.task-leaf-mark > span { width: 6px; height: 6px; border: 1px solid #b8bec7; border-radius: 50%; }
.task-leaf-title { cursor: default; display: flex; align-items: center; }
.bar { cursor: default; }
.bar:hover { outline: none; }
.comment-task-link { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; border: 0; border-radius: 4px; padding: 5px 7px; margin-left: -7px; min-height: 32px; background: #fffbe8; color: #716000; font-size: 11px; text-align: left; overflow-wrap: anywhere; }
.comment-task-link:hover { background: #fff0a6; text-decoration: underline; text-underline-offset: 3px; }
.comment-task-link > span:first-child { color: #8c8158; flex-shrink: 0; }
.task-row.task-selected .task-label { background: #fff4bd; box-shadow: inset 3px 0 0 #e0ba00; }
.task-row.task-selected .timeline-row { background-color: #fffbe8; }
.task-table tr.task-selected td { background-color: #fff4bd; }
.color-picker-row { display: flex; align-items: center; gap: 14px; margin-top: 7px; }
.color-control { display: block; position: relative; flex: 0 0 72px; width: 72px; height: 46px; padding: 4px; border: 1px solid #d9dee5; border-radius: 6px; background: #fff; }
.color-preview { display: block; width: 100%; height: 100%; border-radius: 3px; box-shadow: inset 0 0 0 1px #00000012; }
.form-field .color-picker-input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.color-control:focus-within { outline: 3px solid #ffd70099; outline-offset: 3px; }
.color-values { min-width: 0; }
.color-value { display: block; color: #384451; font: 600 15px/1.5 Consolas, monospace; letter-spacing: .5px; }
.color-values small { color: #929aa5; font-size: 10px; }
.gantt-scroll, .table-wrap { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }

@media (min-width: 751px) and (max-width: 1100px) {
  .page-heading .mission-title { font-size: 30px; }
  .lattice-logo, .hanchu-logo-frame { width: 164px; }
  .brand-caption { font-size: 8px; }
}

@media (max-width: 750px) {
  :root { --label-width: 196px; }
  body { overflow-wrap: break-word; }
  .sidebar { padding: max(12px, env(safe-area-inset-top)) 12px 10px; }
  .brand { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: 6px; margin: 0 auto 14px; max-width: 400px; }
  .lattice-logo { width: 100%; max-width: 166px; height: auto; justify-self: center; }
  .brand-cross { text-align: center; font-size: 20px; }
  .hanchu-logo-frame { width: 100%; max-width: 166px; padding: 9px; justify-self: center; }
  .brand-caption { grid-column: 1 / -1; text-align: center; font-size: 8px; margin: 0; }
  .workspace-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .nav { width: 100%; justify-content: center; min-height: 44px; padding: 6px 3px; margin: 0; gap: 5px; font-size: 12px; white-space: nowrap; border: 1px solid transparent; }
  .nav-count { margin-left: 0; }
  .people-heading { margin: 10px 4px 4px; min-height: 24px; letter-spacing: 1px; }
  .people-heading button { min-width: 36px; min-height: 36px; }
  #people { gap: 6px; padding: 2px 0 4px; scrollbar-width: thin; }
  .person-row { flex: 0 0 auto; }
  .person-edit-button { min-width: 36px; min-height: 44px; }
  .person { flex: 0 0 auto; min-height: 40px; padding: 7px 12px; border: 1px solid #ffffff20; border-radius: 20px; }
  .person.selected { border-color: #FFD700; box-shadow: none; }
  .clear-owner { min-height: 40px; }
  .topbar { padding: 0 14px; height: 58px; }
  .topbar .button { min-height: 40px; }
  .workspace { padding: 19px 12px max(18px, env(safe-area-inset-bottom)); }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 0; margin-bottom: 0; }
  .page-heading > div { display: block; width: 100%; margin-bottom: 12px; }
  .page-heading > .button:not([hidden]) { margin-bottom: 12px; min-height: 44px; }
  .page-heading .mission-title { font-size: clamp(22px, 6.1vw, 28px); letter-spacing: .5px; margin: 6px 0 8px; }
  .page-heading p { max-width: none; font-size: 11px; }
  .eyebrow { font-size: 9px; }
  .project-line { flex-wrap: wrap; gap: 3px; }
  .project-line > div { width: 100%; display: flex; align-items: center; gap: 7px; }
  .field-caption { flex-shrink: 0; margin: 0; font-size: 10px; }
  .project-line select { width: 100%; min-width: 0; max-width: 100%; min-height: 44px; font-size: 16px; text-overflow: ellipsis; }
  .project-goal { font-size: 11px; margin-top: 4px; margin-bottom: 17px; overflow-wrap: anywhere; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-bottom: 17px; }
  .stat { padding: 10px 8px; min-width: 0; }
  .stat label { font-size: 10px; }
  .stat strong { font-size: 23px; margin: 2px 0; }
  .stat small, .stat-icon { display: none; }
  .board-toolbar { gap: 0; }
  .tabs { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
  .tabs button { min-height: 46px; padding: 12px 0; }
  .toolbar-actions { gap: 8px; }
  input[type=search] { width: 100%; min-width: 0; min-height: 42px; font-size: 16px; }
  .toolbar-actions .button { min-height: 42px; flex-shrink: 0; }
  .gantt-options { gap: 4px; padding: 5px 10px; }
  .gantt-options > div:last-child { gap: 2px; }
  .gantt-options select { min-height: 40px; max-width: 83px; font-size: 12px; }
  .gantt-options .text-button { min-height: 40px; font-size: 11px; padding: 3px 6px; }
  .legend { gap: 8px; font-size: 10px; white-space: nowrap; }
  .legend i { width: 13px; }
  .mobile-gantt-hint { display: block; font-size: 9px; color: #7a7e87; background: #F7F6F2; margin: 0; padding: 7px 10px; border-bottom: 1px solid var(--line); }
  .gantt-options[hidden] + .mobile-gantt-hint { display: none; }
  .gantt-scroll { max-height: 65vh; }
  .task-heading { font-size: 10px; padding: 0 10px; }
  .task-label { gap: 3px; padding-right: 7px; padding-left: var(--mobile-indent, 4px) !important; }
  .task-title { min-height: 44px; font-size: 11px; }
  .toggle { width: 28px; min-height: 44px; flex-shrink: 0; }
  .task-leaf-mark { height: 44px; }
  .task-details-button { min-height: 44px; padding: 4px 5px; min-width: 38px; font-size: 10px; }
  .task-table .task-title { white-space: normal; overflow-wrap: anywhere; text-align: left; }
  .task-table th, .task-table td { padding: 10px; }
  .task-table .name-cell { min-width: 250px; }
  .task-table th:first-child, .task-table td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; }
  .task-table th:first-child { background: #fafbf8; }
  .filter-note { font-size: 11px; padding: 9px 12px; }
  .board-footer { gap: 8px; flex-wrap: wrap; padding: 10px 12px; }
  .board-footer span { font-size: 9px; }
  .messages { max-height: none; padding: 16px; }
  .comment-form { padding: 16px; }
  .comment-task-link { min-height: 44px; font-size: 12px; }
  .comment-header { flex-wrap: wrap; }
  .comment time { font-size: 9px; }
  .form-field input, .form-field select, .form-field textarea { min-height: 44px; font-size: 16px; min-width: 0; }
  .form-field select[multiple] { min-height: 128px; }
  dialog { width: calc(100vw - 20px); max-width: 560px; max-height: 92dvh; }
  .modal-head h2 { font-size: 18px; }
  .close { min-width: 40px; min-height: 40px; }
  .modal-body { max-height: 61dvh; padding: 16px; }
  .modal-actions { padding: 12px 14px; gap: 7px; flex-wrap: wrap; }
  .modal-actions .button { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  .modal-actions .text-button { min-height: 44px; }
  .detail-title { font-size: 19px; }
  .detail-grid { gap: 15px 10px; }
  .segment button { min-height: 44px; }
  .toast { width: max-content; max-width: calc(100vw - 32px); bottom: max(16px, env(safe-area-inset-bottom)); padding: 11px 16px; }
}

/* Keep management access beside the footer branding. */
.workspace-footer { flex-wrap: wrap; gap: 8px 20px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand > span { color: #8b978c; font-weight: 600; white-space: nowrap; }
.workspace-footer .footer-auth { color: #858b91; font-size: 10px; font-weight: 400; letter-spacing: 0; min-height: 36px; padding: 6px 0; white-space: nowrap; }
.workspace-footer .footer-auth:hover { color: #716000; text-decoration: underline; }
@media (max-width: 750px) {
  .topbar { display: none; }
  .workspace-footer { gap: 4px 12px; }
  .workspace-footer .footer-auth { min-height: 44px; }
}
