/* AIWA tools rail, extracted from aiwa-tools.css (20260908r1).
   The home page loaded the whole 62 KB tool-page stylesheet to draw one sidebar:
   measured in the browser, 30 of its 614 rules applied — 5%. All 30 were the
   rail. This file is that rail and nothing else, so the home page stops paying
   for the editor, the panes, the toolbars and the diff view it never renders.
   Tool pages still load aiwa-tools.css, which is unchanged and still contains
   these rules; nothing there has to know this file exists. */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 8px; background: #eef2ef; color: var(--aiwa-muted); font-size: 11px; font-weight: 650; }
.chip b { color: var(--aiwa-text); }
/* Compact writing app shell */
.has-tool-rail { --tools-rail-width: 252px; background: #fff; }
.has-tool-rail > main, .has-tool-rail > [data-aiwa-include="/includes/footer.html"] { margin-right: var(--tools-rail-width); transition: margin-right 180ms var(--aiwa-ease); }
.has-tool-rail .tool-layout { grid-template-columns: minmax(0, 1fr); }
.tools-rail-backdrop { display: none; }
.aiwa-tools-rail { position: fixed; z-index: 90; top: 64px; right: 0; bottom: 0; width: var(--tools-rail-width); display: flex; flex-direction: column; border-left: 1px solid var(--aiwa-line); background: #fff; transition: width 180ms var(--aiwa-ease), transform 180ms var(--aiwa-ease); }
.tools-rail-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--aiwa-line); }
.tools-rail-head > strong { font-size: 16px; letter-spacing: -0.02em; }
.tools-rail-head-actions { display: flex; gap: 4px; }
.tools-rail-head-actions button { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--aiwa-text); cursor: pointer; }
.tools-rail-head-actions button:hover { background: var(--aiwa-bg); }
.tools-rail-head-actions img { width: 18px; height: 18px; }
.tools-rail-mobile-close { display: none !important; }
.tools-rail-search { display: flex; align-items: center; gap: 8px; margin: 10px 12px 0; padding: 0 10px; border: 1px solid var(--aiwa-line); border-radius: 9px; }
.tools-rail-search[hidden] { display: none; }
.tools-rail-search img { width: 16px; height: 16px; opacity: .68; }
.tools-rail-search input { width: 100%; min-height: 36px; border: 0; outline: 0; color: var(--aiwa-ink); font-size: 12px; }
.tools-rail-nav { min-height: 0; flex: 1; overflow: auto; padding: 10px 10px 6px; scrollbar-width: thin; }
/* The nav scrolls, but its links are flex items and so shrink by default. Once the tool
   list outgrew the viewport every link was squashed below its own content height and the
   two-line labels ("Citation generator", "Text compare") overlapped the icon beneath.
   Holding their natural height makes the nav scroll, which is what it was built to do. */
