:root {
  --ink: var(--animal-text-color);
  --muted: var(--animal-text-color-secondary);
  --blue: var(--animal-primary-color);
  --cyan: var(--animal-warning-color);
  --pale: var(--animal-bg-color-secondary);
  --line: var(--animal-border-color-light);
  --paper: var(--animal-bg-color);
  --bg: #fff;
  --green: var(--animal-success-color);
  color-scheme: light;
}

html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--animal-text-color) !important;
  background: transparent !important;
  font-family: var(--animal-font-family) !important;
}
#island-background-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
#island-background-layer > .animal-background,
.ksense-dots-background { position: absolute; inset: 0; min-height: 100%; }
.ksense-grid-background {
  position: absolute !important;
  inset: 0;
  min-height: 100%;
  background-color: transparent !important;
  opacity: .34;
}
#app { position: relative; z-index: 1; min-height: 100dvh; background: transparent; }
#app, #app * { font-family: var(--animal-font-family) !important; }
.phone {
  color: var(--animal-text-color) !important;
  background: var(--animal-bg-color) !important;
  border-color: var(--animal-border-color-light) !important;
  box-shadow: 0 18px 54px rgb(61 52 40 / 11%) !important;
  font-family: var(--animal-font-family) !important;
}
#app .screen, #app .chat-screen { color: var(--animal-text-color); }
#app .title, #app h1, #app h2, #app h3, #app strong { color: var(--animal-text-color); }
#app .eyebrow, #app .subtitle, #app .story-who small, #app .time,
#app .continue-copy p, #app .chat-info p, #app .chat-header small { color: var(--animal-text-color-secondary); }
#app .brand b, #app .link, #app .small-btn, #app .speaker,
#app .meaning-panel .meaning-label, #app .chat-profile-open,
#app .learning-phrase { color: var(--animal-primary-color) !important; }
#app .story-text, #app .story-who strong { color: var(--animal-text-color) !important; }
#app .story-text { line-height: 1.58; letter-spacing: normal; }
#app .section-head { margin-top: 24px; margin-bottom: 13px; }
#app .section-head h2 { font-family: var(--animal-font-family); }
#app island-title { display: inline-block; font-family: var(--animal-font-family); }
#app .list { gap: 12px; }

/* Custom-element hosts only provide the existing screen layout; the visible control is the library component inside. */
#app island-button, #app island-tonal-button, #app island-text-button {
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  font: inherit;
}
#app island-button.btn, #app island-tonal-button.btn { display: block; }
#app island-button.full, #app island-tonal-button.full { display: block; width: 100%; }
#app island-button > button, #app island-tonal-button > button, #app island-text-button > button { max-width: 100%; }
#app .nav { background: var(--animal-bg-color) !important; border-color: var(--animal-border-color-light) !important; }
#app .nav island-button { display: flex; flex: 1; justify-content: center; }
#app .nav island-button > button {
  min-width: 64px;
  min-height: 46px;
  padding: 3px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  
  line-height: 1.15;
  white-space: normal;
}
#app .nav island-button.active > button,
#app .nav island-button > button.active { color: var(--animal-primary-color) !important; }
#app island-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; vertical-align: middle; }
#app island-icon svg { display: block; }
#app .nav-icon-wrap { display: inline-flex; position: relative; }
#app .nav-icon-wrap i { background: var(--animal-warning-color) !important; color: var(--animal-text-color) !important; }
#app .home-top-actions { display: flex; align-items: center; }
#app .notification-toggle { display: inline-flex; position: relative; }
#app .notification-badge, #app .chat-unread-badge, #app .chat-row-unread {
  background: var(--animal-warning-color) !important;
  color: var(--animal-text-color) !important;
}

#app island-card { display: block; min-width: 0; padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
#app island-card.story > .animal-card-DJ515,
#app island-card.story > [class*="animal-card-"] {
  padding: 16px 18px;
  border-radius: 20px;
  background: #f7f3df;
  color: var(--animal-text-color);
  box-shadow: none;
}
#app .story-head { display: flex; align-items: center; gap: 11px; }
#app .story-head .avatar { width: 42px; height: 42px; border-radius: 16px; font-size: 22px; background: var(--animal-bg-color-secondary) !important; }
#app .story-who { min-width: 0; flex: 1; }
#app .story-who strong { display: block; font-size: 16px; font-weight: 800; }
#app .story-who small { display: block; margin-top: 2px; font-size: 12px; }
#app island-text-button.follow-btn { display: inline-flex; flex: none; }
#app .story-text { margin: 14px 1px 13px !important; font-size: 15px !important; font-weight: 600 !important; }
#app .story-vocab { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; margin: 0 0 12px !important; padding: 0 !important; overflow: visible !important; }
#app island-tag { display: inline-flex; flex: none; }
#app island-tag small { color: var(--animal-text-color-secondary); font-size: 9px; font-weight: 700; }
#app island-divider { display: block; margin: 2px 0 10px; }
#app .story-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 !important; padding: 0 !important; border: 0 !important; }
#app .story-time-row { display: inline-flex; align-items: center; gap: 6px; }
#app island-button.story-eye { display: inline-flex; }
#app island-button.story-eye > button { min-width: 30px; min-height: 30px; padding: 3px; }
#app island-tonal-button.small-btn { display: inline-flex; flex: none; }
#app island-tonal-button.small-btn > button { padding-inline: 16px; }
#app island-button.small-btn { display: inline-flex; flex: none; }
#app island-button.small-btn > button { padding-inline: 16px; }

#app .guest-banner, #app .plus-card, #app .library-category,
#app .continue-card, #app .saved-row { display: block; width: 100%; text-align: left; }
#app island-card.guest-banner > [class*="animal-card-"],
#app island-card.plus-card > [class*="animal-card-"],
#app island-card.library-category > [class*="animal-card-"],
#app island-card.continue-card > [class*="animal-card-"],
#app island-card.saved-row > [class*="animal-card-"] {
  width: 100%; padding: 16px; border-radius: 20px; background: #f7f3df; color: var(--animal-text-color); box-shadow: none;
}
#app island-card.chat-row > [class*="animal-card-"] { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
#app .chat-list { display: flex; flex-direction: column; gap: 9px; }
#app island-card.chat-row .chat-info { min-width: 0; flex: 1; }
#app island-card.chat-row .chat-info strong { display: block; }
#app island-card.chat-row .chat-info p { display: block; margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app island-card.chat-row .time { flex: none; }
#app island-card.guest-banner > [class*="animal-card-"],
#app island-card.library-category > [class*="animal-card-"] { display: flex; align-items: center; gap: 12px; }
#app island-card.plus-card > [class*="animal-card-"] { position: relative; min-height: 170px; }
#app island-card.continue-card > [class*="animal-card-"] { display: flex; align-items: center; gap: 12px; }
#app island-card.saved-row > [class*="animal-card-"] { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; }
#app .library-categories { display: flex; flex-direction: column; gap: 10px; }
#app island-checkboxes { display: block; margin: -3px 0 14px; }
#app island-checkboxes > div { gap: 12px; }
#app .category-copy, #app .continue-copy { min-width: 0; flex: 1; }
#app .category-copy strong, #app .continue-copy strong { display: block; }
#app .category-copy small { display: block; margin-top: 3px; color: var(--animal-text-color-secondary); }
#app .category-count, #app .saved-row .source { color: var(--animal-text-color-secondary); }
#app .saved-row .meaning { grid-column: 1 / -1; color: var(--animal-text-color); }
#app .saved-row .source { grid-column: 1 / -1; font-size: 11px; }
#app .continue-copy p { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#app .composer input, #app island-input input {
  color: var(--animal-text-color) !important;
  background: var(--animal-bg-color) !important;
  border: 2px solid var(--animal-border-color-light) !important;
  border-radius: 50px !important;
  font-family: var(--animal-font-family) !important;
}
#app .bubble.ai { background: var(--animal-bg-color-secondary); color: var(--animal-text-color); }
#app .bubble.me { background: var(--animal-primary-color); color: #fff; }
#app .bubble.note { background: var(--animal-bg-color); border-color: var(--animal-border-color-light); color: var(--animal-text-color-secondary); }
#app .timer { background: var(--animal-warning-color-bg, #fff4d2) !important; color: var(--animal-text-color) !important; }
#app .settings-section { border-color: var(--animal-bg-color-secondary); }
#app .settings-section h2 { color: var(--animal-text-color) !important; }
#app .settings-list { display: flex; flex-direction: column; gap: 8px; }
#app island-card.settings-row > [class*="animal-card-"] {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 54px; padding: 12px 16px; background: #f7f3df; color: var(--animal-text-color); box-shadow: none;
}
#app island-card.settings-row [slot="headline"] { flex: 1; color: var(--animal-text-color); }
#app island-card.settings-row [slot="supporting-text"] { width: 100%; color: var(--animal-text-color-secondary); }
#app island-card.settings-row [slot="end"] { margin-left: auto; color: var(--animal-primary-color); }
#app island-card.settings-row .lang-options { display: flex; align-items: center; gap: 6px; margin: 0; }
#app island-card.settings-row island-switch { flex: none; }
#app island-card.settings-row .settings-end { padding-right: 2px; }
#app .tabs { background: transparent; padding: 0; }
#app island-tabs { display: block; margin: 0 0 14px; }
#app .animal-tab-list, #app [role="tablist"] { font-family: var(--animal-font-family); }
#app .animal-tab-active, #app [role="tab"][aria-selected="true"] { color: var(--animal-text-color); }
#app .welcome-screen, #app .intro-sheet { color: var(--animal-text-color); background: var(--animal-bg-color) !important; }
#app .onboarding-mode { background: var(--animal-bg-color) !important; }
#app .onboarding-screen, #app .intro-backdrop { background: var(--animal-bg-color) !important; }
#app .intro-sheet { background: var(--animal-bg-color) !important; }
#app .intro-slide h2 { color: var(--animal-text-color) !important; }
#app .intro-hint, #app .choice-copy small { color: var(--animal-text-color-secondary) !important; }
#app .choice-copy strong { color: var(--animal-text-color) !important; }
#app .intro-progress span { background: var(--animal-bg-color-secondary) !important; }
#app .intro-progress span.active { background: var(--animal-primary-color) !important; }
#app .intro-next { display: block; width: 100%; height: auto; background: transparent !important; color: inherit !important; box-shadow: none !important; }
#app .intro-next > button { width: 100%; min-height: 48px; }
#app .intro-close > button, #app .auth-back > button { min-width: 40px; min-height: 40px; padding: 0 12px; }
#app .welcome-brand, #app .welcome-copy h1, #app .welcome-copy p, #app .auth-copy h1,
#app .auth-copy h2, #app .auth-copy p, #app .welcome-auth, #app .auth-actions { color: var(--animal-text-color) !important; }
#app .welcome-copy h1 span { background-image: none !important; color: var(--animal-primary-color) !important; }
#app .welcome-actions island-button { display: block; width: 100%; }
#app .welcome-actions island-button > button { width: 100%; }
#app .welcome-auth { gap: 12px; }
#app .welcome-guest { margin-top: 8px; }
#app .auth-actions island-button { display: block; width: 100%; }
#app .auth-actions island-button > button { width: 100%; }
#app .welcome-brand b { color: var(--animal-primary-color) !important; }
#app .welcome-copy h1 span { background-image: linear-gradient(95deg, var(--animal-primary-color), var(--animal-text-color)) !important; }
#app .intro-next { color: var(--animal-text-color) !important; }
#app .choice-item, #app .learn-card, #app .meaning-panel { background: var(--animal-bg-color-secondary) !important; color: var(--animal-text-color) !important; border-color: var(--animal-border-color-light) !important; }
#app .choice-item.selected { background: var(--animal-primary-color-bg) !important; border-color: var(--animal-primary-color) !important; }
#app island-button.choice-item { display: block; width: 100%; }
#app island-button.choice-item > button {
  width: 100%; min-height: 60px; height: auto; padding: 12px 16px; justify-content: flex-start;
  white-space: normal; text-align: left; border-radius: 20px;
}
#app island-button.choice-item.selected > button {
  color: var(--animal-text-color) !important; background: var(--animal-primary-color-bg) !important;
  border-color: var(--animal-primary-color) !important;
}
body:has(#app .phone.onboarding-mode) #island-background-layer .ksense-grid-background { display: none; }
#app .phone.onboarding-mode,
#app .phone.onboarding-mode .onboarding-screen,
#app .phone.onboarding-mode .intro-backdrop,
#app .phone.onboarding-mode .intro-sheet {
  background: transparent !important;
}

.animal-modal-content { max-height: min(72vh, 680px); overflow: auto; color: var(--animal-text-color); font-family: var(--animal-font-family); }
.animal-modal-content .handle { display: none; }
.animal-modal-content .sheet-description, .animal-modal-content .learn-card p { color: var(--animal-text-color-secondary); }
.animal-modal-content .learn-card { margin: 10px 0; padding: 13px; border-radius: 16px; background: var(--animal-bg-color-secondary); }
.animal-modal-content .phrase-example { background: var(--animal-bg-color-secondary); border-color: var(--animal-border-color-light); }
.animal-modal-content .animal-btn-QoKe1 { font-family: var(--animal-font-family); }

@media (max-width: 520px) {
  #app { min-height: 100dvh; padding: 0; }
  #app .phone { width: 100%; min-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none !important; }
}

/* Shared spacing: use the library's published 4/8/12/16/24px scale. */
:root {
  --ks-space-1: var(--animal-spacing-xs);
  --ks-space-2: var(--animal-spacing-sm);
  --ks-space-3: var(--animal-spacing-md);
  --ks-space-4: var(--animal-spacing-lg);
  --ks-space-5: var(--animal-spacing-xl);
}

/* React components live in custom-element hosts; keep host decoration off so
   the one visible library component owns its own color, shape, and shadow. */
island-button, island-tonal-button, island-text-button {
  box-sizing: border-box;
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit;
  font: inherit;
}
island-button > button, island-tonal-button > button, island-text-button > button {
  box-sizing: border-box;
  max-width: 100%;
  font-family: var(--animal-font-family) !important;
}
island-button.btn, island-tonal-button.btn { display: block; }
island-button.btn.full, island-tonal-button.btn.full { display: block; width: 100%; }

/* Selection rows are layout wrappers; the actual Button receives the state. */
#app island-button.choice-item {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
#app island-button.choice-item > button {
  display: flex;
  width: 100%;
  min-height: 72px;
  height: auto;
  justify-content: flex-start;
  gap: var(--ks-space-3);
  padding: var(--ks-space-3) var(--ks-space-4);
  border-radius: var(--animal-border-radius-base);
  white-space: normal;
  text-align: left;
}
#app island-button.choice-item.selected > button {
  color: var(--animal-text-color) !important;
  background: var(--animal-primary-color-bg) !important;
  border-color: var(--animal-primary-color) !important;
}
#app island-button.choice-item.selected .choice-icon,
#app island-button.choice-item.selected .choice-check {
  background: var(--animal-primary-color) !important;
  border-color: var(--animal-primary-color) !important;
  color: var(--animal-bg-color) !important;
}

/* Keep story and settings cards on the component's own radius and palette. */
#app island-card.story > [class*="animal-card-"],
#app island-card.guest-banner > [class*="animal-card-"],
#app island-card.plus-card > [class*="animal-card-"],
#app island-card.library-category > [class*="animal-card-"],
#app island-card.continue-card > [class*="animal-card-"],
#app island-card.saved-row > [class*="animal-card-"],
#app island-card.settings-row > [class*="animal-card-"] {
  border-radius: var(--animal-border-radius-base);
  background: var(--animal-bg-color);
}
#app island-card.story > [class*="animal-card-"] { padding: var(--ks-space-4); }
#app .story-head { gap: var(--ks-space-3); }
#app .story-vocab { gap: var(--ks-space-2) !important; }
#app .story-bottom { gap: var(--ks-space-2); }
#app .list, #app .settings-list { gap: var(--ks-space-3); }
#app .section-head { gap: var(--ks-space-3); margin-block: var(--ks-space-5) var(--ks-space-3); }

/* Use the library's teal primary instead of the former blue accent. */
#app .bubble.me {
  background: var(--animal-primary-color) !important;
  color: var(--animal-text-color) !important;
}
#app .choice-item.selected { color: var(--animal-text-color) !important; }
#app .choice-item.selected .choice-check,
#app .choice-item.selected .choice-icon { background: var(--animal-primary-color) !important; border-color: var(--animal-primary-color) !important; }

/* The library Modal is a web dialog: inset it from the app edge and cap its
   content height on short/mobile screens to prevent the sheet escaping. */
