/* Cockpit root */

:root {
  --cockpit-font: "Segoe UI Variable Text", "Inter", "Avenir Next", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --cockpit-ink: #172033;
  --cockpit-ink-strong: #0f172a;
  --cockpit-muted: #748196;
  --cockpit-soft: #f7f8fa;
  --cockpit-soft-strong: #f1f4f7;
  --cockpit-line: #e5ebf1;
  --cockpit-line-strong: #d6dee8;
  --cockpit-accent: #0b7a5b;
  --cockpit-accent-strong: #075f47;
  --cockpit-shadow: 0 24px 70px rgb(15 23 42 / 9%);
}

.cockpit-page {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 10% 8%, rgb(123 198 122 / 13%), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgb(237 28 36 / 8%), transparent 25rem),
    radial-gradient(circle at 55% 92%, rgb(255 215 0 / 9%), transparent 30rem),
    #f5f7f9;
  color: var(--cockpit-ink);
  font-family: var(--cockpit-font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.cockpit-layout {
  min-height: 100vh;
}

.cockpit-flashes {
  position: fixed;
  z-index: 80;
  top: 1rem;
  left: 50%;
  width: min(calc(100% - 2rem), 34rem);
  pointer-events: none;
  transform: translateX(-50%);
}

.cockpit-flashes p {
  margin: 0;
  border-radius: 999px;
  box-shadow: 0 12px 36px rgb(15 23 42 / 14%);
  animation: cockpit-flash-dismiss 4.5s ease forwards;
}

@keyframes cockpit-flash-dismiss {
  0%, 78% {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.65rem);
  }
}

.cockpit {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100vh;
  padding: 0.8rem 1rem 6.75rem;
}

.cockpit-stage {
  display: grid;
  align-self: center;
  min-height: 0;
  gap: 0.55rem;
}

.cockpit-topbar {
  display: flex;
  width: min(100%, 96rem);
  min-height: 2.8rem;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin: 0 auto 0.65rem;
}

.cockpit-workbar {
  display: flex;
  z-index: 55;
  width: min(100%, var(--cockpit-board-width, 88rem));
  align-items: center;
  justify-content: flex-end;
  margin: 0 auto;
}

.cockpit-workbar[data-column-count="1"] { --cockpit-board-width: 22rem; }
.cockpit-workbar[data-column-count="2"] { --cockpit-board-width: 44rem; }
.cockpit-workbar[data-column-count="3"] { --cockpit-board-width: 66rem; }
.cockpit-workbar[data-column-count="4"] { --cockpit-board-width: 88rem; }

.cockpit-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--cockpit-ink-strong);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.cockpit-brand img {
  display: block;
  width: 2.65rem;
  height: auto;
}

.cockpit-notification-center {
  position: relative;
  z-index: 60;
}

.cockpit-notification-trigger {
  position: relative;
  display: grid;
  width: auto;
  min-width: 2.55rem;
  height: 2.55rem;
  place-items: center;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 999px;
  background: rgb(255 255 255 / 92%);
  color: var(--cockpit-ink);
  cursor: pointer;
  box-shadow: 0 8px 22px rgb(15 23 42 / 7%);
  grid-auto-flow: column;
  gap: 0.45rem;
  padding-inline: 0.75rem;
}

.cockpit-notification-trigger-label {
  font-size: 0.78rem;
  font-weight: 650;
}

.cockpit-notification-trigger svg {
  width: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cockpit-notification-count {
  position: absolute;
  top: -0.3rem;
  right: -0.2rem;
  display: grid;
  min-width: 1.15rem;
  height: 1.15rem;
  place-items: center;
  border: 2px solid #f5f6f8;
  border-radius: 999px;
  background: #dc2626;
  padding-inline: 0.2rem;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}

.cockpit-notification-count[hidden] {
  display: none;
}

.cockpit-notification-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(23rem, calc(100vw - 2rem));
  overflow: hidden;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 97%);
  box-shadow: 0 24px 64px rgb(15 23 42 / 17%);
  backdrop-filter: blur(20px);
}

.cockpit-notification-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--cockpit-line);
  padding: 1rem 1.05rem 0.85rem;
}

