/* ChatGPT meal/rotation entry and account connection. */
.chatgpt-dialog {
  width: min(100% - 2rem, 640px);
  max-height: calc(100dvh - 2rem);
  padding: 0;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 80px #0004;
  overscroll-behavior: contain;
}
.chatgpt-dialog::backdrop { background: #0008; }
.chatgpt-dialog-content { display: grid; gap: 1rem; padding: clamp(1rem, 4vw, 1.75rem); }
.chatgpt-dialog-content p, .chatgpt-dialog-content h2 { margin: 0; }
.chatgpt-dialog-content h2 { font-size: 1.45rem; }
.chatgpt-dialog-head, .chatgpt-dialog-actions, .chatgpt-connection-row, .chatgpt-photo-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.chatgpt-dialog-head { align-items: flex-start; }
.chatgpt-dialog-actions { justify-content: flex-end; }
.chatgpt-note { color: var(--muted); font-size: .9rem; line-height: 1.5; }
.chatgpt-connection-row { flex-wrap: wrap; font-size: .9rem; }
.chatgpt-connection-row strong { font-weight: 600; }
.chatgpt-connection-row .is-connected { color: var(--primary); }
.chatgpt-installed-entry { display: grid; gap: .6rem; }
.chatgpt-connection-details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.chatgpt-connection-details > :not(summary) { margin-top: .75rem; }
.chatgpt-setup { display: grid; gap: 1rem; }
.chatgpt-setup-steps { margin: 0; padding-left: 1.5rem; }
.chatgpt-setup-steps li { padding: .25rem 0 1rem .25rem; }
.chatgpt-setup-steps li > * + * { margin-top: .6rem; }
.chatgpt-setup-steps .chatgpt-open-link { border: 1px solid var(--border); }
.chatgpt-setup-notice { padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); font-size: .9rem; line-height: 1.5; }
.chatgpt-setup-notice strong { display: block; margin-bottom: .4rem; }
.chatgpt-setup-help { padding: .8rem; border: 1px solid var(--border); border-radius: 10px; }
.chatgpt-setup-help summary { cursor: pointer; font-size: .9rem; font-weight: 600; }
.chatgpt-setup-help p { margin-top: .6rem; }
.chatgpt-dialog label.chatgpt-desktop-ready { display: flex; align-items: flex-start; margin-top: .75rem; font-weight: 400; }
.chatgpt-desktop-ready input { width: auto; flex: 0 0 auto; margin-top: .2rem; }
.chatgpt-open-link[aria-disabled="true"] { color: var(--muted); opacity: .65; }
.chatgpt-resume { display: grid; gap: .6rem; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.chatgpt-resume .ghost-button { justify-self: start; padding-inline: 0; font-size: .8rem; }
.chatgpt-desktop-options { border-top: 1px solid var(--border); padding-top: .8rem; }
.chatgpt-desktop-options summary, .chatgpt-consent-details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.chatgpt-desktop-options p { margin-top: .6rem; }
.chatgpt-desktop-options .chatgpt-open-link { margin-top: .4rem; }
.chatgpt-consent-details small { display: block; margin-top: .4rem; }
.chatgpt-dialog label { display: grid; gap: .4rem; font-size: .9rem; font-weight: 600; }
.chatgpt-dialog input, .chatgpt-dialog textarea, .chatgpt-dialog select { width: 100%; min-width: 0; box-sizing: border-box; }
.chatgpt-status { font-size: .9rem; line-height: 1.5; }
.chatgpt-status:empty { display: none; }
.chatgpt-status.error { color: var(--danger, #b42318); }
.chatgpt-resource { color: var(--muted); overflow-wrap: anywhere; }
.chatgpt-login-notice { padding: .8rem; border-radius: 10px; background: var(--surface-soft); line-height: 1.5; }
.chatgpt-photo-entry { padding: .6rem 0; margin: 0 1rem; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.chatgpt-open-link { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; padding: .55rem .7rem; border-radius: 10px; font-size: .95rem; line-height: 1.25; text-align: center; text-decoration: none; }
.chatgpt-open-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.chatgpt-primary-link { background: var(--primary); color: var(--on-primary); min-height: 2.75rem; font-weight: 600; }
.chatgpt-photo-entry .chatgpt-open-link { white-space: nowrap; }
.chatgpt-rotation-draft .chatgpt-dialog-actions { flex-wrap: wrap; justify-content: flex-start; }
.rotation-saved-pools { padding: 1rem; margin-bottom: 1rem; }
.rotation-saved-pools h3 { margin: 0 0 .35rem; }
.rotation-saved-pools > p { margin: 0 0 .8rem; color: var(--muted); font-size: .88rem; }
.rotation-saved-pool { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; padding: .8rem 0; border-top: 1px solid var(--border); }
.rotation-saved-pool details { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rotation-saved-pool summary { cursor: pointer; font-weight: 600; }
.rotation-saved-pool small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 400; }
.rotation-saved-pool ul { margin: .7rem 0 0; padding-left: 1.2rem; font-size: .9rem; }
.rotation-saved-pool button { flex-shrink: 0; min-height: 2.6rem; }
.mobile-add-meal-actions .chatgpt-open-link { min-height: 2.6rem; padding: .55rem .65rem; font-size: .82rem; font-weight: 750; }
.chatgpt-dialog [hidden], .chatgpt-login-notice[hidden] { display: none !important; }
@media (max-width: 480px) {
  .chatgpt-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); border-radius: 16px; }
  .chatgpt-photo-entry { flex-wrap: wrap; gap: .2rem; margin-inline: .75rem; }
  .chatgpt-dialog-actions button { flex: 1; }
}