.tools-rail-nav .tools-rail-link { flex: 0 0 auto; }
.tools-rail-section-label { margin: 8px 8px 7px; color: #68756d; font-size: 10px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.tools-rail-review-label { margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--aiwa-line); }
.tools-rail-link { position: relative; width: 100%; min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 9px 11px; border: 0; border-radius: 9px; background: transparent; color: #25352c; font-size: 13px; font-weight: 600; text-align: left; text-decoration: none; cursor: pointer; }
.tools-rail-link:hover { background: var(--aiwa-bg); }
.tools-rail-link.active { background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); font-weight: 760; }
.tools-rail-link.active::after { content: ""; position: absolute; top: 7px; right: -10px; bottom: 7px; width: 3px; border-radius: 3px 0 0 3px; background: var(--aiwa-brand); }
.tools-rail-link .aiwa-ui-icon { width: 19px; height: 19px; }
.tools-rail-link.active .aiwa-ui-icon { filter: invert(35%) sepia(70%) saturate(680%) hue-rotate(97deg) brightness(91%); }
.tools-rail-link[hidden] { display: none; }
.tools-rail-secondary { padding: 8px 10px; border-top: 1px solid var(--aiwa-line); }
.tools-rail-plan { display: grid; gap: 7px; padding: 14px 18px 18px; border-top: 1px solid var(--aiwa-line); color: var(--aiwa-text); font-size: 11px; }
.tools-rail-plan strong { color: var(--aiwa-ink); font-size: 12px; }
.tools-rail-meter { height: 5px; overflow: hidden; border-radius: 6px; background: #e4e9e5; }
.tools-rail-meter > span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--aiwa-brand); transition: width 180ms var(--aiwa-ease); }
.tools-rail-collapsed { --tools-rail-width: 68px; }
.tools-rail-collapsed .aiwa-tools-rail { align-items: stretch; }
.tools-rail-collapsed .tools-rail-head { justify-content: center; padding-inline: 8px; }
.tools-rail-collapsed .tools-rail-head > strong, .tools-rail-collapsed .tools-rail-head-actions button:first-child, .tools-rail-collapsed .tools-rail-section-label, .tools-rail-collapsed .tools-rail-link span, .tools-rail-collapsed .tools-rail-plan, .tools-rail-collapsed .tools-rail-search { display: none; }
.tools-rail-collapsed .tools-rail-head-actions { display: block; }
.tools-rail-collapsed .tools-rail-nav, .tools-rail-collapsed .tools-rail-secondary { padding-inline: 8px; }
.tools-rail-collapsed .tools-rail-link { justify-content: center; padding-inline: 8px; }
.tools-rail-collapsed .tools-rail-review-label { display: block; height: 1px; margin: 12px 4px; padding: 0; overflow: hidden; }
.tools-rail-collapsed .tools-rail-link.active::after { right: -8px; }
@media (max-width: 1020px) {
  .has-tool-rail { --tools-rail-width: 280px; }
  .has-tool-rail > main, .has-tool-rail > [data-aiwa-include="/includes/footer.html"] { margin-right: 0; }
  .has-tool-rail .aiwa-tools-toggle { display: inline-flex; }
  .aiwa-tools-rail { z-index: 180; width: min(88vw, 360px); transform: translateX(100%); box-shadow: -18px 0 50px rgba(23,33,27,.16); }
  .tools-panel-open .aiwa-tools-rail { transform: translateX(0); }
  .tools-rail-backdrop { position: fixed; z-index: 170; inset: 64px 0 0; background: rgba(23,33,27,.34); }
  .tools-panel-open .tools-rail-backdrop { display: block; }
  .tools-rail-head-actions [data-tools-panel-collapse] { display: none; }
  .tools-rail-mobile-close { display: grid !important; }
  .tools-rail-collapsed { --tools-rail-width: 280px; }
  .tools-rail-collapsed .tools-rail-head { justify-content: space-between; padding-inline: 16px; }
  .tools-rail-collapsed .tools-rail-head > strong, .tools-rail-collapsed .tools-rail-head-actions button:first-child, .tools-rail-collapsed .tools-rail-section-label, .tools-rail-collapsed .tools-rail-link span, .tools-rail-collapsed .tools-rail-plan { display: initial; }
  .tools-rail-collapsed .tools-rail-head-actions { display: flex; }
  .tools-rail-collapsed .tools-rail-nav, .tools-rail-collapsed .tools-rail-secondary { padding-inline: 10px; }
  .tools-rail-collapsed .tools-rail-link { justify-content: flex-start; padding-inline: 11px; }
  .tools-rail-collapsed .tools-rail-review-label { display: block; height: auto; margin: 17px 8px 7px; padding: 15px 0 0; overflow: visible; }
}
@media (max-width: 900px) {
  .aiwa-tools-rail { top: 56px; padding-bottom: env(safe-area-inset-bottom); }
  .tools-rail-backdrop { inset: 56px 0 0; }
}
