/* ========================================================
   E-007a — Cabinet weekly menu: tabs + day panel
   ======================================================== */

.weekly-menu-card .weekly-intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* ---- табы ---- */
.weekly-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-bottom: 16px;
  padding-bottom: 2px;
}
.weekly-tabs::-webkit-scrollbar { display: none; }

.weekly-tab {
  flex: 0 0 auto;
  background: rgba(255, 244, 248, 0.5);
  border: 1px solid var(--border);
  color: var(--ink-muted);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .15s ease;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  min-width: 80px;
}
.weekly-tab:hover {
  background: var(--pink-50);
  color: var(--ink);
  transform: translateY(-1px);
}
.weekly-tab.is-active {
  background: var(--pink-accent);
  color: #fff;
  border-color: var(--pink-accent);
  box-shadow: 0 4px 12px rgba(255, 123, 163, 0.28);
}
.weekly-tab .weekly-tab-num {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.75;
  margin-bottom: 2px;
}
.weekly-tab.is-active .weekly-tab-num { opacity: 0.9; }
.weekly-tab .weekly-tab-date {
  font-size: 13px;
  font-weight: 700;
}

/* ---- панели ---- */
.weekly-panels {
  position: relative;
}

.weekly-panel {
  display: none;
}
.weekly-panel.is-active {
  display: block;
  animation: weeklyFadeIn .28s ease both;
}
@keyframes weeklyFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.weekly-panel-body {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--ink);
  margin: 0;
}
.weekly-panel-body strong {
  color: var(--ink);
  font-weight: 700;
}

/* ---- footer меню ---- */
.weekly-menu-card .weekly-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.weekly-menu-card .weekly-footer .weekly-footer-info {
  font-size: 12px;
  color: var(--ink-faint);
}

/* ---- adaptive ---- */
@media (max-width: 640px) {
  .weekly-tab { padding: 8px 12px; min-width: 68px; }
  .weekly-tab .weekly-tab-date { font-size: 12px; }
  .weekly-panel-body { font-size: 12px; line-height: 1.65; }
}

/* ---- E-007b: кнопка Перегенерировать и раскрывающаяся форма ---- */
.weekly-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.weekly-section-head .weekly-section-meta {
  font-size: 13px;
  color: var(--ink-faint);
}

.weekly-regen {
  margin-left: auto;
}
.weekly-regen-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--pink-50);
  border: 1px solid var(--pink-200);
  color: var(--pink-accent-hover);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color .15s ease, border-color .15s ease;
  font-family: inherit;
}
.weekly-regen-summary:hover {
  background: var(--pink-100);
  border-color: var(--pink-accent);
}
.weekly-regen-summary::-webkit-details-marker { display: none; }
.weekly-regen-summary::after {
  content: "▾";
  margin-left: 2px;
  transition: transform .2s ease;
}
.weekly-regen[open] .weekly-regen-summary::after { transform: rotate(180deg); }

/* Форма выскакивает вниз через абсолютное позиционирование относительно .weekly-regen */
.weekly-regen {
  position: relative;
}
.weekly-regen-form {
  margin-top: 8px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  gap: 12px;
  width: 320px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  box-shadow: var(--shadow-md);
}
.weekly-regen-form label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.weekly-regen-form select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
}
.weekly-regen-form .weekly-regen-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.weekly-regen-form .weekly-regen-submit {
  flex: 1;
  padding: 10px 16px;
  background: var(--pink-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color .15s ease;
}
.weekly-regen-form .weekly-regen-submit:hover { background: var(--pink-accent-hover); }
.weekly-regen-form .weekly-regen-submit:disabled {
  background: var(--ink-faint);
  cursor: not-allowed;
}
.weekly-regen-form .weekly-regen-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 0;
  line-height: 1.5;
}
.weekly-regen-limit {
  font-size: 11px;
  color: var(--ink-faint);
  margin-left: 6px;
}

@media (max-width: 640px) {
  .weekly-regen { margin-left: 0; position: static; }
  .weekly-regen-form {
    position: static;
    width: 100%;
    margin-top: 10px;
  }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .weekly-panel.is-active { animation: none; }
  .weekly-tab:hover { transform: none; }
}