.cockpit-notification-panel > header div {
  display: grid;
  gap: 0.12rem;
}

.cockpit-notification-panel > header strong {
  color: var(--cockpit-ink-strong);
  font-size: 0.95rem;
}

.cockpit-notification-panel > header span {
  color: var(--cockpit-muted);
  font-size: 0.72rem;
}

.cockpit-notification-panel > header button,
.cockpit-notification-dismiss {
  border: 0;
  background: transparent;
  color: var(--cockpit-muted);
  cursor: pointer;
  font: inherit;
  font-size: 1.15rem;
}

.cockpit-notification-list {
  max-height: min(26rem, 64vh);
  overflow-y: auto;
  padding: 0.45rem;
}

.cockpit-notification-item {
  display: flex;
  align-items: flex-start;
  border-radius: 0.95rem;
  transition: background 150ms ease;
}

.cockpit-notification-item:hover {
  background: var(--cockpit-soft);
}

.cockpit-notification-item.is-auto-dismissing {
  animation: cockpit-notification-dismiss 280ms ease forwards;
}

@keyframes cockpit-notification-dismiss {
  to {
    opacity: 0;
    transform: translateX(0.75rem);
  }
}

.cockpit-notification-focus {
  display: grid;
  flex: 1;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.65rem;
  border: 0;
  background: transparent;
  padding: 0.72rem 0.55rem 0.72rem 0.7rem;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.cockpit-notification-focus > span:last-child {
  display: grid;
  min-width: 0;
  gap: 0.14rem;
}

.cockpit-notification-focus strong,
.cockpit-notification-focus small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-notification-focus strong {
  color: var(--cockpit-ink);
  font-size: 0.82rem;
}

.cockpit-notification-focus small,
.cockpit-notification-focus time {
  color: var(--cockpit-muted);
  font-size: 0.7rem;
}

.cockpit-notification-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.32rem;
  border-radius: 999px;
  background: var(--cockpit-accent);
  box-shadow: 0 0 0 4px rgb(11 122 91 / 10%);
}

.cockpit-notification-item form {
  display: block;
  padding: 0.5rem 0.5rem 0 0;
}

.cockpit-notification-dismiss {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
}

.cockpit-notification-dismiss:hover {
  background: #eef2f6;
  color: var(--cockpit-ink);
}

.cockpit-notification-empty {
  margin: 0;
  padding: 2rem 1rem;
  color: var(--cockpit-muted);
  font-size: 0.8rem;
  text-align: center;
}

.cockpit-tracker.is-notification-focused {
  position: relative;
  z-index: 2;
  animation: cockpit-notification-focus 1.8s ease;
}

@keyframes cockpit-notification-focus {
  0%, 100% { box-shadow: none; }
  25%, 70% { box-shadow: inset 0 0 0 3px rgb(11 122 91 / 42%); }
}

.cockpit-board {
  align-self: center;
  display: grid;
  grid-template-columns: none;
  grid-auto-columns: 22rem;
  grid-auto-flow: column;
  justify-content: start;
  width: min(100%, var(--cockpit-board-width, 88rem));
  height: clamp(28rem, 58vh, 40rem);
  min-height: 0;
  margin-inline: auto;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 1.4rem;
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--cockpit-shadow);
  backdrop-filter: blur(18px);
  scrollbar-width: none;
}

.cockpit-board::-webkit-scrollbar {
  display: none;
}

.cockpit-board[data-column-count="1"] { --cockpit-board-width: 22rem; }
.cockpit-board[data-column-count="2"] { --cockpit-board-width: 44rem; }
.cockpit-board[data-column-count="3"] { --cockpit-board-width: 66rem; }
.cockpit-board[data-column-count="4"] { --cockpit-board-width: 88rem; }

.cockpit-tracker {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--cockpit-line);
  background: rgb(255 255 255 / 76%);
}

.cockpit-tracker:last-child {
  border-right: 0;
}

.cockpit-tracker-header {
  position: relative;
  display: flex;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 5.25rem;
  border-bottom: 1px solid #e8edf2;
  background: rgb(255 255 255 / 90%);
  padding: 1.25rem 1.3rem;
}