.animal-modal-content {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: min(72dvh, 600px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: var(--ks-space-4);
}
.animal-modal-content .sheet-head { gap: var(--ks-space-3); }
.animal-modal-content .sheet-actions { display: block; margin-top: var(--ks-space-4); }
.animal-modal-content .quick-later { margin-top: var(--ks-space-2); }

@media (max-width: 520px) {
  .animal-modal-content { max-height: min(72dvh, 600px); padding: var(--ks-space-4); }
}
@media (min-width: 521px) {
  #app { padding: 28px 16px; }
  #app .phone { height: min(900px, calc(100dvh - 56px)); min-height: 650px; border: 2px solid var(--animal-border-color-light); border-radius: 26px; }
}

/* Animal Island design tokens with K-Sense brand colors: blue primary, yellow accent, brown text. */
html:root {
  --ks-color-primary: #4aa7ee;
  --ks-color-primary-hover: #338fd7;
  --ks-color-primary-active: #2678b5;
  --ks-color-primary-soft: #eaf5fd;
  --ks-color-point: #f5c31c;
  --ks-color-point-soft: #faedcd;
  --ks-color-primary-shadow: rgb(74 167 238 / 30%);
  --ks-color-point-shadow: #dba90e;
  --ks-color-nav-surface: #ffffff;
  --ks-color-nav-selected: #593719;
  --ks-icon-soft: var(--ks-color-point-soft);
  --ks-icon-warm: var(--ks-color-point);
  --animal-primary-color: var(--ks-color-primary);
  --animal-primary-color-hover: var(--ks-color-primary-hover);
  --animal-primary-color-active: var(--ks-color-primary-active);
  --animal-primary-color-bg: var(--ks-color-primary-soft);
  --animal-success-color: #6fba2c;
  --animal-success-color-hover: #85cc45;
  --animal-success-color-active: #5a9e1e;
  --animal-warning-color: var(--ks-color-point);
  --animal-warning-color-bg: var(--ks-color-point-soft);
  --animal-text-color: #794f27;
  --animal-text-color-secondary: #9f927d;
  --animal-bg-color: #f8f8f0;
  --animal-bg-color-secondary: #f0e8d8;
  --animal-border-color: #dcd8d1;
  --animal-border-color-light: #e8e2d6;
  --animal-spacing-xs: 4px;
  --animal-spacing-sm: 8px;
  --animal-spacing-md: 12px;
  --animal-spacing-lg: 16px;
  --animal-spacing-xl: 24px;
  --animal-border-radius-sm: 16px;
  --animal-border-radius-base: 18px;
  --animal-border-radius-lg: 24px;
  --animal-border-width: 2px;
  --animal-shadow-sm: 0 2px 4px 0 rgb(61 52 40 / 6%);
  --animal-shadow-base: 0 3px 10px 0 rgb(61 52 40 / 10%);
  --animal-shadow-lg: 0 8px 24px 0 rgb(61 52 40 / 14%);
  --animal-motion-duration-fast: .15s;
  --animal-motion-duration-base: .25s;
  --animal-motion-duration-slow: .35s;
  --animal-motion-ease: cubic-bezier(.4, 0, .2, 1);
  --md-sys-color-primary: var(--ks-color-primary);
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: var(--ks-color-primary-soft);
  --md-sys-color-on-primary-container: #173a55;
  --md-sys-color-secondary: var(--animal-text-color);
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: var(--ks-color-point-soft);
  --md-sys-color-on-secondary-container: var(--animal-text-color);
  --md-sys-color-tertiary: var(--ks-color-point);
  --md-sys-color-on-tertiary: var(--animal-text-color);
  --md-sys-color-tertiary-container: var(--ks-color-point-soft);
  --md-sys-color-on-tertiary-container: var(--animal-text-color);
  --md-sys-color-surface: var(--animal-bg-color);
  --md-sys-color-on-surface: var(--animal-text-color);
  --md-sys-color-on-surface-variant: var(--animal-text-color-secondary);
  --md-sys-color-surface-container: var(--animal-bg-color-secondary);
  --md-sys-color-outline: var(--animal-border-color);
}

/* Five text-only destinations keep the main areas easy to scan. */
#app .nav {
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: var(--animal-spacing-sm);
  padding: var(--animal-spacing-sm) var(--animal-spacing-md) max(var(--animal-spacing-sm), env(safe-area-inset-bottom));
  background: var(--animal-bg-color) !important;
  border-top: 1px solid var(--animal-border-color-light) !important;
}
#app .nav > island-text-button {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}
#app .nav > island-text-button > button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 2px;
  border: 0 !important;
  border-radius: var(--animal-border-radius-base) !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--animal-text-color-secondary) !important;
  
  font-weight: 700;
  white-space: nowrap;
}
#app .nav > island-text-button.active > button {
  color: var(--animal-primary-color) !important;
}

/* Story and saved-expression rows share the same white library Card surface. */
#app island-card.story > [class*="animal-card-"],
#app island-card.saved-row > [class*="animal-card-"] {
  background: var(--animal-bg-color) !important;
  border-color: var(--animal-border-color-light) !important;
}
#app island-card.saved-row > [class*="animal-card-"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--animal-spacing-sm) var(--animal-spacing-md);
  align-items: center;
  padding: var(--animal-spacing-lg);
  text-align: left;
}
#app .saved-row-main { min-width: 0; display: grid; gap: var(--animal-spacing-xs); }
#app .saved-title-line { display: flex; align-items: center; justify-content: space-between; gap: var(--animal-spacing-sm); }
#app .saved-title-line strong { min-width: 0; }
#app island-checkbox.saved-checkbox { grid-row: 1; grid-column: 1; justify-self: end; z-index: 1; }
#app island-card.saved-row:has(island-checkbox) > [class*="animal-card-"] { grid-template-columns: auto minmax(0, 1fr) auto; }
#app island-card.saved-row:has(island-checkbox) .saved-checkbox { grid-column: 1; grid-row: 1; }
#app island-card.saved-row:has(island-checkbox) .saved-row-main { grid-column: 2; }

/* Account sections use the requested Animal Island wave divider and lighter card rhythm. */
#app .settings-section { margin: var(--animal-spacing-lg) 0; padding: 0; border: 0 !important; }
#app .settings-section h2 { margin: 0 0 var(--animal-spacing-md); font-size: 18px; line-height: 1.3; }
#app .settings-list { gap: var(--animal-spacing-sm); }
#app island-card.settings-row > [class*="animal-card-"] {
  background: var(--animal-bg-color) !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: var(--animal-border-radius-base) !important;
}
#app island-divider { display: block; margin: var(--animal-spacing-md) 0 var(--animal-spacing-lg); }

/* Keep content hierarchy consistent while respecting the pink and brown token pair. */
#app .learning-phrase { color: var(--animal-primary-color) !important; text-decoration-color: var(--animal-primary-color) !important; }
#app .nav > island-text-button:not(.active) > button { color: var(--animal-text-color-secondary) !important; }
#app .follow-btn > button { border-radius: 999px !important; }
#app .notification-toggle > button { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50% !important; background: var(--animal-bg-color) !important; color: var(--animal-text-color) !important; }
#app .bubble.me { background: var(--animal-primary-color) !important; color: #fff !important; }
#app island-button.send > button, #app island-button.btn > button, #app island-button.confirm-delete > button { background: var(--animal-primary-color) !important; border-color: var(--animal-primary-color) !important; color: #fff !important; }
#app island-button.choice-item.selected > button { background: var(--animal-primary-color-bg) !important; border-color: var(--animal-primary-color) !important; }

/* Saved list filters and deletion controls use the native Select, Checkbox, Card and Button components. */
#app .library-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--animal-spacing-sm); margin: 0 0 var(--animal-spacing-md); }
#app .library-filters label, #app .flashcard-character-label { display: grid; gap: var(--animal-spacing-xs); min-width: 0; color: var(--animal-text-color-secondary); font-size: 12px; font-weight: 700; }
#app island-select { display: block; min-width: 0; }
#app .selection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--animal-spacing-md); padding: var(--animal-spacing-sm) 0; }
#app .select-toggle { min-width: 72px; }
#app island-button.select-toggle > button { min-width: 72px; border-radius: 999px !important; }
#app island-button.delete-selected > button { border-radius: 999px !important; }
#app island-checkbox { display: inline-flex; flex: none; }
#app .library-list { display: grid; gap: var(--animal-spacing-md); }
#app .library-empty { padding: var(--animal-spacing-xl) var(--animal-spacing-md); text-align: center; color: var(--animal-text-color-secondary); }

/* Small, predictable confirmation dialog and the flashcard review surface. */
.animal-modal-content:has(.confirm-dialog) { max-height: none; padding: var(--animal-spacing-xl); }
.confirm-dialog h2 { margin: var(--animal-spacing-sm) 0; font-size: 21px; line-height: 1.25; }
.confirm-dialog p { margin: 0; color: var(--animal-text-color-secondary); line-height: 1.5; }
.confirm-actions { display: flex; gap: var(--animal-spacing-sm); margin-top: var(--animal-spacing-lg); }
.confirm-actions > * { flex: 1; }
.confirm-actions > island-button > button, .confirm-actions > island-tonal-button > button { width: 100%; border-radius: 999px !important; }
#app .detail-header-row, #app .detail-pronunciation-row { display: flex; align-items: center; justify-content: space-between; gap: var(--animal-spacing-md); }
#app .detail-header-row .eyebrow, #app .detail-pronunciation-row .detail-pronunciation { margin: 0; }
#app .saved-toggle > button { border-radius: 999px !important; }
#app .speaker > button, #app .flashcard-tools > island-button > button { width: 42px; height: 42px; min-width: 42px; padding: 0; border-radius: 50% !important; background: var(--animal-bg-color) !important; color: var(--animal-text-color) !important; }
#app .flashcard { display: block; margin-top: var(--animal-spacing-lg); }
#app island-card.flashcard > [class*="animal-card-"] { min-height: 370px; padding: var(--animal-spacing-lg); background: var(--animal-bg-color) !important; border: 1px solid var(--animal-border-color-light); border-radius: var(--animal-border-radius-base); }
#app .flashcard-tools { display: flex; justify-content: flex-end; gap: var(--animal-spacing-sm); }
#app .flashcard-content { padding: 55px var(--animal-spacing-sm) var(--animal-spacing-md); text-align: center; }
#app .flashcard-content h2 { margin: 0 0 var(--animal-spacing-md); font-size: 32px; }
#app #flashcard-extra[hidden] { display: none !important; }
#app .flashcard-content > div { text-align: left; }
#app .flashcard-progress { display: grid; grid-template-columns: 1fr auto; gap: var(--animal-spacing-sm); margin-top: var(--animal-spacing-lg); color: var(--animal-text-color-secondary); }
#app .flashcard-progress .progress { grid-column: 1 / -1; margin: 0; background: var(--animal-bg-color-secondary); }
#app .flashcard-progress .progress i { background: var(--animal-primary-color); }
#app .flashcard-hint, #app .flashcard-question { text-align: center; color: var(--animal-text-color-secondary); margin: var(--animal-spacing-lg) 0; }
#app .flashcard-actions { display: flex; gap: var(--animal-spacing-md); }
#app .flashcard-actions > * { flex: 1; }
#app .flashcard-actions > * > button { width: 100%; min-height: 48px; border-radius: 999px !important; }
#app island-button.flashcard-detail > button { border-radius: var(--animal-border-radius-base) !important; }

/* Inactive onboarding icons use light brown; a selected choice stays pink. */
#app .choice-icon { background: var(--ks-icon-soft) !important; color: var(--ks-icon-warm) !important; }
#app .choice-check { border-color: var(--ks-icon-warm) !important; color: var(--ks-icon-warm) !important; }
#app island-button.choice-item.selected > button {
  color: var(--animal-text-color) !important;
  background: var(--animal-primary-color-bg) !important;
  border-color: var(--animal-primary-color) !important;
}
#app island-button.choice-item.selected .choice-icon,
#app island-button.choice-item.selected .choice-check {
  background: var(--animal-primary-color) !important;
  border-color: var(--animal-primary-color) !important;
  color: white !important;
}

/* The phone frame stays narrow on desktop too, so stack long filters inside it. */
#app #learning-list .list-top {
  width: 100%;
  grid-template-columns: 38px minmax(0, 1fr) 78px;
  gap: var(--animal-spacing-sm);
  margin-bottom: var(--animal-spacing-xl);
}
#app #learning-list .list-top .title { min-width: 0; font-size: 21px; }
#app island-button.select-toggle { display: flex; width: 78px; min-width: 78px; justify-self: end; }
#app island-button.select-toggle > button { width: 78px; min-width: 78px; height: 40px; padding: 0 10px; font-size: 13px; }
#app #learning-list .list-label { margin: 0 0 var(--animal-spacing-md); }
#app .library-filters { grid-template-columns: minmax(0, 1fr); gap: var(--animal-spacing-md); margin-bottom: var(--animal-spacing-lg); }
#app .library-filters label { width: 100%; gap: var(--animal-spacing-xs); }
#app .library-filters island-select { width: 100%; }
#app .library-filters island-select > div[class*="animal-wrapper"] { width: 100%; }
#app .library-filters island-select [role="combobox"] { width: 100%; }
#app .selection-toolbar { margin: var(--animal-spacing-sm) 0 var(--animal-spacing-md); }
#app island-button.delete-selected { display: flex; width: auto; min-width: 82px; }
#app island-button.delete-selected > button { min-width: 82px; padding-inline: 16px; }

/* Select menus belong to the narrow phone surface: open below, aligned to the trigger. */
#app .library-filters [role="listbox"],
#app .flashcard-character-label [role="listbox"] {
  position: absolute !important;
  inset: calc(100% + 6px) auto auto 0 !important;
  width: 100% !important;
  max-width: min(100%, 320px) !important;
  max-height: 48dvh;
  overflow-y: auto;
  margin: 0 !important;
  transform: none !important;
  border: 1px solid var(--animal-border-color-light);
  background: var(--animal-bg-color) !important;
  border-radius: var(--animal-border-radius-base);
  box-shadow: var(--animal-shadow-lg);
}
#app .library-filters island-select > div[class*="animal-wrapper"],
#app .flashcard-character-label island-select > div[class*="animal-wrapper"] { position: relative; }
#app .library-filters [role="option"]:hover::before,
#app .flashcard-character-label [role="option"]:hover::before { display: none !important; }

/* Remove icon tiles from the learning categories; typography carries the labels. */
#app .library-category > [class*="animal-card-"] { grid-template-columns: minmax(0, 1fr) auto auto; padding: var(--animal-spacing-md) var(--animal-spacing-lg) !important; }
#app .category-icon { display: none !important; }

/* Compact flashcard empty state, with a warm brown progress fill and no inactive controls. */
#app .flashcard-progress .progress i { background: var(--animal-text-color) !important; }
#app .flashcard-tools[hidden], #app .flashcard-actions[hidden] { display: none !important; }
#app .flashcard-content:has(#flashcard-word:not(:empty)) { min-height: 235px; display: flex; align-items: center; justify-content: center; }
#app .flashcard-content h2 { overflow-wrap: anywhere; }
#app .review-status-list { display: grid; gap: var(--animal-spacing-md); margin-top: var(--animal-spacing-md); }
#app island-card.review-status-row > [class*="animal-card-"] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--animal-spacing-md);
  min-height: 78px;
  padding: var(--animal-spacing-md) var(--animal-spacing-lg) !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: var(--animal-border-radius-base) !important;
  background: var(--animal-bg-color) !important;
  text-align: left;
}
#app .review-status-copy { display: grid; gap: var(--animal-spacing-xs); }
#app .review-status-copy strong { font-size: 16px; }
#app .review-status-copy small { color: var(--animal-text-color-secondary); font-size: 12px; line-height: 1.4; }
#app .review-status-count { color: var(--animal-text-color-secondary); font-size: 14px; font-weight: 700; }
#app island-progress { display: block; width: 100%; min-width: 0; }
#app island-progress > div { width: 100%; }
#app .flashcard-progress island-progress { grid-column: 1 / -1; }
#app .animal-checkboxItem-DxKFM input[type="checkbox"] { border-color: var(--animal-primary-color) !important; }
#app .animal-checkboxItem-DxKFM input[type="checkbox"]:checked { background: var(--animal-primary-color) !important; border-color: var(--animal-primary-color) !important; }

/* The help bulb sits inside the message field; reply ideas expand underneath it. */
#app .composer-area {
  position: relative;
  margin-top: var(--animal-spacing-sm);
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 30px;
  background: var(--animal-bg-color-secondary);
  transition: border-radius var(--animal-motion-duration-base), border-color var(--animal-motion-duration-base);
}
#app .composer-area.suggestions-open { border-color: var(--animal-border-color-light); border-radius: 22px; }
#app .composer { position: relative; gap: 8px; padding: 0; }
#app .composer island-input { display: block; flex: 1 1 auto; width: 0; min-width: 0; }
#app .composer island-input > div[class*="animal-wrapper"] {
  width: 100%;
  height: 54px;
  padding: 0 52px 0 16px;
  border: 1px solid var(--animal-border-color-light);
  background: var(--animal-bg-color) !important;
  box-shadow: none !important;
}
#app .composer island-input input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15px;
}
#app island-tooltip.reply-help { position: absolute; z-index: 4; right: 58px; top: 50%; transform: translateY(-50%); }
#app island-tooltip.reply-help > div { display: inline-flex; }
#app island-tooltip.reply-help > div > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--animal-text-color-secondary) !important;
}
#app island-button.send { display: flex; flex: 0 0 46px; width: 46px; height: 46px; }
#app island-button.send > button { width: 46px; height: 46px; min-width: 46px; padding: 0; border-radius: 50% !important; }
#app .suggestion-area { display: none; padding: 8px 8px 10px; }
#app .composer-area.suggestions-open .suggestion-area { display: block; }
#app .suggestion-count { display: block; margin: 0 0 7px auto; width: fit-content; color: var(--animal-text-color-secondary); font-size: 11px; font-weight: 700; }
#app .suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
#app .suggestions[hidden] { display: none !important; }
#app island-button.suggestion-chip { display: inline-flex; max-width: 100%; }
#app island-button.suggestion-chip > button {
  min-height: 38px;
  height: auto;
  max-width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color) !important;
  color: var(--animal-text-color) !important;
  white-space: normal;
  text-align: left;
  line-height: 1.4;
}

