:root {
  color-scheme: dark;
  --bg: #06101a;
  --surface: #09131f;
  --surface-2: #0d1826;
  --surface-3: #122133;
  --line: rgba(148, 182, 255, 0.12);
  --line-strong: rgba(148, 182, 255, 0.2);
  --text: #eef4ff;
  --muted: #97a9c1;
  --accent: #eaf1ff;
  --accent-soft: rgba(110, 168, 255, 0.11);
  --success: #7ef0b7;
  --warning: #ff9f6a;
  --danger: #ff6d6d;
  --brand: #4f95ff;
  --brand-soft: rgba(79, 149, 255, 0.16);
  --shadow: 0 24px 64px rgba(1, 7, 16, 0.56);
  --radius: 26px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --font: "Manrope", "Segoe UI", sans-serif;
  --dock-safe-space: calc(158px + env(safe-area-inset-bottom));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at top left, rgba(68, 126, 255, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(16, 82, 168, 0.14), transparent 30%),
    linear-gradient(180deg, #07111c 0%, #040911 100%);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
}

.app-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: max(18px, calc(env(safe-area-inset-top) + 10px)) 14px var(--dock-safe-space);
  animation: app-fade-in 280ms ease;
}

@keyframes app-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topbar,
.hero,
.tabs,
.filter-row,
.segmented,
.summary-strip,
.selection-bar,
.two-column,
.inline-form,
.agenda-section-head,
.agenda-title-row,
.agenda-meta-row,
.agenda-footer,
.agenda-content,
.agenda-main {
  display: flex;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 2px 0 0;
}

.profile-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(94, 147, 255, 0.28), rgba(94, 147, 255, 0.12));
  border: 1px solid rgba(148, 182, 255, 0.2);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  box-shadow: 0 12px 28px rgba(31, 76, 158, 0.25);
  overflow: hidden;
  flex: 0 0 42px;
}

.profile-avatar.large {
  width: 54px;
  height: 54px;
  border-radius: 22px;
  font-size: 16px;
  flex-basis: 54px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #67a6ff, #3e88ff);
  color: #f7fbff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(62, 136, 255, 0.28);
}

.profile-entry {
  position: relative;
}

.profile-entry .profile-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  z-index: 2;
}

.profile-copy {
  display: grid;
  gap: 1px;
  text-align: left;
  min-width: 0;
}

.profile-copy strong {
  font-size: 16px;
}

.profile-copy em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions,
.panel-head,
.form-actions,
.agenda-controls {
  display: flex;
}

.topbar-actions {
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 0;
  line-height: 0;
}

.topbar-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  flex: 0 0 44px;
}

.topbar-icon-button svg {
  display: block;
  width: 19px;
  height: 19px;
  margin: auto;
  flex: 0 0 19px;
}

.profile-entry {
  min-width: 0;
  flex: 1 1 auto;
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 5vw, 38px);
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.hero-card,
.form-card,
.insights-card,
.filter-card,
.group-pill,
.agenda-card,
.stats-card {
  background: linear-gradient(180deg, rgba(11, 19, 30, 0.98), rgba(7, 12, 20, 0.98));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 60px;
  padding: 11px 13px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.hero-card-wide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hero-metric {
  min-width: 0;
  padding: 2px 2px 1px;
}

.hero-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.hero-card strong {
  font-size: 15px;
}

.hero-metric.warning strong {
  color: var(--warning);
}

.hero-metric.success strong {
  color: var(--success);
}

.hero.compact {
  gap: 6px;
  margin-bottom: 10px;
}

.hero.compact .hero-card {
  min-height: 58px;
  padding: 10px 12px;
}

.tabs {
  gap: 8px;
  overflow-x: auto;
  margin: 0 -2px 14px;
  padding: 2px;
}

.top-tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(2, 3, 4, 0.96), rgba(2, 3, 4, 0.82));
  backdrop-filter: blur(14px);
}

.tab,
.chip,
.ghost-button,
.primary-button,
.task-select,
.dock-action,
.danger-button,
.attachment-preview-remove {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  font: inherit;
}

.tab,
.chip,
.ghost-button,
.dock-action {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  color: var(--text);
}

.tab,
.chip {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

.tab {
  padding: 10px 14px;
  border-radius: 999px;
}

.chip {
  padding: 10px 12px;
  border-radius: 18px;
}

.tab.active,
.chip.active,
.ghost-button.active,
.dock-action.active {
  border-color: rgba(102, 163, 255, 0.34);
  background: linear-gradient(180deg, rgba(79, 149, 255, 0.24), rgba(79, 149, 255, 0.14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
}

.tab-panel.active {
  display: block;
  padding-bottom: 28px;
  animation: panel-fade-in 200ms ease;
}

.task-list,
.profile-card-grid,
.overview-layout,
.insights-card,
.form-card,
.details-card,
.inbox-panel,
.automation-panel {
  margin-bottom: 18px;
}

.tab-panels,
.form-card,
.details-card,
.details-head,
.details-head > div,
.details-meta,
.details-meta-row,
.details-actions,
.details-block,
.details-block > *,
.attachment-list,
.timeline-list,
.dependency-inline {
  min-width: 0;
  max-width: 100%;
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-card {
  padding: 12px;
  margin-bottom: 12px;
}

.top-filter-card {
  margin-top: 4px;
}

.filter-row {
  gap: 10px;
  align-items: stretch;
}

.filter-row + .filter-row {
  margin-top: 10px;
}

.filter-block {
  min-width: 0;
}

.filter-block.grow {
  flex: 1;
}

.filter-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.filter-hint {
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.segmented {
  gap: 8px;
  flex-wrap: wrap;
}

select,
.select,
input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 22, 35, 0.98), rgba(10, 17, 28, 0.98));
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

select,
.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: none !important;
  background-color: transparent;
  padding-right: 36px;
}

select::-ms-expand {
  display: none;
}

.select-field,
.filter-block:has(> select) {
  position: relative;
}

.select-shell {
  position: relative;
  display: block;
}

.select-shell:has(select:focus-visible) .select-shell-value,
.select-shell:has(select:focus) .select-shell-value {
  border-color: rgba(102, 163, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 0 0 3px rgba(79, 149, 255, 0.12);
}

.select-shell-value {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 42px 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 22, 35, 0.98), rgba(10, 17, 28, 0.98));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-shell-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-right: 2px solid rgba(151, 169, 193, 0.94);
  border-bottom: 2px solid rgba(151, 169, 193, 0.94);
  transform: rotate(45deg);
  pointer-events: none;
}

.select-shell select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.0001;
  z-index: 2;
  cursor: pointer;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  caret-color: transparent;
  padding: 0 !important;
}

.select-shell select::-ms-expand {
  display: none;
}

.select-shell select::-webkit-calendar-picker-indicator {
  opacity: 0;
}

.select-shell.is-placeholder .select-shell-value {
  color: var(--muted);
}

input[type="date"],
input[type="time"] {
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  max-width: 100%;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  opacity: 0.9;
  filter: invert(79%) sepia(20%) saturate(321%) hue-rotate(180deg) brightness(94%) contrast(86%);
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
  text-align: left;
}

