.login-panel { width: min(100%, 432px); margin: clamp(24px, 9vw, 88px) auto 0; padding: clamp(20px, 6vw, 36px); }
.login-panel h1 { margin-bottom: 26px; font-size: clamp(28px, 6vw, 40px); }
.login-form, #grants-form { display: grid; gap: 16px; }
.login-field { display: grid; gap: 7px; }
.login-field label { font-weight: 650; }
.login-field input { display: block; width: 100%; min-height: 44px; font-size: 16px; }
.login-form button { width: 100%; min-height: 44px; margin-top: 5px; }
#status { margin-top: 16px; color: var(--muted); }
#status:empty, #login-status:empty { display: none; }
#login-status { color: var(--red); }
.project-menu .menu-head { color: var(--muted); font-size: 12px; }
.project-menu .current { background: #f0f3ff; }
.project-menu .plan-option { border-top: 1px solid var(--line); margin-top: 6px; font-weight: 650; color: var(--blue); }
#demo-link { color: var(--ink); text-decoration: none; }
#demo-link:hover { background: #f8faff; }
#implementation-plan { padding-bottom: 32px; }
.plan-heading { gap: 12px 24px; }
#plan-title { margin: 0; }
#plan-title:focus { outline: none; }
#plan-updated { margin: 6px 0 0; }
#refresh-plan, .plan-task-body button { min-height: 44px; }

.plan-overall { margin-bottom: 16px; }
.plan-progress-head, .plan-block-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 12px;
}
.plan-progress-head h2, .plan-block-head h2 { margin: 0; line-height: 1.25; font-size: 16px; }
#plan-progress-text { color: var(--blue); font-size: clamp(22px, 3vw, 28px); line-height: 1.15; }
#plan-progress {
  display: block; width: 100%; height: 8px; margin: 13px 0 14px;
  appearance: none; border: 0; border-radius: 8px; background: #edf1f5; overflow: hidden;
}
#plan-progress::-webkit-progress-bar { background: #edf1f5; }
#plan-progress::-webkit-progress-value { background: var(--blue); border-radius: 8px; }
#plan-progress::-moz-progress-bar { background: var(--blue); border-radius: 8px; }
.plan-totals { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.plan-blocks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 16px; }
.plan-block.panel { padding: 0; }
.plan-block-head { padding: 15px 18px; }
.plan-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.plan-tasks { list-style: none; padding: 0; margin: 0; }
.plan-task { border-top: 1px solid var(--line); }
.plan-task details { margin: 0; }
.plan-task summary {
  display: grid; grid-template-columns: 35px minmax(0, 1fr) max-content 13px;
  align-items: start; gap: 6px 10px; padding: 12px 18px; min-height: 48px; width: 100%;
  color: var(--ink); font-size: 14px; cursor: pointer;
}
.plan-task summary::-webkit-details-marker { display: none; }
.plan-task summary::after {
  content: ""; grid-column: 4; grid-row: 1; justify-self: end; align-self: start;
  width: 7px; height: 7px; margin: 4px 3px 0 0; border: solid var(--muted); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.plan-task summary:hover { background: #f8faff; }
.plan-task summary:focus-visible { outline-offset: -3px; }
.plan-task details[open] > summary::after { transform: translateY(3px) rotate(225deg); }
.plan-task summary strong { font-weight: 600; overflow-wrap: anywhere; }
.plan-task-id { color: var(--muted); font-size: 12px; line-height: 20px; }
.plan-task .plan-status { justify-self: start; }
.plan-task-body { padding: 0 18px 16px 63px; color: var(--muted); overflow-wrap: anywhere; }
.plan-task-body p { margin: 0; }
.plan-task-body p + p { margin-top: 6px; }
.plan-task-body button { margin-top: 10px; }
.plan-status { margin: 0; font-size: 11px; line-height: 1.35; }
.plan-status[data-state="completed"] { background: #e6f4ec; color: var(--green); }
.plan-status[data-state="doing"] { background: #edf0ff; color: #283ebe; }
.plan-status[data-state="waiting"] { background: #fff2da; color: #764714; }

#plan-editor {
  width: min(480px, calc(100% - 28px)); max-height: calc(100% - 24px); max-height: calc(100dvh - 24px);
  padding: 0; color: var(--ink); overflow: hidden; box-shadow: 0 20px 80px #18203840;
}
#plan-editor::backdrop { background: #13243d55; }
#plan-editor-form {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: inherit; text-align: left;
}
.plan-editor-head, .plan-editor-fields, .plan-editor-actions { padding-inline: clamp(16px, 5vw, 24px); }
.plan-editor-head { padding-block: 18px 14px; border-bottom: 1px solid var(--line); }
.plan-editor-head h2 { margin: 0; font-size: 20px; line-height: 1.2; }
.plan-editor-head p { margin: 6px 0 0; overflow-wrap: anywhere; }
.plan-editor-fields { display: grid; align-content: start; gap: 14px; padding-block: 16px 18px; overflow: auto; }
.plan-editor-field { display: grid; gap: 6px; min-width: 0; }
.plan-editor-field label { font-weight: 600; }
.plan-editor-field input, .plan-editor-field select { display: block; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.plan-editor-field[hidden], #plan-editor-message:empty { display: none; }
#plan-editor-message { margin: 0; padding: 8px 10px; border-radius: 7px; background: #faebea; color: var(--red); }
.plan-editor-actions {
  display: grid; grid-auto-flow: column; justify-content: end; gap: 8px;
  padding-block: 12px; border-top: 1px solid var(--line); background: #f8fafb;
}
.plan-editor-actions button { min-height: 44px; }
#report-nav button[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -2px var(--blue); }
.report-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.report-totals strong { font-size: clamp(22px, 3vw, 36px); }
.report-table { overflow-x: auto; }
.report-table td, .report-table th { text-align: left; }
#client-projects { margin-bottom: 14px; }
#client-projects button + button { margin-left: 10px; }
#user-picker { max-width: 320px; display: block; }
.enabled { display: flex; align-items: center; gap: 6px; }
.enabled input { width: auto; }
.grant-row { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)) auto; align-items: end; gap: 12px; margin: 12px 0; }
dialog { background: var(--panel, #fff); color: var(--text, #1e2733); border: 1px solid var(--line, #dbe0e7); border-radius: 16px; width: min(480px, calc(100% - 36px)); padding: 20px; }
dialog form { text-align: right; }
dialog dl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
dialog dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 680px) {
  .report-totals { grid-template-columns: 1fr; gap: 0; }
  .grant-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-tools { gap: 6px; }
}
@media (max-width: 860px) {
  .plan-blocks { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .plan-editor-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .plan-block-head { padding-inline: 14px; }
  .plan-task summary {
    grid-template-columns: 30px minmax(0, 1fr) 13px; padding-inline: 14px;
  }
  .plan-task summary::after { grid-column: 3; }
  .plan-task .plan-status { grid-column: 2; }
  .plan-task-body { padding-inline: 54px 14px; }
}
@media (max-width: 420px) {
  .plan-heading h1 { font-size: clamp(26px, 8vw, 34px); }
}
