:root {
  color-scheme: light;
  --bg-primary: #ffffff;
  --bg-surface: #ffffff;
  --bg-hover: #f4f4f3;
  --text-primary: #262626;
  --text-secondary: #787774;
  --border-subtle: #aaaaaa;
  --accent: #2383e2;
  --accent-strong: #0f5da9;
  --accent-soft: #eaf3fc;
  --danger: #d44c47;
  --warning: #a36a16;
  --success: #2f7d4a;
  --urgent: #c2443c;
  --radius-sm: 4px;
  --radius-md: 6px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --font-xs: 0.75rem;
  --font-sm: 0.84rem;
  --font-base: 0.95rem;
  --bg: var(--bg-primary);
  --panel: var(--bg-surface);
  --ink: var(--text-primary);
  --muted: var(--text-secondary);
  --line: var(--border-subtle);
  --warm: var(--warning);
  --soft: var(--accent-soft);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #fff;
}

.splash-screen svg {
  width: 72px;
  height: 72px;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 40px;
}

body.topbar-desktop-bottom .app-shell {
  padding-bottom: 96px;
}

.topbar,
.quick-add,
.tasks-heading,
.calendar-heading,
.calendar-controls,
.task-topline,
.task-title-wrap,
.task-actions,
.auth-actions,
.dialog-header {
  display: flex;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 0 12px;
  background: var(--bg);
}

body.topbar-desktop-bottom .topbar {
  position: fixed;
  top: auto;
  bottom: 0;
  left: 50%;
  width: min(1200px, calc(100% - 32px));
  transform: translateX(-50%);
  margin-bottom: 0;
  padding: 12px 0 18px;
}

body.topbar-desktop-bottom .app-menu {
  top: auto;
  bottom: calc(100% + 8px);
}

.app-mark {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.app-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.menu-wrap {
  position: relative;
}

.view-tab,
.filter-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 11px;
  cursor: pointer;
}

.menu-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.menu-button svg {
  width: 22px;
  height: 22px;
}

.menu-button path {
  fill: currentColor;
}

.app-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  width: 150px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 12px 28px rgb(31 39 36 / 0.12);
}

.app-menu .view-tab {
  border: 0;
  border-radius: 6px;
  text-align: left;
}

.task-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.task-search {
  flex: 1;
  width: auto;
  min-width: 110px;
  padding: 8px 10px;
}

.task-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.filters,
.task-meta,
.toggle-row {
  display: flex;
  gap: 8px;
}

.filters,
.toggle-row {
  flex-wrap: wrap;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-list.compact-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.task-list.is-reordering {
  gap: 18px;
}

.task-list.is-reordering .task-card {
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease,
    margin 120ms ease;
}

.task-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 46px 14px 14px;
  display: grid;
  gap: 10px;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.task-card.compact {
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  gap: 0;
}

.task-card.compact .task-topline {
  align-items: center;
}

.task-card.compact .task-title-wrap {
  align-items: center;
}

.task-card.compact .task-actions {
  display: none;
}

.task-card.compact .task-notes,
.task-card.compact .detail-row {
  display: none;
}

.task-card.is-child {
  margin-left: 28px;
  border-left: 4px solid var(--line);
}

.task-card.is-done {
  opacity: 0.72;
}

.task-card.is-due-today {
  border-color: #d56a4a;
  background: #fff7f2;
}

.task-card.is-overdue {
  border-color: #c84b35;
  background: #fff1ec;
  box-shadow:
    inset 4px 0 0 #c84b35,
    0 6px 18px rgb(200 75 53 / 0.16);
}

.task-card.is-due-tomorrow {
  border-color: #d99b35;
  background: #fffaf0;
}

.task-topline {
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-title-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  flex: 1;
  column-gap: 10px;
  row-gap: 4px;
  align-items: start;
  min-width: 0;
}

.task-title-wrap .drag-handle {
  grid-column: 1;
  grid-row: 1;
}

.task-title-wrap .task-title-button,
.task-title-wrap .task-meta {
  grid-column: 2;
}

.title-icon-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  vertical-align: -2px;
}

.title-tag-icon {
  width: 15px;
  height: 15px;
  opacity: 0.76;
  color: var(--muted);
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.task-title {
  margin: 0;
  font-weight: 700;
}

.task-title-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  padding: 0;
  text-align: left;
  font-weight: 700;
}

