:root {
  --ink: var(--mv-bg);
  --deep: var(--mv-bg-deep);
  --panel: var(--mv-panel);
  --raised: var(--mv-panel-raised);
  --line: var(--mv-line);
  --text: var(--mv-text);
  --muted: var(--mv-muted);
  --blue: var(--mv-blue);
  --teal: var(--mv-teal);
  --sand: var(--mv-sand);
  --danger: var(--mv-red);
  --radius-sm: var(--mv-radius-sm);
  --radius-md: var(--mv-radius-md);
  --radius-lg: var(--mv-radius-lg);
  --shadow: var(--mv-shadow);
  --content: var(--mv-content);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--deep);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: Manrope, Inter, "Segoe UI", sans-serif;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.15rem, 4.2vw, 4.7rem);
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 2.1vw, 2rem);
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.sr-only,
.skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--teal);
  color: var(--deep);
  font-weight: 800;
}

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

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 24px 24px;
  border-right: 1px solid var(--line);
  background: var(--deep);
}

.brand {
  display: inline-block;
  width: 210px;
  margin: 0 4px 48px;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: grid;
  min-height: 52px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  grid-template-columns: 38px 1fr;
  text-decoration: none;
  transition: 160ms ease;
}

.nav-link:hover {
  border-color: var(--line);
  color: var(--text);
  transform: translateX(3px);
}

.nav-link.is-active {
  border-color: rgb(92 124 255 / 0.45);
  background: rgb(92 124 255 / 0.12);
  color: var(--text);
}

.nav-index,
.eyebrow,
.card-number,
.section-number {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-index {
  color: var(--blue);
}

.sidebar-footer {
  display: grid;
  gap: 18px;
}

.profile-chip,
.user-cell {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.profile-copy,
.user-cell > span:last-child {
  display: grid;
  min-width: 0;
}

.profile-copy strong,
.profile-copy small,
.user-cell strong,
.user-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy small,
.user-cell small {
  color: var(--muted);
}

.avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--raised);
  color: var(--teal);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 800;
}

.main-content {
  width: min(100%, calc(var(--content) + 96px));
  margin-inline: auto;
  padding: clamp(46px, 6vw, 92px) clamp(24px, 5vw, 64px);
}

.mobile-header {
  display: none;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 48px;
}

.page-head-compact h1 {
  margin-bottom: 12px;
  font-size: clamp(2.25rem, 4vw, 4rem);
}

.page-lead {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.18rem);
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--teal);
}

.status-pill,
.status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgb(71 215 172 / 0.1);
}

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

.feature-card,
.note-card,
.form-card,
.table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}

.feature-card {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 3vw, 38px);
}

.feature-card-active {
  border-top: 3px solid var(--blue);
}

.feature-card-future {
  border-top: 3px solid var(--teal);
}

.feature-card p:not(.eyebrow),
.note-card p:not(.eyebrow) {
  max-width: 540px;
  color: var(--muted);
}

.card-number {
  color: var(--muted);
}

.text-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover span {
  transform: translateX(4px);
}

.text-link span {
  transition: transform 160ms ease;
}

.text-link.is-muted {
  color: var(--muted);
}

.note-card {
  display: grid;
  min-height: 190px;
  align-content: center;
  padding: clamp(24px, 3vw, 38px);
  border-color: rgb(214 179 106 / 0.45);
  grid-column: 1 / -1;
}

.note-quote {
  margin-bottom: 10px;
  color: var(--sand) !important;
  font-family: Manrope, Inter, sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.45rem);
  font-weight: 750;
  letter-spacing: -0.03em;
}

.stats-row {
  display: grid;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--deep);
  grid-template-columns: repeat(3, 1fr);
}

.stats-row > div {
  display: grid;
  min-height: 112px;
  align-content: center;
  padding: 20px 26px;
  border-right: 1px solid var(--line);
}

.stats-row > div:last-child {
  border-right: 0;
}

.stats-row-small {
  max-width: 660px;
  margin: -22px 0 28px;
}

.stats-row-small > div {
  min-height: 88px;
}

.stat-value {
  font-family: Manrope, Inter, sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
}

.stat-label {
  color: var(--muted);
  font-size: 0.84rem;
}

.text-teal {
  color: var(--teal);
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: 160ms ease;
}

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

.button-primary {
  background: var(--blue);
  color: var(--deep);
}

