/* Ember's first week, the phone's side (run F-EW1): the hello and the
 * letter's card in the feed's top slot (frames 02, 06), What I see and the
 * Fix sheet (03, 13), the tour card (04), the near-cap line and the at-cap
 * note (10, 11), and Settings' spend by piece (15). Linked after
 * ember-feed.css; the palette is pages.css's (--lp-*): Lamplit or Plaster,
 * as the owner chooses. Sizes are the feed's and the conversation's own
 * (F-TY1 sweeps them). Nothing here is red: red is only for Hearth itself
 * failing (D-EW1 §6). */

/* ---- the top slot: the hello and the letter's card ---- */
.eftop { animation: rise var(--dur) var(--ease); overflow: hidden; }
.eftop .efph { display: flex; gap: 12px; align-items: flex-start; margin-top: 2px; }
/* Ember's pixel face: her sheet's first frame, as beside her bubbles. */
.eftop .efface {
  flex: none; width: 30px; height: 46.5px; margin-top: -2px;
  background: url('../img/room/ember.png') 0 0 / 120px 325.5px no-repeat;
  image-rendering: pixelated; image-rendering: crisp-edges;
}
.eftop .eftt { flex: 1 1 auto; min-width: 0; }
.eftop .efeye { display: block; margin-bottom: 2px; }
.eftop .efti { display: block; font-family: var(--body-face); font-weight: 600; font-size: var(--t-title); line-height: var(--lh-title); color: var(--lp-ink); overflow-wrap: anywhere; }
.eftop .sub {
  margin: 2px 0 0; font-family: var(--body-face); font-size: var(--t-body); line-height: var(--lh-body); color: var(--lp-soft); opacity: 1;
  white-space: normal; overflow: visible; text-overflow: clip; max-width: none; overflow-wrap: anywhere;
}
.efx {
  position: relative; flex: none; width: 24px; height: 24px; margin: -2px -4px 0 0; padding: 0; border: 0; background: none;
  cursor: pointer; font-family: var(--body-face); font-weight: 700; font-size: var(--t-figure); line-height: var(--lh-figure); letter-spacing: var(--ls-figure); color: var(--lp-soft);
}
.efx::before { content: ''; position: absolute; inset: -10px; } /* 44 px to the finger */
/* Two buttons share the card's width (frames 02, 06). */
.efctl.two { flex-wrap: nowrap; }
.efctl.two .efbtn { flex: 1 1 0; min-width: 0; min-height: 36px; }
.eftop.gone {
  height: 0 !important; padding-top: 0; padding-bottom: 0; opacity: 0; border-color: transparent;
  transition: height var(--dur) var(--ease), opacity var(--dur-fast) var(--ease), padding var(--dur) var(--ease);
}
/* The key's rows: their second line, under the words. */
.efslide .efsub { display: block; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); }

