/* One field surface, shared with the chat search, across every archive screen. */
:root {
  --archive-field-radius: 12px;
  --archive-field-height: 44px;
  --archive-field-shadow: 0 1px 1px #00000005;
}
body {
  --archive-field-border: color-mix(in srgb,var(--ink) 7%,var(--line));
  --archive-field-background: color-mix(in srgb,var(--ink) 4%,var(--surface));
}
body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),textarea,select,button[role="combobox"]) {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: var(--archive-field-height);
  padding: 10px 12px;
  border: 1px solid var(--archive-field-border);
  border-radius: var(--archive-field-radius);
  background-color: var(--archive-field-background);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: var(--archive-field-shadow);
  transition: background-color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
body :is(input,textarea)::placeholder { color: var(--muted); opacity: 1; }
body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),textarea,select,button[role="combobox"]):hover:not(:disabled) {
  border-color: color-mix(in srgb,var(--blue) 27%,var(--line));
  background-color: color-mix(in srgb,var(--blue) 5%,var(--surface));
}
body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),textarea,select,button[role="combobox"]):focus {
  border-color: color-mix(in srgb,var(--blue) 65%,var(--line));
  background-color: var(--surface);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 15%,transparent),0 5px 16px #00000009;
}
body :is(input,textarea,select,button[role="combobox"]):disabled { opacity: .55; cursor: not-allowed; }
body select { padding-right: 30px; }
body .sidebar .chat-searchbox {
  height: var(--archive-field-height);
  border-color: var(--archive-field-border);
  border-radius: var(--archive-field-radius);
  background-color: var(--archive-field-background);
  box-shadow: var(--archive-field-shadow);
}
body .sidebar .chat-searchbox #search {
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 16px;
  outline: none;
}
body .cp-search {
  min-height: var(--archive-field-height);
  border: 1px solid var(--archive-field-border);
  border-radius: var(--archive-field-radius);
  background-color: var(--archive-field-background);
  box-shadow: var(--archive-field-shadow);
}
body .cp-search:focus-within {
  border-color: color-mix(in srgb,var(--blue) 65%,var(--line));
  background-color: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 15%,transparent),0 5px 16px #00000009;
}
body .cp-search input[type="search"] {
  min-height: 0 !important;
  height: 42px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  outline: none;
}
body .refined-search input { border-radius: var(--archive-field-radius) !important; }
/* A composite field (icon + input, tags + input) draws the one surface; the input inside stays bare.
 * Put .archive-field on the wrapper instead of restyling the inner input per screen. */
body .archive-field {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: var(--archive-field-height);
  padding: 0 12px;
  border: 1px solid var(--archive-field-border);
  border-radius: var(--archive-field-radius);
  background-color: var(--archive-field-background);
  color: var(--ink);
  box-shadow: var(--archive-field-shadow);
  transition: background-color .18s ease,border-color .18s ease,box-shadow .18s ease;
}
body .archive-field:hover { border-color: color-mix(in srgb,var(--blue) 27%,var(--line)); }
body .archive-field:focus-within {
  border-color: color-mix(in srgb,var(--blue) 65%,var(--line));
  background-color: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 15%,transparent),0 5px 16px #00000009;
}
body .archive-field :is(input,textarea):not([type="checkbox"]):not([type="radio"]) {
  flex: 1;
  width: 0;
  min-width: 0;
  min-height: 0 !important;
  height: auto;
  padding: 9px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  font-size: 16px;
}
@media(prefers-reduced-motion:reduce) {
  body :is(input,textarea,select,button[role="combobox"],.archive-field) { transition: none; }
}

/* Font-independent disclosure arrows for native fields and legacy summaries. */
:root{--archive-chevron-down:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7.5 5 5 5-5' fill='none' stroke='%23828b96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");--archive-chevron-up:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 12.5 5-5 5 5' fill='none' stroke='%23828b96' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
body .ui-disclosure-chevron{display:block;flex-shrink:0;width:18px;height:18px;overflow:visible;vertical-align:middle}
body select:not([multiple]):not([size]):not(.archive-select-native){appearance:none;background-image:var(--archive-chevron-down);background-repeat:no-repeat;background-position:right 12px center;background-size:18px 18px;padding-right:38px}
@supports selector(select:open){body select:open{background-image:var(--archive-chevron-up)}}
body :is(.cs-more summary,.history-chat-group>summary,.psc-download-options summary)::after{content:'';display:block;flex:0 0 18px;width:18px;height:18px;align-self:center;background-color:var(--muted);mask:var(--archive-chevron-down) center/contain no-repeat;transition:transform .16s ease}
body :is(.cs-more,.history-chat-group,.psc-download-options)[open]>summary::after{transform:rotate(180deg)}
@media(prefers-reduced-motion:reduce){body :is(.cs-more summary,.history-chat-group>summary,.psc-download-options summary)::after{transition:none}}

body [role="combobox"] .ui-disclosure-chevron{width:18px;height:18px;color:var(--muted);transform:rotate(0deg);transform-origin:center;transition:transform .16s ease}
body [role="combobox"][data-state="open"] .ui-disclosure-chevron{transform:rotate(180deg)}
@media(prefers-reduced-motion:reduce){body [role="combobox"] .ui-disclosure-chevron{transition:none}}

/* Disclosure triggers use the same down/up arrow, independently of legacy rotations. */
body #workspace-panel :is(button[aria-expanded],summary) > span:has(> .ui-disclosure-chevron){transform:none}
body #workspace-panel :is(button[aria-expanded],summary) > .ui-disclosure-chevron,
body #workspace-panel :is(button[aria-expanded],summary) > span > .ui-disclosure-chevron{color:var(--muted);transform:rotate(0deg);transition:transform .16s ease}
body #workspace-panel :is(button[aria-expanded],summary) > .ui-disclosure-chevron{margin-left:auto}
body #workspace-panel button[aria-expanded="true"] > .ui-disclosure-chevron,
body #workspace-panel button[aria-expanded="true"] > span > .ui-disclosure-chevron,
body #workspace-panel details[open] > summary > .ui-disclosure-chevron,
body #workspace-panel details[open] > summary > span > .ui-disclosure-chevron{transform:rotate(180deg)}
@media(prefers-reduced-motion:reduce){body #workspace-panel .ui-disclosure-chevron{transition:none}}
