.work-log-shell {
  display: grid;
  gap: 14px;
}

.work-log-topbar {
  margin-bottom: 0;
}

.work-log-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.work-log-directory,
.work-log-calendar,
.work-log-detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.work-log-directory {
  position: sticky;
  top: 14px;
  overflow: hidden;
}

.work-log-directory-heading,
.work-log-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.work-log-directory-heading {
  min-height: 52px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.work-log-directory-heading h2,
.work-log-detail-heading h2,
.work-log-month-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.work-log-directory-heading h2 {
  font-size: 15px;
}

.work-log-directory-heading > span,
.work-log-count,
.work-log-month-title > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.work-log-user-list {
  display: grid;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
  padding: 8px;
}

.work-log-user {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.work-log-user:hover,
.work-log-user:focus-visible {
  background: #f6f3ef;
  outline: none;
}

.work-log-user.is-active {
  border-color: #a8c9b5;
  background: #eaf5ee;
  color: #1d5139;
}

.work-log-user-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ece8e3;
  color: #514940;
  font-size: 13px;
  font-weight: 900;
}

.work-log-user.is-active .work-log-user-mark {
  background: #24523b;
  color: #fff;
}

.work-log-user-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.work-log-user-copy strong,
.work-log-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-log-user-copy strong {
  font-size: 13px;
}

.work-log-user-copy small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.work-log-main {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.work-log-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.work-log-month-navigation {
  display: flex;
  gap: 6px;
}

.work-log-month-navigation button,
.work-log-add-button,
.work-log-detail-actions button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.work-log-month-navigation button {
  display: grid;
  place-items: center;
  width: 38px;
  padding: 0;
  font-size: 24px;
}

.work-log-month-navigation .work-log-today-button {
  width: auto;
  padding: 0 13px;
  font-size: 13px;
}

.work-log-month-navigation button:hover,
.work-log-month-navigation button:focus-visible,
.work-log-add-button:hover,
.work-log-add-button:focus-visible,
.work-log-detail-actions button:hover,
.work-log-detail-actions button:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
  outline: none;
}

.work-log-month-title {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.work-log-month-title h2 {
  font-size: 24px;
}

.work-log-count {
  justify-self: end;
}

.work-log-calendar {
  overflow: hidden;
  box-shadow: var(--shadow);
}

.work-log-weekdays,
.work-log-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.work-log-weekdays {
  border-bottom: 1px solid var(--line);
  background: #faf8f5;
}

.work-log-weekdays span {
  padding: 10px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.work-log-weekdays span:first-child,
.work-log-day:nth-child(7n + 1) .work-log-day-number {
  color: #d7492d;
}

.work-log-weekdays span:last-child,
.work-log-day:nth-child(7n) .work-log-day-number {
  color: #2762a5;
}

.work-log-day {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 105px;
  gap: 7px;
  padding: 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.work-log-day:nth-child(7n) {
  border-right: 0;
}

.work-log-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.work-log-day:hover,
.work-log-day:focus-visible {
  background: #f8faf8;
  outline: none;
}

.work-log-day.is-outside {
  background: #faf9f7;
  color: #aaa199;
}

.work-log-day.is-selected {
  background: #f0f7f2;
  box-shadow: inset 0 0 0 2px rgba(36, 82, 59, 0.3);
}

.work-log-day-number {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

.work-log-day.is-today .work-log-day-number {
  background: var(--primary);
  color: #fff;
}

.work-log-day.has-log:not(.is-today) .work-log-day-number::after {
  width: 5px;
  height: 5px;
  margin-left: 3px;
  border-radius: 50%;
  background: #d8663b;
  content: "";
}

.work-log-day-excerpt {
  display: -webkit-box;
  overflow: hidden;
  color: #645b52;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.work-log-detail {
  min-height: 190px;
  padding: 18px;
}

.work-log-detail-heading {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.work-log-detail-heading h2 {
  margin-top: 4px;
  font-size: 20px;
}

.work-log-detail-actions {
  display: flex;
  gap: 7px;
}

.work-log-add-button,
.work-log-detail-actions button {
  padding: 0 14px;
}

.work-log-detail-actions .is-danger {
  border-color: #f0b5a4;
  color: #c63e21;
}

.work-log-lines {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.work-log-lines li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.work-log-lines li > span {
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: #d8663b;
}

.work-log-lines p {
  margin: 0;
  color: #3f3934;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.work-log-empty {
  display: grid;
  place-items: center;
  min-height: 110px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.work-log-modal {
  width: min(580px, calc(100vw - 32px));
}

.work-log-form {
  display: grid;
  gap: 14px;
}

.work-log-form textarea {
  resize: vertical;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .work-log-layout {
    grid-template-columns: 1fr;
  }

  .work-log-directory {
    position: static;
  }

  .work-log-user-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 220px;
  }
}

@media (max-width: 640px) {
  .work-log-shell {
    gap: 10px;
  }

  .work-log-user-list {
    grid-template-columns: 1fr;
  }

  .work-log-toolbar {
    grid-template-columns: auto 1fr;
  }

  .work-log-month-title {
    justify-items: end;
  }

  .work-log-month-title h2 {
    font-size: 19px;
  }

  .work-log-count {
    display: none;
  }

  .work-log-day {
    min-height: 54px;
    padding: 5px;
  }

  .work-log-day-excerpt {
    display: none;
  }

  .work-log-detail {
    min-height: 170px;
    padding: 14px;
  }

  .work-log-detail-heading {
    align-items: flex-start;
  }

  .work-log-detail-heading h2 {
    font-size: 17px;
  }
}
