:root {
  color-scheme: light;
  --bg: #f6f7f5;
  --bg-alt: #eef1ec;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --text: #19352f;
  --muted: #5f706b;
  --line: rgba(25, 53, 47, 0.12);
  --brand: #10403b;
  --brand-soft: #e5f0ed;
  --accent: #d97d54;
  --success: #227e63;
  --danger: #a13a30;
  --shadow: 0 1px 2px rgba(16, 64, 59, 0.06);
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 8px;
  --max-width: 1280px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

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

a {
  color: inherit;
}

button {
  cursor: pointer;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-card h1 {
  margin: 0;
}

.auth-card label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.auth-error {
  margin: 0;
  color: var(--danger);
  font-weight: 700;
}

.current-user {
  display: inline-flex;
  align-items: center;
  padding: 12px 0;
  color: var(--muted);
  font-weight: 700;
}

.notification-button {
  position: relative;
}

.notification-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf7;
  font-size: 0.78rem;
}

.notification-count.is-empty {
  background: rgba(16, 64, 59, 0.12);
  color: var(--brand);
}

.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.topbar h1 {
  font-size: clamp(1.2rem, 2.4vw, 1.7rem);
  line-height: 1.05;
}

.topbar-actions,
.action-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-search {
  min-width: min(100%, 280px);
  max-width: 340px;
}

.top-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: none;
  position: sticky;
  top: 8px;
  z-index: 20;
}

.topbar h1,
.hero-card h2,
.section-heading h2,
.section-heading h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

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

.hero-card,
.surface-card,
.stat-card {
  backdrop-filter: none;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-xl);
  background: #ffffff;
  color: var(--text);
}

.hero-card .muted,
.hero-card .eyebrow {
  color: var(--muted);
}

.stats-grid,
.split-section,
.dashboard-plan-grid,
.dashboard-quick-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.workspace-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.mini-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-card,
.surface-card {
  border-radius: var(--radius-lg);
}

.stat-card {
  padding: 12px;
}

.stat-card strong {
  display: block;
  font-size: 1.15rem;
  margin-top: 4px;
}

.surface-card {
  padding: 14px;
}

.section-copy {
  margin: 0;
}

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

.dashboard-quick-entry {
  margin-top: 0;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

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

.compact-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

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

.form-fieldset {
  margin: 0;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 64, 59, 0.08);
  background: rgba(16, 64, 59, 0.04);
}

.form-fieldset legend {
  padding: 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
}

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

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.checkbox-card input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(16, 64, 59, 0.1);
  font-size: 0.98rem;
  font-weight: 800;
}

.checkbox-pill input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.compact-muted {
  margin: 0 0 10px;
}

.compact-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.compact-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.timeline-lines .compact-line {
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
}

.history-section + .history-section {
  margin-top: 14px;
}

.checkbox-card-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.checkbox-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--user-color, var(--brand));
}

.form-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

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

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

textarea {
  resize: vertical;
}

.compact-input {
  max-width: 180px;
  padding: 10px 12px;
}

.primary-button,
.ghost-button,
.tiny-button {
  border: 0;
  border-radius: var(--radius-sm);
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
  text-decoration: none;
}

.primary-button:hover,
.ghost-button:hover,
.tiny-button:hover,
.nav-item:hover {
  transform: translateY(-1px);
}

.primary-button {
  padding: 11px 14px;
  background: var(--accent);
  color: #fffaf7;
  font-weight: 700;
}

.ghost-button {
  padding: 10px 12px;
  background: rgba(16, 64, 59, 0.08);
  color: var(--brand);
  font-weight: 700;
}

.tiny-button-danger {
  background: rgba(163, 44, 34, 0.12);
  color: #9a2b24;
}

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

.inline-create-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(16, 64, 59, 0.08);
}

.fold-card {
  margin-top: 10px;
}

.fold-card[open] .fold-summary {
  margin-bottom: 12px;
}

.fold-summary {
  list-style: none;
  cursor: pointer;
}

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

.fold-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fold-summary > div::after {
  content: "+";
  display: inline-flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(16, 64, 59, 0.08);
  color: var(--brand);
  font-weight: 800;
  font-size: 1.2rem;
}

.fold-card[open] .fold-summary > div::after {
  content: "−";
}

.fold-body {
  display: grid;
  gap: 10px;
}