input[type="file"] {
  padding: 10px 12px;
  color: var(--muted);
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(148, 182, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(79, 149, 255, 0.16), rgba(79, 149, 255, 0.08));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.ghost-button,
.primary-button {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 18px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(180deg, #67a6ff, #3e88ff);
  color: #f7fbff;
  box-shadow: 0 12px 28px rgba(69, 132, 255, 0.28);
}

.ghost-button:hover,
.primary-button:hover,
.tab:hover,
.chip:hover,
.task-select:hover,
.dock-action:hover {
  transform: translateY(-1px);
}

.ghost-button:active,
.primary-button:active,
.dock-action:active,
.tab:active,
.chip:active,
.task-select:active {
  transform: scale(0.98);
}

.summary-strip,
.selection-bar {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  margin-bottom: 10px;
  border-radius: 18px;
  background: rgba(13, 24, 38, 0.88);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.agenda-show-more {
  margin-top: 2px;
}

.show-more-button {
  width: 100%;
}

.task-list,
.group-stats,
.group-grid {
  display: grid;
  gap: 9px;
}

.group-grid {
  margin-top: 12px;
}

.task-list.virtualized {
  position: relative;
  display: block;
  min-height: 240px;
  max-height: min(62vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.virtual-window {
  display: grid;
  gap: 8px;
}

.virtual-spacer {
  width: 100%;
  pointer-events: none;
}

.week-calendar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.week-calendar-day {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 17, 28, 0.96), rgba(7, 12, 20, 0.98));
}

.week-calendar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.week-calendar-head strong {
  font-size: 13px;
  text-transform: capitalize;
}

.week-calendar-head span {
  color: var(--muted);
  font-size: 11px;
}

.week-calendar-body {
  display: grid;
  gap: 8px;
}

.week-calendar-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 10px 2px;
}

.agenda-section {
  margin-bottom: 10px;
}

.agenda-section + .agenda-section {
  margin-top: 8px;
}

.agenda-section-head {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 11px 13px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(14, 22, 34, 0.96), rgba(9, 15, 25, 0.96));
  color: inherit;
  cursor: pointer;
  box-shadow: inset 4px 0 0 rgba(79, 149, 255, 0.28);
}

.agenda-section-head.collapsed {
  margin-bottom: 0;
}

.agenda-section-head h3 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.agenda-section-head span {
  color: var(--muted);
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(79, 149, 255, 0.1);
}

.agenda-stack {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.agenda-card {
  overflow: hidden;
  position: relative;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(8, 13, 22, 0.98), rgba(7, 11, 18, 0.98));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.agenda-card:hover {
  transform: translateY(-1px);
  border-color: rgba(125, 176, 255, 0.2);
  box-shadow: 0 22px 50px rgba(5, 11, 22, 0.4);
}

.swipe-track {
  position: relative;
  overflow: hidden;
}

.swipe-affirm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, rgba(116, 242, 181, 0.28), rgba(116, 242, 181, 0.08));
  color: transparent;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.agenda-card.swiping .swipe-affirm {
  opacity: 0.92;
  transform: scale(1);
}

.swipe-affirm.complete {
  background: linear-gradient(90deg, rgba(116, 242, 181, 0.32), rgba(116, 242, 181, 0.08));
}

.agenda-card.swiping .swipe-affirm.complete {
  color: var(--success);
}

.swipe-affirm.reopen {
  background: linear-gradient(270deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05));
}

.agenda-card.swiping .swipe-affirm.reopen {
  color: var(--text);
}

.swipe-affirm.delete {
  background: linear-gradient(90deg, rgba(255, 109, 109, 0.24), rgba(255, 109, 109, 0.08));
}

.agenda-card.swiping .swipe-affirm.delete {
  color: #ffd4d4;
}

.agenda-content {
  align-items: stretch;
  gap: 9px;
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(9, 15, 24, 0.98), rgba(7, 12, 20, 0.98));
  padding: 10px;
}

.agenda-content.no-range {
  gap: 8px;
}

.agenda-card.no-time-card .agenda-content {
  gap: 8px;
  padding: 10px;
}

.agenda-card.no-time-card .agenda-time {
  width: 72px;
  flex-basis: 72px;
  padding-right: 8px;
}

.agenda-card.no-time-card .agenda-main {
  gap: 5px;
}

.agenda-time {
  width: 72px;
  flex: 0 0 72px;
  display: grid;
  gap: 3px;
  align-content: start;
  padding: 2px 9px 2px 0;
  border-right: 1px solid rgba(148, 182, 255, 0.12);
}

.agenda-time.compact {
  width: 72px;
  flex-basis: 72px;
  padding-right: 8px;
}

.agenda-time strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
}