/* Make the save icon and drawer controls visible outside the app's phone frame portal. */
[data-animal-drawer-portal] .phrase-sheet-head { align-items: center; }
[data-animal-drawer-portal] .phrase-actions { display: flex; align-items: center; gap: var(--animal-spacing-sm); }
[data-animal-drawer-portal] island-button.phrase-save > button,
[data-animal-drawer-portal] island-tonal-button.phrase-save > button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  min-width: 82px;
  padding: 0 12px;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color-secondary) !important;
  color: var(--animal-text-color) !important;
}
[data-animal-drawer-portal] island-button.iconbtn > button,
[data-animal-drawer-portal] island-text-button.iconbtn > button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--animal-bg-color-secondary) !important;
  color: var(--animal-text-color) !important;
}

@media (max-width: 520px) {
  #app .composer-area { margin-bottom: max(env(safe-area-inset-bottom), 4px); }
  #app .composer island-input > div[class*="animal-wrapper"] { height: 52px; }
}

/* Learning section ribbons share the same heading hierarchy as New stories. */
#app #learning .section-head { justify-content: flex-start; margin-top: var(--animal-spacing-xl); }
#app #learning .review-heading { margin-top: var(--animal-spacing-2xl); }
#app #learning island-title { display: inline-flex; max-width: calc(100% - 100px); }
#app #learning island-title > * { max-width: 100%; }
#app #learning .library-categories { margin-bottom: var(--animal-spacing-xl); }

/* The Plus promotion uses the requested sprinkles library background and a clear full-width action. */
#app island-card.plus-card > [class*="animal-card-"] { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: var(--animal-spacing-md); min-height: 0; padding: var(--animal-spacing-lg) !important; overflow: hidden; background: var(--animal-bg-color-secondary) !important; color: var(--animal-text-color) !important; }
#app .plus-card::after { content: none !important; }
#app .plus-sprinkles { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
#app .plus-sprinkles > .animal-background { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .34; }
#app .plus-copy, #app .plus-action { position: relative; z-index: 1; }
#app .plus-copy { display: grid; gap: var(--animal-spacing-xs); }
#app .plus-copy strong { color: var(--animal-text-color) !important; font-size: 23px; }
#app .plus-copy > span { color: var(--animal-text-color) !important; font-size: 17px; font-weight: 700; }
#app .plus-copy small { color: var(--animal-text-color-secondary) !important; line-height: 1.5; }
#app island-button.plus-action { display: block; width: 100%; margin-top: var(--animal-spacing-sm); }
#app island-button.plus-action > button { width: 100%; min-height: 52px; border-radius: 999px !important; background: var(--animal-bg-color) !important; color: var(--animal-text-color) !important; }
#app .plus-crown { display: none !important; }

/* App-wide K-Sense footer. */
#app island-footer { display: block; margin: var(--animal-spacing-2xl) 0 var(--animal-spacing-md); color: var(--animal-text-color-secondary); text-align: center; font-size: 12px; }

/* Keep all library checkboxes compact; selection states use the current pink primary token. */
#app island-checkboxes .animal-checkboxGroup-q3P6l { gap: var(--animal-spacing-sm); }
#app island-checkboxes .animal-checkboxItem-DxKFM { gap: 6px; font-size: 12px; }
#app island-checkboxes input:checked + span,
#app island-checkbox input:checked + span { accent-color: var(--animal-primary-color); }
#app island-checkboxes [class*="checkbox"] input,
#app island-checkbox [class*="checkbox"] input { accent-color: var(--animal-primary-color); }

/* Drawer replaces the oversized centered modal. Its height follows the content and stays viewport-safe. */
[data-animal-drawer-portal] .ksense-drawer {
  left: 50% !important;
  right: auto !important;
  width: min(430px, 100vw) !important;
  transform: translate(-50%, 100%);
  height: auto !important;
  max-height: min(78dvh, 640px) !important;
  min-height: 0;
  background: var(--animal-bg-color) !important;
  color: var(--animal-text-color) !important;
  border-radius: 22px 22px 0 0 !important;
  box-shadow: 0 -12px 36px rgb(61 52 40 / 16%) !important;
  padding-bottom: max(env(safe-area-inset-bottom), 8px);
}
[data-animal-drawer-portal] .ksense-drawer[class*="animal-panelOpen"] { transform: translateX(-50%) !important; }
[data-animal-drawer-portal] .ksense-drawer > [class*="animal-body"] {
  flex: 0 1 auto;
  max-height: min(70dvh, 580px);
  overflow: auto;
  padding: var(--animal-spacing-lg) var(--animal-spacing-lg) var(--animal-spacing-xl);
  color: var(--animal-text-color) !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
[data-animal-drawer-portal] .animal-modal-content { max-height: none; overflow: visible; padding: 0; color: var(--animal-text-color); }
[data-animal-drawer-portal] .animal-modal-content .handle { display: block; width: 36px; height: 4px; margin: 0 auto var(--animal-spacing-lg); background: var(--animal-border-color); }
[data-animal-drawer-portal] island-button,
[data-animal-drawer-portal] island-tonal-button,
[data-animal-drawer-portal] island-text-button { display: inline-flex; min-width: 0; padding: 0; border: 0; background: transparent; box-shadow: none; font: inherit; }
[data-animal-drawer-portal] island-button > button,
[data-animal-drawer-portal] island-tonal-button > button,
[data-animal-drawer-portal] island-text-button > button { max-width: 100%; font-family: var(--animal-font-family) !important; }
[data-animal-drawer-portal] island-button.btn.full,
[data-animal-drawer-portal] island-tonal-button.btn.full { display: flex; width: 100%; }
[data-animal-drawer-portal] island-button.btn.full > button { width: 100%; color: var(--animal-text-color) !important; }
[data-animal-drawer-portal] .phrase-sheet-head,
[data-animal-drawer-portal] .learn-line { display: flex; align-items: center; justify-content: space-between; gap: var(--animal-spacing-md); }
[data-animal-drawer-portal] .phrase-sheet-head h2 { margin: var(--animal-spacing-xs) 0 0; font-size: 25px; }
[data-animal-drawer-portal] .confirm-actions { display: flex; gap: var(--animal-spacing-sm); margin-top: var(--animal-spacing-lg); }
[data-animal-drawer-portal] .confirm-actions > * { flex: 1; }
[data-animal-drawer-portal] .confirm-actions > * > button { width: 100%; }

/* Premium is intentionally an empty destination until its content is ready. */
#app #premium { padding-top: max(28px, env(safe-area-inset-top)); }

@media (max-width: 560px) {
  #app .library-filters { grid-template-columns: 1fr; }
  #app island-card.flashcard > [class*="animal-card-"] { min-height: 340px; }
  #app .settings-section { margin-block: var(--animal-spacing-md); }
}

/* Focused follow-up components: confirmations, contextual help, loading, counts, and notifications. */
[data-animal-drawer-portal] .confirm-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 20px; }
[data-animal-drawer-portal] .confirm-actions > button { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; min-width: 0; min-height: 48px; padding: 0 16px; border: 1px solid var(--animal-border-color-light); border-radius: 999px; font: inherit; font-weight: 650; cursor: pointer; }
[data-animal-drawer-portal] .confirm-actions > .confirm-cancel { background: var(--animal-bg-color); color: var(--animal-text-color); }
[data-animal-drawer-portal] .confirm-actions > .confirm-delete { border-color: var(--animal-primary-color); background: var(--animal-primary-color); color: white; }
[data-animal-drawer-portal] .confirm-actions > button:focus-visible { outline: 2px solid var(--animal-primary-color); outline-offset: 2px; }

#app .chat-header island-tooltip.chat-guide { display: inline-flex; flex: none; }
#app island-tooltip.chat-guide .chat-guide-button { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; min-width: 30px; padding: 0; border: 1px solid var(--animal-border-color-light) !important; border-radius: 50% !important; background: var(--animal-bg-color) !important; box-shadow: none !important; color: var(--animal-text-color-secondary) !important; }
#app island-tooltip.chat-guide .chat-guide-mark { font-size: 15px; font-weight: 700; line-height: 1; }
#app island-tooltip.chat-guide > div { display: inline-flex; }
#app .bubble.ai island-skeleton.chat-reply-skeleton { display: block; width: min(205px, 62vw); max-width: 100%; padding: 3px 0; }
#app .bubble.ai island-skeleton.chat-reply-skeleton [class*="paragraph"] { width: 100%; }

#app island-card.learning-summary { display: block; margin: 14px 0 18px; }
#app island-card.learning-summary > [class*="animal-card-"] { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 88px; padding: 16px 18px !important; border: 1px solid var(--animal-primary-color) !important; border-radius: var(--animal-border-radius-base) !important; background: var(--animal-primary-color-bg) !important; color: var(--animal-text-color) !important; }
#app .learning-summary-copy { display: grid; gap: 3px; }
#app .learning-summary-copy strong { font-size: 15px; }
#app .learning-summary-copy span { color: var(--animal-text-color-secondary); font-size: 12px; }
#app island-countup#word-countup { flex: none; color: var(--animal-text-color); font-weight: 800; }

#app .notification-toggle island-badge#home-unread-badge { position: absolute; top: -4px; right: -5px; display: inline-flex; width: auto; min-width: 0; padding: 0; background: transparent; }
#app .notification-toggle island-badge#home-unread-badge[hidden] { display: none !important; }
#app .notification-toggle island-badge#home-unread-badge > span:first-child { display: none; }
#app .notification-toggle island-badge#home-unread-badge sup { position: static; display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid var(--animal-bg-color); border-radius: 999px; background: var(--animal-primary-color); color: white; font-size: 10px; font-weight: 800; line-height: 1; }
#app .notification-list { display: grid; gap: 10px; }
#app island-card.notification-row { display: block; cursor: pointer; }
#app island-card.notification-row > [class*="animal-card-"] { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 76px; padding: 13px !important; border: 1px solid var(--animal-border-color-light) !important; border-radius: var(--animal-border-radius-base) !important; background: var(--animal-bg-color) !important; }
#app .notification-row .avatar { width: 42px; height: 42px; }
#app .notification-copy { min-width: 0; }
#app .notification-copy strong { display: block; font-size: 14px; }
#app .notification-copy p { margin: 3px 0 0; overflow: hidden; color: var(--animal-text-color-secondary); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
#app .notification-row island-badge { min-width: 22px; color: var(--animal-primary-color); }
#app .notifications-empty { padding: 48px 12px; color: var(--animal-text-color); text-align: center; }
#app .notifications-empty p { margin: 7px 0 0; color: var(--animal-text-color-secondary); font-size: 13px; }

#app .story-who strong { display: flex; align-items: center; gap: 7px; }
#app island-tag.character-hot-tag { display: inline-flex; vertical-align: middle; font-size: 9px; font-weight: 800; letter-spacing: .06em; }
[data-animal-notification-root] [data-position="bottom"] { bottom: max(24px, env(safe-area-inset-bottom)); }
[data-animal-notification-root] .ksense-toast { border-color: var(--animal-primary-color); background: var(--animal-primary-color-bg); color: var(--animal-text-color); }
[data-animal-notification-root] .ksense-toast [class*="iconWrap"] { background: var(--animal-primary-color); color: white; }

/* The help tooltip belongs to the header and stays inside the phone width. */
#app .chat-header { position: relative; }
#app island-tooltip.chat-guide { position: static; }
#app .chat-header .info { flex: 0 1 auto !important; margin-right: auto !important; }
#app .chat-header island-tooltip.chat-guide { margin-left: 8px !important; }
#app island-tooltip.chat-guide [class*="animal-tooltip-"] {
  z-index: 30;
  width: min(260px, calc(100vw - 48px));
  max-width: min(260px, calc(100vw - 48px));
  box-sizing: border-box;
}
#app island-tooltip.chat-guide [class*="animal-islandBody"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
#app island-tooltip.chat-guide [class*="animal-islandContent"] {
  padding: 11px 14px;
  overflow-wrap: anywhere;
}

/* Each reply keeps its actions beside the bubble; translations sit directly below. */
#app .ai-message { align-self: stretch; width: 100%; max-width: 100%; gap: 7px; }
#app .ai-main { display: flex; align-items: flex-start; gap: 7px; width: 100%; min-width: 0; }
#app .ai-message .bubble.ai { flex: 1 1 auto; min-width: 0; max-width: none; }
#app .ai-tools { flex: 0 0 auto; gap: 5px; margin: 2px 0 0; }
#app .ai-tool {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 30px; width: 30px; height: 30px; min-width: 30px; padding: 0;
  border: 0; border-radius: 50%; background: var(--animal-bg-color-secondary);
  color: var(--animal-text-color); font-size: 10px; font-weight: 800; line-height: 1;
}
#app .ai-tool:focus-visible { outline: 2px solid var(--animal-primary-color); outline-offset: 2px; }
#app .ai-tool[aria-expanded="true"] { background: var(--animal-primary-color-bg); color: var(--animal-primary-color); }
#app .ai-translation, #app .ai-pronunciation {
  box-sizing: border-box; width: 100%; margin: 0; padding: 9px 12px;
  border-radius: var(--animal-border-radius-base); background: var(--animal-bg-color-secondary);
  color: var(--animal-text-color-secondary); font-size: 13px; line-height: 1.5;
}
#app .ai-translation[hidden], #app .ai-pronunciation[hidden] { display: none !important; }

/* Save, audio and close are single controls inside the bottom drawer. */
[data-animal-drawer-portal] .phrase-actions { gap: 8px; flex: none; }
[data-animal-drawer-portal] .phrase-actions > button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; min-height: 42px; padding: 0 13px; border: 1px solid var(--animal-border-color-light);
  border-radius: 999px; background: var(--animal-bg-color); color: var(--animal-text-color);
  box-shadow: 0 2px 0 var(--animal-border-color-light); font-size: 14px; font-weight: 700;
}
[data-animal-drawer-portal] .phrase-actions > .speaker,
[data-animal-drawer-portal] .phrase-actions > .iconbtn { width: 42px; min-width: 42px; padding: 0; }
[data-animal-drawer-portal] .phrase-actions > .phrase-save { min-width: 88px; background: var(--animal-primary-color-bg); color: var(--animal-text-color); }
[data-animal-drawer-portal] .phrase-actions > button:active { transform: translateY(1px); box-shadow: none; }

/* A compact, accessible toast rises above the bottom navigation. */
#app-toast.toast {
  position: absolute; z-index: 60; left: 50%; bottom: calc(74px + env(safe-area-inset-bottom));
  width: max-content; max-width: calc(100% - 36px); box-sizing: border-box;
  padding: 11px 16px; border: 1px solid var(--animal-primary-color);
  border-radius: 999px; background: var(--animal-primary-color-bg); color: var(--animal-text-color);
  box-shadow: 0 6px 22px rgb(61 52 40 / 16%); font-size: 13px; line-height: 1.4;
  text-align: center; white-space: normal; opacity: 0; pointer-events: none;
  transform: translate(-50%, 14px); transition: opacity .18s ease, transform .18s ease;
}
#app-toast.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) {
  #app-toast.toast { transition: none; }
}
@media (max-width: 360px) {
  #app .chat-screen { padding-inline: 14px; }
  #app .ai-main { gap: 5px; }
  #app .ai-tools { gap: 3px; }
  #app .ai-tool { flex-basis: 28px; width: 28px; min-width: 28px; height: 28px; }
}
/* Keep the bell visible inside its count badge; only the number overlays it. */
#app .notification-toggle island-badge#home-unread-badge > span:first-child {
  display: inline-flex !important;
  position: relative;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--animal-text-color);
}
#app .notification-toggle island-badge#home-unread-badge sup {
  position: absolute;
  top: -4px;
  right: -6px;
}
#app .notification-toggle island-badge#home-unread-badge sup {
  min-width: 18px !important;
  width: auto !important;
  height: 18px !important;
  padding: 0 4px !important;
  font-size: 10px !important;
  line-height: 1 !important;
  border-width: 2px !important;
}

/* Profile copy has a clear order: short bio first, then the character's note. */
[data-animal-drawer-portal] .profile-bio-panel {
  margin: var(--animal-spacing-md) 0;
  padding: var(--animal-spacing-md) var(--animal-spacing-lg);
  border: 1px solid var(--animal-border-color-light);
  border-radius: var(--animal-border-radius-base);
  background: var(--animal-bg-color);
}
[data-animal-drawer-portal] .profile-bio-panel p {
  margin: 0;
  color: var(--animal-text-color-secondary);
  font-size: 14px;
  line-height: 1.55;
}
[data-animal-drawer-portal] .profile-about-panel {
  margin: 0 0 var(--animal-spacing-md);
  padding: var(--animal-spacing-md) var(--animal-spacing-lg);
  border-radius: var(--animal-border-radius-base);
  border-left: 3px solid var(--animal-primary-color);
  background: var(--animal-primary-color-bg);
}
[data-animal-drawer-portal] .profile-about-label {
  margin: 0 0 var(--animal-spacing-xs);
  color: var(--animal-text-color-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
[data-animal-drawer-portal] .profile-welcome-copy {
  margin: 0;
  color: var(--animal-text-color);
  font-size: 15px;
  line-height: 1.55;
}

/* Use the same Follow/Following control in the story card and profile sheet. */
#app .follow-btn > button,
[data-animal-drawer-portal] .follow-btn > button {
  box-sizing: border-box;
  min-width: 87px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color) !important;
  color: var(--animal-text-color) !important;
  box-shadow: 0 2px 0 var(--animal-border-color) !important;
}
#app .follow-btn.on > button,
[data-animal-drawer-portal] .follow-btn.on > button {
  background: var(--animal-bg-color-secondary) !important;
}
[data-animal-drawer-portal] island-tonal-button.follow-btn { flex: none; }

/* The custom-element host is only a layout wrapper. Draw the CTA once, on its button. */
[data-animal-drawer-portal] island-button.btn.full {
  display: flex;
  width: 100%;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
[data-animal-drawer-portal] island-button.btn.full > button {
  box-sizing: border-box;
  width: 100%;
  min-height: 54px;
  padding: 12px 20px;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color-secondary) !important;
  color: var(--animal-text-color) !important;
  box-shadow: 0 4px 0 var(--animal-border-color) !important;
}
[data-animal-drawer-portal] island-button.btn.full > button:focus-visible {
  outline: 2px solid var(--animal-primary-color) !important;
  outline-offset: 3px;
}

/* Learning phrases stay inline with the Korean sentence instead of looking like chips. */
#app button.learning-phrase {
  display: inline;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--animal-primary-color) !important;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  text-decoration: underline;
  text-decoration-color: var(--animal-primary-color);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  vertical-align: baseline;
  white-space: normal;
}
#app button.learning-phrase:focus-visible {
  border-radius: 2px !important;
  outline: 2px solid var(--animal-primary-color);
  outline-offset: 2px;
}
#app .story-text { display: block; max-width: 100%; white-space: normal; word-break: keep-all; overflow-wrap: break-word; }

