/* Site PM — mobile-first builder UI (UI Refresh) */

#pmApp {
  min-height: calc(100vh - 140px);
  padding-bottom: 80px;
}

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

.pm-project-detail-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.pm-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.pm-back {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 0;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
}
.pm-back:hover { text-decoration: underline; }

.pm-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.pm-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  min-height: 40px;
  transition: all 0.12s ease;
}
.pm-tab.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.pm-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom));
  max-width: 100%;
  box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.04);
}

.pm-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  min-height: 52px;
  padding: 4px;
  border-radius: var(--radius, 8px);
  transition: color 0.12s ease;
}
.pm-nav-btn:hover { color: var(--text); }
.pm-nav-btn.active { color: var(--accent); }
.pm-nav-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--accent));
}
.pm-nav-icon { font-size: 18px; line-height: 1; }

.pm-project-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pm-project-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg, 10px);
  padding: 16px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.12s ease, background 0.12s ease;
  min-height: 44px;
}
.pm-project-card:hover {
  border-color: var(--ui-border-strong, #D1D5DB);
  background: var(--ui-surface-hover, #F9FAFB);
}
.pm-project-card:active { background: #F3F4F6; }
.pm-project-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring, 0 0 0 2px var(--accent));
}

.pm-project-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.pm-project-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.pm-status {
  display: inline-flex;
  margin-top: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  background: #EFF6FF;
  color: var(--accent);
}
.pm-status[data-status="active"],
.pm-status[data-status="in_progress"] {
  background: #ECFDF5;
  color: #059669;
}
.pm-status[data-status="completed"],
.pm-status[data-status="done"] {
  background: #F3F4F6;
  color: #6B7280;
}

.pm-card {
  padding: 4px 16px;
}

.pm-task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.pm-task-row:last-child { border-bottom: none; }

.pm-task-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.pm-task-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.pm-task-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.pm-task-overdue { color: var(--danger); font-weight: 600; }

.pm-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #FFFBEB;
  color: #92400E;
  margin-left: 6px;
}
.pm-badge.done { background: #ECFDF5; color: #059669; }
.pm-badge.confirmed { background: #EFF6FF; color: #1E40AF; }

.pm-timeline-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.pm-timeline-item:last-child { border-bottom: none; }
.pm-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex-shrink: 0;
}

.pm-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) {
  .pm-photo-grid { grid-template-columns: repeat(3, 1fr); }
}

.pm-photo-item {
  aspect-ratio: 1;
  border-radius: var(--radius-lg, 10px);
  overflow: hidden;
  background: #E5E7EB;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
  transition: opacity 0.12s ease;
}
.pm-photo-item:hover { opacity: 0.92; }
.pm-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pm-cal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.pm-cal-month {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
}

.pm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  font-size: 12px;
}
.pm-cal-head {
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 0;
  font-size: 11px;
}
.pm-cal-day {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  padding: 6px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.pm-cal-day:hover { border-color: var(--ui-border-strong, #D1D5DB); }
.pm-cal-day.has-tasks {
  border-color: var(--accent);
  background: #EFF6FF;
}
.pm-cal-day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.pm-cal-day.other { opacity: 0.4; }
.pm-cal-num { font-weight: 600; font-size: 12px; }
.pm-cal-count {
  color: var(--accent);
  font-weight: 600;
  margin-top: 2px;
  font-size: 10px;
}

.pm-empty,
.pm-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}

.pm-fab-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pm-voice-btn {
  flex: 1;
  min-height: 52px;
  min-width: 140px;
  border: 1px solid var(--accent);
  background: #EFF6FF;
  color: var(--accent);
  border-radius: var(--radius-lg, 10px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.pm-voice-btn:hover { background: #DBEAFE; }
.pm-voice-btn.listening {
  background: var(--accent);
  color: #fff;
  animation: pm-pulse 1s infinite;
}
@keyframes pm-pulse { 50% { opacity: 0.75; } }

.pm-form-row { margin-bottom: 14px; }
.pm-form-row label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.pm-form-row input,
.pm-form-row textarea,
.pm-form-row select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius, 8px);
  font-size: 16px;
  font-family: inherit;
}

.pm-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pm-btn-sm {
  padding: 8px 14px;
  font-size: 13px;
  border-radius: var(--radius, 8px);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  font-weight: 500;
  transition: background 0.12s ease;
}
.pm-btn-sm:hover { background: #F9FAFB; }
.pm-btn-sm.primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.pm-btn-sm.primary:hover { background: #1E293B; }

#page-pm {
  padding-bottom: 0;
}

@media (min-width: 768px) {
  #pmApp {
    max-width: 720px;
  }
  .pm-bottom-nav {
    max-width: 720px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 12px 12px 0 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  #pmApp { padding-bottom: 88px; }
}

.pm-setup-card{padding:28px;border:1px solid #bfdbfe;border-radius:18px;background:linear-gradient(145deg,#eff6ff,#fff);color:#0f172a}.pm-setup-kicker{font-size:10px;letter-spacing:.14em;font-weight:800;color:#2563eb}.pm-setup-card h3{font-size:22px;margin:10px 0 8px}.pm-setup-card p{color:#64748b}.pm-setup-card code{background:#dbeafe;padding:3px 7px;border-radius:6px}.pm-connection-note{margin-top:20px;padding:16px;border-radius:12px;background:#0f172a;color:#fff}.pm-connection-note strong,.pm-connection-note span{display:block}.pm-connection-note span{font-size:12px;color:#cbd5e1;margin-top:6px}
