:root {
  --bg: #070b10;
  --bg2: #0e141c;
  --card: #141c28;
  --card-hover: #1a2433;
  --border: #243041;
  --border-soft: rgba(36, 48, 65, 0.7);
  --text: #e8eef7;
  --muted: #8b9bb0;
  --accent: #3ddc97;
  --accent-2: #5aa2ff;
  --accent-dim: rgba(61, 220, 151, 0.14);
  --warn: #f5a524;
  --warn-dim: rgba(245, 165, 36, 0.15);
  --danger: #ff5c7a;
  --danger-dim: rgba(255, 92, 122, 0.15);
  --info: #5aa2ff;
  --info-dim: rgba(90, 162, 255, 0.15);
  --chip: #1c2533;
  --glow: 0 0 0 1px rgba(61, 220, 151, 0.08), 0 10px 30px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --nav-h: 64px;
  --radius: 16px;
  --tap: 44px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-family: var(--font);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body {
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
  background-image:
    radial-gradient(1200px 600px at 50% -200px, rgba(61, 220, 151, 0.08), transparent 60%),
    radial-gradient(800px 400px at 100% 0%, rgba(90, 162, 255, 0.05), transparent 50%);
  background-attachment: fixed;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; border: none; background: none; }

.pressable {
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}
.pressable:active {
  transform: scale(0.97);
  filter: brightness(1.08);
}

.app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-h) + 18px + var(--safe-bottom));
}

.screen { display: block; }
.screen.hidden { display: none !important; }
.screen-body { padding: 12px; }
.loading-inline {
  color: var(--muted);
  padding: 28px 8px;
  text-align: center;
  font-size: 14px;
}

/* Skeletons */
.skeleton-stack { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.skeleton {
  background: linear-gradient(90deg, #121821 0%, #1a2430 50%, #121821 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
}
.sk-banner { height: 48px; }
.sk-week { height: 72px; }
.sk-stat { height: 160px; }
.sk-card { height: 96px; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 11, 16, 0.88);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border-soft);
  padding: calc(8px + var(--safe-top)) 12px 10px;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.header-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.header-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text);
}

.date-nav {
  display: grid;
  grid-template-columns: var(--tap) 1fr var(--tap);
  gap: 8px;
  align-items: center;
}

.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg2);
  border-radius: 12px;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  padding: 0;
}

.date-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 10px;
}
.date-input-wrap input[type="date"] {
  width: 100%;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
}
.date-input-wrap input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.85);
  opacity: 0.8;
}