.button-primary:hover {
  background: #7691ff;
}

.button-secondary {
  border-color: var(--line);
  background: var(--raised);
  color: var(--text);
}

.button-quiet {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.button-danger-quiet {
  border-color: rgb(217 72 72 / 0.35);
  background: transparent;
  color: #ef8787;
}

.button-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.82rem;
}

.button-full {
  width: 100%;
}

.flash-stack {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.flash {
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--raised);
}

.flash-success {
  border-left-color: var(--teal);
}

.flash-error {
  border-left-color: var(--danger);
}

.table-card {
  overflow: hidden;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--deep);
  color: var(--muted);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgb(255 255 255 / 0.018);
}

.align-right {
  text-align: right;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 4px 8px;
  border: 1px solid rgb(92 124 255 / 0.38);
  border-radius: 999px;
  color: #aebcff;
  font-size: 0.75rem;
  font-weight: 700;
}

.tag-sand {
  border-color: rgb(214 179 106 / 0.4);
  color: var(--sand);
}

.tag-muted {
  border-color: var(--line);
  color: var(--muted);
}

.status-active {
  border-color: rgb(71 215 172 / 0.4);
  color: var(--teal);
}

.status-inactive {
  color: var(--muted);
}

.context-note {
  max-width: 840px;
  margin: 22px 0 0;
  padding-left: 16px;
  border-left: 2px solid var(--sand);
  color: var(--muted);
}

.context-note strong {
  color: var(--text);
}

.editor-grid {
  display: grid;
  gap: 18px;
}

.form-card {
  padding: clamp(22px, 3vw, 34px);
}

.narrow-card {
  max-width: 660px;
}

.section-head {
  display: grid;
  align-items: start;
  margin-bottom: 28px;
  grid-template-columns: 46px 1fr;
}

.section-head h2,
.section-head p {
  margin-bottom: 6px;
}

.section-head p {
  color: var(--muted);
}

.section-number {
  padding-top: 5px;
  color: var(--blue);
}

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

.field-span-2 {
  grid-column: 1 / -1;
}

.form-stack,
.field {
  display: grid;
  gap: 8px;
}

.form-stack {
  gap: 18px;
}

.field > span {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--deep);
  color: var(--text);
}

.field textarea {
  resize: vertical;
}

.field input:hover {
  border-color: #48586d;
}

.field input:focus {
  border-color: var(--blue);
}

.field.has-error input,
.permission-list.has-error {
  border-color: var(--danger);
}

.field-error {
  color: #f08d8d;
  font-size: 0.82rem;
}

.check-row,
.permission-option {
  display: flex;
  min-height: 44px;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}

.check-row input,
.permission-option input {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.check-row-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--deep);
}

.check-row-panel span,
.permission-option span {
  display: grid;
}

.check-row-panel small,
.permission-option small {
  color: var(--muted);
}

.permission-list {
  display: grid;
  gap: 10px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.permission-option {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--deep);
}

.permission-option:has(input:checked) {
  border-color: rgb(92 124 255 / 0.65);
  background: rgb(92 124 255 / 0.08);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.muted {
  color: var(--muted);
}

.split-workspace {
  display: grid;
  align-items: start;
  gap: 20px;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.7fr);
}

.sticky-editor {
  position: sticky;
  top: 24px;
}

.empty-cell,
.empty-panel {
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.is-archived {
  opacity: 0.58;
}

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

.project-browser {
  display: grid;
  gap: 14px;
}

.project-filters {
  display: grid;
  align-items: end;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-filter-search {
  grid-column: 1 / -1;
}

.project-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  grid-column: 1 / -1;
}

.project-result-count {
  padding-inline: 4px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.project-card {
  --project-color: var(--blue);
  display: grid;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  grid-template-columns: 7px minmax(0, 1fr) auto;
}

.project-card .project-color {
  width: 7px;
  height: 100%;
  min-height: 76px;
  border-radius: 999px;
  background: var(--project-color);
}

.project-card h2,
.project-card p {
  margin-bottom: 5px;
}

.project-card-copy > p:not(.eyebrow) {
  color: var(--muted);
}

.budget-bar {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--deep);
}

.budget-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--project-color);
}

.main-content:has(.time-page) {
  width: 100%;
  max-width: none;
  padding: 32px clamp(16px, 3vw, 42px) 64px;
}

