/* Application screens: shared field sizing and compact controls. */
:is(.lc-profile, .lc-profile-card, [data-hub-panel="templates"], .lc-prefs) input.ds-field {
  min-block-size: max(var(--ds-touch), calc(var(--ds-fs-input) * 1.35 + 2 * var(--ds-space-2)));
}
:is(.lc-profile, .lc-profile-card, [data-hub-panel="templates"], .lc-prefs) .ds-field[aria-invalid="true"] {
  background-color: color-mix(in srgb, var(--ds-status-error) 14%, var(--ds-surface-inset));
}
.lc-personal-stats .lc-screen-status { color: var(--ds-ink-muted); line-height: 1.45; }
.lc-personal-stats .lc-screen-status[data-state="error"] { color: var(--ds-status-error); }
#stats-personal-modes { margin-top: var(--ds-space-3); }
.lc-head-action.ds-btn {
  flex: none; margin-inline-start: auto; padding-inline: var(--ds-space-3);
  border: 0; border-radius: var(--ds-radius-tab); box-shadow: none;
}
.lc-head-action.ds-btn:focus-visible { outline-offset: -2px; }
.lc-shop-item .lc-cart-add > .lc-icon { display: none; }
.lc-head-action .lc-icon { inline-size: 18px; block-size: 18px; }
/* The close control already yields to Back; don't leave an invisible button occupying the shop header. */
@media (max-width: 25rem) {
  .lc-head-action.ds-btn { inline-size: var(--ds-touch); padding-inline: 0; }
  .lc-head-action span { display: none; }
  .lc-shop-list { padding-inline: var(--ds-space-3); }
  .lc-shop-item { gap: var(--ds-space-1); }
  .lc-shop-item .lc-cart-add { display: grid; place-items: center; inline-size: 36px; min-block-size: 36px; padding: 0; }
  .lc-shop-item .lc-cart-add > .lc-icon { display: block; inline-size: 16px; block-size: 16px; }
  .lc-cart-add > span { display: none; }
  .lc-shop-price { padding-inline: 5px; }
}
.profile-bio-form:not([hidden]) { display: grid; gap: var(--ds-space-2); }
.profile-bio-field { position: relative; margin-block-start: var(--ds-space-1); }
.profile-bio-field > textarea { display: block; resize: vertical; padding-block-start: calc(var(--ds-fs-micro) * 1.2 + var(--ds-space-3)); }
#profile-bio-count { position: absolute; inset-block-start: var(--ds-space-2); inset-inline-end: var(--ds-space-3);
  pointer-events: none; color: var(--ds-ink-muted); font: 600 var(--ds-fs-micro)/1 var(--lc-font); font-variant-numeric: tabular-nums; }
#profile-bio-status:empty { display: none; }
.lc-profile-about .lc-compact-heading { justify-content: space-between; }
.lc-profile-about .lc-compact-heading .set-label { margin: 0; }
.profile-privacy { display: grid; gap: var(--ds-space-2); }
.profile-privacy-tabs { display: flex; align-items: center; gap: var(--ds-space-1); min-inline-size: 0; }
.profile-privacy-tabs > .lc-tabs { flex: 1 1 auto; min-inline-size: 0; }
.profile-privacy-tabs > [data-lc-info] { flex: none; }
.profile-privacy .lc-tab { flex-basis: 0; }
@media (max-width: 359px) { #set-privacy.set-row > summary { column-gap: 8px; } }
.privacy-switches:not([hidden]) { display: grid; }
.privacy-switches .hub-toggle { padding-inline: 0; box-shadow: none; }
.privacy-switches [aria-disabled="true"] { cursor: wait; }
.privacy-switches .ds-group-title { margin-block-start: var(--ds-space-3); }
.profile-privacy .set-hint { margin: 0; }
#privacy-status:empty { display: none; }
.lc-premium-category-copy small { white-space: normal; overflow: visible; }
#set-google-on > summary { padding-block: var(--ds-space-1); }
.lc-account-summary-label {
  display: flex; flex: 1; flex-wrap: wrap; align-items: center; justify-content: space-between;
  min-inline-size: 0; gap: var(--ds-space-1) var(--ds-space-2); overflow-wrap: anywhere;
}
.lc-account-summary-label > span { min-inline-size: 0; }
.lc-account-summary-label > .set-tag { margin-inline-start: 0; max-inline-size: 100%; box-sizing: border-box; }
#set-google-on > summary .set-chevron { margin-inline-start: 0; }
#set-google-on[open] > summary .set-chevron { transform: rotate(90deg); }
.lc-account-security {
  display: grid; min-inline-size: 0; gap: var(--ds-space-3); margin: 0 var(--ds-row-inset) var(--ds-space-2);
  padding: var(--ds-space-3); border-radius: var(--ds-radius-xl); background: var(--ds-surface-inset);
  font-size: var(--ds-fs-label); overflow-wrap: anywhere;
}
.lc-account-email, .lc-account-email dd, .lc-account-security h4 { margin: 0; }
.lc-account-email dt, .lc-account-sessions small { color: var(--ds-ink-muted); }
.lc-account-email dd { margin-top: var(--ds-space-1); }
.lc-account-sessions { display: grid; gap: 1px; padding: 0; margin: var(--ds-space-1) 0 0; list-style: none; }
.lc-account-sessions:empty, #set-google-session-note:empty { display: none; }
.lc-account-sessions li { display: grid; gap: 3px; padding-block: var(--ds-space-2); border-bottom: 1px solid var(--ds-edge); }
.lc-account-session-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: var(--ds-space-1); }
.lc-account-session-line .set-tag { max-inline-size: none; margin-inline-start: 0; }
.lc-account-actions { display: flex; flex-wrap: wrap; gap: var(--ds-space-1); }
.lc-account-actions .ds-btn { min-height: 2.125rem; min-width: 0; white-space: normal; padding-inline: var(--ds-space-2); }
#set-google-delete { color: var(--ds-status-error); }
/* Compact field; the approximate group starts on its own line under exact hits. */
#profile-interest-help { margin-block: 0 var(--ds-space-2); }
#profile-interest-help p { margin: 0; }
#profile-interest-catalog-help, #profile-interest-catalog-help p + p { margin-top: var(--ds-space-2); }
#profile-interest-note { margin: var(--ds-space-2) 0 0; }
#profile-interest-note:empty { display: none; }
#profile-interest-choices { display: grid; gap: 5px; max-height: 10.25rem; overflow: auto; padding: 4px 2px 3px; }
.lc-interest-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px; min-inline-size: 0; }
#profile-interest-choices .ds-btn {
  min-inline-size: 0; max-inline-size: 100%; min-height: 1.5rem; gap: .45em;
  padding: .125rem .4rem; white-space: normal; overflow-wrap: anywhere;
  border-radius: var(--ds-radius-md); font-size: var(--ds-fs-label); text-align: start;
}
#profile-interest-direct .ds-btn[data-kind="prefix"] { --interest-tone: var(--ds-green); }
#profile-interest-nearby { --interest-tone: var(--ds-amber); }
#profile-interest-nearby .ds-btn, #profile-interest-direct .ds-btn[data-kind="prefix"] {
  --ds-btn-fill: color-mix(in srgb, var(--interest-tone) 36%, var(--ds-surface-inset));
  --ds-btn-line: color-mix(in srgb, var(--interest-tone) 58%, var(--ds-edge));
}
#profile-interest-choices .ds-btn span { min-inline-size: 0; }
#profile-interest-choices small { flex: none; font-size: inherit; font-variant-numeric: tabular-nums; }