/* Week strip */
.week-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 10px;
  scrollbar-width: none;
  margin-bottom: 2px;
}
.week-strip::-webkit-scrollbar { display: none; }
.week-day {
  flex: 0 0 auto;
  width: 52px;
  min-height: 64px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  color: var(--muted);
}
.week-day .wd { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.week-day .dn { font-size: 16px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.week-day .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: transparent; margin-top: 2px;
}
.week-day.has-posts .dot { background: var(--accent); }
.week-day.has-action .dot { background: var(--warn); }
.week-day.today {
  border-color: rgba(90, 162, 255, 0.55);
  box-shadow: inset 0 0 0 1px rgba(90, 162, 255, 0.2);
}
.week-day.selected {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.week-day.selected .dn { color: var(--accent); }

/* Search */
.search-row { padding: 10px 12px 0; }
.search-input {
  width: 100%;
  min-height: var(--tap);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg2);
  padding: 0 14px;
  font-size: 16px;
}
.search-input::placeholder { color: #6b7a8f; }

/* Filters */
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 12px 4px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.toolbar {
  padding: 8px 12px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.btn-add {
  min-height: var(--tap);
  border-radius: 12px;
  border: 1px dashed var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 800;
  font-size: 14px;
}
.btn-bulk {
  min-height: var(--tap);
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  padding: 0 12px;
  white-space: nowrap;
}

.status-bar {
  padding: 8px 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  min-height: 20px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}

.card {
  width: 100%;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 72px;
  box-shadow: var(--glow);
}
.card.action-needed {
  border-color: rgba(245, 165, 36, 0.55);
  background: linear-gradient(180deg, rgba(245,165,36,0.08), var(--card));
}
.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.time {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-text { background: var(--info-dim); color: var(--info); }
.badge-session { background: var(--accent-dim); color: var(--accent); }
.badge-waiting { background: var(--warn-dim); color: var(--warn); }
.badge-other { background: #243041; color: var(--muted); }

.status-pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: lowercase;
}
.status-pill.planned { color: var(--accent); }
.status-pill.action { color: var(--warn); }
.status-pill.skipped { color: var(--muted); opacity: 0.8; }
.status-pill.ready { color: var(--info); }

.preview {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta-line { font-size: 12px; color: var(--muted); line-height: 1.4; }

.empty {
  margin: 20px 4px;
  padding: 28px 18px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(20, 28, 40, 0.4);
}
.empty strong {
  display: block;
  color: var(--text);
  margin-bottom: 6px;
  font-size: 16px;
}
.empty .empty-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

/* Home */
.home-date {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 600;
}
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  min-height: 76px;
  box-shadow: var(--glow);
}
.stat-card .n {
  font-size: 30px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat-card .l {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 4px;
}
.stat-card.planned .n { color: var(--accent); }
.stat-card.action .n { color: var(--warn); }
.stat-card.session .n { color: var(--info); }
.stat-card.skipped .n { color: var(--muted); }

.section-title {
  font-size: 13px;
  font-weight: 800;
  margin: 10px 0 10px;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid var(--border);
}
.banner.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.banner.off { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }
.banner.warn { background: var(--warn-dim); border-color: var(--warn); color: var(--warn); }
.banner.neutral { background: var(--card); color: var(--muted); }
.banner button.linkish {
  display: inline;
  color: inherit;
  text-decoration: underline;
  font-weight: 800;
  padding: 0;
  margin-left: 4px;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-chip {
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}
.stat-chip strong { color: var(--text); margin-right: 4px; }

/* Settings */
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--glow);
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
}
.toggle-row .label { font-weight: 800; font-size: 16px; }
.toggle { position: relative; width: 52px; height: 32px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #2a3545; border-radius: 999px;
  border: 1px solid var(--border); transition: background 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute; width: 24px; height: 24px;
  left: 3px; top: 3px; background: var(--text);
  border-radius: 50%; transition: transform 0.2s;
}
.toggle input:checked + .toggle-slider {
  background: var(--accent); border-color: var(--accent);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px); background: #062016;
}
.help-text {
  margin-top: 12px; color: var(--muted);
  font-size: 13px; line-height: 1.5;
}
.help-text ul { margin: 8px 0 0; padding-left: 18px; }
.note-box {
  margin-top: 12px; padding: 10px 12px;
  background: var(--bg2); border-radius: 10px;
  font-size: 12px; color: var(--muted); line-height: 1.45;
}
.profile-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-dim); color: var(--accent);
  border: 1px solid rgba(61,220,151,0.35);
  border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 800; margin-bottom: 12px;
}

/* Auth */
.auth-gate {
  min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  max-width: 420px; margin: 0 auto;
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(61,220,151,0.25), rgba(90,162,255,0.2));
  border: 1px solid rgba(61,220,151,0.35); font-size: 26px;
}
.auth-gate h1 { font-size: 24px; margin: 0 0 4px; font-weight: 800; }
.auth-sub { color: var(--accent); font-size: 13px; font-weight: 700; margin: 0; }
.auth-help { color: var(--muted); margin: 0 0 16px; line-height: 1.45; font-size: 14px; }
.auth-hint { color: #6b7a8f; font-size: 12px; line-height: 1.4; margin-top: 18px; }
.auth-gate input {
  width: 100%; min-height: var(--tap); border-radius: 12px;
  border: 1px solid var(--border); background: var(--bg2);
  padding: 0 14px; font-size: 16px; margin-bottom: 12px;
}
.primary-btn {
  width: 100%; min-height: var(--tap); border: none; border-radius: 12px;
  background: linear-gradient(135deg, #2dd4a0, #3ddc97);
  color: #062016; font-weight: 800; font-size: 16px;
}
.primary-btn:disabled { opacity: 0.5; }
.auth-error { color: var(--danger); font-size: 14px; margin-top: 10px; min-height: 20px; font-weight: 600; }

/* Bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(10, 14, 20, 0.94);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-top: 1px solid var(--border-soft);
  padding: 6px 4px calc(6px + var(--safe-bottom));
  max-width: 720px; margin: 0 auto;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; min-height: 52px; color: var(--muted);
  font-size: 11px; font-weight: 700; padding: 4px; border-radius: 14px;
}
.nav-btn .nav-ico { font-size: 18px; line-height: 1.2; }
.nav-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* Sheets */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.58);
  z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--bg2);
  border-top-left-radius: 20px; border-top-right-radius: 20px;
  border: 1px solid var(--border); border-bottom: none;
  max-height: min(94dvh, 920px);
  transform: translateY(110%); transition: transform 0.25s cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  max-width: 720px; margin: 0 auto;
}
.sheet.open { transform: translateY(0); }
.sheet-compact { max-height: min(70dvh, 560px); }
.sheet-handle {
  display: none !important;
}
.sheet-header {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 12px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.sheet-header h2 { flex: 1; margin: 0; font-size: 17px; font-weight: 800; }
.sheet-body {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 14px 20px; flex: 1;
}
.field { margin-bottom: 14px; }
.field label {
  display: block; font-size: 11px; font-weight: 800;
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px;
}
.field textarea,
.field input[type="datetime-local"],
.field input[type="date"],
.field input[type="time"],
.select-input {
  width: 100%; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); padding: 12px; font-size: 16px; line-height: 1.4; min-height: var(--tap);
}
.field textarea { min-height: 180px; resize: vertical; }
.select-input { appearance: none; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.clone-box {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border);
}
.clone-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.clone-row input {
  min-height: var(--tap); border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); padding: 0 10px; font-size: 16px;
}

