/* Editor search and replace, and the collapsible sidebar. Loaded last on purpose:
   the theme sheets set the sidebar width with !important. */

/* ---------------------------------------------------------------- search and replace */
.segments-toolbar-right { display: flex; align-items: center; gap: 10px; }
.find-open { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid var(--line-strong, #d0d5dd); border-radius: 8px; color: var(--ink-soft, #475467); background: #fff; font-size: 11px; font-weight: 600; cursor: pointer; }
.segments-toolbar .find-open > span[aria-hidden] { color: inherit; font-size: 14px; line-height: 1; }
.segments-toolbar .find-open > .find-open-label { color: inherit; font-size: 11px; }
.find-open:hover, .find-open.active { border-color: #a5b4fc; color: #4338ca; background: #eef2ff; }

.find-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 17px 11px; border-bottom: 1px solid var(--line, #eaecf0); background: #f8f9ff; }
.find-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.find-row > * { min-width: 0; }
.find-input { display: flex; flex: 1 1 200px; min-width: 170px; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong, #d0d5dd); border-radius: 8px; background: #fff; }
.find-input:focus-within { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,.14); }
.find-input span { color: #667085; font-size: 15px; }
.find-input input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 13px; }
.find-bar select { height: 34px; padding: 0 8px; border: 1px solid var(--line-strong, #d0d5dd); border-radius: 8px; background: #fff; font-size: 12px; }
.find-option { display: inline-flex; align-items: center; gap: 5px; color: #344054; font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.find-option-warning { color: #c2410c; }
.find-count { flex: 0 1 300px; min-width: 0; overflow: hidden; color: #475467; font-size: 11px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.find-bar select { max-width: 150px; }
.find-buttons { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.find-buttons button { height: 30px; min-width: 30px; padding: 0 10px; border: 1px solid var(--line-strong, #d0d5dd); border-radius: 7px; color: #344054; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.find-buttons button:hover:not(:disabled), .find-buttons button.active { border-color: #a5b4fc; color: #4338ca; background: #eef2ff; }
.find-buttons button.primary { border-color: #4f46e5; color: #fff; background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.find-buttons button:disabled { opacity: .45; cursor: not-allowed; }
.find-help { flex-basis: 100%; color: #667085; font-size: 11px; }
.find-preview { height: 34px; margin: 0; padding: 7px 10px; overflow: hidden; border: 1px dashed #c7d2fe; border-radius: 8px; color: #344054; background: #fff; font-size: 12px; line-height: 18px; white-space: nowrap; text-overflow: ellipsis; }
.find-preview small { color: #667085; }
.find-preview-empty { color: #98a2b3; }
.find-notice { margin: 0; padding: 7px 10px; border-radius: 8px; color: #1e3a8a; background: #eef2ff; font-size: 12px; }
.find-preview b { color: #4338ca; font-size: 11px; }
.find-replaced { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 8px; color: #1e3a8a; background: #e0e7ff; font-size: 12px; }
.find-replaced button { height: 28px; padding: 0 10px; border: 1px solid #a5b4fc; border-radius: 7px; color: #3730a3; background: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.find-empty { padding: 18px 17px; color: #667085; font-size: 13px; }
@media (max-width: 620px) {
  .segments-toolbar { flex-wrap: wrap; gap: 6px; padding-top: 6px; padding-bottom: 6px; }
  .segments-toolbar-right { flex-wrap: wrap; }
  .find-open-label { display: none; }
  .find-count { flex-basis: 100%; }
}

/* ---------------------------------------------------------------- collapsible sidebar */
.sidebar-toggle { position: absolute; top: 30px; right: -13px; z-index: 45; display: grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 1px solid #e4e7ec; border-radius: 50%; color: #4338ca; background: #fff; box-shadow: 0 4px 12px rgba(16,24,40,.16); font-size: 16px; font-weight: 800; line-height: 1; cursor: pointer; transition: transform .18s ease, background .18s ease; }
.sidebar-toggle:hover { background: #eef2ff; transform: scale(1.06); }
.sidebar-toggle:focus-visible { outline: 3px solid rgba(99,102,241,.35); outline-offset: 2px; }
.app-shell .sidebar { transition: width .2s ease, transform .25s ease; }
.app-shell .workspace { transition: margin-left .2s ease; }

@media (min-width: 821px) {
  .app-shell.sidebar-collapsed .sidebar { width: 76px !important; padding-right: 12px !important; padding-left: 12px !important; overflow: visible; }
  .app-shell.sidebar-collapsed .workspace { margin-left: 76px !important; }
  .app-shell.sidebar-collapsed .sidebar .brand { justify-content: center; margin-right: auto; margin-left: auto; padding: 0 !important; }
  .app-shell.sidebar-collapsed .main-nav { overflow-x: hidden; }
  .app-shell.sidebar-collapsed .nav-label { height: 1px; margin: 12px 10px !important; overflow: hidden; color: transparent !important; background: rgba(255,255,255,.08); }
  .app-shell.sidebar-collapsed .main-nav > div:first-child > .nav-label { margin-top: 0 !important; }
  .app-shell.sidebar-collapsed .nav-item { position: relative; justify-content: center; gap: 0; padding: 0 !important; }
  .app-shell.sidebar-collapsed .nav-item > span:not([data-icon]) { display: none; }
  .app-shell.sidebar-collapsed .nav-item em { position: absolute; top: 2px; right: 2px; min-width: 0; padding: 0 4px; font-size: 9px; line-height: 14px; }
  .app-shell.sidebar-collapsed .sidebar-foot { padding-right: 0 !important; padding-left: 0 !important; }
  .app-shell.sidebar-collapsed .sidebar-foot .usage-head,
  .app-shell.sidebar-collapsed .sidebar-foot .usage-track,
  .app-shell.sidebar-collapsed .sidebar-foot small { display: none; }
  .app-shell.sidebar-collapsed .sidebar-signout { justify-content: center; margin-top: 0; border-top: 0; }
  .app-shell.sidebar-collapsed .sidebar-signout span { display: none; }
}
@media (max-width: 820px) {
  .sidebar-toggle { display: none; }
}
