:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-muted: #f1f1ef;
  --ink: #37352f;
  --muted: #787774;
  --line: #e9e9e7;
  --accent: #37352f;
  --accent-ink: #ffffff;
  --shadow: 0 8px 24px rgba(15, 15, 15, 0.05);
  --motion-fast: 120ms ease;
  --motion-normal: 160ms ease;
  --motion-soft: 220ms ease;
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

@font-face {
  font-family: "Digital-7";
  src: url("./fonts/Digital-7.ttf") format("truetype");
  font-display: swap;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes soft-pop {
  from {
    opacity: 0.9;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes backdrop-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes calendar-rise {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gentle-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.site-record-footer {
  border-top: 1px solid var(--line);
  background: #fbfbfa;
  padding: 10px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.site-record-footer a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  transition:
    background-color var(--motion-normal),
    border-color var(--motion-normal),
    color var(--motion-normal),
    opacity var(--motion-normal),
    transform var(--motion-normal),
    box-shadow var(--motion-normal);
}

button:active:not(:disabled) {
  transform: scale(0.97);
}

.icon-choice:active:not(:disabled) {
  transform: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfbfa;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #ffffff;
}

.brand h1,
.brand p,
.topbar h2,
.topbar p,
.panel h3,
.panel p {
  margin: 0;
}

.brand h1 {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
}

.brand p,
.eyebrow,
.section-kicker,
.note-label {
  color: var(--muted);
  font-size: 12px;
}

.space-list {
  display: grid;
  gap: 6px;
}

.space-button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
  transition:
    background-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.space-button[data-space-id="dashboard"] {
  --space-color: #6f6e69;
}

.space-button[data-space-id="life"],
.bookmark-category[data-category-id="life"] {
  --space-color: #548164;
}

.space-button[data-space-id="student"],
.bookmark-category[data-category-id="student"] {
  --space-color: #337ea9;
}

.space-button[data-space-id="research"],
.bookmark-category[data-category-id="research"] {
  --space-color: #9065b0;
}

.space-button[data-space-id="practice"],
.bookmark-category[data-category-id="practice"] {
  --space-color: #c7773c;
}

.space-button[data-space-id="bookmarks"] {
  --space-color: #c14c8a;
}

.space-button:hover,
.space-button.active {
  background: #f1f1ef;
  box-shadow: none;
}

.space-button:hover {
  transform: translateX(2px);
}

.space-icon,
.project-symbol {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--space-color, var(--ink));
  padding: 5px;
  flex: 0 0 auto;
  vertical-align: middle;
}

.space-button > .space-icon {
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--space-color, #787774) 26%, #ffffff);
  border-radius: 9px;
  background: color-mix(in srgb, var(--space-color, #787774) 11%, #ffffff);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  padding: 6px;
}

.space-nav-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--space-color, #787774) 32%, #ffffff);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.18)),
    color-mix(in srgb, var(--space-color, #787774) 15%, #ffffff);
  color: color-mix(in srgb, var(--space-color, var(--ink)) 82%, #20201d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 3px 8px rgba(15, 15, 15, 0.04);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.day-task small .project-symbol,
.project-item small .space-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  padding: 3px;
  margin-right: 3px;
}

.project-category-title,
.day-task small,
.project-item small {
  align-items: center;
}

.cloud-note {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
}

.cloud-note p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.cloud-sync {
  display: grid;
  gap: 10px;
}

.cloud-sync-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cloud-logout-button {
  width: 24px;
  height: 24px;
  min-height: 24px;
  border-radius: 6px;
  padding: 0;
}

.cloud-logout-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cloud-sync p {
  margin: 0;
}

.cloud-sync p.pending-sync {
  color: #8b6b18;
  font-weight: 600;
}

.cloud-sync input {
  min-height: 34px;
  font-size: 13px;
}

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

.cloud-actions button[hidden] + button,
.cloud-account-actions button:not([hidden]):only-child {
  grid-column: 1 / -1;
}

.cloud-transfer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cloud-actions button {
  min-width: 0;
  padding-inline: 8px;
}

.export-button {
  width: 100%;
  flex: 0 0 auto;
}

.user-panel-section {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbfa;
  padding: 10px;
}

.user-panel-section p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.user-panel-section label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.user-panel-section input {
  min-height: 36px;
  color: var(--ink);
}

.caldav-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.outlook-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mail-limit-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.user-actions {
  display: grid;
  gap: 8px;
}

.user-actions button {
  width: 100%;
  justify-content: center;
}

.workspace {
  min-width: 0;
  width: 100%;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  margin-bottom: 20px;
  padding-top: 0;
}

.topbar h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0;
}

.topbar-actions,
.panel-header,
.form-row,
.workflow-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  min-width: 0;
  align-self: flex-start;
  margin-top: 0;
}

.time-widget,
.weather-widget {
  display: grid;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 8px 8px 10px;
  animation: fade-up 220ms ease both;
}

.time-widget {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

.clock-face {
  width: 40px;
  height: 40px;
  display: block;
  border: 1.8px solid #787774;
  border-radius: 999px;
  background: #f8f8f7;
  position: relative;
}

.clock-face::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--ink);
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.clock-tick {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 4px;
  border-radius: 999px;
  background: #aaa8a2;
  transform-origin: center center;
}

.clock-tick:nth-child(1) {
  transform: translate(-50%, -50%) rotate(0deg) translateY(-17px);
}

.clock-tick:nth-child(2) {
  transform: translate(-50%, -50%) rotate(30deg) translateY(-17px);
}

.clock-tick:nth-child(3) {
  transform: translate(-50%, -50%) rotate(60deg) translateY(-17px);
}

.clock-tick:nth-child(4) {
  transform: translate(-50%, -50%) rotate(90deg) translateY(-17px);
}

.clock-tick:nth-child(5) {
  transform: translate(-50%, -50%) rotate(120deg) translateY(-17px);
}

.clock-tick:nth-child(6) {
  transform: translate(-50%, -50%) rotate(150deg) translateY(-17px);
}

.clock-tick:nth-child(7) {
  transform: translate(-50%, -50%) rotate(180deg) translateY(-17px);
}

.clock-tick:nth-child(8) {
  transform: translate(-50%, -50%) rotate(210deg) translateY(-17px);
}

.clock-tick:nth-child(9) {
  transform: translate(-50%, -50%) rotate(240deg) translateY(-17px);
}

.clock-tick:nth-child(10) {
  transform: translate(-50%, -50%) rotate(270deg) translateY(-17px);
}

.clock-tick:nth-child(11) {
  transform: translate(-50%, -50%) rotate(300deg) translateY(-17px);
}

.clock-tick:nth-child(12) {
  transform: translate(-50%, -50%) rotate(330deg) translateY(-17px);
}

.clock-hand {
  position: absolute;
  left: 50%;
  bottom: 50%;
  width: 2px;
  border-radius: 999px;
  background: var(--ink);
  transform-origin: bottom center;
  translate: -50% 0;
  transition: transform 180ms ease;
  z-index: 2;
}

.hour-hand {
  height: 10px;
}

.minute-hand {
  height: 14px;
  background: #787774;
}

.second-hand {
  width: 1px;
  height: 15px;
  background: #5f5e59;
  transition: transform 80ms linear;
}

.time-copy,
.weather-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

#timeNow,
#weatherTemp {
  font-family: "Digital-7", "Roboto Mono", Consolas, monospace;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1;
}

.time-copy span,
.time-copy small,
.weather-copy span,
.weather-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-copy span,
.time-copy small,
.weather-copy span,
.weather-copy small {
  color: var(--muted);
  font-size: 12px;
}

.time-copy strong,
.weather-copy strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.1;
}

.weather-widget {
  grid-template-columns: 40px minmax(0, 1fr) 32px;
  gap: 8px;
  width: 240px;
  min-width: 240px;
  max-width: 240px;
}

.weather-symbol {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--ink);
  padding: 5px;
}

.weather-symbol svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.weather-refresh {
  width: 32px;
  min-height: 32px;
  font-size: 16px;
}

.weather-refresh.loading {
  animation: soft-pop 600ms ease infinite alternate;
}

.weather-widget.error {
  border-color: #ead7d4;
}

.primary-button,
.ghost-button,
.icon-button,
.danger-button {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  padding: 0 14px;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.icon-button:disabled {
  cursor: not-allowed;
  background: #f1f1ef;
  color: #b7b7b2;
  border-color: var(--line);
}

.ghost-button {
  padding: 0 12px;
}

.danger-button {
  padding: 0 12px;
  color: #c4554d;
  border-color: #ead7d4;
}

.danger-button:hover {
  background: #fbefed;
  border-color: #d8aca6;
}

.status-button {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 38px;
  background: var(--surface);
  color: var(--ink);
}

.status-button:hover,
.status-button.active {
  background: #f1f1ef;
  border-color: #787774;
}

.icon-button {
  width: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 20px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
  width: 100%;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
  box-shadow: none;
  animation: fade-up 220ms ease both;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.metric:hover {
  border-color: #d9d8d4;
  box-shadow: 0 6px 16px rgba(15, 15, 15, 0.04);
  transform: translateY(-1px);
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
  width: 100%;
}

.content-layout.bookmark-mode {
  grid-template-columns: 1fr;
}

.content-layout.space-mode {
  grid-template-columns: minmax(0, 1fr) 360px;
}

.main-column {
  display: grid;
  gap: 18px;
  min-width: 0;
  width: 100%;
}

.content-layout.space-mode .main-column {
  order: 1;
}

.content-layout.space-mode .calendar-panel {
  order: 2;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-width: 0;
  width: 100%;
  box-shadow: none;
  animation: gentle-in 220ms ease both;
  transition:
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.panel:not(.calendar-panel):hover {
  border-color: #deddda;
  box-shadow: 0 8px 20px rgba(15, 15, 15, 0.035);
}

.panel-header {
  justify-content: space-between;
  margin-bottom: 14px;
}

#bookmarkPanel {
  max-height: none;
}

.panel h3 {
  font-size: 18px;
  margin-top: 2px;
}

.bookmark-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.bookmark-category {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--space-color, var(--line));
  border-radius: 8px;
  padding: 12px;
  background: #fbfbfa;
}

.bookmark-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.bookmark-column {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border-radius: 8px;
}

.bookmark-column.drag-over {
  background: #f8f8f7;
  outline: 1px dashed #c9c9c5;
  outline-offset: 3px;
}

.bookmark-category h4,
.bookmark-column h5 {
  margin: 0;
  font-size: 14px;
}

.bookmark-category h4 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--space-color, var(--ink));
}

.category-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--space-color, var(--muted));
}

