/* Shared phone chrome at 440 × 956, then page 14's empty chat state. */
.phone {
  --statusbar-height: 70px;
  --chat-nav-height: 61px;
  --history-search-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 30px;
  box-shadow: none;
}
.phone .phone-inner {
  border: 0;
  border-radius: 30px;
}
/* Keep the existing navigation offset below the 62 px system status area. */
.phone .statusbar {
  display: grid;
  grid-template-columns: 1fr 95px 1fr;
  align-items: start;
  height: 62px;
  margin-bottom: calc(var(--statusbar-height) - 62px);
  padding: 0;
  color: #29282e;
  font: 600 17px/22px system-ui, sans-serif;
}
.phone .statusbar > time {
  grid-column: 1;
  margin-top: 21.5px;
  padding-inline-start: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.phone .island {
  top: 18px;
  width: 136px;
  height: 40px;
  border-radius: 22px;
  background: #383838;
}
.phone .status-icons {
  display: flex;
  grid-column: 3;
  justify-self: end;
  align-items: center;
  gap: 8px;
  margin: 24.33px 43.76px 0 0;
}
.phone .status-icons svg { flex: none; }
.phone .nav {
  height: var(--chat-nav-height);
  padding: 0 var(--page-gutter);
  border: 0;
  position: relative;
}
.phone .nav-center strong {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0;
}
.phone .nav-center small {
  font-size: 11px;
  color: #898989;
  margin-top: 3px;
}
.phone .nav-center small .connection-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #898989;
  margin-right: 8px;
}
.phone .nav-center small .connection-dot.offline {
  background: transparent;
  border: 1px solid #898989;
}
.phone:has(.chat-intro) .screen {
  padding: 0 var(--page-gutter);
  scrollbar-width: none;
}
.phone:has(.chat-intro) .screen::-webkit-scrollbar { display: none; }
.chat-intro {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 120px 0 24px;
  color: #383838;
}
.chat-intro .orb-slot {
  width: 122px;
  height: 122px;
  flex: 0 0 122px;
  border: 1px dashed #292929;
  border-radius: 50%;
}
.chat-intro h1 {
  color: #8d8d8d;
  font-size: 35px;
  line-height: 1.15;
  font-weight: 400;
  letter-spacing: -.8px;
  margin: 28px 0 12px;
}
.chat-intro .intro-line {
  color: #383838;
  font-size: 14px;
  line-height: 1.55;
  white-space: nowrap;
  margin: 0;
}
.chat-intro .intro-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 52px;
}
.chat-intro .intro-actions button {
  min-width: 155px;
  min-height: 30px;
  padding: 4px 18px;
  border-radius: 999px;
  background: #d9d9d9;
  color: #383838;
  font-size: 13px;
  line-height: 1.5;
  white-space: nowrap;
}
.chat-intro .intro-actions button:hover,
.chat-intro .intro-actions button:focus-visible { background: #cacaca; }
.nav .chat-nav-icon {
  height: 44px;
  width: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  padding: 0;
}
.nav .chat-history-glyph {
  display: grid;
  grid-template-columns: repeat(2, 6px);
  gap: 2px;
  height: 12px;
}
.nav .chat-history-glyph::before,
.nav .chat-history-glyph::after {
  content: "";
  background: repeating-linear-gradient(currentColor 0 2px, transparent 2px 5px);
}
.phone .phone-footer:has(.composer) {
  padding: 0 20px 8px;
  border: 0;
}
.phone .composer {
  height: 70px;
  margin: 0;
  border: 1px solid #dedede;
  border-radius: 35px;
  padding: 0 19px;
  gap: 13px;
}
.composer .composer-plus {
  color: #bfbfbf;
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  flex: 0 0 22px;
  padding: 0;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.composer .composer-mic {
  flex: 0 0 24px;
  width: 24px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.composer .composer-mic[aria-pressed="true"] {
  border-radius: 50%;
  outline: 2px solid #9369d5;
  outline-offset: 3px;
}
.composer .composer-mic svg { width: 22px; height: 28px; }
.phone .composer input {
  font-size: 14px;
  color: #383838;
}
.phone .composer input::placeholder { color: #8a8a8a; }
.phone .composer .send { display: none; }
.phone .composer:has(input:not(:placeholder-shown)) .send { display: block; }
.phone .composer:has(input:not(:placeholder-shown)) .composer-mic { display: none; }
.phone .composer[data-has-attachments] .send { display: block; }
.phone .composer[data-has-attachments] .composer-mic { display: none; }

.phone .attachment-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.phone .attachment-draft {
  flex-wrap: nowrap;
  justify-content: flex-start;
  padding: 0 2px 6px;
  overflow-x: auto;
}
.phone .attachment-item {
  display: flex;
  max-width: 100%;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid #e8dff2;
  border-radius: 12px;
  background: #fbf8ff;
}
.phone .attachment-draft .attachment-item { flex: 0 0 auto; }
.phone .attachment-main {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 3px 7px;
  background: transparent;
  color: #42365c;
  text-align: left;
}
.phone .attachment-main img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.phone .attachment-main span { min-width: 0; }
.phone .attachment-main strong {
  display: block;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.phone .attachment-main small { display: block; font-size: 10px; color: #716986; }
.phone .attachment-remove {
  width: 28px;
  height: 32px;
  padding: 0;
  color: #716986;
  background: transparent;
  border: 0;
  font-size: 18px;
}
.phone .attachment-preview {
  display: block;
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
  border-radius: 10px;
  margin-bottom: 12px;
}
.phone .homebar {
  width: 110px;
  height: 4px;
  background: #383838;
  margin: 1px auto 8px;
  opacity: 1;
  pointer-events: none;
}
.phone .homebar[data-faded="true"] {
  opacity: 0;
  transition: opacity 180ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .phone .homebar[data-faded="true"] { transition: none; }
}
@media (max-width: 700px) {
  .chat-intro { padding-top: clamp(36px, 13vh, 120px); }
  .chat-intro .intro-line { white-space: normal; }
}

/* Daily review inside the conversation. */
#screen[data-view="chat"]:not(:has(.chat-intro)) { padding: 12px var(--page-gutter) var(--section-gap); }
#screen[data-view="chat"]:not(:has(.chat-intro)) .date-rule { font-size: 12px; margin: 5px 0 23px; }
#screen .bubble-wrap .userbubble {
  width: fit-content; max-width: 85%; margin: 0 0 0 auto;
  padding: 9px 14px; font-size: 14px; line-height: 1.45;
  color: #383838; background: #dadada; opacity: 1;
}
#screen .story-message { margin: 17px 0 0; }
#screen .story-reply {
  width: fit-content; max-width: 90%; margin: 0 0 12px;
  border-radius: 15px 15px 15px 0; padding: 10px 17px;
  color: #373737; background: #f8f8f8; font-size: 14px; line-height: 1.45;
}
.story-message .daily-card {
  padding: 12px var(--card-inset); margin: 0; border-radius: var(--card-radius);
  background: #fafafa; border: 1px solid #ddd;
}
.story-message .daily-card .caption { font-size: var(--small-size); letter-spacing: 0; margin: 0 0 8px; color: #747474; }
.story-message .daily-card > p { font-size: 14px; line-height: 1.55; color: #222; margin: 0 0 12px; }
.story-message svg, .story-dialog > svg { display: block; width: 100%; height: auto; }
.story-plot { display: block; width: 100%; padding: 0; position: relative; border: 0; border-radius: 12px; background: white; overflow: hidden; }
.story-plot span { position: absolute; top: 12px; right: 13px; color: #777; font-size: 16px; }
.story-message .source-row { margin-top: 8px; text-align: right; font-size: 11px; line-height: 1.4; color: #777; }
:is(.story-followups, .chipset, .story-message .actions) button {
  min-height: 30px; padding: 5px 16px; border: 1px solid #dcdcdc; border-radius: 20px; background: #fff; font-size: 11px;
}
.story-followups { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 16px; }
.story-followups button { min-width: 113px; background: #fafafa; }
.story-message .reply-tools {
  display: flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  margin: 5px 0 0;
}
.story-message > .health-sources + .reply-tools {
  margin-block-start: 2px;
}
.story-message .reply-tool {
  display: grid;
  place-items: center;
  width: 34px;
  min-height: 32px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #665c70;
  cursor: pointer;
}
.story-message .reply-tool svg { width: 16px; height: 16px; }
.story-message .reply-tool:is(:hover,:focus-visible,[aria-pressed="true"]) {
  color: var(--brand-ink, #60439a);
  background: var(--lavender, #f1eaf9);
  border-color: var(--lavender-line, #e6dbf5);
}
.story-message .reply-tool:active { background: var(--lavender-line, #e6dbf5); }
.story-message .reply-tool:focus-visible { outline: 2px solid var(--brand-ink, #60439a); outline-offset: 1px; }
.story-message .reply-tool:disabled { opacity: .5; cursor: default; }
.reply-copy-buffer {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.connect-device-card { width: 100%; margin-top: 12px; }
.connect-device-card > button[data-action] {
  display: flex; align-items: center; justify-content: space-between;
  box-sizing: border-box; width: 100%; min-height: 56px;
  padding: 12px var(--card-inset); border: 1px solid #dcdcdc; border-radius: var(--card-radius, 14px);
  background: #fff; color: #383838; font-size: 15px; text-align: left;
}
.connect-device-card > button[data-action]::after {
  content: ""; width: 7px; height: 7px; margin-right: 2px;
  border-top: 1.5px solid #777; border-right: 1.5px solid #777; transform: rotate(45deg);
}
.connect-device-card > button[data-action]:is(:hover,:focus-visible,:active) { background: #f5f5f5; }
.story-dialog { position: relative; padding: 14px; background: white; }
.dialog .modal-close {
  display: grid; place-items: center; z-index: 2;
  width: 36px; height: 36px; padding: 0;
  border: 0; background: transparent; color: #333; font-size: 24px; line-height: 1;
}
.story-dialog > .modal-close { position: absolute; top: 16px; right: 16px; }
.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-heading > .modal-close { flex: 0 0 36px; }
.report-dialog > .modal-heading { position: sticky; top: 0; z-index: 2; background-color: inherit; }
.story-dialog .button { margin: 12px 0 0; }

.story-message .weekly-card {
  border: 1px solid #dcdcdc;
  border-radius: var(--card-radius);
  padding: 12px var(--card-inset);
  background: #fff;
  color: #383838;
}
.weekly-card .caption { margin: 0 0 10px; color: #777; font-size: 11px; letter-spacing: 0; }
.weekly-card h3 { margin: 0 0 7px; font-size: 14px; line-height: 20px; font-weight: 400; }
.weekly-card .weekly-summary, .weekly-card .weekly-days {
  margin: 0; padding: 0; font-size: 13px; line-height: 23px; color: #747474;
}
.weekly-days { list-style: none; }
.weekly-card .source-row { margin: 8px 0; font-size: var(--small-size); }
#screen .segmented {
  display: flex; gap: 0; margin: 0; padding: 0; border: 1px solid #ddd;
  border-radius: 24px; background: #f1f1f1; overflow: hidden;
}
#screen .segmented button {
  flex: 1; min-height: var(--field-height); border: 0; border-radius: inherit;
  background: transparent; color: #383838; font-size: 13px;
}
#screen .segmented button[aria-pressed="true"] { background: #aaa; }

.weekly-card .chart-bars {
  height: 154px;
  margin: 8px 5px 30px 0;
  padding: 0 0 8px;
  gap: 0;
  border-bottom: 1px solid #e8e8e8;
  box-sizing: border-box;
}
.weekly-card .bar-wrap { min-width: 0; }
.weekly-card .bar-wrap .bar { border-radius: 2px; width: 52%; max-width: 26px; }
.weekly-card .bar-wrap b {
  margin-bottom: 4px;
  font-size: 11px;
  line-height: 14px;
  font-weight: 400;
  color: #858585;
}
.weekly-card .bar-wrap b:has(+ small) { margin-bottom: -3px; }
.weekly-card .bar-wrap small { bottom: -27px; color: #858585; font-size: 10px; white-space: nowrap; }
.weekly-card:has(.chart-bars) .source-row { margin-bottom: 10px; }


/* Shared components within the app's phone display. */
.phone {
  --page-gutter: 24px;
  --card-radius: 15px;
  --control-radius: 8px;
  --field-height: 44px;
  --action-height: 48px;
  --section-gap: 24px;
  --item-gap: 12px;
  --label-gap: 8px;
  --nav-title: 18px;
  --card-inset: 16px;
  --body-size: 14px;
  --small-size: 11px;
  --secondary-ink: #747474;
  --card-line: #ddd;
}
@media (max-width: 700px) {
  .phone { width: min(440px, 100%); height: auto; aspect-ratio: 440 / 956; }
}
#screen:not([data-view="chat"]) {
  padding: 16px var(--page-gutter) var(--section-gap);
}
.phone .nav:has(.back) > :last-child { flex: 0 0 44px; }
.phone .nav .back {
  width: 44px; height: 44px; padding: 0; border: 0;
  color: var(--dark); font-size: 27px; line-height: 1;
}
#screen > h1 { font-size: 22px; line-height: 1.4; letter-spacing: 0; margin: 8px 0 12px; }
#screen > h2, #screen .myhead h2 { font-size: 18px; line-height: 1.4; }
#screen > p:not(.micro, .meta) { font-size: var(--body-size); line-height: 1.6; color: var(--secondary-ink); }
#screen :is(.card, .growth-proposal),
.dialog[data-kind="report"] .card {
  padding: var(--card-inset); border: 1px solid var(--card-line);
  border-radius: var(--card-radius); background: #fff; margin: 12px 0;
}
#screen :is(.soft, .growth-proposal) { background: #fafafa; }
#screen .urgent-card { border-radius: var(--card-radius); padding: var(--card-inset); }
#screen .urgent-card .actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#screen :is(.card, .growth-proposal) h3 { font-size: 15px; line-height: 1.5; margin: 0 0 8px; }
#screen :is(.card, .growth-proposal, .urgent-card) p, #screen .profile-summary {
  font-size: var(--body-size); line-height: 1.6;
}
#screen .story-reply, #screen .userbubble { white-space: pre-wrap; overflow-wrap: anywhere; }
#screen .chipset { gap: 12px; margin: 12px 16px; }
#screen :is(.note-empty, .archive-row) { border-radius: var(--card-radius); padding: 14px var(--card-inset); }
#screen :is(.link-row, .row .control-label, .row strong, .form-field) { font-size: var(--body-size); }
#screen :is(.link-row small, .row small, .meta, .note) { font-size: var(--small-size); color: var(--secondary-ink); }
/* Common form and action controls inside the phone. */
.phone :is(#screen, .dialog) .form-field {
  display: block; font-size: 13px; line-height: 20px; margin: 0 0 var(--item-gap);
}
.phone :is(#screen, .dialog) .form-field :is(input, select, textarea) {
  display: block; width: 100%; min-width: 0; min-height: var(--field-height);
  margin: var(--label-gap) 0 0; padding: 8px 12px; box-sizing: border-box;
  border: 1px solid var(--card-line); border-radius: var(--control-radius);
  background: white; font: inherit; font-size: var(--body-size); color: inherit;
}
.phone :is(#screen, .dialog) .form-field textarea { min-height: 80px; }
#screen .two-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--item-gap); }
#screen .button, #overlay .dialog .button, .phone-footer .button {
  min-height: var(--action-height); border-radius: var(--control-radius);
  padding: 10px 16px; font-size: var(--body-size); line-height: 20px;
}
.phone .row { min-height: 48px; gap: var(--item-gap); padding-block: 12px; }
.phone .row > :not(.switch) { min-width: 0; overflow-wrap: anywhere; }
.phone .row .control-label { flex: 1; max-width: none; }
.phone .row small { font-size: var(--small-size); line-height: 1.5; margin-top: 4px; }
.phone .switch { width: 36px; height: 22px; }
.phone .switch::after { box-sizing: border-box; width: 16px; height: 16px; }
.phone .switch.on::after { margin-left: 14px; }
.phone-footer:not(:has(.composer)) { padding-inline: var(--page-gutter); border-top: 0; }
.phone-footer:empty { padding: 0; }
.dialog:not([data-kind="notification"], [data-kind="permission"], .story-dialog) {
  background: white; border: 1px solid var(--card-line); border-radius: var(--card-radius);
  padding: 20px var(--card-inset) 14px;
}
.dialog:not([data-kind="notification"], [data-kind="permission"]) p:not(.micro, .meta) {
  font-size: var(--body-size); line-height: 1.6;
}
.phone .screen { scrollbar-width: none; }
.phone .screen::-webkit-scrollbar { display: none; }
#screen > .segmented { margin: 12px 0 16px; }
.story-followups:has(> :nth-child(3)) button { min-width: 0; }

#screen .card.report-preview-card {
  position: relative; padding: 20px 17px 19px 13px;
  border: 1px solid #ddd; border-radius: 14px; background: #fff;
}
#screen .report-preview-card h3 {
  margin: 0 0 8px 4px; font-size: 16px; font-weight: 700; line-height: 24px; color: #383838;
}
#screen .report-preview-card .report-period {
  margin: 0 0 14px 4px; font-size: 13px; line-height: 20px; color: #888;
}
#screen .report-preview-card .button,
#screen .urgent-card .button[data-action="reportFromUrgent"] {
  width: 100%; min-height: 45px; margin: 0; padding: 8px 14px;
  border: 1px solid #ddd; border-radius: 24px; background: #f1f1f1;
  color: #383838; font-size: 16px; line-height: 24px; font-weight: 650;
}
#screen .urgent-card .button[data-action="reportFromUrgent"] { margin-top: 12px; }
.report-preview-card button[data-action="openReport"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

/* Personal homepage on the 440 × 956 artboard. */
.phone:has(#screen:is([data-management="home"],[data-management="detail"],[data-view="historyDetail"])) .nav { height: 44px; padding-inline: 12px; }
.phone:has(#screen:is([data-management="home"],[data-management="detail"],[data-view="historyDetail"])) .nav-center strong { font-size: var(--nav-title); }
#screen[data-view="my"] { padding: 32px var(--page-gutter) var(--section-gap); color: #383838; }
.account-identity { text-align: center; }
.account-avatar { width: 109px; height: 109px; margin: auto; border-radius: 50%; background: #f2f2f2; border: 1px solid #ddd; }
.account-avatar-button, .account-edit { border: 0; background: transparent; cursor: pointer; }
.account-avatar-button { display: block; margin: auto; padding: 0; border-radius: 50%; }
.account-edit { margin-top: 3px; padding: 4px 10px; font-size: 12px; color: #60439a; }
.account-identity :is(h1,p) { overflow-wrap: anywhere; }
.account-avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.account-avatar-edit img { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
#accountForm .account-avatar-edit button { width: auto; margin: 0; }
#accountForm > .button { margin-top: 14px; }
.account-identity h1 { font-size: 26px; line-height: 34px; margin: 6px 0 0; }
.account-identity p { font-size: 13px; line-height: 19px; margin: 2px 0 0; color: #888; }
.account-stats { width: min(336px, 100%); margin: 28px auto 23px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.account-stats > div { min-height: 87px; text-align: center; padding: 12px 4px 8px; border: 1px solid #ddd; border-radius: 15px; background: #f7f7f7; }
.account-stats h2 { font-size: 13px; line-height: 20px; margin: 0 0 6px; font-weight: 500; }
.account-stats p { color: #888; font-size: 11px; line-height: 19px; margin: 0; }
.account-stats i { display: inline-block; width: 9px; height: 9px; margin-right: 9px; border-radius: 50%; background: #888; }
.account-group { border: 1px solid #ddd; border-radius: 15px; padding: 0 15px; margin-bottom: 12px; }
.account-group:last-child { margin-bottom: 0; }
.account-group button { width: 100%; min-height: 56px; padding: 0 8px; display: flex; align-items: center; justify-content: space-between; text-align: left; font-size: 14px; }
.account-group button + button { border-top: 1px solid #eee; }
.account-group button span[aria-hidden] { font-size: 18px; }
.account-group button:active { background: #f7f7f7; }
.demo-login { margin: 28% auto 0; text-align: center; max-width: 300px; }


/* Shared management detail layout, measured on the 440 × 956 reference. */
#screen[data-management="detail"] { padding: 24px var(--page-gutter); color: #383838; }
#screen[data-management="detail"] > :first-child { margin-top: 0; }
#screen[data-management="detail"] .button:not(.secondary) { background: #383838; border-color: #383838; }
#screen[data-view="profile"] .button { margin: 24px 0 0; }

#screen[data-view="manageDeletion"] { padding-top: 18px; }
.deletion-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 45px; margin-bottom: 12px; padding: 8px 17px 8px 27px;
  border: 1px solid #ddd; border-radius: 8px; cursor: pointer;
  font-size: 13px; line-height: 20px; color: #222;
}
.deletion-option input {
  appearance: none; width: 14px; height: 14px; flex: 0 0 14px; margin: 0;
  border: 1.5px solid #aaa; border-radius: 50%; cursor: pointer;
}
.deletion-option input:checked { border-color: #888; }
.deletion-option input:checked::after {
  content: ""; display: block; width: 4px; height: 7px; margin: 0 auto;
  border: solid #888; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
#screen[data-view="manageDeletion"] .button { min-height: var(--action-height); margin: 24px 0 0; }
#screen[data-view="manageDeletion"] .button:disabled { opacity: .4; cursor: default; }

.phone-inner:has(#historyDrawer:not([hidden])) { --drawer-width: 79%; }
.phone-inner:has(#historyDrawer:not([hidden])) :is(#nav,#screen,#footer) {
  transform: translateX(var(--drawer-width)); opacity: .38;
}
#historyDrawer:not([hidden]) { position: absolute; inset: 0; z-index: 8; display: flex; }
.phone-inner:has(#historyDrawer:not([hidden])) .statusbar { z-index: 9; background: transparent; pointer-events: none; }
.history-panel { width: var(--drawer-width); min-width: 0; display: flex; flex-direction: column; background: #fff; box-shadow: 5px 0 16px #0000000a; padding: calc(var(--statusbar-height) + (var(--chat-nav-height) - var(--history-search-height)) / 2) 16px 12px; }
.history-filter { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: var(--history-search-height); flex-shrink: 0; border: 1px solid #e8e8e8; border-radius: 22px; background: #fafafa; color: #888; }
.history-filter svg,.history-manage svg { width: 17px; height: 17px; flex: none; }
.history-filter input { border: 0; width: 100%; min-width: 0; padding: 6px 0; font: inherit; font-size: 14px; color: #383838; background: transparent; }
#historyResults { overflow-y: auto; min-height: 0; padding: 8px 5px 12px; }
#historyResults section { margin: 0 0 18px; }
#historyResults section:first-child { border-bottom: 1px solid #eee; padding-bottom: 10px; }
.history-heading,.history-entry { display: flex; align-items: center; justify-content: space-between; }
.history-heading { min-height: 38px; }
.history-heading h2 { font-weight: 500; font-size: 12px; margin: 0; color: #777; }
.history-manage,.history-pin { font-size: 12px; min-height: 40px; color: #707070; }
.history-manage { min-width: 36px; }
.history-title { flex: 1; min-width: 0; text-align: left; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: #333; min-height: 46px; }
.history-empty { color: #888; font-size: 13px; }
.history-dismiss { flex: 1; }

/* Bound the scrolling content between the fixed chrome and footer. */
.phone .screen { min-height: 0; min-width: 0; overflow-y: auto; overflow-wrap: anywhere; }
.phone .phone-footer { flex: none; }
.phone .composer input { min-width: 0; }
.phone .toast-anchor {
  position: absolute;
  inset-inline: var(--page-gutter);
  /* 206px above the bottom of the 956px reference canvas. */
  inset-block-end: 21.55%;
  z-index: 40;
}
.phone .phone-inner .toast { position: static; }
.phone .modal-layer { z-index: 35; padding: 24px var(--page-gutter); }
.phone .dialog { max-height: 100%; margin: 0; overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.phone .dialog:not([data-kind="notification"],[data-kind="permission"],.story-dialog) {
  padding: var(--card-inset); border-radius: var(--card-radius);
}
.phone .dialog h2 { margin: 0 0 12px; font-size: 18px; line-height: 1.45; }
.phone .dialog .modal-heading > h2 { margin: 0; }
.phone .dialog > .button:last-child { margin-bottom: 0; }
.phone .dialog > .button + .button { margin-top: var(--label-gap); }
.phone .dialog .v2-table { width: 100%; }
.phone .dialog .meta { font-size: var(--small-size); }
.phone .history-panel { padding-inline: var(--card-inset); }
.phone #historyResults { padding-inline: 0; }
.phone .history-entry { min-height: 48px; gap: 8px; }
.phone .history-title { overflow-wrap: anywhere; }
.phone .screen .actions { gap: 8px; }
#screen .actions button { border-radius: var(--control-radius); min-height: var(--field-height); font-size: 13px; }

#screen .link-row { min-height: 56px; align-items: center; gap: var(--item-gap); }
#screen .link-row > span:first-child { min-width: 0; }
#screen .link-row > span:last-child { flex: none; }