.sheet-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 12px 14px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--border); background: var(--bg2); flex-shrink: 0;
}
.sheet-actions .full { grid-column: 1 / -1; }

.btn {
  min-height: var(--tap); border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  font-weight: 800; font-size: 14px; padding: 0 12px;
}
.btn:disabled { opacity: 0.5; }
.btn-save { background: var(--accent); border-color: var(--accent); color: #062016; }
.btn-approve { background: var(--info-dim); border-color: var(--info); color: var(--info); }
.btn-skip { background: var(--warn-dim); border-color: var(--warn); color: var(--warn); }
.btn-delete { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-primary-outline {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent); width: 100%;
}

.toast {
  position: fixed; left: 50%;
  bottom: calc(var(--nav-h) + 16px + var(--safe-bottom));
  transform: translateX(-50%) translateY(140%);
  background: #152032; border: 1px solid var(--border);
  color: var(--text); padding: 12px 18px; border-radius: 14px;
  z-index: 80; font-size: 14px; font-weight: 700;
  max-width: calc(100% - 32px);
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
  pointer-events: none; box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  opacity: 0; visibility: hidden;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1; visibility: visible;
}
.toast.ok { border-color: rgba(61,220,151,0.45); }
.toast.err { border-color: rgba(255,92,122,0.5); color: #ffc0cb; }
.toast.warn { border-color: rgba(245,165,36,0.5); }

.hidden { display: none !important; }

/* Dagflow */
.btn-dagflow-create {
  display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); margin: 0 0 10px; padding: 12px 14px;
  border-radius: 14px; border: none;
  background: linear-gradient(135deg, #2dd4a0, #3ddc97 55%, #5aa2ff);
  color: #04120c; font-weight: 900; font-size: 15px;
  box-shadow: 0 10px 28px rgba(61, 220, 151, 0.28);
}
.df-subnav {
  display: flex; gap: 8px; margin-bottom: 8px; overflow-x: auto;
}
.df-wizard { padding-bottom: 24px; }
.df-steps {
  color: var(--muted); font-size: 11px; font-weight: 800;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 10px;
}
.df-progress-track {
  height: 6px; border-radius: 999px; background: #1a2430;
  overflow: hidden; margin-bottom: 14px;
}
.df-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-grid.counts { grid-template-columns: repeat(3, 1fr); }
.choice-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  min-height: 68px; padding: 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card); text-align: left;
}
.choice-btn strong { font-size: 15px; }
.choice-btn span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.choice-btn.active {
  border-color: var(--accent); background: var(--accent-dim);
  box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.35);
}
.choice-btn.disabled, .choice-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.df-nav-row { display: flex; gap: 10px; margin-top: 16px; }
.df-nav-row .btn { flex: 1; }
.df-spinner-wrap { text-align: center; padding: 36px 12px; }
.df-spinner {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%;
  border: 3px solid rgba(61, 220, 151, 0.18);
  border-top-color: var(--accent);
  animation: dfspin 0.75s linear infinite;
}
@keyframes dfspin { to { transform: rotate(360deg); } }
.df-elapsed {
  margin-top: 10px; font-variant-numeric: tabular-nums;
  color: var(--muted); font-size: 13px; font-weight: 700;
}
.celebrate {
  text-align: center; padding: 8px 0 4px; font-size: 42px;
  animation: pop 0.45s ease;
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
#dfDateNav.hidden { display: none !important; }

.offline-banner {
  margin: 0 12px 10px; padding: 10px 12px; border-radius: 12px;
  background: var(--danger-dim); border: 1px solid var(--danger);
  color: var(--danger); font-size: 13px; font-weight: 700;
}

@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; width: 720px;
    transform: translate(-50%, 110%);
  }
  .sheet.open { transform: translate(-50%, 0); }
  .header { padding-left: 16px; padding-right: 16px; }
  .timeline { padding: 16px; gap: 12px; }
  .bottom-nav {
    left: 50%; right: auto; width: 720px; transform: translateX(-50%);
  }
}

/* === Ronde 2 === */
.header-tools { display: flex; align-items: center; gap: 8px; }
.auto-ref-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 800; color: var(--muted);
  padding: 6px 8px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card);
}
.auto-ref-toggle input { width: 14px; height: 14px; }
.btn-sendnow {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #1a0b00; font-weight: 900; border: none;
  box-shadow: 0 8px 22px rgba(249, 115, 22, 0.28);
}
.btn-sendnow.hidden { display: none !important; }
.bulk-shift-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px;
}
.template-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px;
}
.tpl-chip {
  border: 1px solid var(--border); background: #121a24; color: var(--text);
  border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700;
}
.tpl-chip.on, .tpl-chip.active {
  border-color: var(--accent); background: var(--accent-dim); color: var(--accent);
}
.health-card { margin: 12px 0; }
.ok-text { color: var(--accent); }
.err-text { color: var(--danger); }
.journal-details { margin-top: 10px; }
.journal-details summary {
  cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 700;
}
.journal-pre {
  margin: 8px 0 0; padding: 10px; border-radius: 10px;
  background: #0a1018; border: 1px solid var(--border);
  color: #9fb0c3; font-size: 10px; line-height: 1.4;
  max-height: 160px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}