/* A real tab rail and one set of settings forms (the All tab shows the same sections). */
[data-hub-panel="settings"] { container: settings-pane / inline-size; }
#settings-tab-content { min-inline-size: 0; }
#settings-tab-content:focus-visible { outline-offset: -3px; }
.lc-legal { container: legal-page / inline-size; padding: clamp(12px, 3vw, 24px); }
.lc-legal-copy { max-inline-size: 60ch; margin-inline: auto; overflow-wrap: anywhere; }
.lc-legal-head { padding-block: var(--ds-space-4); }
.lc-legal-head h2 { margin-block: var(--ds-space-2) 0; color: var(--ds-ink); font: 750 var(--ds-fs-heading)/1.2 var(--lc-font); }
.lc-page .lc-legal-head > .lc-doc-date { margin: 0; padding: 0; line-height: 1.4; text-align: start; }
.lc-legal-clause { border-block-start: 1px solid var(--ds-edge); padding-block: var(--ds-space-4); }
.lc-legal-clause h3 { display: flex; align-items: center; gap: var(--ds-space-2); margin: 0 0 var(--ds-space-2); font: 750 var(--ds-fs-title)/1.3 var(--lc-font); }
.lc-legal-clause h3 > svg { flex: none; color: var(--ds-ink-accent); }
.lc-legal-clause p { margin-block: 0 var(--ds-space-2); color: var(--ds-ink-muted); font: 500 var(--ds-fs-label)/1.65 var(--lc-font); }
.lc-legal-clause :is(strong, .lc-seller dd) { color: var(--ds-ink); }
.lc-legal-clause .lc-legal-callout { background: var(--ds-surface-inset); border-inline-start: 2px solid var(--ds-ink-accent); border-radius: var(--ds-radius-sm); padding: var(--ds-space-3); }
.lc-profile-modal > .lc-modal-body { display: grid; gap: var(--ds-space-3); min-height: 0; overflow: auto; overscroll-behavior: contain; }
/* Same mobile sheet, sticky header and single scroll area for Inbox and Today's bonuses. */
.lc-content-sheet[open] { display: flex; flex-direction: column; overflow: hidden; }
.lc-content-sheet > .lc-modal-head { flex: none; }
.lc-content-sheet > .lc-modal-body {
  display: grid; align-content: start; gap: var(--ds-space-3); flex: 1 1 auto;
  min-block-size: 0; min-inline-size: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: none;
  overflow-wrap: anywhere;
}
.lc-content-sheet > .lc-modal-body:focus-visible { outline: var(--ds-focus-ring); outline-offset: -3px; }

.lc-profile-modal .ds-sect { min-width: 0; padding: 0; }
.lc-bonus-guide { display: grid; margin: var(--ds-space-2) 0 0; }
.lc-bonus-guide > div { border-block-start: 1px solid var(--ds-edge); padding-block: var(--ds-space-2); }
.lc-bonus-guide dt { font-weight: 750; color: var(--ds-ink); }
.lc-bonus-guide dt small { color: var(--ds-ink-accent); font-size: var(--ds-fs-micro); }
.lc-bonus-guide dd { margin: var(--ds-space-1) 0 0; line-height: 1.5; color: var(--ds-ink-muted); }
