/* Prorab AI — mockup design */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/inter-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/inter-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/inter-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #e2e7ee;
  --surface: #ffffff;
  --surface-muted: #edf1f6;
  --text: #121826;
  --muted: #5e6776;
  --accent: #2b6bff;
  --accent-dark: #1d56e0;
  --success: #16a34a;
  --warning: #ea580c;
  --danger: #ef4444;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-card: 0 2px 4px rgba(16, 24, 40, 0.06), 0 12px 28px rgba(16, 24, 40, 0.10);
  --shadow-card-press: 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-float: 0 -12px 36px rgba(16, 24, 40, 0.16);
  --transition: 160ms ease;
  --hero-h: 275px;
  --hero-img-pos: 72% center;
  --bottom-nav-h: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --type-section: clamp(19px, 5.2vw, 22px);
  --type-card: clamp(13px, 3.5vw, 15px);
  --type-meta: clamp(11px, 2.8vw, 12px);
  --type-chip: clamp(10px, 2.7vw, 12px);
  --type-nav: clamp(9px, 2.6vw, 10px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1em;
  height: 1em;
  display: block;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body {
  margin: 0;
  font-family: var(--font);
  font-synthesis: none;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  overflow-x: hidden;
}

.app-shell {
  width: 100%;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 20px);
  background: var(--bg);
}

.app {
  padding: 0 clamp(12px, 4vw, 16px) 16px;
}

/* ===== HERO ===== */

.hero {
  position: relative;
  height: var(--hero-h);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  overflow: hidden;
  margin-bottom: 0;
  box-shadow: 0 10px 28px rgba(16, 24, 40, 0.12);
  transition: opacity var(--transition), height var(--transition);
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-img-pos);
  z-index: 1;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    rgba(5, 10, 18, 0.9) 0%,
    rgba(5, 10, 18, 0.62) 38%,
    rgba(5, 10, 18, 0.18) 62%,
    rgba(5, 10, 18, 0.08) 100%
  ),
  linear-gradient(180deg, rgba(5, 10, 18, 0.12) 0%, rgba(5, 10, 18, 0.28) 100%);
}

.hero-bg-fallback {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 120% at 88% 45%, rgba(38, 48, 62, 0.55) 0%, transparent 65%),
    linear-gradient(155deg, #1c2d42 0%, #111c2a 42%, #070d14 100%);
  z-index: 0;
  display: none;
}

.hero.hero--fallback .hero-bg-fallback {
  display: block;
}

.hero.hero--fallback .hero-img {
  display: none;
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 18px;
  padding-right: 68px;
  pointer-events: none;
}

.hero-main {
  pointer-events: auto;
  width: 100%;
  max-width: min(420px, 58%);
}

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.hero-object,
.hero-notify {
  pointer-events: auto;
}

.hero-title {
  margin: 0;
  font-size: clamp(30px, 7.5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: #fff;
  line-height: 1;
}

.hero-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.35;
}

.hero-date {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.7);
}

.hero-object {
  position: static;
  width: 100%;
  margin-top: 12px;
  padding: 8px 12px;
}

.hero-object.glass-card {
  background: rgba(12, 16, 24, 0.52);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.22) inset,
    0 10px 22px rgba(0, 0, 0, 0.22);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.hero-notify {
  position: absolute;
  top: calc(20px + env(safe-area-inset-top, 0px));
  right: 20px;
  z-index: 4;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  pointer-events: auto;
}

.hero-notify .icon,
.hero-notify svg {
  width: 20px;
  height: 20px;
}

.hero-notify:active {
  background: rgba(255, 255, 255, 0.25);
}

.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(20, 24, 32, 0.5);
}

.glass-card {
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: var(--radius-md);
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 2px;
}

.glass-select {
  width: 100%;
  padding: 0;
  padding-right: 18px;
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6 -6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 14px 14px;
  line-height: 1.25;
}

.hero.hero--fallback .hero-gradient {
  display: none;
}

.hero.hero--fallback .hero-content {
  position: relative;
  inset: auto;
  height: 100%;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 20px;
  padding-right: 72px;
  pointer-events: auto;
}

.hero.hero--fallback .hero-main {
  max-width: 100%;
}

.hero.hero--fallback .hero-object {
  max-width: 460px;
}

.glass-select option {
  color: var(--text);
  background: var(--surface);
}

.project-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  transition: gap 0.25s ease, margin-top 0.25s ease;
}

.project-action-btn {
  flex: 1;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: none;
  transition:
    min-height 0.25s ease,
    padding 0.25s ease,
    font-size 0.25s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    gap 0.25s ease;
}

.project-action-btn--primary {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.36);
}

.project-action-icon {
  display: inline-flex;
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
}

.project-action-icon .icon {
  width: 14px;
  height: 14px;
}

.project-actions--compact {
  gap: 6px;
  margin-top: 6px;
}

.project-actions--compact .project-action-btn {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}

.project-actions--compact #projectRenameBtn .project-action-icon {
  display: inline;
}

.project-sheet-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 4px 12px;
}

.project-sheet-form .field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #667085);
}

