:root {
  color-scheme: light;
  --ink: #192538;
  --muted: #586579;
  --soft: #edf0f5;
  --line: #dfe5ee;
  --action: #264264;
  --action-hover: #1c3352;
  --primary: #2856c4;
  --primary-hover: #2148a7;
  --selection-bg: #e6f1fb;
  --selection-line: #95b9de;
  --topbar-bg: #ededed;
  --warm: #e8af56;
  --canvas: #f5f5f5;
  --topbar-height: 62px;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  background: var(--canvas);
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; min-width: 300px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, a, input, textarea, select, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #79a3de; outline-offset: 3px; }
button:focus:not(:focus-visible), main:focus { outline: none; }
a { color: var(--action); text-decoration: none; }
svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }
body:has(.detail-dialog[open]) { overflow: hidden; }
.topbar {
  position: sticky; top: 0; z-index: 8; height: var(--topbar-height); padding: 0 clamp(10px, 2vw, 30px);
  background: var(--topbar-bg); color: var(--ink); border-bottom: 1px solid #dcdcdc;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.brand {
  background: none; border: 0; color: inherit; display: flex; align-items: center; gap: 10px;
  padding: 0; white-space: nowrap; font-size: 1.1rem; font-weight: 740; letter-spacing: .045em;
}
.brand-mark {
  display: block; width: 34px; height: 34px; flex: none; object-fit: contain;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.notice-trigger { position: relative; min-width: 34px; justify-content: center; }
.notice-count {
  position: absolute; top: -5px; right: -4px; padding: 1px 4px; min-width: 15px; border-radius: 10px;
  background: #ad2929; color: #fff; text-align: center; line-height: 1.15; font-size: .68rem; font-weight: 750;
}
.avatar {
  border: 0; border-radius: 50%; display: grid; place-items: center; width: 34px; height: 34px;
  flex: none; background: #dedede; color: var(--ink); font-size: .81rem; font-weight: 750;
}
.top-avatar:hover { background: #d4d4d4; }
.top-avatar:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
main { padding: 27px clamp(12px, 2.2vw, 34px) 37px; max-width: 1450px; margin: 0 auto; }
.month-main { padding: 13px clamp(6px, 1.25vw, 22px) 24px; max-width: none; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin: 0 0 24px; }
.page-head h1 { margin: 0 0 7px; font-size: clamp(1.75rem, 2.8vw, 2.2rem); letter-spacing: -.035em; line-height: 1.28; font-weight: 760; }
.page-head p { margin: 0; color: var(--muted); line-height: 1.55; font-size: .92rem; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.button {
  min-height: 41px; display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  padding: 8px 13px; border: 1px solid #dce0e6; border-radius: 8px; color: #2c3645;
  background: #fff; font-weight: 650; font-size: .89rem; line-height: 1.35; white-space: nowrap;
}
.button:hover { background: #eef1f5; border-color: #cbd2dc; }
.button svg { width: 17px; height: 17px; }
.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.top-actions .toolbar-button { background: #f8f8f8; border-color: #d5d5d5; color: var(--ink); }
.top-actions .toolbar-button:hover, .top-actions [aria-current="page"] { background: #e3e3e3; border-color: #cbcbcb; }
.ghost { border-color: transparent; background: none; }
.small-button { min-height: 34px; padding: 6px 9px; font-size: .83rem; }
.date-control {
  display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; min-height: 41px;
  border: 1px solid #dce0e6; border-radius: 8px; background: white; color: #364050;
}
.date-control svg { width: 16px; height: 16px; }
.date-control input { width: auto; min-width: 117px; padding: 6px 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; font-size: .9rem; }
.notice {
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px; color: #655021; font-weight: 540;
  font-size: .85rem; background: #fcf3e1; border: 1px solid #f0e5cc; border-radius: 9px; padding: 7px 11px; min-height: 35px;
}
.notice svg { width: 16px; height: 16px; color: #977133; }
.notice button { margin-left: auto; border: 0; background: none; color: #72521e; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; }
.section { margin-bottom: 25px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 1.22rem; letter-spacing: -.02em; font-weight: 750; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: .74rem; min-height: 24px; padding: 3px 8px; border-radius: 5px; color: #2d4160; background: #e9edf4; white-space: nowrap; }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.amber { background: #faefd9; color: #856123; }
.chip.gray { background: #eceef0; color: #595e65; }
.chip.red { background: #f9e8e4; color: #963e36; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .88rem; }
th { background: #f1f3f5; color: #4e5764; font-weight: 640; white-space: nowrap; }
th, td { padding: 11px 14px; border-bottom: 1px solid #eceef1; }
tr:last-child td { border-bottom: 0; }
td .tag-icon { color: #435774; margin-right: 4px; }
td .tag-icon svg { width: 16px; height: 16px; }
.table-title { min-width: 135px; font-weight: 650; }
.table-activity { min-width: 130px; max-width: 360px; }
.table-activity span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.link-button { border: 0; background: transparent; color: var(--action); padding: 4px 0; text-underline-offset: 4px; font-weight: 680; white-space: nowrap; }
.link-button:hover { text-decoration: underline; }
.empty { border: 1px dashed #ccd2da; border-radius: 12px; background: #fbfcfd; padding: 29px 18px; text-align: center; color: var(--muted); margin: 0; }
.empty > svg { margin-bottom: 6px; color: #5d6f8a; width: 26px; height: 26px; }
.empty h2, .empty h3 { font-size: 1.03rem; color: var(--ink); margin: 3px 0 7px; }
.empty p { margin: 0 0 12px; }
.empty .page-actions { justify-content: center; }
.panel { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.panel h2, .panel h3 { margin: 0 0 12px; font-size: 1.12rem; }
.panel p { color: var(--muted); line-height: 1.7; }
.panel p:last-child { margin-bottom: 0; }
.detail-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-bottom: 14px; }
.detail-stats > div, .attendance-button { border-radius: 8px; padding: 11px; background: #f1f3f6; }
.detail-stats span { display: block; font-size: .81rem; color: var(--muted); margin-bottom: 4px; }
.detail-stats strong { font-size: .98rem; display: block; word-break: break-word; }
.attendance-button { border: 0; color: var(--action); text-align: left; }
.attendance-button strong { text-decoration: underline; text-underline-offset: 3px; }
.attendance-button:hover { background: #e0e6ee; }
.project-scope { margin: 0 0 9px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.photo-grid button, .photo-grid img { width: 100%; height: 100%; display: block; }
.photo-grid button { padding: 0; border: 0; background: var(--soft); aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; }
.photo-grid img { object-fit: cover; }
dialog {
  padding: 0; border: 1px solid #d9dee5; border-radius: 16px; width: min(672px, calc(100% - 34px)); max-height: min(92dvh, 980px);
  background: #fff; color: var(--ink); box-shadow: 0 16px 70px rgb(0 0 0 / 18%); overflow: auto;
}
dialog::backdrop { background: rgb(0 0 0 / 32%); }
#dialog[data-dismiss-on-backdrop="true"] { max-height: min(74dvh, 680px); }
.dialog-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 21px 15px;
  border-bottom: 1px solid var(--line); background: white; position: sticky; top: 0; z-index: 2;
}
.dialog-head h2 { font-size: 1.24rem; margin: 2px 0 0; }
.dialog-head p { color: var(--muted); font-size: .87rem; margin: 4px 0 0; }
.dialog-body { padding: 19px 21px; }
.dialog-foot { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 21px; border-top: 1px solid var(--line); background: white; z-index: 2; }
.icon-button { display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; min-width: 36px; min-height: 36px; background: var(--soft); color: #343e4e; padding: 7px; }
.icon-button:hover { background: #e1e6ee; }
.field { display: grid; gap: 7px; font-size: .9rem; font-weight: 650; color: #2d3848; min-width: 0; }
.field + .field, .form-row + .field, .field + .form-row, .form-row + .form-row { margin-top: 13px; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-row .field { margin: 0; }
input:not([type=file]), textarea, select { min-width: 0; color: var(--ink); }
.field input, .field select, .field textarea, select {
  min-height: 42px; padding: 9px 10px; border: 1px solid #d9dde4; border-radius: 8px; background: #fff; font-weight: 450;
}
.field textarea { min-height: 74px; resize: vertical; }
.field textarea.record-input { min-height: 104px; line-height: 1.55; }
.field input:focus, .field textarea:focus, select:focus { outline: 2px solid #88a0c4; outline-offset: 1px; }
select { appearance: none; padding-right: 33px !important; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 8 5 5 5-5' fill='none' stroke='%23526580' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-size: 16px; background-repeat: no-repeat; background-position: right 9px center; }
.subform { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.subform h3 { margin: 0 0 7px; font-size: .95rem; }
.subform p { color: var(--muted); font-size: .84rem; margin: 5px 0 9px; }
.photo-controls { display: flex; flex-wrap: wrap; gap: 7px; }
.photo-controls input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-controls label { cursor: pointer; }
.photo-controls input:focus-visible + label { outline: 3px solid #79a3de; outline-offset: 3px; }
.preview-list { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 9px; }
.preview { position: relative; overflow: hidden; border-radius: 8px; aspect-ratio: 4 / 3; background: var(--soft); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button { position: absolute; top: 3px; right: 3px; color: white; background: #151d2acc; border: 0; border-radius: 6px; min-height: 29px; min-width: 29px; }
.preview button svg { width: 15px; height: 15px; }
.form-error { color: #8f3e31; font-size: .9rem; margin: 11px 0 0; }
.toast { position: fixed; z-index: 30; bottom: 24px; right: 24px; background: #1b2738; color: #fff; border-radius: 10px; padding: 11px 15px; max-width: min(370px, calc(100% - 34px)); box-shadow: 0 8px 24px #10172138; }
.toast:empty { display: none; }
#photo-dialog { width: min(900px, calc(100% - 24px)); background: #172438; border: 0; }
#photo-dialog img { display: block; max-height: 86dvh; width: 100%; object-fit: contain; }
#photo-dialog button { position: absolute; top: 10px; right: 10px; }
.backup-pill { display: flex; gap: 10px; align-items: start; }
.backup-pill > svg { color: var(--action); margin-top: 2px; }
.backup-pill p { margin-top: 3px; }
.backup-head { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.sign-in-main {
  min-height: calc(100svh - var(--topbar-height));
  display: grid;
  justify-items: center;
  align-content: start;
  padding: clamp(24px, 8vh, 70px) 16px 36px;
}
.sign-in {
  width: min(100%, 438px);
  padding: clamp(22px, 5vw, 34px);
  border-radius: 17px;
  box-shadow: 0 12px 30px #121a260a;
}
.sign-in-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  color: #25364f;
  background: #e5e9f0;
}
.sign-in-icon svg { width: 24px; height: 24px; }
.sign-in h1 { margin: 0; font-size: 1.45rem; }
.sign-in > p { margin: 8px 0 22px; font-size: .93rem; }
.sign-in-roles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 16px 0; border-radius: 10px; background: var(--soft); }
.sign-in-roles .button { justify-content: center; border-color: transparent; background: none; }
.sign-in-roles .button[aria-pressed="true"] { color: var(--action-hover); border-color: var(--selection-line); background: var(--selection-bg); }
.login-notice { margin-bottom: 16px; padding: 12px; border-radius: 8px; background: var(--soft); color: var(--ink); }
.login-notice p { margin: 0 0 6px; }
.login-notice a { text-decoration: underline; text-underline-offset: 3px; }
.sign-in input { font-size: 1rem; }
.sign-in form > .button { width: 100%; min-height: 44px; margin-top: 8px; }
.sign-in .recovery-link { display: block; margin: 12px auto 0; min-height: 36px; }
.field-hint { margin: 0 0 14px; color: var(--muted); font-size: .875rem; }
.report-project { min-width: 0; }
.report-project > .button { margin-top: 6px; min-height: 42px; }
#report-form .subform + .field { margin-top: 14px; }
.report-add-worker { margin-top: 8px; }
.worker-group + .worker-group { margin-top: 13px; }
.worker-group h3 { margin: 8px 0 6px; color: var(--muted); font-size: .9rem; }
.worker-delete { color: #942f2f; }
#worker-dialog .dialog-foot .worker-delete { margin-right: auto; }
.worker-contact-fields { margin-top: 14px; }
.roster-list small, .worker-option small { display: block; margin-top: 3px; color: var(--muted); }
.roster-list, .attendance-names { list-style: none; margin: 0; padding: 0; }
.roster-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(125px, 100%), 1fr)); gap: 8px; }
.roster-person {
  display: block; width: 100%; height: 100%; min-height: 44px; padding: 8px 12px; text-align: left;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); overflow-wrap: anywhere;
}
.roster-person:hover { border-color: #9eb1cc; background: #edf2f9; }
.worker-profile { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0; }
.worker-profile > div { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.worker-profile dt { color: var(--muted); font-size: .88rem; }
.worker-profile dd { margin: 4px 0 0; font-weight: 650; overflow-wrap: anywhere; }
.attendance-names { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(110px, 100%), 1fr)); gap: 7px; }
.attendance-names li { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f4f6f8; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.loading { margin: 5vh auto; max-width: 500px; text-align: center; padding: 22px; }

@media (max-width: 850px) {
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .backup-head { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 660px) {
  :root { --topbar-height: 53px; }
  .brand { font-size: .98rem; gap: 6px; }
  .brand-mark, .top-avatar { width: 30px; height: 30px; }
  .top-actions { gap: 5px; }
  .top-actions .button { min-height: 34px; padding: 5px 7px; font-size: .79rem; gap: 4px; }
  .top-actions .button svg { width: 15px; height: 15px; }
  .topbar:has(.return-home) {
    height: auto; min-height: var(--topbar-height); padding-block: 6px; flex-wrap: wrap; row-gap: 4px;
  }
  .topbar:has(.return-home) .top-actions { margin-inline-start: auto; }
  main { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 13px; }
  .page-head h1 { font-size: 1.63rem; }
  .page-head p { font-size: .87rem; }
  .page-actions { gap: 6px; }
  .notice { font-size: .77rem; gap: 5px; }
  .notice button { padding: 2px; white-space: nowrap; }
  .section-head h2 { font-size: 1.08rem; }
  .section { margin-bottom: 18px; }
  td, th { padding: 9px 10px; }
  .detail-stats { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(14px + env(safe-area-inset-bottom)); right: 13px; }
  dialog { width: 100%; max-width: 100%; max-height: 100dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; }
  .dialog-head, .dialog-body, .dialog-foot { padding-left: 14px; padding-right: 14px; }
  .dialog-foot { padding-bottom: calc(11px + env(safe-area-inset-bottom)); }
  .dialog-foot .primary { flex: 1; }
  .field input, .field select, .field textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.day-attendance { color: var(--action); font-size: .85rem; white-space: nowrap; }
.day-attendance svg { width: 17px; height: 17px; }
.day-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.day-project {
  display: flex; align-items: center; gap: 12px; padding: 9px 13px; text-align: left; width: 100%; min-height: 65px;
  color: var(--ink); border: 0; border-bottom: 1px solid var(--line);
}
.day-project:last-child { border-bottom: 0; }
.day-project:focus-visible { outline-offset: -3px; }
.day-project img { flex: none; width: 66px; height: 43px; border-radius: 6px; object-fit: cover; }
.day-project-info { display: grid; gap: 4px; flex: 1; min-width: 0; }
.day-project-info strong { font-size: .96rem; }
.day-project-text {
  font-size: .84rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  white-space: pre-line; overflow-wrap: anywhere;
}
.day-project-meta { display: grid; justify-items: end; gap: 3px; flex: none; }
.day-progress { color: #324460; font-size: .78rem; white-space: nowrap; }
.idle-detail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.work-toggle {
  display: flex; gap: 7px; margin: 13px 0; padding: 0; min-inline-size: 0; border: 0;
}
.work-toggle legend { margin: 0 0 6px; padding: 0; font-weight: 650; font-size: .9rem; color: #2d3848; }
.work-toggle label { position: relative; flex: 1; cursor: pointer; }
.work-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.work-toggle label > span {
  display: flex; gap: 7px; align-items: center; justify-content: center; min-height: 40px; border: 1px solid #d9dde4;
  border-radius: 8px; color: #394557; font-size: .9rem; font-weight: 650; background: #fff;
}
.work-toggle input:checked + span { border-color: var(--selection-line); color: var(--action-hover); background: var(--selection-bg); }
.work-toggle input:focus-visible + span { outline: 3px solid #79a3de; outline-offset: 2px; }
.work-fields { margin-top: 13px; }
.attendance-field { margin: 13px 0 0; min-width: 0; padding: 0; border: 0; }
.attendance-field legend { padding: 0; color: #2d3848; font-size: .91rem; font-weight: 700; }
.attendance-count { margin-left: 5px; font-size: .84rem; color: var(--action); }
.attendance-field small { color: var(--muted); font-size: .82rem; }
.worker-selection-actions { display: flex; gap: 7px; margin: 7px 0; }
.worker-options {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(98px, 100%), 1fr)); gap: 6px;
  padding: 2px;
}
.worker-option {
  position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; min-height: 42px; padding: 6px 8px;
  border: 1px solid #d9dde4; border-radius: 7px; color: #303b4c; cursor: pointer;
  font-size: .91rem; overflow-wrap: anywhere;
}
.worker-option input { position: absolute; inset: 0 auto auto 0; width: 1px; height: 1px; margin: 0; opacity: 0; }
.worker-option:has(:checked) { background: var(--selection-bg); border-color: var(--selection-line); color: var(--action-hover); font-weight: 700; }
.worker-option:has(:checked)::after { content: "✓"; margin-inline-start: auto; }
.worker-option:has(:focus-visible) { outline: 3px solid #79a3de; outline-offset: 2px; }

.month-main .notice { margin-bottom: 8px; min-height: 29px; padding-block: 4px; }

.calendar-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: clip; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 9px; padding: 13px 14px 8px; }
.calendar-month, .calendar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.calendar-month h1 { font-size: clamp(1.1rem, 2.1vw, 1.52rem); margin: 0; letter-spacing: -.03em; line-height: 1.25; }
.month-picker {
  position: relative; display: grid; place-items: center; overflow: hidden; border: 1px solid #dbdfe6; border-radius: 7px;
  width: 34px; height: 34px; color: #374963; background: #fff; cursor: pointer;
}
.month-picker:hover { background: #edf0f4; }
.month-picker:focus-within { outline: 2px solid #758fb5; outline-offset: 2px; }
.month-picker svg { width: 17px; height: 17px; }
.month-picker input {
  appearance: none; position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  min-width: 0; opacity: 0; cursor: pointer;
}
.month-picker input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.calendar-actions .button:disabled { opacity: .5; cursor: default; }

.calendar-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; padding: 0 14px 9px;
  color: #4a5360; font-size: .88rem;
}
.calendar-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-legend .calendar-total { color: var(--muted); }
.calendar-legend .calendar-rotate { display: none; margin-left: auto; color: #3b4c65; }
.calendar-mark { width: 12px; height: 12px; display: inline-grid; place-items: center; flex: none; border-radius: 4px; }
.calendar-mark.worked { background: #3b567e; }
.calendar-mark.worked::after {
  content: ""; display: block; width: 6px; height: 3px; border: solid #fff; border-width: 0 0 1.5px 1.5px;
  transform: translateY(-.6px) rotate(-45deg);
}
.calendar-mark.idle { background: #dce0e6; }
.calendar-mark.idle::after { content: ""; width: 7px; height: 1.5px; border-radius: 3px; background: #535d6d; }

.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 1px; background: #d8d8d8; }
.month-weekday {
  position: sticky; top: var(--topbar-height); z-index: 2;
  display: grid; place-items: center; min-height: 36px; background: #fff;
  box-shadow: 0 1px #d8d8d8; color: #384353; font-size: .94rem; font-weight: 650;
}
.month-weekday.weekend { color: #4b5666; }
.month-cell {
  min-width: 0; min-height: 154px; padding: 8px 9px 11px; background: #fff;
}
.month-cell.outside { background: #f0f0f0; }
.month-cell-head { margin-bottom: 8px; }
.month-day-number {
  display: inline-grid; place-items: center; min-width: 34px; min-height: 33px; padding: 1px 5px;
  background: transparent; border: 0; border-radius: 7px; color: var(--ink); font-variant-numeric: tabular-nums;
  font-size: 1.16rem; font-weight: 800; line-height: 1;
}
button.month-day-number:hover { background: #dbe4f3; }
.current-day .month-day-number { background: #f4be62; color: #462a06; }
.current-day .month-day-number:hover { background: #efb14b; }
.future .month-day-number, .outside .month-day-number { background: transparent; color: #656e7d; font-weight: 600; }
.month-entries { display: grid; gap: 7px; }
.project-color-0 { --project-hue: 234; }
.project-color-1 { --project-hue: 211; }
.project-color-2 { --project-hue: 275; }
.project-color-3 { --project-hue: 19; }
.project-color-4 { --project-hue: 198; }
.project-color-5 { --project-hue: 322; }
.project-color-6 { --project-hue: 48; }
.project-color-7 { --project-hue: 254; }
.project-color-8 { --project-hue: 352; }
.project-color-9 { --project-hue: 194; }
.project-color-10 { --project-hue: 291; }
.project-color-11 { --project-hue: 31; }
.calendar-entry {
  display: grid; gap: 4px; width: 100%; min-width: 0; padding: 6px 7px; overflow: hidden; text-align: left;
  border: 1px solid #dedede;
  border-radius: 6px; color: #262f3d;
  line-height: 1.35;
}
.calendar-entry:hover, .day-project:hover { filter: brightness(.965); }
.calendar-entry:focus-visible { outline-offset: -2px; }
.entry-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; min-width: 0; }
.entry-name {
  --entry-font-size: .94rem;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: hsl(var(--project-hue, 234) 45% 24%); font-weight: 750;
}
.entry-progress {
  flex: none; padding: 1px 0; color: var(--ink);
  font-size: .83rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.entry-content { display: flex; align-items: baseline; gap: 5px; min-width: 0; font-size: .875rem; }
.report-symbol {
  display: inline-block; flex: none; font-size: .92em; line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.day-project-text .report-symbol { margin-inline-end: 4px; }
.entry-status { flex: none; padding: 1px 4px; border-radius: 4px; background: #e7ecee; color: #384e59; font-weight: 700; }
.entry-status.missing { padding: 0; background: transparent; color: var(--ink); font-weight: 550; }
.day-project-info strong { color: hsl(var(--project-hue, 234) 45% 24%); }
.entry-summary {
  --entry-font-size: .875rem;
  display: -webkit-box; min-width: 0; overflow: hidden; overflow-wrap: anywhere;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.entry-name, .entry-summary { font-size: var(--entry-fitted-size, var(--entry-font-size)); }
.calendar-entry [data-fit="smaller"] { --entry-fitted-size: max(.6875rem, calc(var(--entry-font-size) - .09375rem)); }
.calendar-entry [data-fit="minimum"] { --entry-fitted-size: .6875rem; }

.detail-dialog {
  position: fixed; inset: 0 0 0 auto; width: min(640px, 100% - clamp(48px, 14vw, 92px)); max-width: 100%;
  height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 14px 0 0 14px; overscroll-behavior: contain;
}
.detail-dialog::backdrop { background: rgb(0 0 0 / 20%); }
.detail-dialog .dialog-head h2 { overflow-wrap: anywhere; }
.detail-dialog .dialog-head p { line-height: 1.5; }
.detail-dialog .dialog-body { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.detail-progress {
  display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 12px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 8px; font-size: .9rem;
}
.detail-progress strong { color: var(--ink); font-size: 1rem; }
.calendar-entry, .day-project, .detail-progress {
  background-color: #f1f1f1;
  background-image: linear-gradient(to right,
    #c8e6d3 var(--project-progress, 0%),
    transparent var(--project-progress, 0%));
}
.detail-history { margin: 15px 0 0; border: 1px solid var(--line); border-radius: 9px; }
.detail-history summary { padding: 10px 13px; color: var(--action); font-weight: 680; cursor: pointer; }
.detail-history .table-wrap { border: 0; border-radius: 0 0 8px 8px; }
.admin-list { display: grid; gap: 8px; }
.admin-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #f5f5f5; color: var(--ink); text-align: left;
  overflow-wrap: anywhere;
}
.admin-row button { flex: none; }
.project-admin-row { flex-wrap: wrap; }
.project-admin-row p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
.admin-check { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0; }
.event-row p { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.event-row:hover { background: #eee; }

@media (max-width: 660px) {
  .month-main { padding-top: 8px; }
  .calendar-toolbar { padding: 8px 7px 6px; gap: 6px; }
  .calendar-month, .calendar-actions { gap: 4px; }
  .calendar-actions .button { min-height: 32px; padding: 4px 5px; font-size: .75rem; }
  .month-picker { width: 28px; height: 30px; }
  .calendar-legend { padding: 0 7px 6px; gap: 6px 9px; font-size: .79rem; }
  .month-weekday { min-height: 28px; font-size: .82rem; }
  .detail-dialog { border-radius: 10px 0 0 10px; }
  .day-project { padding: 8px 9px; gap: 7px; }
  .day-project img { width: 45px; }
}

@media (orientation: portrait) and (max-width: 660px) {
  .calendar-legend .calendar-rotate { display: inline-flex; }
  .month-grid { row-gap: 1px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  .month-cell { padding: 3px 2px 4px; min-height: 61px; }
  .month-cell-head { margin-bottom: 4px; }
  .month-day-number { min-width: 25px; min-height: 25px; padding-inline: 3px; font-size: .96rem; }
  .month-entries { gap: 3px; }
  .calendar-entry { gap: 1px; padding: 2px; min-height: 34px; border-radius: 4px; }
  .entry-heading { display: grid; justify-content: stretch; gap: 0; }
  .entry-name, .entry-summary { --entry-font-size: .75rem; line-height: 1.2; }
  .entry-progress { justify-self: start; padding: 0; font-size: .6875rem; }
  .entry-content { align-items: flex-start; gap: 2px; font-size: .6875rem; line-height: 1.2; }
  .entry-content .report-symbol { margin-top: 1px; font-size: .82em; }
  .entry-status { flex: 0 1 auto; min-width: 0; padding: 0; background: transparent; overflow-wrap: anywhere; }
  .calendar-entry:not(.worked) .entry-summary { display: none; }
}

@media (orientation: landscape) and (max-height: 520px) {
  :root { --topbar-height: 46px; }
  .calendar-entry { padding: 4px; gap: 2px; }
  .entry-name { --entry-font-size: .82rem; }
  .entry-summary { --entry-font-size: .75rem; }
  .entry-progress, .entry-content { font-size: .75rem; }
  .month-entries { gap: 4px; }
}

@media (max-width: 350px) {
  .topbar { padding-inline: 6px; gap: 5px; }
  .top-actions { gap: 3px; }
  .top-actions .button { padding-inline: 5px; }
  .top-actions [data-action="report"] svg { display: none; }
  .calendar-month h1 { font-size: 1rem; }
  .calendar-actions .button { padding-inline: 4px; }
}
