:root {
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --input: #d1d5db;
  --primary: #111827;
  --primary-foreground: #ffffff;
  --accent: #2563eb;
  --accent-muted: #eff6ff;
  --destructive: #dc2626;
  --ring: #93c5fd;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 6%);
  --shadow-md: 0 12px 32px rgb(15 23 42 / 9%);
  --page-shell-gutter: max(1rem, calc((100vw - 1520px) / 2));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgb(37 99 235 / 8%), transparent 30rem),
    var(--background);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

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

h1 {
  margin-bottom: .5rem;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.05;
}

h5,
.tall-title {
  margin-bottom: 1rem;
  color: var(--foreground);
  font-size: 1.05rem;
  font-weight: 650;
}

input,
textarea,
select {
  display: block;
  width: 100%;
  min-height: 2.5rem;
  margin: .45rem 0 1rem;
  padding: .55rem .75rem;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background-color: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #9ca3af;
}

input:focus,
textarea:focus,
select:focus {
  outline: 0;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgb(147 197 253 / 35%);
}

label {
  color: var(--foreground);
  font-size: .9rem;
  font-weight: 600;
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  margin: 0;
  padding: .55rem .9rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  color: var(--primary-foreground);
  cursor: pointer;
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

button:hover,
.button:hover {
  background: #020617;
  text-decoration: none;
}

.secondary,
.button.secondary {
  border-color: var(--border);
  background: var(--card);
  color: var(--foreground);
}

.secondary:hover,
.button.secondary:hover {
  background: var(--muted);
}

.destructive-button {
  border-color: #fecaca;
  background: #991b1b;
  color: #fff;
}

.destructive-button:hover {
  background: #7f1d1d;
}

.page-shell {
  display: block;
  width: min(1520px, calc(100% - (var(--page-shell-gutter) * 2)));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.main-column {
  min-width: 0;
}

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

.mobile-top-nav {
  position: relative;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
  padding: .45rem;
  border: 1px solid rgb(226 232 240 / 85%);
  border-radius: calc(var(--radius) + 2px);
  background: rgb(255 255 255 / 90%);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px);
}

.mobile-top-nav > a {
  flex: 0 0 auto;
  color: var(--foreground);
  font-weight: 800;
  text-transform: lowercase;
}

.nav-command-button {
  flex: 0 0 auto;
  margin-left: auto;
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border-color: var(--border);
  background: var(--card);
  color: var(--muted-foreground);
}

.side-nav {
  position: fixed;
  top: 4.75rem;
  right: auto;
  bottom: .75rem;
  left: var(--page-shell-gutter);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: min(18rem, calc(100vw - (var(--page-shell-gutter) * 2)));
  min-height: auto;
  padding: .7rem;
  border: 1px solid rgb(226 232 240 / 85%);
  border-radius: calc(var(--radius) + 2px);
  background: rgb(255 255 255 / 86%);
  box-shadow: var(--shadow-md);
  transform: translateX(calc(-100% - var(--page-shell-gutter) - 1rem));
  transition: transform .18s ease;
  backdrop-filter: blur(14px);
}

.side-nav.is-open {
  transform: translateX(0);
}

.side-nav-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: .35rem .35rem .7rem;
}

.brand-link {
  display: inline-flex;
  gap: .55rem;
  align-items: center;
  width: auto;
  min-height: 2.4rem;
  padding: .25rem .35rem;
  color: var(--foreground);
  font-size: .95rem;
  font-weight: 800;
  text-transform: lowercase;
}

.brand-profile-picture {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgb(226 232 240 / 95%);
  border-radius: 999px;
  background: var(--muted);
  box-shadow: var(--shadow-sm);
  color: var(--muted-foreground);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
  object-fit: cover;
  overflow: hidden;
  text-transform: uppercase;
}

.nav-search {
  position: relative;
  display: flex;
  gap: .35rem;
  align-items: center;
  padding: .25rem .35rem .6rem;
}

.nav-search input {
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: .45rem .65rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: rgb(255 255 255 / 78%);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  font-size: .82rem;
}

.nav-search input:focus {
  border-color: rgb(37 99 235 / 55%);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%);
  outline: none;
}

.nav-search button {
  flex: 0 0 auto;
  width: auto;
  min-height: 2.25rem;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: .72rem;
}

