/* The shell and Rozmowa as in the old product (engine/public styles.css, experience.css,
   loader.css; ADR 0030): its sizes, spacing, colours and motion, on v2's markup. Loaded after
   styles.css; other pages keep their own rules (pages.css). Rozmowa goes on in chat.css,
   viewer.css and widgets.css, linked after this file in the same order. */

:root {
  --olive-ink: #505b37; --raised: #f1f0e9; --control: #cbcdbd; --field: #fffef8;
  --hover: #e9e8e0; --ink-hover: #454c37; --danger-soft: #f6e9e4; --panel: var(--sidebar);
}

/* The loaders and the entrance motion (.q-spinner, .q-loading, .q-enter, .q-pop) are pages.css's. */
.panel-enter { animation: q-enter 200ms var(--ease) both; }
@keyframes view-reveal { from { opacity: .7; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Shell */
.app-shell { height: 100dvh; min-height: 400px; display: flex; overflow: hidden; }
.navigation { width: 224px; flex-shrink: 0; padding: 15px 17px 16px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 35; }
.navigation .wordmark { display: flex; align-items: center; gap: 0; font: 21px/1 var(--serif); width: fit-content; padding: 0 9px 14px; letter-spacing: -.6px; color: var(--ink); }
.navigation .wordmark img { width: 20px; height: 20px; margin-right: 6px; }
.navigation .wordmark > span { color: var(--olive); }
.navigation .new-chat { display: flex; align-items: center; gap: 10px; border-radius: 7px; padding: 11px 13px; margin: 0; text-align: left; font-size: 14.8px; width: 100%; background: var(--ink); color: var(--surface); }
.navigation .new-chat:hover { background: #3a4033; color: #fff; box-shadow: 0 4px 14px #292b2715; }
.new-chat-plus { display: grid; place-items: center; width: 18px; height: 18px; }
.new-chat-plus .icon { width: 18px; height: 18px; stroke-width: 1.7; }
.navigation .nav { display: grid; gap: 3px; margin-top: 11px; }
.navigation .nav-item { width: 100%; display: flex; gap: 11px; align-items: center; padding: 10px 12px; border-radius: 6px; color: #64675b; text-align: left; font-size: 14.8px; position: relative; transition: background .2s, color .2s; }
.navigation .nav-item .icon { width: 18px; height: 18px; }
.navigation .nav-item:hover { background: #dcded150; color: var(--ink); }
.navigation .nav-item.active { background: #d9ddce; color: #454c37; font-weight: 550; }
.navigation .nav-item.active:before { content: ''; position: absolute; left: -17px; height: 20px; width: 3px; background: var(--olive); border-radius: 0 3px 3px 0; }
.account-wrap { margin-top: auto; position: relative; }
.navigation .account { width: 100%; display: flex; gap: 9px; text-align: left; align-items: center; border-top: 1px solid var(--line); padding: 16px 8px 3px; font-size: 13.5px; font-weight: 550; color: var(--ink); border-radius: 0; }
.navigation .account:active { transform: none; }
.navigation .account .who { min-width: 0; flex: 1; }
.navigation .account strong { display: block; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navigation .account small { display: block; color: var(--ink); font-size: 11.1px; font-weight: 400; }
.navigation .account .avatar { font-size: 12.3px; }
.navigation .account .settings-icon { margin-left: auto; width: 19px; height: 19px; color: var(--muted); transition: transform .3s var(--ease), color .2s; }
.navigation .account:hover .settings-icon, .navigation .account[aria-expanded=true] .settings-icon { color: var(--ink); transform: rotate(30deg); }
.account-menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 35px #292b2717; z-index: 40; transform-origin: bottom left; }
.account-menu[hidden] { display: none; }
.account-menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.account-menu-who strong { display: block; font-size: 13.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-who small { font-size: 11.5px; color: var(--muted); }
.account-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 6px; font-size: 13.5px; color: var(--ink); text-align: left; }
.account-menu-item .icon { color: var(--muted); }
.account-menu-item:hover, .account-menu-item:focus-visible { background: var(--hover); color: var(--ink); outline: none; }
.account-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.workspace .topbar { height: 67px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 0 30px; gap: 20px; }
.topbar-start { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-end { margin-left: auto; position: relative; flex-shrink: 0; }
.history-slot:empty { display: none; }
.back-button[hidden] { display: none; }
.workspace .breadcrumbs { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--muted); font-size: 13.5px; }
.workspace .breadcrumbs .slash { color: #b2b6a7; }
.workspace .breadcrumbs a { color: var(--muted); }
.workspace .breadcrumbs a:hover { color: var(--ink); }
.workspace .breadcrumbs .current { color: var(--ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; max-width: min(48vw, 480px); }
#page-title[data-renamable] { cursor: text; border-radius: 5px; padding: 2px 4px; margin: -2px -4px; }
#page-title[data-renamable]:hover { background: #dcded180; }
.title-input { font: inherit; color: var(--ink); background: var(--field); border: 1px solid var(--control); border-radius: 6px; padding: 3px 8px; min-width: min(360px, 50vw); }
.title-input:focus { outline: 0; border-color: var(--olive); box-shadow: 0 0 0 3px var(--sage); }
.icon-button svg { width: 17px; height: 17px; }
.history-toggle:hover, .history-toggle[aria-expanded=true] { background: #d9ddce; color: var(--ink); }
.mobile-menu, .nav-shade { display: none; }
.workspace .page { flex: 1; min-width: 0; min-height: 0; overflow: auto; position: relative; outline: 0; scrollbar-width: thin; scrollbar-color: #c9cdbd transparent; animation: view-reveal 200ms var(--ease); }

/* The connection line (ADR 0053): fixed over the page, so it never moves the content. */
.connection-line { position: fixed; top: 14px; left: calc(50% + 112px); transform: translateX(-50%); z-index: 310; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 12px; border: 1px solid #7b4436; background: #4a2c25; color: #f4e7e1; box-shadow: 0 8px 30px #2b39272b; animation: q-pop 160ms var(--ease) both; }
.connection-line[hidden] { display: none; }
.connection-line.is-back { background: #333b2a; border-color: #566445; color: #edf2e1; }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.connection-line.is-offline .connection-dot { animation: q-breathe 1.4s ease-in-out infinite; }
@keyframes q-breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (max-width: 760px) { .connection-line { left: 50%; } }
@media (prefers-reduced-motion: reduce) { .connection-line, .connection-line .connection-dot { animation: none; } }

/* Aktywność in the header (old activity.js). */
.activity-trigger { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); transition: background-color 160ms ease, color 160ms ease; padding: 7px 11px; font-size: 12px; }
.activity-trigger:hover { background: var(--hover); color: var(--ink); }
.activity-trigger.is-running { color: var(--ink-hover); border-color: var(--control); }
.activity-panel { position: absolute; right: 0; top: calc(100% + 12px); width: min(420px, calc(100vw - 32px)); max-height: min(70vh, 580px); overflow: auto; z-index: 40; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); transform-origin: top right; box-shadow: 0 12px 35px #292b2717; }
.activity-panel[hidden] { display: none; }
.activity-panel h2 { font: 400 25px var(--serif); margin: 0 0 12px; }
.activity-panel p { font-size: 13px; color: var(--muted); }
.activity-item { display: grid; gap: 4px; padding: 11px 8px; margin: 0 -8px; border-top: 1px solid var(--line); border-radius: 6px; color: var(--ink); transition: background-color 160ms ease; }
.activity-item:hover { background: color-mix(in srgb, var(--sage) 40%, transparent); }
.activity-item strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.activity-state, .activity-item time { font-size: 11px; color: var(--muted); }
.activity-state--waiting { color: #86622b; }
.activity-state--failed, .activity-state--interrupted { color: var(--danger); }
.activity-state--running { color: var(--olive); }
/* What Quartio does now (ADR 0053): the trigger's live line and the panel's runs. */
.activity-trigger { display: inline-flex; align-items: center; gap: 7px; max-width: min(420px, 44vw); }
.now-line { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.now-line--in { animation: now-line-in 260ms var(--ease) both; }
@keyframes now-line-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* Idle, the dot takes no room: "Aktywność" stands as it did. */
.activity-trigger:not(.is-running) .now-dot { width: 0; margin-right: -7px; }
.now-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--control); opacity: 0; transform: scale(.4); transition: opacity 200ms ease, transform 200ms var(--ease), background-color 200ms ease, width 200ms var(--ease), margin 200ms var(--ease); }
.activity-trigger.is-running .now-dot { opacity: 1; transform: none; background: var(--olive); animation: now-pulse 1.8s ease-in-out infinite; }
@keyframes now-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--olive) 45%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
.activity-panel h3.now-heading { font: 500 11px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 2px; }
.now-runs { display: grid; gap: 10px; }
.now-idle { margin: 0; }
.now-run { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--raised); display: grid; gap: 6px; }
.now-run-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.now-run-head strong { font-size: 13px; font-weight: 500; }
.now-run.is-open { cursor: pointer; transition: border-color 160ms var(--ease), background-color 160ms var(--ease); }
.now-run.is-open:hover { border-color: color-mix(in srgb, var(--olive) 45%, var(--line)); background: var(--surface); }
.now-run-title { font-size: 13px; font-weight: 500; color: var(--ink); text-decoration: none; }
.now-run.is-open:hover .now-run-title, .now-run-title:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.now-time, .now-who { font-size: 11px; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
.now-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12px; color: var(--ink); }
.now-steps li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 6px; align-items: center; }
.now-steps li > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.now-steps li:not(.is-going) { color: var(--muted); }
.now-mark { text-align: center; color: var(--olive); }
.now-detail { color: var(--muted); }
/* How far a step is: numbers that change in place without the line moving. */
.now-progress, .tool-activity-progress { color: var(--muted); font-variant-numeric: tabular-nums; }
.now-steps a { color: inherit; text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 2px; }
.now-spin { width: 11px; height: 11px; }
.now-waiting-list:empty, .now-who[hidden], .now-actions[hidden] { display: none; }
.now-waiting { border-top: 1px dashed var(--line); padding-top: 7px; font-size: 12px; }
.now-waiting p { margin: 0 0 6px; color: #86622b; }
.now-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.now-actions .btn[aria-disabled=true] { opacity: .65; cursor: progress; }
/* What was done lately (ADR 0053): one line each, its detail linking where it changed. */
.now-recent { display: grid; }
.recent-item { display: grid; gap: 3px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12px; }
.recent-item:first-child { border-top: 0; }
.recent-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.recent-head strong { font-size: 12.5px; font-weight: 500; }
.recent-head time, .recent-item small { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.recent-detail { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.recent-detail a { color: inherit; text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 2px; }
.recent-item.is-pending .recent-head strong { color: #86622b; }
.recent-item.is-denied .recent-head strong, .recent-item--failed .recent-head strong, .recent-item.is-failed .recent-head strong { color: #8a4a3c; }
.recent-item .now-actions { margin-top: 4px; }
@media (max-width: 760px) { .activity-trigger { max-width: 52vw; } }
@media (max-width: 440px) { .activity-trigger { max-width: 132px; padding: 7px 8px; } .activity-panel { right: -6px; } }
@media (prefers-reduced-motion: reduce) { .now-line--in, .activity-trigger.is-running .now-dot { animation: none; } }


/* Administracja: the admin pages as one quiet list. */
.page-heading { margin: 0 0 28px; }
.page-heading .eyebrow { display: block; font: 600 11px/1.55 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.page-heading h1 { font: 400 clamp(38px, 3.8vw, 54px)/1.05 var(--serif); letter-spacing: -1.2px; margin: 0; color: var(--ink); }
.page-heading p { font: 400 14px/1.7 var(--sans); color: var(--muted); margin: 12px 0 0; }
.admin-list { display: grid; }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 14px 10px; margin: 0 -10px; border-top: 1px solid var(--line); border-radius: 6px; color: var(--ink); transition: background-color 160ms ease; }
.admin-row:first-child { border-top: 0; }
.admin-row:hover { background: color-mix(in srgb, var(--sage) 40%, transparent); }
.admin-row > .icon { color: var(--olive); }
.admin-row-text { flex: 1; min-width: 0; }
.admin-row-text strong { display: block; font-size: 14.8px; font-weight: 550; }
.admin-row-text small { display: block; font-size: 12.3px; color: var(--muted); margin-top: 2px; }
.admin-row-count { min-width: 22px; padding: 0 7px; border-radius: 11px; font: 600 11.5px/22px var(--sans); text-align: center; background: var(--sage); color: var(--olive-ink); }
.admin-row-arrow { transform: rotate(180deg); color: var(--muted); transition: transform .2s var(--ease); }
.admin-row:hover .admin-row-arrow { transform: rotate(180deg) translateX(-3px); }

@media (max-width: 1200px) {
  .navigation { width: 205px; padding: 15px 14px 16px; }
  .navigation .nav-item.active:before { left: -14px; }
}
@media (max-width: 760px) {
  .navigation { position: fixed; inset: 0 auto 0 0; width: 228px; z-index: 50; transform: translateX(-100%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s .3s; }
  .nav-open .navigation { visibility: visible; transform: none; transition: transform .3s var(--ease), visibility 0s; }
  .nav-shade { display: block; position: fixed; inset: 0; background: #29301f50; z-index: 49; visibility: hidden; opacity: 0; transition: opacity .3s, visibility 0s .3s; border: 0; }
  .nav-open .nav-shade { visibility: visible; opacity: 1; transition: opacity .3s; }
  .mobile-menu { display: inline-grid; }
  .workspace .topbar { height: 59px; padding: 0 16px; gap: 12px; }
  .workspace .breadcrumbs { gap: 10px; }
  .workspace .breadcrumbs .crumb-root, .workspace .breadcrumbs .crumb-root + .slash { display: none; }
}