/* Align the unread count to the bell button rather than the page edge. */
#app island-button.notification-toggle > button {
  display: flex;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
#app island-button.notification-toggle > button > span,
#app island-button.notification-toggle > button > span > span {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}
#app .notification-toggle island-badge#home-unread-badge {
  position: relative !important;
  inset: auto !important;
  display: inline-flex !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  padding: 0 !important;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
#app .notification-toggle island-badge#home-unread-badge > span:first-child {
  width: 100%;
  height: 100%;
}
#app .notification-toggle island-badge#home-unread-badge sup {
  top: -3px;
  right: -3px;
  z-index: 2;
}

/* Unread counts share the app's pink notification color. */

#app .notification-row island-badge sup {
  display: grid;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

/* Five equal navigation slots keep the labels compact on narrow phones. */
#app .nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding-inline: 10px;
}
#app .nav island-button {
  display: flex;
  width: 100%;
  min-width: 0;
  flex: none;
  justify-content: center;
}
#app .nav island-button > button {
  width: 100%;
  min-width: 0;
  padding-inline: 2px;
  text-align: center;
}

/* Legacy pink accent names now point to the yellow brand accent tokens. */
html:root {
  --ks-color-accent: var(--ks-color-point);
  --ks-color-accent-soft: var(--ks-color-point-soft);
}

/* Onboarding rows contain only the check, level (when relevant), and copy. */
#app .choice-item {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  min-height: 82px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 24px !important;
  background: var(--animal-bg-color) !important;
  color: var(--animal-text-color) !important;
  box-shadow: 0 2px 6px rgb(61 52 40 / 5%) !important;
  text-align: left !important;
}
#app .choice-item.selected {
  border: 2px solid var(--ks-color-accent) !important;
  background: var(--ks-color-accent-soft) !important;
  box-shadow: 0 4px 12px var(--ks-color-primary-shadow) !important;
}
#app .choice-copy { flex: 1 1 auto; min-width: 0; }
#app .choice-copy strong { display: block; font-size: 15px; line-height: 1.3; }
#app .choice-copy small { display: block; margin-top: 4px; line-height: 1.4; }
#app .choice-level-code {
  flex: 0 0 42px;
  color: var(--animal-text-color-secondary);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
#app .choice-item.selected .choice-level-code { color: var(--animal-primary-color); }
#app .choice-item island-checkbox { display: inline-flex; align-items: center; flex: 0 0 22px; width: 22px; height: 22px; }
#app island-checkbox .animal-cbx-r-W7r input[type="checkbox"] {
  width: var(--cbx-size) !important;
  height: var(--cbx-size) !important;
  border-color: var(--animal-border-color) !important;
  background: var(--animal-bg-color) !important;
}
#app island-checkbox .animal-cbx-r-W7r input[type="checkbox"]:checked {
  border-color: var(--ks-color-accent) !important;
  background: var(--ks-color-accent) !important;
}
#app island-checkbox .animal-cbx-r-W7r input[type="checkbox"]:focus-visible { outline-color: var(--ks-color-accent) !important; }

/* Keep the unread count tucked onto the bell circle's upper-right edge. */
#app island-button.notification-toggle > button { position: relative; overflow: visible !important; }
#app island-button.notification-toggle > button > span { position: relative; }
#app island-button.notification-toggle island-badge#home-unread-badge {
  position: absolute !important;
  top: -7px !important;
  right: -7px !important;
  z-index: 3;
  display: block !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
}
#app island-button.notification-toggle island-badge#home-unread-badge > span:first-child { display: none !important; }
#app island-button.notification-toggle island-badge#home-unread-badge sup {
  position: static !important;
  display: grid !important;
  min-width: 24px !important;
  height: 20px !important;
  padding: 0 5px !important;
  border: 2px solid var(--animal-bg-color) !important;
  border-radius: 999px !important;
  background: var(--ks-color-accent) !important;
  color: #fff !important;
  font-size: 11px !important;
  line-height: 1 !important;
}

/* Chats uses the requested dark green dot field with clear white conversation cards. */
#app #chats { position: relative; isolation: isolate; background: transparent !important; }
#app #chats > :not(.chats-dots-background) { position: relative; z-index: 1; }
#app .chats-dots-background { position: absolute; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
#app .chats-dots-background > * { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; }
#app island-card.chat-row { display: block; margin: 0 0 12px; }
#app island-card.chat-row > [class*="animal-card-"] {
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 24px !important;
  background: #fff !important;
  color: var(--animal-text-color) !important;
}

/* Fit the language picker within its row; the helper line is redundant. */
#app island-card.language-setting > [class*="animal-card-"] {
  display: grid !important;
  grid-template-columns: minmax(86px, .7fr) minmax(0, 1fr) minmax(118px, 150px) !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  padding-inline: 16px !important;
}
#app island-card.language-setting [slot="supporting-text"] { display: none !important; }
#app island-card.language-setting island-select { width: 100%; min-width: 0; max-width: 150px; }
#app island-card.language-setting island-select > * { max-width: 100%; }
#app island-card.language-setting island-select button,
#app island-card.language-setting island-select [role="combobox"] { width: 100%; min-width: 0; max-width: 100%; }

/* Remove the decorative account icon and balance the text with card padding. */
#app island-card.guest-banner > [class*="animal-card-"] { display: flex; align-items: center; gap: 14px; padding: 18px 22px !important; }
#app .guest-banner .guest-copy { flex: 1; min-width: 0; }
#app .guest-banner .chevron { flex: none; margin-left: 8px; }

/* Drawer typography and actions use the same face and widths as the rest of the app. */
[data-animal-drawer-portal], [data-animal-drawer-portal] * { font-family: var(--animal-font-family) !important; }
[data-animal-drawer-portal] .guest-signin-actions { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
[data-animal-drawer-portal] .guest-signin-actions > island-button,
[data-animal-drawer-portal] .guest-signin-actions > island-tonal-button { display: block !important; width: 100% !important; min-width: 0 !important; }
[data-animal-drawer-portal] .guest-signin-actions > island-button > button,
[data-animal-drawer-portal] .guest-signin-actions > island-tonal-button > button {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 54px !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  border-radius: 999px !important;
  font: inherit !important;
}
[data-animal-drawer-portal] .guest-signin-actions .guest-later { justify-self: center; }

/* Pink is also the selected state for notification preference switches. */
#app .settings-section island-switch [class*="animal-switch-checked"] {
  background: var(--ks-color-accent) !important;
  border-color: var(--ks-color-accent) !important;
  box-shadow: inset 0 2px 4px var(--ks-color-primary-shadow) !important;
}
#app .settings-section island-switch [class*="animal-switch-checked"] [class*="animal-handle"] { border-color: var(--ks-color-accent) !important; }

@media (max-width: 380px) {
  #app .choice-item { gap: 10px !important; padding-inline: 12px !important; }
  #app island-card.language-setting > [class*="animal-card-"] { grid-template-columns: 74px minmax(0, 1fr) 118px !important; gap: 7px !important; padding-inline: 12px !important; }
  #app island-card.chat-row > [class*="animal-card-"] { padding-inline: 12px !important; }
}


/* Polish the compact home story controls and spacing under the section ribbon. */
#app .continue-section .section-head { margin-bottom: 9px !important; }
#app #continue-chat-card { margin-top: 0 !important; }
#app island-card.story island-text-button.follow-btn > button,
#app island-card.story island-button.follow-btn > button { min-width: 84px !important; width: auto !important; min-height: 36px !important; height: 36px !important; padding: 0 14px !important; font-size: 13px !important; border-radius: 999px !important; }
#app island-checkbox .animal-cbx-r-W7r .animal-splash-95w6m { display: none !important; animation: none !important; }

/* Character conversations sit closer together in the Chats list. */
#app .chat-list { gap: 8px !important; }
#app island-card.chat-row { margin: 0 !important; }

/* Put the display-language control at the trailing edge of its card. */
#app island-card.language-setting > [class*="animal-card-"] {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
}
#app island-card.language-setting [slot="headline"] { flex: 0 1 140px; min-width: 88px; }
#app island-card.language-setting island-select { flex: 0 0 148px; width: 148px; max-width: 148px; margin-left: auto; }
#app island-card.language-setting island-select > * { width: 100% !important; max-width: 100% !important; }
#app island-card.language-setting island-select button,
#app island-card.language-setting island-select [role="combobox"] { width: 100% !important; max-width: 100% !important; }

/* Premium purchase CTA is centered and uses the light warm neutral token. */
#app island-button.plus-action { display: block; width: 100%; position: relative; inset: auto; margin-top: 12px; }
#app island-button.plus-action > button {
  display: flex !important;
  width: 100% !important;
  min-height: 48px !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color-secondary) !important;
  color: var(--animal-text-color) !important;
  text-align: center !important;
}
#app .plus-card > [class*="animal-card-"] { display: flex; flex-direction: column; align-items: stretch; }
#app button.plus-action {
  display: flex !important;
  width: 100% !important;
  min-height: 48px !important;
  margin-top: 12px !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color-secondary) !important;
  color: var(--animal-text-color) !important;
  font: inherit !important;
  text-align: center !important;
  cursor: pointer;
}

/* Separate the two learning ribbons and the flashcard list below them. */
#app .flashcard-section-head { margin: 32px 0 14px !important; }
#app .review-status-list { margin-top: 0 !important; }

/* The two review actions stay aligned at the bottom while the review area stays a fixed height. */
#app #flashcards.active {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  min-height: 0;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
#app island-card.flashcard { flex: none; height: clamp(370px, 47vh, 470px); margin-top: 16px; }
#app island-card.flashcard > [class*="animal-card-"] {
  display: flex !important;
  height: 100% !important;
  min-height: 0 !important;
  flex-direction: column !important;
  padding: 16px !important;
  overflow: hidden !important;
}
#app .flashcard-tools { flex: none; min-height: 42px; }
#app .flashcard-tools > island-button > button {
  display: grid !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 50% !important;
  background: var(--animal-bg-color) !important;
  color: var(--animal-text-color) !important;
}
#app .flashcard-tools > button {
  display: grid !important;
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  padding: 0 !important;
  place-items: center !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 50% !important;
  background: var(--animal-bg-color) !important;
  color: var(--animal-text-color) !important;
  cursor: pointer;
}
#app .flashcard-tools > button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#app .flashcard-tools island-icon { display: inline-flex !important; width: 21px; height: 21px; color: var(--animal-text-color) !important; }
#app .flashcard-tools island-icon svg { width: 100%; height: 100%; fill: currentColor !important; stroke: currentColor !important; }
#app .flashcard-content:has(#flashcard-word:not(:empty)) {
  display: flex !important;
  min-height: 0 !important;
  flex: 1 1 auto;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 10px;
  overflow: auto;
  padding: 16px 6px 2px !important;
  text-align: center;
}
#app .flashcard-content h2 { flex: none; margin: 0 !important; font-size: 30px !important; line-height: 1.25 !important; overflow-wrap: anywhere; }
#app .flashcard-content > #flashcard-extra { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: stretch; gap: 8px; text-align: left; }
#app #flashcard-extra[hidden] { display: none !important; }
#app #flashcard-pronunciation, #app #flashcard-meaning { margin: 0 !important; color: var(--animal-text-color-secondary) !important; line-height: 1.4; }
#app #flashcard-pronunciation { text-align: center; }
#app #flashcard-meaning { text-align: center; }
#app island-divider.flashcard-divider { display: block; margin: 3px 0 !important; }
#app #flashcard-extra h3 { margin: 0 !important; font-size: 16px; }
#app .flashcard-content .example-card { margin: 0; padding: 13px 14px; }
#app .flashcard-actions {
  position: sticky;
  z-index: 5;
  bottom: 0;
  display: flex;
  flex: none;
  gap: 12px;
  margin-top: auto;
  padding: 12px 0 0;
  background: var(--animal-bg-color);
}
#app .flashcard-actions > island-tonal-button,
#app .flashcard-actions > island-button { display: block; flex: 1 1 0; min-width: 0; }
#app .flashcard-actions > island-tonal-button > button,
#app .flashcard-actions > island-button > button {
  display: flex !important;
  width: 100% !important;
  height: 50px !important;
  min-height: 50px !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 10px !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: 999px !important;
  background: var(--animal-bg-color) !important;
  box-shadow: 0 3px 7px rgb(61 52 40 / 10%) !important;
  color: var(--animal-text-color) !important;
  font-size: 14px !important;
  white-space: nowrap;
}
#app .flashcard-actions > island-button.got-it > button { background: var(--animal-bg-color-secondary) !important; box-shadow: 0 4px 0 #c4b89e !important; }

/* The language dropdown sits at the right edge of its settings row. */
#app island-card.language-setting > [class*="animal-card-"] { display: flex !important; justify-content: space-between !important; }
#app island-card.language-setting island-select { flex: 0 0 148px !important; margin-left: auto !important; }
#app island-card.language-setting [slot="headline"] { flex: 0 1 auto !important; }

/* Keep the modal's small eyebrow in the same rounded face as surrounding K-Sense copy. */
[data-animal-drawer-portal] .guest-signin-copy .eyebrow { font-family: var(--animal-font-family) !important; letter-spacing: .04em; }

/* Welcome actions share dimensions; one clear pink primary action, two quiet sign-in choices. */
#app #onboarding-welcome .welcome-actions { display:flex !important; flex-direction:column !important; align-items:stretch !important; gap:10px !important; padding:18px 25px calc(env(safe-area-inset-bottom) + 17px) !important; }
#app #onboarding-welcome .welcome-auth { width:100%; gap:9px !important; }
#app #onboarding-welcome .welcome-actions island-button { display:block !important; width:100% !important; min-height:52px !important; }
#app #onboarding-welcome .welcome-actions island-button > button { display:flex !important; width:100% !important; min-width:0 !important; height:52px !important; min-height:52px !important; align-items:center !important; justify-content:center !important; border-radius:999px !important; font-size:15px !important; font-weight:700 !important; text-align:center !important; }
#app #onboarding-welcome .welcome-auth .apple-login > button,
#app #onboarding-welcome .welcome-auth .email-login > button { border:1px solid var(--animal-border-color-light) !important; background:#fff !important; box-shadow:0 2px 5px rgb(61 52 40 / 8%) !important; color:var(--animal-text-color) !important; }
#app #onboarding-welcome .welcome-actions .welcome-guest { margin-top:1px !important; }
#app #onboarding-welcome .welcome-actions island-text-button.welcome-guest,
#app #onboarding-auth .auth-actions island-text-button.welcome-guest { display:flex !important; width:max-content !important; min-height:40px !important; align-self:center !important; }
#app #onboarding-welcome .welcome-actions island-text-button.welcome-guest > button,
#app #onboarding-auth .auth-actions island-text-button.welcome-guest > button { width:auto !important; min-width:0 !important; min-height:40px !important; padding:4px 8px !important; border:0 !important; border-radius:0 !important; background:transparent !important; box-shadow:none !important; color:var(--animal-text-color) !important; font-size:14px !important; font-weight:700 !important; text-decoration:underline !important; text-underline-offset:4px; }
#app #onboarding-welcome island-footer { display:block; margin:7px 0 0 !important; font-size:11px !important; color:var(--animal-text-color-secondary) !important; }

/* Remove the unnecessary close control and make saving the clear primary action. */
[data-animal-drawer-portal] .phrase-actions button[aria-label="Close"] { display:none !important; }
[data-animal-drawer-portal] .phrase-actions { align-items:center; gap:10px !important; }
[data-animal-drawer-portal] .phrase-actions .speaker { width:44px; height:44px; border-radius:50%; background:var(--animal-bg-color-secondary) !important; color:var(--animal-text-color) !important; }
[data-animal-drawer-portal] .phrase-actions .phrase-save { min-width:136px; min-height:46px; border:0 !important; border-radius:999px !important; background:var(--ks-color-accent-soft) !important; color:var(--animal-text-color) !important; box-shadow:0 3px 0 var(--ks-color-point-shadow) !important; font-weight:800; }

/* Editable suggestions stay compact; tapping the card sends, editing the input does not. */
#app .suggestion-edit-row { min-height:50px; padding:6px 11px; gap:8px; cursor:pointer; }
#app .suggestion-edit-row .suggestion-send { display:none !important; }
#app .suggestion-edit-row > island-icon { width:18px; height:18px; flex:none; color:var(--animal-text-color-secondary); }
#app .suggestion-area .suggestion-count { margin:0 0 4px; text-align:right; }
#app .suggestions { gap:8px !important; padding-top:6px !important; }