.bookmark-column h5 {
  color: var(--muted);
  font-size: 12px;
}

.agenda-project-link,
.agenda-space-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  padding: 1px 3px;
}

.agenda-project-link:hover,
.agenda-space-link:hover {
  background: #f1f1ef;
}

.bookmark {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  min-height: 42px;
  padding: 6px 6px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  background: #ffffff;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

.bookmark-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  align-self: stretch;
  flex: 1 1 auto;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.bookmark-folder {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.bookmark-folder.drag-over > .folder-heading,
.bookmark-folder.drag-over {
  border-color: #b9b8b3;
  background: #f8f8f7;
}

.folder-heading {
  padding-left: 6px;
}

.bookmark-folder-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  text-align: left;
}

.bookmark-folder-toggle strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-folder-toggle small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.folder-caret {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 140ms ease;
}

.bookmark-folder.expanded .folder-caret {
  transform: rotate(90deg);
}

.bookmark-folder-items {
  display: grid;
  gap: 6px;
  padding-left: 18px;
}

.bookmark-link strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-symbol {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
}

.bookmark-symbol svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bookmark-delete {
  width: 28px;
  height: 28px;
  min-height: 28px;
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  display: grid;
  place-items: center;
  display: none;
}

#bookmarkPanel.editing .bookmark-delete {
  display: grid;
}