.nav-search-results {
  position: absolute;
  top: calc(100% - .35rem);
  right: .35rem;
  left: .35rem;
  z-index: 80;
  max-height: min(22rem, calc(100vh - 8rem));
  overflow: auto;
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 98%);
  box-shadow: var(--shadow-md);
}

.nav-search-results[hidden] {
  display: none;
}

.nav-search-results button[hidden] {
  display: none;
}

.nav-search-results button {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: .55rem;
  align-items: center;
  width: 100%;
  min-height: 2.25rem;
  padding: .45rem .55rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  box-shadow: none;
  color: var(--foreground);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

.nav-search-icon {
  display: inline-flex;
  flex: 0 0 1.35rem;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.nav-search-results button:hover,
.nav-search-results button:focus {
  background: var(--accent-muted);
  color: var(--foreground);
  outline: none;
}

.nav-search-results button > span:not(.nav-search-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-nav a,
.side-nav button {
  gap: .45rem;
  justify-content: flex-start;
  width: 100%;
  min-height: 2.25rem;
  padding: .55rem .65rem;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.side-nav .brand-link {
  gap: .55rem;
  justify-content: flex-start;
  width: auto;
  min-height: 2.4rem;
  padding: .25rem .35rem;
  color: var(--foreground);
  font-size: .95rem;
  font-weight: 800;
}

.nav-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1;
}

.side-nav a:hover,
.side-nav button:hover {
  background: var(--muted);
  color: var(--foreground);
  text-decoration: none;
}

.side-nav .primary-link {
  background: var(--primary);
  color: var(--primary-foreground);
}

.side-nav .nav-search button {
  justify-content: center;
  width: auto;
}

.side-nav .nav-search-results button {
  justify-content: stretch;
}

.nav-logout {
  margin-top: auto;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: block;
  background: rgb(15 23 42 / 28%);
}

.nav-backdrop[hidden] {
  display: none;
}

.command-palette[hidden] {
  display: none;
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: start center;
  padding: max(4rem, 10vh) 1rem 1rem;
}

.command-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / 34%);
  backdrop-filter: blur(4px);
}

.command-panel {
  position: relative;
  z-index: 1;
  width: min(38rem, 100%);
  overflow: hidden;
  border: 1px solid rgb(226 232 240 / 92%);
  border-radius: calc(var(--radius) + 6px);
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 24px 64px rgb(15 23 42 / 22%);
}

.command-input-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .8rem .9rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
}

.command-input-row input {
  min-height: 2rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
}

.command-input-row input:focus {
  box-shadow: none;
}

.command-shortcut {
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0 .45rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: .72rem;
  font-weight: 800;
}

.command-results {
  max-height: min(26rem, calc(100vh - 10rem));
  overflow: auto;
  padding: .35rem;
}

.command-results[hidden] {
  display: none;
}

.command-results button {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  width: 100%;
  min-height: 2.6rem;
  padding: .55rem .65rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  box-shadow: none;
  color: var(--foreground);
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
}

.command-results button:hover,
.command-results button:focus {
  background: var(--accent-muted);
  outline: none;
}

.command-results button[hidden] {
  display: none;
}

.command-results button > span:not(.nav-search-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hamburger-button {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  min-height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.hamburger-button:hover,
.hamburger-button:focus-visible {
  border-color: rgb(37 99 235 / 30%);
  background: var(--accent-muted);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%), var(--shadow-sm);
  color: var(--accent);
  outline: none;
}

.hamburger-button span {
  width: 1rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.inline-form {
  display: inline;
}

.inline-form button {
  border: 0;
}

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 10.75rem;
  padding: 1rem;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--muted-foreground);
  text-align: center;
}

.message {
  margin-bottom: 1rem;
  padding: .75rem .9rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: var(--accent-muted);
  color: #1d4ed8;
}

.error {
  color: var(--destructive);
  font-weight: 600;
}