.time-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.time-heading h1 {
  margin-bottom: 8px;
  font-size: clamp(2.2rem, 4vw, 4rem);
}

.sync-state {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
  white-space: nowrap;
}

.sync-state span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.sync-state[data-state="offline"] span,
.sync-state[data-state="error"] span {
  background: var(--sand);
}

.app-notification {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 18px;
  width: min(420px, calc(100vw - 32px));
  padding: 18px 20px;
  border: 1px solid var(--teal);
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 18px 48px rgb(0 0 0 / 45%);
  color: var(--text);
}

.app-notification strong,
.app-notification span {
  grid-column: 1;
}

.app-notification span {
  color: var(--muted);
}

.app-notification button {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.timer-deck {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.timer-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}

.timer-card.is-running {
  border-color: rgb(71 215 172 / 0.55);
  box-shadow: inset 0 3px 0 var(--teal);
}

.timer-card[data-lane="secondary"].is-running {
  border-color: rgb(92 124 255 / 0.58);
  box-shadow: inset 0 3px 0 var(--blue);
}

.timer-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.timer-card-head output {
  margin-left: auto;
  color: var(--teal);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.lane-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
}

[data-lane="secondary"] .lane-dot {
  background: var(--blue);
}

.timer-description input,
.timer-fields input,
.timer-fields select {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--deep);
  color: var(--text);
}

.timer-description input {
  min-height: 52px;
  border-color: transparent;
  background: var(--raised);
  font-weight: 750;
}

.timer-fields {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  grid-template-columns: minmax(150px, 0.8fr) minmax(140px, 1fr) auto;
}

.timer-button {
  min-width: 112px;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--teal);
  color: var(--deep);
  font-weight: 850;
}

.timer-button span {
  margin-right: 7px;
}

.timer-stop {
  background: var(--danger);
  color: var(--text);
}

.timer-warning {
  margin: 12px 0 0;
  color: var(--sand);
  font-size: 0.82rem;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.calendar-navigation,
.view-switch {
  display: flex;
  align-items: stretch;
  gap: 7px;
}

.icon-button,
.period-button,
.view-switch a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

button.icon-button {
  cursor: pointer;
}

.period-button {
  display: grid;
  justify-items: start;
  line-height: 1.1;
}

.period-button span {
  color: var(--muted);
  font-size: 0.7rem;
}

.view-switch a.is-active {
  border-color: rgb(92 124 255 / 0.6);
  background: rgb(92 124 255 / 0.14);
}

.mobile-day-tabs {
  display: none;
}

.calendar-shell {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 110px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--deep);
}

.calendar-hours {
  position: absolute;
  z-index: 4;
  top: 82px;
  left: 0;
  width: 56px;
  height: 1152px;
  border-right: 1px solid var(--line);
  background: var(--deep);
  pointer-events: none;
}

.calendar-hours span {
  position: absolute;
  right: 8px;
  color: var(--muted);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.66rem;
  transform: translateY(-50%);
}

.calendar-hours span[data-hour="0"] { top: 0; }
.calendar-hours span[data-hour="2"] { top: 8.333%; }
.calendar-hours span[data-hour="4"] { top: 16.666%; }
.calendar-hours span[data-hour="6"] { top: 25%; }
.calendar-hours span[data-hour="8"] { top: 33.333%; }
.calendar-hours span[data-hour="10"] { top: 41.666%; }
.calendar-hours span[data-hour="12"] { top: 50%; }
.calendar-hours span[data-hour="14"] { top: 58.333%; }
.calendar-hours span[data-hour="16"] { top: 66.666%; }
.calendar-hours span[data-hour="18"] { top: 75%; }
.calendar-hours span[data-hour="20"] { top: 83.333%; }
.calendar-hours span[data-hour="22"] { top: 91.666%; }

.calendar-days {
  --day-count: 5;
  display: grid;
  min-width: calc(var(--day-count) * 190px + 56px);
  padding-left: 56px;
  grid-template-columns: repeat(var(--day-count), minmax(190px, 1fr));
}

