/* ── Modal Overlay & Base ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  z-index: 100; display: none; align-items: flex-end;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: 24px 24px 0 0; width: 100%;
  max-height: 92vh; overflow-y: auto;
  padding: 16px 20px calc(var(--safe-bottom) + 20px);
  animation: slideUp 0.28s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle {
  width: 40px; height: 4px; background: var(--subtle-bg-hover);
  border-radius: 2px; margin: 0 auto 20px;
}
.modal-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 20px;
}
.modal-title { font-size: 1.45rem; font-weight: 700; flex: 1; padding-right: 12px; }
.modal-close {
  background: var(--subtle-bg-hover); border: none; color: var(--text);
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.modal-tag {
  display: inline-block; background: rgba(233,69,96,0.18); color: var(--accent);
  border-radius: 20px; padding: 4px 12px; font-size: 0.8rem;
  font-weight: 600; margin-bottom: 16px;
}
.modal-desc { color: var(--muted); font-size: 0.95rem; line-height: 1.65; margin-bottom: 20px; }
.tips-list { list-style: none; margin-bottom: 20px; }
.tips-list li {
  padding: 9px 0 9px 22px; position: relative;
  font-size: 0.95rem; border-bottom: 1px solid var(--border);
}
.tips-list li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

/* ── Sets & Last Session Boxes ── */
.sets-box {
  background: var(--bg); border-radius: 12px; padding: 14px;
  margin-bottom: 24px; display: flex; align-items: center; gap: 12px;
}
.sets-box .sets-icon { font-size: 1.4rem; }
.sets-box .sets-label { font-size: 0.78rem; color: var(--muted); }
.sets-box .sets-value { font-size: 1rem; font-weight: 600; }
.last-session-box {
  background: var(--bg); border-radius: 12px; padding: 14px;
  margin-bottom: 20px; display: flex; align-items: center; gap: 12px;
}
.last-session-box .ls-icon { font-size: 1.4rem; }
.last-session-box .ls-value { font-size: 1rem; font-weight: 600; }
.last-session-box .ls-value.none { color: var(--muted); font-weight: 400; font-style: italic; }
.last-session-box .ls-date { font-size: 0.75rem; color: var(--muted); margin-top: 1px; }

/* ── Log Inputs ── */
.log-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.log-field label {
  display: block; font-size: 0.78rem; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.log-input-wrap {
  display: flex; align-items: center; background: var(--bg);
  border-radius: 10px; padding: 12px; gap: 6px;
  border: 1px solid var(--border-med);
}
.log-input-wrap input {
  background: none; border: none; color: var(--text);
  font-size: 1.1rem; font-weight: 600; width: 100%;
  outline: none; font-family: inherit;
}
.log-input-wrap input::placeholder { color: var(--muted); }
.log-input-wrap span { color: var(--muted); font-size: 0.85rem; flex-shrink: 0; }

/* ── Buttons ── */
.save-btn {
  width: 100%; background: var(--green); color: #fff; border: none;
  border-radius: 14px; padding: 15px; font-size: 1rem; font-weight: 700;
  cursor: pointer; margin-bottom: 12px; transition: background 0.3s;
}
.save-btn:active { opacity: 0.85; }
.yt-btn {
  width: 100%; background: rgba(233,69,96,0.15); color: var(--accent);
  border: 1px solid rgba(233,69,96,0.3); border-radius: 14px;
  padding: 15px; font-size: 1rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.yt-btn:active { opacity: 0.85; }

/* ── Create Plan / Title Modal Inputs ── */
.plan-name-input {
  width: 100%; background: var(--bg);
  border: 1px solid var(--border-med); border-radius: 12px;
  padding: 15px 16px; color: var(--text); font-size: 1.1rem;
  font-family: inherit; outline: none; margin-bottom: 16px;
}
.plan-name-input:focus { border-color: var(--accent); }
.plan-name-input::placeholder { color: var(--muted); }
.create-btn {
  width: 100%; background: var(--accent); color: white; border: none;
  border-radius: 14px; padding: 16px; font-size: 1rem;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.create-btn:active { opacity: 0.85; }

/* ── Confirmation Dialog ── */
.confirm-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.7); display: none; align-items: flex-end; justify-content: center; }
.confirm-overlay.open { display: flex; }
.confirm-sheet { background: var(--card); border-radius: 28px 28px 0 0; padding: 28px 24px 44px; width: 100%; max-width: 500px; }
.confirm-title { font-size: 1.1rem; font-weight: 700; text-align: center; margin-bottom: 8px; }
.confirm-msg { font-size: 0.88rem; color: var(--muted); text-align: center; margin-bottom: 28px; line-height: 1.5; }
.confirm-btn-del { width: 100%; background: var(--accent); border: none; color: #fff; padding: 16px; border-radius: 16px; font-size: 1rem; font-weight: 700; font-family: inherit; cursor: pointer; margin-bottom: 10px; }
.confirm-btn-del:active { opacity: 0.85; }
.confirm-btn-cancel { width: 100%; background: var(--subtle-bg); border: none; color: var(--text); padding: 15px; border-radius: 16px; font-size: 1rem; font-family: inherit; cursor: pointer; }
.confirm-btn-cancel:active { opacity: 0.7; }
