/* UI release: concept-1-2026-09-14. Approved workbench composition on the live app. */

.app-body { color-scheme: light; }
.app-body [hidden] { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: var(--z-modal); transform: translateY(-200%);
  padding: 10px 16px; background: white; border: 1px solid var(--accent-red); border-radius: 6px;
}
.skip-link:focus { transform: translateY(0); }

/* Shell shared by all existing routes. Editor internals retain their own theme. */
.app-header { border-bottom: 1px solid var(--border-subtle); box-shadow: none; padding-inline: 32px; }
.header__breadcrumb { display: flex; align-items: center; gap: 12px; min-width: 0; font-size: 13px; color: var(--text-muted); }
.header__breadcrumb a { color: var(--text-muted); white-space: nowrap; }
#header-current-page { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header__workspace-label { color: var(--text-muted); font-size: 11px; letter-spacing: .7px; margin-right: 10px; }
.header__user-avatar, .sidebar__user-avatar { background: #eceef1; color: #49525e; cursor: default; }
.sidebar { height: 100dvh; }
.sidebar__logo { border-bottom: 0; padding: 27px 22px 22px; gap: 10px; }
.sidebar__logo-icon { width: 34px; height: 34px; }
.sidebar__logo-text { font-size: 20px; line-height: 1.2; letter-spacing: -.7px; }
.sidebar__logo-text small { display: block; margin-top: 6px; font-size: 10px; letter-spacing: 1.5px; color: var(--text-muted); font-weight: 500; }
.sidebar__nav { padding: 6px 12px 20px; }
.sidebar__nav-group + .sidebar__nav-group { margin-top: 22px; }
.sidebar__nav-label { color: var(--text-muted); font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 600; padding: 0 12px; margin-bottom: 9px; }
.sidebar__nav-list { padding: 0; gap: 3px; }
.sidebar__nav-link { min-height: 40px; padding: 9px 12px; border-radius: 7px; color: var(--text-secondary); font-size: 13px; line-height: 1.4; gap: 10px; }
.sidebar__nav-link.active { border-left: 0; padding-left: 12px; background: #faedef; }
.sidebar__nav-link:hover { background: #f1f3f5; }
.sidebar__nav-link.active:hover { background: #f8e4e7; }
.sidebar__nav-link .nav-icon { width: 17px; height: 17px; }
.sidebar__footer { padding: 18px 20px; }
.sidebar__logout-btn { width: 36px; height: 36px; }
.sidebar__close { display: none; }
/* The transparent mobile backdrop must not intercept the menu button. */
.sidebar-overlay { pointer-events: none; }
.sidebar-overlay.visible { pointer-events: auto; }
.page-title, .section-title { color: var(--text-primary); text-transform: none; letter-spacing: -.5px; }
.page-title::before, .section-title::before { content: none; }
.page-title { font-weight: 600; }
.page-subtitle { color: var(--text-muted); }
.card { border-radius: 9px; }
.btn { border-radius: 6px; }
.form-input, .form-select { border-radius: 6px; }

/* Assistant: clear entry, existing conversation, real navigation actions. */
.workbench { max-width: 1190px; padding: 44px 48px 30px; }
.workbench__hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.workbench__hero-copy { max-width: 660px; min-width: 0; }
.workbench__eyebrow { display: flex; align-items: center; gap: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.6px; font-size: 11px; font-weight: 600; margin-bottom: 13px; }
.workbench__eyebrow::before { content: ''; width: 6px; height: 6px; background: var(--accent-red); border-radius: 1px; }
.workbench h1 { font-size: clamp(28px, 2.6vw, 38px); font-weight: 600; letter-spacing: -1.3px; line-height: 1.2; margin-bottom: 14px; }
.workbench__subtitle { color: var(--text-muted); font-size: 15px; line-height: 1.75; max-width: 570px; }
.workbench__drawing { position: relative; width: 152px; height: 140px; flex: none; background-image: linear-gradient(#e9ecef 1px, transparent 1px), linear-gradient(90deg, #e9ecef 1px, transparent 1px); background-size: 16px 16px; mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); }
.workbench__drawing svg { width: 100%; height: 100%; }
.workbench__compose { display: block; background: white; border: 1px solid #d5dae0; border-radius: 12px; padding: 0; overflow: hidden; box-shadow: 0 4px 18px #202b3b05; }
.workbench__compose:focus-within { border-color: var(--accent-red); box-shadow: 0 0 0 3px var(--accent-red-10); }
.workbench .chat-page__input { display: block; resize: vertical; width: 100%; min-height: 126px; max-height: 300px; background: white; border: 0; border-radius: 0; padding: 22px 24px 12px; font-size: 16px; line-height: 1.7; }
.workbench .chat-page__input:focus-visible { outline: 2px solid var(--accent-red); outline-offset: -4px; }
.workbench .chat-page__input::placeholder { color: #77818c; opacity: 1; }
.workbench__compose-footer { padding: 10px 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.workbench__attachments { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.workbench__attach { display: inline-flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 6px; font-size: 12px; color: var(--text-secondary); background: #f4f5f7; min-height: 38px; }
.workbench__attach:hover { background: #e9edf1; }
.workbench svg { flex-shrink: 0; }
.workbench__attach svg, .workbench__send svg { width: 17px; height: 17px; }
.workbench__formats { font-size: 10px; color: var(--text-muted); }
.workbench__drawing-link { font-size: 12px; padding: 9px 0; }
.workbench__send { display: inline-flex; align-items: center; gap: 14px; min-height: 40px; padding: 10px 17px; font-size: 13px; }
.workbench__input-hint { font-size: 11px; line-height: 1.65; color: var(--text-muted); padding: 10px 2px 0; }
.workbench__busy { padding: 9px 2px 0; color: var(--text-secondary); font-size: 12px; }
.workbench .chat-page__attachment { max-width: calc(100% - 32px); overflow-wrap: anywhere; margin: 0 16px 6px; padding: 6px 10px; background: #f5f6f7; }
.workbench .chat-page__attachment-name { min-width: 0; }
.workbench .chat-page__attachment-remove { min-width: 32px; min-height: 32px; flex: none; }
.workbench__dialogue { margin-bottom: 16px; }
.workbench__dialogue > h2 { font-size: 13px; color: var(--text-muted); font-weight: 500; margin-bottom: 10px; }
.workbench .chat-page__log { max-height: 50vh; min-height: 120px; padding: 16px; border: 1px solid var(--border-subtle); border-radius: 9px; background: #fff; gap: 16px; overscroll-behavior: contain; }
.workbench .chat-msg__text { background: #f1f3f5; font-size: 14px; line-height: 1.65; border-radius: 9px; max-width: 90%; }
.workbench .chat-msg--user .chat-msg__text { background: #faedef; color: var(--text-primary); }
.workbench .chat-msg--error .chat-msg__text { background: var(--accent-red-10); color: var(--accent-red-dark); }
.workbench .chat-action-card { background: #fafbfc; border-left: 3px solid var(--accent-red); max-width: 100%; padding: 15px; }
.workbench .chat-action-card .chat-msg__text { background: transparent; }
.workbench__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 26px 0 36px; }
.workbench__action { display: block; min-width: 0; padding: 20px; border: 1px solid var(--border-subtle); background: white; color: var(--text-primary); border-radius: 9px; transition: border-color .15s, background .15s; }
.workbench__action:hover { background: #fafbfc; border-color: #b9c1ca; text-decoration: none; }
.workbench__action-icons { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; color: #586473; }
.workbench__action-icons svg { width: 23px; height: 23px; }
.workbench__action-icons svg:last-child { width: 15px; height: 15px; color: #818d99; }
.workbench__action strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.workbench__action > span:last-child { display: block; font-size: 12px; line-height: 1.65; color: var(--text-muted); }
.workbench__section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.workbench__section-head h2 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
.workbench__section-head a, .workbench__history-link > a { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); white-space: nowrap; padding-block: 8px; }
.workbench__section-head svg, .workbench__history-link > a svg { width: 15px; height: 15px; }
.workbench__history-link { display: flex; align-items: center; gap: 16px; padding: 23px; border: 1px solid var(--border-subtle); background: #fff; border-radius: 9px; }
.workbench__history-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 8px; background: #f2f4f6; color: #626e7d; }
.workbench__history-icon svg { width: 22px; height: 22px; }
.workbench__history-link h3 { font-size: 14px; font-weight: 500; line-height: 1.5; }
.workbench__history-link p { font-size: 12px; line-height: 1.6; color: var(--text-muted); margin-top: 4px; }
.workbench__history-link > a { margin-left: auto; }
.workbench__footer { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--text-muted); margin-top: 18px; }

@media (max-width: 1100px) {
  .workbench { padding: 34px 30px 26px; }
  .workbench__drawing { width: 120px; }
  .workbench__formats { display: none; }
  .workbench__action { padding: 16px; }
}
@media (max-width: 900px) {
  .workbench__drawing { display: none; }
  .header__workspace-label { display: none; }
  .workbench__actions { gap: 10px; }
}
@media (max-width: 768px) {
  .app-header { padding-inline: 12px; gap: 10px; }
  /* Router restores a desktop inline margin; resizing must still clear it. */
  .app-wrapper { margin-left: 0 !important; }
  .sidebar { width: min(300px, 88vw); visibility: hidden; }
  .sidebar.open { visibility: visible; }
  .sidebar__logo { padding: 21px 18px; }
  .sidebar__close { display: grid; place-items: center; font-size: 26px; line-height: 1; width: 36px; height: 36px; margin-left: auto; color: var(--text-muted); }
  .sidebar__nav-link { min-height: 44px; }
  .sidebar__nav-group + .sidebar__nav-group { margin-top: 17px; }
  .header__breadcrumb { gap: 8px; font-size: 12px; flex: 1; }
  .header__actions { margin-left: 0; }
  .header__user-avatar { width: 28px; height: 28px; }
  .workbench { padding: 28px 22px 24px; }
  .workbench h1 { font-size: 32px; }
  .workbench__subtitle { font-size: 14px; }
  .bottom-nav { background: #fff; border-top: 1px solid var(--border-subtle); box-shadow: none; }
  .workbench .chat-page__log { max-height: 45dvh; }
}
@media (max-width: 540px) {
  .header__breadcrumb > a { display: none; }
  .header__breadcrumb > span[aria-hidden] { display: none; }
  .workbench { padding: 25px 16px 24px; }
  .workbench h1 { font-size: 29px; letter-spacing: -.9px; }
  .workbench__eyebrow { font-size: 10px; }
  .workbench__hero { margin-bottom: 22px; }
  .workbench .chat-page__input { padding: 17px 17px 10px; min-height: 138px; }
  .workbench__compose-footer { padding: 7px 12px 13px; }
  .workbench__attachments { gap: 3px 10px; }
  .workbench__send { margin-left: auto; }
  .workbench__actions { grid-template-columns: 1fr; margin-top: 22px; margin-bottom: 28px; }
  .workbench__action { display: grid; grid-template-columns: 27px minmax(0, 1fr); column-gap: 13px; padding: 15px; }
  .workbench__action-icons { grid-row: 1 / 3; margin: 0; align-self: center; }
  .workbench__action-icons svg:last-child { display: none; }
  .workbench__action strong { margin-bottom: 3px; font-size: 14px; }
  .workbench__action > span:last-child { font-size: 12px; }
  .workbench__section-head h2 { font-size: 16px; }
  .workbench__history-link { flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 17px; }
  .workbench__history-icon { width: 34px; height: 34px; }
  .workbench__history-link > div { flex: 1; min-width: 160px; }
  .workbench .chat-msg__text { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .workbench__action { transition: none; }
}