.task-card:not(.compact) .task-title-wrap {
  align-items: start;
  padding-right: 4px;
}

.task-card:not(.compact) .detail-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.task-card:not(.compact) .detail-row::-webkit-scrollbar {
  display: none;
}

.task-card:not(.compact) .detail-row .badge,
.task-card:not(.compact) .detail-row .inline-tag-wrap {
  flex: 0 0 auto;
  white-space: nowrap;
}

.task-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.task-card.is-drop-target-before {
  margin-top: 0;
}

.drop-preview {
  opacity: 0.5;
  border-style: dashed;
  pointer-events: none;
}

.task-list.is-reordering .task-card {
  min-height: 42px;
}

.drag-handle {
  display: inline-flex;
  align-items: flex-start;
  align-self: start;
  color: var(--muted);
  cursor: default;
  font-size: 0.95rem;
  line-height: 1.45;
  user-select: none;
}

.task-card:hover {
  border-color: #bcc8c3;
  box-shadow: 0 4px 12px rgb(31 39 36 / 0.08);
}

.badge {
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 0.8rem;
}

.badge.urgent {
  background: #f9ded4;
  color: #9b3d32;
}

.badge.asap {
  background: #f8ebc9;
  color: #7a5a1d;
}

.badge.stage {
  background: #f4efe3;
  color: #7a5a1d;
}

.badge.category-private,
.inline-tag-button.category-private {
  background: #ece8f8;
  color: #5a438e;
}

.badge.due-today {
  background: #f9ded4;
  color: #9b3d32;
}

.badge.due-overdue {
  background: #c84b35;
  color: #fff;
}

.badge.due-tomorrow {
  background: #f8ebc9;
  color: #7a5a1d;
}