.project-sheet-form .field-input {
  min-height: 50px;
  border: 1px solid var(--border, #d0d5dd);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: var(--font);
}

.project-sheet-form .form-error,
.project-sheet-form .issues-form-error {
  color: #b42318;
  font-size: 13px;
  margin: 0;
}

.project-sheet-submit,
.project-sheet-form .save-button {
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  background: var(--accent, #1d4ed8);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
}

.project-sheet-submit:disabled {
  opacity: 0.6;
  cursor: wait;
}

/* ===== DASHBOARD ===== */

.home-view {
  animation: fadeIn 260ms ease;
  padding-top: 16px;
}

.home-hub {
  --hub-gap: clamp(6px, 1.8vw, 10px);
  --hub-space: clamp(14px, 4vw, 22px);
  --hub-pad: clamp(8px, 2.4vw, 12px);
  --hub-icon: clamp(28px, 8.2vw, 36px);
  --hub-title: var(--type-section);
  --hub-label: var(--type-card);
  --hub-meta: var(--type-meta);
  --hub-peek: clamp(16px, 5.6vw, 26px);
  display: grid;
  gap: var(--hub-space);
  width: min(100%, 880px);
  margin: 0 auto;
  padding: clamp(4px, 1.2vw, 8px) 0 clamp(16px, 5vw, 36px);
  grid-column: 1 / -1;
}

.hub-section {
  display: grid;
  gap: clamp(6px, 1.8vw, 10px);
  min-width: 0;
}

.hub-section-title {
  margin: 0;
  padding: 0 2px;
  font-family: var(--font);
  font-size: var(--hub-title);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: #0f1623;
}

.hub-section--quick .hub-section-title,
.hub-section--work .hub-section-title,
.hub-section--control .hub-section-title,
.hub-section--resources .hub-section-title {
  color: var(--text);
}

.hub-quick-scroll,
.hub-row--scroll {
  display: flex;
  gap: var(--hub-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 2px 0 6px;
  margin: 0;
  scrollbar-width: none;
}

.hub-quick-scroll {
  gap: var(--hub-gap);
  padding-right: var(--hub-peek);
  scroll-padding-inline: 0;
}

.hub-quick-scroll::-webkit-scrollbar,
.hub-row--scroll::-webkit-scrollbar {
  display: none;
}

.hub-card {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: clamp(6px, 1.8vw, 12px);
  width: 100%;
  min-width: 0;
  min-height: 80px;
  margin: 0;
  padding: var(--hub-pad) var(--hub-pad) clamp(8px, 2vw, 12px);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  font-family: var(--font);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    background-color var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hub-card:hover {
  box-shadow: var(--shadow-card);
}

.hub-card:active {
  transform: scale(0.985);
  box-shadow: var(--shadow-card-press);
}

.hub-card:focus-visible {
  outline: 3px solid rgba(43, 107, 255, 0.35);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .hub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 24, 40, 0.07), 0 16px 32px rgba(16, 24, 40, 0.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-card,
  .hub-now-chip,
  .bottom-nav-item,
  .bottom-nav-fab,
  .hero-notify {
    transition: none;
  }

  .hub-card:hover,
  .hub-card:active,
  .bottom-nav-item:active,
  .bottom-nav-fab:active {
    transform: none;
  }
}

.hub-card--quick {
  flex: 0 0 calc((100% - (2 * var(--hub-gap)) - var(--hub-peek)) / 3);
  width: auto;
  min-height: 88px;
  height: auto;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  justify-content: space-between;
}

.hub-card--quick .hub-card-icon {
  background: rgba(15, 23, 42, 0.08);
}

.hub-card--tile {
  min-height: 80px;
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(16, 24, 40, 0.07), 0 14px 32px rgba(16, 24, 40, 0.12);
}

.hub-row--scroll .hub-card--tile {
  flex: 0 0 calc((100% - (2 * var(--hub-gap))) / 3);
  width: auto;
  min-height: 80px;
  height: auto;
  scroll-snap-align: start;
  justify-content: space-between;
}

.hub-card-icon {
  display: grid;
  place-items: center;
  width: var(--hub-icon);
  height: var(--hub-icon);
  border-radius: 12px;
  font-size: clamp(13px, 3.8vw, 18px);
  font-weight: 700;
  line-height: 1;
  color: #334155;
  background: rgba(15, 23, 42, 0.06);
  box-shadow: none;
  flex-shrink: 0;
}

.hub-card-icon .icon {
  width: clamp(20px, 5.6vw, 22px);
  height: clamp(20px, 5.6vw, 22px);
}

.hub-card-body {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-top: auto;
}

.hub-card-label {
  display: block;
  max-width: 100%;
  overflow: visible;
  font-size: var(--hub-label);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #1a2230;
  white-space: normal;
  overflow-wrap: break-word;
}

.hub-card--quick .hub-card-label {
  font-size: var(--hub-label);
}

.hub-card-meta {
  display: block;
  max-width: 100%;
  overflow: visible;
  font-size: var(--hub-meta);
  font-weight: 500;
  color: #647082;
  line-height: 1.3;
  letter-spacing: 0.005em;
  white-space: normal;
}

.hub-meta-compact,
.hub-chip-compact {
  display: none;
}

@media (max-width: 639px) {
  .hub-meta-full,
  .hub-chip-full {
    display: none;
  }

  .hub-meta-compact,
  .hub-chip-compact {
    display: inline;
  }
}

.hub-card-meta.is-warning {
  color: var(--warning);
}

.hub-card-meta.is-danger {
  color: var(--danger);
}

.hub-card--accent-blue {
  background: var(--surface);
}

.hub-card--quick.hub-card--accent-blue {
  background: #d9e6ff;
}

.hub-card--accent-blue .hub-card-icon {
  color: #1d56e0;
  background: rgba(43, 107, 255, 0.22);
}

.hub-card--accent-green {
  background: var(--surface);
}

.hub-card--quick.hub-card--accent-green {
  background: #d8f0e0;
}

.hub-card--accent-green .hub-card-icon {
  color: #15803d;
  background: rgba(22, 163, 74, 0.20);
}

.hub-card--accent-amber {
  background: var(--surface);
}

.hub-card--quick.hub-card--accent-amber {
  background: #ffe0c8;
}

.hub-card--accent-amber .hub-card-icon {
  color: #c2410c;
  background: rgba(234, 88, 12, 0.20);
}

.hub-card--accent-slate {
  background: var(--surface);
}

.hub-card--quick.hub-card--accent-slate {
  background: #dfe6ee;
}

.hub-card--accent-slate .hub-card-icon {
  color: #334155;
  background: rgba(71, 85, 105, 0.18);
}

.hub-grid {
  display: grid;
  gap: var(--hub-gap);
  min-width: 0;
}

.hub-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hub-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hub-now {
  position: relative;
  display: grid;
  gap: clamp(6px, 1.6vw, 8px);
  min-height: 0;
  padding: clamp(10px, 2.4vw, 14px) clamp(12px, 3vw, 16px);
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(16, 24, 40, 0.07), 0 14px 32px rgba(16, 24, 40, 0.12);
}

.hub-now.is-loading {
  background: var(--surface-muted);
}

.hub-now.is-alert {
  background: #fff4e8;
}

.hub-now-headline {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #0f1623;
}

.hub-now.is-loading .hub-now-headline {
  height: 12px;
  width: min(58%, 200px);
}

.hub-now-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1.4vw, 8px);
  min-width: 0;
}

.hub-now-signal,
.hub-now-chip {
  min-height: 32px;
  border-radius: 999px;
}

.hub-now-chip {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  margin: 0;
  padding: clamp(5px, 1.2vw, 7px) clamp(6px, 1.6vw, 8px);
  border: 0;
  background: #e8edf4;
  color: #3d4654;
  font-family: var(--font);
  font-size: var(--type-chip);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.hub-now-chip.is-danger {
  background: #f8d4d4;
  color: #b42318;
}

.hub-now-chip.is-warning {
  background: #ffd9b8;
  color: #9a3412;
}

.hub-now-chip.is-calm {
  color: #3d4654;
}

.hub-now-slot {
  border-radius: 10px;
  background:
    linear-gradient(110deg, #e6ebf2 0%, #f3f5f8 42%, #e6ebf2 100%);
  background-size: 180% 100%;
  opacity: 0.72;
}

.hub-now-status,
.hub-now-hint {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.3;
}

.hub-now-retry {
  appearance: none;
  width: max-content;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent, #1d4ed8);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 600px) {
  .home-view {
    padding-top: 12px;
  }

  body:not(.section-mode) .app-shell {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  }

  body:not(.section-mode) .voice-fab {
    display: none;
  }
}

@media (min-width: 640px) {
  .home-hub {
    --hub-gap: 12px;
    --hub-space: 28px;
    --hub-pad: 16px;
    --hub-icon: 42px;
    --hub-title: clamp(24px, 3vw, 32px);
    --hub-label: 18px;
    --hub-meta: 12px;
    gap: var(--hub-space);
    width: min(100%, 920px);
  }

  .hub-section {
    gap: 12px;
  }

  .hub-quick-scroll,
  .hub-row--scroll {
    display: grid;
    overflow: visible;
    scroll-snap-type: none;
    margin: 0;
    padding: 0;
    gap: 12px;
  }

  .hub-quick-scroll {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hub-row--scroll {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hub-card--quick,
  .hub-row--scroll .hub-card--tile {
    flex: unset;
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .hub-card--quick {
    min-height: 128px;
    gap: 18px;
  }

  .hub-card--quick .hub-card-label {
    font-size: 19px;
  }

  .hub-card--tile,
  .hub-row--scroll .hub-card--tile {
    min-height: 118px;
    padding: 16px 16px 14px;
    gap: 14px;
  }

  .hub-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
  }

  .hub-now {
    padding: 12px 14px;
    gap: 8px;
  }

  .hub-now-headline {
    font-size: 16px;
  }

  .hub-now-chip {
    min-height: 34px;
    font-size: 12px;
  }
}

@media (min-width: 1024px) {
  .home-hub {
    --hub-title: 34px;
    --hub-label: 19px;
    gap: 32px;
    width: min(100%, 960px);
    padding-top: 8px;
    padding-bottom: 40px;
  }

  .hub-section {
    gap: 14px;
  }

  .hub-section-title {
    font-size: 34px;
  }

  .hub-card--tile,
  .hub-row--scroll .hub-card--tile {
    min-height: 124px;
  }

  .hub-card--quick {
    min-height: 136px;
  }

  .hub-card-label {
    font-size: 19px;
  }

  .hub-card--quick .hub-card-label {
    font-size: 20px;
  }

  .hub-now {
    min-height: 0;
    padding: 16px 18px;
  }
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.section-link {
  border: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
}

.dashboard {
  margin-bottom: 18px;
}

.metrics-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.metrics-scroll::-webkit-scrollbar { display: none; }

.metric-card {
  flex: 0 0 132px;
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.metric-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.metric-value {
  display: block;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.metric-value--sm {
  font-size: 19px;
}

.metric-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

.metric-sub.color-red { color: var(--danger); font-weight: 600; }
.metric-sub.color-warning { color: var(--warning); font-weight: 600; }

.progress-bar {
  height: 6px;
  background: #e8ecf2;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar--sm { margin-top: 8px; }

.progress-fill {
  max-width: 100%;
  height: 100%;
  border-radius: 99px;
  transition: width 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-accent { background: var(--accent); }
.progress-green { background: var(--success); }
.progress-yellow { background: var(--warning); }
.progress-red { background: var(--danger); }
.progress-fill--over { background: #af52de; }

/* Attention */

.attention-card {
  margin-top: 14px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.attention-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.attention-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.attention-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: opacity var(--transition);
}

.attention-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.attention-row:active { opacity: 0.7; }

.chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chip-dot--danger { background: var(--danger); }
.chip-dot--warning { background: var(--warning); }
.chip-dot--info { background: var(--accent); }

.attention-row-body {
  flex: 1;
  min-width: 0;
}

.attention-row-body strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.attention-row-body span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-chevron {
  flex-shrink: 0;
  color: #c5cad3;
  font-size: 18px;
  font-weight: 300;
}

/* ===== MENU GRID ===== */

.menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.menu-button {
  min-height: 118px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 10px;
  transition: transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.menu-button:hover { box-shadow: var(--shadow-float); }
.menu-button:active { transform: scale(0.97); }

.menu-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 2px;
}

.menu-label {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.menu-desc {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  text-align: center;
  line-height: 1.3;
}

/* ===== CONTENT ===== */

.content {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  animation: slideUp 240ms ease;
  margin-top: 12px;
}

.content h2 { margin: 0 0 16px; font-size: 22px; font-weight: 700; }
.content h3 { margin: 20px 0 10px; font-size: 16px; font-weight: 700; }

.hidden { display: none !important; }

.back-button {
  width: 100%;
  margin-top: 12px;
  padding: 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

/* ===== FORMS ===== */

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: -8px;
}

.form input,
.form textarea,
.form select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1.5px solid #e8ecf2;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 16px;
  background: var(--surface-muted);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}

.form input:focus,
.form textarea:focus,
.form select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(43, 107, 255, 0.12);
}

.form textarea { min-height: 100px; resize: vertical; }

.work-catalog-field {
  position: relative;
}

.work-catalog-combobox {
  position: relative;
}

.work-catalog-combobox input {
  padding-right: 44px;
}

.work-catalog-panel {
  display: none;
  position: fixed;
  z-index: 2100;
  max-height: 280px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(27, 39, 51, 0.12);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(25, 39, 61, 0.16);
}

.work-catalog-panel.is-open {
  display: grid;
  gap: 8px;
}

.work-catalog-option,
.work-catalog-add {
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  text-align: left;
  background: #f7f9fc;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.work-catalog-option.is-active,
.work-catalog-option:hover,
.work-catalog-add:hover {
  background: rgba(43, 107, 255, 0.08);
}

.work-catalog-option-title {
  font-size: 15px;
  font-weight: 700;
}

.work-catalog-option-category,
.work-catalog-helper,
.work-catalog-empty {
  color: var(--muted);
  font-size: 12px;
}

.work-catalog-helper {
  margin-top: 6px;
  line-height: 1.35;
}
.save-button {
  min-height: 56px;
  padding: 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.save-button:hover { background: var(--accent-dark); }
.save-button:active { transform: scale(0.98); }

.secondary-button {
  min-height: 50px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}

.tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab-button {
  flex: 1;
  min-width: 80px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}

.tab-button.active {
  background: var(--text);
  color: #fff;
}

.list-card {
  padding: 16px;
  margin-bottom: 10px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

.list-card.overdue {
  background: #fff8f7;
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.12);
}

.list-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.list-card-title { font-size: 15px; font-weight: 700; }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-yellow { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

.list-card-meta {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
}

.list-card-meta strong { color: var(--text); }

.color-green { color: var(--success); }
.color-yellow { color: var(--warning); }
.color-red { color: var(--danger); }

.select-card {
  padding: 16px;
  margin-bottom: 10px;
  border: 2px solid #e8ecf2;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: var(--surface);
  transition: border-color var(--transition), transform var(--transition);
}

.select-card:active { transform: scale(0.99); }
.select-card.selected { border-color: var(--accent); background: #f0f5ff; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.stat-card {
  padding: 14px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
}

.stat-readiness {
  grid-column: span 2;
  text-align: center;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 18px;
}

.stat-readiness .stat-label { color: rgba(255,255,255,0.6); }
.stat-readiness .stat-value { color: #fff; font-size: 36px; }

.stat-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value { font-size: 22px; font-weight: 800; }
.stat-small { font-size: 17px; }

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.analytics-table th,
.analytics-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #f0f2f5;
}

.analytics-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.voice-result {
  padding: 16px;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  line-height: 1.55;
}

.info-box {
  padding: 14px 16px;
  background: #eff6ff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #1e40af;
  margin-bottom: 14px;
}

.ai-assistant-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-assistant-input {
  min-height: 96px;
  resize: vertical;
}

.ai-assistant-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.ai-voice-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.ai-voice-button .icon {
  width: 20px;
  height: 20px;
}

.ai-voice-button.recording {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  animation: pulse 1.2s infinite;
}

.ai-voice-button.processing {
  opacity: 0.65;
  cursor: wait;
}

.ai-voice-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ai-voice-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-muted);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ai-voice-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ai-voice-status {
  font-size: 14px;
  color: var(--text);
}

.ai-voice-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--danger);
}

.ai-voice-actions,
.ai-voice-review {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-assistant-answer {
  margin-top: 12px;
}

.ai-assistant-answer-text {
  margin-top: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ai-continuation-hint {
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-bottom: 8px;
}

.ai-assistant-proposal {
  margin-top: 12px;
}

.ai-action-preview-card {
  display: grid;
  gap: 10px;
}

.ai-action-preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.ai-action-preview-body {
  display: grid;
  gap: 8px;
}

.ai-action-preview-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.ai-action-preview-warning {
  color: var(--color-warning, #b45309);
  font-size: 0.92rem;
}

.ai-action-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.status-action-btn {
  padding: 8px 14px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px #e8ecf2;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--accent);
}

.photo-placeholder {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.photo-slot {
  padding: 24px 10px;
  border: 2px dashed #e8ecf2;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: var(--surface-muted);
}

/* ===== VOICE FAB ===== */

.voice-fab {
  position: fixed;
  right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 20px);
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  background: #141820;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: transform var(--transition), background var(--transition);
}

.voice-fab:active { transform: scale(0.93); }
.voice-fab.listening,
.voice-fab.recording { background: var(--danger); animation: pulse 1.2s infinite; }
.voice-fab.processing { background: var(--text); opacity: 0.85; }
.voice-fab.preview { background: var(--accent, #1f6feb); }
.voice-fab.error { background: var(--danger); }
.voice-fab:disabled { opacity: 0.45; cursor: not-allowed; }
.voice-fab-icon { width: 22px; height: 22px; }

/* ===== BOTTOM NAV ===== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding: 4px 2px var(--safe-bottom);
  background: #ffffff;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  justify-items: stretch;
  box-shadow:
    0 -1px 0 rgba(16, 24, 40, 0.05),
    var(--shadow-float);
  z-index: 100;
  transition: transform var(--transition);
}

.bottom-nav-item {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px 2px 6px;
  color: #8a93a3;
  transition: color var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
  transform: scale(0.96);
}

.bottom-nav-item.active {
  color: var(--accent);
}

.bottom-nav-item.active .bottom-nav-label {
  color: var(--accent);
  font-weight: 700;
}

.bottom-nav-icon-wrap {
  position: relative;
  display: inline-flex;
}

.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-icon .icon {
  width: clamp(20px, 5.4vw, 22px);
  height: clamp(20px, 5.4vw, 22px);
}

.bottom-nav-label {
  font-family: var(--font);
  font-size: var(--type-nav);
  font-weight: 500;
  color: inherit;
  line-height: 1.1;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.nav-badge {
  position: absolute;
  top: -4px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottom-nav-slot {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 6px;
}

.bottom-nav-fab {
  display: grid;
  place-items: center;
  width: clamp(44px, 12vw, 46px);
  height: clamp(44px, 12vw, 46px);
  margin: -12px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: transparent;
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(43, 107, 255, 0.32);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.bottom-nav-fab::before,
.bottom-nav-fab::after {
  content: "";
  grid-area: 1 / 1;
  background: #fff;
  border-radius: 1px;
}

.bottom-nav-fab::before {
  width: 16px;
  height: 2.5px;
}

.bottom-nav-fab::after {
  width: 2.5px;
  height: 16px;
}

.bottom-nav-fab:active { transform: scale(0.93); }

/* ===== SHEETS ===== */

.crash-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 16px);
  z-index: 220;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.crash-notice-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.crash-notice-code {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.crash-notice-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.crash-notice-actions button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
}

.crash-notice-retry {
  background: var(--accent);
  color: #fff;
}

.crash-notice-copy {
  background: var(--surface-muted);
  color: var(--text);
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 200;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 12px 20px calc(20px + var(--safe-bottom));
  z-index: 210;
  animation: slideUpSheet 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.sheet-handle {
  width: 36px;
  height: 4px;
  background: #e2e8f0;
  border-radius: 99px;
  margin: 0 auto 16px;
}

.sheet-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-action {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.sheet-action .icon {
  width: 22px;
  height: 22px;
  color: #334155;
}
.sheet-action:active { background: #e8ebf0; }

/* ===== SECTION MODE ===== */

body.section-mode .hero {
  opacity: 0;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none;
  pointer-events: none;
  overflow: hidden;
}

body.section-mode .home-view { display: none; }

body.section-mode .bottom-nav {
  transform: translateY(100%);
}

body.section-mode .voice-fab {
  bottom: calc(var(--safe-bottom) + 16px);
}

@media (max-width: 600px) {
  body.section-mode .app-shell {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  }

  body.section-mode .app {
    padding-top: 0;
  }

  body.section-mode .content {
    margin-top: 0;
    padding: 0 clamp(12px, 4vw, 16px) 20px;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  body.section-mode .section-page {
    max-width: none;
    margin: 0;
  }

  body.section-mode .section-topbar {
    margin: 0 calc(-1 * clamp(12px, 4vw, 16px)) 8px;
    padding-top: max(6px, env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
  }

  body.section-mode .section-body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  body.section-mode .voice-fab {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: max(10px, env(safe-area-inset-left, 0px));
    right: auto;
    width: 44px;
    height: 44px;
    z-index: 60;
  }

  body.section-mode .voice-fab-icon {
    width: 20px;
    height: 20px;
  }
}

/* ===== ANIMATIONS ===== */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

/* ===== RESPONSIVE APPLICATION LAYOUT ===== */

html,
body {
  width: 100%;
  min-width: 0;
}

body {
  background:
    radial-gradient(circle at 10% -10%, rgba(43, 107, 255, 0.08), transparent 32rem),
    var(--bg);
}

button,
input,
select,
textarea,
.list-card,
.select-card,
.attention-row-body {
  min-width: 0;
}

img,
svg,
table {
  max-width: 100%;
}

.hero {
  isolation: isolate;
}

.metric-card,
.menu-button,
.attention-card,
.content {
  border: none;
}

.metric-value,
.metric-value--sm,
.list-card-title {
  overflow-wrap: anywhere;
}

.analytics-table {
  display: table;
  table-layout: fixed;
}

.analytics-table th,
.analytics-table td {
  overflow-wrap: anywhere;
}

.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
}

.form .form-field > label {
  margin: 0;
}

/* Mobile: <= 600px */
@media (max-width: 600px) {
  :root {
    --hero-h: 275px;
    --hero-img-pos: 78% center;
  }

  .app-shell {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 20px);
  }

  body:not(.section-mode) .app-shell {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  }

  .app {
    padding-inline: clamp(12px, 4vw, 18px);
  }

  .hero {
    height: clamp(260px, 72vw, 290px);
    min-height: 260px;
    max-height: 290px;
    border-radius: 0 0 28px 28px;
  }

  .hero-main {
    max-width: 100%;
  }

  .hero-object {
    width: 100%;
    margin-top: 10px;
    padding: 7px 10px;
  }

  .hero-notify {
    top: calc(18px + env(safe-area-inset-top, 0px));
    right: 18px;
  }

  .metrics-scroll {
    width: calc(100% + clamp(12px, 4vw, 18px));
    margin-left: calc(-1 * clamp(12px, 4vw, 18px));
    padding-left: clamp(12px, 4vw, 18px);
    padding-right: clamp(12px, 4vw, 18px);
    overscroll-behavior-inline: contain;
  }

  .metric-card {
    flex: 0 0 clamp(124px, 39vw, 148px);
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-button {
    min-height: 112px;
  }

  .form {
    display: flex;
  }

  .form-field {
    width: 100%;
  }

  .content {
    padding: clamp(16px, 5vw, 22px);
  }

  .list-card-header {
    flex-wrap: wrap;
  }

  .status-actions > * {
    max-width: 100%;
  }

  .voice-fab {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px);
  }
}

@media (max-width: 390px) {
  :root {
    --hero-h: 270px;
    --hero-img-pos: 80% center;
  }

  .hero {
    height: 270px;
    min-height: 270px;
    max-height: 270px;
  }

  .hero-main {
    max-width: 72%;
  }

  .hero-title {
    font-size: clamp(30px, 8.2vw, 34px);
  }

  .metric-card { flex: 0 0 124px; }
  .menu-button { min-height: 110px; }
}

@media (max-width: 360px) {
  .metric-card { flex: 0 0 120px; }
}

/* Tablet: 601px–1024px */
@media (min-width: 601px) and (max-width: 1024px) {
  :root {
    --hero-h: 280px;
    --hero-img-pos: 70% center;
  }

  .app-shell {
    width: calc(100% - 40px);
    max-width: 960px;
    margin: 20px auto 0;
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 28px);
  }

  .app {
    padding: 0 0 24px;
  }

  .hero {
    border-radius: 30px;
  }

  .hero-main {
    max-width: min(440px, 55%);
  }

  .hero-object {
    width: min(400px, 100%);
  }

  .hero.hero--fallback .hero-content {
    padding: 28px 32px;
    padding-right: 72px;
  }

  .hero.hero--fallback .hero-object {
    width: min(440px, 62%);
    margin-top: 22px;
  }

  .hero-notify {
    top: 22px;
    right: 22px;
  }

  .home-view {
    padding-top: 22px;
  }

  .metrics-scroll {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    gap: 14px;
  }

  .metric-card {
    min-height: 112px;
  }

  .menu {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .menu-button {
    min-height: 124px;
  }

  .content {
    width: min(100%, 920px);
    margin: 20px auto 0;
    padding: 28px;
  }

  .back-button {
    width: min(100%, 920px);
    margin-inline: auto;
  }

  .form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 18px;
  }

  .form > :not(.form-field) {
    grid-column: 1 / -1;
  }

  .form > .save-button {
    width: min(100%, 360px);
    justify-self: end;
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: 18px;
    width: calc(100% - 64px);
    max-width: 1040px;
    border-radius: 26px;
    padding-inline: 16px;
    background: #ffffff;
    box-shadow: 0 12px 40px rgba(16, 24, 40, 0.18);
  }

  .app-shell {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 120px);
  }

  .voice-fab {
    position: fixed;
    right: max(20px, calc((100vw - min(100vw - 40px, 960px)) / 2 + 16px));
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 28px);
  }
}

/* Desktop: >= 1025px */
@media (min-width: 1025px) {
  :root {
    --hero-h: 280px;
    --hero-img-pos: 68% center;
  }

  .app-shell {
    width: calc(100% - 64px);
    max-width: 1440px;
    min-height: 100vh;
    margin: 28px auto 0;
    padding-bottom: 48px;
  }

  .app {
    padding: 0;
  }

  .hero {
    height: clamp(270px, 18vw, 290px);
    min-height: 270px;
    max-height: 290px;
    border-radius: 32px;
  }

  .hero-content {
    padding: 24px 32px;
    padding-right: 80px;
  }

  .hero-main {
    max-width: min(480px, 48%);
  }

  .hero-title {
    font-size: clamp(48px, 3.6vw, 54px);
  }

  .hero-subtitle {
    font-size: 16px;
    margin-top: 10px;
  }

  .hero-date {
    font-size: 14px;
    margin-top: 8px;
  }

  .hero-object {
    width: 400px;
    max-width: 100%;
    margin-top: 16px;
    padding: 10px 14px;
  }

  .glass-select {
    font-size: 17px;
  }

  .hero-notify {
    top: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
  }

  .hero-notify svg {
    width: 22px;
    height: 22px;
  }

  .home-view {
    display: grid;
    grid-template-columns: minmax(380px, 0.9fr) minmax(620px, 1.4fr);
    gap: 0 24px;
    padding-top: 28px;
    align-items: start;
  }

  .home-view:has(.today-dashboard) {
    display: block;
    padding-top: 28px;
  }

  .dashboard {
    display: contents;
  }

  .home-view:has(.today-dashboard) .dashboard {
    display: grid;
  }

  .section-head,
  .metrics-scroll {
    grid-column: 1 / -1;
  }

  .section-head {
    margin-bottom: 14px;
  }

  .metrics-scroll {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    overflow: visible;
    padding: 0;
    margin-bottom: 24px;
  }

  .metric-card {
    min-height: 120px;
    padding: 18px;
    flex: unset;
  }

  .attention-card {
    grid-column: 1;
    margin: 0;
    padding: 20px;
  }

  .menu {
    grid-column: 2;
    grid-row: 3;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }

  .menu-button {
    min-height: 138px;
    padding: 18px 12px;
  }

  .menu-icon {
    font-size: 38px;
  }

  .content {
    width: min(100%, 1100px);
    margin: 28px auto 0;
    padding: 34px 38px;
  }

  .back-button {
    display: block;
    width: min(100%, 1100px);
    margin: 14px auto 0;
  }

  .form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 20px 24px;
  }

  .form > :not(.form-field) {
    grid-column: 1 / -1;
  }

  .form > .save-button {
    width: min(100%, 380px);
    justify-self: end;
  }

  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-readiness {
    grid-column: span 3;
  }

  .app-shell {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 96px);
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 50%;
    right: auto;
    width: min(calc(100vw - 48px), 980px);
    transform: translateX(-50%);
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  .bottom-nav-item {
    min-width: 0;
    width: 100%;
  }

  .bottom-nav-fab {
    width: 50px;
    height: 50px;
    margin-top: -14px;
    font-size: 0;
    padding: 0;
  }

  .bottom-nav-fab::before {
    width: 18px;
    height: 2.5px;
  }

  .bottom-nav-fab::after {
    width: 2.5px;
    height: 18px;
  }

  .voice-fab {
    position: fixed;
    right: max(24px, env(safe-area-inset-right, 0px));
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    width: 52px;
    height: 52px;
  }

  body.section-mode .voice-fab {
    display: flex;
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
  }

  body.section-mode .hero {
    opacity: 1;
    height: 118px;
    pointer-events: auto;
    border-radius: 24px;
  }

  body.section-mode .hero-img {
    display: none;
  }

  body.section-mode .hero-bg-fallback {
    display: block;
  }

  body.section-mode .hero-content {
    position: relative;
    inset: auto;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    padding-right: 72px;
    pointer-events: auto;
  }

  body.section-mode .hero-brand {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  body.section-mode .hero-subtitle,
  body.section-mode .hero-date {
    display: none;
  }

  body.section-mode .hero-object {
    position: relative;
    top: auto;
    left: auto;
    width: min(420px, 45%);
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }

  body.section-mode .glass-select {
    padding: 0 18px 0 0;
    background-position: right 2px center;
    font-size: 16px;
  }

  body.section-mode .hero-notify {
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
}

@media (min-width: 1600px) {
  .app-shell {
    min-width: 0;
  }
}

@media (min-width: 1025px) and (max-width: 1099px) {
  .home-view {
    grid-template-columns: 1fr;
  }

  .attention-card,
  .menu {
    grid-column: 1;
  }

  .attention-card {
    margin-bottom: 24px;
  }

  .menu {
    grid-row: auto;
  }
}

/* ==========================
   ПЛАН РАБОТ
   ========================== */

/* ==========================
   ВНУТРЕННЯЯ НАВИГАЦИЯ
   ========================== */

.section-page {
  max-width: 1180px;
  margin: 0 auto;
}

.section-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(72px, auto) 1fr minmax(72px, auto);
  align-items: center;
  gap: 8px;
  margin: -4px -4px 16px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 10px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.section-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 10px;
  border: none;
  border-radius: 12px;
  background: rgba(0, 122, 255, 0.08);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.section-nav-back {
  justify-self: start;
}

.section-nav-home {
  justify-self: end;
}

.section-nav-back-icon,
.section-nav-home-icon {
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
}

.section-nav-back-icon .icon,
.section-nav-home-icon .icon {
  width: 20px;
  height: 20px;
}

.section-topbar-title {
  margin: 0;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-title-short {
  display: none;
}

.section-body {
  padding-bottom: 8px;
}

.section-loading {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-secondary);
}

button.select-card {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  cursor: pointer;
  font: inherit;
}

.fact-success {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--card-shadow);
}

.fact-success-badge {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.fact-success-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.fact-success-meta,
.fact-success-contractor {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--text-secondary);
}

.fact-success-contractor {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.fact-success-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.fact-success-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f5;
}

.fact-success-row span {
  color: var(--text-secondary);
}

.fact-success-reason {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.fact-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 480px) {
  .section-title-full {
    display: none;
  }

  .section-title-short {
    display: inline;
  }

  .section-nav-back-label,
  .section-nav-home-label {
    display: none;
  }

  .section-nav-btn {
    padding: 8px;
  }
}

@media (min-width: 1025px) {
  .section-topbar {
    margin-left: 0;
    margin-right: 0;
    border-radius: 14px 14px 0 0;
  }
}

.plan-screen {
  max-width: 960px;
  margin: 0 auto;
}

.plan-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.plan-back-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
  flex-shrink: 0;
}

.plan-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0;
}

.plan-project-name {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 0 0;
  color: var(--text-primary);
}

.plan-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.plan-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.plan-summary-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.plan-summary-item strong {
  font-size: 15px;
}

.plan-period {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.plan-segmented {
  display: flex;
  align-items: stretch;
  gap: 3px;
  padding: 3px;
  margin-bottom: 12px;
  background: #e9e9eb;
  border-radius: 10px;
}

.plan-segment {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 6px;
}

.plan-segment.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.plan-segment--date {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
}

.plan-segment-text {
  pointer-events: none;
  white-space: nowrap;
}

.plan-segment-date-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: none;
}

.plan-period-tab {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: none;
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  text-align: center;
}

.plan-period-tab.active {
  background: var(--accent);
  color: #fff;
}

.plan-period-date {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.plan-period-date input[type="date"] {
  border: none;
  background: transparent;
  font-size: 11px;
  color: inherit;
  width: 100%;
  text-align: center;
  cursor: pointer;
}

.plan-period-date.active input[type="date"] {
  color: #fff;
}

.plan-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.plan-add-btn {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.plan-filters-btn {
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--card-shadow);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.plan-filters {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}

.plan-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan-filters-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.plan-filters-grid select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}

.plan-filters-reset {
  width: 100%;
  margin-top: 10px;
}

.plan-filters-actions {
  display: none;
}

.plan-fab-add {
  display: none;
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card {
  display: flex;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.plan-card-status-bar {
  width: 5px;
  flex-shrink: 0;
  background: #c7c7cc;
}

.plan-card--grey .plan-card-status-bar { background: #c7c7cc; }
.plan-card--blue .plan-card-status-bar { background: #007aff; }
.plan-card--green .plan-card-status-bar { background: #34c759; }
.plan-card--red .plan-card-status-bar { background: #ff3b30; }

.plan-card-body {
  flex: 1;
  padding: 14px 16px;
  position: relative;
}

.plan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.plan-card-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
}

.plan-card-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f2f2f7;
  color: var(--text-secondary);
  white-space: nowrap;
}

.plan-card-location,
.plan-card-building,
.plan-card-contractor {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 2px 0;
}

.plan-card-contractor {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.plan-card-volumes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.plan-vol-row {
  font-size: 13px;
}

.plan-vol-row span {
  color: var(--text-secondary);
  margin-right: 6px;
}

.plan-card-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 13px;
}

.offline-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 10px;
  height: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  cursor: default;
  flex-shrink: 0;
}

.prorab-env-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 149, 0, 0.92);
  color: #1a1208;
  margin-right: 6px;
}

.prorab-env-badge[data-env="staging"] {
  background: rgba(255, 59, 48, 0.9);
  color: #fff;
}

.offline-status-dot {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #22c55e;
}

.offline-status.is-syncing .offline-status-dot {
  background: #eab308;
  animation: offline-status-pulse 1.25s ease-in-out infinite;
}

.offline-status.is-offline .offline-status-dot,
.offline-status.is-error .offline-status-dot,
.offline-status.is-conflict .offline-status-dot {
  background: #ef4444;
  animation: none;
}

.offline-status.is-synced .offline-status-dot {
  background: #22c55e;
  animation: none;
}

@keyframes offline-status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.offline-preparation {
  position: fixed;
  z-index: 1290;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 24px));
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-float);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 12px;
  align-items: center;
}

.offline-preparation.hidden { display: none; }
.offline-preparation div { display: grid; gap: 3px; }
.offline-preparation span { color: var(--muted); font-size: 12px; }
.offline-preparation progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: var(--accent); }
.offline-preparation button { border: 0; background: var(--surface-muted); border-radius: 10px; padding: 8px 10px; }

.sync-local-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-size: 12px;
  font-weight: 700;
}

.offline-first-use {
  margin: 24px auto;
  max-width: 520px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: center;
}

.offline-conflict-modal {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, .62);
}

.offline-conflict-card { width: min(680px, 100%); max-height: 90vh; overflow: auto; padding: 22px; border-radius: 20px; background: #fff; }
.offline-conflict-versions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.offline-conflict-versions section { padding: 12px; border-radius: 12px; background: var(--surface-muted); overflow-wrap: anywhere; }
.offline-conflict-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.offline-conflict-actions button { min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px; font-weight: 700; }

.offline-fallback-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.offline-fallback-card { max-width: 420px; padding: 28px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-float); text-align: center; }
.offline-fallback-card button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }

@media (max-width: 480px) {
  .offline-conflict-versions { grid-template-columns: 1fr; }
}

.plan-progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8ecf2; }
.plan-progress-fill { display: block; max-width: 100%; height: 100%; border-radius: inherit; background: #ff3b30; }
.plan-progress-text { min-width: 42px; text-align: right; font-weight: 700; }

.plan-card-workers {
  font-size: 13px;
  margin-bottom: 4px;
}

.plan-card-deviation,
.plan-card-reason {
  font-size: 13px;
  margin: 4px 0;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.plan-segmented { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }

.work-plan-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 14px; }
.work-plan-tabs button { border: 1px solid #d1d1d6; border-radius: 10px; padding: 10px; background: #fff; font-weight: 600; }
.work-plan-tabs button.active { color: #fff; border-color: #007aff; background: #007aff; }
.work-plan-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.work-plan-totals span { padding: 10px; border-radius: 10px; background: #f2f2f7; font-size: 12px; }
.work-plan-totals strong { display: block; margin-top: 4px; font-size: 15px; }
.work-schedule { display: flex; flex-wrap: wrap; gap: 9px; margin: 14px 0; padding: 12px; border: 1px solid #e5e5ea; border-radius: 12px; }
.work-schedule legend { font-weight: 600; }
.work-schedule label { display: inline-flex; gap: 4px; align-items: center; }
.work-schedule button { width: 100%; }
.work-plan-weekdays, .work-plan-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.work-plan-weekdays { margin-bottom: 5px; color: #6e6e73; font-size: 10px; font-weight: 700; text-align: center; }
.work-plan-weekdays .is-weekend { color: #d70015; }
.work-plan-day-spacer { min-width: 0; }
.work-plan-records { display: grid; gap: 6px; margin-bottom: 12px; }
.work-plan-records div { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; border-radius: 9px; background: #f2f2f7; }
.work-plan-records span, .work-plan-records small, .work-plan-records em { display: block; }
.work-plan-records small, .work-plan-records em { color: var(--muted); font-size: 12px; font-style: normal; }
.work-plan-records button { border: 0; background: transparent; color: #ff3b30; font-size: 22px; }
.work-plan-editor { margin-bottom: 14px; padding: 12px; border: 1px solid #e5e5ea; border-radius: 12px; background: #fafafa; }
.work-plan-editor h4, .work-plan-editor p { margin: 0 0 6px; }
.work-plan-editor-error { margin: 8px 0; padding: 9px; border-radius: 9px; background: #fff1f0; color: #d70015; }
.work-plan-day { min-width: 0; min-height: 78px; padding: 7px; border: 1px solid #e5e5ea; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; background: #fff; color: var(--text); text-align: left; cursor: pointer; transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease; }
.work-plan-day:hover, .work-plan-day:focus-visible { border-color: var(--accent); box-shadow: 0 3px 10px rgba(43,107,255,.15); outline: 2px solid var(--accent); outline-offset: 1px; }
.work-plan-day:active { transform: scale(.96); }
.work-plan-day-date { display: block; color: #6e6e73; font-size: 11px; line-height: 1.1; font-weight: 600; }
.work-plan-day-volume { display: block; min-width: 0; margin-top: 4px; color: var(--text); font-size: 17px; line-height: 1.1; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-plan-day-unit { display: block; min-width: 0; margin-top: 1px; color: #6e6e73; font-size: 10px; line-height: 1.1; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-plan-day-source { display: block; min-width: 0; margin-top: auto; padding-top: 5px; color: #6e6e73; font-size: 9px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-plan-day--warning { border-color: #ff9500; background: #fff8ee; }
.work-plan-day--weekend { border-color: #ffb3b0; background: #fff7f7; }
.work-plan-day--weekend .work-plan-day-date, .work-plan-day--holiday .work-plan-day-date { color: #d70015; }
.work-plan-day--weekend:hover, .work-plan-day--weekend:focus-visible { border-color: #ff9f9b; }

@media (max-width: 600px) {
  .work-plan-totals { grid-template-columns: 1fr; }
  .work-plan-weekdays, .work-plan-calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .work-plan-day { min-height: 70px; padding: 5px 3px; }
  .work-plan-day-volume { font-size: 12px; }
  .work-plan-day-unit { font-size: 9px; }
  .work-plan-day-source { font-size: 7px; }
}

.plan-btn {
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.plan-btn-primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
}

.plan-btn-secondary {
  background: #f2f2f7;
  color: var(--accent);
}

.plan-btn-icon {
  width: 44px;
  padding: 10px;
  background: #f2f2f7;
  font-size: 18px;
  line-height: 1;
}

.plan-card-menu {
  position: absolute;
  right: 16px;
  bottom: 56px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 10;
  overflow: hidden;
  min-width: 160px;
}

.plan-card-menu button {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: #fff;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.plan-card-menu button:hover {
  background: #f2f2f7;
}

.plan-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.plan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.plan-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 16px 20px calc(20px + var(--safe-bottom));
  z-index: 1;
}

body.plan-modal-open { overflow: hidden; }

.plan-modal-header {
  position: sticky;
  top: -16px;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  margin: 0 -4px 14px;
  padding: 12px 4px 10px;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid #eceef1;
}

.plan-modal-header button { min-width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: #f2f2f7; cursor: pointer; font-weight: 600; }
.plan-modal-back { padding: 0 10px; color: var(--accent); }
.plan-modal-close { margin-right: 8px; font-size: 28px; line-height: 1; }

.plan-modal-handle {
  width: 36px;
  height: 4px;
  background: #d1d1d6;
  border-radius: 2px;
  margin: 0 auto 12px;
}

.plan-modal-title {
  font-size: 18px;
  font-weight: 700;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-modal-confirm { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.42); }
.plan-modal-confirm > div { width: min(360px, 100%); padding: 18px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-float); }
.plan-modal-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.plan-modal-confirm-actions button { min-height: 44px; border: 0; border-radius: 10px; background: #f2f2f7; font-weight: 600; }

.plan-contractor-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.plan-contractor-row select {
  flex: 1;
}

.plan-fact-context {
  background: #f2f2f7;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.plan-fact-context p {
  margin: 4px 0;
  color: var(--text-secondary);
}

.plan-fact-plan {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-size: 13px;
}

.plan-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

@media (min-width: 601px) {
  .plan-summary {
    grid-template-columns: repeat(6, 1fr);
  }

  .plan-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1025px) {
  .plan-filters-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .plan-modal {
    align-items: center;
  }

  .plan-modal-sheet {
    border-radius: 20px;
    max-height: 85vh;
  }
}

body.section-mode .voice-fab {
  bottom: calc(var(--safe-bottom) + 16px);
}

/* ===== PLAN MOBILE UX (<=600px) ===== */

@media (max-width: 600px) {
  .plan-screen {
    max-width: none;
  }

  .plan-project-name {
    font-size: 13px;
    margin: 0 0 8px;
    color: var(--text-secondary);
    font-weight: 600;
  }

  .plan-summary {
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 8px 6px;
    margin-bottom: 10px;
    border-radius: 12px;
  }

  .plan-summary-label {
    font-size: 9px;
    letter-spacing: 0.02em;
  }

  .plan-summary-item strong {
    font-size: 13px;
  }

  .plan-fab-add {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .plan-filters-actions {
    display: flex;
  }

  .plan-segmented {
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 3px;
    margin-bottom: 10px;
    background: #e9e9eb;
    border-radius: 10px;
  }

  .plan-segment {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
    line-height: 1.2;
  }

  .plan-segment.active {
    background: #fff;
    color: var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  }

  .plan-segment--date {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
  }

  .plan-segment-text {
    pointer-events: none;
  }

  .plan-segment-date-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    margin: 0;
    padding: 0;
  }

  .plan-toolbar {
    margin-bottom: 10px;
    gap: 8px;
  }

  .plan-toolbar--fab-visible .plan-add-btn {
    visibility: hidden;
    pointer-events: none;
  }

  .plan-add-btn {
    min-height: 48px;
    font-size: 15px;
  }

  .plan-filters-btn {
    min-width: 48px;
    min-height: 48px;
    padding: 12px 14px;
    flex-shrink: 0;
  }

  .plan-fab-add {
    position: fixed;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 30px;
    font-weight: 400;
    line-height: 1;
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.35);
    z-index: 85;
    cursor: pointer;
  }

  .plan-fab-add:active {
    transform: scale(0.94);
  }

  .plan-list {
    gap: 10px;
  }

  .plan-card-body {
    padding: 12px 14px 14px;
  }

  .plan-card-title {
    font-size: 15px;
  }

  .plan-card-location {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .plan-card-secondary {
    font-size: 12px;
    color: var(--muted);
    margin: 0;
  }

  .plan-card-contractor {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .plan-card-volumes {
    margin-bottom: 4px;
  }

  .plan-card-workers {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
  }

  .plan-card-progress,
  .plan-card-deviation,
  .plan-card-reason {
    font-size: 12px;
  }

  .plan-card-actions {
    margin-top: 10px;
    gap: 8px;
    align-items: stretch;
  }

  .plan-btn-fact {
    flex: 1;
    min-height: 50px;
    font-size: 15px;
  }

  .plan-btn-icon {
    flex: 0 0 48px;
    width: 48px;
    min-height: 48px;
    font-size: 14px;
    letter-spacing: 1px;
  }

  .plan-card-menu {
    bottom: 60px;
    right: 14px;
  }

  .plan-filters-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
  }

  .plan-filters-actions .save-button,
  .plan-filters-actions .plan-btn {
    min-height: 48px;
  }

  .fact-success-actions .save-button,
  .fact-success-actions .secondary-button {
    min-height: 50px;
  }

  .form .save-button {
    min-height: 50px;
  }
}

/* ==========================
   ЗАМЕЧАНИЯ
   ========================== */

.issues-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: calc(16px + var(--safe-bottom));
}

.issues-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  background: #f2f2f7;
  border-radius: 14px;
  padding: 10px 8px;
}

.issues-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.issues-summary-label {
  font-size: 10px;
  color: #636366;
  text-align: center;
  line-height: 1.2;
}

.issues-summary-item strong {
  font-size: 16px;
  font-weight: 700;
}

.issues-search-row {
  margin-top: 2px;
}

.issues-search {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
  background: #fff;
}

.issues-toolbar {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.issues-create-btn {
  flex: 1;
  min-height: 50px;
  border: none;
  border-radius: 14px;
  background: #007aff;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.issues-toolbar--fab-visible .issues-create-btn {
  visibility: hidden;
  pointer-events: none;
}

.issues-filters-btn {
  min-width: 48px;
  min-height: 50px;
  border: 1px solid #d1d1d6;
  border-radius: 14px;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}

.issues-fab-add {
  position: fixed;
  right: 16px;
  bottom: calc(72px + var(--safe-bottom));
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.35);
  z-index: 120;
  cursor: pointer;
}

.issues-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.issues-card {
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.issues-card--overdue {
  border-color: #ff3b30;
  background: #fff8f8;
}

.issues-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.issues-card-overdue {
  color: #ff3b30;
  font-size: 12px;
  font-weight: 700;
}

.issues-card-priority,
.issues-detail-priority {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f2f7;
  color: #636366;
}

.issues-priority--important {
  background: #fff4e5;
  color: #ff9500;
}

.issues-priority--critical {
  background: #ffebea;
  color: #ff3b30;
}

.issues-card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
}

.issues-card-location,
.issues-card-contractor,
.issues-card-deadline {
  margin: 0;
  font-size: 14px;
  color: #636366;
}

.issues-card-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.issues-btn {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #d1d1d6;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 14px;
}

.issues-btn-secondary {
  background: #f2f2f7;
}

.issues-card-open {
  width: 100%;
  margin-top: 4px;
}

.issues-filters {
  background: #f9f9fb;
  border-radius: 14px;
  padding: 12px;
}

.issues-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.issues-filters-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #636366;
}

.issues-filters-grid select {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #d1d1d6;
  padding: 8px 10px;
  font-size: 14px;
}

.issues-filter-checkbox {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 14px !important;
}

.issues-filters-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.issues-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.issues-chip {
  min-height: 40px;
  border: 1px solid #d1d1d6;
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

.issues-chip.active {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
}

.issues-chip-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.issues-chip-date input[type="date"] {
  border: none;
  background: transparent;
  font-size: 14px;
  min-height: auto;
  padding: 0;
}

.issues-form-section {
  margin-bottom: 18px;
}

.issues-form-heading {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.issues-form-hint {
  margin: 8px 0 0;
  font-size: 13px;
  color: #8e8e93;
}

.issues-form-error {
  margin: 8px 0 12px;
  padding: 9px;
  border-radius: 9px;
  background: #fff1f0;
  color: #d70015;
}

.issues-photo-zone,
.issues-photo-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 120px;
  border: 2px dashed #c7c7cc;
  border-radius: 16px;
  background: #f9f9fb;
  text-align: center;
  cursor: pointer;
  padding: 16px;
}

.issues-photo-pick--compact {
  min-height: 72px;
}

.issues-photo-pick-title {
  font-size: 18px;
  font-weight: 600;
}

.issues-photo-pick-sub {
  font-size: 14px;
  color: #8e8e93;
}

.issues-photo-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.issues-photo-thumb-wrap {
  position: relative;
}

.issues-photo-thumb-wrap img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
}

.issues-photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #ff3b30;
  color: #fff;
  cursor: pointer;
}

.issues-description-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.issues-description-row textarea {
  flex: 1;
  min-height: 110px;
}

.issues-mic-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  background: #f2f2f7;
  font-size: 18px;
  opacity: 0.5;
}

.issues-contractor-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.issues-contractor-row select {
  flex: 1;
}

.issues-deadline-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.issues-sticky-actions {
  position: sticky;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  margin-top: 12px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 30%);
  z-index: 5;
}

body.section-mode .issues-sticky-actions {
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 20;
}

body.section-mode .section-body:has(.issues-screen--form) {
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.issues-screen--detail {
  overflow-x: hidden;
}

.issues-screen--with-actions {
  --issues-action-bar-height: 76px;
  padding-bottom: calc(var(--issues-action-bar-height) + 64px + env(safe-area-inset-bottom, 0px));
}

.issues-screen--actions-2 {
  --issues-action-bar-height: 136px;
}

.issues-detail-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px clamp(12px, 4vw, 16px) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
  max-width: 100%;
}

.issues-save-btn,
.issues-action-btn {
  width: 100%;
  min-height: 52px !important;
}

.issues-action-btn--file {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  cursor: pointer;
  text-align: center;
}

.issues-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.issues-detail-overdue {
  color: #ff3b30;
  font-size: 12px;
  font-weight: 700;
}

.issues-detail-overdue-meta {
  margin: -4px 0 8px;
  color: #ff3b30;
  font-size: 13px;
  font-weight: 600;
}

.issues-detail-number {
  font-size: 18px;
  font-weight: 700;
}

.issues-detail-status {
  font-size: 13px;
  font-weight: 700;
}

.issues-photo-group-title {
  margin: 16px 0 8px;
  font-size: 14px;
}

.issues-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issues-gallery-main {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  background: #f2f2f7;
  cursor: pointer;
}

.issues-gallery-main img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.issues-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.issues-gallery-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  background: #f2f2f7;
  cursor: pointer;
  scroll-snap-align: start;
}

.issues-gallery-thumb.active {
  border-color: #007aff;
}

.issues-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.issues-photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.issues-photo-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
}

.issues-photo-viewer-body {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  padding: 48px 16px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.issues-photo-viewer-img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 8px;
}

.issues-photo-viewer-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.issues-photo-viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.issues-photo-viewer-prev { left: 8px; }
.issues-photo-viewer-next { right: 8px; }

.issues-photo-viewer-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.issues-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.issues-detail-grid > div {
  background: #f2f2f7;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.issues-detail-grid span {
  font-size: 12px;
  color: #8e8e93;
}

.issues-photo-gallery img,
.issues-ba-panel img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 12px;
}

.issues-before-after-panels {
  display: block;
}

.issues-before-after-grid--desktop {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.issues-ba-panel.hidden {
  display: none;
}

.issues-ba-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #636366;
}

.issues-ba-empty {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f2f7;
  border-radius: 12px;
  color: #8e8e93;
}

.issues-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issues-history-list li {
  background: #f2f2f7;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.issues-history-comment {
  color: #636366;
  line-height: 1.4;
}

.issues-history-list time {
  font-size: 12px;
  color: #8e8e93;
}

.issues-success {
  text-align: center;
  padding: 24px 0;
}

.issues-success-badge {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.issues-success-title {
  margin: 0 0 8px;
  font-size: 28px;
}

.issues-success-meta,
.issues-success-contractor,
.issues-success-deadline {
  margin: 0 0 6px;
  color: #636366;
}

.issues-success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

@media (min-width: 768px) {
  .issues-list {
    grid-template-columns: 1fr 1fr;
  }

  .issues-before-after-grid--desktop {
    display: grid;
  }

  .issues-before-after-panels,
  .issues-before-after-tabs {
    display: none;
  }
}

@media (max-width: 600px) {
  .issues-summary-label {
    font-size: 9px;
  }

  .issues-summary-item strong {
    font-size: 15px;
  }

  .issues-filters-grid {
    grid-template-columns: 1fr;
  }

  .issues-screen--with-actions {
    padding-bottom: calc(var(--issues-action-bar-height) + 72px + env(safe-area-inset-bottom, 0px));
  }

  .issues-sticky-actions {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  body.section-mode:has(.issues-screen--with-actions) .voice-fab {
    bottom: calc(var(--issues-action-bar-height) + 72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 1025px) {
  .issues-detail-action-bar {
    bottom: env(safe-area-inset-bottom, 0px);
    max-width: 600px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
  }

  .issues-screen--with-actions {
    padding-bottom: calc(var(--issues-action-bar-height) + 20px + env(safe-area-inset-bottom, 0px));
  }

  .materials-detail-action-bar {
    bottom: env(safe-area-inset-bottom, 0px);
    max-width: 600px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-radius: 20px 20px 0 0;
  }

  .materials-screen--with-actions {
    padding-bottom: calc(var(--materials-action-bar-height) + 20px + env(safe-area-inset-bottom, 0px));
  }
}

/* ==========================
   МАТЕРИАЛЫ
   ========================== */

.materials-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.materials-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  background: #f2f2f7;
  border-radius: 14px;
  padding: 10px 8px;
}

.materials-summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.materials-summary-label {
  font-size: 10px;
  color: #636366;
  text-align: center;
  line-height: 1.2;
}

.materials-summary-item strong {
  font-size: 15px;
  font-weight: 700;
}

.materials-search {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 16px;
}

.materials-toolbar {
  display: flex;
  gap: 8px;
}

.materials-create-btn {
  flex: 1;
  min-height: 50px;
  border: none;
  border-radius: 14px;
  background: #007aff;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.materials-toolbar--fab-visible .materials-create-btn {
  visibility: hidden;
  pointer-events: none;
}

.materials-filters-btn {
  min-width: 48px;
  min-height: 50px;
  border: 1px solid #d1d1d6;
  border-radius: 14px;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
}

.materials-fab-add {
  position: fixed;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: #007aff;
  color: #fff;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.35);
  z-index: 120;
  cursor: pointer;
}

.materials-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.materials-card {
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.materials-card--overdue {
  border-color: #ff3b30;
  background: #fff8f8;
}

.materials-card-overdue,
.materials-card-risk {
  font-size: 12px;
  font-weight: 700;
}

.materials-card-overdue { color: #ff3b30; }
.materials-card-risk { color: #ff9500; }

.materials-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.materials-card-qty,
.materials-card-work,
.materials-card-location,
.materials-card-date,
.materials-card-status,
.materials-card-responsible,
.materials-card-overdue-meta {
  margin: 0;
  font-size: 14px;
  color: #636366;
}

.materials-card-work-label {
  margin: 4px 0 0;
  font-size: 12px;
  color: #8e8e93;
}

.materials-btn {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #d1d1d6;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 14px;
}

.materials-btn-secondary { background: #f2f2f7; }

.materials-card-open { width: 100%; margin-top: 6px; }

.materials-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.materials-filters-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #636366;
}

.materials-filters-grid select,
.materials-filters-grid input[type="date"] {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid #d1d1d6;
  padding: 8px 10px;
  font-size: 14px;
}

.materials-filter-checkbox {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  font-size: 14px !important;
}

.materials-chips,
.materials-deadline-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.materials-chip {
  min-height: 40px;
  border: 1px solid #d1d1d6;
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}

.materials-chip.active {
  background: #007aff;
  border-color: #007aff;
  color: #fff;
}

.materials-chip-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.materials-chip-date input[type="date"] {
  border: none;
  background: transparent;
  font-size: 14px;
  padding: 0;
}

.materials-sticky-actions {
  position: sticky;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  margin-top: 12px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 30%);
}

.materials-save-btn,
.materials-action-btn {
  width: 100%;
  min-height: 52px !important;
}

.materials-screen--with-actions {
  --materials-action-bar-height: 76px;
  padding-bottom: calc(var(--materials-action-bar-height) + 64px + env(safe-area-inset-bottom, 0px));
}

.materials-screen--actions-2 {
  --materials-action-bar-height: 136px;
}

.materials-detail-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px clamp(12px, 4vw, 16px) calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.06);
}

.materials-detail-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.materials-detail-overdue { color: #ff3b30; font-size: 12px; font-weight: 700; }
.materials-detail-overdue-meta,
.materials-detail-risk {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.materials-detail-overdue-meta { color: #ff3b30; }
.materials-detail-risk { color: #ff9500; }

.materials-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.materials-detail-grid > div {
  background: #f2f2f7;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.materials-detail-grid span {
  font-size: 12px;
  color: #8e8e93;
}

.materials-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.materials-history-list li {
  background: #f2f2f7;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.materials-history-list time {
  font-size: 12px;
  color: #8e8e93;
}

.plan-materials-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 4px 0 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d1d1d6;
  background: #f9f9fb;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.plan-materials-chip--green { border-color: #34c759; color: #248a3d; background: #eefbf2; }
.plan-materials-chip--yellow { border-color: #ff9500; color: #c93400; background: #fff8ee; }
.plan-materials-chip--red { border-color: #ff3b30; color: #d70015; background: #fff1f0; }

@media (min-width: 768px) {
  .materials-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .materials-summary-label { font-size: 9px; }
  .materials-summary-item strong { font-size: 14px; }
  .materials-filters-grid { grid-template-columns: 1fr; }
  .materials-screen--with-actions {
    padding-bottom: calc(var(--materials-action-bar-height) + 72px + env(safe-area-inset-bottom, 0px));
  }
  body.section-mode:has(.materials-screen--with-actions) .voice-fab {
    bottom: calc(var(--materials-action-bar-height) + 72px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Daily operational home */
.today-dashboard { display: grid; gap: 16px; }
.today-loading, .today-error, .today-empty { padding: 28px 18px; text-align: center; color: var(--muted); background: #fff; border-radius: 18px; }
.today-error button { min-height: 44px; margin-top: 12px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 700; }
.today-overview { padding: 20px; border-radius: 22px; background: linear-gradient(145deg, #172231, #26384d); color: #fff; box-shadow: var(--shadow-float); }
.today-overview--alert { background: linear-gradient(145deg, #24202a, #3e2d32); }
.today-kicker, .today-section-head span { display: block; margin-bottom: 5px; color: #ffbd69; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.today-overview h2 { margin: 0 0 16px; font-size: 22px; line-height: 1.15; }
.today-signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.today-signal { min-height: 64px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px; background: rgba(255,255,255,.08); color: inherit; text-align: left; }
button.today-signal { cursor: pointer; }
.today-signal strong { display: block; font-size: 21px; line-height: 1; }
.today-signal span { display: block; margin-top: 5px; color: rgba(255,255,255,.72); font-size: 11px; line-height: 1.2; }
.today-signal.is-danger { background: rgba(255,59,48,.2); border-color: rgba(255,110,102,.35); }
.today-signal.is-warning { background: rgba(255,159,10,.2); border-color: rgba(255,190,86,.35); }
.today-workers { margin: 14px 0 12px; color: rgba(255,255,255,.88); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.today-workers .icon { width: 18px; height: 18px; flex-shrink: 0; }
.today-walkthrough { width: 100%; min-height: 50px; border: 0; border-radius: 14px; background: #ff9f0a; color: #1d2026; font-size: 15px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.today-walkthrough .icon { width: 20px; height: 20px; }
.today-section { padding: 16px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-card); }
.today-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.today-section-head span { color: var(--accent); }
.today-section-head h3 { margin: 0; font-size: 19px; }
.today-section-head > strong { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px; background: #fff0ef; color: var(--danger); }
.today-section-head button { min-height: 44px; border: 0; background: transparent; color: var(--accent); font-weight: 700; }
.today-attention-list, .today-work-list { display: grid; gap: 10px; }
.today-period-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.today-period-tabs button { min-width: 0; padding: 9px 6px; border: 1px solid #d1d1d6; border-radius: 10px; background: #fff; color: var(--text); font-weight: 600; }
.today-period-tabs button.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.today-period-error { margin-bottom: 10px; padding: 10px; border-radius: 10px; background: #fff1f0; color: #d70015; font-size: 13px; }
.today-attention { display: flex; align-items: center; width: 100%; min-height: 72px; padding: 11px 10px; border: 1px solid #eceef1; border-radius: 15px; background: #fff; color: var(--text); text-align: left; }
.today-attention-icon { display: grid; place-items: center; flex: 0 0 40px; height: 40px; margin-right: 10px; border-radius: 12px; background: #f5f6f8; color: #334155; }
.today-attention-icon .icon { width: 20px; height: 20px; }
.attention-chevron .icon { width: 18px; height: 18px; color: #8b95a5; }
.today-attention-body { min-width: 0; flex: 1; }
.today-attention-body strong, .today-attention-body span, .today-attention-body small, .today-attention-body em { display: block; }
.today-attention-body strong { font-size: 14px; line-height: 1.25; }
.today-attention-body span, .today-attention-body small { margin-top: 3px; color: var(--muted); font-size: 12px; font-style: normal; }
.today-attention-body em { margin-top: 5px; color: var(--danger); font-size: 10px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.today-work { position: relative; display: flex; overflow: hidden; border: 1px solid #eceef1; border-radius: 16px; background: #fff; }
.today-work-bar { flex: 0 0 5px; background: #c7c7cc; }
.today-work--red .today-work-bar { background: #ff3b30; }.today-work--green .today-work-bar { background: #34c759; }.today-work--blue .today-work-bar { background: #007aff; }
.today-work-body { min-width: 0; flex: 1; padding: 14px; }
.today-work-head { display: flex; justify-content: space-between; gap: 10px; }
.today-work-head h4 { margin: 0; font-size: 15px; line-height: 1.25; }.today-work-head p, .today-work-contractor { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.today-work-head > strong { color: var(--accent); font-size: 17px; }
.today-work-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.today-work-stats span { padding: 9px; border-radius: 10px; background: #f6f7f9; color: var(--muted); font-size: 10px; }.today-work-stats strong { display: block; margin-top: 3px; color: var(--text); font-size: 12px; }
.today-material { min-height: 44px; margin-top: 8px; padding: 0 12px; border: 0; border-radius: 11px; font-weight: 700; }.today-material--red { background: #fff0ef; color: #d52b1e; }.today-material--yellow { background: #fff7e6; color: #9a5a00; }.today-material--green { background: #eaf8ee; color: #187a35; }
.today-fact-btn { width: 100%; min-height: 46px; margin-top: 10px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-weight: 800; }.today-fact-btn.is-secondary { background: #eef4fb; color: var(--accent); }
.today-works-section { min-width: 0; }
body:not(.section-mode) .hero {
  height: calc(208px + env(safe-area-inset-top, 0px));
  min-height: calc(208px + env(safe-area-inset-top, 0px));
  max-height: none;
}
body:not(.section-mode) .hero-subtitle { display: none; }
body:not(.section-mode) .hero-content {
  justify-content: flex-start;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  padding-bottom: 10px;
}
body:not(.section-mode) .hero-title {
  font-size: 22px;
}
body:not(.section-mode) .hero-date {
  margin-top: 2px;
  font-size: 12px;
}

@media (max-width: 600px) {
  .plan-modal-header { grid-template-columns: 78px minmax(0, 1fr) 44px; }
  .plan-modal-back { padding: 0 6px; font-size: 13px; }
  .plan-modal-title { font-size: 15px; }
  .today-period-tabs { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .today-dashboard { margin-top: 14px; gap: 12px; }
  .today-overview { padding: 17px; border-radius: 19px; }
  .today-section { padding: 14px; border-radius: 18px; }
  body:not(.section-mode) .hero {
    height: calc(214px + env(safe-area-inset-top, 0px));
    min-height: calc(214px + env(safe-area-inset-top, 0px));
    max-height: none;
  }
  body:not(.section-mode) .hero-title { font-size: 22px; }
  body:not(.section-mode) .hero-object { margin-top: 8px; padding: 7px 10px; }
  body:not(.section-mode) .hero-content {
    justify-content: flex-start;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
  }
  .glass-select { font-size: 15px; }
}

@media (min-width: 760px) and (max-width: 1099px) {
  .today-work-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .today-dashboard {
    grid-template-columns: minmax(360px, 0.75fr) minmax(700px, 1.8fr);
    grid-template-areas:
      "overview attention"
      "works works";
    align-items: start;
    column-gap: 24px;
    row-gap: 16px;
  }

  .today-overview {
    grid-area: overview;
    width: 100%;
    min-width: 0;
    max-width: 440px;
    justify-self: start;
  }

  #attentionBlock {
    grid-area: attention;
    align-self: start;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .today-works-section {
    grid-area: works;
    width: 100%;
  }

  .today-work-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

@media (min-width: 1500px) {
  .today-work-list {
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  }
}

@media (min-width: 1900px) {
  .today-dashboard {
    grid-template-columns: minmax(360px, 0.75fr) minmax(720px, 1.85fr);
  }

  .today-work-list {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  }
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(10, 16, 24, 0.72);
}

.auth-gate.hidden {
  display: none;
}

.auth-gate-card {
  width: min(100%, 420px);
  padding: 1.5rem;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.auth-gate-title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}

.auth-gate-subtitle {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.auth-gate-form {
  display: grid;
  gap: 0.75rem;
}

.auth-gate-error {
  margin: 0 0 1rem;
  color: #b42318;
}

.auth-gate-switch {
  margin-top: 1rem;
  border: 0;
  background: none;
  color: #1a4f8b;
  cursor: pointer;
}

.app-shell.auth-locked > :not(#authGate) {
  pointer-events: none;
  user-select: none;
  filter: blur(2px);
}
