/* Modern presentation shared by V8 and V10 (body[data-ui-family="modern"]); V1 keeps its stylesheet.
   The V2 overview and trend cards were removed in v0.55.0. */
.design-variant-control { display: inline-flex; align-items: center; gap: 5px; margin: 0; white-space: nowrap; font-size: 12px; font-weight: 500; }
.design-variant-control select { width: 62px; min-height: 36px; padding: 4px 6px; font-size: 14px; }
body[data-ui-family="modern"] {
  --radius: 14px; --canvas: #faf9f6; --canvas-alt: #f5f1ee; --surface: #ffffff; --elevated: #fffdfa;
  --line: #e4deda; --line-strong: #c9bfba; --ink: #293344; --ink-2: #505a67; --ink-muted: #626976;
  --blue: #8c4056; --blue-light: #f7e9ed; --focus: #8c4056; --dot: transparent;
  --v2-sage: #e4eee6; --v2-blush: #f7e8e8; --v2-on-accent: #fff;
  --shadow: 0 4px 18px -10px rgb(41 51 68 / .13);
  font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--canvas);
}
body[data-ui-family="modern"] .canvas-grid { background-image: none; }
body[data-ui-family="modern"] h1:not(:where(.hd-app *)) { font-size: 27px; line-height: 1.25; font-weight: 650; }
body[data-ui-family="modern"] h2:not(:where(.hd-app *)) { font-size: 20px; line-height: 1.35; }
body[data-ui-family="modern"] h3:not(:where(.hd-app *)) { font-size: 17px; line-height: 1.4; }
body[data-ui-family="modern"] .small { font-size: 14px; }
body[data-ui-family="modern"] button,
body[data-ui-family="modern"] .btn,
body[data-ui-family="modern"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
body[data-ui-family="modern"] select { font-size: 16px; min-height: 44px; height: auto; }
body[data-ui-family="modern"] textarea { font-size: 16px; line-height: 1.5; }
body[data-ui-family="modern"] summary { min-height: 44px; padding-block: 10px; }
body[data-ui-family="modern"] a { text-underline-offset: 3px; }
body[data-ui-family="modern"] button.primary,
body[data-ui-family="modern"] .btn.primary,
body[data-ui-family="modern"] .talkbtn { color: var(--v2-on-accent); }
body[data-ui-family="modern"] .shell { grid-template-columns: 102px minmax(0, 1fr); grid-template-rows: minmax(64px, auto) auto; }
body[data-ui-family="modern"] .rail { padding-inline: 5px; }
body[data-ui-family="modern"] .rail-btn { padding: 9px 4px; min-height: 54px; font-size: 13px; border-radius: 11px; }
body[data-ui-family="modern"] .topbar { min-height: 64px; height: auto; padding: 8px 20px; gap: 9px; }
body[data-ui-family="modern"] .topbar .brand { font-size: 17px; }
body[data-ui-family="modern"] .topbar .userbox { font-size: 14px; }
body[data-ui-family="modern"] .topbar .design-variant-control { font-size: 14px; }
body[data-ui-family="modern"] .content { padding-top: 24px; }
body[data-ui-family="modern"] .content,
body[data-ui-family="modern"] .sheet,
body[data-ui-family="modern"] .home.simple,
body[data-ui-family="modern"] .home.simple > * { min-width: 0; }
body[data-ui-family="modern"] .sheet { border-radius: 14px; }
body[data-ui-family="modern"] .hcard { padding: 16px; border-radius: 14px; }
body[data-ui-family="modern"] .hcard .small { line-height: 1.5; }
body[data-ui-family="modern"].design-v2-home-active #rulerbox { display: none; }
body[data-ui-family="modern"] .talk { border-radius: 18px; }
body[data-ui-family="modern"] .talk .talk-head { padding: 12px; gap: 8px; flex-wrap: wrap; }
body[data-ui-family="modern"] .talk .talk-head .small { font-size: 14px; }
body[data-ui-family="modern"] .talk .talkhelp { display: block; overflow: visible; font-size: 14px; line-height: 1.4; margin: 6px 0; }
body[data-ui-family="modern"] .talk textarea { min-height: 64px; height: 64px; }
body[data-ui-family="modern"] .talk .seg { flex-wrap: wrap; }
body[data-ui-family="modern"] .talk .seg button { flex: 1 1 auto; font-size: 14px; }
body[data-ui-family="modern"] .talkbtn { min-height: 44px; font-size: 16px; }
body[data-ui-family="modern"] .talkf > .talkhelp { font-size: 14px; }
body[data-ui-family="modern"] #mealtodaybox .nowrap { white-space: normal; overflow-wrap: anywhere; }
@media (min-width: 641px) and (max-width: 1000px) {
  body[data-ui-family="modern"] .topbar .userbox > span:not(.avatar) { display: none; }
  body[data-ui-family="modern"] .topbar .userbox { flex: 0 0 30px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body[data-ui-family="modern"] {
    --canvas: #161821; --canvas-alt: #1d202a; --surface: #222632; --elevated: #292d39;
    --ink: #f3f0f1; --ink-2: #d3ccd0; --ink-muted: #c3bdc5; --line: #43404a; --line-strong: #6e6571;
    --blue: #edb3c3; --blue-light: #452c3b; --focus: #f4c6d3; --v2-sage: #283a35; --v2-blush: #382735; --v2-on-accent: #241823;
  }
}
:root[data-theme="dark"] body[data-ui-family="modern"] {
  --canvas: #161821; --canvas-alt: #1d202a; --surface: #222632; --elevated: #292d39;
  --ink: #f3f0f1; --ink-2: #d3ccd0; --ink-muted: #c3bdc5; --line: #43404a; --line-strong: #6e6571;
  --blue: #edb3c3; --blue-light: #452c3b; --focus: #f4c6d3; --v2-sage: #283a35; --v2-blush: #382735; --v2-on-accent: #241823;
}
@media (max-width: 640px) {
  body[data-ui-family="modern"] .topbar:has([data-ui-variant-select]) #aichip { display: none; }
  .design-variant-control > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  body[data-ui-family="modern"] .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(58px, auto) auto; }
  body[data-ui-family="modern"] .topbar { min-height: 58px; gap: 7px; padding: 6px 12px; }
  body[data-ui-family="modern"] .topbar .userbox { display: none; }
  body[data-ui-family="modern"] .topbar .sep { display: none; }
  body[data-ui-family="modern"] .topbar .brand { font-size: 16px; }
  body[data-ui-family="modern"] .topbar .weekchip { margin-left: 0; font-size: 14px; }
  body[data-ui-family="modern"] .content,
  body[data-ui-family="modern"] main.narrow { padding: 14px 12px calc(96px + env(safe-area-inset-bottom)); }
  body[data-ui-family="modern"] .rail { min-height: 70px; padding: 5px 4px calc(5px + env(safe-area-inset-bottom)); }
  body[data-ui-family="modern"] #rail > .rail-btn { display: none; }
  body[data-ui-family="modern"] #rail > #railmore { display: flex; flex: 1; min-width: 0; min-height: 54px; padding: 5px 2px; font-size: 12px; line-height: 1.35; }
  body[data-ui-family="modern"] #rail .rail-btn .ic { width: 22px; height: 22px; }
  body[data-ui-family="modern"] .railsheet:not([hidden]) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: min(70dvh, 540px); overflow-y: auto; overscroll-behavior: contain; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 10px; border-radius: 16px; }
  body[data-ui-family="modern"] .railsheet a,
  body[data-ui-family="modern"] .railsheet button { min-height: 54px; font-size: 14px; padding: 9px 6px; line-height: 1.4; }
  body[data-ui-family="modern"] .talk { border-radius: 0; top: 0; bottom: 0; width: auto; max-width: none; }
  body[data-ui-family="modern"] .talkbtn { bottom: calc(82px + env(safe-area-inset-bottom)); }
  body[data-ui-family="modern"] .talk .talk-head { font-size: 16px; }
  body[data-ui-family="modern"] .talk .talk-form { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
/* On a desktop the live conversation has its own space, so it does not cover the selected curve. */
@media (min-width: 1200px) {
  body[data-ui-family="modern"] .shell { grid-template-columns: 184px minmax(0, 1fr); }
  body[data-ui-family="modern"] .rail { padding: 10px 8px; overflow-y: auto; overscroll-behavior: contain; }
  body[data-ui-family="modern"] .rail-btn { flex-direction: row; justify-content: flex-start; gap: 10px; min-height: 44px; padding: 10px; margin: 0 2px; font-size: 14px; line-height: 1.4; text-align: left; }
  body[data-ui-family="modern"] .rail-btn .ic { width: 20px; height: 20px; flex-shrink: 0; }
  body[data-ui-family="modern"] .rail .logo { justify-items: start; padding-left: 12px; }
}
@media (min-width: 1200px) and (min-height: 561px) {
  body[data-ui-family="modern"].talking { --v2-chat-width: clamp(380px, 30vw, 440px); }
  body[data-ui-family="modern"].talking main.content { padding-left: 18px; padding-right: calc(var(--v2-chat-width) + 32px); }
  body[data-ui-family="modern"].talking .talk { top: 76px; right: 12px; bottom: 12px; width: var(--v2-chat-width); }
  body[data-ui-family="modern"].talking .content .two,
  body[data-ui-family="modern"].talking .content .split { grid-template-columns: minmax(0, 1fr); }
}
body[data-ui-family="modern"] .talk-list { min-height: 0; }
@media (max-width: 900px) and (max-height: 560px) {
  body[data-ui-family="modern"] .talk { top: 0; right: 0; bottom: 0; left: 0; width: auto; border: 0; border-radius: 0; z-index: 60; }
  body[data-ui-family="modern"] .talk .talk-head { flex-wrap: nowrap; }
}
@media (max-width: 360px) {
  body:not([data-ui-family="modern"]) .design-variant-control { margin-inline: -6px; }
  body:not([data-ui-family="modern"]) .design-variant-control select { width: 44px; min-width: 44px; padding-inline: 2px; }
  body[data-ui-family="modern"] .topbar:has([data-ui-variant-select]) .userbox { display: none; }
  body[data-ui-family="modern"] .topbar .brand { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  body[data-ui-family="modern"] *, body[data-ui-family="modern"] *::before, body[data-ui-family="modern"] *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print { .design-variant-control { display: none; } }