/* ---- the sheets: What I see, Fix ---- */
.ewsheet {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center;
  background: var(--lp-scrim); color-scheme: var(--lp-scheme);
  transition: opacity var(--dur) var(--ease);
}
.ewsheet.away { opacity: 0; }
.ewcard {
  position: relative; width: 100%; max-width: 560px; max-height: calc(100% - 40px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--lp-card); color: var(--lp-ink); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
  padding: 8px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  font-family: var(--body-face); font-weight: 400; font-size: var(--t-body); line-height: var(--lh-body);
  transition: transform var(--dur) var(--ease);
}
.ewsheet.away .ewcard { transform: translateY(calc(100% + 32px)); }
.ewgrip { display: block; width: 44px; height: 5px; border-radius: 3px; margin: 0 auto 10px; background: var(--lp-edge); }
.ewtitle { margin: 4px 0 8px; font-family: var(--body-face); font-weight: 600; font-size: var(--t-title); line-height: var(--lh-title); color: var(--lp-ink); overflow-wrap: anywhere; }
.ewhead { display: flex; gap: 10px; align-items: center; }
.ewemo { flex: none; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; font-weight: 700; font-size: var(--t-figure); line-height: 1; letter-spacing: var(--ls-figure); }
.ewp { margin: 0 0 12px; color: var(--lp-soft); overflow-wrap: anywhere; }
.ewp b { color: var(--lp-ink); }
.ewsub { color: var(--lp-ink); }
.ewrows, .ewlinks { list-style: none; margin: 0 0 12px; padding: 0; }
.ewrow { display: flex; gap: 12px; align-items: center; padding: 9px 0; }
.ewrow + .ewrow { border-top: 1px solid var(--lp-edge); }
.ewmark { flex: none; width: 18px; text-align: center; color: var(--lp-soft); font-weight: 700; }
.ewwords { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ewwords .ewt { display: block; color: var(--lp-ink); }
.ewwords .ewnote { display: block; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); }
.ewswitch {
  position: relative; flex: none; width: 46px; height: 28px; padding: 0; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--lp-track);
}
.ewswitch::before { content: ''; position: absolute; inset: -8px -2px; }
.ewswitch i {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--lp-card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform var(--dur-fast) var(--ease);
}
.ewswitch.on { background: var(--lp-accent); }
.ewswitch.on i { transform: translateX(18px); }
.ewswitch[disabled] { opacity: .55; cursor: default; }
.ewlinks li + li { border-top: 1px solid var(--lp-edge); }
.ewlink {
  display: flex; width: 100%; gap: 10px; justify-content: space-between; align-items: baseline; padding: 10px 0; border: 0;
  background: none; cursor: pointer; font: inherit; color: var(--lp-ink); text-align: left;
}
.ewlink .v { flex: none; font-weight: 700; color: var(--lp-soft); }
.ewlink .v::after { content: ' ›'; }
.ewsuggest {
  display: flex; gap: 12px; align-items: center; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--lp-accentBg);
}
.ewsuggest .ewp { flex: 1 1 auto; margin: 0; color: var(--lp-ink); }
.ewsaid { margin: 0 0 10px; font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); }
.ewacts { display: flex; gap: 10px; }
.ewbtn {
  position: relative; flex: 1 1 0; min-height: 36px; padding: 4px 14px; border: 0; border-radius: 10px; cursor: pointer;
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-body); line-height: var(--lh-body); color: var(--lp-accent); background: var(--lp-accentBg);
}
.ewbtn::before { content: ''; position: absolute; inset: -4px 0; } /* 44 px to the finger */
.ewbtn.primary { color: var(--lp-card); background: var(--lp-accent); }
.ewbtn.quiet { flex: none; background: none; padding: 4px 6px; }
.ewbtn[disabled] { opacity: .55; cursor: default; }
.ewsheet button:focus-visible { outline: 2px solid var(--lp-accent); outline-offset: 2px; }

/* ---- the conversation: the tour, the near-cap line, the at-cap note ---- */
.convo .em.noline .col { gap: 0; }
.convo .tourcard .tchips { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 2px; }
.convo .tchip {
  position: relative; max-width: 100%; text-align: left; border: 0; border-radius: 16px; padding: 6px 12px; cursor: pointer;
  font-family: var(--body-face); font-weight: 600; font-size: var(--t-small); line-height: var(--lh-small); color: var(--gold); background: var(--lp-accentBg); overflow-wrap: anywhere;
}
.convo .tchip::before { content: ''; position: absolute; inset: -4px 0; }
/* Near the cap (frame 10): her line over the bar, calm, with a small gauge
 * (a picture, nearly full: no figure). */
.convo .capline {
  flex: none; display: flex; gap: 8px; align-items: flex-start; margin: 0 12px 6px;
  font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--softc);
}
.convo .capline[hidden] { display: none; }
.convo .capgauge {
  flex: none; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%;
  background: conic-gradient(var(--edge) 0 85%, var(--softc) 85% 100%);
  box-shadow: inset 0 0 0 1.5px var(--softc);
}
.convo .capcard p { margin: 0; }
.convo .capcard p b { color: var(--ink2); }

/* ---- Settings › Ember's privacy: the spend by piece (frame 15) ---- */
#settings .spendpieces .cnt { font-family: var(--body-face); font-size: var(--t-small); line-height: var(--lh-small); color: var(--lp-soft); }
#settings .spendpieces .piece .v { font-variant-numeric: tabular-nums; }
#settings .spendbar { height: 8px; margin: 8px 0 2px; border-radius: 4px; background: var(--lp-track); overflow: hidden; }
#settings .spendbar i { display: block; height: 100%; border-radius: 4px; background: var(--lp-bar); }
#settings .caproom { margin-top: 8px; }
