.theorem-personal { min-width: 0; }
.theorem-personal p { margin: 8px 0; font-size: .86rem; line-height: 1.5; }
.theorem-personal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.theorem-personal select { min-width: 0; flex: 1 1 180px; max-width: 100%; }
.theorem-personal[hidden], .theorem-personal [hidden], .theorem-personal-account [hidden] { display: none !important; }
.theorem-personal-account { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.theorem-personal-link { border: 0; padding: 0; background: none; color: var(--muted); font: inherit; font-size: .75rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.theorem-personal-link:hover, .theorem-personal-link:focus-visible { color: var(--accent); }
#personal-login { margin-top: 10px; }
#personal-login input { display: block; width: 100%; min-width: 0; }
.theorem-personal .btn { white-space: normal; }
.theorem-personal button:disabled { opacity: .45; cursor: not-allowed; }
.theorem-personal-history { padding-left: 0; list-style: none; }
.theorem-personal-status { color: #466449; }
.theorem-personal-status[data-warning="true"] { color: #99512b; }
.theorem-personal-conflict { padding: 10px; border: 1px solid #ba7942; border-radius: 8px; background: #fff4e5; }
.theorem-personal-history { max-height: 260px; overflow: auto; }
.theorem-personal-history li { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin: 8px 0; }
.theorem-personal-preview { max-height: 220px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .8rem/1.5 monospace; }
#personal-wide-host { min-width: 0; margin: 0 16px 16px; container-type: inline-size; }
#personal-wide-host[hidden], #personal-shared-banner[hidden], #personal-shared-banner [hidden] { display: none !important; }
.theorem-personal-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 6px; font-size: .86rem; }
.theorem-personal-list { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.theorem-personal-list:empty { display: none; }
.theorem-personal-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); }
.theorem-personal-item:last-child { border-bottom: 0; }
.theorem-personal-item.is-current { background: color-mix(in srgb, var(--accent) 9%, var(--bg)); box-shadow: inset 3px 0 var(--accent); }
.theorem-personal-item-name { min-width: 0; border: 0; padding: 0; background: none; color: var(--accent); text-align: left; font: inherit; font-size: .9rem; cursor: pointer; overflow-wrap: anywhere; }
.theorem-personal-item-name:hover { text-decoration: underline; }
.theorem-personal-item-date { font-size: .72rem; color: var(--muted); }
.theorem-personal-item-actions { display: flex; flex-wrap: wrap; gap: 5px; grid-column: 1 / -1; }
.theorem-personal-current-tag { display: inline-block; margin-left: 7px; color: var(--accent); font: .65rem/1.4 monospace; }
@container (min-width: 560px) {
  .theorem-personal.wide .theorem-personal-item { grid-template-columns: minmax(0, 1fr) minmax(130px, .45fr) auto; }
  .theorem-personal.wide .theorem-personal-item-actions { grid-column: auto; }
}
.theorem-personal-subpanel { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 10px; }
.theorem-personal-subpanel input[type="text"], .theorem-personal-subpanel input[type="password"] { width: 100%; min-width: 0; }
#personal-share-form > label { display: block; margin: 8px 0; font-size: .85rem; }
.theorem-shared-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); font-size: .85rem; background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.theorem-personal-history li > span { min-width: 0; overflow-wrap: anywhere; }

/* My graphs presentation only: no rules apply to other calculator panels. */
#theorem-personal #personal-account-name { font-style: normal; font-weight: 600; color: var(--accent); }
#theorem-personal #personal-member-content { container-type: inline-size; }
#theorem-personal .theorem-personal-state-card {
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 4px; padding: 10px; margin: 0 0 12px; display: grid; gap: 8px;
}
#theorem-personal .theorem-personal-status-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
#theorem-personal .theorem-personal-state-card > .btn { justify-self: start; }
#theorem-personal #personal-current { font-weight: 600; overflow-wrap: anywhere; }
#theorem-personal .theorem-personal-badge {
  display: inline-block; width: fit-content; max-width: 100%; padding: 4px 7px;
  margin: 0; border: 1px solid currentColor; border-radius: 3px; white-space: nowrap;
  font: 600 .7rem/1.5 var(--font-mono, monospace); color: #284d38; background: #edf4ee;
}
#theorem-personal .theorem-personal-badge[data-state="draft"],
#theorem-personal .theorem-personal-badge[data-state="local"] { color: #424a48; background: #eff0ec; }
#theorem-personal .theorem-personal-badge[data-state="changed"],
#theorem-personal .theorem-personal-badge[data-state="remote"] { color: #704713; background: #fff3df; }
#theorem-personal .theorem-personal-badge[data-state="failed"],
#theorem-personal .theorem-personal-badge[data-state="conflict"] { color: #822e32; background: #fff0ee; }
#theorem-personal .theorem-personal-badge[data-state="syncing"] { color: #284e63; background: #edf4fa; }
#theorem-personal .theorem-personal-detail-body,
#theorem-personal #personal-version-detail { display: grid; gap: 8px; min-width: 0; }
#theorem-personal .theorem-personal-detail-body { padding-top: 8px; }
#theorem-personal .theorem-personal-detail-body p { margin: 0; font-size: .76rem; font-style: normal; overflow-wrap: anywhere; line-height: 1.65; }
#theorem-personal .theorem-personal-detail-body p:empty { display: none; }
#theorem-personal summary { cursor: pointer; line-height: 1.6; overflow-wrap: anywhere; }
#theorem-personal .theorem-personal-help { font-size: .8rem; }
#theorem-personal .theorem-personal-help p { margin-bottom: 0; }
#theorem-personal .theorem-personal-menu { position: relative; justify-self: end; }
#theorem-personal .theorem-personal-menu > summary {
  list-style: none; width: 24px; text-align: center; border: 1px solid var(--border);
  border-radius: 3px; font: 700 1rem/1.4 monospace; color: var(--accent);
}
#theorem-personal .theorem-personal-menu > summary::-webkit-details-marker { display: none; }
#theorem-personal .theorem-personal-menu[open] > .theorem-personal-menu-body {
  position: absolute; top: calc(100% + 5px); right: 0; z-index: 30;
  width: 260px; max-width: calc(100vw - 76px); padding: 12px; box-sizing: border-box;
  border: 1px solid var(--border); border-radius: 4px; background: var(--bg);
  box-shadow: 0 4px 14px #1a16121a; display: grid; gap: 10px;
}
#theorem-personal .theorem-personal-menu-body .theorem-personal-row,
#theorem-personal .theorem-personal-menu-body .theorem-personal-item-actions { display: grid; gap: 8px; margin: 0; }
#theorem-personal .theorem-personal-menu-body .btn { text-align: left; }
#theorem-personal .theorem-personal-menu-body .theorem-personal-details { border-top: 1px solid var(--border); padding-top: 8px; font-size: .8rem; }
#theorem-personal .theorem-personal-group h3 { margin: 12px 0 6px; font-size: .9rem; font-weight: 600; }
#theorem-personal .theorem-personal-list { overflow: visible; }
#theorem-personal #personal-graph-list .theorem-personal-item {
  grid-template-columns: minmax(0, 1fr) auto 3em auto 24px; gap: 7px; padding: 9px;
}
#theorem-personal #personal-graph-list .theorem-personal-item > * { min-width: 0; grid-column: auto; grid-row: 1; }
#theorem-personal #personal-graph-list .theorem-personal-item-name { grid-column: 1; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
#theorem-personal .theorem-personal-item-name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#theorem-personal .theorem-personal-short-id { flex-shrink: 0; font: .65rem/1.5 monospace; color: var(--muted); }
#theorem-personal .theorem-personal-current-tag { flex-shrink: 0; margin: 0; }
#theorem-personal #personal-graph-list .theorem-personal-badge { grid-column: 2; padding: 2px 4px; }
#theorem-personal #personal-graph-list .theorem-personal-item-date { grid-column: 3; white-space: nowrap; font-size: .67rem; }
#theorem-personal #personal-graph-list .theorem-personal-row-next { grid-column: 4; border-color: var(--accent); color: var(--accent); padding: 4px 6px; font-size: .65rem; white-space: nowrap; }
#theorem-personal #personal-graph-list .theorem-personal-menu { grid-column: 5; }
#theorem-personal #personal-drafts-panel { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
#theorem-personal #personal-drafts-panel > summary { font-weight: 600; font-size: .85rem; }
#theorem-personal .theorem-personal-conflict { margin-top: 12px; }
#theorem-personal button:focus-visible, #theorem-personal summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@container (max-width: 420px) {
  #theorem-personal #personal-graph-list .theorem-personal-item { gap: 4px; padding: 7px 5px; }
  #theorem-personal #personal-graph-list .theorem-personal-badge { font-size: .58rem; padding: 2px; }
  #theorem-personal #personal-graph-list .theorem-personal-item-name { font-size: .75rem; gap: 3px; }
  #theorem-personal .theorem-personal-short-id { font-size: .55rem; }
  #theorem-personal .theorem-personal-current-tag { font-size: 0; }
  #theorem-personal .theorem-personal-current-tag::after { content: '•'; font-size: .65rem; }
  #theorem-personal #personal-graph-list .theorem-personal-row-next { font-size: .58rem; padding: 4px; }
}
