.tool-launcher{position:relative;z-index:60;flex:none;display:inline-flex;align-items:center;min-width:44px;min-height:44px;margin-inline-start:auto}
.feed-bar-in>.tool-launcher{order:5}
.tool-launcher-button{display:grid;place-items:center;flex:none;width:44px;height:44px;min-width:44px;padding:0;border:0;border-radius:var(--radius-8);background:transparent;color:var(--color-ink-2);cursor:pointer;transition:background-color var(--motion-state) var(--ease-flow),color var(--motion-state) var(--ease-flow)}
.tool-launcher-button:hover,.tool-launcher-button[aria-expanded="true"]{background:var(--color-fill);color:var(--color-ink)}
.tool-launcher-button:active{transform:scale(.96)}
.tool-launcher-button:focus-visible,.tool-launcher-tile:focus-visible,.tool-launcher-more:focus-visible{outline:var(--focus-ring);outline-offset:var(--focus-offset)}
.tool-launcher-tile:focus-visible,.tool-launcher-more:focus-visible{outline-offset:calc(-1 * var(--focus-offset))}
.tool-launcher-dots{display:grid;grid-template-columns:repeat(3,4px);gap:3px}
.tool-launcher-dots i{width:4px;height:4px;border-radius:50%;background:currentColor}
/* One floating sheet: the radius and the no-outline of "Tùy chỉnh" (audit 16/11: 24 px and a hairline here). Its height
   follows the window, so "Thêm từ Google" is in sight whenever the window has room for it (a 460 px cap hid it). */
.tool-launcher-panel{position:absolute;top:calc(100% + var(--space-8));right:0;width:min(344px,calc(100vw - 24px));max-height:calc(100dvh - 88px);overflow:auto;overscroll-behavior:contain;padding:var(--space-12);border:0;border-radius:var(--msn-panel-r);background:var(--color-surface);color:var(--color-ink);box-shadow:var(--shadow-sheet);opacity:0;transform:scale(.96);transform-origin:top right;transition:opacity 150ms var(--ease-flow),transform 150ms var(--ease-flow)}
.tool-launcher-panel.is-open{opacity:1;transform:scale(1)}
.tool-launcher-panel[hidden]{display:none}
.tool-launcher-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--space-4)}
.tool-launcher-tile{min-width:0;min-height:84px;padding:var(--space-8) var(--space-4);border-radius:var(--radius-12);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--space-8);color:var(--color-ink-2);text-align:center;font:inherit;font-size:var(--text-small);line-height:var(--leading-snug);text-decoration:none;cursor:pointer;transition:background-color var(--motion-state) var(--ease-flow),color var(--motion-state) var(--ease-flow)}
.tool-launcher-tile:hover{background:var(--color-accent-wash);color:var(--color-accent)}
/* The product's own colour logo, as Google's app picker shows it; the letter holds the slot until it loads. */
.tool-launcher-panel:focus{outline:none}
.tool-launcher-icon,.tool-launcher-fallback{width:40px;height:40px;flex:none;transition:transform var(--motion-feedback) var(--ease-press)}
.tool-launcher-icon{display:block;object-fit:contain}
.tool-launcher-fallback{display:grid;place-items:center;border-radius:var(--radius-full);background:var(--color-fill);color:var(--color-ink-2);font-weight:600}
.tool-launcher-icon[hidden],.tool-launcher-fallback[hidden]{display:none}
.tool-launcher-tile:active .tool-launcher-icon,.tool-launcher-tile:active .tool-launcher-fallback{transform:scale(.94)}
.tool-launcher-label{max-width:100%;overflow-wrap:anywhere}
.tool-launcher-more{grid-column:1/-1;display:flex;align-items:center;justify-content:center;min-height:44px;margin-top:var(--space-8);border-top:1px solid var(--color-hair);color:var(--color-ink-2);font-size:var(--text-small);text-decoration:none}
.tool-launcher-more:hover{color:var(--color-accent)}
/* Reduced motion: the panel still fades in, it no longer grows (captain, 16/11: keep the fades, stop the movement). */
@media(prefers-reduced-motion:reduce){.tool-launcher-panel{transform:none;transition:opacity var(--motion-feedback) var(--ease-flow)}.tool-launcher-button,.tool-launcher-tile,.tool-launcher-icon,.tool-launcher-fallback{transition:none}.tool-launcher-button:active,.tool-launcher-tile:active .tool-launcher-icon,.tool-launcher-tile:active .tool-launcher-fallback{transform:none}}
.mobile-nav{display:none}