.detail-header {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.detail-header h1 {
  margin-bottom: .35rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  align-items: center;
  margin: 0 0 .75rem;
  color: var(--muted-foreground);
  font-size: .82rem;
  font-weight: 750;
}

.breadcrumbs a {
  color: var(--muted-foreground);
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.breadcrumbs span:last-child {
  color: var(--foreground);
}

.breadcrumb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.breadcrumb-actions .breadcrumbs,
.breadcrumb-actions .entity-controls {
  margin-bottom: 0;
}

.muted-text {
  margin: 0;
  color: var(--muted-foreground);
  font-weight: 700;
}

.goal-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.goal-summary-panel {
  padding: .85rem .95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
}

.goal-summary-panel span,
.goal-summary-panel strong {
  display: block;
}

.goal-summary-panel span {
  color: var(--muted-foreground);
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.goal-summary-panel strong {
  margin-top: .3rem;
  color: var(--foreground);
  font-size: 1.35rem;
}

.survey-row {
  display: grid;
  grid-template-columns: 17rem minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.fixed-panel,
.detail-form,
.inline-create,
.import-panel,
.login-panel,
.chart-options,
.menu-grid a,
.list,
.activity-chart,
table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
}

.profile-form {
  max-width: 34rem;
}

.profile-picture-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: .75rem;
}

.profile-picture-row img,
.profile-picture-placeholder {
  width: 5rem;
  height: 5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--accent-muted);
  object-fit: cover;
}

.profile-picture-placeholder {
  display: grid;
  place-items: center;
  color: var(--accent);
  font-size: 2rem;
  font-weight: 750;
}

.fixed-panel {
  position: sticky;
  top: 2rem;
  width: 17rem;
  padding: 1.15rem;
}

.two-day-entry {
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  padding-left: 4rem;
}

.notes-panel {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  width: 100%;
}

.notes-panel[data-dictation-cleanup-panel] {
  position: relative;
}

.notes-panel-toolbar {
  grid-column: 3;
  grid-row: 1;
  z-index: 1;
  align-self: start;
  justify-self: end;
  margin: -1rem 0 0;
}

.notes-panel label {
  grid-row: 1;
}

.notes-panel label:nth-of-type(1) {
  grid-column: 1;
}

.notes-panel label:nth-of-type(2) {
  grid-column: 2;
}

.notes-panel label:nth-of-type(3) {
  grid-column: 3;
}

.dictation-cleanup-button.is-loading {
  color: var(--accent);
  cursor: wait;
  opacity: .72;
}

.notes-panel label + label {
  margin-top: 0;
}

.notes-panel textarea {
  min-height: 9rem;
}

.day-entry-stack {
  display: grid;
  gap: 1rem;
}

.section-filter-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  width: 100%;
}

.bulk-jump-controls {
  position: fixed;
  top: 7.25rem;
  left: var(--page-shell-gutter);
  z-index: 50;
  display: grid;
  gap: .75rem;
}

.bulk-jump-button {
  width: 3rem;
  min-height: 3rem;
  padding: 0;
  border-color: var(--border);
  border-radius: calc(var(--radius) + 2px);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-md);
  color: var(--foreground);
  font-size: 1.05rem;
  backdrop-filter: blur(14px);
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease, transform .15s ease;
}

.bulk-jump-button:hover,
.bulk-jump-button:focus-visible {
  border-color: rgb(37 99 235 / 30%);
  background: var(--accent-muted);
  box-shadow: 0 0 0 3px rgb(37 99 235 / 12%), var(--shadow-md);
  color: var(--accent);
  outline: none;
  transform: translateY(-1px);
}

.secondary-button {
  width: auto;
  border-color: var(--border);
  background: var(--card);
  color: var(--foreground);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: rgb(37 99 235 / 30%);
  background: var(--accent-muted);
  color: var(--accent);
  outline: none;
}

.day-entry-panel {
  scroll-margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
}

.day-entry-title {
  margin: 0 0 .7rem;
  color: var(--foreground);
  font-size: 1.45rem;
  line-height: 1.2;
}

.day-entry-panel > input {
  max-width: 18rem;
}

.day-entry-panel .activity-grid {
  margin-top: 1rem;
}

.activity-section + .activity-section {
  margin-top: 1.25rem;
}

.activity-section-header {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 0 .7rem;
}