.agenda-time span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.agenda-time.compact strong {
  font-size: 10px;
  line-height: 1.18;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.agenda-time.compact span {
  font-size: 8px;
  line-height: 1.15;
}

.agenda-main {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.agenda-title-row {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-right: 50px;
}

.agenda-heading {
  min-width: 0;
  flex: 1;
}

.agenda-side {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.agenda-controls {
  align-items: center;
  gap: 8px;
}

.agenda-kicker {
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.group-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 999px;
  background: var(--group-accent, var(--brand));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--group-accent, var(--brand)) 16%, transparent);
}

.agenda-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.agenda-title.done {
  text-decoration: line-through;
  color: rgba(245, 247, 248, 0.54);
}

.agenda-meta-row,
.agenda-footer {
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.agenda-priority {
  flex: 0 0 auto;
  min-width: 38px;
  padding: 5px 9px;
  text-align: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.03);
}

.agenda-priority.priority-1 {
  border-color: rgba(158, 178, 194, 0.14);
  background: rgba(158, 178, 194, 0.08);
}

.agenda-priority.priority-2 {
  border-color: rgba(230, 234, 236, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.agenda-priority.priority-3 {
  border-color: rgba(255, 159, 106, 0.18);
  background: rgba(255, 159, 106, 0.08);
}

.agenda-priority.priority-4 {
  border-color: rgba(255, 109, 109, 0.18);
  background: rgba(255, 109, 109, 0.08);
}

.agenda-chip {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 182, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
}

.agenda-chip.compact {
  padding-inline: 8px;
}

.agenda-chip.subtle {
  color: var(--success);
  border-color: rgba(126, 240, 183, 0.16);
  background: rgba(126, 240, 183, 0.08);
}

.agenda-chip.google {
  color: #8cc6ff;
  background: rgba(79, 149, 255, 0.12);
}

.agenda-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.32;
}

.agenda-status {
  color: var(--muted);
  font-size: 11px;
  min-height: 16px;
}

.task-select {
  min-width: 34px;
  height: 34px;
  border-radius: 16px;
  background: rgba(79, 149, 255, 0.1);
  color: var(--text);
}

.task-select.selected {
  background: rgba(126, 240, 183, 0.16);
  color: var(--success);
}

.drag-handle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(79, 149, 255, 0.1);
  color: var(--muted);
  cursor: grab;
  display: grid;
  place-items: center;
}

.drag-handle svg {
  width: 16px;
  height: 16px;
}

.agenda-card.dragging {
  opacity: 0.56;
}

.priority-1 {
  color: #9eb2c2;
}

.priority-2 {
  color: #e6eaec;
}

.priority-3 {
  color: var(--warning);
}

.priority-4 {
  color: var(--danger);
}

.two-column {
  gap: 12px;
  align-items: flex-start;
}

.two-column > * {
  flex: 1;
}

.form-card,
.insights-card {
  padding: 16px;
}

.form-card.alt {
  background: linear-gradient(180deg, rgba(12, 16, 20, 0.98), rgba(7, 9, 11, 0.98));
}

.form-card.compact {
  margin-bottom: 12px;
}

.panel-head,
.form-actions {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-actions {
  flex-wrap: wrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

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

.form-help {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.form-card-add {
  background: linear-gradient(180deg, rgba(10, 18, 29, 0.98), rgba(6, 12, 21, 0.98));
}

.full-width {
  grid-column: 1 / -1;
}

.form-hint {
  color: var(--muted);
  line-height: 1.45;
}

.weekday-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reminder-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.compact-form {
  display: grid;
  gap: 12px;
}

.weekday-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px 4px 28px;
  min-height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  position: relative;
}

.weekday-pill input,
.reminder-pill input,
.checkbox-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.weekday-pill::before,
.reminder-pill::before,
.checkbox-row::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 10px;
  min-width: 10px;
  height: 10px;
  min-height: 10px;
  margin-top: -5px;
  border-radius: 3px;
  border: 1px solid rgba(148, 182, 255, 0.24);
  background: rgba(7, 12, 20, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.weekday-pill::after,
.reminder-pill::after,
.checkbox-row::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 2px;
  background: transparent;
  transform: scale(0.7);
  transition: background 0.16s ease, transform 0.16s ease;
}

.reminder-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px 4px 29px;
  min-height: 32px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 10px;
  line-height: 1;
  position: relative;
}

.reminder-pill:has(input:checked),
.weekday-pill:has(input:checked),
.checkbox-row:has(input:checked) {
  background: rgba(79, 149, 255, 0.18);
  border-color: rgba(79, 149, 255, 0.32);
}

.weekday-pill:has(input:checked)::before,
.reminder-pill:has(input:checked)::before,
.checkbox-row:has(input:checked)::before {
  border-color: rgba(102, 163, 255, 0.58);
  background: rgba(79, 149, 255, 0.22);
}

.weekday-pill:has(input:checked)::after,
.reminder-pill:has(input:checked)::after,
.checkbox-row:has(input:checked)::after {
  background: linear-gradient(180deg, #9ec5ff, #4f95ff);
  transform: scale(1);
}

.recurrence-details {
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.recurrence-hint {
  margin: -2px 0 0;
}

[data-edit-recurrence-detail="interval"],
[data-edit-recurrence-detail="weekdays"] {
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.stats-grid,
.group-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stats-compact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.stats-compact-grid.one-row {
  grid-auto-flow: column;
  grid-auto-columns: minmax(146px, 1fr);
  grid-template-columns: none;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.stats-compact-grid.one-row::-webkit-scrollbar {
  display: none;
}

.stats-pill {
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.stats-pill span {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-pill strong {
  font-size: 14px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-card,
.group-pill {
  padding: 14px;
}

.advanced-insights-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.advanced-insight-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.advanced-insight-card h3 {
  font-size: 13px;
}

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

.advanced-insight-item {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  padding: 9px 10px;
  border-radius: 14px;
  background: rgba(79, 149, 255, 0.06);
  border: 1px solid rgba(148, 182, 255, 0.08);
}

.stats-search {
  margin: 8px 0 10px;
}

.profile-toolbar {
  display: grid;
  gap: 8px;
  margin: 6px 0 12px;
}

.profile-toolbar-groups {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: stretch;
}

.profile-toolbar-log {
  grid-template-columns: minmax(0, 1fr);
}

.profile-toolbar-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
}

.profile-toolbar-input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
}

.profile-toolbar-button {
  min-height: 42px;
  padding-inline: 16px;
  white-space: nowrap;
}

.notification-filters {
  margin-bottom: 10px;
}

.group-pill.compact {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  min-height: 0;
}

.stats-card span,
.group-pill span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  margin-bottom: 6px;
  font-size: 11px;
}

.stats-card strong,
.group-pill strong {
  font-size: 14px;
}

.group-pill-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.group-pill-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 4px;
}

.group-actions-menu {
  margin-top: 6px;
}

.group-actions-menu summary {
  list-style: none;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  min-height: 40px;
  padding-right: 32px;
}

.group-actions-menu summary::-webkit-details-marker {
  display: none;
}

.group-actions-menu summary::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid rgba(151, 169, 193, 0.92);
  border-bottom: 2px solid rgba(151, 169, 193, 0.92);
  transform: rotate(45deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0.9;
}

.group-actions-menu[open] summary {
  border-color: rgba(102, 163, 255, 0.28);
  background: rgba(79, 149, 255, 0.1);
}

.group-actions-menu[open] summary::after {
  transform: rotate(225deg);
}

.group-actions-menu .dropdown-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
  animation: dropdown-slide 0.18s ease;
}

.group-actions-menu .dropdown-actions .compact-action,
.group-actions-menu .dropdown-actions .primary-button,
.group-actions-menu .dropdown-actions .danger-button {
  width: 100%;
}

@keyframes dropdown-slide {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.task-timeline {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.details-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
  gap: 4px;
}

.details-head .eyebrow {
  margin-bottom: 0;
}

.details-head > div {
  display: grid;
  gap: 0;
}

.inbox-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.inbox-head .ghost-button {
  justify-self: end;
}

.details-head .ghost-button {
  width: auto;
  min-width: 108px;
  max-width: 148px;
  justify-self: start;
  white-space: nowrap;
}

.details-card {
  display: grid;
  gap: 10px;
  width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
  padding-top: 12px;
}

.details-card .panel-head {
  margin-bottom: 0;
}

.panel-head.details-head {
  display: grid;
  width: 100%;
}

.details-meta {
  display: grid;
  gap: 6px;
}

.details-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.details-meta-row > * {
  min-width: 0;
  max-width: 100%;
}

.details-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.details-action-menu {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.details-action-summary {
  position: relative;
  justify-content: flex-start;
  padding-right: 38px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.details-action-summary::-webkit-details-marker {
  display: none;
}

.details-action-summary::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 2px solid rgba(151, 169, 193, 0.92);
  border-bottom: 2px solid rgba(151, 169, 193, 0.92);
  transform: rotate(45deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0.92;
}

.details-action-menu[open] .details-action-summary::after {
  transform: rotate(225deg);
}

.details-actions.compact-menu {
  padding-top: 0;
  animation: dropdown-slide 0.18s ease;
}

.details-actions.compact-menu > * {
  min-width: 0;
  max-width: 100%;
}

.details-block {
  display: grid;
  gap: 7px;
  padding: 11px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.details-note {
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
}

.details-meta .agenda-chip,
.details-meta .agenda-priority {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
}

.details-meta-row.secondary .agenda-chip {
  background: rgba(255, 255, 255, 0.04);
}

.details-action-danger {
  grid-column: auto;
}

.delegate-card,
.delegate-inline {
  display: grid;
  gap: 8px;
}

.details-block,
.details-block > *,
.delegate-card,
.delegate-inline,
.details-effort,
.relation-graph-shell {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.details-card .panel-head,
.details-card .form-actions,
.details-card .inline-form,
.details-card .attachment-item,
.details-card .dependency-item,
.details-card .dependency-copy {
  min-width: 0;
  max-width: 100%;
}

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

.delegate-card-head h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.delegate-card-head span,
.delegate-card-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#profileMeta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.compact-capture-card {
  padding-bottom: 14px;
}

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

.inbox-panel {
  display: grid;
  gap: 10px;
}

.inbox-capture-block {
  gap: 8px;
  padding: 11px;
}

.inbox-capture-head h3 {
  margin: 0 0 4px;
}

.inbox-capture-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.module-debug-card {
  margin-top: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 182, 255, 0.18);
  background: rgba(7, 14, 24, 0.62);
  display: grid;
  gap: 10px;
}

.module-debug-card .profile-section-body {
  margin-top: 0;
}

.module-debug-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-debug-head strong,
.module-debug-head span {
  font-size: 12px;
}

.module-debug-head span {
  color: var(--muted);
}

.module-debug-actions {
  display: flex;
  justify-content: flex-end;
}

.module-debug-actions .ghost-button {
  min-height: 34px;
  padding: 8px 12px;
  font-size: 11px;
}

.insights-heatmap-grid {
  display: grid;
  grid-template-columns: 48px repeat(7, minmax(24px, 1fr));
  gap: 6px;
  align-items: center;
}

.insights-heatmap-head,
.insights-heatmap-hour {
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.insights-heatmap-hour {
  text-align: left;
}

.insights-heatmap-cell {
  min-height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(125, 154, 209, 0.1);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: rgba(245, 249, 255, 0.88);
}

.insights-heatmap-cell.level-1 { background: rgba(72, 124, 228, 0.16); }
.insights-heatmap-cell.level-2 { background: rgba(72, 124, 228, 0.26); }
.insights-heatmap-cell.level-3 { background: rgba(72, 124, 228, 0.4); }
.insights-heatmap-cell.level-4 { background: rgba(95, 163, 255, 0.62); }

.insights-heatmap-cell span {
  line-height: 1;
}

.module-debug-toggle {
  width: 100%;
}

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

.module-debug-grid.muted .module-debug-pill {
  background: rgba(255, 255, 255, 0.02);
}

.module-debug-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.module-debug-pill span,
.module-debug-pill strong {
  font-size: 11px;
}

.module-debug-pill span {
  color: var(--muted);
}

.module-debug-pill.on {
  border-color: rgba(126, 240, 183, 0.24);
}

.module-debug-pill.off {
  border-color: rgba(255, 159, 106, 0.18);
}

.add-panel-head {
  margin-bottom: 10px;
}

.inbox-capture-block textarea,
.details-block input,
.details-block select,
.details-block textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

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

.capture-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 182, 255, 0.1);
  background: linear-gradient(180deg, rgba(17, 28, 42, 0.9), rgba(10, 18, 29, 0.84));
}

.capture-item.converted {
  border-color: rgba(126, 240, 183, 0.16);
}

.capture-item.archived {
  opacity: 0.82;
}

.capture-item-head,
.automation-action-copy {
  display: grid;
  gap: 4px;
}

.capture-item-head span,
.capture-item em,
.automation-action-copy span {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.4;
}

.capture-item-actions,
.automation-action-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.inbox-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.inbox-summary {
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
}

.automation-action-list {
  display: grid;
  gap: 8px;
}

.automation-action-card {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 16px;
  border: 1px solid rgba(148, 182, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

@media (min-width: 721px) {
  .details-head {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .details-head .ghost-button {
    justify-self: end;
  }

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

  .details-action-danger {
    grid-column: 1 / -1;
  }
}

.details-effort {
  display: grid;
}

.effort-pill {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.effort-pill strong {
  font-size: 14px;
}

.effort-pill span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.effort-pill.tone-quick {
  border-color: rgba(122, 235, 174, 0.28);
}

.effort-pill.tone-focus {
  border-color: rgba(111, 165, 255, 0.3);
}

.effort-pill.tone-long {
  border-color: rgba(255, 159, 106, 0.32);
}

.effort-pill.tone-delegatable {
  border-color: rgba(190, 145, 255, 0.32);
}

.focus-layout,
.conflict-layout {
  display: grid;
  gap: 12px;
}

.focus-stack {
  display: grid;
  gap: 10px;
}

.focus-card,
.conflict-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.focus-card-head,
.conflict-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.focus-card-head strong,
.conflict-card-head strong {
  display: block;
  font-size: 15px;
}

.focus-card-head span,
.conflict-card-head span {
  color: var(--muted);
  font-size: 11px;
}

.focus-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.conflict-card-body {
  display: grid;
  gap: 8px;
}

.conflict-side {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.conflict-card-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.overview-utilities .overview-quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.compact-action {
  min-height: 42px;
  padding-inline: 14px;
  width: 100%;
  justify-content: center;
}

.config-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.config-summary-copy {
  display: grid;
  gap: 4px;
}

.config-summary-copy span {
  color: var(--muted);
  font-size: 12px;
}

.config-summary-copy strong {
  font-size: 13px;
}

.overview-drill-card {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.stack-chart-card[data-overview-group],
.overview-graph-node {
  cursor: pointer;
}

.notification-rules-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-toggle.mini {
  min-height: 42px;
  padding: 10px 11px;
}

.compact-toggle.mini .toggle-box {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border-radius: 5px;
}

.compact-toggle.mini .toggle-copy strong {
  font-size: 12px;
}

.template-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.template-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
}

.template-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.template-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-chip {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  min-width: 140px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(19, 30, 46, 0.96), rgba(10, 18, 29, 0.98));
  color: var(--text);
  text-align: left;
}

.template-chip strong {
  font-size: 12px;
}

.template-chip span,
.template-empty {
  color: var(--muted);
  font-size: 11px;
}

.config-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 13;
  padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
}

.config-sheet-panel {
  max-width: 920px;
  margin: 0 auto;
  max-height: calc(100dvh - 56px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 14px;
  border-radius: 26px 26px 18px 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 19, 30, 0.99), rgba(7, 12, 20, 0.99));
  box-shadow: var(--shadow);
}

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

.config-sheet-body {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  overflow: auto;
  padding-right: 2px;
  padding-bottom: 4px;
}

.config-sheet-actions {
  position: sticky;
  bottom: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 182, 255, 0.08);
  background: linear-gradient(180deg, rgba(11, 19, 30, 0.76), rgba(7, 12, 20, 0.98));
}

.task-timeline-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.task-timeline-head span,
.timeline-empty,
.timeline-item span,
.timeline-item em {
  color: var(--muted);
  font-size: 11px;
}

.timeline-list {
  display: grid;
  gap: 7px;
}

.timeline-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.timeline-item strong {
  font-size: 13px;
}

.insight-list {
  margin: 14px 0 0;
  padding-left: 18px;
}

.insight-compact,
.log-compact {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.stats-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.stats-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.stats-section-head strong {
  color: var(--muted);
  font-size: 13px;
  transition: transform 0.18s ease;
}

.stats-section-head.collapsed strong {
  transform: rotate(-90deg);
}

.stats-section + .stats-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.insight-pill,
.log-item {
  padding: 9px 11px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.insight-pill {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.log-item {
  display: grid;
  gap: 4px;
}

.notification-item {
  width: 100%;
  text-align: left;
  padding: 10px 11px;
}

.log-item.unread {
  border-color: rgba(98, 160, 255, 0.32);
  background: linear-gradient(180deg, rgba(98, 160, 255, 0.12), rgba(255, 255, 255, 0.03));
}

.log-item span,
.log-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.log-item strong {
  font-size: 13px;
}

.profile-panel-head {
  justify-content: flex-start;
  margin-bottom: 2px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 12px;
  overflow-x: clip;
}

.profile-card-wide {
  grid-column: 1 / -1;
}

.profile-card:has(.integration-card.compact) {
  display: grid;
  gap: 10px;
}

.profile-card,
.doc-card {
  min-width: 0;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.docs-stack {
  display: grid;
  gap: 6px;
  margin-top: 0;
}

.profile-log-stack {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.data-tools-grid {
  display: grid;
  gap: 10px;
}

.data-tool-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(7, 17, 29, 0.62);
}

.tool-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  align-items: center;
}

.data-tool-card textarea,
.data-tool-card input,
.data-tool-card select {
  width: 100%;
  min-width: 0;
}

.profile-log-item.compact {
  padding: 8px 10px;
  border-radius: 14px;
}

.compact-preferences {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  padding-bottom: 0;
}

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

.module-center-grid {
  margin-top: 10px;
}

.compact-toggle-grid > .filter-label {
  grid-column: 1 / -1;
  margin-bottom: -2px;
}

.compact-toggle {
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 22, 35, 0.98), rgba(10, 17, 28, 0.98));
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  position: relative;
}

.compact-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

.compact-toggle .toggle-box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 7px;
  border: 1px solid rgba(148, 182, 255, 0.22);
  background: rgba(9, 15, 24, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.compact-toggle input:checked + .toggle-box {
  background: linear-gradient(180deg, rgba(109, 168, 255, 0.92), rgba(69, 132, 255, 0.92));
  border-color: rgba(130, 182, 255, 0.7);
  box-shadow: 0 8px 18px rgba(69, 132, 255, 0.2);
}

.compact-toggle .toggle-copy {
  display: grid;
  gap: 2px;
}

.compact-toggle .toggle-copy strong {
  font-size: 13px;
}

.compact-toggle .toggle-copy span {
  color: var(--muted);
  font-size: 11px;
}

.compact-preferences .stats-pill {
  min-height: 0;
  padding: 9px 10px;
  min-width: 0;
}

.profile-section-headline {
  margin-bottom: 10px;
}

.profile-section-toggle {
  width: 100%;
  min-height: 44px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  cursor: pointer;
}

.profile-section-toggle strong {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
  line-height: 1;
  position: relative;
  transition: transform 0.2s ease, color 0.2s ease;
}

.profile-section-toggle strong::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid rgba(151, 169, 193, 0.92);
  border-bottom: 2px solid rgba(151, 169, 193, 0.92);
  transform: rotate(45deg);
}

.profile-section-toggle.collapsed strong {
  transform: rotate(-90deg);
}

.profile-section-body {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 182, 255, 0.08);
  animation: dropdown-slide 0.18s ease;
}

.automation-entry {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.automation-entry-copy {
  display: grid;
  gap: 4px;
  text-align: left;
}

.automation-entry-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.automation-entry-chevron {
  width: 11px;
  height: 11px;
  border-top: 2px solid rgba(210, 223, 247, 0.72);
  border-right: 2px solid rgba(210, 223, 247, 0.72);
  transform: rotate(45deg);
  flex: 0 0 auto;
}

.automation-panel {
  display: grid;
  gap: 14px;
}

.automation-screen-grid {
  display: grid;
  gap: 10px;
}

.automation-screen-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 182, 255, 0.08);
  background: linear-gradient(180deg, rgba(17, 28, 42, 0.9), rgba(10, 18, 29, 0.84));
}

.automation-screen-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.group-shortcut-card.embedded {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.group-bulk-bar-embedded {
  margin-top: 12px;
}

.overview-layout {
  display: grid;
  gap: 10px;
}

.overview-card {
  padding: 13px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 22, 34, 0.92), rgba(9, 16, 27, 0.88));
  box-shadow: var(--shadow);
}

.overview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.overview-head h2 {
  margin: 0;
  font-size: 20px;
}

.overview-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  max-width: 180px;
  text-align: right;
}

.overview-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.chart-shell {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 182, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.chart-caption {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.line-chart {
  width: 100%;
  height: 132px;
  display: block;
}

.line-chart-path {
  stroke: #74a7ff;
  stroke-width: 2.4;
  fill: none;
}

.line-chart-dot {
  fill: #b7d0ff;
}

.chart-axis {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.relation-graph-shell {
  display: grid;
  gap: 10px;
}

.relation-graph-shell.compact {
  gap: 8px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(148, 182, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.relation-graph {
  width: 100%;
  height: 224px;
  display: block;
}

.relation-graph.compact {
  height: 170px;
}

.dependency-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.dependency-copy {
  display: grid;
  gap: 4px;
}

.dependency-copy strong,
.dependency-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.dependency-copy span {
  color: var(--muted);
  white-space: nowrap;
  font-size: 12px;
}

.dependency-copy strong {
  white-space: normal;
  word-break: break-word;
  line-height: 1.32;
}

.dependency-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.dependency-inline .select-shell,
.dependency-inline select {
  min-width: 0;
  width: 100%;
}

.dependency-inline .compact-action {
  min-width: 112px;
}

.relation-node-title {
  fill: rgba(231, 238, 249, 0.92);
  font-size: 10px;
  font-weight: 700;
}

.relation-node-title.dependency-short {
  font-size: 9px;
}

.relation-node-subtitle {
  fill: rgba(151, 169, 193, 0.92);
  font-size: 8px;
  font-weight: 700;
}

.relation-node-status {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.relation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.relation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.relation-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  display: inline-block;
}

.relation-legend.compact {
  gap: 8px;
}

.stack-chart-list {
  display: grid;
  gap: 10px;
}

.stack-chart-card {
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(148, 182, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.stack-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.stack-chart-head strong,
.stack-chart-head span,
.stack-chart-meta span {
  font-size: 12px;
}

.stack-bar {
  height: 10px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.stack-bar-segment {
  display: block;
  height: 100%;
}

.stack-bar-segment.active {
  background: #74a7ff;
}

.stack-bar-segment.overdue {
  background: #ff9f6a;
}

.stack-bar-segment.completed {
  background: #7ef0b7;
}

.stack-chart-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.overview-timeline {
  display: grid;
  gap: 8px;
}

.timeline-bar-row {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 54px;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.timeline-bar-date,
.timeline-bar-values {
  font-size: 11px;
  color: var(--muted);
}

.timeline-bar-values {
  text-align: right;
}

.timeline-bar-track {
  height: 10px;
  position: relative;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.timeline-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
}

.timeline-bar.overdue {
  background: rgba(255, 159, 106, 0.78);
}

.timeline-bar.reopened {
  background: rgba(116, 167, 255, 0.8);
  opacity: 0.72;
}

.chart-empty {
  padding: 20px 14px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 182, 255, 0.14);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 460px) {
  .overview-card {
    padding: 12px;
    border-radius: 20px;
  }

  .overview-head {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
  }

  .overview-head h2 {
    font-size: 18px;
  }

  .overview-note {
    max-width: none;
    text-align: left;
    font-size: 11px;
  }

  .overview-chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-shell {
    padding: 10px;
    border-radius: 16px;
  }

  .relation-graph {
    height: 206px;
  }

  .relation-node-title {
    font-size: 9px;
  }

  .timeline-bar-row {
    grid-template-columns: 48px minmax(0, 1fr) 46px;
    gap: 8px;
  }

  .stack-chart-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .profile-section-toggle {
    gap: 10px;
  }

  .profile-section-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
  }

  .profile-section-toggle h3 {
    margin: 0;
    font-size: 17px;
  }

  .profile-log-stack {
    gap: 6px;
  }

  .log-item {
    padding: 8px 10px;
    border-radius: 12px;
  }

  .automation-entry {
    padding: 12px 14px;
    border-radius: 18px;
  }

  .automation-entry-copy strong {
    font-size: 14px;
  }

  .compact-toggle-grid {
    grid-template-columns: 1fr;
  }

  .dependency-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .dependency-remove {
    width: 100%;
  }
}

.doc-card strong {
  display: block;
  margin-bottom: 0;
}

.doc-card {
  padding: 0;
  overflow: hidden;
}

.docs-stack .doc-card,
.profile-log-stack .log-item {
  border: 1px solid rgba(108, 146, 216, 0.18);
  background: rgba(12, 18, 29, 0.78);
  box-shadow: inset 0 1px 0 rgba(167, 198, 255, 0.04);
}

.doc-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.doc-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 11px 12px;
  cursor: pointer;
}

.doc-toggle-copy {
  min-width: 0;
  flex: 1;
  text-align: left;
}

.doc-toggle-copy strong {
  font-size: 13px;
  line-height: 1.3;
}

.doc-toggle-chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid rgba(151, 169, 193, 0.92);
  border-bottom: 2px solid rgba(151, 169, 193, 0.92);
  transform: rotate(45deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
  opacity: 0.88;
}

.doc-toggle:hover .doc-toggle-chevron {
  opacity: 1;
}

.doc-card:has(.doc-body.hidden) .doc-toggle-chevron {
  transform: rotate(45deg);
}

.doc-card:not(:has(.doc-body.hidden)) .doc-toggle-chevron {
  transform: rotate(225deg);
}

.doc-body {
  margin-top: 0;
  padding: 0 12px 11px;
  border-top: 1px solid rgba(148, 182, 255, 0.08);
  animation: dropdown-slide 0.18s ease;
}

.profile-log-stack {
  gap: 8px;
}

.profile-log-stack .log-item {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border-radius: 16px;
}

.profile-log-stack .log-item span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.profile-log-stack .log-item strong {
  font-size: 13px;
  line-height: 1.35;
}

.profile-log-stack .log-item em {
  color: rgba(149, 173, 206, 0.86);
  font-size: 11px;
  font-style: normal;
}

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

.dependency-inline {
  margin-top: 10px;
  align-items: stretch;
}

.dependency-inline .select-shell,
.dependency-inline select {
  flex: 1 1 auto;
}

.dependency-inline .compact-action {
  flex: 0 0 auto;
}

.dependency-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dependency-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.dependency-copy strong,
.dependency-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dependency-remove {
  min-width: 88px;
}

.attachment-preview-list {
  display: grid;
  gap: 8px;
}

.attachment-preview-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.attachment-preview-thumb {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(79, 149, 255, 0.12);
  border: 1px solid rgba(148, 182, 255, 0.12);
}

.attachment-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.attachment-file-glyph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
}

.attachment-preview-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.attachment-preview-meta strong,
.attachment-preview-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-preview-meta span,
.attachment-preview-empty {
  color: var(--muted);
  font-size: 12px;
}

.attachment-preview-remove {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  background: rgba(255, 121, 121, 0.12);
  color: #ffd0d0;
}

.attachment-item,
.attachment-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.attachment-item a {
  color: var(--text);
  text-decoration: none;
  word-break: break-word;
}

.attachment-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.danger-zone {
  margin-top: 18px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 109, 109, 0.18);
  background: rgba(255, 109, 109, 0.05);
}

.danger-zone strong {
  display: block;
  margin-bottom: 6px;
}

.danger-zone p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.45;
}

.danger-button {
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 109, 109, 0.22);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 109, 109, 0.14), rgba(255, 109, 109, 0.08));
  color: #ffd0d0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(70, 15, 20, 0.16);
}

.bottom-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  border-radius: 28px;
  background: rgba(7, 12, 20, 0.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dock-action {
  min-height: 54px;
  border-radius: 20px;
  padding: 8px 6px;
  display: grid;
  place-items: center;
  gap: 4px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.dock-badge {
  position: absolute;
  top: 7px;
  right: 10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #69a8ff, #3f89ff);
  color: #f8fbff;
  font-size: 9px;
  font-weight: 800;
  box-shadow: 0 8px 16px rgba(63, 137, 255, 0.22);
  z-index: 2;
}

.dock-action.dock-primary {
  background: rgba(79, 149, 255, 0.14);
}

.dock-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 149, 255, 0.08);
  border: 1px solid rgba(148, 182, 255, 0.12);
  font-size: 13px;
  line-height: 1;
}

.dock-icon svg {
  width: 15px;
  height: 15px;
  display: block;
}

.dock-action.active .dock-icon,
.dock-action.dock-primary .dock-icon {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.14);
}

.dock-action::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(125, 176, 255, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
}

.dock-action.active::after,
.dock-action:hover::after {
  opacity: 1;
}

.dock-label {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.dock-indicator {
  position: absolute;
  left: 0;
  bottom: 8px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7db0ff, rgba(125, 176, 255, 0.28));
  transition: transform 180ms ease, width 180ms ease;
}

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(9, 15, 24, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 20;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 11;
}

.empty-state {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  padding: 26px 18px;
  border-radius: 24px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 14px;
}

.empty-state span {
  max-width: 280px;
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .stats-grid,
  .group-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .stats-compact-grid.one-row {
    grid-auto-columns: minmax(132px, 1fr);
    grid-template-columns: none;
  }

  .advanced-insights-grid {
    gap: 8px;
  }

  .advanced-insight-card {
    padding: 11px;
  }

  .advanced-insight-item {
    font-size: 11px;
    padding: 8px 9px;
  }

  .two-column {
    flex-direction: column;
  }

  .hero-card-wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .week-calendar-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .topbar {
    align-items: center;
  }

  .top-tabs {
    display: none;
  }

  .filter-row,
  .agenda-title-row,
  .selection-bar,
  .summary-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .segmented {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .chip {
    flex: 0 0 auto;
  }

  .filter-card {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    margin: 0;
    z-index: 12;
    max-height: 68vh;
    overflow: auto;
    transform: translateY(115%);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border-radius: 24px;
  }

  .filter-card.sheet-open {
    transform: translateY(0);
    opacity: 1;
  }

  .agenda-content {
    gap: 8px;
  }

  .agenda-time {
    width: 68px;
    flex-basis: 68px;
    padding-right: 8px;
  }

  .agenda-title {
    font-size: 14px;
  }

  .profile-copy strong {
    font-size: 14px;
  }

  .profile-card-grid {
    grid-template-columns: 1fr;
  }

  .compact-preferences {
    grid-template-columns: 1fr 1fr;
  }

.group-shortcut-card .inline-form {
  grid-template-columns: minmax(0, 1fr);
}

  .dock-icon {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: calc(178px + env(safe-area-inset-bottom));
  }

  .tab-panel.active {
    padding-bottom: 42px;
  }

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

  .profile-entry {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }

  .topbar-actions {
    display: flex;
    flex-direction: row;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .topbar-actions > * {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    flex: 0 0 42px;
  }

  .hero-card-wide {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
  }

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

  .stats-compact-grid.one-row {
    grid-auto-columns: minmax(124px, 1fr);
    grid-template-columns: none;
  }

  .hero-card {
    min-height: 62px;
  }

  .agenda-content {
    padding: 9px;
  }

  .agenda-title-row {
    padding-right: 47px;
  }

  .agenda-side {
    right: 8px;
  }

  .agenda-meta-row,
  .agenda-footer {
    gap: 6px;
  }

  .agenda-meta-row {
    gap: 5px;
  }

  .agenda-title-row {
    gap: 8px;
  }

  .agenda-priority {
    min-width: 34px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .agenda-time {
    width: 58px;
    flex-basis: 58px;
    font-size: 10px;
  }

  .agenda-time.compact {
    width: 58px;
    flex-basis: 58px;
    padding-right: 8px;
  }

  .agenda-time.compact strong {
    font-size: 9px;
  }

  .agenda-time.compact span {
    font-size: 8px;
  }

  .filter-card,
  .form-card,
  .insights-card {
    padding: 14px;
  }

  .notification-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .profile-toolbar {
    gap: 7px;
    margin: 4px 0 10px;
  }

  .profile-toolbar-groups {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
    align-items: stretch;
  }

  .profile-toolbar-form {
    grid-template-columns: minmax(82px, 1fr) 40px;
    gap: 6px;
  }

  .profile-toolbar-input,
  .profile-toolbar-button {
    min-height: 40px;
  }

  .profile-toolbar-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
    overflow: hidden;
    color: transparent;
    font-size: 0;
    position: relative;
  }

  .profile-toolbar-button::before {
    content: "+";
    color: var(--text);
    font-size: 20px;
    line-height: 1;
  }

  .notification-filters .chip {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 11px;
    justify-content: center;
    text-align: center;
  }

  .profile-section-body {
    margin-top: 4px;
    padding-top: 8px;
  }

  .docs-stack {
    gap: 5px;
    margin-top: 0;
  }

  .doc-toggle {
    padding: 10px 11px;
    gap: 8px;
  }

  .doc-toggle-copy strong {
    font-size: 12px;
  }

  .doc-body {
    padding: 0 11px 10px;
  }

  .doc-card p {
    font-size: 11px;
    line-height: 1.45;
  }

  .profile-log-stack {
    gap: 6px;
  }

  .notification-item,
  .log-item {
    padding: 8px 9px;
    border-radius: 13px;
  }

  .notification-item strong,
  .log-item strong {
    font-size: 12px;
    line-height: 1.3;
  }

  .notification-item span,
  .notification-item em,
  .log-item span,
  .log-item em {
    font-size: 10px;
    line-height: 1.25;
  }

  .details-card {
    gap: 8px;
    padding-top: 8px;
  }

  .details-card .panel-head {
    margin-bottom: 0;
  }

  .details-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 4px;
  }

  .inbox-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .panel-head.details-head {
    align-items: stretch;
  }

  .details-head h2 {
    font-size: 18px;
    line-height: 1.04;
    word-break: break-word;
    margin-top: 0;
  }

  .details-head .ghost-button {
    width: auto;
    min-width: 0;
    max-width: 108px;
    min-height: 34px;
    padding-inline: 10px;
    align-self: start;
    justify-self: end;
  }

  .inbox-head .ghost-button {
    width: auto;
    min-width: 0;
    max-width: 122px;
    justify-self: end;
  }

  .inbox-panel {
    gap: 8px;
  }

  .inbox-capture-block {
    gap: 7px;
    padding: 10px;
  }

  .details-meta {
    gap: 5px;
  }

  .details-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 5px;
  }

  .details-meta-row.primary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details-meta-row.secondary {
    display: grid;
    grid-template-columns: 1fr;
  }

  .details-meta .agenda-chip,
  .details-meta .agenda-priority {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-height: 28px;
    padding: 5px 7px;
    font-size: 9px;
  }

  .details-action-summary {
    width: 100%;
    min-height: 34px;
    padding: 8px 34px 8px 11px;
    font-size: 12px;
  }

  .details-action-menu,
  .details-action-menu[open] {
    gap: 6px;
  }

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

  .details-actions .compact-action,
  .details-actions .ghost-button,
  .details-actions .primary-button,
  .details-actions .danger-button {
    width: 100%;
    min-height: 36px;
    padding: 8px 9px;
    font-size: 12px;
  }

  .details-action-danger {
    grid-column: 1 / -1;
  }

  .details-action-menu,
  .details-action-menu[open],
  .details-actions,
  .details-block,
  .details-block input,
  .details-block select,
  .details-block textarea,
  .details-block button,
  .details-block .attachment-list,
  .details-block .timeline-list,
  .dependency-inline,
  .dependency-inline .select-shell,
  .dependency-inline select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .dependency-inline {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dependency-item {
    grid-template-columns: 1fr;
    align-items: stretch;
    padding: 8px 9px;
  }

  .dependency-inline .compact-action,
  .dependency-remove {
    width: 100%;
    min-width: 0;
  }

  .dependency-copy strong {
    font-size: 12px;
    line-height: 1.32;
    word-break: break-word;
  }

  .details-block {
    gap: 6px;
    padding: 9px 10px;
  }

  .details-block h3 {
    font-size: 13px;
  }

  .delegate-card-head h3 {
    font-size: 12px;
  }

  .delegate-card-head span,
  .delegate-card-meta,
  .dependency-copy span {
    font-size: 11px;
  }

  .delegate-card-head span,
  .delegate-card-meta {
    white-space: normal;
    word-break: break-word;
  }

  .details-card {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  .insights-heatmap-grid {
    grid-template-columns: 42px repeat(7, minmax(20px, 1fr));
    gap: 4px;
  }

  .insights-heatmap-cell {
    min-height: 22px;
    border-radius: 8px;
    font-size: 9px;
  }

  .relation-graph-shell {
    overflow: hidden;
    padding: 9px;
    border-radius: 16px;
  }

  .relation-graph {
    width: 100%;
    height: auto;
  }

  .relation-graph.compact {
    height: 136px;
  }

  .group-shortcut-card {
    padding: 9px 10px;
  }

  .group-shortcut-card.embedded {
    margin-top: 4px;
  }

  .group-shortcut-card .inline-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }

  .group-shortcut-card .inline-form .ghost-button,
  .group-shortcut-card .inline-form .primary-button {
    min-width: 96px;
    min-height: 38px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .group-grid {
    gap: 7px;
    margin-top: 10px;
  }

  .group-pill.compact {
    gap: 4px;
    padding: 9px 10px;
    border-radius: 18px;
  }

  .group-pill span,
  .group-pill-meta {
    font-size: 10px;
    margin-bottom: 0;
  }

  .group-pill strong {
    font-size: 13px;
    line-height: 1.18;
  }

  .group-actions-menu {
    margin-top: 5px;
  }

  .group-actions-menu summary {
    min-height: 36px;
    padding-right: 30px;
  }

  .group-actions-menu summary::after {
    right: 14px;
    width: 7px;
    height: 7px;
  }

  .group-actions-menu .dropdown-actions {
    gap: 5px;
    margin-top: 5px;
  }

  .group-actions-menu .dropdown-actions .compact-action,
  .group-actions-menu .dropdown-actions .primary-button,
  .group-actions-menu .dropdown-actions .danger-button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 12px;
  }

  .agenda-card.no-time-card .agenda-content {
    gap: 6px;
    padding: 9px;
  }

  .agenda-card.no-time-card .agenda-time {
    width: 58px;
    flex-basis: 58px;
    padding-right: 6px;
  }

  .agenda-card.no-time-card .agenda-time.compact strong {
    font-size: 9px;
    line-height: 1.14;
  }

  .agenda-card.no-time-card .agenda-time.compact span {
    font-size: 8px;
  }

  .delegate-card-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .delegate-card-head .compact-action {
    width: 100%;
  }

  .delegate-inline {
    grid-template-columns: 1fr;
  }

  .focus-card-actions,
  .overview-utilities .overview-quick-actions {
    grid-template-columns: 1fr;
  }

  .details-block {
    gap: 7px;
    padding: 10px;
    border-radius: 16px;
  }

  .details-block h3 {
    font-size: 13px;
  }

  .details-note {
    font-size: 11px;
    line-height: 1.4;
  }

  .timeline-list {
    gap: 6px;
  }

  .timeline-item {
    padding: 7px 9px;
    border-radius: 13px;
  }

  .timeline-item strong {
    font-size: 11px;
  }

  .relation-graph-shell.compact {
    padding: 9px;
    border-radius: 15px;
  }

  .relation-graph.compact {
    height: 132px;
  }

  .relation-legend.compact {
    gap: 6px;
    font-size: 10px;
  }

  .dependency-inline {
    gap: 8px;
  }

  .topbar-actions {
    width: auto;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    flex: 0 0 auto;
  }

  .topbar-actions > * {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    flex: 0 0 42px;
  }

  .icon-button.topbar-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    max-height: 42px;
    border-radius: 16px;
  }

  .topbar-icon-button svg {
    width: 18px;
    height: 18px;
    margin: auto;
    transform: translateY(0);
  }

  .bottom-dock {
    gap: 6px;
    padding: 7px;
  }

  .dock-action {
    min-height: 50px;
    border-radius: 18px;
  }

  .dock-label {
    font-size: 10px;
  }

  .dock-badge {
    top: 6px;
    right: 8px;
    min-width: 14px;
    height: 14px;
    font-size: 8px;
  }

  .weekday-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .reminder-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .weekday-pill {
    min-height: 28px;
    padding: 4px 6px 4px 22px;
    font-size: 8px;
  }

  .reminder-pill {
    min-height: 28px;
    padding: 4px 6px 4px 22px;
    font-size: 8px;
  }

  .weekday-pill::before,
  .reminder-pill::before,
  .checkbox-row::before {
    left: 6px;
    width: 8px;
    min-width: 8px;
    height: 8px;
    min-height: 8px;
    margin-top: -4px;
    border-radius: 2px;
  }

  .weekday-pill::after,
  .reminder-pill::after,
  .checkbox-row::after {
    width: 4px;
    height: 4px;
    margin-top: -2px;
    left: 8px;
  }

  .profile-hero {
    align-items: flex-start;
  }

  .module-debug-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .timeline-bar-row {
    grid-template-columns: 48px minmax(0, 1fr) 42px;
    gap: 8px;
  }

  .focus-card,
  .conflict-card {
    padding: 10px;
    border-radius: 16px;
  }

  .focus-card-head strong,
  .conflict-card-head strong {
    font-size: 13px;
  }

  .conflict-card-note,
  .effort-pill span {
    font-size: 11px;
  }

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

  .module-center-grid {
    grid-template-columns: 1fr;
  }

  .profile-avatar.large {
    width: 50px;
    height: 50px;
    border-radius: 20px;
    flex-basis: 50px;
  }

  .stats-pill {
    padding: 9px 10px;
  }

  .integration-card.compact .integration-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .integration-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .integration-actions > * {
    width: 100%;
  }

  .config-summary-card,
  .config-sheet-head {
    flex-direction: column;
    align-items: stretch;
  }

  .config-sheet-actions {
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    padding-top: 8px;
  }

  .config-sheet-actions > * {
    flex: 1 1 0;
    min-height: 44px;
  }

  .config-sheet-panel {
    max-height: calc(100dvh - 92px);
    padding: 12px;
  }

  .config-sheet-body {
    gap: 8px;
    margin: 10px 0;
  }

  .config-sheet-body .weekday-grid,
  .config-sheet-body .reminder-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .config-sheet-body .weekday-pill,
  .config-sheet-body .reminder-pill {
    min-height: 30px;
    justify-content: center;
    padding-left: 20px;
  }

  .group-actions-menu summary {
    min-height: 40px;
  }

  .group-actions-menu summary::after {
    right: 14px;
    width: 7px;
    height: 7px;
    margin-top: -5px;
  }

  .config-sheet-body .form-hint,
  .config-sheet-body .form-help {
    font-size: 10px;
    line-height: 1.35;
  }

  .capture-actions,
  .capture-item-actions,
  .automation-action-buttons {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 821px) {
  .week-calendar {
    grid-template-columns: repeat(7, minmax(200px, 1fr));
    align-items: start;
    overflow-x: auto;
  }

  .bottom-dock {
    left: 50%;
    right: auto;
    width: min(760px, calc(100vw - 32px));
    transform: translateX(-50%);
  }

  .sheet-backdrop {
    display: none !important;
  }
}
.integration-stack {
  display: grid;
  gap: 10px;
}

.integration-card {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.integration-card.compact {
  padding: 12px 12px 11px;
}

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

.integration-head strong {
  min-width: 0;
  flex: 1;
}

.integration-actions {
  margin-top: 12px;
}

.integration-card.compact .integration-head {
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.integration-card.compact label {
  display: grid;
  gap: 6px;
}

.group-shortcut-card {
  padding: 10px 11px;
}

.group-shortcut-card.embedded {
  margin-top: 6px;
}

.group-shortcut-card .inline-form {
  margin-top: 0;
  align-items: stretch;
}

.group-shortcut-card .form-hint {
  margin-top: 10px;
}

.integration-actions > * {
  flex: 1;
}

.integration-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
}

.integration-badge.connected {
  color: var(--success);
  border-color: rgba(116, 242, 181, 0.26);
  background: rgba(116, 242, 181, 0.08);
}

.integration-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 0;
  min-height: 48px;
  padding: 12px 14px 12px 38px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  position: relative;
}

.checkbox-row input {
  flex: 0 0 auto;
}

.checkbox-row::before {
  left: 14px;
}

.checkbox-row::after {
  left: 16px;
}

.checkbox-row span {
  display: block;
  min-width: 0;
  line-height: 1.4;
}

.integration-card.compact .checkbox-row {
  margin-top: 8px;
  padding-right: 12px;
}

.integration-card.compact .checkbox-row span {
  font-size: 13px;
}

.group-shortcut-card .inline-form {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.group-shortcut-card .inline-form .ghost-button,
.group-shortcut-card .inline-form .primary-button {
  min-width: 112px;
}
