:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --panel: #ffffff;
  --line: #d7dbe2;
  --text: #151922;
  --muted: #5f6876;
  --accent: #1d6f8f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.app-version {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

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

.sidebar {
  padding: 14px;
  border-right: 1px solid var(--line);
  background: #eef1f5;
}

.sidebar-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 12px;
  align-items: start;
}

.sidebar-projects {
  min-width: 0;
}

.timer-card {
  background: #101820;
  color: #ffffff;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
}

.timer-card .timer {
  justify-content: space-between;
}

.timer-card .timer span {
  color: #c7d1dc;
}

.timer-card .timer strong {
  font-size: 1.65rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.content {
  padding: 18px;
}

.panel,
.project-head {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.project-head {
  display: flex;
  justify-content: flex-start;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.project-action {
  flex: 0 0 auto;
}

.project-summary {
  min-width: 0;
}

.work-button {
  width: auto;
  min-width: 142px;
  font-weight: 700;
}

.work-button.is-working {
  background: #4dd7e8;
  border-color: #1298aa;
  color: #052f36;
}

.work-button.is-resting {
  background: #e8eaee;
  border-color: #b9c0ca;
  color: #1d242d;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.new-project,
.stack {
  display: grid;
  gap: 8px;
}

input,
textarea,
select,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

button {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  cursor: pointer;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.check input {
  width: auto;
}

.project-list {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}

.project-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.6);
}

.project-link.active {
  border-color: #c96f1a;
  background: #ffe2bf;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.project-color-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 28px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.project-priority,
.project-time,
.pin,
.meta,
.empty,
small {
  color: var(--muted);
}

.project-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.pin {
  font-size: 0.78rem;
  font-weight: 700;
  margin-right: 4px;
}

.timer {
  display: flex;
  gap: 10px;
  align-items: center;
}

.day-timeline {
  display: grid;
  justify-items: center;
  gap: 6px;
  position: sticky;
  top: 14px;
}

.timeline-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.timeline-bars {
  display: grid;
  grid-template-columns: 20px 20px;
  gap: 4px;
  height: 600px;
}

.worked-bar,
.day-bar {
  width: 20px;
  height: 600px;
  border-radius: 4px;
}

.worked-bar {
  position: relative;
  background: transparent;
  outline: 1px solid rgba(21, 25, 34, 0.12);
  overflow: hidden;
}

.worked-segment {
  position: absolute;
  left: 0;
  width: 20px;
}

.day-bar {
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 41.5px,
      rgba(21, 25, 34, 0.22) 41.5px,
      rgba(21, 25, 34, 0.22) 42.5px
    ),
    #dfe4ea;
  border: 1px solid #c3cad4;
}

.items {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 8px;
}

.items li {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.login-box {
  width: min(360px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.error {
  color: #a12f2f;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-main {
    grid-template-columns: 1fr;
  }

  .day-timeline {
    display: none;
  }
}