.activity-section-title {
  margin: 0;
  color: var(--muted-foreground);
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-add-button {
  width: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  padding: 0;
}

.bulk-activity-add-form {
  display: grid;
  grid-template-columns: minmax(10rem, 1.3fr) repeat(3, minmax(7rem, .8fr));
  gap: .5rem;
  align-items: center;
  margin-bottom: .75rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(248 250 252 / 90%);
}

.bulk-activity-add-form input,
.bulk-activity-add-form select {
  min-height: 2.15rem;
  padding: .4rem .55rem;
}

.bulk-activity-add-form input[name="name"] {
  grid-column: span 2;
}

.bulk-activity-add-actions {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.bulk-activity-add-actions .button {
  width: auto;
  min-height: 2.15rem;
  padding: .4rem .65rem;
}

.bulk-submit-row {
  width: 100%;
}

.notes-summary-panel {
  max-width: 48rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-sm);
}

.copy-button {
  width: auto;
  margin-bottom: .75rem;
}

.notes-summary-panel pre {
  margin: 0;
  white-space: pre-wrap;
}

.float-right {
  float: none;
  width: 100%;
}

.activity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  gap: .75rem;
}

.activity-card {
  position: relative;
  min-height: 4.6rem;
  padding: .75rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.activity-card label {
  display: block;
  min-height: 1.5rem;
  margin-bottom: .35rem;
  color: var(--muted-foreground);
  font-size: .88rem;
  font-weight: 600;
}

.activity-card--slider label {
  padding-right: 2rem;
}

.activity-card label a:first-child {
  color: var(--muted-foreground);
}

.activity-card label a:last-child {
  color: var(--foreground);
}

.activity-context-menu {
  position: fixed;
  z-index: 40;
  min-width: 9rem;
  padding: .3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.activity-context-menu button {
  display: block;
  width: 100%;
  min-height: 2rem;
  padding: .45rem .65rem;
  border: 0;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: var(--foreground);
  box-shadow: none;
  text-align: left;
  font-size: .9rem;
  font-weight: 650;
}

.activity-context-menu button:hover,
.activity-context-menu button:focus-visible {
  background: var(--accent-muted);
  color: var(--accent);
  outline: none;
}

.range-column input {
  min-height: 2.1rem;
  margin: 0;
  padding: .45rem .65rem;
}

.range-column input[type="range"] {
  width: 100%;
  height: 1.1rem;
  min-height: 1.1rem;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  accent-color: var(--accent);
}

.slider-max-button {
  position: absolute;
  top: .55rem;
  right: .55rem;
  width: 1.65rem;
  min-height: 1.65rem;
  padding: 0;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--muted-foreground);
  font-size: .78rem;
  opacity: .72;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}

.slider-max-button i {
  transform: rotate(90deg);
}

.slider-max-button.is-slider-max i {
  transform: rotate(-90deg);
}

.slider-max-button:hover,
.slider-max-button:focus-visible {
  background: var(--accent-muted);
  color: var(--accent);
  opacity: 1;
  outline: none;
}

.login-panel {
  max-width: 25rem;
  margin: 11vh auto;
  padding: 1.5rem;
}

.login-panel h1 {
  margin-bottom: 1.25rem;
  font-size: 2.25rem;
}

.login-panel .button,
.login-panel button {
  width: 100%;
  margin-top: .35rem;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: .85rem;
}

.menu-grid a {
  display: flex;
  min-height: 5rem;
  align-items: center;
  padding: 1rem;
  color: var(--foreground);
  font-weight: 700;
}

.menu-grid a:hover,
.list li:hover {
  background: var(--muted);
  text-decoration: none;
}

.list {
  overflow: hidden;
  padding: 0;
  list-style: none;
}

.list li {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.list li:last-child {
  border-bottom: 0;
}

.list span,
small {
  color: var(--muted-foreground);
  font-size: .82rem;
}

.detail-form,
.inline-create,
.import-panel {
  max-width: 36rem;
  padding: 1rem;
}

.page-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.muted,
.import-status {
  color: var(--muted-foreground);
}

.import-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(16rem, .7fr);
  gap: 1rem;
  align-items: start;
}

.import-panel {
  max-width: none;
}

.import-dropzone {
  min-height: 18rem;
}

.entity-controls {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

.entity-controls a {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  padding: .45rem .75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  font-size: .88rem;
  font-weight: 650;
}

.entity-controls a:hover {
  background: var(--muted);
  text-decoration: none;
}

.entity-title a {
  color: var(--accent);
}

.entity-title {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .6rem;
  align-items: center;
}

.entity-title-select {
  display: inline-block;
  width: auto;
  max-width: min(100%, 28rem);
  min-height: 2.75rem;
  margin: 0;
  padding: .2rem 2.35rem .2rem .25rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background-color: transparent;
  box-shadow: none;
  color: var(--foreground);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

.entity-title-select:hover,
.entity-title-select:focus {
  background-color: var(--muted);
  box-shadow: 0 0 0 3px rgb(147 197 253 / 25%);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.tag-chip {
  display: inline-flex;
  min-height: 1.75rem;
  align-items: center;
  gap: .35rem;
  padding: .25rem .65rem;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--accent-muted);
  color: #1d4ed8;
  font-size: .78rem;
  font-weight: 700;
}

.tag-chip:hover {
  background: #dbeafe;
  text-decoration: none;
}

.tag-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: .85rem;
  height: .85rem;
  color: #60a5fa;
  font-size: .7rem;
  line-height: 1;
}

.chart-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -.5rem 0 .75rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  color: var(--foreground);
  font-weight: 800;
}

.icon-button > i,
.table-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
  line-height: 1;
}