.hist-card { cursor: default; text-align: left; }
.review-item {
  margin-bottom: 14px; padding: 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card);
}
.review-text {
  width: 100%; margin: 8px 0; min-height: 96px;
  border-radius: 12px; border: 1px solid var(--border);
  background: #0a1018; color: var(--text); padding: 10px; font-size: 14px;
}
.day-meta-banners { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.btn.full { width: 100%; }

/* ===== Ronde 3 ===== */
.countdown-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
  white-space: nowrap;
}
.countdown-chip.near { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); }
.countdown-chip.soon { background: rgba(251, 191, 36, 0.16); color: #fbbf24; border-color: rgba(251, 191, 36, 0.35); }
.countdown-chip.late { background: rgba(248, 113, 113, 0.16); color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); }

.status-pill.sending { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }
.status-pill.failed { background: rgba(248, 113, 113, 0.2); color: #fca5a5; }
.status-pill.concept { background: rgba(167, 139, 250, 0.18); color: #c4b5fd; }

.card.selected {
  outline: 2px solid rgba(52, 211, 153, 0.7);
  background: rgba(52, 211, 153, 0.08);
}
.card-check {
  position: absolute;
  left: 10px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 2px solid rgba(148, 163, 184, 0.55);
  background: transparent;
}
.card-check.on {
  background: #34d399;
  border-color: #34d399;
  box-shadow: inset 0 0 0 2px #070b10;
}
.card.pressable { position: relative; }
.multiMode .card, .card.selected { padding-left: 36px; }
.card.selected .card-check, .card .card-check { margin-right: 0; }
.card:has(.card-check) { padding-left: 36px; }

.multi-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 12px 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(52, 211, 153, 0.35);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
}
.multi-bar.hidden { display: none !important; }
.multi-count { font-size: 13px; font-weight: 700; color: #a7f3d0; }
.multi-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.multi-actions .btn { flex: 1 1 auto; min-width: 64px; padding: 10px 8px; font-size: 13px; }
#btnMultiSelect.active { color: #34d399; box-shadow: 0 0 0 1px rgba(52,211,153,0.45); }

.detail-relative {
  font-size: 13px;
  color: #94a3b8;
  margin: 4px 0 10px;
}
.post-preview-card {
  background: linear-gradient(180deg, rgba(30,41,59,0.85), rgba(15,23,42,0.9));
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.preview-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 700;
}
.preview-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
  color: #e2e8f0;
  max-height: 220px;
  overflow: auto;
}

.action-group { margin: 14px 0 8px; }
.action-group-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 8px;
}
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.action-grid .btn { width: 100%; justify-content: center; }
.btn-warn {
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.sheet-body-scroll {
  max-height: min(62vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}
.sheet-actions-sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(7,11,16,0), rgba(7,11,16,0.95) 28%);
  padding-top: 8px;
}
.sheet-detail { max-height: min(92vh, 820px); }

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 12px;
}
.compare-card {
  border-radius: 14px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148,163,184,0.16);
}
.compare-card .n { font-size: 22px; font-weight: 800; }
.compare-card .l { font-size: 12px; font-weight: 700; color: #cbd5e1; }
.compare-card .s { font-size: 11px; color: #64748b; margin-top: 2px; }
.compare-card.planned { border-color: rgba(52,211,153,0.35); }
.compare-card.concept { border-color: rgba(167,139,250,0.35); }
.compare-card.action { border-color: rgba(251,191,36,0.35); }
.compare-card.waiting { border-color: rgba(56,189,248,0.35); }

.channel-card { margin-bottom: 12px; }
.banner.err {
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}
.audit-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(148,163,184,0.12);
}
.audit-when { font-size: 11px; color: #64748b; }
.audit-what { font-size: 13px; color: #cbd5e1; margin-top: 2px; }
.semi-cats { max-height: 220px; overflow: auto; margin-top: 10px; }
.icon-btn.active { color: #34d399; }

/* Visual QA consistency */
.badge, .status-pill, .countdown-chip { vertical-align: middle; }
.card-top { gap: 6px; flex-wrap: wrap; }
.filters { gap: 6px; }
.chip { min-height: 36px; }
.timeline { gap: 10px; }
.section-title { margin-top: 18px; }

@media (max-width: 420px) {
  .action-grid { grid-template-columns: 1fr 1fr; }
  .multi-actions .btn { font-size: 12px; padding: 9px 6px; }
}

/* R3 polish pass */
.filters { padding-bottom: 2px; }
.chip.active { box-shadow: 0 0 0 1px rgba(52,211,153,0.35); }
.status-pill { font-size: 11px; font-weight: 700; }
.badge { font-size: 11px; font-weight: 700; }
.card { margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 96px; }
.header-tools { display: flex; align-items: center; gap: 6px; }
.bottom-nav { border-top: 1px solid rgba(148,163,184,0.12); }
.nav-btn.active .nav-label { color: #6ee7b7; }
.sheet { border-top: 1px solid rgba(52,211,153,0.18); }
.empty-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.compare-card.planned .n { color: #6ee7b7; }
.compare-card.concept .n { color: #c4b5fd; }
.compare-card.action .n { color: #fbbf24; }
.compare-card.waiting .n { color: #7dd3fc; }

.day-meta-banners { margin-bottom: 8px; }
.day-meta-banners .banner { margin-bottom: 8px; }
.stat-chip { display: inline-flex; gap: 4px; align-items: baseline; padding: 6px 10px; border-radius: 999px; background: rgba(15,23,42,0.9); border: 1px solid rgba(148,163,184,0.16); font-size: 12px; color: #94a3b8; }
.stat-chip strong { color: #e2e8f0; font-size: 13px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* keep timeline clear of multi-bar + bottom nav */
#screenPlanning .timeline { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
.multi-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }


/* Detail footer: stacked full-width buttons, no handle gap */
.sheet-actions.sheet-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  grid-template-columns: none;
}
.sheet-actions.sheet-actions-stack .btn {
  width: 100%;
  grid-column: auto;
}

/* Prominent media-needed banner */
.media-needed-banner {
  display: none;
  margin: 0 0 14px;
  padding: 14px 14px 14px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(239, 68, 68, 0.12));
  color: #fde68a;
  font-weight: 800;
  font-size: 15px;
  line-height: 1.35;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15) inset;
}
.media-needed-banner.show { display: block; }
.media-needed-banner .media-needed-title {
  font-size: 16px;
  margin-bottom: 4px;
  color: #fbbf24;
}
.media-needed-banner .media-needed-sub {
  font-size: 13px;
  font-weight: 600;
  color: #fcd34d;
  opacity: 0.95;
}


/* Home v2 — today only */
.home-status {
  margin: 4px 0 16px;
  padding: 14px 14px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
}
.home-status.ok {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #a7f3d0;
}
.home-status.warn {
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
.home-status.pause {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e2e8f0;
}
.home-status.bad {
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fecaca;
}
.home-block { margin: 0 0 18px; }
.home-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}
.home-hero .card {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12);
}
.home-list { padding: 0; }
.home-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0 8px;
}
.home-cta .btn { width: 100%; }



.home-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: 1fr;
  gap: 10px;
  margin: 4px 0 16px;
  align-items: stretch;
}
.home-tile {
  width: 100%;
  min-height: 88px;
  height: 100%;
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  text-align: center;
  box-sizing: border-box;
  box-shadow: none;
}
.home-tile .n {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
  min-height: 26px;
}
.home-tile .l {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  line-height: 1.2;
  min-height: 15px;
}
.home-tile.warn {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
}
.home-tile.warn .n { color: #fbbf24; }
.home-tile.on {
  border-color: rgba(52, 211, 153, 0.4);
}
.home-tile.on .n { color: #6ee7b7; }
.home-tile.off .n { color: #94a3b8; }
.home-tile.is-empty {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(148, 163, 184, 0.07);
}
.home-tile.is-empty .n {
  color: #94a3b8;
  font-weight: 700;
}
.home-tile.is-empty .l {
  color: #94a3b8;
}

.home-empty-note {
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-weight: 700;
}

.plan-note {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.28);
  color: #fde68a;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
}

/* ===== Overnight polish 2026-09-09 ===== */
.chip { min-height: 44px; padding: 0 16px; }
.df-lead {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
}
.df-subnav .chip { flex: 1 1 0; text-align: center; justify-content: center; }

.sheet {
  overflow: hidden;
  padding-bottom: 0;
}
.sheet-header {
  padding: 16px 12px 12px;
  min-height: 56px;
}
.sheet-body,
.sheet-body-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-bottom: 18px;
}
.sheet-actions,
.sheet-actions-sticky {
  position: relative;
  bottom: auto;
  flex-shrink: 0;
  background: var(--bg2);
  box-shadow: 0 -10px 24px rgba(0, 0, 0, 0.28);
  padding: 12px 14px calc(12px + var(--safe-bottom));
  z-index: 2;
}
.sheet-actions-stack { display: flex; flex-direction: column; gap: 10px; }
.sheet-stack { display: flex; flex-direction: column; gap: 10px; }
.sheet-stack .btn, .empty-actions .btn { width: 100%; min-height: 44px; }
.action-grid .btn { min-height: 44px; }
.multi-actions .btn { min-height: 44px; }

.status-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  margin: 0 0 10px;
}
.status-hero[hidden], .missed-banner[hidden] { display: none !important; }
.status-hero .status-main { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.status-hero .status-sub { font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }
.status-hero.planned { border-color: rgba(61, 220, 151, 0.45); }
.status-hero.finish { border-color: rgba(251, 191, 36, 0.55); background: rgba(251, 191, 36, 0.1); }
.status-hero.ready { border-color: rgba(90, 162, 255, 0.4); }
.status-hero.bad { border-color: rgba(255, 92, 122, 0.5); background: rgba(255, 92, 122, 0.1); }
.status-hero.sending { border-color: rgba(251, 191, 36, 0.5); }

.missed-banner {
  margin: 0 0 12px;
  padding: 16px 14px;
  border-radius: 16px;
  border: 1.5px solid rgba(148, 163, 184, 0.45);
  background: rgba(148, 163, 184, 0.12);
}
.missed-banner .missed-title { font-size: 18px; font-weight: 800; color: #e2e8f0; margin-bottom: 4px; }
.missed-banner .missed-sub { font-size: 14px; font-weight: 600; color: #cbd5e1; line-height: 1.4; }

.tech-details {
  margin-top: 16px;
  border-top: 1px solid var(--border-soft);
  padding-top: 8px;
}
.tech-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tech-body {
  padding: 4px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-word;
}
.more-block {
  margin-top: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 14px 12px;
}
.more-block > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 800;
  cursor: pointer;
}
.hidden-note {
  margin: 8px 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.action-group-title { margin-top: 4px; }
.preview-label { letter-spacing: 0.04em; }

.sheet > .sheet-body:last-child {
  padding-bottom: calc(20px + var(--safe-bottom));
}
.banner.warn { color: #fde68a; }

/* ===== Ronde 2 — 390px phone layout ===== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.header-slim {
  padding-bottom: 10px;
}
.header-slim .header-row {
  margin-bottom: 0;
}

.plan-dock {
  padding: 12px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-dock .search-row,
.plan-dock .filters,
.plan-dock .toolbar {
  padding: 0;
  margin: 0;
}

/* 7 equal days, no horizontal clip on a 390px iPhone */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  margin: 0;
}
.week-day {
  width: auto;
  min-width: 0;
  max-width: 100%;
  flex: none;
  min-height: 58px;
  padding: 6px 0 5px;
  border-radius: 12px;
  gap: 1px;
}
.week-day .wd,
.week-day .dn {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
  line-height: 1.15;
}
.week-day .wd {
  font-size: 10px;
  letter-spacing: 0;
}
.week-day .dn {
  font-size: 15px;
}
.week-day .dot {
  margin-top: 3px;
}

.date-nav {
  min-width: 0;
}
.date-input-wrap {
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.date-face {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.date-input-wrap input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  opacity: 0;
  border: none;
}

#screenPlanning .filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  overflow: hidden;
}
#screenPlanning .filters .chip {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 4px;
  font-size: 12px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
  overflow: hidden;
}

.toolbar {
  grid-template-columns: 1fr 108px;
  align-items: stretch;
}
.plan-toolbar {
  grid-template-columns: var(--tap) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
}
.plan-toolbar .btn-add {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-toolbar .btn-bulk {
  width: auto;
  min-width: 88px;
  padding: 0 12px;
}
.plan-toolbar #btnPlanSearch.active,
.plan-toolbar #btnPlanSearch[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.plan-search-expand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin: 0;
}
.plan-search-expand.hidden,
.plan-search-expand[hidden] {
  display: none !important;
}
.plan-search-expand .search-input {
  flex: 1;
  min-width: 0;
}
.plan-search-expand .icon-btn {
  flex: 0 0 auto;
}
.btn-bulk {
  width: 100%;
  padding: 0 8px;
}

.card {
  gap: 8px;
  padding: 12px 14px;
}
.card-glance {
  display: grid;
  grid-template-columns: 58px auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-glance .time {
  font-size: 17px;
  line-height: 1;
}
.card-glance .badge {
  justify-self: start;
}
.card-glance .status-pill {
  margin-left: 0;
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  text-transform: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}
.preview {
  -webkit-line-clamp: 2;
  font-size: 14px;
  line-height: 1.4;
}

.status-bar {
  padding: 10px 16px 0;
}

#screenPlanning .timeline {
  padding: 10px 12px calc(var(--nav-h) + 20px + var(--safe-bottom));
}

.multi-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  top: auto;
  bottom: calc(var(--nav-h) + 8px + var(--safe-bottom));
  z-index: 46;
  margin: 0 auto;
  max-width: 696px;
}
.multi-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.multi-actions .btn {
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}
body.multi-open #screenPlanning .timeline {
  padding-bottom: calc(280px + var(--safe-bottom));
}

.empty {
  margin: 8px 0 4px;
  padding: 28px 16px 22px;
}
.empty p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 600;
}
.empty .empty-actions .btn {
  width: 100%;
}

.home-tiles {
  gap: 10px;
  margin: 2px 0 18px;
  align-items: stretch;
}
.home-tile .l {
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 15px;
}
.screen-body {
  padding: 14px 12px 8px;
}
.home-block {
  margin-bottom: 16px;
}
.home-cta {
  margin-top: 4px;
}

/* Dagflow: Maken is the first, obvious screen */
.df-subnav {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 6px;
  overflow: visible;
  margin: 0;
}
.df-subnav .chip {
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
#dfTabMaken.active,
.chip-maken.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #062016;
  box-shadow: none;
}
#screenDagflow[data-view="maken"] #btnDagflowCreate,
#screenDagflow[data-view="maken"] #dfDateNav {
  display: none !important;
}
#screenDagflow[data-view="gepland"] #btnDagflowCreate,
#screenDagflow[data-view="jobs"] #btnDagflowCreate {
  display: flex;
  margin-top: 10px;
  min-height: 40px;
  font-size: 14px;
  box-shadow: none;
  background: var(--card);
  color: var(--accent);
  border: 1px solid rgba(61, 220, 151, 0.45);
}
.df-lead {
  margin: 0 0 12px;
}
.df-wizard {
  padding-bottom: 12px;
}
.df-wizard .section-title {
  margin-top: 0;
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: -0.02em;
  font-size: 18px;
  font-weight: 800;
}
.choice-btn {
  min-width: 0;
  min-height: 72px;
}
.choice-btn strong,
.choice-btn span {
  max-width: 100%;
}
.choice-grid.counts {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choice-grid.counts .choice-btn {
  align-items: center;
  justify-content: center;
  min-height: 56px;
  text-align: center;
}

/* Settings stays quiet: toggles first, no pill noise */
#screenSettings .screen-body {
  padding-top: 16px;
}
#screenSettings .settings-card {
  margin-bottom: 12px;
}
#screenSettings .help-text {
  margin-top: 8px;
  margin-bottom: 0;
}
#screenSettings .more-block {
  margin-top: 6px;
}
#screenSettings .auth-hint {
  margin: 8px 0 4px;
}