/* Message bubbles follow the card palette: cream for the AI and pink for the learner. */
#app .bubble.ai { background: #f7f3df !important; color: var(--animal-text-color) !important; }
#app .messages .bubble.me {
  background: #f5f8e0 !important;
  color: #5a6b28 !important;
}
#app .messages .bubble.me .learning-phrase {
  color: #5a6b28 !important;
  font-weight: 900 !important;
  text-decoration-color: #5a6b28 !important;
  text-decoration-thickness: 2px;
}
#app .ai-main { display: flex !important; align-items: flex-start !important; gap: 8px !important; }
#app .ai-message .bubble.ai {
  flex: 0 1 auto !important;
  width: fit-content !important;
  max-width: calc(100% - 112px) !important;
  min-width: 0 !important;
  overflow-wrap: anywhere;
}
#app .ai-message .ai-tools { flex: 0 0 auto; }
#app .bubble.ai .ai-translation {
  width: 100%;
  margin: 7px 0 0;
  padding: 6px 0 0;
  border-top: 1px solid rgb(121 79 39 / 16%);
  border-radius: 0;
  background: transparent !important;
  color: var(--animal-text-color-secondary) !important;
  font-size: 12px;
  line-height: 1.45;
}
#app .bubble.ai .ai-translation[hidden] { display: none !important; }

/* The story context is plain typewritten copy, not another tooltip card. */
#app #chat-context-slot { flex: none; width: 100%; padding: 10px 0 12px; }
#app island-tooltip.chat-context-tooltip { display: block !important; width: 100% !important; }
#app .chat-context-typewriter {
  display: block; white-space: pre-line; color: var(--animal-text-color) !important;
  font-size: 14px; font-style: italic; font-weight: 700; line-height: 1.6; text-align: left;
}

/* Two editable reply examples are wide input cards, with a pencil cue and send action. */
#app .composer-area.suggestions-open { padding: 10px 12px 12px !important; border: 1px solid var(--animal-border-color-light); border-radius: 22px; background: #f8f8f0; }
#app .suggestion-area { width: 100%; }
#app .suggestions {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 9px !important;
  width: 100% !important;
  padding: 9px 0 0 !important;
}
#app .suggestions[hidden] { display: none !important; }
#app .suggestion-edit-row {
  display: flex; align-items: center; gap: 9px; width: 100%; min-width: 0;
  padding: 8px 10px; border: 1px solid var(--animal-border-color-light); border-radius: 18px;
  background: #fff; box-shadow: 0 3px 9px rgb(61 52 40 / 9%);
}
#app .suggestion-edit-row > island-icon { color: var(--animal-text-color-secondary); }
#app island-input.suggestion-edit-input { display: block; flex: 1; min-width: 0; }
#app island-input.suggestion-edit-input input { width: 100%; min-width: 0; padding: 7px 0; border: 0; outline: 0; background: transparent; color: var(--animal-text-color); font: inherit; font-size: 13px; }
#app island-button.suggestion-send { display: block; flex: none; }
#app island-button.suggestion-send > button { display: grid !important; width: 34px !important; height: 34px !important; min-width: 34px !important; padding: 0 !important; place-items: center !important; border-radius: 50% !important; background: var(--ks-color-accent) !important; color: #fff !important; }
@media (max-width: 380px) {
  #app .ai-message .bubble.ai { max-width: calc(100% - 102px) !important; }
  #app .composer-area.suggestions-open { padding-inline: 8px !important; }
}

/* Reply suggestions use a plain text preview; the pencil opens the editor. */
#app .suggestion-edit-row {
  min-height: 64px; padding: 12px 16px; gap: 12px; border-radius: 20px;
  border-color: var(--animal-border-color-light); background: #fff;
  box-shadow: 0 4px 12px rgb(61 52 40 / 10%); cursor: pointer;
}
#app .suggestion-pencil { display: grid; width: 24px; height: 24px; flex: none; padding: 2px; place-items: center; background: transparent; color: var(--animal-text-color-secondary); }
#app .suggestion-pencil svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#app .suggestion-display-text { flex: 1; min-width: 0; color: var(--animal-text-color); font-size: 14px; font-weight: 650; }
#app .suggestion-edit-input { flex: 1; min-width: 0; padding: 5px 2px; border: 0; outline: 0; background: transparent; color: var(--animal-text-color); font: inherit; font-size: 14px; }
#app .suggestion-edit-input:focus { box-shadow: 0 2px 0 var(--ks-color-accent); }
#app .suggestion-edit-row:focus-visible { outline: 2px solid var(--ks-color-accent); outline-offset: 2px; }

/* The save-from-reply sheet has two pink category chips and one changing list panel. */
[data-animal-drawer-portal] .learn-picker { overflow: hidden; border: 1.5px solid var(--animal-border-color-light); border-radius: 20px; background: var(--animal-bg-color); }
[data-animal-drawer-portal] .learn-chip-row { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--animal-border-color-light); }
[data-animal-drawer-portal] .learn-chip { flex: 1; min-height: 42px; padding: 8px 12px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--animal-text-color-secondary); font: inherit; font-weight: 700; cursor: pointer; }
[data-animal-drawer-portal] .learn-chip.selected { background: var(--ks-color-accent); color: var(--animal-text-color); }
[data-animal-drawer-portal] .learn-chip:focus-visible { outline: 2px solid var(--animal-text-color); outline-offset: 2px; }
[data-animal-drawer-portal] .learn-choice-list { display: grid; gap: 9px; padding: 11px; }
[data-animal-drawer-portal] .learn-choice { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid var(--animal-border-color-light); border-radius: 16px; background: #fff; box-shadow: 0 3px 9px rgb(61 52 40 / 7%); }
[data-animal-drawer-portal] .learn-choice-copy { min-width: 0; }
[data-animal-drawer-portal] .learn-choice-copy .saved-kind { display: block; margin-bottom: 3px; color: var(--ks-color-accent); }
[data-animal-drawer-portal] .learn-choice-copy strong { display: block; color: var(--animal-text-color); font-size: 15px; }
[data-animal-drawer-portal] .learn-choice-copy p { margin: 3px 0 0; color: var(--animal-text-color-secondary); font-size: 12px; line-height: 1.45; }
[data-animal-drawer-portal] .learn-choice-save { display: inline-flex; min-width: 76px; min-height: 38px; flex: none; align-items: center; justify-content: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--animal-border-color-light); border-radius: 999px; background: var(--animal-bg-color); color: var(--animal-text-color); font: inherit; font-size: 12px; font-weight: 700; }
[data-animal-drawer-portal] .learn-choice-save:hover { border-color: var(--ks-color-accent); }
[data-animal-drawer-portal] .learn-choice-empty { padding: 15px; color: var(--animal-text-color-secondary); text-align: center; }
[data-animal-drawer-portal] .learn-done { margin-top: 12px; }
[data-animal-drawer-portal] .follow-btn.on { background: var(--ks-color-accent-soft) !important; color: var(--animal-text-color) !important; }

/* Phrase detail sheet actions: bookmark-only Save and a full-width detail route. */
[data-animal-drawer-portal] .phrase-actions .phrase-save.icon-only { display: grid; width: 46px; min-width: 46px; height: 46px; min-height: 46px; padding: 0; place-items: center; border: 1px solid var(--animal-border-color-light) !important; border-radius: 50% !important; background: var(--ks-color-accent-soft) !important; color: var(--animal-text-color) !important; box-shadow: 0 3px 0 var(--ks-color-point-shadow) !important; }
[data-animal-drawer-portal] .phrase-more { display: flex; width: 100%; min-height: 50px; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; border: 1px solid var(--animal-border-color-light); border-radius: 999px; background: var(--ks-color-accent-soft); box-shadow: 0 4px 0 var(--ks-color-point-shadow); color: var(--animal-text-color); font: inherit; font-weight: 800; }
[data-animal-drawer-portal] .phrase-more span { font-size: 21px; line-height: 1; }

/* Save confirmations use the Animal Island notification palette. */
#app .toast { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 10px 16px; border: 1px solid var(--animal-border-color-light); border-left: 4px solid var(--ks-color-accent); border-radius: 16px; background: var(--animal-bg-color); box-shadow: 0 8px 22px rgb(61 52 40 / 16%); color: var(--animal-text-color); font-size: 14px; font-weight: 750; }
#app .toast-mark { display: grid; width: 24px; height: 24px; flex: none; place-items: center; border-radius: 50%; background: var(--ks-color-accent); color: var(--animal-text-color); font-weight: 900; }