.subtle-card {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.workspace-card {
  min-width: 0;
}

.workspace-list-card,
.workspace-detail-card {
  height: fit-content;
}

.auxiliary-list.is-hidden {
  display: none;
}

.inline-form-section {
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(16, 64, 59, 0.05);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.compact-heading {
  margin-bottom: 12px;
}

.jobs-priority-sections {
  display: grid;
  gap: 10px;
}

.jobs-priority-section {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.priority-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.priority-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.priority-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.priority-dot-high {
  background: #c44b3f;
}

.priority-dot-medium {
  background: #d97d54;
}

.priority-dot-low {
  background: #227e63;
}

.priority-count {
  color: var(--muted);
  font-weight: 700;
}

.job-detail-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.job-detail-grid {
  display: grid;
  gap: 10px;
}

.job-detail-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.job-main-entry-card {
  margin: 12px 0;
  background: #f8fbf8;
  border-color: rgba(16, 64, 59, 0.2);
}

.job-detail-more {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.inline-fold {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

.inline-fold .fold-summary {
  padding: 0;
}

.inline-fold .fold-body {
  padding-top: 10px;
}

.photo-group + .photo-group {
  margin-top: 18px;
}

.compact-detail-form {
  margin-bottom: 16px;
}

.job-note-card {
  border-left: 4px solid var(--accent);
}

.job-work-item-card {
  border-left: 4px solid var(--success);
}

.job-task-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
}

.job-task-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--success);
}

.job-task-card.is-done {
  opacity: 0.72;
}

.job-task-card.is-done h4,
.job-task-card.is-done p {
  text-decoration: line-through;
}

.list-card {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.job-list-card {
  display: grid;
  gap: 10px;
}

.job-list-card.is-selected {
  border-color: rgba(16, 64, 59, 0.42);
  box-shadow: inset 4px 0 0 var(--brand);
}

.job-list-card .list-card-header {
  align-items: flex-start;
}

.job-list-finance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.job-list-finance span {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 64, 59, 0.05);
}

.customer-detail {
  margin-top: 16px;
}

.detail-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.detail-card h4,
.detail-card p {
  margin: 0;
}

.detail-card p + p {
  margin-top: 6px;
}

.mini-stat {
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.mini-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 1.1rem;
}

.timeline-card {
  border-left: 4px solid var(--brand-soft);
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.material-lines {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.material-lines-empty {
  margin-top: 14px;
}

.material-line {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(150px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(16, 64, 59, 0.05);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.material-line strong,
.material-line span,
.material-line-totals span {
  display: block;
}

.material-line span,
.material-line-totals span {
  color: var(--muted);
  font-size: 0.88rem;
}

.material-line-totals {
  display: grid;
  gap: 4px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-thumb {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(16, 64, 59, 0.05);
  border: 1px solid rgba(16, 64, 59, 0.08);
}

.photo-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
}

.photo-thumb figcaption {
  min-height: 2.4em;
  color: var(--muted);
  font-size: 0.85rem;
}

.team-calendar-card {
  border-left: 5px solid var(--user-color, var(--brand));
}

.activity-card {
  border-left: 5px solid var(--accent);
}

.activity-own {
  border-left-color: var(--brand-soft);
}

.inline-list {
  margin-top: 16px;
}

.list-card-header,
.badge-row,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-meta {
  justify-content: flex-start;
}

.list-card h4,
.list-card p {
  margin: 0;
}

.list-card h4 {
  font-size: 1rem;
}

.list-card p + p {
  margin-top: 6px;
}

.badge-row {
  justify-content: flex-start;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  font-weight: 700;
}

.badge-brand {
  background: var(--brand-soft);
  color: var(--brand);
}

.user-badge {
  background: color-mix(in srgb, var(--user-color, var(--brand)) 18%, white);
  color: var(--user-color, var(--brand));
}

.badge-accent {
  background: rgba(217, 125, 84, 0.14);
  color: #a45533;
}

.badge-success {
  background: rgba(34, 126, 99, 0.12);
  color: var(--success);
}

.badge-danger {
  background: rgba(161, 58, 48, 0.12);
  color: var(--danger);
}

.tiny-button {
  padding: 8px 10px;
  background: rgba(16, 64, 59, 0.08);
  color: var(--brand);
  font-weight: 700;
}

.tiny-button.is-active {
  background: var(--brand);
  color: #fff;
}

.tiny-button-success {
  background: rgba(34, 126, 99, 0.14);
  color: var(--success);
}

.icon-button {
  min-width: 46px;
  padding-inline: 0;
}

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

.calendar-quick-actions {
  margin-top: 12px;
}

.repeatable-fieldset {
  display: grid;
  gap: 12px;
}

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

.repeatable-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(110px, 0.7fr) auto;
  align-items: end;
  gap: 10px;
}

.archived-jobs-section {
  background: rgba(16, 64, 59, 0.04);
}

.is-hidden {
  display: none;
}

.nav-item {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
  font-weight: 700;
}

.nav-item.is-active {
  background: var(--brand);
  color: #f6faf9;
}

.calendar-toolbar {
  display: grid;
  gap: 12px;
}

.calendar-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.segmented-control {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(16, 64, 59, 0.08);
}

.segment-button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  font-weight: 700;
}

.segment-button.is-active {
  background: var(--brand);
  color: #f6faf9;
}

.calendar-title {
  min-width: 180px;
  font-weight: 800;
  color: var(--brand);
}

.calendar-layout {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.calendar-grid {
  display: grid;
  gap: 12px;
}

.calendar-weekdays,
.calendar-month-grid,
.calendar-week-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
  padding: 0 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.calendar-day-cell,
.calendar-week-column,
.calendar-day-panel {
  border: 1px solid rgba(16, 64, 59, 0.1);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
}

.calendar-day-cell {
  min-height: 126px;
  padding: 10px;
  text-align: left;
}

.calendar-layout.is-month-detail-view .calendar-day-cell {
  min-height: 82px;
  padding: 7px;
}

.calendar-layout.is-month-detail-view .calendar-month-grid,
.calendar-layout.is-month-detail-view .calendar-weekdays {
  gap: 6px;
}

.calendar-layout.is-month-detail-view .calendar-day-cell .calendar-items {
  gap: 4px;
  margin-top: 6px;
}

.calendar-layout.is-month-detail-view .calendar-day-cell .calendar-chip {
  padding: 4px 6px;
  font-size: 0.76rem;
}

.calendar-layout.is-month-detail-view .calendar-day-cell .calendar-day-number {
  width: 26px;
  height: 26px;
}

.calendar-day-cell.is-other-month {
  opacity: 0.52;
}

.calendar-day-cell.is-today,
.calendar-week-column.is-today,
.calendar-day-panel.is-today {
  border-color: rgba(217, 125, 84, 0.48);
  box-shadow: inset 0 0 0 1px rgba(217, 125, 84, 0.18);
}

.calendar-day-cell.is-selected,
.calendar-week-column.is-selected,
.calendar-day-panel.is-selected {
  border-color: rgba(16, 64, 59, 0.32);
  box-shadow: inset 0 0 0 2px rgba(16, 64, 59, 0.12);
}

.calendar-day-number {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(16, 64, 59, 0.08);
  font-weight: 800;
}

.calendar-day-cell.is-today .calendar-day-number,
.calendar-week-column.is-today .calendar-day-number,
.calendar-day-panel.is-today .calendar-day-number {
  background: var(--accent);
  color: #fffaf7;
}

.calendar-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.calendar-chip {
  display: block;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: rgba(16, 64, 59, 0.08);
  font-size: 0.86rem;
  color: var(--text);
}

.calendar-chip.is-task {
  background: rgba(217, 125, 84, 0.14);
}

.calendar-chip.is-job {
  background: rgba(16, 64, 59, 0.14);
  border-left: 4px solid var(--brand);
}

.calendar-chip.is-service {
  background: rgba(34, 126, 99, 0.12);
}

.calendar-chip-more {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
}

.calendar-week-column,
.calendar-day-panel {
  padding: 12px;
}

.calendar-layout.is-detail-view .calendar-grid > .calendar-day-panel {
  min-height: auto;
}

.calendar-layout.is-detail-view .calendar-grid .calendar-column-header {
  margin-bottom: 8px;
}

.calendar-layout.is-detail-view .calendar-grid .calendar-day-number {
  width: 42px;
  height: 42px;
}

.calendar-layout.is-detail-view .calendar-grid .calendar-items {
  margin-top: 8px;
}

.calendar-layout.is-detail-view .calendar-chip {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.95rem;
}

.calendar-layout.is-detail-view .calendar-week-grid {
  grid-template-columns: 1fr;
}

.calendar-layout.is-detail-view .calendar-week-column {
  min-height: auto;
  padding: 10px;
}

.calendar-add-fold {
  margin-top: 12px;
}

.calendar-week-column {
  min-height: 280px;
}

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

.calendar-detail-card {
  border-left: 4px solid var(--brand);
}

.calendar-detail-card.task {
  border-left-color: var(--accent);
}

.calendar-detail-card.job {
  border-left-color: var(--brand);
}

.calendar-detail-card.service {
  border-left-color: var(--success);
}

.calendar-empty-note {
  margin: 0;
  color: var(--muted);
}

.empty-state {
  padding: 18px 12px;
  border: 1px dashed rgba(16, 64, 59, 0.16);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.empty-title {
  margin: 0 0 6px;
  font-weight: 800;
}

.card-meta {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (min-width: 860px) {
  .app-shell {
    padding: 18px 20px 36px;
  }

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

  .dashboard-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .dashboard-plan-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }

  .calendar-layout {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
  }

  .calendar-layout.is-month-detail-view {
    grid-template-columns: minmax(460px, 1.05fr) minmax(420px, 0.95fr);
    align-items: start;
  }

  .calendar-layout.is-detail-view {
    grid-template-columns: minmax(260px, 0.58fr) minmax(0, 1.42fr);
    align-items: start;
  }

  .workspace-grid.contacts-workspace {
    grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.35fr);
    align-items: start;
  }

  .workspace-grid.jobs-workspace {
    grid-template-columns: minmax(340px, 0.82fr) minmax(0, 1.45fr);
    align-items: start;
  }

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

  .hero-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .action-row {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
  }

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

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

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

  .compact-input {
    max-width: none;
  }

  .topbar-actions,
  .action-row,
  .filter-row,
  .calendar-toolbar-row {
    width: 100%;
  }

  .topbar-actions > *,
  .action-row > *,
  .filter-row > *,
  .calendar-toolbar-row > * {
    flex: 1 1 140px;
  }

  .job-list-finance {
    grid-template-columns: 1fr;
  }

  .fold-summary > div {
    align-items: flex-start;
  }

  .material-line {
    grid-template-columns: 1fr;
  }

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

  .prep-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .prep-row .tiny-button {
    width: 100%;
  }

  .calendar-weekdays,
  .calendar-month-grid,
  .calendar-week-grid {
    grid-template-columns: 1fr;
  }

  .job-snapshot,
  .compact-line {
    grid-template-columns: 1fr;
  }

  .calendar-detail-card .list-card-header,
  .plan-job-editor .section-heading {
    align-items: flex-start;
  }

  .calendar-simple-form,
  .plan-job-editor .compact-detail-form {
    grid-template-columns: 1fr;
  }

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

  .calendar-weekday {
    display: none;
  }

  .calendar-day-cell,
  .calendar-week-column {
    min-height: auto;
  }
}

/* Zahradni Kuna workspace */
:root {
  --bg: #f4f7f2;
  --bg-alt: #eef4ec;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --text: #183d35;
  --muted: #6d7b74;
  --line: #dfe8df;
  --brand: #155c4c;
  --brand-soft: #e2f0e8;
  --accent: #b86f3c;
  --success: #2f7d55;
  --danger: #bd4940;
  --shadow: 0 1px 2px rgba(21, 92, 76, 0.05), 0 16px 34px rgba(21, 92, 76, 0.08);
  --radius-xl: 18px;
  --radius-lg: 12px;
  --radius-md: 9px;
  --radius-sm: 7px;
  --max-width: none;
}

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

.is-hidden,
.app-shell.is-hidden {
  display: none !important;
}

.app-shell {
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  background: var(--bg);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(21, 92, 76, 0.04), transparent 38%),
    radial-gradient(circle at 100% 0%, rgba(184, 111, 60, 0.12), transparent 32%);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8f0 48%, #eaf3e8 100%);
  border-right: 1px solid var(--line);
}

.sidebar-backdrop,
.mobile-menu-button,
.mobile-bottom-bar {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px 14px 8px 14px;
  background:
    linear-gradient(135deg, #14342f 0%, #155c4c 72%),
    #14342f;
  color: #d8efbe;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.18);
}

.sidebar-brand strong,
.sidebar-footer strong {
  display: block;
  font-size: 1.05rem;
  line-height: 1.15;
  color: var(--text);
}

.sidebar-brand span,
.sidebar-footer span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.86rem;
}

.topbar-search.compact-input {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 13px 16px;
  border: 0;
  border: 1px solid #e7eee4;
  border-radius: 10px;
  background: #ffffff;
  font-size: 1rem;
}

.sidebar-search-results {
  max-height: 260px;
  overflow: auto;
}

.sidebar-search-results:empty {
  display: none;
}

.sidebar-search-results .empty-state {
  padding: 12px;
  background: #fafafa;
  text-align: left;
}

.sidebar-search-results .list-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.sidebar-search-results .list-card-header,
.sidebar-search-results .badge-row,
.sidebar-search-results .card-actions,
.sidebar-search-results .card-meta,
.sidebar-search-results .muted {
  display: none;
}

.sidebar-search-results h4 {
  margin: 0;
  font-size: 0.92rem;
}

.sidebar-group-label {
  margin: 12px 4px 0;
  color: #8b9a91;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.top-nav {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.nav-item,
.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-weight: 700;
}

.nav-item.is-active {
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand), 0 1px 0 rgba(21, 92, 76, 0.04);
}

.sidebar-link {
  cursor: default;
  opacity: 0.78;
}

.nav-icon {
  width: 20px;
  color: currentColor;
  text-align: center;
  font-size: 1.05rem;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 18px 4px 0;
  border-top: 1px solid var(--line);
}

.sidebar-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.sidebar-logout {
  grid-column: 2;
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b5b1ac;
  font-size: 0.86rem;
  font-weight: 700;
}

.app-workspace {
  min-width: 0;
}

.topbar {
  height: 76px;
  margin: 0;
  padding: 0 36px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.1;
}

.topbar-actions {
  align-items: center;
}

.current-user,
#export-data,
#import-trigger,
.notification-button {
  display: none !important;
}

.main-content {
  max-width: none;
  padding: 38px 42px 68px;
}

.panel {
  max-width: none;
}

.hero-card,
.surface-card,
.stat-card {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 178px;
  padding: 36px 40px;
  border-radius: 16px 16px 16px 6px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.99) 0%, rgba(238, 247, 232, 0.97) 100%),
    radial-gradient(circle at 96% 8%, rgba(184, 111, 60, 0.16), transparent 34%);
  border-left: 5px solid var(--brand);
}

.hero-card h2 {
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  font-weight: 650;
  letter-spacing: 0;
  color: var(--text);
}

.hero-card .muted {
  margin-top: 6px;
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-weather {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 190px;
  padding: 22px;
  border-radius: 14px 14px 14px 4px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(21, 92, 76, 0.1);
  color: var(--muted);
  text-align: right;
}

.hero-weather strong {
  color: var(--brand);
  font-size: clamp(2.4rem, 3.8vw, 3.2rem);
  line-height: 0.95;
}

.eyebrow {
  color: #86817b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.app-shell .primary-button,
.app-shell .ghost-button,
.app-shell .tiny-button {
  border-radius: 0;
  box-shadow: none;
  transform: none;
}

.app-shell .primary-button {
  background: var(--brand);
  color: #ffffff;
  font-weight: 800;
}

.app-shell .primary-button:hover,
.app-shell .ghost-button:hover,
.app-shell .tiny-button:hover,
.nav-item:hover {
  transform: none;
}

.header-new-job,
#calendar-new-job {
  padding: 13px 24px;
  border-radius: 10px 10px 10px 4px;
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(21, 92, 76, 0.18);
}

.app-shell .ghost-button {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
  font-weight: 800;
}

.app-shell .hero-actions .primary-button,
.app-shell .hero-actions .ghost-button,
.app-shell .calendar-toolbar .ghost-button,
.app-shell .calendar-toolbar .primary-button,
.app-shell .tiny-button {
  border-radius: 0;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.stat-card {
  min-height: 142px;
  padding: 24px 24px 22px;
  border-radius: 12px 12px 12px 5px;
}

.stat-card strong {
  margin-top: 12px;
  color: #191919;
  font-size: clamp(2rem, 2.8vw, 2.45rem);
  line-height: 1;
}

.stat-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 1rem;
}

.stat-card-danger strong,
.stat-card-danger span {
  color: var(--danger);
}

.stat-card-success strong,
.stat-card-success span {
  color: var(--success);
}

.stat-card-warning strong,
.stat-card-warning span {
  color: var(--accent);
}

.dashboard-plan-grid {
  grid-template-columns: 1.05fr 1.05fr 1.45fr;
  gap: 18px;
  margin-top: 28px;
}

.dashboard-plan-grid > .weather-card {
  grid-column: span 1;
}

.danger-soft-card {
  background: #fffafa;
  border-color: #ffd7d4;
}

.weather-list {
  display: grid;
  gap: 14px;
  color: var(--muted);
}

.weather-list span {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.weather-list strong {
  color: var(--text);
}

.surface-card {
  padding: 24px;
  border-radius: 12px 12px 12px 5px;
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
}

.compact-input {
  max-width: 220px;
}

.calendar-shell-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.calendar-page-heading {
  align-items: flex-start;
  margin-bottom: 28px;
}

.calendar-page-heading h2 {
  font-size: 1.75rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--text);
}

.calendar-page-heading .muted {
  margin: 8px 0 0;
  font-size: 1.05rem;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.feature-page-grid {
  display: grid;
  gap: 24px;
}

.feature-hero {
  min-height: 132px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border-left: 5px solid var(--accent);
}

.feature-hero h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 800;
}

.feature-section .stack-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.feature-section .empty-state {
  grid-column: 1 / -1;
}

.feature-section .list-card {
  min-height: 136px;
}

.calendar-toolbar-row {
  align-items: center;
}

#team-calendar-user-filter {
  max-width: 145px;
}

.segmented-control {
  flex-wrap: nowrap;
  gap: 0;
  padding: 4px;
  border-radius: 11px;
  background: #e8efe5;
}

.segment-button {
  min-width: 86px;
  padding: 13px 20px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.segment-button.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-calendar-view="day"] {
  display: none;
}

.calendar-layout,
.calendar-layout.is-month-detail-view,
.calendar-layout.is-detail-view {
  grid-template-columns: 1fr;
  gap: 26px;
  margin-top: 0;
}

.calendar-grid {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 5px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.calendar-weekdays,
.calendar-month-grid,
.calendar-week-grid {
  gap: 0;
}

.calendar-weekdays {
  border-bottom: 1px solid var(--line);
}

.calendar-weekday {
  min-height: 56px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.calendar-day-cell,
.calendar-week-column,
.calendar-day-panel {
  border-color: var(--line);
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
}

.calendar-day-cell {
  min-height: 145px;
  padding: 17px 12px;
  border-width: 0 1px 1px 0;
}

.calendar-month-grid .calendar-day-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-layout.is-month-detail-view .calendar-day-cell {
  min-height: 145px;
  padding: 17px 12px;
}

.calendar-day-cell.is-selected,
.calendar-day-cell.is-today,
.calendar-week-column.is-selected,
.calendar-week-column.is-today,
.calendar-day-panel.is-selected,
.calendar-day-panel.is-today {
  border-color: var(--line);
  box-shadow: none;
}

.calendar-day-cell.is-selected {
  background: var(--brand-soft);
}

.calendar-day-cell.is-drop-target,
.calendar-week-column.is-drop-target {
  background: #fff6ee;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.calendar-day-number {
  width: auto;
  height: auto;
  min-width: 26px;
  padding: 0 2px;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.calendar-day-cell.is-today .calendar-day-number,
.calendar-week-column.is-today .calendar-day-number,
.calendar-day-panel.is-today .calendar-day-number {
  width: 34px;
  height: 34px;
  background: var(--brand);
  color: #ffffff;
}

.calendar-items {
  gap: 6px;
  margin-top: 42px;
}

.calendar-layout.is-month-detail-view .calendar-day-cell .calendar-items {
  gap: 6px;
  margin-top: 42px;
}

.calendar-chip,
.calendar-chip.is-task,
.calendar-chip.is-job,
.calendar-chip.is-service {
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid #c8dfd4;
  border-left: 4px solid var(--brand);
  border-radius: 7px 7px 7px 2px;
  background: #edf7f1;
  color: #155c4c;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-chip::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-right: 6px;
  border-radius: 999px;
  background: currentColor;
  vertical-align: middle;
}

.calendar-range-mark {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(21, 92, 76, 0.12);
  font-size: 0.72rem;
}

.calendar-chip.is-dragging {
  opacity: 0.45;
}

.calendar-chip-more {
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-empty-note {
  margin: 0;
  color: var(--muted);
}

.calendar-week-grid {
  min-height: 560px;
}

.calendar-week-column {
  min-height: 560px;
  padding: 18px 10px;
  border-width: 0 1px 0 0;
}

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

.calendar-layout.is-detail-view .calendar-week-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-layout.is-detail-view .calendar-week-column {
  min-height: 560px;
}

.calendar-day-panel {
  padding: 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.calendar-layout.is-month-detail-view #calendar-detail,
.calendar-layout.is-detail-view #calendar-detail {
  max-width: 980px;
}

.stack-list {
  gap: 10px;
}

.list-card,
.calendar-detail-card,
.empty-state {
  border-radius: 10px;
}

.job-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(21, 92, 76, 0.1);
  border-radius: 10px;
  background: #f7faf5;
}

.job-snapshot span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.job-snapshot strong {
  color: var(--text);
  font-size: 0.98rem;
}

.plan-job-editor {
  border-left: 5px solid var(--brand);
}

.calendar-simple-form,
.plan-job-editor .compact-detail-form {
  gap: 14px;
}

.compact-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.compact-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff;
}

.compact-muted {
  margin: 0 0 12px;
}

.form-section-title {
  margin-top: 6px;
  padding: 8px 0 2px;
  border-top: 1px solid rgba(21, 92, 76, 0.1);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.form-section-title:first-of-type {
  margin-top: 0;
  border-top: 0;
}

.photo-upload-fieldset .photo-grid {
  margin-bottom: 14px;
}

.prep-checklist-fieldset {
  background: rgba(226, 240, 232, 0.72);
}

.prep-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.prep-check {
  min-height: 54px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(21, 92, 76, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  font-weight: 800;
}

.prep-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.prep-check:has(input:checked) {
  background: rgba(47, 125, 85, 0.12);
  color: var(--success);
}

.prep-row:has(input[name="prepDone"]:checked) input[name="prepTitle"] {
  border-color: rgba(47, 125, 85, 0.22);
  background: rgba(47, 125, 85, 0.06);
}

.customer-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

  .main-content {
    padding: 32px 24px 48px;
  }

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

  .dashboard-plan-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.sidebar-lock {
    overflow: hidden;
  }

  .app-shell {
    display: block;
  }

  .app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(84vw, 326px);
    height: 100dvh;
    padding: 18px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 22px 0 42px rgba(21, 92, 76, 0.2);
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .app-shell.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    border: 0;
    background: rgba(12, 28, 24, 0.38);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  .app-shell.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-button {
    width: 44px;
    height: 44px;
    display: grid;
    gap: 5px;
    place-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    color: var(--brand);
  }

  .mobile-menu-button span {
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-bottom-bar {
    position: fixed;
    inset: auto 12px 12px;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(21, 92, 76, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 38px rgba(21, 92, 76, 0.22);
    backdrop-filter: blur(14px);
  }

  .mobile-bottom-bar button {
    display: grid;
    gap: 3px;
    place-items: center;
    min-height: 52px;
    border: 0;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 800;
  }

  .mobile-bottom-bar span {
    font-size: 1.05rem;
    line-height: 1;
  }

  .mobile-bottom-bar strong {
    font-size: 0.78rem;
  }

  .top-nav {
    flex-direction: column;
    overflow: visible;
  }

  .nav-item,
  .sidebar-link {
    min-width: 0;
  }

  .sidebar-link,
  .sidebar-footer {
    display: none;
  }

  .topbar {
    height: auto;
    padding: 16px;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .topbar > div:first-of-type {
    min-width: 0;
  }

  .topbar h1 {
    font-size: 1.25rem;
  }

  .topbar-actions {
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .topbar-actions > * {
    flex: 0 0 auto;
  }

  .main-content {
    padding: 18px 14px 112px;
  }

  .hero-card,
  .surface-card,
  .stat-card {
    padding: 18px;
  }

  .stats-grid,
  .dashboard-plan-grid {
    grid-template-columns: 1fr;
  }

  .calendar-page-heading,
  .calendar-toolbar,
  .calendar-toolbar-row {
    display: grid;
    width: 100%;
  }

  .calendar-month-grid,
  .calendar-week-grid {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays {
    display: none;
  }

  .calendar-day-cell,
  .calendar-week-column,
  .calendar-layout.is-month-detail-view .calendar-day-cell,
  .calendar-layout.is-detail-view .calendar-week-column {
    min-height: auto;
    border-right: 0;
  }

  .calendar-items,
  .calendar-layout.is-month-detail-view .calendar-day-cell .calendar-items {
    margin-top: 12px;
  }

  .prep-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .prep-row .tiny-button {
    width: 100%;
  }
}