/* Detail / add sheets: footer never covers the form */
.sheet,
.sheet-detail {
  overflow: hidden;
  padding-bottom: 0;
  max-height: calc(100dvh - 8px - var(--safe-top));
}
.sheet::before,
.sheet-handle {
  display: none !important;
  content: none !important;
  height: 0 !important;
}
.sheet-body,
.sheet-body-scroll {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}
.sheet-actions,
.sheet-actions-sticky,
.sheet-actions-stack {
  position: relative;
  bottom: auto;
  flex-shrink: 0;
  background: var(--bg2);
  box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.22);
}
.media-needed-banner.show {
  margin-bottom: 12px;
}
.action-grid .btn {
  min-height: 48px;
  white-space: normal;
  line-height: 1.2;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.template-chips {
  gap: 8px;
}
.tpl-chip {
  min-height: 36px;
}

@media (max-width: 430px) {
  .week-day {
    min-height: 56px;
    padding-left: 0;
    padding-right: 0;
  }
  .week-day .dn { font-size: 15px; }
  .header { padding-left: 12px; padding-right: 12px; }
  .plan-dock { padding-left: 12px; padding-right: 12px; }
}

.session-subgrid { margin-top: 10px; display: grid; gap: 8px; }
.toggle-row.compact { padding: 6px 0; }
.mention-controls { margin-top: 10px; display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.mention-controls .meta-line { grid-column: 1 / -1; }
.badge-mention { background: rgba(168, 85, 247, 0.18); color: #d8b4fe; }

/* Expandable planning cards */
.card-expandable { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.card-expandable .card-main {
  all: unset;
  display: block;
  cursor: pointer;
  padding: 12px 14px 10px;
  box-sizing: border-box;
  width: 100%;
}
.card-expandable .card-glance {
  grid-template-columns: 58px auto minmax(0, 1fr) 22px;
}
.card-chevron {
  width: 18px;
  height: 18px;
  justify-self: end;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .18s ease;
  opacity: .7;
  margin-top: -4px;
}
.card-expandable.is-open .card-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.card-dropdown {
  display: none;
  padding: 0 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.card-dropdown.show { display: block; }
.card-full-preview {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 12px;
  margin: 10px 0 10px;
  max-height: 280px;
  overflow: auto;
}
.card-open-detail { margin-top: 0; }
.preview.hidden { display: none !important; }

/* Detail sheet polish */
.edit-details, .clone-details {
  margin-top: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
}
.edit-details summary, .clone-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  list-style: none;
}
.edit-details summary::-webkit-details-marker,
.clone-details summary::-webkit-details-marker { display: none; }
.post-preview-card {
  margin-top: 8px;
  margin-bottom: 4px;
}
.preview-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.45;
}


/* === Meer tools + sheet footer layout (tools-sheet-1) === */
.sheet.sheet-detail {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 0;
  max-height: calc(100dvh - 8px - var(--safe-top));
}
.sheet.sheet-detail > .sheet-body,
.sheet.sheet-detail > .sheet-body-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 28px;
}
.sheet.sheet-detail > .sheet-actions {
  position: relative;
  bottom: auto;
  flex-shrink: 0;
  z-index: 3;
  margin-top: 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.35);
  background: var(--bg2);
  padding: 14px 14px calc(14px + var(--safe-bottom));
}
.sheet-scroll-pad {
  height: 24px;
}
.tools-details,
.edit-details,
.clone-details,
.tech-details {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.45);
  padding: 4px 12px 10px;
}
.tools-details > summary,
.edit-details > summary,
.clone-details > summary,
.tech-details > summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 2px;
  list-style: none;
}
.tools-details > summary::-webkit-details-marker,
.edit-details > summary::-webkit-details-marker {
  display: none;
}
.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tools-grid .btn-tool {
  min-height: 48px;
  white-space: normal;
  line-height: 1.25;
  font-size: 13px;
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.28);
  color: #a7f3d0;
}
.tools-grid .btn-tool:disabled {
  opacity: 0.45;
}
.tools-grid #btnToolRegen {
  grid-column: 1 / -1;
}
.tool-result-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.tool-result-panel.ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
}
.tool-result-panel.warn {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}
.tools-media-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.danger-zone {
  margin-top: 18px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
.danger-zone .action-group-title {
  color: #fca5a5;
  margin-bottom: 8px;
}
.action-group + .tools-details {
  margin-top: 14px;
}
@media (max-width: 430px) {
  .tools-grid {
    grid-template-columns: 1fr 1fr;
  }
  .sheet.sheet-detail > .sheet-body-scroll {
    padding-bottom: 36px;
  }
}


/* === Composer merge (composer-merge-1): editable TG-style body === */
.post-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.post-composer .composer-time {
  margin: 0;
}
.post-composer .composer-time label {
  font-size: 12px;
  color: #94a3b8;
}
.composer-text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 180px;
  resize: vertical;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 15px;
  line-height: 1.45;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}