/* Only Home, Learning, and My use the grid background; Chats keeps its green dots. */
#island-background-layer .ksense-grid-background { display: none !important; }
body:has(#app #home.active) #island-background-layer .ksense-grid-background,
body:has(#app #learning.active) #island-background-layer .ksense-grid-background,
body:has(#app #mypage.active) #island-background-layer .ksense-grid-background { display: block !important; }
body:has(#app #home.active) #island-background-layer .ksense-dots-background,
body:has(#app #learning.active) #island-background-layer .ksense-dots-background,
body:has(#app #mypage.active) #island-background-layer .ksense-dots-background { display: none !important; }
#app .phone:has(#home.active), #app .phone:has(#learning.active), #app .phone:has(#mypage.active) { background: transparent !important; }

/* Premium uses the library's yellow dot background and a compact icon tab bar. */
#island-background-layer .ksense-premium-dots-background {
  position: absolute !important;
  inset: 0;
  display: none !important;
  min-height: 100%;
  opacity: .38;
  pointer-events: none;
}
body:has(#app #premium.active) #island-background-layer .ksense-grid-background,
body:has(#app #premium.active) #island-background-layer .ksense-dots-background { display: none !important; }
body:has(#app #premium.active) #island-background-layer .ksense-premium-dots-background { display: block !important; }
#app .phone:has(#premium.active), #app #premium.active { background: transparent !important; }

#app .nav > island-text-button.nav-item { display: flex !important; min-width: 0; flex: 1 1 0 !important; }
#app .nav > island-text-button.nav-item > button {
  display: flex !important;
  width: 100% !important;
  height: 66px !important;
  min-height: 66px !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 4px 1px !important;
  border-radius: var(--animal-border-radius-sm) !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--animal-text-color-secondary) !important;
}
#app .nav { background: var(--ks-color-nav-surface) !important; }
#app .nav > island-text-button.nav-item > button > svg { display: block !important; flex: none !important; width: 26px !important; height: 26px !important; }
#app .nav > island-text-button.nav-item > button > .nav-label { display: block !important; overflow: hidden; max-width: 100%; margin: 0 !important;  font-weight: 700 !important; line-height: 1.15 !important; text-overflow: ellipsis; white-space: nowrap; }
#app .nav > island-text-button.nav-item.active > button {
  background: transparent !important;
  color: var(--ks-color-nav-selected) !important;
}
#app .nav > island-text-button.nav-item.active > button > .nav-label { color: var(--ks-color-nav-selected) !important; }

/* Keep the five tab labels readable without emoji or generated icons. */
#app .nav > island-text-button.nav-item > button { height:52px !important; min-height:52px !important; gap:0 !important; padding:4px 2px !important; }
#app .nav > island-text-button.nav-item > button > svg,
#app .nav > island-text-button.nav-item > button > island-icon { display:none !important; }
#app .nav > island-text-button.nav-item > button > .nav-label {  line-height:1.2 !important; }

/* Onboarding leaves room below the copy and advances both progress segments in sequence. */
#app #onboarding-welcome .welcome-copy { top:32% !important; }
#app #onboarding-welcome .welcome-progress-segment::after { animation:none !important; width:0; }
#app #onboarding-welcome .welcome-progress.first-active .welcome-progress-segment:first-child::after { animation:welcome-progress-fill 1.5s linear forwards !important; }
#app #onboarding-welcome .welcome-progress.second-active .welcome-progress-segment:first-child::after { width:100%; animation:none !important; }
#app #onboarding-welcome .welcome-progress.second-active .welcome-progress-segment:nth-child(2)::after { animation:welcome-progress-fill 1.5s linear forwards !important; }

/* Matching login controls use equal sizing, with a clear primary and secondary treatment. */
#app #onboarding-welcome .welcome-auth .apple-login > button,
#app #onboarding-welcome .welcome-auth .email-login > button { width:100% !important; height:52px !important; min-height:52px !important; border-radius:999px !important; }
#app #onboarding-welcome .welcome-auth .apple-login > button { border:1px solid var(--ks-color-primary) !important; background:var(--ks-color-primary) !important; box-shadow:0 4px 0 var(--ks-color-primary-shadow,#2477b7) !important; color:#fff !important; }
#app #onboarding-welcome .welcome-auth .email-login > button { border:2px solid var(--animal-border-color-light) !important; background:var(--animal-bg-color) !important; box-shadow:0 3px 0 var(--animal-border-color-light) !important; color:var(--animal-text-color) !important; }

/* Story vocabulary chips are removed; the character story remains the learning context. */
#app .story-vocab { display:none !important; }

/* Translated character introductions sit quietly beneath the Korean original. */
[data-animal-drawer-portal] .profile-story-translation { margin:8px 0 0; color:var(--animal-text-color-secondary); font-size:12px; font-weight:400; font-style:italic; line-height:1.55; }

/* Confirmation sheet buttons share the same bounds and Animal Island treatment. */
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions { display:flex !important; align-items:stretch; gap:12px; margin-top:20px; }
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions island-button,
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions island-tonal-button { display:block; flex:1; min-width:0; }
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions island-button > button,
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions island-tonal-button > button { display:flex !important; width:100% !important; min-width:0 !important; min-height:48px !important; align-items:center; justify-content:center; padding:0 14px !important; border:1px solid var(--animal-border-color-light) !important; border-radius:999px !important; background:var(--animal-bg-color) !important; box-shadow:0 3px 0 var(--animal-border-color-light) !important; color:var(--animal-text-color) !important; }
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions island-button > button { border-color:var(--ks-color-primary) !important; background:var(--ks-color-primary) !important; box-shadow:0 3px 0 var(--ks-color-primary-shadow,#2477b7) !important; color:#fff !important; }

/* Open-source and analytics disclosures follow the existing settings sheet rhythm. */
[data-animal-drawer-portal] .open-source-sheet h2 { margin:4px 0 14px; color:var(--animal-text-color); font-size:22px; }
[data-animal-drawer-portal] .open-source-entry { margin:10px 0; padding:14px; border:1px solid var(--animal-border-color-light); border-radius:18px; background:#fff; }
[data-animal-drawer-portal] .open-source-entry strong { display:block; color:var(--animal-text-color); }
[data-animal-drawer-portal] .open-source-entry p { margin:5px 0; color:var(--animal-text-color-secondary); font-size:13px; line-height:1.5; }
[data-animal-drawer-portal] .open-source-entry a { color:var(--ks-color-primary); overflow-wrap:anywhere; }
[data-animal-drawer-portal] .open-source-note { margin:10px 0 16px; color:var(--animal-text-color-secondary); font-size:12px; line-height:1.5; }
#app .analytics-consent-toggle { min-width:54px; min-height:36px; padding:6px 12px; border:1px solid var(--animal-border-color-light); border-radius:999px; background:var(--animal-bg-color-secondary); color:var(--animal-text-color); font:inherit; font-weight:750; }

/* Premium comparison uses the Animal Island Card surface and brand color tokens. */
#app island-card.premium-compare-card { display: block; width: 100%; margin: 14px 0 28px; }
#app island-card.premium-compare-card > [class*="animal-card-"] {
  padding: 20px 14px 16px !important;
  border: 1px solid var(--animal-border-color-light) !important;
  border-radius: var(--animal-border-radius-lg) !important;
  background: var(--ks-color-nav-surface) !important;
  box-shadow: var(--animal-shadow-base) !important;
  color: var(--animal-text-color) !important;
}
#app .premium-compare-heading { margin: 0 2px 18px; }
#app .premium-compare-heading .eyebrow { color: var(--animal-text-color-secondary); font-size: var(--animal-font-size-sm); letter-spacing: .09em; }
#app .premium-compare-heading h2 { margin: 5px 0 5px; color: var(--animal-text-color); font-size: 22px; line-height: 1.3; }
#app .premium-compare-heading p { margin: 0; color: var(--animal-text-color-secondary); font-size: var(--animal-font-size-base); line-height: var(--animal-line-height-base); }
#app table.premium-benefits { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; color: var(--animal-text-color); font-size: var(--animal-font-size-base); line-height: 1.5; }
#app .premium-benefits th, #app .premium-benefits td { padding: 13px 5px; border-bottom: 1px solid var(--animal-border-color-light); text-align: center; vertical-align: middle; }
#app .premium-benefits thead th { padding-top: 10px; padding-bottom: 12px; color: var(--animal-text-color-secondary); font-size: var(--animal-font-size-base); font-weight: 800; }
#app .premium-benefits thead th:first-child { width: 46%; text-align: left; }
#app .premium-benefits thead th:nth-child(2) { width: 23%; }
#app .premium-benefits thead th:nth-child(3) { width: 31%; }
#app .premium-benefits tbody th { color: var(--animal-text-color); font-size: var(--animal-font-size-base); font-weight: 700; line-height: 1.5; text-align: left; overflow-wrap: anywhere; }
#app .premium-benefits .premium-column-head { border-radius: var(--animal-border-radius-sm) var(--animal-border-radius-sm) 0 0; background: linear-gradient(145deg, var(--ks-color-primary-soft), var(--ks-color-point-soft)); color: var(--animal-text-color); }
#app .premium-benefits .premium-column { background: color-mix(in srgb, var(--ks-color-primary-soft) 54%, white); color: var(--animal-text-color); font-weight: 800; }
#app .premium-benefits tbody tr:last-child th, #app .premium-benefits tbody tr:last-child td { border-bottom: 0; }
#app .premium-benefits tbody tr:last-child .premium-column { border-radius: 0 0 var(--animal-border-radius-sm) var(--animal-border-radius-sm); }
#app .benefit-check { display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--ks-color-point-soft); color: var(--animal-text-color); font-size: 14px; font-weight: 900; }
#app .premium-compare-note { margin: 12px 2px 0; color: var(--animal-text-color-secondary); font-size: var(--animal-font-size-sm); line-height: 1.5; }

#app #premium.active { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
#app .premium-subscribe {
  position: static;
  display: block;
  width: 100%;
  margin: var(--animal-spacing-lg) 0;
}
#app island-button.premium-subscribe > button {
  display: flex !important;
  width: 100% !important;
  min-height: 56px !important;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ks-color-primary) !important;
  border-radius: 999px !important;
  background: var(--ks-color-primary) !important;
  box-shadow: 0 6px 0 var(--ks-color-primary-shadow) !important;
  color: var(--animal-bg-color) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
}
#app island-button.premium-subscribe > button:hover { transform: translateY(-1px); box-shadow: 0 7px 0 var(--ks-color-primary-shadow) !important; }
#app island-button.premium-subscribe > button:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ks-color-primary-shadow) !important; }

/* Current approved onboarding and account-entry details. */
#app #onboarding-welcome .welcome-copy { top: 32% !important; width: calc(100% - 44px) !important; max-width: 430px; }
#app #onboarding-welcome .welcome-slide { display: none; }
#app #onboarding-welcome .welcome-slide.active { display: block; animation: welcome-slide-in .25s ease both; }
#app #onboarding-welcome .welcome-slide h1 { max-width: 390px; margin-bottom: 14px; font-size: clamp(30px, 8vw, 38px) !important; line-height: 1.12 !important; letter-spacing: -.045em !important; color: var(--animal-text-color) !important; }
#app #onboarding-welcome .welcome-slide h1 span { color: var(--ks-color-primary) !important; background: none !important; }
#app #onboarding-welcome .welcome-slide p { margin: 0; font-size: 14px !important; line-height: 1.5 !important; color: var(--animal-text-color-secondary) !important; }
#app #onboarding-welcome .welcome-progress { display: flex; gap: 8px; width: calc(100% - 52px); margin: 0 auto 34px; }
#app #onboarding-welcome .welcome-progress-segment { display: block; position: relative; height: 8px; flex: 1; overflow: hidden; border-radius: 999px; background: var(--ks-color-primary-soft); }
#app #onboarding-welcome .welcome-progress-segment::after { content: ''; position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--ks-color-primary); }
#app #onboarding-welcome .welcome-progress-segment:first-child::after { animation: welcome-progress-fill 1.5s linear forwards; }
#app #onboarding-welcome .welcome-progress.second-active .welcome-progress-segment:nth-child(2)::after { animation: welcome-progress-fill 1.5s linear forwards; }
#app #onboarding-welcome .welcome-progress.complete .welcome-progress-segment::after { width: 100%; }
#app #onboarding-welcome .welcome-login-copy { display:flex; align-items:center; justify-content:center; gap:5px; margin:0 0 0; color:var(--animal-text-color-secondary); font-size:12px; }
#app #onboarding-welcome island-text-button.welcome-login { display:inline-flex; min-height:30px; }
#app #onboarding-welcome island-text-button.welcome-login > button { min-height:30px; padding:2px 3px; border:0; background:transparent; box-shadow:none; color:var(--ks-color-primary); font:inherit; font-weight:800; }
@keyframes welcome-progress-fill { to { width:100%; } }
@keyframes welcome-slide-in { from { opacity:.55; transform:translateY(5px); } to { opacity:1; transform:translateY(0); } }
@media (max-height:720px) { #app #onboarding-welcome .welcome-copy { top:27% !important; } }

/* Home badge follows Animal Island's medium app-blue badge. */
#app island-button.notification-toggle > button { position:relative; overflow:visible !important; }
#app .notification-toggle island-badge#home-unread-badge { position:absolute !important; z-index:4; top:-5px; right:-7px; display:inline-flex !important; width:auto !important; min-width:0 !important; background:transparent !important; }
#app .notification-toggle island-badge#home-unread-badge > span:first-child { display:none !important; }
#app .notification-toggle island-badge#home-unread-badge sup { position:static !important; display:grid !important; min-width:25px !important; height:25px !important; padding:0 6px !important; border:2px solid var(--animal-bg-color) !important; border-radius:999px !important; background:var(--ks-color-primary) !important; color:white !important; font-size:12px !important; font-weight:800 !important; line-height:1 !important; box-shadow:0 2px 6px rgb(61 52 40 / 16%); }
#app .notification-permission-tip { position:absolute; z-index:30; top:52px; right:0; width:min(290px, calc(100vw - 64px)); padding:16px; border:1px solid var(--animal-border-color-light); border-radius:22px; background:var(--animal-bg-color); color:var(--animal-text-color); box-shadow:0 14px 32px rgb(61 52 40 / 18%); }
#app .notification-permission-tip[hidden] { display:none !important; }
#app .notification-permission-tip strong { display:block; font-size:15px; }
#app .notification-permission-tip p { margin:6px 0 7px; color:var(--animal-text-color-secondary); font-size:12px; line-height:1.45; }
#app .notification-permission-tip island-text-button > button { padding:4px 0; color:var(--ks-color-primary) !important; font-size:12px !important; font-weight:800 !important; }

/* Chats: white title, remaining shared time, unread order, and expiry locks. */
#app #chats .top h1 { color:#fff !important; }
#app .chat-time-chip { display:flex; min-width:72px; min-height:38px; align-items:center; justify-content:center; padding:0 13px; border:1px solid var(--animal-border-color-light); border-radius:999px; background:#fff; color:var(--animal-text-color); font-size:14px; font-weight:850; font-variant-numeric:tabular-nums; }
#app island-card.chat-row { position:relative; overflow:hidden; }
#app island-card.chat-row.is-locked { cursor:default; }
#app island-card.chat-row.is-locked > [class*="animal-card-"] { filter:blur(1.6px); opacity:.48; }
#app .chat-row-lock { position:absolute; z-index:3; inset:0; display:grid; place-items:center; border:1px solid rgb(255 255 255 / 55%); border-radius:24px; background:rgb(247 243 223 / 56%); color:var(--animal-text-color); pointer-events:none; }
#app .chat-row-lock island-icon { display:grid; width:44px; height:44px; place-items:center; border:1px solid var(--animal-border-color-light); border-radius:50%; background:var(--animal-bg-color); box-shadow:0 4px 12px rgb(61 52 40 / 10%); }
#app .chat-expired-action { position:sticky; z-index:4; bottom:0; padding:14px 0 max(14px, env(safe-area-inset-bottom)); background:transparent; }
#app .chat-expired-action[hidden] { display:none !important; }
#app .chat-premium-button { display:block; width:100%; }
#app island-button.chat-premium-button > button { display:flex !important; width:100% !important; min-height:52px !important; align-items:center; justify-content:center; border:1px solid var(--animal-border-color-light) !important; border-radius:999px !important; background:var(--ks-color-primary) !important; box-shadow:0 4px 0 var(--ks-color-primary-shadow, #2477b7) !important; color:#fff !important; font-size:15px !important; font-weight:800 !important; }

/* The language choices open vertically within the phone instead of escaping the row. */
#app island-card.language-setting > [class*="animal-card-"] { display:grid !important; grid-template-columns:minmax(0,1fr) !important; gap:10px !important; align-items:stretch !important; overflow:visible !important; }
#app island-card.language-setting [slot="headline"] { min-width:0 !important; }
#app .language-picker { position:relative; z-index:7; width:100%; }
#app .language-toggle { display:flex; width:100%; min-height:48px; align-items:center; justify-content:space-between; gap:10px; padding:0 14px; border:2px solid var(--animal-border-color-light); border-radius:18px; background:var(--animal-bg-color); color:var(--animal-text-color); font:inherit; font-weight:750; text-align:left; }
#app .language-chevron { color:var(--ks-color-primary); font-size:20px; line-height:1; }
#app .language-options { position:absolute; z-index:8; top:calc(100% + 6px); right:0; left:0; display:flex; flex-direction:column; gap:2px; max-height:230px; overflow:auto; padding:7px; border:1px solid var(--animal-border-color-light); border-radius:20px; background:var(--animal-bg-color); box-shadow:0 10px 24px rgb(61 52 40 / 14%); }
#app .language-options[hidden] { display:none !important; }
#app .language-options button { min-height:42px; padding:7px 12px; border:0; border-radius:14px; background:transparent; color:var(--animal-text-color); font:inherit; text-align:left; }
#app .language-options button[aria-selected="true"] { background:var(--ks-color-primary-soft); color:var(--animal-text-color); font-weight:800; }

/* Translation expands under each reply with pinyin, a dash divider, and English. */
#app .ai-translate island-icon { width:18px; height:18px; }
#app .ai-translation:not([hidden]) { display:flex; flex-direction:column; gap:5px; margin-top:11px; padding-top:9px; border-top:1px solid var(--animal-border-color-light); color:var(--animal-text-color-secondary); font-size:12px; line-height:1.45; }
#app .translation-pinyin { color:var(--animal-text-color-secondary); }
#app .translation-separator { color:var(--ks-color-primary); font-weight:800; letter-spacing:.1em; }
#app .translation-english { color:var(--animal-text-color); }

/* Save-from-reply sheet uses the shared cream/blue palette, with category labels only in its tabs. */
[data-animal-drawer-portal] .learn-chip.selected { background:var(--ks-color-accent-soft) !important; color:var(--animal-text-color) !important; box-shadow:none !important; }
[data-animal-drawer-portal] .learn-choice .saved-kind { display:none !important; }
[data-animal-drawer-portal] .learn-choice-save { border-color:var(--animal-border-color-light) !important; background:var(--animal-bg-color-secondary) !important; color:var(--animal-text-color) !important; box-shadow:0 3px 0 var(--animal-border-color-light) !important; }
[data-animal-drawer-portal] .learn-choice-save island-icon { color:var(--ks-color-primary) !important; }
[data-animal-drawer-portal] button.learn-done { background:var(--ks-color-primary) !important; box-shadow:0 4px 0 var(--ks-color-primary-shadow, #2477b7) !important; color:#fff !important; }
[data-animal-drawer-portal] .learn-choice-list { max-height:min(44vh, 390px); overflow:auto; }
#app .ai-tools .ai-translate { color:var(--animal-text-color) !important; }
#app .conversation-bar { display:flex; align-items:center; gap:10px; }
#app .conversation-bar > strong { flex:1; }
#app .conversation-time { margin-left:auto; }
#app .chat-screen .chat-expired-action { flex:none; }
#app .chat-delete-toggle { display:grid; place-items:center; width:38px; height:38px; padding:0; border:1.5px solid var(--animal-text-color); border-radius:50%; background:transparent; color:var(--animal-text-color); cursor:pointer; }
#app .chat-delete-toggle island-icon { width:20px; height:20px; }
#app .chat-delete-toggle.is-active { background:var(--animal-bg-color-secondary); }
#app #messages .message-selection-range { display:flex; flex-direction:column; gap:14px; width:100%; box-sizing:border-box; padding:12px 10px; border:2px solid var(--animal-text-color); border-radius:24px; }
#app #messages [data-chat-message-index] { cursor:pointer; }
#app #messages .message-selection-range .bubble,
#app #messages .message-selection-range .ai-message { outline:0 !important; }
#app .chat-delete-actions { flex:none; padding:8px 0 12px; background:var(--animal-bg-color); }
#app .chat-delete-actions[hidden], #app .chat-delete-premium[hidden] { display:none !important; }
#app .chat-delete-hint-row { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 9px; }
#app .chat-delete-hint { margin:0; color:var(--animal-text-color-secondary); text-align:center; font-size:13px; }
#app .chat-delete-cancel { padding:4px 2px; border:0; background:transparent; color:var(--animal-text-color); font:inherit; font-size:13px; cursor:pointer; }
#app .chat-delete-buttons { position:relative; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
#app .chat-delete-action { position:relative; min-height:50px; overflow:hidden; display:flex; align-items:center; justify-content:center; border:1.5px solid var(--animal-text-color); border-radius:18px; background:var(--animal-bg-color-secondary); color:var(--animal-text-color); font:inherit; font-weight:700; cursor:pointer; }
#app .chat-delete-action.is-primary { background:var(--animal-text-color); color:var(--animal-bg-color); }
#app .chat-delete-buttons.is-locked .chat-delete-action > span:first-child { filter:blur(2px); opacity:.48; }
#app .chat-delete-buttons.is-locked .chat-delete-action { opacity:.64; cursor:pointer; }
#app .chat-delete-lock { display:none; position:absolute; z-index:2; left:50%; top:50%; transform:translate(-50%,-50%); align-items:center; justify-content:center; }
#app .chat-delete-buttons.is-locked .chat-delete-lock { display:flex; }
#app .chat-delete-lock island-icon { display:grid; place-items:center; width:42px; height:42px; border:1px solid var(--animal-border-color-light); border-radius:50%; background:var(--animal-bg-color); color:var(--animal-text-color); box-shadow:0 3px 10px #51402b22; }
#app .chat-delete-premium { margin:8px 0 0; color:var(--animal-text-color); text-align:center; font-size:13px; }
#app .chat-delete-mode #messages { user-select:none; }
#app island-button.reply-help { display:inline-flex; flex:none; }
#app island-button.reply-help > button { display:grid !important; width:34px !important; min-width:34px !important; height:34px !important; min-height:34px !important; place-items:center; padding:0 !important; border:0 !important; border-radius:50% !important; background:var(--animal-bg-color-secondary) !important; box-shadow:none !important; color:var(--animal-text-color) !important; }
#app island-button.reply-help island-icon { width:18px; height:18px; }
#app .home-top-actions { position:relative; }
#app .suggestion-count { color:var(--animal-text-color-secondary) !important; font-size:10px !important; }

/* Account and sign-in additions stay on Animal Island surfaces and type. */
#app .email-auth-sheet h2, #app .account-delete-confirm h2 { margin:4px 0 8px; color:var(--animal-text-color); font-family:var(--animal-font-family); font-size:22px; }
#app .email-auth-sheet p, #app .account-delete-confirm p { color:var(--animal-text-color-secondary); line-height:1.55; }
#app .email-auth-sheet label { display:block; margin-top:18px; color:var(--animal-text-color); font-weight:700; }
#app .email-auth-sheet .input { border:1px solid var(--animal-border-color-light); border-radius:18px; background:var(--animal-bg-color); color:var(--animal-text-color); }
#app .email-auth-sheet .input:focus { outline:2px solid var(--ks-color-primary-soft); border-color:var(--ks-color-primary); }
#app .email-auth-cancel { display:flex; justify-content:center; margin:10px auto; }
#app .email-auth-sheet small { display:block; color:var(--animal-text-color-secondary); text-align:center; font-size:11px; }
#app .data-delete-row [slot="headline"] { color:var(--animal-text-color); }
#app .account-delete-confirm .sheet-actions island-button,
#app .account-delete-confirm .sheet-actions island-tonal-button { flex:1; }
#app .account-delete-confirm .sheet-actions island-button > button { background:var(--ks-color-primary) !important; color:#fff !important; }
#app .profile-about-panel .profile-story-copy { margin:12px 0 0; padding-top:11px; border-top:1px solid var(--animal-border-color-light); color:var(--animal-text-color-secondary); font-size:13px; line-height:1.6; }

/* Premium comparison stays compact while every included feature uses the same status badge. */
#app .premium-benefits th, #app .premium-benefits td { padding: var(--animal-spacing-sm) var(--animal-spacing-xs); }
#app .premium-benefits tbody th { overflow-wrap: normal; word-break: normal; }
#app .premium-compare-note { color: var(--animal-text-color-secondary); }




/* Flashcards use the white Animal Island surface and a dashed example card. */
#app island-card.flashcard > [class*="animal-card-"] { background: var(--ks-color-nav-surface) !important; }
#app .flashcard-content .example-card {
  border: 1px dashed var(--animal-border-color-light);
  border-radius: var(--animal-border-radius-lg);
  background: var(--ks-color-nav-surface);
  color: var(--animal-text-color);
}
#app .flashcard-actions > island-button.got-it > button { box-shadow: 0 4px 0 var(--animal-border-color-light) !important; }

/* The composer uses the shared pill button with a visible Send label. */
#app island-button.send { display: flex; flex: 0 0 auto; width: auto; height: auto; }
#app island-button.send > button {
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 46px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: var(--animal-spacing-xs);
  padding: 0 var(--animal-spacing-md) !important;
  border: 1px solid var(--ks-color-primary) !important;
  border-radius: 999px !important;
  background: var(--ks-color-primary) !important;
  box-shadow: 0 4px 0 var(--ks-color-primary-shadow) !important;
  color: var(--animal-bg-color) !important;
  font: inherit;
  font-weight: 800;
}
#app island-button.send island-icon { color: currentColor !important; }
#app .send-label { white-space: nowrap; }
#app .ai-generated-label { margin: 0 0 var(--animal-spacing-xs); color: var(--animal-text-color-secondary); font-size: 10px; line-height: 1.35; }

/* Consent and legal sheets use the shared Animal Island modal surface and spacing. */
#app .legal-notice-sheet,
#app .ai-data-consent-sheet,
#app .age-confirm-sheet { display: grid; gap: var(--animal-spacing-md); padding: var(--animal-spacing-md); color: var(--animal-text-color); }
#app .legal-notice-sheet h2 { margin: 0; color: var(--animal-text-color); font-family: var(--animal-font-family); font-size: 22px; }
#app .legal-notice-sheet p,
#app .ai-data-consent-sheet p,
#app .age-confirm-sheet p { margin: 0; color: var(--animal-text-color-secondary); font-size: 14px; line-height: 1.6; }
#app .legal-notice-sheet .eyebrow { color: var(--animal-text-color-secondary); font-size: 11px; font-weight: 800; }
#app .legal-notice-sheet island-button,
#app .ai-data-consent-sheet .sheet-actions island-button,
#app .age-confirm-sheet .sheet-actions island-button { flex: 1; }
#app .legal-notice-sheet island-button > button,
#app .ai-data-consent-sheet .sheet-actions island-button > button,
#app .age-confirm-sheet .sheet-actions island-button > button { width: 100%; border-color: var(--ks-color-primary) !important; background: var(--ks-color-primary) !important; box-shadow: 0 3px 0 var(--ks-color-primary-shadow) !important; color: var(--animal-bg-color) !important; }
#app .auth-age-consent,
#app .auth-consent { display: flex !important; align-items: flex-start; gap: var(--animal-spacing-sm); margin-top: var(--animal-spacing-sm) !important; color: var(--animal-text-color-secondary) !important; font-size: 12px; font-weight: 500 !important; line-height: 1.5; }
#app .auth-age-consent input,
#app .auth-consent input { flex: none; width: 16px; height: 16px; margin-top: 2px; accent-color: var(--ks-color-primary); }
#app .auth-consent button,
#app .legal-inline-links button { padding: 0; border: 0; background: transparent; color: var(--ks-color-primary); font: inherit; text-decoration: underline; }
#app .legal-inline-links { display: flex; justify-content: flex-start; }
#app .ai-data-consent-sheet .sheet-actions,
#app .age-confirm-sheet .sheet-actions { display: flex; gap: var(--animal-spacing-sm); margin-top: var(--animal-spacing-xs); }
#app .ai-data-consent-sheet .sheet-actions island-tonal-button,
#app .age-confirm-sheet .sheet-actions island-tonal-button { flex: 1; }
#app .ai-data-consent-sheet .sheet-actions island-tonal-button > button,
#app .age-confirm-sheet .sheet-actions island-tonal-button > button { width: 100%; border-color: var(--animal-border-color-light); background: var(--animal-bg-color); color: var(--animal-text-color); }

/* Rows without supporting copy give the title the available width. */
#app island-card.data-delete-row > [class*="animal-card-"],
#app island-card.open-source-row > [class*="animal-card-"] { display: flex; align-items: center; gap: var(--animal-spacing-md); }
#app island-card.data-delete-row [slot="headline"],
#app island-card.open-source-row [slot="headline"] { min-width: 0; flex: 1; }

/* Required first-run choices live in the Animal Island drawer portal, outside #app. */
[data-animal-drawer-portal] .guest-consent-sheet {
  display: grid;
  gap: var(--animal-spacing-sm);
  padding: var(--animal-spacing-md);
  color: var(--animal-text-color);
}
[data-animal-drawer-portal] .guest-consent-sheet > .eyebrow {
  margin: 0;
  color: var(--animal-text-color-secondary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
}
[data-animal-drawer-portal] .guest-consent-sheet h2 {
  margin: 0;
  color: var(--animal-text-color);
  font-family: var(--animal-font-family);
  font-size: 22px;
  line-height: 1.25;
}
[data-animal-drawer-portal] .guest-consent-sheet .guest-consent-intro {
  margin: 0 0 var(--animal-spacing-xs);
  color: var(--animal-text-color-secondary);
  font-size: 14px;
  line-height: 1.55;
}
[data-animal-drawer-portal] .guest-consent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--animal-spacing-sm);
  min-width: 0;
  padding: var(--animal-spacing-sm) var(--animal-spacing-md);
  border: 1px solid var(--animal-border-color-light);
  border-radius: var(--animal-border-radius-lg);
  background: var(--animal-bg-color);
}
[data-animal-drawer-portal] .guest-consent-sheet .auth-consent,
[data-animal-drawer-portal] .guest-consent-sheet .auth-age-consent {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: var(--animal-spacing-sm);
  margin: 0;
  color: var(--animal-text-color);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}
[data-animal-drawer-portal] .guest-consent-sheet .auth-consent input,
[data-animal-drawer-portal] .guest-consent-sheet .auth-age-consent input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--ks-color-primary);
  cursor: pointer;
}
[data-animal-drawer-portal] .guest-consent-row.is-checked,
[data-animal-drawer-portal] .guest-consent-sheet .auth-age-consent.is-checked {
  border-color: var(--ks-color-primary);
  background: var(--animal-bg-color-secondary);
}
[data-animal-drawer-portal] .guest-consent-sheet .auth-age-consent {
  padding: var(--animal-spacing-sm) var(--animal-spacing-md);
  border: 1px solid var(--animal-border-color-light);
  border-radius: var(--animal-border-radius-lg);
  background: var(--animal-bg-color);
}
[data-animal-drawer-portal] .guest-consent-sheet .consent-notice-link {
  min-width: 48px;
  min-height: 36px;
  padding: 6px 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ks-color-primary);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
[data-animal-drawer-portal] .guest-consent-sheet .consent-notice-link:focus-visible,
[data-animal-drawer-portal] .guest-consent-sheet input:focus-visible {
  outline: 2px solid var(--ks-color-primary);
  outline-offset: 2px;
}
[data-animal-drawer-portal] .guest-consent-feedback {
  margin: 0;
  padding: var(--animal-spacing-sm) var(--animal-spacing-md);
  border-radius: var(--animal-border-radius-base);
  background: var(--animal-bg-color-secondary);
  color: var(--animal-text-color);
  font-size: 12px;
  line-height: 1.45;
}
[data-animal-drawer-portal] .guest-consent-feedback[hidden] { display: none !important; }
[data-animal-drawer-portal] .guest-consent-sheet .sheet-actions {
  display: grid !important;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: var(--animal-spacing-sm);
  margin: var(--animal-spacing-sm) 0 0;
}
[data-animal-drawer-portal] .guest-consent-sheet .sheet-actions button.guest-consent-cancel,
[data-animal-drawer-portal] .guest-consent-sheet .sheet-actions button.guest-consent-continue {
  appearance: none;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 8px 12px;
  border: 1px solid var(--animal-border-color-light);
  border-radius: 999px;
  background: var(--animal-bg-color);
  box-shadow: 0 3px 0 var(--animal-border-color);
  color: var(--animal-text-color);
  font-family: var(--animal-font-family);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.25;
  white-space: normal;
  cursor: pointer;
}
[data-animal-drawer-portal] .guest-consent-sheet .sheet-actions button.guest-consent-continue {
  border-color: var(--ks-color-primary);
  background: var(--ks-color-primary);
  box-shadow: 0 3px 0 var(--ks-color-primary-shadow);
  color: var(--animal-bg-color);
}
[data-animal-drawer-portal] .guest-consent-sheet .sheet-actions button:focus-visible {
  outline: 2px solid var(--ks-color-primary);
  outline-offset: 3px;
}
[data-animal-drawer-portal] .guest-consent-sheet .sheet-actions button:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* Restored email action and portal form use the existing K-Sense tokens. */
#app #onboarding-welcome .welcome-auth .email-login > button,
#app .auth-actions .email-login > button { border: 1px solid var(--ks-color-primary) !important; background: var(--ks-color-primary) !important; box-shadow: 0 4px 0 var(--ks-color-primary-shadow) !important; color: var(--animal-bg-color) !important; }
.email-entry-sheet { display: grid; gap: var(--animal-spacing-md); color: var(--animal-text-color); }
.email-entry-sheet h2, .email-entry-sheet p { margin: 0; }
.email-entry-sheet p { color: var(--animal-text-color-secondary); line-height: 1.6; }
.email-entry-sheet form, .email-entry-sheet label { display: grid; gap: var(--animal-spacing-sm); }
.email-entry-sheet input { box-sizing: border-box; width: 100%; min-height: 48px; padding: var(--animal-spacing-sm) var(--animal-spacing-md); border: 1px solid var(--animal-border-color-light); border-radius: var(--animal-border-radius-lg); background: var(--animal-bg-color); color: var(--animal-text-color); font: inherit; }
.email-entry-sheet input:focus-visible { outline: 2px solid var(--ks-color-primary); outline-offset: 2px; }
.email-entry-actions { display: flex; gap: var(--animal-spacing-sm); }
.email-entry-actions button { flex: 1; min-height: 48px; padding: var(--animal-spacing-sm); border: 1px solid var(--animal-border-color-light); border-radius: 999px; background: var(--animal-bg-color); color: var(--animal-text-color); font: inherit; cursor: pointer; }
.email-entry-actions button[type="submit"] { background: var(--ks-color-primary); border-color: var(--ks-color-primary); color: var(--animal-bg-color); box-shadow: 0 3px 0 var(--ks-color-primary-shadow); }
.email-entry-actions button:disabled { opacity: .65; cursor: wait; }
.email-entry-sheet [data-email-feedback] { padding: var(--animal-spacing-sm); border: 1px solid var(--animal-border-color-light); border-radius: var(--animal-border-radius-sm); }
.email-entry-sheet [hidden] { display: none !important; }

/* The future subscription page shares Premium's existing surface and type scale. */
#app .subscription-placeholder { display: block; margin-top: var(--animal-spacing-lg); }
#app .subscription-placeholder > [class*="animal-card-"] { display: grid; gap: var(--animal-spacing-md); padding: var(--animal-spacing-lg); background: var(--ks-color-nav-surface); border: 1px solid var(--animal-border-color-light); border-radius: var(--animal-border-radius-lg); }
#app .subscription-placeholder h2 { margin: 0; color: var(--animal-text-color); font-size: 22px; line-height: 1.4; }
#app .subscription-placeholder p { margin: 0; color: var(--animal-text-color-secondary); font-size: var(--animal-font-size-base); line-height: var(--animal-line-height-base); }
#app #subscription .title { font-size: 24px; }
body:has(#app #subscription.active) #island-background-layer .ksense-grid-background,
body:has(#app #subscription.active) #island-background-layer .ksense-dots-background { display: none !important; }
body:has(#app #subscription.active) #island-background-layer .ksense-premium-dots-background { display: block !important; }
#app .phone:has(#subscription.active), #app #subscription.active { background: transparent !important; }

/* Keep the real Badge outside the bell button's React-owned contents. */
#app .bell-badge-wrap { position: relative; display: inline-flex; flex: none; }
#app .bell-badge-wrap > island-badge { position: absolute; top: -5px; right: -6px; z-index: 5; pointer-events: none; }
#app .bell-badge-wrap > island-badge[hidden] { display: none !important; }
#app .bell-badge-wrap > island-badge sup { position: static; display: grid; place-items: center; min-width: 22px; height: 22px; box-sizing: border-box; padding: 0 4px; border: 2px solid var(--animal-bg-color); border-radius: 999px; font-size: var(--animal-font-size-sm); line-height: 1; }
#app .bell-badge-wrap > island-badge > span > span { display: none; }
#app .analytics-preference-card { display: block; }
#app .analytics-setting-content { display: flex; align-items: center; gap: var(--animal-spacing-md); }
#app .analytics-setting-copy { flex: 1; min-width: 0; }
#app .analytics-setting-copy strong { display: block; font-size: var(--animal-font-size-base); line-height: 1.5; color: var(--animal-text-color); }
#app .analytics-setting-copy p { margin: var(--animal-spacing-xs) 0 0; font-size: var(--animal-font-size-sm); line-height: 1.6; color: var(--animal-text-color-secondary); }
#app .analytics-setting-content .analytics-consent-toggle { flex: none; min-width: 60px; min-height: 40px; }
#app .analytics-consent-toggle[aria-checked="true"] { background: var(--ks-color-primary); color: var(--animal-bg-color); border-color: var(--ks-color-primary); }
#app .analytics-consent-toggle:focus-visible { outline: 2px solid var(--ks-color-primary); outline-offset: 3px; }

/* Annual-first plan selection, built with Animal Island Card / Button / Notification. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#app #subscription.active { padding-bottom: calc(210px + env(safe-area-inset-bottom)); }
.ksense-paywall { color: var(--animal-text-color); }
.paywall-heading { margin: 16px 0 28px; text-align: center; }
.paywall-heading h2 { margin: 8px 0 14px; font-size: clamp(27px,7vw,34px); line-height: 1.2; color: var(--animal-text-color); }
.paywall-heading p { margin: 0; color: var(--animal-text-color-secondary); font-size: 15px; line-height: 1.6; }
.paywall-plans { display: grid; gap: 20px; padding: 0; margin: 0; border: 0; min-width: 0; }
.ksense-paywall .paywall-plan { position: relative; margin: 0; padding: 20px 16px; border: 2px solid var(--animal-border-color-light); border-radius: var(--animal-border-radius-lg); background: var(--ks-color-nav-surface); box-shadow: none; overflow: visible; }
.ksense-paywall .paywall-plan.is-selected { border-color: var(--ks-color-primary); box-shadow: 0 4px 0 var(--ks-color-primary-shadow); }
.ksense-paywall .paywall-annual { border: 3px solid transparent; background: linear-gradient(var(--ks-color-nav-surface),var(--ks-color-nav-surface)) padding-box,linear-gradient(110deg,var(--ks-color-primary),var(--animal-warning-color)) border-box; }
.paywall-recommended { position: absolute; left: 14px; top: -14px; padding: 5px 12px; border-radius: 999px; background: var(--ks-color-primary); color: var(--animal-bg-color); font-size: 11px; font-weight: 800; letter-spacing: .03em; }
.paywall-plan label { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 68px; }
.paywall-plan input { width: 18px; height: 18px; flex: none; margin: 0; accent-color: var(--ks-color-primary); }
.paywall-plan:has(input:focus-visible) { outline: 2px solid var(--ks-color-primary); outline-offset: 4px; }
.paywall-plan-info { display: grid; flex: 1; gap: 5px; min-width: 0; }
.paywall-plan-info > strong { font-size: 21px; color: var(--animal-text-color); }
.paywall-plan-info > span { font-size: 14px; line-height: 1.4; }
.paywall-plan-info small { color: var(--animal-text-color-secondary); font-size: 12px; }
.paywall-price { display: grid; justify-items: end; flex: none; gap: 3px; }
.paywall-price > strong { font-size: 18px; white-space: nowrap; }
.paywall-price small { font-size: 12px; font-weight: 500; }
.paywall-price del { color: var(--animal-text-color-secondary); font-size: 12px; }
.paywall-explanation, .paywall-preview { margin: 20px 0 0; color: var(--animal-text-color-secondary); font-size: 12px; line-height: 1.6; }
.paywall-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 18px; font-size: 12px; }
.paywall-legal a { color: var(--animal-text-color-secondary); text-decoration: underline; }
#app .subscription-footer { display: none; position: absolute; z-index: 7; left: 20px; right: 20px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 12px 0 14px; background: var(--animal-bg-color); border-top: 1px solid var(--animal-border-color-light); }
#app .phone:has(#subscription.active) .subscription-footer { display: block; }
.paywall-selected { margin: 0 0 8px; text-align: center; color: var(--animal-text-color-secondary); font-size: 12px; }
#app .subscription-footer .paywall-subscribe { width: 100%; min-height: 52px; border-radius: 999px; background: var(--ks-color-primary); border-color: var(--ks-color-primary); box-shadow: 0 4px 0 var(--ks-color-primary-shadow); color: var(--animal-bg-color); font-size: 16px; font-weight: 800; }
.ksense-payment-notice { font-family: var(--animal-font-family); }
@media (max-width: 350px) { .paywall-plan label { gap: 8px; } .ksense-paywall .paywall-plan { padding: 18px 10px; } .paywall-plan-info > strong { font-size: 18px; } .paywall-price > strong { font-size: 16px; } }

/* A dated launch offer applies to all three products; Annual stays recommended. */
.paywall-offer { padding: var(--animal-spacing-md); margin: 0 0 28px; border: 1px solid var(--ks-color-primary); border-radius: var(--animal-border-radius-lg); background: var(--ks-color-primary-soft); color: var(--animal-text-color); }
.paywall-offer strong { display: block; font-size: var(--animal-font-size-base); }
.paywall-offer p { margin: 5px 0 0; font-size: var(--animal-font-size-sm); line-height: 1.6; color: var(--animal-text-color-secondary); }
.ksense-paywall .paywall-plan-info .paywall-discount { color: var(--ks-color-primary-active); font-weight: 800; font-size: var(--animal-font-size-sm); }
.paywall-price > strong { display: grid; justify-items: end; gap: 2px; }
.paywall-price > strong > small { font-size: var(--animal-font-size-sm); }
#app .subscription-footer .paywall-restore { display: flex; margin: 8px auto 0; color: var(--ks-color-primary); font-size: var(--animal-font-size-sm); }
#app .subscription-footer:has(.paywall-restore) { bottom: calc(72px + env(safe-area-inset-bottom)); }

/* Localization layout rules: W3C text expansion + Animal Island type tokens. */
#app #nav { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 4px; padding-inline: 8px; }
#app #nav > island-text-button.nav-item { display: block; width: 100%; min-width: 0; margin: 0; }
#app #nav > island-text-button.nav-item > button { width: 100% !important; min-width: 0 !important; height: auto !important; min-height: 56px !important; padding: 6px 2px !important; white-space: normal !important; }
#app #nav > island-text-button.nav-item > button > span,
#app #nav > island-text-button.nav-item > button > .nav-label { display: block !important; width: 100%; min-width: 0; max-width: 100%; overflow: visible !important; white-space: normal !important; overflow-wrap: anywhere; word-break: normal; text-overflow: clip !important;  line-height: 1.35 !important; text-align: center; }
#app island-card.chat-row > [class*="animal-card-"] { display: grid !important; grid-template-columns: 48px minmax(0,1fr) auto; gap: 12px; align-items: center; }
#app island-card.chat-row .chat-info { min-width: 0; overflow: hidden; }
#app island-card.chat-row .chat-info strong { overflow-wrap: anywhere; line-height: 1.4; }
#app .chat-row-meta { display: grid; justify-items: end; align-content: center; gap: 6px; min-width: 32px; max-width: 82px; }
#app .chat-row-meta .time { max-width: 82px; font-size: var(--animal-font-size-sm); line-height: 1.4; white-space: normal; overflow-wrap: anywhere; text-align: right; }
#app .chat-row-meta .chat-row-unread-badge { display: inline-flex; min-width: 0; height: auto; padding: 0; border: 0; background: transparent !important; }
#app .chat-row-meta .chat-row-unread-badge sup { position: static; display: grid; place-items: center; min-width: 22px; height: 22px; border: 2px solid var(--animal-bg-color); border-radius: 999px; padding: 0 4px; font-size: var(--animal-font-size-sm); line-height: 1; }
#app .chat-row-unread-badge > span > span { display: none; }
#app .guest-account-card { position: relative; width: 100%; min-height: 0; padding: 20px; overflow: hidden; border: 1px solid var(--animal-border-color-light); border-radius: var(--animal-border-radius-lg); }
#app .guest-account-content { position: relative; z-index: 1; min-width: 0; }
#app .guest-account-content h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.4; overflow-wrap: anywhere; color: var(--animal-text-color); }
#app .guest-account-content p { margin: 0 0 16px; font-size: var(--animal-font-size-base); line-height: 1.6; color: var(--animal-text-color-secondary); }
#app .guest-account-login { width: 100%; min-height: 44px; background: var(--ks-color-primary); border-color: var(--ks-color-primary); color: var(--animal-bg-color); }
#app .account-signed-in p { margin: 6px 0 0; overflow-wrap: anywhere; }

/* Keep library notifications inside the phone column, below its current header. */
[data-animal-notification-root] [data-position="top"] { top: var(--ks-notification-top,24px); left: var(--ks-notification-center,50%); width: var(--ks-notification-width,384px); max-width: calc(100vw - 32px); }
[data-animal-notification-root] [data-notification-key] { box-sizing: border-box; width: 100%; max-width: 100%; }
[data-animal-notification-root] .animal-type-info-vUAM1 { background: var(--ks-color-primary-soft); border-color: var(--ks-color-primary); box-shadow: 0 6px 18px var(--ks-color-primary-shadow); }
[data-animal-notification-root] .animal-type-info-vUAM1 .animal-iconWrap-H2lSM { background: var(--animal-bg-color); color: var(--ks-color-primary); }
#app .chat-error{margin:12px 0;padding:14px;border:1px solid var(--animal-error-color);border-radius:16px;background:var(--animal-bg-color);font-size:14px;line-height:1.5}#app .chat-error p{margin:8px 0;overflow-wrap:anywhere;color:var(--animal-text-color-secondary)}#app .chat-error button{background:var(--ks-color-nav-surface);border:1px solid var(--animal-primary-color);border-radius:18px;padding:8px 14px;color:var(--animal-primary-color)}

/* Canonical navigation typography. Fitty may adjust the label inline; no competing important font sizes. */
#app #nav {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));column-gap:0;align-items:stretch;}
#app #nav > island-text-button.nav-item > button {min-height:56px!important;max-width:100%;white-space:normal!important;}
#app #nav > island-text-button.nav-item > button > span,
#app #nav > island-text-button.nav-item > button > .nav-label {line-height:1.35!important;white-space:normal!important;word-break:normal;overflow-wrap:normal;max-width:100%;text-wrap:balance;}

#app #nav > island-text-button.nav-item > button > span,#app #nav > island-text-button.nav-item > button > .nav-label{font-size:12px;line-height:1.35!important;white-space:normal!important;overflow-wrap:normal;word-break:normal;}
.auth-method-picker{padding:24px;max-width:430px;margin-inline:auto;color:var(--animal-text-color)}.auth-method-picker h2{font-size:24px;line-height:1.3;margin:0 0 10px;overflow-wrap:anywhere}.auth-method-picker p{font-size:16px;line-height:1.5;margin:0 0 24px;color:var(--animal-text-color-secondary)}.auth-method-picker>button{display:flex;width:100%;min-height:48px;height:auto;margin-top:12px;padding:14px 18px;white-space:normal;line-height:1.35}.auth-method-picker .auth-method-apple{background:#fff;color:#000;border:1px solid #000;box-shadow:none}.auth-method-picker .auth-method-email{background:var(--ks-color-primary);color:#fff;border-color:var(--ks-color-primary);box-shadow:0 4px 0 var(--ks-color-primary-shadow)}.auth-method-picker .auth-method-cancel{background:transparent;border-color:transparent;box-shadow:none;color:var(--animal-text-color-secondary)}

/* Keep each lock above its own blurred content, never inside the blurred wrapper. */
#app island-card.chat-row.is-locked > [class*="animal-card-"] { filter:none; opacity:1; position:relative; }
#app island-card.chat-row.is-locked :is(island-avatar,.chat-info,.chat-row-meta) { filter:blur(1.2px); opacity:.55; }
#app .chat-row-lock { backdrop-filter:none; background:rgb(247 243 223 / 18%); }
#app .ai-reply-avatar { display:block; width:32px; height:32px; min-width:32px; flex:0 0 32px; margin:2px 0 0; }

/* Auth chooser shares the existing Drawer surface and Button geometry. */
[data-animal-drawer-portal] .ksense-auth-chooser-drawer{bottom:0!important;background:var(--animal-bg-color)!important;padding-bottom:var(--ks-safe-bottom,env(safe-area-inset-bottom,0px))!important}
[data-animal-drawer-portal] .ksense-auth-chooser-drawer>[class*="animal-body"]{padding:0!important;max-height:calc(85dvh - var(--ks-safe-bottom,0px));overflow-y:auto}
.ksense-auth-chooser-drawer .auth-method-picker{padding:12px 24px 16px;max-width:none}
.auth-sheet-handle{width:36px;height:4px;margin:0 auto 20px;border-radius:999px;background:var(--animal-border-color-light)}
.ksense-auth-chooser-drawer .auth-method-picker :is(.auth-method-apple,.auth-method-email){min-height:52px;margin-top:12px;padding:12px 18px;border:1px solid var(--animal-border-color-light);border-radius:999px;background:#fff;color:var(--animal-text-color);box-shadow:0 3px 0 var(--animal-border-color-light);font-size:16px;font-weight:700;line-height:1.35}
.ksense-auth-chooser-drawer .auth-method-apple svg{color:#111;flex:none}
.ksense-auth-chooser-drawer .auth-method-cancel{min-height:44px;margin-top:16px;margin-bottom:0}
#app .notification-choice-list{display:flex;flex-direction:column;gap:12px}
#app .notification-choice>[class*="animal-card-"]{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px}
#app .notification-choice p,.notification-quiet-note{font-size:14px;line-height:1.5;color:var(--animal-text-color-secondary);margin:6px 0 0}
#app .notification-choice button[role="switch"]{flex:none}
.optional-notification-consent{margin-top:20px;padding-top:16px;border-top:1px solid var(--animal-border-color-light)}
.optional-notification-consent h3{font-size:17px;margin:0 0 8px}.optional-notification-consent p{font-size:13px;line-height:1.5;color:var(--animal-text-color-secondary)}

[data-animal-drawer-portal] .ksense-information-drawer{display:flex;flex-direction:column;max-height:calc(100dvh - var(--ks-safe-top,0px) - 12px)!important;padding:0!important;overflow:hidden}
[data-animal-drawer-portal] .ksense-information-drawer>[class*="animal-body"]{flex:1 1 auto;min-height:0;max-height:none;padding:16px 20px;overflow:auto;overscroll-behavior:contain}
[data-animal-drawer-portal] .ksense-information-drawer>[class*="animal-footer"]{flex:0 0 auto;padding:12px 20px calc(12px + var(--ks-safe-bottom,env(safe-area-inset-bottom,0px)));border-top:1px solid var(--animal-border-color-light);background:var(--animal-bg-color)}
.information-content{color:var(--animal-text-color);font-family:var(--animal-font-family)}.information-content h2{margin:0 0 18px;font-size:23px;line-height:1.35}.information-content h3{font-size:16px;margin:0 0 10px;line-height:1.4}.information-content p,.information-content li{font-size:14px;line-height:1.65;overflow-wrap:anywhere}.information-content p{color:var(--animal-text-color-secondary)}.information-content ul{padding-left:20px}.information-content>[class*="animal-card"]{margin:14px 0}.information-content a{color:var(--ks-color-primary);text-decoration:underline}.credit-photo{margin:14px 0;padding-top:12px;border-top:1px solid var(--animal-border-color-light)}.credit-photo p{margin:4px 0}.credit-license-list li{margin:9px 0}.information-actions{display:grid;grid-template-columns:1fr 1.3fr;gap:12px}.information-actions button,.ksense-information-drawer>[class*="animal-footer"]>button{width:100%;min-height:48px;white-space:normal;line-height:1.35}.information-actions .information-delete-button{background:var(--animal-bg-color);color:var(--animal-error-color,#b73732);border:1px solid currentColor;box-shadow:0 3px 0 var(--animal-border-color-light)}.deletion-error{color:var(--animal-error-color,#b73732)!important}

#app .legacy-chat-archive{margin-top:16px;border-top:1px solid var(--animal-border-color-light);padding-top:12px}#app .legacy-chat-archive>summary{cursor:pointer;padding:10px 4px;font-size:14px;color:var(--animal-text-color-secondary)}

/* K-Scene release enhancements */

/* Character metadata chips and flashcard Premium gate use shared Animal Island tokens. */
#app .character-facts{display:flex;flex-wrap:wrap;gap:var(--animal-spacing-xs);margin-top:7px}
#app .character-facts island-tag{font-size:11px;line-height:1.2}
#app island-card.flashcard.premium-locked{position:relative;overflow:hidden}
#app island-card.flashcard.premium-locked .flashcard-content,#app island-card.flashcard.premium-locked .flashcard-tools,#app island-card.flashcard.premium-locked .flashcard-actions{filter:blur(7px);opacity:.42;pointer-events:none;user-select:none}
#app .flashcard-premium-gate{position:absolute;inset:0;z-index:3;display:grid;place-items:center;padding:var(--animal-spacing-lg);background:color-mix(in srgb,var(--animal-bg-color) 58%,transparent)}
#app .flashcard-premium-gate-content{display:flex;max-width:280px;flex-direction:column;align-items:center;gap:var(--animal-spacing-sm);padding:var(--animal-spacing-lg);border:1px solid var(--animal-border-color-light);border-radius:var(--animal-border-radius-lg);background:var(--ks-color-nav-surface);color:var(--animal-text-color);text-align:center;box-shadow:var(--animal-shadow-base)}
#app .flashcard-premium-gate-content island-icon{color:var(--ks-color-primary)}
#app island-button.flashcard-premium-cta{display:block;width:100%;margin-top:var(--animal-spacing-xs)}
#app island-button.flashcard-premium-cta>button{width:100%;background:var(--ks-color-primary)!important;color:var(--ks-color-nav-surface)!important}
#app .flashcard-actions.premium-actions-locked{display:block}
#app .flashcard-actions.premium-actions-locked island-button.flashcard-premium-cta{display:block;width:100%}
#app .flashcard-actions.premium-actions-locked island-button.flashcard-premium-cta>button{width:100%;min-height:52px}
#app .flashcard-actions .need-practice[hidden],#app .flashcard-actions .got-it[hidden]{display:none!important}
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions:has(> :only-child){justify-content:center}
[data-animal-drawer-portal] .account-delete-confirm .sheet-actions:has(> :only-child)>*{flex:0 1 min(240px,100%)}

/* Character bio translation follows the Korean bio in the selected display language. */
[data-animal-drawer-portal] .profile-bio-panel .profile-bio-translation{margin-top:10px;padding-top:10px;border-top:1px solid var(--animal-border-color-light);font-size:13px;font-style:italic;line-height:1.55;color:var(--animal-text-color-secondary)}
/* Expanded chat translation is exactly Korean, romanization, then the chosen language. */
#app .ai-translation .translation-original{color:var(--animal-text-color);font-weight:600}
#app .ai-translation .translation-pinyin{font-size:11px;color:var(--animal-text-color-secondary)}
#app .ai-translation .translation-english{color:var(--animal-text-color)}

/* Screenshot-led story introduction and phrase sheet keep scroll inside the drawer. */
.animal-modal-content:has(.profile-intro-sheet),
.animal-modal-content:has(.phrase-detail-sheet){max-height:min(88dvh,760px);overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;padding:0 0 calc(16px + env(safe-area-inset-bottom,0px))}
.profile-intro-sheet{display:flex;flex-direction:column;gap:18px;padding:0 22px 16px;color:var(--animal-text-color)}
.animal-modal-content .profile-intro-head{display:flex;align-items:center;gap:16px;margin:0;padding:2px 2px 6px}
.animal-modal-content .profile-intro-head island-avatar{width:68px;height:68px;min-width:68px;border:2px solid var(--animal-border-color-light);border-radius:22px;box-shadow:0 3px 10px var(--animal-shadow-color)}
.profile-intro-identity{min-width:0;display:grid;gap:5px}
.profile-intro-identity h2{margin:0;color:var(--animal-text-color);font-size:28px;line-height:1.2}
.profile-intro-identity p{margin:0;color:var(--animal-text-color-secondary);font-size:15px;line-height:1.4}
.animal-modal-content .profile-intro-sheet .profile-bio-panel{margin:0;padding:16px 18px;border:1px solid var(--animal-border-color-light);border-radius:26px;background:var(--animal-bg-color);box-shadow:none}
.animal-modal-content .profile-intro-sheet .profile-bio-panel p{color:var(--animal-text-color);font-size:16px;line-height:1.6}
.animal-modal-content .profile-intro-sheet .profile-bio-panel .profile-bio-translation{margin-top:10px;padding-top:10px;border-color:var(--animal-border-color-light);color:var(--animal-text-color-secondary);font-size:14px;font-style:italic}
.animal-modal-content .profile-intro-prompt{display:block;margin:0;padding:0;border:1px solid var(--animal-border-color-light);border-radius:28px;background:var(--animal-warning-color-bg,#fff4d2);box-shadow:none;color:var(--animal-text-color)}
.profile-intro-prompt-content{display:grid;gap:10px;padding:18px 20px}
.profile-intro-prompt-label{margin:0;color:var(--animal-text-color);font-size:21px;line-height:1.35;font-weight:800}
.profile-intro-situation{margin:0;color:var(--animal-text-color-secondary);font-size:16px;line-height:1.55}
.profile-intro-actions{margin:4px 0 0}
.profile-intro-start{display:block;width:100%}
.profile-intro-start>button{width:100%;min-height:54px}
.profile-intro-later{margin:0}
.profile-intro-later island-text-button>button{min-height:46px;color:var(--animal-text-color);font-size:16px;font-weight:700}

/* The dictionary quick sheet uses the same cream card, text and border tokens. */
.animal-modal-content .phrase-detail-sheet{display:grid;gap:8px;padding:0 20px 18px;color:var(--animal-text-color)}
.animal-modal-content .phrase-detail-sheet .phrase-sheet-head{margin:0;align-items:center}
.animal-modal-content .phrase-detail-sheet .phrase-pronunciation{margin:0 0 2px;color:var(--animal-text-color-secondary)}
.animal-modal-content island-card.phrase-meaning-card{display:block;margin:0;border:1px solid var(--animal-border-color-light);border-radius:22px;background:var(--animal-bg-color-secondary);box-shadow:none;color:var(--animal-text-color)}
.animal-modal-content .phrase-meaning-content{display:grid;gap:5px;padding:14px 16px}
.animal-modal-content .phrase-meaning-content .meaning-label{color:var(--animal-text-color-secondary);font-size:12px;font-weight:750}
.animal-modal-content .phrase-meaning-content p{margin:0;color:var(--animal-text-color);font-size:16px;line-height:1.5}
.animal-modal-content .phrase-meaning-content p[hidden]{display:none}
.animal-modal-content .phrase-detail-sheet .example-heading{margin:7px 0 0;color:var(--animal-text-color);font-size:14px}
.animal-modal-content .phrase-detail-sheet .phrase-example{display:grid;gap:5px;margin:7px 0 0;padding:12px 15px;border:1px solid var(--animal-border-color-light);border-radius:20px;background:var(--animal-bg-color);color:var(--animal-text-color)}
.animal-modal-content .phrase-detail-sheet .phrase-example strong{color:var(--animal-text-color);font-size:15px;line-height:1.5}
.animal-modal-content .phrase-detail-sheet .phrase-example-roman{color:var(--animal-text-color-secondary);font-size:14px;line-height:1.5}
.animal-modal-content .phrase-detail-sheet .phrase-example-translation{color:var(--animal-text-color);font-size:14px;line-height:1.5}
.animal-modal-content .phrase-detail-sheet .phrase-more{margin-top:4px;color:var(--animal-text-color);font-weight:750}