.calendar-day {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.calendar-day:last-child {
  border-right: 0;
}

.calendar-day > header {
  position: sticky;
  z-index: 6;
  top: 0;
  display: flex;
  height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgb(7 10 14 / 0.96);
}

.calendar-day > header div {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 6px;
}

.calendar-day > header span {
  color: var(--muted);
  font-size: 0.72rem;
  grid-column: 1 / -1;
}

.calendar-day > header strong {
  font-size: 1.2rem;
}

.calendar-day > header small {
  align-self: end;
  color: var(--muted);
}

.calendar-day > header output {
  color: var(--teal);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.67rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.calendar-day.is-today > header {
  box-shadow: inset 0 -3px 0 var(--blue);
}

.day-lanes {
  display: grid;
  height: 1152px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calendar-lane {
  position: relative;
  border-right: 1px dashed rgb(48 59 73 / 0.65);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, rgb(48 59 73 / 0.6) 47px, rgb(48 59 73 / 0.6) 48px);
  cursor: crosshair;
}

.calendar-lane:last-child {
  border-right: 0;
  background-color: rgb(92 124 255 / 0.018);
}

.lane-label {
  position: sticky;
  z-index: 3;
  top: 86px;
  display: block;
  width: fit-content;
  margin: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgb(7 10 14 / 0.84);
  color: var(--muted);
  font-size: 0.58rem;
  pointer-events: none;
}

.time-block {
  --entry-color: var(--blue);
  position: absolute;
  z-index: 2;
  right: 4px;
  left: 4px;
  display: grid;
  min-height: 23px;
  align-content: start;
  overflow: hidden;
  padding: 6px 6px 10px;
  border: 1px solid color-mix(in srgb, var(--entry-color) 68%, transparent);
  border-left: 4px solid var(--entry-color);
  border-radius: 6px;
  background: color-mix(in srgb, var(--entry-color) 16%, var(--panel));
  color: var(--text);
  cursor: grab;
  text-align: left;
  touch-action: none;
}

.time-block:hover,
.time-block:focus-visible {
  z-index: 5;
  filter: brightness(1.14);
}

.time-block strong,
.time-block span,
.time-block small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-block strong { font-size: 0.72rem; }
.time-block span,
.time-block small { color: var(--muted); font-size: 0.61rem; }
.time-block.is-unassigned { --entry-color: var(--sand); }
.time-block.is-running { box-shadow: 0 0 0 1px var(--teal), 0 10px 28px rgb(0 0 0 / 0.25); }

.time-block i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 7px;
  cursor: ns-resize;
}

.entry-dialog {
  width: min(620px, calc(100% - 28px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.entry-dialog::backdrop {
  background: rgb(0 0 0 / 0.72);
  backdrop-filter: blur(4px);
}

.dialog-head,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.report-controls {
  margin-bottom: 18px;
}

.report-controls form {
  display: grid;
  align-items: end;
  gap: 14px;
  grid-template-columns: minmax(180px, 0.45fr) minmax(260px, 1fr) auto;
}

.report-ready {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgb(71 215 172 / 0.45);
  border-radius: var(--radius-md);
  background: var(--mv-audit-bg);
}

.report-ready h2,
.report-ready p {
  margin-bottom: 4px;
}

.report-ready > div > p:last-child {
  color: var(--muted);
}

.report-frame {
  width: 100%;
  min-height: 900px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--ink);
}

.report-note {
  margin-top: 18px;
}

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

.dialog-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
}

.signin-page {
  background: var(--deep);
}

.signin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
}

.signin-brand,
.signin-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 7vw, 110px);
}

.signin-brand {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--ink);
}

.signin-brand::after {
  position: absolute;
  right: -12vw;
  bottom: -16vw;
  width: 40vw;
  height: 40vw;
  border: 1px solid rgb(92 124 255 / 0.22);
  content: "";
  transform: rotate(45deg);
}

.signin-brand img {
  width: min(280px, 70%);
  margin-bottom: clamp(60px, 10vh, 120px);
}

.signin-brand h1 {
  max-width: 720px;
  font-size: clamp(2.65rem, 5.5vw, 6rem);
}

.signin-brand > p:not(.eyebrow) {
  max-width: 590px;
  color: var(--muted);
  font-size: 1.1rem;
}

.brand-rule {
  display: flex;
  width: min(360px, 70%);
  height: 5px;
  margin-top: 42px;
}

.brand-rule span:first-child {
  width: 42%;
  background: var(--teal);
}

.brand-rule span:last-child {
  flex: 1;
  background: var(--blue);
}

.signin-panel {
  background: var(--deep);
}

.auth-card {
  width: min(100%, 480px);
  margin-inline: auto;
}

.auth-card h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.auth-card > .muted {
  margin-bottom: 34px;
}

