.shell[data-page=profile] {
  --intake-paper: #fcfbf8;
  --intake-ink: #292538;
  --intake-line: #dedbd4;
  --intake-muted: #645f6c;
  background: var(--intake-paper);
  color: var(--intake-ink);
}
.shell[data-page=profile] .topbar {background: var(--intake-paper); border-bottom-color: var(--intake-line)}
.shell[data-page=profile] #main-content {padding: 0 clamp(18px,5vw,27px) calc(30px + env(safe-area-inset-bottom))}
.intake-page {
  --intake-paper: #fcfbf8;
  --intake-ink: #292538;
  --intake-line: #dedbd4;
  --intake-muted: #645f6c;
  --intake-accent: #443d83;
  color: var(--intake-ink);
  padding-bottom: 8px;
}
.intake-head {padding: 31px 0 24px; border-bottom: 1px solid var(--intake-line)}
.intake-head h2 {
  font: 670 clamp(30px,7.8vw,38px)/1.3 "Songti SC","STSong","Noto Serif CJK SC","Noto Serif SC",serif;
  letter-spacing: -.035em;
}
.intake-head p {margin-top: 9px; font-size: 14px; line-height: 1.65; color: var(--intake-muted)}
.intake-form fieldset {min-inline-size: 0; margin: 0; padding: 0; border: 0}
.intake-form legend {padding: 0}
.intake-identity {display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 20px; padding: 24px 0}
.intake-label,.intake-section h3 {font: 650 17px/1.5 "Songti SC","STSong","Noto Serif CJK SC","Noto Serif SC",serif}
.intake-label {display: block; margin-bottom: 9px}
.intake-label span,.intake-zone {font: 400 12px/1.4 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif; color: var(--intake-muted)}
.intake-label span {margin-left: 3px}
.intake-section {padding: 20px 0; border-top: 1px solid var(--intake-line)}
.intake-section-heading {display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px}
.intake-form input,.intake-form select,.intake-form button {scroll-margin-block: 80px}
.intake-control {
  display: block; width: 100%; min-width: 0; height: 46px; padding: 0 12px; margin: 0;
  border: 1px solid #d0ccc8; border-radius: 7px; background-color: #fffefa;
  color: var(--intake-ink); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums;
}
.intake-control::placeholder {color: #716b76; opacity: 1}
.intake-control:disabled {background-color: #f4f2ed; color: #827d85; opacity: 1}
select.intake-control {appearance: auto; padding-inline: 8px 3px}
input[type=time].intake-control {max-width: 100%; text-align: left; -webkit-appearance: none}
input[type=time].intake-control::-webkit-date-and-time-value {text-align: left}
.intake-control:focus-visible,.intake-choices input:focus-visible + span,.intake-unknown input:focus-visible {
  outline: 2px solid var(--intake-accent); outline-offset: 2px;
}
.intake-control[aria-invalid=true],.intake-choices:has(input[aria-invalid=true]) {border-color: #9a4050}
.intake-choices {display: flex; align-items: stretch; gap: 3px; padding: 3px; min-height: 46px; border-radius: 7px; background: #f0eeea; border: 1px solid #dedad5}
.intake-choices label {position: relative; flex: 1; min-width: 0; cursor: pointer}
.intake-choices input {position: absolute; width: 1px; height: 1px; opacity: 0}
.intake-choices span {
  display: grid; place-items: center; height: 100%; border-radius: 4px; padding: 4px 10px;
  color: #57515e; line-height: 1.4; font-size: 15px; white-space: nowrap;
}
.intake-choices input:checked + span {color: #fff; background: var(--intake-accent); font-weight: 600}
.intake-calendar {padding: 2px; min-height: 40px}
.intake-calendar span {padding-inline: 12px; font-size: 13px}
.intake-date-fields {display: grid; grid-template-columns: minmax(0,1.14fr) minmax(0,1fr) minmax(0,1fr); gap: 8px}
.intake-unknown {display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; color: #504b5b; font-size: 14px}
.intake-unknown input {width: 17px; height: 17px; margin: 0; accent-color: var(--intake-accent)}
.intake-unknown-hint,.intake-conversion,.intake-error,.intake-privacy {font-size: 12.5px; line-height: 1.65}
.intake-unknown-hint,.intake-privacy {color: var(--intake-muted)}
.intake-conversion {display: block; margin-top: 8px; color: var(--intake-accent); font-variant-numeric: tabular-nums}
.intake-error {margin-top: 6px; color: #902f42}
.intake-actions {padding-top: 2px}
.intake-save-error {margin: 0 0 10px}
.intake-submit,.intake-cancel {width: 100%; min-height: 48px; border-radius: 7px; color: #fff; background: var(--intake-accent); font-size: 16px; font-weight: 600}
.intake-cancel {margin-top: 5px; background: transparent; color: var(--intake-accent); min-height: 44px; font-size: 14px; font-weight: 500}
.intake-submit:disabled {opacity: .7}
.intake-privacy {margin-top: 12px}
@media (max-width: 360px) {
  .intake-identity {gap: 12px; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr)}
  .intake-head {padding-top: 25px}
  .intake-date-fields {gap: 6px}
}

/* The name and its action share a single header control, also at narrow widths. */
.shell .profile-action {display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:1px;min-height:44px;padding:2px 3px;color:var(--purple-deep)}
.shell .profile-action .header-name {display:block;max-width:6em;line-height:1.2;text-align:left}
.profile-switch-label {display:inline-flex;align-items:center;gap:2px;font-size:10.5px;line-height:1.3;white-space:nowrap}
.profile-switch-label .ui-icon {width:10px;height:10px;transform:rotate(90deg)}
@media(max-width:430px){.shell .profile-action .header-name {max-width:3.6em}}
.profile-picker {width:min(390px,calc(100% - 28px));max-height:min(78dvh,620px);padding:0;border:1px solid #ddd8d0;border-radius:16px;background:#fcfbf8;color:#302939;box-shadow:0 12px 50px #23202a26;overflow:auto;overscroll-behavior:contain;margin:auto}
.profile-picker::backdrop {background:#25202e60}
.profile-picker header,.profile-picker footer {display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px}
.profile-picker header {border-bottom:1px solid #dedbd4}
.profile-picker h2 {margin:0;font:650 21px/1.4 "Songti SC","STSong","Noto Serif CJK SC",serif}
.profile-picker button {background:transparent;color:inherit}
.profile-picker [data-close-picker] {width:42px;height:42px;font-size:24px;color:#655d6c}
.profile-list {padding-inline:20px}
.profile-list button {display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:65px;padding:10px 0;text-align:left}
.profile-list button + button {border-top:1px solid #e5e1db}
.profile-list strong,.profile-list small {display:block;overflow-wrap:anywhere}
.profile-list strong {font-size:16px;line-height:1.5}
.profile-list small {color:#665e6b;font-size:12px;line-height:1.65}
.profile-current {color:#514684;font-size:12px;white-space:nowrap}
.profile-picker footer {border-top:1px solid #dedbd4;justify-content:flex-start;gap:8px}
.profile-picker footer button {min-height:44px;padding:0 12px;border-radius:7px;font-size:14px;color:#514684}
.profile-picker [data-new-profile] {background:#474078;color:white}
.profile-picker [role=alert] {margin:4px 20px 12px;font-size:13px;color:#902f42}
.profile-picker button:focus-visible {outline:2px solid #61558c;outline-offset:-2px}
@media(max-width:520px){.profile-picker {margin:auto auto max(10px,env(safe-area-inset-bottom));}}
