/* Shared application frame. Department-specific controls retain their own layout. */
:root {
  --frame-ink: #192e28;
  --frame-muted: #52665e;
  --frame-line: #d8e2dc;
  --frame-paper: #f5f7f5;
  --frame-forest: #214c3f;
  --frame-active: #e0eee4;
  --frame-header: 55px;
  --frame-rail: 212px;
  scroll-padding-top: calc(var(--frame-header) + 12px);
}
body { background: var(--frame-paper); color: var(--frame-ink); }
#app > .mira-topbar {
  position: sticky; inset-block-start: 0; z-index: 30; min-height: var(--frame-header);
  display: flex; align-items: center; gap: 14px; padding: 5px 23px;
  background: #fff; border-bottom: 1px solid var(--frame-line);
}
.mira-topbar .wordmark { color: var(--frame-forest); font: 800 23px/1.15 system-ui,sans-serif; letter-spacing: .11em; }
.mira-topbar .wordmark::after { content: none; }
.mira-topbar .tagline { font-size: 11px; letter-spacing: .025em; color: var(--frame-muted); }
.mira-topbar .identity { margin-inline-start: auto; color: var(--frame-muted); font-size: 13px; }
.mira-topbar .frame-location { border-inline-start: 1px solid var(--frame-line); padding-inline-start: 14px; font-weight: 650; font-size: 13px; }
.mira-topbar button { background: #fff; border-color: var(--frame-line); color: var(--frame-forest); min-height: 36px; padding: 6px 13px; }
.workspace-layout { display: grid; grid-template-columns: var(--frame-rail) minmax(0,1fr); align-items: start; min-height: calc(100dvh - var(--frame-header)); }
.workspace-layout > main { margin: 0 auto; width: 100%; min-width: 0; max-width: 1640px; padding: clamp(17px,2.15vw,34px); }
.workspace-layout > .workspace-navigation {
  position: sticky; top: var(--frame-header); z-index: 15; align-self: start; height: calc(100dvh - var(--frame-header));
  display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 15px 10px 24px;
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  border: 0; border-inline-end: 1px solid var(--frame-line); background: #fbfcfa; backdrop-filter: none;
}
.workspace-navigation .nav-priority,.workspace-navigation .nav-sections,.workspace-navigation .nav-section {
  display: flex; flex-direction: column; align-items: stretch; gap: 1px; flex-wrap: nowrap; min-width: 0; margin: 0; overflow: visible;
}
.workspace-navigation .nav-sections { gap: 11px; }
.workspace-navigation .nav-label {
  color: #5a6c64; font-size: 10px; font-weight: 700; letter-spacing: .065em;
  text-transform: uppercase; padding: 3px 10px 5px;
}
.workspace-navigation button {
  width: 100%; display: flex; align-items: center; gap: 8px; min-height: 34px; margin: 0; padding: 6px 10px;
  color: #314b40; background: transparent; border: 1px solid transparent; border-radius: 6px; box-shadow: none;
  font-size: 13.5px; line-height: 1.3; text-align: left; font-weight: 480; white-space: normal;
}
.workspace-navigation button:hover { background: #eef2ee; border-color: #e5ece6; }
.workspace-navigation button[aria-current="page"] {
  color: #134532; font-weight: 700; border-color: #cbded0; background: var(--frame-active);
  box-shadow: inset 3px 0 #397351;
}
.workspace-navigation .nav-picker { display: none; }
.workspace-navigation .nav-icon { order: -1; width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linejoin: round; stroke-linecap: round; }
.mobile-chat-shortcut { display: none; }
.mira-unread {
  margin-inline-start: auto; min-width: 21px; border-radius: 20px; padding: 1px 5px;
  background: #24664d; color: white; text-align: center; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.mira-unread[hidden],.mira-chat-notice[hidden] { display: none; }
.mira-test-unread { margin-inline-start: 0; background: #fff0ca; color: #604315; }
.mira-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.mira-chat-notice {
  position: fixed; z-index: 45; inset: auto 20px 18px auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  max-width: min(430px,calc(100vw - 30px)); padding: 12px 15px; background: #163e34; color: #fff;
  box-shadow: 0 4px 20px #133c2925; border-radius: 8px; font-size: 14px;
}
.mira-chat-notice a { color: #e1f6df; font-weight: 650; }
.mira-chat-notice button { padding: 4px 8px; min-height: 32px; background: transparent; color: white; border-color: #9fbaaf; }
.view-content { min-width: 0; }
.workspace-layout :is(h1,h2) { color: var(--frame-ink); letter-spacing: -.025em; }
.workspace-layout .card { border-color: var(--frame-line); border-radius: 11px; box-shadow: 0 1px 2px #183a2c06; }
.workspace-layout :is(input,select,textarea,button):focus-visible,.workspace-layout a:focus-visible {
  outline: 3px solid #4f8d70; outline-offset: 2px;
}
.workspace-layout .projects-heading { gap: 10px; margin: 0 0 15px; }
.projects-heading h2 { margin: 0; }
.portfolio-header-actions,.portfolio-modes,.portfolio-view-tools { display: flex; align-items: center; gap: 7px; }
.portfolio-header-actions button,.portfolio-modes button { min-height: 35px; padding: 6px 11px; font-size: 13px; border-radius: 6px; }
.portfolio-header-actions button:first-child { color: var(--frame-forest); background: white; border-color: var(--frame-line); }
.portfolio-view-tools { justify-content: space-between; margin: 10px 0 8px; }
.portfolio-count { color: var(--frame-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.portfolio-modes { gap: 0; border: 1px solid var(--frame-line); border-radius: 7px; background: white; padding: 2px; }
.portfolio-modes button { border: none; color: var(--frame-muted); background: transparent; min-height: 29px; }
.portfolio-modes button[aria-pressed="true"] { color: #1c4838; font-weight: 650; background: var(--frame-active); }
.workspace-layout .project-toolbar { margin: 0; gap: 7px; align-items: center; }
.workspace-layout .project-toolbar :is(input,select,button) { min-height: 37px; font-size: 14px; padding-block: 6px; }
.workspace-layout .project-toolbar input { max-width: 310px; }
.workspace-layout .project-toolbar select { max-width: 180px; }
.workspace-layout .project-toolbar .material-tabs { display: flex; flex-wrap: wrap; gap: 3px; }
.project-summary-title h3 { margin: 0 0 4px; min-width: 0; }
.project-summary-title .project-revision,.project-summary-title .project-brand { margin: 3px 0 0; font-size: 12px; }
.project-purchase-fact { display:grid; gap:2px; margin:6px 0; border-inline-start:3px solid #3a7555; border-radius:3px; background:#edf6ef; padding:6px 9px; color:#204e36; font-size:13px; line-height:1.4; }
.project-purchase-fact.purchase-partial { background:#fff4dd; color:#674819; border-inline-start-color:#ac7c22; }
.project-purchase-fact .purchase-origin { color:var(--frame-muted); font-size:11px; }
.purchase-origin a { display:inline-block; margin-inline-start:8px; }
[data-portfolio-layout="list"] > .project-grid { display: grid; grid-template-columns: minmax(0,1fr); margin-top: 0; gap: 7px; }
[data-portfolio-layout="list"] > .project-grid > .project-card {
  display: grid; grid-template-columns: minmax(145px,1.34fr) minmax(175px,1.1fr) minmax(132px,.8fr) minmax(94px,.46fr);
  grid-template-areas: "title facts dates actions" "preview facts dates actions"; align-items: start; gap: 5px 16px;
  margin: 0; padding: 12px 15px; border-radius: 9px; background: white; min-width: 0;
}
[data-portfolio-layout="list"] > .project-grid > .project-card[hidden] { display:none; }
[data-portfolio-layout="list"] .project-card-body { display: contents; }
[data-portfolio-layout="list"] .project-summary-title { grid-area: title; align-self: start; }
[data-portfolio-layout="list"] .project-summary-title h3 { font-size: 16px; line-height: 1.35; }
[data-portfolio-layout="list"] .project-card-meta { grid-area: dates; min-width: 0; align-self: start; padding: 0; }
[data-portfolio-layout="list"] .project-dates { background: transparent; border: 0; flex-direction: column; padding: 0; gap: 2px; }
[data-portfolio-layout="list"] .project-date { font-size: 11px; line-height: 1.4; }
[data-portfolio-layout="list"] .project-card-badges { padding: 5px 0 0; gap: 3px; flex-wrap: wrap; }
[data-portfolio-layout="list"] .project-card-badges span { padding: 2px 5px; font-size: 10px; }
[data-portfolio-layout="list"] .project-material-unknown { display: none; }
[data-portfolio-layout="list"] > .project-grid .project-facts {
  grid-area: facts; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; margin: 0;
  font-size: 12px; line-height: 1.4; align-content: start;
}
[data-portfolio-layout="list"] .project-facts dt { font-size: 11px; color: var(--frame-muted); }
[data-portfolio-layout="list"] .project-facts dd { margin: 0; color: var(--frame-ink); }
[data-portfolio-layout="list"] > .project-grid .project-card-actions {
  grid-area: actions; display: grid; grid-template-columns: minmax(0,1fr); width: 100%; align-self: start; align-content: start; gap: 4px; padding: 0; margin: 0;
}
[data-portfolio-layout="list"] .project-card-actions button { width: 100%; min-height: 32px; font-size: 12px; line-height: 1.35; padding: 5px 6px; border-radius: 5px; white-space: normal; word-break: normal; overflow-wrap: normal; }
[data-portfolio-layout="list"] > .project-grid .project-cover {
  grid-area: preview; display: flex; align-items: center; gap: 6px; padding: 0; margin: 0; border: 0;
  width: 100%; height: auto; min-height: 0; aspect-ratio: auto; background: transparent;
}
[data-portfolio-layout="list"] > .project-grid .project-cover a { display: block; flex: 0 0 43px; width: 43px; height: 34px; }
[data-portfolio-layout="list"] > .project-grid .project-cover img { display: block; width: 43px; height: 34px; border-radius: 4px; object-fit: contain; }
[data-portfolio-layout="list"] > .project-grid .project-cover :is(figcaption,p) {
  position: static; padding: 0; margin: 0; background: transparent; color: var(--frame-muted); font-size: 10px; line-height: 1.35;
}
[data-portfolio-layout="list"] > .project-grid .project-cover[data-preview-state="empty"].project-cover-empty { display: none; }
[data-portfolio-layout="cards"] > .project-grid { grid-template-columns: repeat(auto-fill,minmax(min(100%,280px),1fr)); gap: 14px; }
[data-portfolio-layout="cards"] > .project-grid > .project-card { display: flex; flex-direction: column; }
[data-portfolio-layout="cards"] > .project-grid > .project-card[hidden] { display: none; }
[data-portfolio-layout="cards"] .project-card-body { padding: 14px 16px 10px; }
[data-portfolio-layout="cards"] .project-summary-title h3 { font-size: 18px; }
[data-portfolio-layout="cards"] .project-cover:not(.project-cover-empty) { max-height: 165px; }
[data-portfolio-layout="cards"] .project-cover-empty { min-height: 0; }
.workspace-layout .chat-workspace-main { max-width: none; padding: 12px 16px; }
.department-measures { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:8px; margin:12px 0; }
.department-measures button { display:grid; align-content:start; gap:2px; width:100%; min-height:58px; padding:8px 11px; background:#fff; border:1px solid var(--frame-line); border-radius:8px; text-align:left; color:var(--frame-muted); }
.department-measures button strong { font-size:20px; line-height:1.2; color:var(--frame-ink); font-variant-numeric:tabular-nums; }
.department-measures button span { font-size:12px; line-height:1.3; }
.department-measures button[aria-pressed=true] { color:var(--frame-forest); background:var(--frame-active); border-color:#a8c6b2; }
.department-chat-coverage { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin:0 0 10px; font-size:12px; color:var(--frame-muted); }
.department-chat-coverage meter { width:104px; height:12px; }
.department-work-count { border-inline-start:3px solid #b58429; padding:4px 8px; background:#fff5de; color:#654817; font-size:12px; }
@media (min-width:1500px) { :root { --frame-rail: 232px; } }
@media (min-width:761px) and (max-width:1079px) {
  :root { --frame-rail: 172px; }
  .workspace-layout > main { padding-inline: 14px; }
  [data-portfolio-layout="list"] > .project-grid > .project-card {
    grid-template-columns: minmax(145px,1fr) minmax(190px,1.2fr) minmax(95px,.55fr);
    grid-template-areas: "title facts actions" "dates facts actions" "preview facts actions";
  }
}
@media (max-width:760px) {
  :root { --frame-header: 45px; scroll-padding-top: 105px; }
  #app > .mira-topbar { padding: 4px 12px; gap: 9px; }
  .mira-topbar .wordmark { font-size: 19px; }
  .mira-topbar .tagline { display: none; }
  .mira-topbar .frame-location { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; padding-inline-start: 8px; }
  .mira-topbar .identity { max-width: 23vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
  .mira-topbar button { min-height: 34px; padding: 4px 9px; font-size: 12px; }
  .workspace-layout { display: block; }
  .workspace-layout > .workspace-navigation {
    top: var(--frame-header); height: auto; width: 100%; display: grid; grid-template-columns: 1fr minmax(104px,.75fr);
    gap: 7px; align-items: center; padding: 5px 10px; border-inline: 0; border-bottom: 1px solid var(--frame-line);
    overflow: visible; background: #fbfcfa;
  }
  .workspace-navigation .nav-sections,.workspace-navigation .nav-label { display: none; }
  .workspace-navigation .nav-priority { display: flex; flex-direction: row; align-items: stretch; gap: 4px; margin: 0; }
  .workspace-navigation .nav-priority button { flex: 1 1 0; min-width: 0; width: auto; min-height: 44px; justify-content: center; font-size: 12px; padding: 5px 3px; white-space: nowrap; }
  .workspace-navigation .nav-icon { display: none; }
  .mobile-chat-shortcut { display: inline-flex; align-items: center; gap: 3px; color: var(--frame-forest); font-size: 12px; font-weight: 650; text-decoration: none; padding: 6px 2px; }
  .workspace-navigation .nav-picker { display: block; margin: 0; font-size: 10px; }
  .workspace-navigation .nav-picker select { min-height: 44px; margin: 1px 0 0; padding: 5px; font-size: 12px; background: #fff; }
  .workspace-layout > main { padding: 15px 12px; }
  .workspace-layout .chat-workspace-main { padding: 4px 8px; }
  .workspace-layout .projects-heading { align-items: flex-start; }
  .workspace-layout .projects-heading h2 { font-size: 25px; }
  .portfolio-header-actions button { min-height: 40px; font-size: 12px; }
  .portfolio-header-actions { flex-wrap: wrap; }
  .workspace-layout .project-toolbar input { max-width: none; flex: 1 1 160px; }
  .workspace-layout .project-toolbar select { max-width: 130px; }
  .workspace-layout .material-tabs { flex: 1 1 100%; flex-wrap: wrap; }
  .workspace-layout .project-toolbar .material-tabs button { flex: 0 1 auto; width: auto; font-size: 12px; min-height: 37px; padding-inline: 7px; }
  [data-portfolio-layout="list"] > .project-grid > .project-card {
    grid-template-columns: minmax(0,1fr) minmax(95px,.56fr);
    grid-template-areas: "title title" "facts facts" "dates actions" "preview preview"; padding: 12px; gap: 8px;
  }
  [data-portfolio-layout="list"] > .project-grid .project-facts { font-size: 13px; }
  [data-portfolio-layout="list"] .project-card-actions button { min-height: 44px; }
  .mira-chat-notice { inset: auto 10px max(10px,env(safe-area-inset-bottom)) 10px; max-width: none; }
}

/* Project portfolio. Keep role files, brief and preview together on small screens. */
.production-portfolio { --pc-line:#dce5df; --pc-ink:#163c31; --pc-muted:#52685c; min-width:0; }
.production-portfolio .project-phases { display:flex; flex-wrap:wrap; gap:3px; width:fit-content; max-width:100%; padding:3px; border:1px solid var(--pc-line); border-radius:13px; background:#edf2ee; }
.production-portfolio .project-phases button { min-height:40px; border:0; background:transparent; color:#40594c; font-size:14px; font-weight:600; padding:7px 14px; border-radius:10px; }
.production-portfolio .project-phases button[aria-pressed=true] { color:white; background:#255344; }
.production-portfolio .project-toolbar { position:relative; align-items:center; gap:8px; margin:10px 0 14px; }
.production-portfolio .project-toolbar > input { max-width:310px; flex:1 1 150px; margin:0; }
.production-portfolio summary { cursor:pointer; color:#335c4a; }
.production-portfolio .project-extra-filters { margin:0; padding:0; border:0; }
.production-portfolio .project-extra-filters > summary { padding:8px 4px; font-size:13px; font-weight:600; }
.production-portfolio .project-extra-filters[open] { flex-basis:100%; }
.production-portfolio .project-filter-body { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:8px; background:#f3f6f3; border:1px solid var(--pc-line); border-radius:10px; }
.production-portfolio .project-filter-body select { max-width:240px; width:auto; }
.production-portfolio .portfolio-view-tools { margin:0 0 0 auto; }
.production-portfolio .project-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,310px),1fr)); gap:12px; align-items:start; }
.production-portfolio[data-catalog-layout=list] .project-grid { grid-template-columns:minmax(0,1fr); }
.production-portfolio .project-grid > .project-card { display:flex; flex-direction:column; margin:0; border:1px solid var(--pc-line); border-radius:14px; background:#fff; box-shadow:0 2px 8px #183b2c08; overflow:hidden; }
.production-portfolio .project-grid > .project-card[hidden] { display:none; }
.production-portfolio .project-card > .project-cover { order:-1; position:relative; width:100%; height:120px; max-height:none; margin:0; background:#eaf0eb; border-bottom:1px solid var(--pc-line); }
.production-portfolio .project-card > .project-cover::before { content:"Макет"; position:absolute; top:8px; left:9px; z-index:1; pointer-events:none; padding:2px 7px; border-radius:7px; background:#fffffff2; color:#3f574b; font-size:11px; font-weight:650; }
.production-portfolio .project-card > .project-cover img { width:100%;height:100%; object-fit:contain; }
.production-portfolio .project-card > .project-cover figcaption { bottom:4px; left:7px; margin:0; padding:1px 6px; font-size:10px; line-height:1.4; border-radius:4px; }
.production-portfolio .project-card > .project-cover-empty { display:flex; flex-direction:row; justify-content:flex-start; align-items:center; height:auto; min-height:43px; padding:8px 10px 8px 65px; background:#f4f6f3; }
.production-portfolio .project-card > .project-cover-empty::before { top:50%; transform:translateY(-50%); }
.production-portfolio .project-card > .project-cover-empty p { font-size:11px; line-height:1.35; text-align:left; }
.production-portfolio .project-card-body { display:grid; min-width:0; gap:8px; padding:12px 14px; }
.production-portfolio .project-grid .project-card-body h3 { margin:0; font-size:17px; line-height:1.28; color:var(--pc-ink); overflow-wrap:anywhere; }
.production-portfolio .project-card-meta { display:flex; flex-direction:column; align-items:stretch; border:0; padding:0; background:transparent; gap:6px; }
.production-portfolio .project-status-line,.production-portfolio .project-brief-date,.production-portfolio .project-brief-line { display:grid; grid-template-columns:55px minmax(0,1fr); column-gap:7px; align-items:baseline; font-size:13px; line-height:1.35; }
.production-portfolio .project-brief-line>strong,.production-portfolio .project-status-line>span,.production-portfolio .project-brief-date>strong { font-size:12px; font-weight:600; color:var(--pc-muted); }
.production-portfolio .project-status-line strong { justify-self:start; border-radius:6px; padding:2px 7px; background:#e9f3ec; color:#245840; font-size:12px; }
.production-portfolio .project-brief-date .project-dates { display:block; margin:0; padding:0; border:0; }
.production-portfolio .project-brief-date .project-date { margin:0; font-size:12px; }
.production-portfolio .project-brief-date .project-date + .project-date { font-size:11px; color:var(--pc-muted); }
.production-portfolio .project-brief-copy { overflow:hidden; overflow-wrap:anywhere; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.production-portfolio .project-brief-line small { grid-column:2; color:var(--pc-muted); font-size:10px; }
.production-portfolio .project-role-files { display:grid; padding:4px 8px; background:#f5f8f5; border-radius:8px; }
.production-portfolio .project-role-file { display:flex; justify-content:space-between; align-items:center; gap:5px; min-height:25px; font-size:12px; color:#314b3b; }
.production-portfolio .project-role-file + .project-role-file { border-top:1px solid var(--pc-line); }
.production-portfolio .project-role-file :is(a,small) { font-size:11px; }
.production-portfolio .project-role-file a { display:inline-flex; min-height:35px; align-items:center; font-weight:650; color:#22543b; }
.production-portfolio .project-role-file small { color:var(--pc-muted); }
.production-portfolio .project-card-footer { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; }
.production-portfolio .project-card-footer > button,.production-portfolio .project-more button { width:auto; min-height:44px; padding:5px 10px; font-size:13px; }
.production-portfolio .project-card-body .project-more,.production-portfolio .source-project-setup { border:0; padding:0; margin:0; }
.production-portfolio .project-more > summary,.production-portfolio .source-project-setup > summary { padding:8px 0; font-size:12px; }
.production-portfolio .project-more[open] { flex:1 1 100%; min-width:0; }
.production-portfolio .project-more .project-facts { margin:4px 0 8px; grid-template-columns:max-content minmax(0,1fr); font-size:12px; overflow-wrap:anywhere; }
@media(max-width:600px) {
 .production-portfolio .project-phases { display:grid; width:100%; grid-template-columns:repeat(2,minmax(0,1fr)); }
 .production-portfolio .project-phases button { min-height:44px; padding:5px 2px; font-size:12px; }
 .production-portfolio .project-role-file a { min-height:44px; }
 .production-portfolio .project-extra-filters summary,.production-portfolio .project-more > summary,.production-portfolio .source-project-setup > summary { min-height:44px; align-content:center; }
}

/* A project opens on its brief; operational forms stay available on demand. */
.project-sheet { border:1px solid #d5e0d8; background:#fff; border-radius:16px; padding:clamp(12px,2vw,24px); }
.project-sheet-overview { display:grid; grid-template-columns:minmax(160px,0.8fr) minmax(0,1.2fr); gap:clamp(12px,2vw,24px); align-items:start; }
.project-sheet-overview > .project-cover { margin:0; width:100%; height:clamp(140px,19vw,250px); border-radius:10px; background:#f1f5f0; }
.project-sheet-overview .project-cover img { width:100%; height:100%; object-fit:contain; }
.project-sheet-overview > .project-cover-empty { height:auto; min-height:85px; }
.project-sheet .project-card-body { display:grid; min-width:0; gap:9px; }
.project-sheet .project-card-meta { display:grid; padding:0; margin:0; gap:7px; background:transparent; border:0; }
.project-sheet :is(.project-status-line,.project-brief-date,.project-brief-line) { display:grid; grid-template-columns:65px minmax(0,1fr); column-gap:10px; font-size:14px; }
.project-sheet :is(.project-brief-date,.project-brief-line)>strong,.project-sheet .project-status-line>span { color:#496455; font-weight:600; }
.project-sheet .project-dates,.project-sheet .project-date { margin:0; padding:0; border:0; }
.project-sheet .project-brief-line :is(small,details) { grid-column:2; }
.project-sheet .project-brief-copy { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.project-sheet .project-full-spec p { white-space:pre-wrap; overflow-wrap:anywhere; }
.project-sheet :is(.project-sheet-editor,.project-sheet-tools) { margin:12px 0 0; padding:0; border:0; border-top:1px solid #dce7df; }
.project-sheet :is(.project-sheet-editor,.project-sheet-tools)>summary { min-height:44px; align-content:center; font-weight:650; cursor:pointer; }
@media(max-width:650px){
 .project-sheet-overview { grid-template-columns:minmax(0,1fr); }
 .project-sheet-overview > .project-cover { height:140px; }
 .project-sheet-overview > .project-cover-empty { min-height:42px; height:auto; }
}

.project-sheet .project-brief-copy { display:block; }
.project-sheet .project-brief-line:has(.project-full-spec) .project-brief-copy { display:block; overflow:visible; -webkit-line-clamp:unset; }
.project-technical-facts { min-width:0; margin:10px 0; }
.project-technical-facts h3 { font-size:16px; margin:0 0 6px; }
.project-technical-fact { margin:10px 0; padding:8px 10px; border-left:3px solid #c6d8c9; background:#f5f8f4; }
.project-technical-fact h4 { margin:0 0 4px; font-size:13px; }
.project-technical-fact p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font-size:13px; line-height:1.5; }
.project-technical-facts-compact .project-technical-fact { margin:6px 0; }
.project-working-file-values { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.project-working-file-values a,.project-working-file-values small { overflow-wrap:anywhere; }
.project-sheet .project-status-line strong { justify-self:start; padding:2px 8px; border-radius:6px; background:#e9f3ec; color:#245840; }
:is(.production-portfolio,.project-sheet) .project-status-line[data-state=paused] strong { background:#fff1cf; color:#81550f; }
:is(.production-portfolio,.project-sheet) .project-status-line:is([data-state=completed],[data-state=archived]) strong { background:#e8edf0; color:#435765; }
.project-save-actions { display:flex; flex-wrap:wrap; gap:8px; grid-column:1/-1; }
@media(max-width:650px){
 .project-save-actions { position:sticky; bottom:env(safe-area-inset-bottom,0px); z-index:1; padding:6px; background:#fff; border-top:1px solid #dce7df; }
 .project-save-actions button { flex:1; min-height:44px; margin:0; }
}

.project-sheet .project-role-files { display:grid; padding:2px 10px; border-radius:8px; background:#f3f7f3; }
.project-sheet .project-role-file { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:36px; font-size:13px; }
.project-sheet .project-role-file+.project-role-file { border-top:1px solid #dce7df; }
.project-sheet .project-role-file a { display:inline-flex; align-items:center; min-height:44px; }
.project-sheet .project-role-file small { color:#536a5b; }

/* Keep the full artwork visible. The caption sits beneath it, never over dimensions or text. */
:is(.production-portfolio,.project-sheet) .project-cover:not(.project-cover-empty):has(>a) { display:grid; grid-template-rows:minmax(0,1fr) auto; height:clamp(155px,19vw,205px); background:#ecf1ed; }
:is(.production-portfolio,.project-sheet) .project-cover:not(.project-cover-empty):has(>a)::before { content:none; }
:is(.production-portfolio,.project-sheet) .project-cover:has(>a) figcaption { position:static; width:100%; max-width:none; border:0; border-radius:0; padding:4px 10px; background:#f1f5f1; color:#405b4d; font-size:11px; line-height:1.4; }
:is(.production-portfolio,.project-sheet) .project-cover[data-preview-state=ready] figcaption { color:#215438; background:#eaf5eb; }
/* Document and multi-source covers size to their text, never to an image frame. */
:is(.project-grid,.project-sheet-overview) .project-cover:is(.project-cover-document,.project-cover-sources) {
 display:block; height:auto; max-height:none; min-height:0; aspect-ratio:auto; padding:12px 14px; overflow:visible;
}
:is(.project-grid,.project-sheet-overview) .project-cover:is(.project-cover-document,.project-cover-sources)::before { content:none; }
.project-document-preview,.project-document-preview-file { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; min-width:0; }
.project-document-preview { gap:10px; }
.project-source-files { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; margin:8px 0 0; padding:0; list-style:none; }
.project-source-files li { min-width:0; margin:0; }
:is(.project-grid,.project-sheet-overview) .project-cover:is(.project-cover-document,.project-cover-sources) a {
 display:flex; align-items:center; flex:none; width:auto; height:auto; min-height:44px; margin:0; padding:5px 0;
 font-size:13px; line-height:1.45; white-space:normal; overflow-wrap:anywhere; text-underline-offset:3px;
}
:is(.project-grid,.project-sheet-overview) .project-cover:is(.project-cover-document,.project-cover-sources) p { margin:0; max-width:none; font-size:12px; line-height:1.5; }
:is(.project-grid,.project-sheet-overview) .project-cover-service.project-cover-empty { display:block; padding:12px 14px; text-align:left; }
:is(.project-grid,.project-sheet-overview) .project-cover-service.project-cover-empty::before { content:"Фото объекта"; position:static; display:block; transform:none; margin-bottom:6px; padding:0; background:none; }
:is(.production-portfolio,.project-sheet) .project-purchase-summary .project-calculation-link { grid-column:2; justify-self:start; display:inline-flex; align-items:center; min-height:36px; color:#215540; font-size:13px; font-weight:650; overflow-wrap:anywhere; text-underline-offset:3px; }
.production-portfolio .project-card-footer { border-top:1px solid var(--pc-line); padding-top:6px; }
@media(min-width:700px){
 .production-portfolio[data-catalog-layout=list] .project-grid > .project-card { display:grid; grid-template-columns:minmax(135px,24%) minmax(0,1fr); align-items:start; }
 .production-portfolio[data-catalog-layout=list] .project-grid > .project-card[hidden] { display:none; }
}
@media(max-width:650px){
 :is(.production-portfolio,.project-sheet) .project-purchase-summary .project-calculation-link { min-height:44px; }
}

/* Keep delivery and exceptions legible in cards, list and the opened project. */
.production-portfolio > .material-tabs { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0; }
.production-portfolio > .material-tabs button { width:auto; min-height:44px; padding:5px 10px; }
:is(.production-portfolio,.project-sheet) .project-brief-date .project-deadline { font-size:16px; font-weight:750; color:#183c30; }
.project-overdue,.project-complaint { --deadline-ink:#791725; --deadline-fill:#ffe1e4; }
.project-soon { --deadline-ink:#5c4100; --deadline-fill:#fff0a8; }
:is(.production-portfolio,.project-sheet) .project-brief-date .project-deadline time {
 display:inline-block; max-width:100%; border-radius:5px; padding:1px 4px;
 font-size:18px; font-weight:750; color:var(--deadline-ink,#183c30); background-color:var(--deadline-fill,transparent);
}
.project-attention { display:table; margin:3px 0; padding:3px 8px; border-radius:6px; font-size:13px; line-height:1.45; }
.project-date-basis { overflow-wrap:anywhere; }
.attention-overdue,.attention-complaint { color:#791725; background:#ffe1e4; }
.attention-soon { color:#5c4100; background:#fff0a8; }
.production-portfolio .project-grid > :is(.project-overdue,.project-complaint) { border-inline-start:5px solid #b52e40; }
.production-portfolio .project-grid > .project-soon { border-inline-start:5px solid #d4a200; }