.bookmark-delete svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.bookmark-delete:hover {
  background: #f1f1ef;
  border-color: #deddda;
  color: var(--ink);
}

#editBookmarkBtn.active {
  background: #f1f1ef;
  border-color: #787774;
}

.bookmark:hover {
  background: #f7f7f5;
  border-color: #d9d8d4;
  box-shadow: 0 5px 14px rgba(15, 15, 15, 0.04);
  transform: translateY(-1px);
}

.bookmark.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.bookmark.drag-over {
  border-color: #c9c9c5;
  box-shadow: inset 0 0 0 1px #c9c9c5;
}

.task-meta,
.project-item small {
  color: var(--muted);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.kanban-empty {
  grid-column: 1 / -1;
}

.workflow-layout {
  display: grid;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.lane {
  min-width: 0;
  min-height: 260px;
  background: #fbfbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  transition:
    background-color 140ms ease,
    border-color 140ms ease;
}

.lane.drag-over {
  background: #f1f1ef;
  border-color: #c9c9c5;
  box-shadow: inset 0 0 0 1px #c9c9c5;
}

.lane-title {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.task-card {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-left: 5px solid var(--task-color);
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: grab;
  transition:
    box-shadow 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
  animation: soft-pop 160ms ease both;
}

.task-card:hover {
  box-shadow: 0 6px 18px rgba(15, 15, 15, 0.06);
  border-color: #c9c9c5;
  transform: translateY(-1px);
}

.task-card.dragging {
  cursor: grabbing;
  opacity: 0.55;
  transform: scale(0.98);
}

.task-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 700;
  margin-bottom: 8px;
}

.task-title span,
.task-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-location {
  color: var(--muted);
  font-size: 0.86em;
  font-weight: 500;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  min-width: 0;
  width: 100%;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-controls select {
  min-height: 36px;
}

.calendar-controls select {
  width: 118px;
}

.calendar-day,
.calendar-head {
  min-height: 78px;
  border-radius: 6px;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 5px;
  font-size: 12px;
}

.calendar-head {
  min-height: 24px;
  color: var(--muted);
  place-items: center;
}

.calendar-panel {
  min-height: 720px;
}

.content-layout.space-mode .calendar-panel {
  min-height: 0;
}

.content-layout.space-mode .calendar-day,
.content-layout.space-mode .calendar-head {
  min-height: 52px;
  height: auto;
  gap: 2px;
  padding: 4px;
}

.content-layout.space-mode .calendar-head {
  min-height: 24px;
}

.calendar-day {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  min-width: 0;
  width: 100%;
  overflow: visible;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
  animation: calendar-rise 180ms ease both;
}

.calendar-day:hover {
  background: #fbfbfa;
  border-color: #d9d8d4;
  transform: translateY(-1px) scale(1.005);
}

.calendar-day.muted {
  background: #f1f1ef;
  color: #a7a59f;
  opacity: 1;
}

.calendar-day.muted .calendar-date {
  color: #a7a59f;
}

.calendar-day.muted .calendar-event {
  background: #f7f7f5;
  color: #8f8d87;
  opacity: 0.72;
}

.calendar-day.muted .project-symbol {
  color: #aaa8a2;
}

.calendar-day.today {
  outline: 2px solid var(--accent);
}

.calendar-day.selected {
  background: #f8f8f7;
  border-color: #c9c9c5;
  box-shadow: inset 0 0 0 1px #c9c9c5;
}

.calendar-day.selected:not(.muted) .calendar-date {
  color: var(--ink);
}

.calendar-date {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.calendar-events {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.calendar-bars {
  display: grid;
  gap: 2px;
  margin-top: 2px;
  align-self: start;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  border: 1px solid #ecebea;
  border-left: 3px solid var(--task-color);
  border-radius: 4px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  padding: 2px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: calendar-rise 180ms ease both;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.calendar-event:hover {
  background: #fbfbfa;
  border-color: #deddda;
  border-left-color: var(--task-color);
  box-shadow: 0 4px 10px rgba(15, 15, 15, 0.05);
  transform: translateX(1px);
}

.calendar:not(.calendar-animate) .calendar-day,
.calendar:not(.calendar-animate) .calendar-event,
.calendar:not(.calendar-animate) .calendar-bar {
  animation: none;
}

.calendar-event .project-symbol {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

.calendar-event > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  padding-left: 2px;
}

.calendar-bar {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--bar-color);
  animation: soft-pop 160ms ease both;
}

.day-agenda {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.day-agenda-title {
  color: var(--muted);
  font-size: 13px;
}

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

.day-task {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px 10px;
  align-items: center;
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: #ffffff;
  animation: fade-up 180ms ease both;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.day-task:hover {
  background: #fbfbfa;
  border-color: #c9c9c5;
  transform: translateY(-1px);
}

.day-task .calendar-bar {
  background: var(--task-color);
}

.day-task small {
  grid-column: 2;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.project-list:has(.project-category) {
  grid-template-columns: 1fr;
}

.project-empty {
  grid-column: 1 / -1;
  min-height: 50px;
  display: grid;
  place-items: center;
}

.kanban-area {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.kanban-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.kanban-toolbar > strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-toolbar > strong span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-toolbar > strong .project-symbol {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  padding: 4px;
}

.kanban-toolbar .workflow-actions {
  gap: 4px;
}

.kanban-toolbar #editProjectBtn {
  margin-right: 0;
}

.project-category {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.project-category-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.project-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.project-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease,
    box-shadow 140ms ease;
}

.project-item:hover,
.project-item.active {
  background: #f1f1ef;
  border-color: #c9c9c5;
}

.project-item.complete {
  background: #fbfbfa;
  color: var(--muted);
}

.project-item:hover {
  box-shadow: 0 5px 14px rgba(15, 15, 15, 0.04);
  transform: translateY(-1px);
}

.project-item.dashboard-project {
  width: 100%;
  min-width: 0;
}

.project-copy {
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.project-item.dashboard-project .project-copy {
  min-height: 22px;
}

.project-copy br {
  display: none;
}

.project-item strong {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 1px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-complete-badge {
  flex: 0 0 auto;
  border: 1px solid #d7d7d4;
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.project-item small {
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-item .project-symbol {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 7px;
}

.project-color {
  width: 4px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--project-color);
}

.space-icon svg,
.project-symbol svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.space-icon circle:last-child,
.project-symbol circle:last-child {
  fill: currentColor;
  stroke: none;
}

.task-add-button {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  font-weight: 700;
}

.task-add-button:hover:not(:disabled) {
  background: #f1f1ef;
  border-color: #c9c9c5;
}

.task-add-button:disabled {
  background: #f1f1ef;
  color: #b7b7b2;
  border-color: var(--line);
}

.dialog {
  width: min(460px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  animation: soft-pop var(--motion-normal) both;
}

.dialog::backdrop {
  background: rgba(37, 34, 30, 0.28);
  animation: backdrop-in var(--motion-normal) both;
}

.dialog form {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.dialog header,
.dialog menu {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.dialog menu.split-menu {
  justify-content: space-between;
}

.menu-left,
.menu-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dialog h3 {
  margin: 0;
}

.confirm-dialog {
  width: min(360px, calc(100vw - 32px));
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.form-row > label {
  flex: 1;
  min-width: 0;
}

#taskForm .form-row {
  justify-content: flex-start;
}

#taskForm .form-row > label {
  flex: 0 0 128px;
}

#taskForm .form-row > label:first-child {
  flex-basis: 150px;
}

.time-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.time-pair span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

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

input,
select {
  width: 100%;
  min-height: 38px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 0 10px;
  transition:
    background-color var(--motion-normal),
    border-color var(--motion-normal),
    box-shadow var(--motion-normal);
}

input:focus,
select:focus {
  outline: none;
  border-color: #c9c9c5;
  box-shadow: 0 0 0 3px rgba(55, 53, 47, 0.08);
}

input[type="date"],
input[type="time"] {
  cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  border-radius: 5px;
  cursor: pointer;
  padding: 4px;
  transition:
    background-color var(--motion-normal),
    opacity var(--motion-normal),
    transform var(--motion-normal);
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  background-color: #f1f1ef;
  opacity: 0.85;
  transform: scale(1.08);
}

.form-context {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fbfbfa;
  color: var(--muted);
  font-size: 13px;
}

.color-palette {
  display: grid;
  grid-template-columns: repeat(9, 28px);
  gap: 8px;
  align-items: center;
}

.icon-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, 34px);
  gap: 8px;
}

.icon-choice {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0;
  transition:
    background-color var(--motion-fast),
    border-color var(--motion-fast);
}

.icon-choice .project-symbol {
  width: 22px;
  height: 22px;
  transition: none;
}

.icon-choice:hover,
.icon-choice:hover .project-symbol {
  transform: none;
}

.icon-choice.active {
  background: #f1f1ef;
  border-color: #787774;
}

.icon-choice:hover:not(.active) {
  background: #fbfbfa;
  border-color: #d9d8d4;
}

.color-swatch {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--swatch-color);
  padding: 0;
  transition:
    border-color var(--motion-normal),
    box-shadow var(--motion-normal),
    transform var(--motion-normal);
}

.color-swatch:hover {
  transform: translateY(-1px);
}

.color-swatch:hover,
.color-swatch.active {
  border-color: #787774;
}

.color-swatch.active {
  box-shadow:
    0 0 0 2px #ffffff,
    0 0 0 4px #37352f;
}

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

.empty.compact {
  padding: 12px;
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 20;
  max-width: min(320px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #37352f;
  color: #ffffff;
  padding: 10px 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 8px));
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .space-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-layout {
    grid-template-columns: 1fr;
  }

  .content-layout.space-mode {
    grid-template-columns: 1fr;
  }

  .content-layout.space-mode .main-column,
  .content-layout.space-mode .calendar-panel {
    order: initial;
  }

  .workflow-layout {
    grid-template-columns: 1fr;
  }

  .bookmark-columns {
    grid-template-columns: 1fr;
  }

  .project-list,
  .project-category-list,
  .bookmark-category-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1081px) and (max-width: 1320px) {
  .content-layout.space-mode {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .content-layout.space-mode .kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .panel-header,
  .workflow-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .time-widget,
  .weather-widget {
    min-width: 0;
    max-width: none;
    width: 100%;
  }

  .overview-grid,
  .kanban,
  .space-list {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 78px;
    padding: 5px;
  }

  .content-layout.space-mode .calendar-day {
    min-height: 48px;
    padding: 5px;
  }

  .calendar-event {
    font-size: 11px;
    padding-inline: 4px;
  }
}