/* Desktop tabs share one row with the header actions and scroll when space runs out. */
.feed-bar-in{
  min-height:var(--bar-h);height:var(--bar-h);display:flex;flex-wrap:nowrap;align-items:center;
  gap:clamp(0px,.7vw,var(--space-12));padding-inline:clamp(var(--space-8),1.1vw,var(--page-pad))
}
.feed-brand,.feed-navigation,.ed-link,.tc-link,.theme-btn,.feed-bar-in>.tool-launcher{order:0}
.feed-brand{flex:none;white-space:nowrap}
.feed-navigation{
  display:flex;flex:1 1 auto;min-width:0;flex-wrap:nowrap;align-items:center;gap:clamp(0px,.45vw,var(--space-8));
  order:0;overflow:visible;width:auto;margin:0;padding:0;-webkit-mask-image:none;mask-image:none
}
.feed-filters{
  display:flex;flex:1 1 auto;min-width:0;flex-wrap:nowrap;align-items:center;gap:var(--space-4);
  overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scroll-behavior:smooth;scrollbar-width:none;
  padding:var(--space-4);
  -webkit-mask-image:none;mask-image:none
}
.feed-filters::-webkit-scrollbar{display:none}
.feed-bar.is-stacked .feed-bar-in{height:var(--bar-h);flex-wrap:nowrap;padding-block:0}
.feed-bar.is-stacked .feed-brand{flex:none;margin-inline-end:0}
.feed-bar.is-stacked .feed-navigation{order:0;flex:1 1 auto;flex-basis:auto;margin-inline-end:0;align-items:center}
.feed-bar.is-stacked .feed-filters{flex-wrap:nowrap;overflow-x:auto}
.filter-chip,.sort-btn,.ed-link,.tc-link{flex:none;min-height:44px}
.sort-switch{flex:none;margin:0;gap:0;padding:0}
.ed-link{gap:var(--space-4)}
.ed-link .i{width:16px;height:16px;flex:none}
.theme-btn{flex:none}
.bar{
  height:var(--bar-h);flex-wrap:nowrap;gap:clamp(0px,.7vw,var(--space-12));
  padding-inline:clamp(var(--space-8),1.1vw,var(--page-pad))
}
.bar>.brand{flex:none;white-space:nowrap}
.bar>.brand,.bt-bar>.bt-brand,#doc-back-btn.story-modal-close{min-height:44px}
.bar>.ed-link,.bar>.tc-link,.bar>.theme{flex:none;min-width:44px;min-height:44px}
.bar>.tc-link{width:44px;height:44px;padding:0}
.bar>.tc-link::before{inset-inline:var(--header-pill-inset)}
.bar>.tc-link .tc-label{display:none}
.bar>.theme{margin-left:0}
.bt-bar{flex-wrap:nowrap;gap:clamp(0px,.7vw,var(--space-12));padding-inline:clamp(var(--space-8),1.1vw,var(--page-pad))}
.bt-brand{flex:none;white-space:nowrap}
.bt-date-stepper{flex:0 1 auto;min-width:0;gap:0;padding-inline:0}
.bt-current-date-btn{min-width:44px;padding-inline:var(--space-4);white-space:nowrap}
.bt-bar-actions{flex:none;gap:0}
@media(max-width:1279px){
  .tc-link{padding:0}
  .tc-link::before{inset-inline:var(--header-pill-inset)}
  .tc-link .tc-label{display:none}
}
@media(max-width:767px){
  /* The phone dock (captain, 08/11: "appdock nổi như các dock hiện đại"): one pill floating clear of the screen's
     edges and the home indicator, on a solid surface, so nothing behind it can be read (coordinator, 08/11: a translucent dock let the headline behind it show through). The current page's plate sits exactly one
     padding inside every edge of the dock, and its radius is the dock's radius minus that padding (the dock rule
     the captain approved on 03/11). The page keeps room below its last line so the dock never covers it. */
  /* The dock is 64 px tall at the default text size and grows with the reader's text: at 200 % a label takes two lines
     instead of running into its neighbour (audit 16/11), and the page's bottom room grows with it. */
  :root{--mobile-nav-h:max(64px,calc(var(--dock-pad) * 2 + 24px + 2.3 * var(--text-micro)));--dock-pad:var(--space-6);--dock-gap:var(--space-12);--dock-radius:calc(var(--mobile-nav-h) / 2)}
  body{padding-bottom:calc(var(--mobile-nav-h) + var(--dock-gap) * 2 + env(safe-area-inset-bottom))}
  .mobile-nav{position:fixed;z-index:55;left:max(var(--space-16),env(safe-area-inset-left));right:max(var(--space-16),env(safe-area-inset-right));bottom:calc(var(--dock-gap) + env(safe-area-inset-bottom));max-width:420px;margin-inline:auto;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--space-4);height:var(--mobile-nav-h);padding:var(--dock-pad);border:0;border-radius:var(--dock-radius);background:var(--color-float);box-shadow:var(--shadow-lift)}
  .mobile-nav-link{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:44px;border-radius:calc(var(--dock-radius) - var(--dock-pad));color:var(--color-ink-2);font-family:var(--family);font-size:var(--text-micro);font-weight:var(--weight-semibold);line-height:1.15;text-align:center;text-decoration:none;-webkit-tap-highlight-color:transparent;transition:background-color var(--motion-state) var(--ease-flow),color var(--motion-state) var(--ease-flow),transform var(--motion-feedback) var(--ease-press)}
  .mobile-nav-link span{max-width:100%}
  .mobile-nav-link svg{width:22px;height:22px;flex:none}
  /* The current page: its label in --color-current (coral in light; the ink in dark, where coral on its wash read 3.64:1,
     audit 16/11), its symbol always coral. */
  .mobile-nav-link[aria-current="page"]{background:var(--color-accent-wash);color:var(--color-current)}
  .mobile-nav-link[aria-current="page"] svg{color:var(--color-accent)}
  .mobile-nav-link:focus-visible{outline:var(--focus-ring);outline-offset:calc(-1 * var(--focus-offset))}
  .mobile-nav-link:active{transform:scale(.95);transition-duration:var(--motion-feedback)}
  .mobile-nav-link:not([aria-current="page"]):active{background:var(--color-fill)}
  .toast-container{bottom:calc(var(--mobile-nav-h) + var(--dock-gap) * 2 + env(safe-area-inset-bottom))}
  @media(prefers-contrast:more){.mobile-nav{border:var(--msn-hair) solid var(--color-hair-strong)}}
  @media(prefers-reduced-motion:reduce){.mobile-nav-link{transition:none}.mobile-nav-link:active{transform:none}}
  .feed-bar-in{height:112px;min-height:112px;display:grid;grid-template-columns:minmax(0,1fr) 44px 44px;grid-template-rows:56px 56px;column-gap:var(--space-4);row-gap:0;padding-inline:var(--space-8)}
  .feed-bar-in .feed-brand{grid-column:1;grid-row:1;min-width:44px;min-height:44px}
  .feed-bar-in .feed-navigation{grid-column:1/-1;grid-row:2;min-width:0;width:100%;height:56px;gap:var(--space-4)}
  .source-bar .feed-bar-in{height:var(--bar-h);min-height:var(--bar-h);grid-template-rows:var(--bar-h)}
  .source-bar .feed-navigation{display:none}
  .feed-bar-in:has(.doc-nav){height:var(--bar-h);min-height:var(--bar-h);grid-template-columns:44px minmax(0,1fr) 44px 44px;grid-template-rows:var(--bar-h)}
  .feed-bar-in .doc-nav{grid-column:1;grid-row:1;min-width:44px}
  .feed-bar-in:has(.doc-nav) .feed-brand{grid-column:2}
  .feed-bar-in:has(.doc-nav)>.theme-btn{grid-column:3}
  .feed-bar-in:has(.doc-nav)>.tool-launcher{grid-column:4}
  .feed-bar-in .doc-spacer{display:none}
  .feed-bar-in .feed-filters{min-width:0;padding:var(--space-4) var(--space-24) var(--space-4) 0;-webkit-mask-image:linear-gradient(to right,#000 calc(100% - 20px),transparent);mask-image:linear-gradient(to right,#000 calc(100% - 20px),transparent)}
  .feed-bar-in .sort-switch{flex:none}
  .feed-bar-in>.ed-link,.feed-bar-in>.tc-link,.bar>.ed-link,.bar>.tc-link{display:none}
  .feed-bar-in>.theme-btn{grid-column:2;grid-row:1;display:grid;min-width:44px;min-height:44px}
  .feed-bar-in>.tool-launcher{grid-column:3;grid-row:1;margin:0}
  .bar>.theme{margin-left:auto}
  .bar>.tool-launcher{margin-left:0}
  .bar>.brand,.bt-bar>.bt-brand{display:inline-flex;align-items:center;min-width:44px;min-height:44px}
  .bar>.when-line,.bar>.nav,.bar>.src-state{display:none}
  .bt-bar .bt-brand{flex:none}
  .bt-bar .bt-date-stepper{flex:1 1 auto;min-width:0}
  .bt-bar .bt-bar-actions{flex:none}
  .bt-bar .tool-launcher{margin-inline-start:0}
  .bt-current-date-btn{min-width:0;max-width:110px;overflow:hidden;text-overflow:ellipsis}
  .tool-launcher-panel{max-height:calc(100dvh - var(--bar-h) - var(--mobile-nav-h) - var(--dock-gap) * 2 - env(safe-area-inset-bottom) - var(--space-16))}
  #doc-back-btn.story-modal-close{width:44px;height:44px;min-width:44px}
}
/* A phone turned sideways (a window under 768 px wide and under 500 px tall): the dock stands as a rail at the right
   edge, its four places one above the other, so it never lies over the story the reader came for (audit 16/11: at
   667 x 375 the dock covered the lead, 24 px of it showed). */
@media(max-width:767px) and (max-height:500px) and (orientation:landscape){
  :root{--rail-w:calc(64px + var(--space-12))}
  body{padding-bottom:var(--space-16);padding-right:calc(var(--rail-w) + var(--dock-gap) + env(safe-area-inset-right))}
  .mobile-nav{top:50%;bottom:auto;left:auto;right:max(var(--dock-gap),env(safe-area-inset-right));width:var(--rail-w);height:auto;max-width:none;margin:0;grid-template-columns:minmax(0,1fr);grid-auto-rows:minmax(52px,auto);border-radius:calc(var(--rail-w) / 2);transform:translateY(-50%)}
  .mobile-nav-link{border-radius:calc(var(--rail-w) / 2 - var(--dock-pad))}
  .toast-container{bottom:var(--space-16)}
  .tool-launcher-panel{max-height:calc(100dvh - var(--bar-h) - var(--space-16))}
}
@media(max-width:360px){
  .feed-bar-in,.feed-navigation,.bar,.bt-bar{gap:0}
  .bt-current-date-btn{max-width:76px}
}
@media(prefers-reduced-motion:reduce){.feed-filters{scroll-behavior:auto}}