.task-notes {
  color: var(--muted);
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.task-notes a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.task-actions {
  display: contents;
}

.icon-action-button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-action-button img {
  width: 18px;
  height: 18px;
  display: block;
}
.icon-action-button svg {
  width: 18px;
  height: 18px;
}

.icon-action-button path {
  fill: currentColor;
}

.task-top-actions,
.task-bottom-actions {
  position: absolute;
  right: 12px;
  display: flex;
  gap: 3px;
}

.task-top-actions {
  top: 12px;
}

.task-bottom-actions {
  bottom: 12px;
}

.task-actions .icon-action-button,
.task-bottom-button {
  position: static;
}

.task-bottom-button[data-task-last] svg {
  transform: rotate(180deg);
}

.action-button,
.delete-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.primary-button,
.ghost-button,
.icon-button {
  border: 1px solid transparent;
  cursor: pointer;
}

.detail-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.danger-button {
  color: #9b3d32;
}

.primary-button {
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 11px 14px;
  font-weight: 700;
}

.ghost-button {
  border-color: var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  padding: 9px 12px;
}

.toolbar-icon-button,
.filter-button {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
}

.toolbar-icon-button svg,
.filter-button svg {
  width: 21px;
  height: 21px;
  color: currentColor;
}

.toolbar-icon-button svg {
  display: block;
}

.filter-all path {
  fill: currentColor;
}

.filter-someday path,
.filter-shopping path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-icon-button.is-detailed {
  display: inline-grid;
  place-items: center;
}

.density-simple {
  display: inline-grid;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-card,
.auth-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.detail-card {
  max-height: min(86vh, 760px);
  overflow: auto;
}

.detail-card .detail-actions {
  position: sticky;
  bottom: -20px;
  margin: 0 -20px -20px;
  padding: 12px 20px 20px;
  background: #fff;
}

.inline-tag-button {
  border: 0;
  cursor: pointer;
}

.inline-tag-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.inline-tag-menu {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 6px;
  animation: reveal-tag-menu 140ms ease-out;
}

.inline-tag-menu button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 4px 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

@keyframes reveal-tag-menu {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.dialog-header {
  align-items: center;
  justify-content: space-between;
}

.dialog-header h2 {
  margin-bottom: 0;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tag-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

.tag-fieldset legend {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-option {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 11px;
  cursor: pointer;
}

.tag-option.is-selected {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.is-hidden {
  display: none;
}

.view.is-hidden {
  display: none;
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ink);
}

.check-pill input {
  width: auto;
  margin: 0;
}

.helper-text,
.auth-message {
  color: var(--muted);
}

.setting-block {
  display: grid;
  gap: 10px;
  max-width: 680px;
}

.setting-block h3 {
  margin-bottom: 0;
}

.calendar-controls {
  align-items: center;
  gap: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-cell {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: grid;
  align-content: start;
  gap: 8px;
}

.calendar-cell.is-muted {
  opacity: 0.45;
}

.calendar-date {
  font-weight: 700;
}

.calendar-entry {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: var(--soft);
  color: var(--accent-strong);
  padding: 6px 7px;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.archive-list {
  display: grid;
  gap: 10px;
}

.archive-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}

.archive-title-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  text-align: left;
  font-weight: 700;
}

.archive-title-button:hover {
  color: var(--accent-strong);
}

.archive-actions {
  display: flex;
  gap: 8px;
}

.work-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.work-title-input {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  padding: 6px 0;
}

.confirm-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.confirm-card p {
  margin-bottom: 0;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.work-details {
  display: grid;
  gap: 8px;
}

.work-category-editor {
  min-width: 0;
}

.work-deadline-editor {
  min-width: 0;
}

.work-edit-row {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.work-edit-row > * {
  flex: 0 1 auto;
}

.work-flag-editor {
  margin-left: auto;
}

.work-flag-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.flag-icon-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  opacity: 0.46;
}

.flag-icon-button.is-active {
  border-color: var(--accent);
  background: var(--soft);
  color: var(--accent-strong);
  opacity: 1;
}

.flag-icon-button svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.work-deadline-stack {
  display: grid;
  gap: 10px;
}

.work-deadline-menu {
  flex-wrap: wrap;
}

.work-deadline-fields {
  align-items: end;
}

.work-inline-tag-wrap {
  width: 100%;
}

.work-notes-label textarea {
  min-height: 96px;
}

.stopwatch {
  display: grid;
  gap: 8px;
}

.stopwatch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.timer-icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.timer-icon-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.elapsed-time-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

.time-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.time-stepper button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 6px;
}

.time-stepper .time-step-minus-strong {
  border-color: #b45f3b;
  background: #d7744d;
  color: #fff;
}

.time-stepper .time-step-minus-soft {
  border-color: #e6b49e;
  background: #f6e8e2;
  color: #9b3d32;
}

.time-stepper .time-step-plus-soft {
  border-color: #b9ccec;
  background: #eaf1ff;
  color: #244f8f;
}

.time-stepper .time-step-plus-strong {
  border-color: #2f67b1;
  background: #2f67b1;
  color: #fff;
}

.stopwatch strong {
  font-size: 2rem;
}

.work-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

dialog {
  width: min(620px, calc(100% - 32px));
  margin: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgb(31 39 36 / 0.35);
}

.icon-button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
}

.close-icon-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.close-icon-button svg {
  width: 22px;
  height: 22px;
}

.close-icon-button path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 820px) {
  .calendar-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-grid {`n    grid-template-columns: 1fr;`n  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1200px);
  }

  body.topbar-desktop-bottom:not(.topbar-mobile-bottom) .app-shell {
    padding-bottom: 40px;
  }

  body.topbar-desktop-bottom:not(.topbar-mobile-bottom) .topbar {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    width: auto;
    transform: none;
    margin-bottom: 24px;
    padding: 18px 0 12px;
  }

  body.topbar-desktop-bottom:not(.topbar-mobile-bottom) .app-menu {
    top: calc(100% + 8px);
    bottom: auto;
  }

  body.topbar-mobile-bottom .app-shell {
    padding-bottom: 92px;
  }

  body.topbar-mobile-bottom .topbar {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 50%;
    width: min(100% - 20px, 1200px);
    transform: translateX(-50%);
    margin-bottom: 0;
    padding: 10px 0 14px;
  }

  body.topbar-mobile-bottom .app-menu {
    top: auto;
    bottom: calc(100% + 8px);
  }

  .tasks-heading {
    gap: 8px;
  }

  .task-search {
    min-width: 92px;
    padding-inline: 8px;
  }

  .task-toolbar {
    gap: 6px;
  }

  .filters {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .filter-button,
  .toolbar-icon-button {
    width: 34px;
    height: 34px;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

  .task-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .task-title-wrap {
    align-content: start;
  }
}

.markdown-export-card {
  width: min(720px, calc(100vw - 32px));
}

#markdownExportOutput {
  min-height: min(52vh, 520px);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.55;
}

.markdown-export-actions {
  justify-content: flex-end;
}
.work-mode-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.work-mode-status {
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.setting-check {
  display: flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
  margin-top: 8px;
}

.unrecorded-notice {
  margin: 0 0 12px;
}

.unrecorded-notice button {
  width: 100%;
  border: 1px solid #c98a4b;
  border-radius: 6px;
  background: #fff6e9;
  color: #7b4a1c;
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
  font-weight: 700;
}

.idle-prompt-card {
  width: min(500px, calc(100vw - 32px));
  margin: 0 auto;
}

.idle-prompt-selector {
  margin: 2px 0 4px;
}

.idle-prompt-selector-label {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: var(--font-sm);
}

.idle-prompt-options {
  display: grid;
  gap: 6px;
}

.idle-prompt-option {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}

.idle-prompt-option:hover,
.idle-prompt-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.guest-view {
  display: grid;
  min-height: min(70vh, 620px);
  place-items: center;
  padding: 32px 0;
}

.guest-panel {
  display: grid;
  width: min(100%, 360px);
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.guest-panel img {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.guest-panel h1,
.guest-panel p {
  margin: 0;
}

.guest-panel p {
  color: var(--text-secondary);
}

.idle-prompt-actions,
.idle-prompt-form {
  display: grid;
  gap: 10px;
}

.idle-prompt-form {
  margin-top: 14px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 18px;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 6px;
  background: #1f2724;
  color: #fff;
  padding: 10px 14px;
  box-shadow: 0 10px 24px rgb(31 39 36 / 0.2);
}

/* MyWork workspace refresh: calm, text-led, and dense without card clutter. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-base);
  line-height: 1.55;
}

.app-shell {
  width: min(1040px, calc(100% - 40px));
}

.topbar {
  gap: var(--space-2);
  margin-bottom: 18px;
  padding: 12px 0;
  background: #ffffff;
  backdrop-filter: blur(10px);
}

.app-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

.top-quick-add {
  flex: 1;
  min-width: 0;
}

.top-quick-add input {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 8px 10px;
  color: var(--text-primary);
  transition: background 120ms ease, box-shadow 120ms ease;
}

.top-quick-add input::placeholder { color: #9b9a97; }
.top-quick-add input:focus { background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-subtle); outline: 0; }

.menu-button,
.icon-button,
.work-mode-icon-button {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
}

.menu-button:hover,
.icon-button:hover,
.work-mode-icon-button:hover { background: var(--bg-hover); color: var(--text-primary); }

.app-menu {
  width: 170px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 20px rgb(15 15 15 / 0.08);
  padding: 5px;
}

.app-menu .view-tab { padding: 8px 9px; color: var(--text-primary); font-size: var(--font-sm); }
.app-menu .view-tab:hover, .app-menu .view-tab.is-active { background: var(--bg-hover); }

.section-heading { margin-bottom: 14px; }
.section-heading h2 { margin: 0; font-size: 1.12rem; font-weight: 650; letter-spacing: 0; }
#toggleDensityButton { display: none; }

.task-toolbar-left { gap: 6px; }
.task-search { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); }
.task-search:focus { background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-subtle); outline: 0; }
.filter-button, .toolbar-icon-button { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: transparent; color: var(--text-secondary); }
.filter-button:hover, .toolbar-icon-button:hover, .filter-button.is-active { background: var(--bg-hover); color: var(--text-primary); }

.task-list, .task-list.compact-layout {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--border-subtle);
}

.task-card,
.task-card.compact {
  width: 100%;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  padding: 10px 76px 10px 4px;
  gap: 4px;
  box-shadow: none;
}

.task-card:hover { border-color: var(--border-subtle); background: var(--bg-hover); box-shadow: none; }
.task-card.compact .task-topline, .task-card.compact .task-title-wrap { align-items: start; }
.task-card.compact .task-title-wrap { gap: 3px 8px; }
.task-card.compact .task-meta { display: flex; }
.task-card.compact .task-actions { display: contents; }
.task-card.compact .task-notes, .task-card.compact .detail-row { display: none; }

.task-card.is-child {
  margin-left: 22px;
  width: calc(100% - 22px);
  border-left: 1px solid #d8d8d5;
  padding-left: 12px;
}

.task-card.is-due-today,
.task-card.is-overdue,
.task-card.is-due-tomorrow { background: transparent; box-shadow: inset 3px 0 0 transparent; }
.task-card.is-due-today { box-shadow: inset 3px 0 0 #dd7c59; }
.task-card.is-overdue { box-shadow: inset 3px 0 0 var(--urgent); }
.task-card.is-due-tomorrow { box-shadow: inset 3px 0 0 #d5a341; }

.task-title-wrap { column-gap: 8px; row-gap: 2px; }
.task-title-button { font-size: var(--font-base); font-weight: 520; line-height: 1.45; }
.task-card.compact .task-title-button { font-weight: 520; }
.task-title-wrap .task-meta { gap: 4px; }
.drag-handle { color: #c6c6c3; font-size: 0.82rem; line-height: 1.55; }
.title-tag-icon { width: 14px; height: 14px; opacity: 0.62; }

.badge {
  border-radius: 3px;
  background: #f1f1ef;
  color: #5f5f5b;
  padding: 2px 5px;
  font-size: var(--font-xs);
  font-weight: 500;
}
.badge.urgent, .badge.due-today { background: #f9e7e4; color: #aa453f; }
.badge.asap, .badge.due-tomorrow { background: #fbf3df; color: #8b641b; }
.badge.due-overdue { background: #f7dfdc; color: #a83531; }
.badge.category-private, .inline-tag-button.category-private { background: #f0ecfa; color: #65518e; }
.task-notes { margin: 3px 0 0 25px; font-size: var(--font-sm); line-height: 1.55; }

.task-top-actions, .task-bottom-actions { right: 6px; gap: 1px; }
.task-top-actions { top: 7px; }
.task-bottom-actions { bottom: 7px; }
.icon-action-button { display: inline-grid; place-items: center; width: 25px; height: 25px; padding: 0; line-height: 1; border: 1px solid var(--border-subtle); color: #8f8f8b; }
.icon-action-button svg { display: block; width: 15px; height: 15px; }
.icon-action-button:hover { color: var(--text-primary); background: #eaeae8; }

.work-card { gap: 14px; padding: 22px; }
.work-title-input { font-size: 1.25rem; font-weight: 600; border-bottom-color: transparent; }
.work-title-input:focus { border-bottom-color: var(--border-subtle); outline: 0; }
.work-edit-row { gap: 6px; align-items: center; }
.work-flag-editor { margin-left: 0; }
.flag-icon-button { width: 30px; height: 30px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: transparent; opacity: 0.8; }
.flag-icon-button:hover { background: var(--bg-hover); opacity: 1; }
.flag-icon-button.is-active { border-color: #bfd6ec; background: var(--accent-soft); color: var(--accent-strong); }
.work-delete-button { color: var(--danger); }
.work-delete-button:hover { background: #fae9e8; color: #b63934; }
.work-notes-label { gap: 4px; font-size: var(--font-sm); }
.work-notes-label textarea { min-height: 148px; border: 0; border-radius: var(--radius-sm); background: #f8f8f7; padding: 10px; }
.work-notes-label textarea:focus { background: var(--bg-surface); box-shadow: 0 0 0 1px var(--border-subtle); outline: 0; }

.stopwatch { gap: 6px; padding-top: 4px; }
.stopwatch-header > span { color: var(--text-secondary); font-size: var(--font-sm); }
.timer-icon-button { width: 34px; height: 34px; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); background: var(--bg-hover); color: var(--text-primary); }
.elapsed-time-input { width: 100%; border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 2rem; font-weight: 700; text-align: center; }
.time-stepper { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.time-stepper button, .time-stepper .time-step-minus-strong, .time-stepper .time-step-minus-soft, .time-stepper .time-step-plus-soft, .time-stepper .time-step-plus-strong { border: 1px solid var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 6px; font-size: var(--font-sm); }
.time-stepper .time-step-minus-strong { background: #f7dfdc; color: #a83531; }
.time-stepper .time-step-minus-soft { background: #fbefed; color: #b85e59; }
.time-stepper .time-step-plus-soft { background: #eaf3fc; color: #3470aa; }
.time-stepper .time-step-plus-strong { background: #dbeafa; color: #1d5d9b; }
.work-actions { justify-content: flex-start; border-top: 1px solid var(--border-subtle); padding-top: 14px; }
#completeWorkButton { margin-left: auto; }
.primary-button { border: 1px solid var(--accent-strong); border-radius: var(--radius-sm); background: var(--accent); padding: 8px 12px; font-size: var(--font-sm); }
.ghost-button { border-color: var(--border-subtle); border-radius: var(--radius-sm); padding: 8px 10px; font-size: var(--font-sm); }
.ghost-button:hover { background: var(--bg-hover); }

.work-mode-controls { order: 2; margin-left: 0; gap: 4px; }
.work-mode-status { display: inline-grid; place-items: center; width: 22px; height: 32px; }
.work-mode-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px #e8f4eb; }
.work-mode-icon-button { display: inline-grid; place-items: center; width: 32px; height: 32px; cursor: pointer; padding: 0; }
.work-mode-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.unrecorded-notice { margin: 0 0 8px; }
.unrecorded-notice button { border: 0; border-radius: var(--radius-sm); background: #fbf3df; color: #87611e; padding: 7px 9px; font-size: var(--font-sm); font-weight: 500; }
.notification-setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.stale-session-button { width: auto; min-height: 30px; padding: 4px 7px; gap: 5px; color: var(--danger); }
.stale-session-button svg { width: 15px; height: 15px; }

.settings-panel, .archive-panel, .calendar-panel, .tasks-panel { padding-bottom: 18px; }
.setting-block { max-width: 720px; gap: 9px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.setting-block h3 { margin: 0; font-size: var(--font-base); font-weight: 600; }
.setting-block:last-child { border-bottom: 0; }
.check-pill { border: 0; border-radius: var(--radius-sm); background: transparent; padding: 5px 0; color: var(--text-primary); }
.calendar-grid { gap: 1px; background: var(--border-subtle); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); overflow: hidden; }
.calendar-cell { border: 0; border-radius: 0; background: var(--bg-surface); padding: 9px; min-height: 112px; }
.calendar-entry { border-radius: var(--radius-sm); background: #f2f2f1; color: var(--text-primary); font-size: var(--font-xs); }
.archive-list { gap: 0; border-top: 1px solid var(--border-subtle); }
.archive-item { border: 0; border-bottom: 1px solid var(--border-subtle); border-radius: 0; padding: 10px 4px; gap: 4px; }
.archive-title-button { font-weight: 550; }
.archive-actions { gap: 3px; }
.empty-state { border: 0; border-radius: var(--radius-sm); background: #f6f6f5; color: var(--text-secondary); padding: 26px; }
.helper-text, .auth-message, label { color: var(--text-secondary); }
.detail-card, .auth-card { gap: 12px; padding: 22px; }
.detail-card .detail-actions { background: var(--bg-surface); }

dialog { border-radius: var(--radius-md); box-shadow: 0 20px 50px rgb(15 15 15 / 0.16); }
dialog::backdrop { background: rgb(15 15 15 / 0.26); }

@media (min-width: 700px) {
  .task-card:not(:hover) .task-top-actions,
  .task-card:not(:hover) .task-bottom-actions { opacity: 0.12; }
  .task-card:hover .task-top-actions,
  .task-card:hover .task-bottom-actions { opacity: 1; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 24px, 1040px); }
  .topbar { gap: 4px; }
  .app-mark { width: 32px; height: 32px; }
  .top-quick-add input { padding-inline: 6px; }
  .work-mode-status { width: 14px; }
  .work-mode-dot { width: 7px; height: 7px; }
  .work-mode-icon-button { width: 30px; height: 30px; }
  .task-card, .task-card.compact { padding-right: 62px; }
  .task-card.is-child { margin-left: 14px; width: calc(100% - 14px); padding-left: 9px; }
  .task-top-actions, .task-bottom-actions { opacity: 1; }
  .work-card { padding: 18px; }
}

@media (max-width: 560px) {
  .work-mode-controls { gap: 4px; }
  .work-mode-status { display: none; }
  .work-mode-controls .ghost-button { padding: 7px 8px; font-size: 0.8rem; }
}
