[hidden] { display: none !important; }

.checklist-app {
  --ink: #202b26;
  --muted: #586660;
  --line: #dbe4de;
  --accent: #17654d;
  --pale: #e7f0e9;
  --panel: #fff;
  margin: 0;
  min-height: 100vh;
  background: #f6f8f5;
  color: var(--ink);
  font: 15px/1.5 Inter, "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}
.checklist-app *, .checklist-app *::before, .checklist-app *::after { box-sizing: border-box; }
.checklist-app :is(button, input, select, textarea, summary) { font: inherit; }
.checklist-app button, .checklist-app summary { cursor: pointer; }
.checklist-app button:disabled { cursor: default; opacity: .55; }
.checklist-app :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { width: min(1200px, calc(100% - 64px)); margin-inline: auto; }
.app-header { background: #fff; border-bottom: 1px solid var(--line); }
.app-header-content { min-height: 70px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 17px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.brand-mark { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 7px; background: var(--accent); color: #fff; }
.app-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.app-actions #pmState { color: var(--muted); font-size: 13px; }
.app-actions #pmState[data-level="attention"] { color: #81521c; }
.secondary-button, .primary-button, .danger-button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); white-space: nowrap; }
.secondary-button:hover { background: #eff4ee; }
.primary-button { min-height: 42px; padding-inline: 15px; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 650; }
.primary-button:hover { background: #11523e; }
.danger-button { color: #a13b31; border-color: #e4c5c0; background: #fff4f3; }
.account-menu { position: relative; }
.account-menu summary { display: flex; align-items: center; gap: 8px; list-style: none; border-radius: 6px; padding: 7px 4px; }
.account-menu summary::-webkit-details-marker { display: none; }
.menu-chevron { width: 6px; height: 6px; border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.menu-popover { position: absolute; z-index: 1; right: 0; top: calc(100% + 3px); min-width: 134px; display: grid; padding: 5px; background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 25px #202b2614; }
.menu-popover button { text-align: left; padding: 8px 10px; border: 0; border-radius: 5px; color: var(--ink); background: transparent; }
.menu-popover button:hover { background: var(--pale); }

.workspace { padding-block: 27px 60px; }
.project-switcher { display: flex; align-items: center; gap: 12px; }
.project-navigation { display: flex; align-items: stretch; flex: 1; gap: 12px; min-width: 0; padding: 3px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.project-tab { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 64px; min-width: 112px; max-width: 260px; flex: 1 0 0; padding: 12px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); text-align: left; }
.project-tab:hover { border-color: #9db7a9; }
.project-tab[aria-pressed="true"] { border-color: #5a9278; background: var(--pale); color: #154f3c; }
.project-tab > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 700; }
.project-tab > small { flex-shrink: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.project-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 32px; }
.project-header > div:first-child { min-width: 0; }
.project-title-row, .project-actions { display: flex; align-items: center; gap: 8px; }
.project-actions { flex-shrink: 0; }
.project-header h1 { min-width: 0; margin: 0; color: #1e2b25; font-size: clamp(26px, 3.8vw, 35px); font-weight: 780; line-height: 1.23; }
.checklist-app :is(.project-name, .phase-name) { min-width: 0; max-width: 100%; padding: 1px 3px; background: transparent; border: 1px solid transparent; border-radius: 5px; color: inherit; font: inherit; }
.project-name { width: clamp(110px, 31vw, 410px); text-overflow: ellipsis; }
@supports (field-sizing: content) {
  .project-name { width: auto; min-width: 2ch; max-width: min(410px, 47vw); field-sizing: content; }
}
.checklist-app :is(.project-name, .phase-name):is(:hover, :focus) { border-color: var(--line); outline: 1px solid #8eb09c; outline-offset: 0; background: white; }
.project-header p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.list-toolbar { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-top: 21px; }
.list-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.list-filters button { min-height: 34px; padding: 5px 12px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); white-space: nowrap; font-size: 14px; }
.list-filters button:hover { color: var(--ink); background: #eef3ee; }
.list-filters button[aria-pressed="true"], #pmDeleted[aria-pressed="true"] { background: var(--pale); border-color: #cadbcf; color: #154f3c; font-weight: 650; }
#pmDeleted { font-size: 14px; }
.week-hint { margin: 9px 0 17px; color: var(--muted); font-size: 13px; }
.list-empty { margin-top: 20px; padding: 24px 18px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 10px; }
.phases { display: grid; gap: 18px; }
.phase { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: var(--panel); }
.phase-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 16px; min-height: 62px; padding: 11px 16px; }
.phase-header h2 { display: flex; align-items: baseline; min-width: 0; flex: 1 1 250px; gap: 8px; margin: 0; font-size: 17px; line-height: 1.35; }
.phase-name { width: min(100%, 360px); text-overflow: ellipsis; }
.stage-name { padding: 3px 7px; border-radius: 5px; background: var(--pale); color: #245742; font-size: 12px; white-space: nowrap; }
.phase-details { display: flex; align-items: center; gap: 12px; }
.phase-cycle { color: var(--muted); font-size: 13px; }
.list-columns, .item { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(186px, .48fr) 128px 84px 52px; align-items: center; gap: 12px; padding-inline: 16px; }
.list-columns { min-height: 38px; padding-block: 7px; background: #f6f8f5; border-block: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.list-columns span:nth-child(3), .list-columns span:nth-child(4) { text-align: center; }
.group-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; min-height: 40px; background: #fafbf9; }
.grp + .grp .group-header { border-top: 1px solid var(--line); }
.group-header h3 { margin: 0; font-size: 13px; font-weight: 700; color: #43574b; }
.text-button { padding: 4px 5px; border: 0; border-radius: 5px; color: var(--accent); background: transparent; font-size: 13px; white-space: nowrap; }
.text-button:hover { background: var(--pale); }
.item { min-height: 55px; padding-block: 6px; border-top: 1px solid #edf0eb; }
.item:hover, .item:focus-within { background: #fbfcfa; }
.item-complete .item-code { color: var(--accent); }
.item-deleted { opacity: .8; }
.item-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.item-code { flex-shrink: 0; width: 4em; padding-inline: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.item .plan { display: grid; grid-template-columns: minmax(115px, 1fr) minmax(73px, .7fr); align-items: center; gap: 5px; }
.item .plan label { min-width: 0; }
.item textarea, .item .plan input { width: 100%; min-width: 0; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 6px; }
.item textarea { display: block; min-height: 36px; padding: 7px 6px; line-height: 1.38; overflow: hidden; resize: none; }
.item .plan input { height: 34px; padding: 3px 6px; font-size: 13px; }
.item .date input { border-color: var(--line); }
.item .week input::placeholder { color: #6a786f; }
.item textarea:hover, .item .plan input:hover { border-color: var(--line); }
.item textarea:focus, .item .plan input:focus { background: white; border-color: #8eb09c; outline: 1px solid #8eb09c; outline-offset: 0; }
.item .week input:invalid { border-color: #a13b31; }
.item .week > span, .item .acceptance > span { display: none; }
.acceptance { display: grid; justify-content: center; align-items: center; padding: 5px; cursor: pointer; }
.acceptance input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.item-actions { text-align: right; }
.remove-button { color: #8c443b; }
.remove-button:hover { background: #f9eeeb; }

.checklist-app .collab-dialog { color: var(--ink); border-color: var(--line); font: inherit; }
.checklist-app .collab-dialog button:hover { background: #eff4ee; }
.checklist-app .collab-dialog .primary-button { background: var(--accent); border-color: var(--accent); color: #fff; }
.checklist-app .collab-dialog .danger-button { background: #fff4f3; border-color: #e4c5c0; color: #a13b31; }
.checklist-app #additionForm { display: grid; align-items: stretch; }
#additionForm label { font-size: 13px; font-weight: 650; }
#additionForm select { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #a6b8ca; border-radius: 7px; background: #fff; color: var(--ink); }
#additionForm button { justify-self: end; }

@media (max-width: 780px) {
  .shell { width: calc(100% - 32px); }
  .list-columns, .item { grid-template-columns: minmax(125px, 1fr) 186px 96px 60px 42px; gap: 7px; padding-inline: 10px; }
  .item-code { width: auto; min-width: 2.8em; }
  .phase-header, .group-header { padding-inline: 12px; }
}
@media (max-width: 600px) {
  .shell { width: calc(100% - 24px); }
  .app-header-content { align-items: center; flex-wrap: wrap; padding-block: 8px; min-height: 60px; gap: 3px 10px; }
  .app-actions { gap: 7px; }
  .app-actions #pmState { font-size: 12px; }
  .brand { font-size: 15px; gap: 6px; }
  .brand-mark { width: 22px; height: 22px; }
  .app-actions .secondary-button { padding-inline: 6px; }
  .workspace { padding-top: 15px; }
  .project-switcher { gap: 6px; }
  #pmAddProject { font-size: 13px; padding-inline: 6px; }
  .project-navigation { gap: 6px; }
  .project-tab { display: grid; grid-template-columns: minmax(0, 1fr); text-align: center; min-width: 66px; max-width: min(9rem, 100%); min-height: 55px; gap: 3px; padding: 6px 2px; }
  .project-tab > span { font-size: 14px; }
  .project-tab > small { font-size: 11px; }
  .project-header { margin-top: 21px; flex-wrap: wrap; gap: 9px; }
  .project-actions { margin-left: auto; gap: 5px; }
  .project-actions button { font-size: 13px; min-height: 34px; padding-inline: 6px; }
  .list-toolbar { margin-top: 15px; }
  .list-filters { gap: 4px; }
  .list-filters button { padding-inline: 5px; font-size: 13px; }
  #pmDeleted { font-size: 12px; padding-inline: 7px; }
  .week-hint { font-size: 12px; margin-bottom: 13px; }
  .phase-header { min-height: 49px; padding-block: 8px; }
  .phase-header h2 { font-size: 15px; flex-basis: 145px; }
  .phase-name { width: min(100%, 230px); }
  .phase-details { gap: 7px; }
  .phase-cycle { font-size: 12px; }
  .list-columns { display: none; }
  .item { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 5px; padding: 5px 8px 8px; }
  .item-title { grid-column: 1 / -1; padding-left: 3px; }
  .item .plan { grid-column: 1 / -1; grid-template-columns: minmax(115px, 140px) minmax(70px, 98px); }
  .item .acceptance > span { display: inline; color: var(--muted); font-size: 12px; white-space: nowrap; }
  .item .week input { border-color: var(--line); }
  .item .acceptance { display: flex; align-items: center; gap: 3px; padding: 4px 1px; }
  .acceptance input { width: 15px; height: 15px; }
  .item-actions button { padding-inline: 4px; }
}

#pmUser { white-space: nowrap; font-weight: 700; }
#pmState { opacity: .9; }
#pmState[data-level="attention"] { color: #ffe28a; }
#pmbar #pmConflicts { border-color: #ffe28a; color: #ffe28a; }
#pmbar button:disabled { opacity: .55; cursor: default; }
[data-editable] { cursor: text; white-space: pre-wrap; }
[data-editable]:hover { outline: 1px dashed #a5b9cd; outline-offset: 2px; }
[data-editable]:focus { outline: 2px solid #647e98; outline-offset: 2px; }
[data-conflict] { box-shadow: 0 0 0 2px #d49a24 !important; }
.collab-dialog {
  box-sizing: border-box;
  width: min(640px, calc(100vw - 32px));
  max-height: min(720px, calc(100dvh - 32px));
  overflow: auto;
  background: #fff;
  color: #172b41;
  padding: 20px 22px;
  border: 1px solid #ccd8e3;
  border-radius: 12px;
  box-shadow: 0 12px 42px #0e233d33;
  font: 14px/1.55 system-ui, "Microsoft YaHei", sans-serif;
}
.collab-dialog::backdrop { background: #12263f80; }
.collab-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.collab-dialog h2 { margin: 0; font-size: 20px; }
.collab-dialog p { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.collab-dialog button, .delivery-login button {
  padding: 7px 13px; border: 1px solid #c7d3de; border-radius: 7px;
  background: #f4f8fc; color: #173a5a; cursor: pointer; font: inherit;
}
.collab-dialog button:hover { background: #e7f0f8; }
.collab-dialog button:disabled { opacity: .65; cursor: default; }
.collab-dialog input, .delivery-login input {
  box-sizing: border-box; min-width: 0; padding: 9px 11px; border: 1px solid #a6b8ca;
  border-radius: 7px; font: inherit; color: #172b41;
}
#historyEntries { list-style: none; margin: 0 0 12px; padding: 0; }
#historyEntries li, #conflictEntries article { border-top: 1px solid #dce5ee; padding: 12px 0; }
#historyEntries li p { margin: 4px 0; }
#historyEntries .history-meta { color: #425a70; }
#conflictEntries h3 { margin: 0; }
#conflictEntries button + button { margin-left: 8px; }
#additionForm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
#additionForm input { flex: 1; }
#additionState { flex: 0 0 100%; margin: 0; color: #9a3428; }

.delivery-login {
  box-sizing: border-box; margin: 0; padding: 24px; min-height: 100vh;
  display: grid; place-items: center;
  background: #ecf2f7; color: #172b41;
  font: 15px/1.55 system-ui, "Microsoft YaHei", sans-serif;
}
.delivery-login-card {
  box-sizing: border-box; width: min(100%, 420px); padding: 30px;
  border: 1px solid #cdd9e4; border-radius: 14px; background: #fff;
  box-shadow: 0 8px 26px #18355014;
}
.delivery-login h1 { font-size: 24px; margin: 0 0 20px; }
.delivery-login form { display: grid; gap: 8px; }
.delivery-login label { font-weight: 600; }
.delivery-login input { margin-bottom: 6px; }
.delivery-login button { margin-top: 6px; background: #204d75; color: #fff; border-color: #204d75; }
.delivery-login button:disabled { opacity: .65; }
#loginMessage { margin: 0; min-height: 1.55em; color: #9a3428; }

@media print {
  .collab-dialog { display: none !important; }
  [data-conflict] { box-shadow: none !important; }
}