.table-icon {
  margin-right: .35rem;
  color: var(--muted-foreground);
}

.icon-button:hover {
  background: var(--muted);
}

.tag-remove-button {
  width: 1.85rem;
  min-height: 1.85rem;
  border-color: #fecaca;
  color: #991b1b;
  font-size: 1rem;
}

.tag-remove-button:hover {
  background: #fee2e2;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding: 6rem 1rem 1rem;
  background: rgb(15 23 42 / 28%);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop-centered {
  place-items: center;
  padding: 1rem;
}

.modal-panel {
  width: min(100%, 38rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: rgb(255 255 255 / 98%);
  box-shadow: var(--shadow-md);
}

.confirmation-modal {
  width: min(calc(100vw - 2rem), 30rem);
  padding: 1.25rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
}

.confirmation-modal .modal-header {
  padding: 0;
}

.confirmation-modal .muted-text {
  margin: .75rem 0 1.25rem;
  color: #475569;
  font-weight: 600;
  line-height: 1.45;
}

.confirmation-modal .actions {
  justify-content: flex-end;
}

.chart-options {
  display: grid;
  gap: .9rem;
  margin: 0;
  padding: 1rem;
}

.chart-options fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.chart-options legend {
  width: 100%;
  margin-bottom: .35rem;
  color: var(--muted-foreground);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.chart-options label {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2rem;
  padding: .3rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: .86rem;
}

.chart-options input {
  display: inline-block;
  width: auto;
  min-height: auto;
  margin: 0;
  box-shadow: none;
  accent-color: var(--accent);
}

.rollup-row {
  display: flex;
  flex-wrap: wrap;
  gap: .9rem 1rem;
  align-items: end;
}

.rollup-row fieldset:first-child {
  flex: 1 1 24rem;
}

.rollup-row .chart-number-option {
  flex: 0 1 14rem;
}

.chart-options .chart-number-option label {
  border-radius: var(--radius);
}

.chart-options input[type="number"] {
  width: 4.5rem;
  min-height: 1.75rem;
  padding: .2rem .45rem;
  text-align: right;
}

.chart-source-form {
  max-width: none;
}

.source-section {
  margin-top: 1.25rem;
}

.source-section h2,
.source-section h3 {
  margin-bottom: .65rem;
  color: var(--muted-foreground);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.source-section h3 {
  margin-top: 1rem;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: .5rem;
}

.source-option {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.35rem;
  padding: .45rem .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font-weight: 650;
}

.source-option input {
  width: auto;
  min-height: auto;
  margin: 0;
  box-shadow: none;
}

.chart-frame {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  grid-template-rows: 17rem auto;
  gap: .35rem .7rem;
  margin: 1.5rem 0 .6rem;
}

.chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: .85rem 0 .85rem;
  color: var(--muted-foreground);
  font-size: .75rem;
  font-weight: 700;
  text-align: right;
}

.chart-y-axis span:first-child {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  align-self: center;
  text-transform: uppercase;
}

.activity-chart {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 100%;
  margin: 0;
  padding: .85rem;
  overflow: hidden;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    var(--card);
  background-size: 24px 24px;
}

.activity-chart span {
  flex: 1;
  min-width: 2px;
  height: var(--bar-height);
  border-radius: 999px 999px 0 0;
  background: #e11d48;
}

.activity-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.activity-chart polyline {
  fill: none;
  stroke: #e11d48;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.activity-chart .chart-series-line {
  stroke: var(--series-color, #e11d48);
}

.activity-chart .chart-hit-point {
  fill: transparent;
  pointer-events: all;
  stroke: transparent;
  stroke-width: 4;
  vector-effect: non-scaling-stroke;
}

.activity-chart .chart-hit-point:hover {
  fill: var(--series-color, #e11d48);
}

.chart-tooltip {
  position: absolute;
  z-index: 20;
  max-width: min(18rem, calc(100vw - 2rem));
  padding: .5rem .7rem;
  border: 1px solid rgb(15 23 42 / 30%);
  border-radius: calc(var(--radius) - 2px);
  background: rgb(15 23 42 / 88%);
  box-shadow: 0 12px 26px rgb(15 23 42 / 24%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  pointer-events: none;
  white-space: nowrap;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-x-axis {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted-foreground);
  font-size: .75rem;
  font-weight: 700;
}

.chart-x-axis span:nth-child(2) {
  text-transform: uppercase;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 1.25rem;
  color: var(--muted-foreground);
  font-size: .82rem;
}

.chart-legend span {
  display: inline-flex;
  gap: .4rem;
  align-items: center;
}

.chart-legend i {
  width: .75rem;
  height: .75rem;
  border-radius: 999px;
  background: var(--series-color, #e11d48);
}

table {
  width: 100%;
  overflow: hidden;
  border-collapse: separate;
  border-spacing: 0;
}

.full-width-table {
  width: 100%;
  table-layout: fixed;
}

.group-activities-table th:first-child,
.group-activities-table td:first-child {
  width: 58%;
}

.group-activities-table th:nth-child(2),
.group-activities-table td:nth-child(2) {
  width: 20%;
}

.group-activities-table th:nth-child(3),
.group-activities-table td:nth-child(3) {
  width: 22%;
}

th,
td {
  padding: .85rem .9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: .8rem;
  font-weight: 750;
}

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

tbody tr:hover td {
  background: #f8fafc;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.form-actions {
  align-items: center;
  justify-content: space-between;
  margin-top: .25rem;
}

.notes-cell {
  max-width: 34rem;
}

.link-button {
  min-height: 2rem;
  padding: .3rem .55rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--accent);
  font-size: .95rem;
}

.link-button:hover {
  background: var(--accent-muted);
  color: var(--accent);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
}

.checkbox input {
  display: inline-block;
  width: auto;
  min-height: auto;
  margin: 0;
  box-shadow: none;
}

pre {
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #0f172a;
  color: #e2e8f0;
}

@media (max-width: 960px) {
  .page-shell {
    display: block;
    width: min(100% - 1rem, 46rem);
    padding-top: .75rem;
  }

  .survey-row {
    display: block;
  }

  .two-day-entry {
    padding-left: 0;
  }

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

  .fixed-panel {
    position: static;
    width: 100%;
    margin-bottom: 1rem;
  }

  .bulk-jump-controls {
    top: 5rem;
    right: .75rem;
    left: auto;
  }

  .notes-panel {
    display: block;
    width: 100%;
  }

  .notes-panel label + label {
    margin-top: 1rem;
  }

  .activity-grid {
    grid-template-columns: repeat(2, minmax(12rem, 1fr));
  }

  .bulk-activity-add-form {
    grid-template-columns: 1fr 1fr;
  }

  .bulk-activity-add-form input[name="name"],
  .bulk-activity-add-actions {
    grid-column: 1 / -1;
  }

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

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

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

  .bulk-activity-add-form {
    grid-template-columns: 1fr;
  }

  table {
    display: block;
    overflow-x: auto;
  }

  table.full-width-table {
    display: table;
    width: 100%;
    min-width: 100%;
    overflow: hidden;
  }
}