.auth-card .flash {
  margin-bottom: 22px;
}

.error-state {
  display: grid;
  max-width: 700px;
  min-height: 62vh;
  align-content: center;
  justify-items: start;
}

.error-state img {
  margin-bottom: 34px;
}

.error-state p:not(.eyebrow) {
  max-width: 600px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.08rem;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .sidebar {
    padding-inline: 18px;
  }

  .brand {
    width: 188px;
  }

  .row-actions {
    min-width: 210px;
    flex-wrap: wrap;
  }

  .signin-shell {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.8fr);
  }

  .split-workspace {
    grid-template-columns: 1fr;
  }

  .sticky-editor {
    position: static;
  }

  .timer-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .mobile-header {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: rgb(7 10 14 / 0.96);
  }

  .mobile-header img {
    width: 170px;
  }

  .menu-button {
    display: grid;
    width: 48px;
    height: 48px;
    place-content: center;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
  }

  .menu-button span[aria-hidden] {
    width: 20px;
    height: 2px;
    background: var(--text);
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 76px 0 auto;
    display: none;
    height: calc(100vh - 76px);
    padding: 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .sidebar.is-open {
    display: flex;
  }

  .sidebar .brand {
    display: none;
  }

  .main-content {
    padding: 42px 18px 70px;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 34px;
  }

  .dashboard-grid,
  .field-grid,
  .project-filters {
    grid-template-columns: 1fr;
  }

  .project-filter-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .project-filter-actions .button {
    width: 100%;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .feature-card {
    min-height: 280px;
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .stats-row > div {
    min-height: 84px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stats-row > div:last-child {
    border-bottom: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    padding: 18px;
    border-bottom: 1px solid var(--line);
  }

  tbody tr:last-child {
    border-bottom: 0;
  }

  td,
  td.align-right {
    display: grid;
    align-items: start;
    padding: 10px 0;
    border: 0;
    grid-template-columns: 108px minmax(0, 1fr);
    text-align: left;
  }

  td::before {
    color: var(--muted);
    content: attr(data-label);
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }

  .row-actions {
    min-width: 0;
    justify-content: flex-start;
  }

  .signin-shell {
    display: block;
  }

  .signin-brand,
  .signin-panel {
    padding: 42px 22px;
  }

  .signin-brand {
    min-height: 46vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .signin-brand img {
    width: 220px;
    margin-bottom: 54px;
  }

  .signin-brand::after {
    width: 70vw;
    height: 70vw;
  }

  .main-content:has(.time-page) {
    padding: 24px 12px 60px;
  }

  .time-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .timer-deck {
    grid-template-columns: 1fr;
  }

  .calendar-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .calendar-navigation,
  .view-switch {
    justify-content: space-between;
  }

  .period-button {
    flex: 1;
  }

  .view-switch a {
    flex: 1;
  }

  .mobile-day-tabs {
    display: grid;
    gap: 5px;
    margin-bottom: 8px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .mobile-day-tabs button {
    display: grid;
    min-width: 0;
    min-height: 48px;
    place-items: center;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--deep);
    color: var(--muted);
    font-size: 0.65rem;
  }

  .mobile-day-tabs button.is-active {
    border-color: var(--blue);
    color: var(--text);
  }

  .calendar-days {
    min-width: 0;
    padding-left: 48px;
    grid-template-columns: 1fr;
  }

  .calendar-day {
    display: none;
  }

  .calendar-day.is-mobile-active {
    display: block;
  }

  .calendar-hours {
    width: 48px;
  }

  .project-card {
    grid-template-columns: 7px minmax(0, 1fr);
  }

  .project-card .row-actions {
    grid-column: 2;
  }

  .dialog-actions {
    grid-template-columns: 1fr 1fr;
  }

  .report-controls form {
    grid-template-columns: 1fr;
  }

  .report-ready {
    align-items: stretch;
    flex-direction: column;
  }

  .report-ready .row-actions,
  .report-ready .button {
    width: 100%;
  }

  .report-frame {
    min-height: 680px;
  }

  .dialog-actions span {
    display: none;
  }
}

@media (max-width: 420px) {
  h1 {
    font-size: 2.3rem;
  }

  .page-head .button,
  .form-actions .button {
    width: 100%;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  td,
  td.align-right {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .row-actions,
  .row-actions form,
  .row-actions .button {
    width: 100%;
  }
}

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