.cockpit-tracker-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cockpit-tracker-title > span {
  display: grid;
  min-width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border: 1px solid var(--cockpit-line);
  border-radius: 999px;
  background: var(--cockpit-soft-strong);
  color: var(--cockpit-muted);
  padding-inline: 0.35rem;
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1;
}

.cockpit-tracker-header h2,
.cockpit-tracker-header p {
  margin: 0;
}

.cockpit-tracker-header h2 {
  color: var(--cockpit-ink-strong);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.cockpit-tracker-header p {
  margin-top: 0.25rem;
  color: var(--cockpit-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.3;
}

.cockpit-tracker-create {
  display: grid;
  flex: 0 0 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid var(--cockpit-line);
  border-radius: 999px;
  background: #fff;
  color: var(--cockpit-ink);
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, transform 150ms ease;
}

.cockpit-tracker-create:hover {
  border-color: var(--cockpit-ink-strong);
  background: var(--cockpit-ink-strong);
  color: #fff;
  transform: translateY(-1px);
}

.cockpit-tracker-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.82rem;
  scrollbar-color: #d9e1ea transparent;
  scrollbar-width: thin;
}

.cockpit-entry-group + .cockpit-entry-group {
  margin-top: 0.52rem;
}

.cockpit-entry-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  border-radius: 0.8rem;
  cursor: grab;
  touch-action: pan-y;
  transition: opacity 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.cockpit-entry-group.is-dragging {
  position: relative;
  z-index: 4;
  cursor: grabbing;
  opacity: 0.92;
  box-shadow: 0 14px 30px rgb(15 23 42 / 13%);
  transform: scale(1.015);
  touch-action: none;
}

.cockpit-tracker[data-tracker="medications"] .cockpit-entry-group-copy small {
  display: none;
}

.cockpit-entry-list {
  display: flex;
  min-width: 0;
  max-width: 13rem;
  gap: 0.32rem;
  justify-content: flex-end;
  overflow-x: auto;
  padding-block: 0.1rem;
  scrollbar-width: none;
}

.cockpit-tracker[data-tracker="todos"] .cockpit-entry-list,
.cockpit-tracker[data-tracker="todos"] .cockpit-entry-card {
  max-width: 100%;
  min-width: 0;
}

.cockpit-entry-list::-webkit-scrollbar {
  display: none;
}

.cockpit-entry-list .cockpit-entry-card {
  flex: 0 0 auto;
  min-height: 2.25rem;
}

.cockpit-entry-list .cockpit-entry-card + .cockpit-entry-card {
  margin-top: 0;
}

.cockpit-tracker[data-tracker="medications"] .cockpit-entry-link {
  display: flex;
  justify-content: center;
  padding: 0.44rem 0.62rem;
}

.cockpit-tracker[data-tracker="medications"] .cockpit-status {
  display: none;
}

.cockpit-entry-group-header {
  position: relative;
  display: block;
  align-items: center;
  gap: 0.16rem;
  min-width: 0;
  border-radius: 0.7rem;
  padding: 0.45rem 0.28rem 0.4rem 0.85rem;
  transition: background 180ms ease, color 180ms ease;
}

.cockpit-entry-group-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.cockpit-entry-group-name {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 0.18rem;
}

.cockpit-entry-group-name > a,
.cockpit-entry-group-name > strong {
  min-width: 0;
}

.cockpit-entry-group-header strong,
.cockpit-entry-group-header a {
  color: var(--cockpit-ink);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-entry-group-header a {
  text-decoration: none;
}

.cockpit-entry-group-header a:hover {
  text-decoration: underline;
  text-underline-offset: 0.16rem;
}

.cockpit-entry-group-header small {
  color: var(--cockpit-muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.25;
}

.cockpit-entry-drag {
  position: absolute;
  left: 0;
  color: #b3bdc9;
  cursor: grab;
  font-size: 0.9rem;
  letter-spacing: -0.2rem;
  line-height: 1;
  user-select: none;
}

.is-tracker-sorting,
.is-tracker-sorting * {
  cursor: grabbing !important;
  user-select: none !important;
}

.cockpit-entry-group:hover .cockpit-entry-drag {
  color: #77869a;
}

.cockpit-entry-drag:active {
  cursor: grabbing;
}

.cockpit-entry-group-name form {
  display: block;
  flex: 0 0 auto;
  margin: 0;
}

.cockpit-group-bell {
  position: relative;
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #a2adbc;
  cursor: pointer;
}

.cockpit-group-bell:hover {
  background: rgb(255 255 255 / 70%);
}

.cockpit-group-bell.is-active {
  color: var(--cockpit-accent);
}

.cockpit-group-bell svg {
  width: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.cockpit-group-bell .cockpit-group-bell-slash {
  position: absolute;
  inset: 0.35rem;
  width: auto;
  height: auto;
  stroke-width: 2.2;
}

.cockpit-entry-card strong {
  color: var(--cockpit-ink);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
}

.cockpit-entry-card small {
  color: var(--cockpit-muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.25;
}

.cockpit-entry-card {
  display: flex;
  align-items: center;
  min-height: 2.45rem;
  overflow: hidden;
  border: 1px solid rgb(226 232 240 / 72%);
  border-radius: 0.75rem;
  background: #f7f9fb;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.cockpit-entry-link.is-done {
  border-color: #86efac;
  background: #dcfce7;
}

.cockpit-entry-link.is-warning {
  border-color: #fde047;
  background: #fef9c3;
}

.cockpit-entry-link.is-overdue {
  border-color: #fdba74;
  background: #ffedd5;
}

.cockpit-entry-link.is-missed {
  border-color: #fca5a5;
  background: #fee2e2;
}

.cockpit-entry-card + .cockpit-entry-card {
  margin-top: 0.28rem;
}

.cockpit-entry-card:hover {
  border-color: #d7dfe9;
  background: #fff;
  box-shadow: 0 8px 20px rgb(15 23 42 / 5%);
  transform: translateY(-1px);
}

.cockpit-entry-link {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.48rem 0.56rem;
  border: 1px solid transparent;
  border-radius: 0.7rem;
  color: inherit;
  text-decoration: none;
}

button.cockpit-entry-link {
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

button.cockpit-entry-link:disabled {
  cursor: not-allowed;
  opacity: 0.68;
}

button.cockpit-entry-link.is-ready {
  opacity: 1;
}

.cockpit-entry-link.is-completion {
  cursor: pointer;
}

.cockpit-entry-link.is-static {
  cursor: default;
}

.cockpit-entry-copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.cockpit-tracker[data-tracker="medications"] .cockpit-entry-copy {
  display: none;
}

.cockpit-tracker[data-tracker="diet"] .cockpit-entry-copy,
.cockpit-tracker[data-tracker="diet"] .cockpit-status {
  display: none;
}

.cockpit-tracker[data-tracker="medications"] .cockpit-entry-link,
.cockpit-tracker[data-tracker="diet"] .cockpit-entry-link {
  display: flex;
  justify-content: center;
  grid-template-columns: auto minmax(0, 1fr);
}

.cockpit-entry-card strong,
.cockpit-entry-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-entry-card form {
  display: contents;
}

.cockpit-entry-action {
  flex: 0 0 auto;
  margin-right: 0.38rem;
  border: 0;
  border-radius: 999px;
  background: var(--cockpit-accent);
  padding: 0.4rem 0.58rem;
  color: #fff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.cockpit-entry-action:hover {
  background: var(--cockpit-accent-strong);
  transform: translateY(-1px);
}

.cockpit-status {
  display: inline-flex;
  width: fit-content;
  margin-left: auto;
  border-radius: 999px;
  background: #eef2f6;
  padding: 0.32rem 0.56rem;
  color: #637086;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.cockpit-status.is-done {
  background: #d9fbe9;
  color: #05704e;
}

.cockpit-status.is-missed {
  background: #fee2e2;
  color: #b42318;
}

.cockpit-entry-meta {
  color: var(--cockpit-muted);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.cockpit-tracker-info-body {
  display: grid;
  gap: 1rem;
  padding-block: 0.2rem;
}

.cockpit-medication-kind {
  color: var(--cockpit-accent) !important;
  font-weight: 700 !important;
}

.cockpit-medication-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.cockpit-medication-summary > div {
  display: grid;
  gap: 0.2rem;
  border: 1px solid var(--cockpit-line);
  border-radius: 0.9rem;
  background: var(--cockpit-soft);
  padding: 0.72rem 0.8rem;
}

.cockpit-medication-summary span,
.cockpit-medication-schedule p,
.cockpit-medication-dose-copy small,
.cockpit-medication-dose-state small {
  color: var(--cockpit-muted);
  font-size: 0.72rem;
}

.cockpit-medication-summary strong {
  color: var(--cockpit-ink-strong);
  font-size: 0.92rem;
}

.cockpit-medication-schedule {
  overflow: hidden;
  border: 1px solid var(--cockpit-line);
  border-radius: 1rem;
}

.cockpit-medication-schedule > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--cockpit-soft);
  padding: 0.75rem 0.85rem;
}

.cockpit-medication-schedule h2,
.cockpit-medication-schedule p {
  margin: 0;
}

.cockpit-medication-schedule h2 {
  color: var(--cockpit-ink-strong);
  font-size: 0.86rem;
}

.cockpit-medication-schedule > header > span {
  border-radius: 999px;
  background: #fff;
  padding: 0.28rem 0.5rem;
  color: var(--cockpit-accent);
  font-size: 0.72rem;
  font-weight: 750;
}

.cockpit-medication-schedule ol {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cockpit-medication-schedule li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 0.85rem;
}

.cockpit-medication-schedule li + li {
  border-top: 1px solid var(--cockpit-line);
}

.cockpit-medication-step {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--cockpit-muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.cockpit-medication-dose-copy,
.cockpit-medication-dose-state {
  display: grid;
  min-width: 0;
  gap: 0.08rem;
}

.cockpit-medication-dose-copy strong,
.cockpit-medication-dose-state strong {
  color: var(--cockpit-ink);
  font-size: 0.8rem;
}

.cockpit-medication-dose-state {
  text-align: right;
}

.cockpit-medication-schedule li.is-done .cockpit-medication-step {
  background: #dcfce7;
  color: #05704e;
}

.cockpit-medication-schedule li.is-ready .cockpit-medication-step {
  background: #fef3c7;
  color: #a16207;
}

.cockpit-medication-schedule li.is-missed .cockpit-medication-step {
  background: #fee2e2;
  color: #b42318;
}

.cockpit-tracker-info-body dl {
  display: grid;
  gap: 0.15rem;
  margin: 0;
}

.cockpit-tracker-info-body dl div,
.cockpit-notification-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--cockpit-line);
  padding: 0.72rem 0.2rem;
}

.cockpit-tracker-info-body dt {
  color: var(--cockpit-muted);
  font-size: 0.8rem;
}

.cockpit-tracker-info-body dd {
  margin: 0;
  color: var(--cockpit-ink);
  font-size: 0.82rem;
  font-weight: 650;
}

.cockpit-notification-setting > span {
  display: grid;
  gap: 0.14rem;
}

.cockpit-notification-setting strong {
  color: var(--cockpit-ink);
  font-size: 0.86rem;
}

.cockpit-notification-setting small {
  color: var(--cockpit-muted);
  font-size: 0.74rem;
}

.cockpit-switch {
  position: relative;
  display: block;
  width: 2.75rem;
  height: 1.55rem;
  flex: 0 0 auto;
}

.cockpit-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cockpit-switch > span[aria-hidden] {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: background 160ms ease;
}

.cockpit-switch > span[aria-hidden]::after {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgb(15 23 42 / 18%);
  content: "";
  transition: transform 160ms ease;
}

.cockpit-switch input:checked + span[aria-hidden] {
  background: var(--cockpit-accent);
}

.cockpit-switch input:checked + span[aria-hidden]::after {
  transform: translateX(1.2rem);
}

.cockpit-empty {
  display: grid;
  min-height: 12rem;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  border: 1px dashed var(--cockpit-line-strong);
  border-radius: 1.1rem;
  color: #97a3b4;
  text-align: center;
}

.cockpit-empty span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-soft-strong);
  color: #8692a3;
  font-size: 1.4rem;
  line-height: 1;
}

.cockpit-empty p {
  max-width: 13rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
}

/* Fixed command dock */

.cockpit-dock {
  position: fixed;
  z-index: 50;
  bottom: 1rem;
  left: 50%;
  display: grid;
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  width: min(calc(100% - 2rem), 96rem);
  min-height: 4.4rem;
  gap: 1rem;
  border: 1px solid rgb(210 218 229 / 86%);
  border-radius: 1.4rem;
  background: rgb(255 255 255 / 92%);
  padding: 0.62rem 0.9rem;
  box-shadow:
    0 18px 46px rgb(15 23 42 / 13%),
    inset 0 1px 0 rgb(255 255 255 / 75%);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.cockpit a:focus-visible,
.cockpit button:focus-visible,
.cockpit [tabindex]:focus-visible {
  outline: 3px solid rgb(11 122 91 / 30%);
  outline-offset: 3px;
}

.cockpit-dock-nav,
.cockpit-dock-user,
.cockpit-date-control {
  display: flex;
  align-items: center;
}

.cockpit-dock-nav {
  min-width: 0;
  gap: 0.15rem;
}

.cockpit-dock-nav a,
.cockpit-dock-user a,
.cockpit-dock-user button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0.48rem 0.6rem;
  color: var(--cockpit-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}

.cockpit-dock-nav a:hover,
.cockpit-dock-user a:hover,
.cockpit-dock-user button:hover,
.cockpit-config-link {
  background: var(--cockpit-soft-strong);
  color: var(--cockpit-ink);
}

.cockpit-date-control {
  position: relative;
  justify-content: center;
  gap: 0.45rem;
}

.cockpit-date-step {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-ink-strong);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.cockpit-date-step:hover {
  background: #273244;
  transform: scale(1.06);
}

.cockpit-date-anchor {
  position: relative;
}

.cockpit-date-button {
  display: grid;
  gap: 0.05rem;
  min-width: 6.5rem;
  min-height: 2.9rem;
  place-items: center;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 999px;
  background: #fff;
  padding: 0.48rem 0.9rem;
  color: var(--cockpit-ink);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 4px 12px rgb(15 23 42 / 5%);
}

.cockpit-date-button small {
  color: var(--cockpit-muted);
  font-size: 0.64rem;
  font-weight: 500;
  line-height: 1.1;
}

.cockpit-date-button.is-open {
  border-color: #a8b4c3;
  background: var(--cockpit-soft);
}

.cockpit-dock-user {
  justify-content: flex-end;
}

.cockpit-dock-user form {
  display: contents;
}

/* Three-wheel date picker */

.cockpit-date-popover {
  position: absolute;
  z-index: 70;
  bottom: calc(100% + 1rem);
  left: 50%;
  display: grid;
  grid-template-columns: 3.35rem 3.35rem 4.6rem;
  gap: 0.4rem;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 1.25rem;
  background: rgb(255 255 255 / 96%);
  padding: 0.7rem;
  box-shadow: 0 22px 55px rgb(15 23 42 / 16%);
  transform: translateX(-50%);
  backdrop-filter: blur(20px);
}

.cockpit-date-popover::after {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 0.75rem;
  height: 0.75rem;
  border-right: 1px solid var(--cockpit-line-strong);
  border-bottom: 1px solid var(--cockpit-line-strong);
  background: #fff;
  content: "";
  transform: translate(-50%, -50%) rotate(45deg);
}

.cockpit-date-column {
  display: grid;
  gap: 0.35rem;
  text-align: center;
}

.cockpit-date-label {
  color: #8e9aab;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.09em;
}

.cockpit-date-wheel {
  display: flex;
  height: 9rem;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  border-radius: 0.8rem;
  background: var(--cockpit-soft);
  padding-block: 3.35rem;
  scrollbar-width: none;
  mask-image: linear-gradient(to bottom, transparent 0, #000 18%, #000 82%, transparent 100%);
}

.cockpit-date-wheel::-webkit-scrollbar {
  display: none;
}

.cockpit-date-choice {
  display: grid;
  flex: 0 0 2.25rem;
  place-items: center;
  scroll-snap-align: center;
  border-radius: 0.7rem;
  color: #8b97a8;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  text-decoration: none;
}

.cockpit-date-choice.is-selected {
  background: var(--cockpit-ink-strong);
  color: #fff;
  box-shadow: 0 7px 16px rgb(15 23 42 / 18%);
}

/* Configuration modal */

.cockpit-config-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(15 23 42 / 30%);
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.cockpit-config {
  width: min(100%, 36rem);
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 60%);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 28px 80px rgb(15 23 42 / 24%);
}

.cockpit-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #edf1f5;
  padding: 1.25rem 1.35rem;
}

.cockpit-config-header p,
.cockpit-config-header h1 {
  margin: 0;
}

.cockpit-config-header p {
  color: var(--cockpit-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cockpit-config-header h1 {
  margin-top: 0.15rem;
  color: var(--cockpit-ink-strong);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cockpit-config-close {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-soft-strong);
  color: var(--cockpit-muted);
  font-size: 1.3rem;
  text-decoration: none;
}

.cockpit-config-form {
  display: grid;
  gap: 1.1rem;
  padding: 1.35rem;
}

.cockpit-config-count,
.cockpit-config-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.cockpit-config-count > span,
.cockpit-config-field span {
  color: var(--cockpit-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.cockpit-config-stepper,
.cockpit-config-order {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cockpit-config-stepper {
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 999px;
  background: var(--cockpit-soft);
  padding: 0.25rem;
}

.cockpit-config-stepper button,
.cockpit-config-order button {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--cockpit-muted);
  font: inherit;
  cursor: pointer;
}

.cockpit-config-stepper button {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
}

.cockpit-config-stepper button:hover {
  background: var(--cockpit-ink-strong);
  color: #fff;
}

.cockpit-config-stepper output {
  min-width: 1.5rem;
  color: var(--cockpit-ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.cockpit-config-slots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.cockpit-config-field {
  display: grid;
  gap: 0.35rem;
}

.cockpit-config-order button {
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--cockpit-line);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.cockpit-config-order button:hover:not(:disabled) {
  border-color: #a8b4c3;
  color: var(--cockpit-ink);
}

.cockpit-config-order button:disabled {
  opacity: 0.28;
  cursor: default;
}

.cockpit-config-field select {
  width: 100%;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 0.85rem;
  background: var(--cockpit-soft);
  padding: 0.7rem 0.75rem;
  color: var(--cockpit-ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
}

.cockpit-config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  border-top: 1px solid #edf1f5;
  padding-top: 1rem;
}

.cockpit-button {
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 0.95rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.cockpit-button.is-secondary {
  background: var(--cockpit-soft-strong);
  color: var(--cockpit-muted);
}

.cockpit-button.is-primary {
  background: var(--cockpit-ink-strong);
  color: #fff;
}

/* Inline tracker creation */

.cockpit-create-backdrop {
  position: fixed;
  z-index: 95;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgb(15 23 42 / 30%);
  padding: 1rem;
  backdrop-filter: blur(8px);
}

.cockpit-create {
  display: grid;
  width: min(100%, 38rem);
  max-height: min(46rem, calc(100vh - 2rem));
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 64%);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 28px 80px rgb(15 23 42 / 24%);
}

.cockpit-create-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #edf1f5;
  padding: 1.25rem 1.35rem;
}

.cockpit-create-header p,
.cockpit-create-header h1 {
  margin: 0;
}

.cockpit-create-header p {
  color: var(--cockpit-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.cockpit-create-header h1 {
  margin-top: 0.15rem;
  color: var(--cockpit-ink-strong);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.cockpit-create-close {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: var(--cockpit-soft-strong);
  color: var(--cockpit-muted);
  font-size: 1.3rem;
  line-height: 1;
  text-decoration: none;
}

.cockpit-create-form {
  display: grid;
  gap: 1rem;
  min-height: 0;
  overflow-y: auto;
  padding: 1.35rem;
}

.cockpit-create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.cockpit-create-field,
.cockpit-create-check {
  display: grid;
  gap: 0.38rem;
  min-width: 0;
}

.cockpit-create-field.is-wide,
.cockpit-create-check.is-wide {
  grid-column: 1 / -1;
}

.cockpit-create-field span,
.cockpit-create-check span {
  color: var(--cockpit-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.cockpit-create-field input,
.cockpit-create-field select,
.cockpit-create-field textarea {
  width: 100%;
  min-height: 2.75rem;
  box-sizing: border-box;
  border: 1px solid var(--cockpit-line-strong);
  border-radius: 0.9rem;
  background: var(--cockpit-soft);
  padding: 0.7rem 0.78rem;
  color: var(--cockpit-ink);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  outline: none;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.cockpit-create-field textarea {
  resize: vertical;
}

.cockpit-create-field input:focus,
.cockpit-create-field select:focus,
.cockpit-create-field textarea:focus {
  border-color: #a8b4c3;
  background: #fff;
  box-shadow: 0 0 0 3px rgb(15 23 42 / 6%);
}

.cockpit-create-check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid var(--cockpit-line);
  border-radius: 1rem;
  background: var(--cockpit-soft);
  padding: 0.75rem 0.85rem;
}

.cockpit-create-check input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--cockpit-accent);
}

.cockpit-create-errors {
  display: grid;
  gap: 0.2rem;
  border: 1px solid #fecaca;
  border-radius: 1rem;
  background: #fef2f2;
  padding: 0.85rem 1rem;
  color: #991b1b;
}

.cockpit-create-errors strong {
  font-size: 0.88rem;
  font-weight: 700;
}

.cockpit-create-errors span {
  font-size: 0.8rem;
}

.cockpit-create-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  border-top: 1px solid #edf1f5;
  padding-top: 1rem;
}

/* Responsive cockpit: one readable tracker at a time. */

@media (max-width: 760px) {
  .cockpit-flashes {
    top: auto;
    bottom: 9.4rem;
  }

  .cockpit {
    padding: 0.7rem 0.7rem 9.25rem;
  }

  .cockpit-topbar {
    min-height: 2.5rem;
    margin-bottom: 0.5rem;
  }

  .cockpit-workbar {
    margin-bottom: 0;
  }

  .cockpit-notification-panel {
    right: -0.15rem;
  }

  .cockpit-medication-summary {
    grid-template-columns: 1fr;
  }

  .cockpit-brand img {
    width: 2.35rem;
  }

  .cockpit-board {
    align-self: start;
    grid-template-columns: none;
    grid-auto-columns: min(88vw, 24rem);
    grid-auto-flow: column;
    width: 100%;
    height: calc(100vh - 13.8rem);
    min-height: 26rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .cockpit-board::-webkit-scrollbar {
    display: none;
  }

  .cockpit-tracker {
    scroll-snap-align: center;
    border-right: 1px solid #e3e8ef;
  }

  .cockpit-dock {
    bottom: 0.7rem;
    grid-template-areas:
      "date user"
      "nav nav";
    grid-template-columns: minmax(0, 1fr) auto;
    width: calc(100% - 1.4rem);
    min-height: 7.8rem;
    gap: 0.45rem 0.75rem;
    border-radius: 1.25rem;
    padding: 0.65rem 0.75rem;
  }

  .cockpit-date-control {
    grid-area: date;
    justify-content: flex-start;
  }

  .cockpit-dock-user {
    grid-area: user;
  }

  .cockpit-dock-nav {
    grid-area: nav;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: hidden;
    border-top: 1px solid #edf0f4;
    padding-top: 0.45rem;
    text-align: center;
  }

  .cockpit-dock-nav a,
  .cockpit-dock-user a,
  .cockpit-dock-user button {
    min-width: 0;
    padding-inline: 0.18rem;
    font-size: clamp(0.62rem, 2.7vw, 0.74rem);
  }

  .cockpit-config-slots {
    grid-template-columns: 1fr;
  }

  .cockpit-create {
    max-height: calc(100vh - 1.4rem);
  }

  .cockpit-create-grid {
    grid-template-columns: 1fr;
  }

  .cockpit-create-actions {
    flex-direction: column-reverse;
  }

  .cockpit-create-actions .cockpit-button {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
}

@media (max-width: 410px) {
  .cockpit-date-button {
    min-width: 5.4rem;
  }

  .cockpit-dock-user a {
    display: none;
  }

  .cockpit-date-popover {
    left: 0;
    transform: none;
  }

  .cockpit-date-popover::after {
    left: 4.6rem;
  }
}
