.account-integration-dialog{position:fixed;max-width:720px;width:calc(100% - 32px);max-height:85dvh;overflow:auto;padding:28px;border:1px solid var(--yf-border,#d4d9dc);border-radius:16px;color:var(--yf-text,#14171c);background:var(--yf-surface,#fffefa);font:inherit}
.account-integration-dialog::backdrop{background:rgba(15,23,42,.45)}
.account-integration-dialog h2{padding-right:52px;margin-top:0}.account-dialog-close{position:absolute;right:20px;top:20px}
.account-integration-dialog form{display:grid;gap:14px}.account-integration-dialog label{display:grid;gap:6px}.account-integration-dialog input:not([type=checkbox]){width:100%;box-sizing:border-box;padding:10px;border:1px solid var(--yf-border,#d4d9dc);border-radius:8px;background:var(--yf-surface,#fffefa);color:inherit;font:inherit}
.account-integration-dialog button{padding:9px 15px;border:1px solid var(--yf-border,#d4d9dc);border-radius:8px;background:var(--yf-surface-soft,#fbf2e3);color:inherit;cursor:pointer;font:inherit}.account-integration-dialog button:disabled{opacity:.6;cursor:wait}
.account-integration-dialog article{padding:12px 0;border-bottom:1px solid var(--yf-border,#d4d9dc)}.legacy-history-text{white-space:pre-wrap;overflow-wrap:anywhere}

/* Keep the title and close action outside the scrollable account/history content. */
.account-integration-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  box-sizing: border-box;
  max-height: min(85dvh, calc(100dvh - 24px));
  padding: 0;
  overflow: hidden;
  overscroll-behavior: contain;
}
.account-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--yf-border, #d4d9dc);
}
.account-dialog-head h2 { min-width: 0; margin: 0; padding: 0; font-size: 20px; }
.account-dialog-head .account-dialog-close { position: static; flex: none; }
.account-dialog-body {
  min-height: 0;
  min-width: 0;
  padding: 0 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.account-dialog-body details { margin: 12px 0; }
.account-dialog-body summary { cursor: pointer; overflow-wrap: anywhere; line-height: 1.6; }
.legacy-history-time { display: block; margin: 4px 0; color: var(--yf-muted, #626963); font-size: 12px; }
.legacy-history-text .katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
@media (max-width: 520px) {
  .account-dialog-head { padding: 14px 16px; }
  .account-dialog-body { padding: 0 16px 16px; }
}
