:root { scrollbar-gutter: stable; }
.sidebar { gap: 34px; padding-top: 26px; }
.topbar { position: relative; }
.topbar #save-state { margin-left: auto; text-align: right; }
.workspace-clock {
  position: absolute; inset: 0 auto 0 var(--clock-left);
  display: flex; align-items: center; gap: 18px; pointer-events: none;
  color: var(--ink); font-size: inherit; font-weight: 500; white-space: nowrap;
}
@media (min-width: 761px) {
  .workspace { --sidebar-width: 195px; }
  .workspace .topbar { position: sticky; top: 0; z-index: 12; margin-left: calc(-1 * var(--sidebar-width)); }
  .sidebar { top: 64px; }
  #preview-heading, #schedule .schedule-trash { scroll-margin-top: 76px; }
}
@media (min-width: 761px) and (max-width: 1190px) {
  .workspace { --sidebar-width: 166px; }
}
.sidebar .nav-link:active { transform: none; }
.sidebar .nav-link[aria-current] { font-weight: inherit; }
.side-brand { margin-block: 0; }
.brand { width: min(100%, 158px); }
.nav-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.nav-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:is(#save-version, #delete-month) .nav-icon { width: 15px; height: 15px; }
.sidebar .nav-icon { color: #ffd0ec; }
.sidebar .nav-link[aria-current] .nav-icon { color: var(--accent); }
.sidebar-copyright {
  margin: auto 8px 0; padding: 13px 0 15px; border-top: 1px solid #ffffff30;
  color: #ffe4f4; font-size: 9px; letter-spacing: .025em; white-space: nowrap;
}
.work-view .project-heading { align-items: flex-start; min-height: 72px; }
.branded-heading { display: flex; align-items: center; gap: clamp(8px, 1vw, 14px); }
.page-brand {
  display: inline-flex; align-items: center; flex: none; padding: 7px 9px;
  background: #660744; border-radius: 5px;
}
.page-brand img { display: block; width: clamp(112px, 10vw, 147px); height: auto; }
.page-heading-rule { width: 1px; height: .76em; flex: none; background: #dec7d8; }
.page-title-line { white-space: nowrap; }
.page-title-baseline { display: inline-block; width: 0; height: 0; }
.work-view .project-heading > :is(.button,.actions) { margin-top: var(--heading-action-offset, 0px); }
.monthly-layout { grid-template-columns: 142px minmax(595px,1.35fr) minmax(320px,1fr); }
.month-directory { padding: 11px 8px; }
.month-directory h2 { font-size: 14px; padding: 0 3px; margin-bottom: 7px; }
.month-directory #create-month { display: flex; width: 100%; padding-inline: 3px; margin-bottom: 10px; }
.month-year-group + .month-year-group { margin-top: 6px; }
.month-directory .month-year {
  position: relative; display: flex; width: 100%; border-radius: 999px; font-weight: 700;
  padding-inline: 23px; box-shadow: inset 0 1px #ffffff3d, 0 2px 4px #a000591a;
}
.month-year::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 5px; height: 5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: translateY(-65%) rotate(45deg);
}
.month-year[aria-expanded="true"]::after { transform: translateY(-35%) rotate(225deg); }
.month-year-items { padding-top: 3px; }
.month-node, .month-version { width: 100%; display: flex; align-items: center; gap: 5px; min-height: 31px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); padding: 4px 5px; text-align: left; font-size: 12px; }
.month-node { font-weight: 700; }
.month-node:hover, .month-version:hover { background: var(--soft); }
.month-node[aria-current] { background: #fae1f1; color: #8e075b; }
.month-node .month-count { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 400; }
.month-version { padding-left: 14px; color: var(--muted); }
.month-version-saved { display: grid; justify-content: start; gap: 0; }
.month-version-time { font-size: 10px; font-weight: 400; }
.month-version[aria-current] { color: #8e075b; background: #fae1f1; font-weight: 700; }
.month-versions {
  margin: 0 0 10px; padding: 6px 0; border-block: 1px solid var(--line);
}
.month-version-list {
  display: grid; align-content: start; gap: 2px; height: 190px;
  overflow-y: auto; scrollbar-width: thin; scrollbar-gutter: stable;
}
.month-version-heading { margin: 1px 5px 4px; color: var(--ink); font-size: 11px; font-weight: 700; }
.month-form { padding: 14px; display: grid; gap: 11px; }
.month-form label { display: grid; gap: 4px; }
.month-form .month-check { display: flex; align-items: center; gap: 6px; }
.month-check input { width: auto; accent-color: var(--accent); }
.month-form .actions { justify-content: flex-end; }
.month-readonly .row-actions button { visibility: hidden; }
.month-empty { padding: 16px; }
.month-empty p { margin: 4px 0 12px; }
.month-trash h3 { margin: 10px 15px 0; color: var(--ink); font-size: 13px; }
#delete-month-dialog { width: min(445px,94vw); }
.row-cancelled td { color: var(--muted); background: #f8f4f7; }
.row-cancelled :is(input,textarea) { color: var(--muted); }
.row-cancelled .cell-value { color: var(--muted); }
.cancelled-label { display: block; font-size: 10px; text-align: center; color: var(--muted); }
.mark-option.status-action { margin-top: 9px; }
@media (max-width: 1340px) {
  .monthly-layout { grid-template-columns: 142px minmax(0,1fr); }
  .monthly-layout .preview { grid-column: 2; position: static; }
}
@media (max-width: 760px) {
  .sidebar { padding-top: 12px; }
  .sidebar .nav-link { gap: 5px; }
  .sidebar .nav-icon { width: 15px; height: 15px; }
  .work-view .project-heading { min-height: 100px; }
  .topbar { min-height: 74px; align-items: flex-start; padding-top: 8px; }
  .workspace-clock { top: 31px; }
  .monthly-layout { grid-template-columns: minmax(0,1fr); }
  .monthly-layout .preview { grid-column: 1; }
  .month-year-items { display: flex; gap: 4px; flex-wrap: wrap; }
  .month-node, .month-version { width: auto; }
  .month-version-list {
    display: flex; align-items: center; height: 48px;
    overflow-x: auto; overflow-y: hidden; scrollbar-gutter: auto; white-space: nowrap;
  }
  .month-version-list > * { flex: none; padding-inline: 8px; }
}
.work-view { max-width: 1550px; overflow-anchor: none; }
.button.excel { color: white; background: #167447; border-color: #167447; font-weight: 500; }
.button.excel:hover { background: #0c5e36; border-color: #0c5e36; }
#download, #download-excel { min-width: 102px; }
.schedule-column { min-width: 0; display: grid; gap: 16px; }
#schedule-order { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.schedule-footer { display: grid; gap: 7px; }
.schedule-footer .button { width: 100%; min-height: 40px; }
.schedule-trash { scroll-margin-top: 12px; --trash-delete-width: 74px; --trash-restore-width: 72px; --trash-gap: 6px; }
.schedule-trash .trash-head { padding-right: 28px; }
.trash-actions {
  flex: none; display: grid; grid-template-columns: var(--trash-delete-width) var(--trash-restore-width);
  gap: var(--trash-gap);
}
.trash-actions .button, .trash-clear { min-height: 32px; }
.trash-clear { width: calc(var(--trash-delete-width) + var(--trash-restore-width) + var(--trash-gap)); }
.trash-list li > div:first-child { min-width: 0; }
#purge-trash-dialog { width: min(455px, 94vw); }
.schedule-trash .empty { padding: 12px 15px 15px; }
#delete-activity { width: min(430px, 94vw); }
.delete-detail { margin: 0; padding: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.delete-actions { justify-content: flex-end; padding: 0 15px 15px; }
.row-actions .remove { width: 19px; }
.small.mark {
  flex: none; width: 29px; height: 29px; padding: 0; place-items: center;
  font-size: 13px; font-weight: 500; line-height: 1; text-align: center; color: #a50068;
  border: 1px solid; border-color: #fff4fb #eac4dc #dfb5cf #f8deef;
  border-radius: 7px 9px 7px 8px / 9px 7px 8px 6px;
  background: linear-gradient(151deg,#fceff8 4%,#f8e6f2 56%,#f2dbe9);
  box-shadow: inset 1px 1px 0 #ffffffa3, inset -1px -1px 0 #8e305319, 0 1px 2px #680b3920;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.small.mark[aria-pressed="true"] {
  color: white; border-color: #df46a4 #a40066 #8d0058 #c72c8a;
  background: linear-gradient(153deg,#d51a8e,#bd0078 58%,#a80069);
  box-shadow: inset 1px 1px 0 #ffb8e046, inset -1px -1px 0 #65003a45, 0 1px 2px #78024540;
}
@media (hover: hover) {
  .small.mark:hover { transform: translateY(-2px) scale(1.07); box-shadow: inset 1px 1px 0 #ffffff65, 0 4px 7px #680b3935; }
}
.small.mark:active { transform: translateY(1px) scale(.96); box-shadow: inset 0 2px 4px #62023637; }
.mark-menu {
  position: fixed; inset: auto; margin: 0; width: min(230px, calc(100vw - 20px));
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--text); box-shadow: 0 14px 34px #42032928;
}
.mark-menu strong { display: block; margin-bottom: 5px; color: var(--ink); }
.time-picker {
  position: fixed; inset: auto; margin: 0; width: min(308px,calc(100vw - 20px));
  padding: 12px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--text); box-shadow: 0 14px 34px #42032928;
}
.time-picker h2 { font-size: 15px; margin: 0 0 8px; }
.time-picker-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.time-picker fieldset {
  display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; min-width: 0; margin: 0;
  padding: 3px 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff8fc;
}
.time-picker legend { padding: 0 4px; font-size: 12px; font-weight: 500; color: var(--ink); }
.time-picker label { display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.time-picker select { width: 100%; padding: 4px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.time-picker select:hover { border-color: #d99ec5; }
.time-picker p { margin: 8px 0; }
.time-picker-actions { display: flex; justify-content: space-between; gap: 6px; }
.mark-option {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  width: 100%; min-height: 36px; margin-top: 5px; padding: 5px 8px;
  color: var(--ink); text-align: left; border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(180deg,white,#fcf8fb); box-shadow: 0 1px 1px #72044b0d;
  transition: background .15s, border-color .15s, transform .15s;
}
.mark-option:hover { border-color: #dba9cb; background: #faeaf4; }
.mark-option:active { transform: translateY(1px); }
.mark-option[aria-pressed="true"] { border-color: #e7adcf; background: #fbe5f3; font-weight: 500; }
.mark-option-state { flex: none; min-width: 47px; padding: 2px 4px; text-align: center; font-size: 10px; border-radius: 4px; color: var(--muted); background: #f0e8ee; }
.mark-option[aria-pressed="true"] .mark-option-state { background: var(--accent); color: white; }
@media (prefers-reduced-motion: reduce) {
  .small.mark:is(:hover,:active), .mark-option:active { transform: none; }
}
.workspace-message {
  position: fixed; z-index: 20; right: 20px; bottom: 18px; margin: 0;
  padding: 10px 16px; max-width: min(460px, calc(100vw - 40px)); border-radius: 7px;
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--ink); background: var(--paper);
}
select {
  min-width: 0; color: var(--text); background: var(--paper); border: 1px solid var(--line);
  border-radius: 5px; font: inherit; padding: 6px 8px;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dashboard-filters {
  display: grid; grid-template-columns: minmax(90px,.65fr) minmax(90px,.65fr) 1fr 1fr auto;
  gap: 10px; align-items: end; margin-bottom: 16px;
  padding: 12px 14px; background: #ffffffba; border: 1px solid var(--line); border-radius: 9px;
}
.dashboard-filters label, .review-form label { display: grid; min-width: 0; gap: 4px; color: var(--ink); font-size: 12px; }
.dashboard-filters select { width: 100%; }
.dashboard-filters button { min-height: 34px; }
.metrics-frame { position: relative; margin-bottom: 15px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 11px; }
.metric-trace { position: absolute; inset: -5px; display: block; width: calc(100% + 10px); height: calc(100% + 10px); pointer-events: none; }
.metric {
  padding: 14px 16px; border: 1px solid #a63376; border-radius: 9px;
  min-width: 0; color: white; box-shadow: 0 5px 16px #43092706;
  background: radial-gradient(ellipse at 100% 0%,#c62583 0%,transparent 72%), linear-gradient(130deg,#72064b,#9a0962);
}
.metric span, .metric small { display: block; font-size: 12px; }
.metric strong { display: block; margin: 3px 0 4px; font: 700 clamp(26px,3vw,43px)/1.08 WorkMiSans, system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 13px; }
.dashboard-grid > .panel { grid-column: span 2; box-shadow: 0 5px 16px #43092706; overflow: hidden; }
.dashboard-grid .trend-card { grid-column: span 4; }
.dashboard-grid .wide-card { grid-column: 1 / -1; }
.dashboard-card-head { padding: 14px 16px 11px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dashboard-card-head p, .panel-head p { margin: 2px 0 0; }
.dashboard-card-head input { width: auto; padding: 3px 5px; font-size: 11px; }
.monthly-chart { padding: 20px 16px 13px; display: grid; grid-template-columns: auto minmax(0,1fr); gap: 8px; }
.axis { display: flex; flex-direction: column; justify-content: space-between; text-align: right; height: 169px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.month-columns {
  min-width: 0; display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); align-items: end;
  height: 188px; gap: 4px; border-top: 1px solid #f1e7ee;
  background: repeating-linear-gradient(to bottom,transparent 0 40px,#f1e7ee 40px 41px);
}
.month-column { min-width: 0; display: grid; grid-template-rows: 164px 24px; gap: 0; padding: 0 2px; border: 0; background: transparent; color: var(--muted); align-items: end; }
.month-bar {
  position: relative; display: block; width: 100%; max-width: 38px; justify-self: center;
  border-radius: 5px 5px 2px 2px; background: #d6a8c1; transition: background .16s ease;
}
.month-column:hover .month-bar { background: #bd739c; }
.month-column[aria-pressed=true] .month-bar { background: #92085a; z-index: 1; }
.month-count-note {
  display: none; position: absolute; left: 50%; bottom: calc(100% + 7px); transform: translateX(-50%);
  padding: 2px 5px; border: 1px solid #e6cdda; border-radius: 3px; background: #fffafc; color: #770645;
  font-size: 10px; font-weight: 700; white-space: nowrap; line-height: 1.35; pointer-events: none;
}
.month-count-note::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1px; height: 8px; background: #c08ca9; }
.month-column[aria-pressed=true] .month-count-note { display: block; animation: month-count-in .18s ease-out both; }
@keyframes month-count-in { from { opacity: 0; translate: 0 3px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) { .month-count-note { animation: none !important; } }
.month-column small { font-size: 10px; white-space: nowrap; align-self: center; justify-self: center; border-bottom: 1px solid transparent; }
.month-column[aria-pressed=true] small { color: #92085a; font-weight: 700; border-color: currentColor; }
.calendar { padding: 2px 13px 13px; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 4px; }
.calendar .weekday { color: var(--muted); font-size: 11px; text-align: center; }
.day {
  min-width: 0; min-height: 27px; padding: 1px; border-radius: 4px; border: 1px solid transparent;
  color: var(--muted); background: #f9f4f7; font: 12px/1.2 WorkMiSans, sans-serif;
}
.day.has-event { background: #f6c5e1; color: #660744; }
.day[data-intensity="2"] { background: #e995c5; }
.day[data-intensity="3"] { background: #a62272; color: white; }
.day[aria-pressed="true"], .day:hover { border-color: var(--accent); }
.day:disabled { cursor: default; border-color: transparent; }
.distribution { padding: 1px 15px 13px; display: grid; gap: 8px; }
.rank {
  width: 100%; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 7px; text-align: left;
  padding: 3px 2px; background: transparent; border: 0; border-radius: 4px; color: var(--text);
}
.rank:hover, .rank[aria-pressed="true"] { background: var(--soft); }
.rank span { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.rank .rank-value { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank .rank-track { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: #f4e5ef; overflow: hidden; }
.rank-track b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#a7136d,#e448a3); }
.rank:last-child .rank-track b { opacity: .7; }
.dashboard-details { margin-top: 13px; }
.data-table th, .data-table td { padding: 8px; text-align: center; overflow-wrap: anywhere; }
.data-table td { font-size: 12px; }
.data-table th:nth-child(1), .data-table th:nth-child(2) { width: 13%; }
.data-table th:nth-child(5) { width: 30%; }
.version-list { padding: 4px 14px 10px; }
.record-month { margin: 14px 0 6px; color: var(--ink); font-size: 13px; }
.record {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.record:last-child { border-bottom: 0; }
.record strong { display: block; color: var(--ink); overflow-wrap: anywhere; }
.record p { margin: 2px 0 0; }
.record .record-tag { display: inline-block; margin-left: 6px; padding: 0 5px; background: var(--soft); border-radius: 3px; font-size: 11px; color: var(--ink); font-weight: 400; }
.record .record-changes { margin-top: 4px; }
.record-changes b { font-weight: 500; margin-right: 9px; color: var(--ink); }
.search-input { width: min(250px,100%); }
.upload-button { cursor: pointer; position: relative; overflow: hidden; }
.upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.alias-panel { margin-bottom: 14px; }
.alias-form { padding: 11px 14px; display: grid; gap: 7px; grid-template-columns: auto 1fr 1fr auto; }
.alias-list { padding: 0 14px 9px; }
.alias-list .record { padding: 6px 0; }
#version-dialog { width: min(940px,95vw); }
.version-preview-actions, .version-preview-meta { padding: 9px 15px 0; }
.version-preview-meta { padding-bottom: 9px; }
#version-poster { max-width: 760px; margin-inline: auto; }
.review-form { padding: 12px 15px 16px; display: grid; gap: 10px; }
.review-form p { margin: 0; }
.review-form summary { cursor: pointer; color: var(--ink); }
.review-form ul { padding-left: 19px; max-height: 150px; overflow: auto; }
.review-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
@media (max-width: 1170px) {
  .dashboard-grid .trend-card { grid-column: span 3; }
  .dashboard-grid .calendar-card { grid-column: span 3; }
}
@media (max-width: 940px) {
  .dashboard-grid > .panel { grid-column: span 3; }
  .dashboard-grid .trend-card { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .sidebar { gap: 9px; }
  .sidebar-copyright { margin: 0 4px; padding: 6px 0 0; }
  .trash-list li { flex-wrap: wrap; }
  .trash-actions, .trash-clear { margin-left: auto; }
  .side-brand { margin-top: 0; }
  .project-heading .actions .button { padding: 5px 9px; font-size: 12px; }
  .dashboard-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-filters button { justify-self: start; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .metric { padding: 11px 13px; }
  .dashboard-grid > .panel, .dashboard-grid .calendar-card { grid-column: 1 / -1; }
  .day { min-height: 34px; }
  .record { grid-template-columns: minmax(0,1fr); gap: 6px; }
  .alias-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