.composer-text:focus {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.post-composer .composer-time input[type="datetime-local"] {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
  direction: ltr;
}
.post-composer .composer-time input[type="datetime-local"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
}
.post-composer .composer-time input[type="datetime-local"]::-webkit-datetime-edit,
.post-composer .composer-time input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
  text-align: left;
  display: inline-flex;
  justify-content: flex-start;
  width: 100%;
}
.post-composer .composer-time input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  margin-left: auto;
}

/* === Dagflow step5 success list (dagflow-nav-1) === */
.df-wizard {
  padding-bottom: calc(16px + var(--safe-bottom));
}
.df-success-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* Tight gap before actions; .app already clears bottom nav */
  padding-bottom: 8px;
}
.df-success-actions {
  position: sticky;
  bottom: calc(var(--nav-h) + 10px + var(--safe-bottom));
  z-index: 5;
  padding: 8px 0 4px;
  margin-top: 4px;
  background: linear-gradient(180deg, rgba(10, 14, 20, 0) 0%, rgba(10, 14, 20, 0.92) 28%, var(--bg, #0a0e14) 55%);
}
.df-wait-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(245, 165, 36, 0.12);
  border: 1px solid rgba(245, 165, 36, 0.45);
  color: #ffd79a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.df-success-list .card.action-needed {
  box-shadow: inset 0 0 0 1px rgba(245, 165, 36, 0.35);
}

/* Planning long-press reorder */
.card.can-reorder { touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.timeline.is-reordering,
.timeline.is-reordering .card { touch-action: none; cursor: grabbing; }
html.reorder-no-scroll,
body.reorder-no-scroll {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
  position: fixed;
  left: 0; right: 0;
  width: 100%;
}
.card.is-drag-source {
  opacity: 0.35;
  border-style: dashed;
}
.card.drag-over-above { box-shadow: inset 0 3px 0 0 var(--accent, #3ddc97); }
.card.drag-over-below { box-shadow: inset 0 -3px 0 0 var(--accent, #3ddc97); }
.drag-ghost {
  position: fixed;
  z-index: 120;
  pointer-events: none;
  opacity: 0.92;
  transform: scale(1.02);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  border-radius: 16px;
  margin: 0;
}


/* LAB auth */
.auth-advanced { margin-top: 18px; color: var(--muted); font-size: 13px; }
.auth-advanced summary { cursor: pointer; color: #8ea0b8; margin-bottom: 10px; }
.auth-advanced input { margin-bottom: 10px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px; padding: 4px 10px; max-width: 140px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.team-row:last-child { border-bottom: 0; }
.team-meta { font-size: 12px; color: var(--muted); }
.team-add-row { display: flex; gap: 8px; margin-top: 10px; }
.team-add-row input { flex: 1; }
.role-pill { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.08); }
.role-pill.owner { color: #fbbf24; }
.role-pill.admin { color: #34d399; }
