/* Оформление дашборда. Взято из static/gantt-projects.html один в один:
   инструмент должен выглядеть так же, как личный дашборд.
   Ниже, отдельным слоем, - только то, чего в дашборде нет: шапка инструмента,
   вкладки проектов и режим правки. */

:root {
      /* Визуальные токены унаследованы из КЭДО/kedo_roadmap.html. */
      --a: #2563eb;
      --a-bg: #eff6ff;
      --b: #7c3aed;
      --b-bg: #f5f3ff;
      --v: #0d9488;
      --v-bg: #f0fdfa;
      --g: #d97706;
      --g-bg: #fffbeb;
      --pilot: #db2777;
      --pilot-bg: #fdf2f8;
      --scale: #4338ca;
      --scale-bg: #eef2ff;
      --baseline: #16a34a;
      --baseline-bg: #f0fdf4;
      --service: #0284c7;
      --service-bg: #f0f9ff;
      --h2: #9f1239;
      --h2-bg: #fff1f2;
      --ink: #0d1326;
      --muted: #64748b;
      --line: #e7e9ee;
      --card: #ffffff;
      --bg: #f4f5f8;
      --font: "Onest", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      --shadow: 0 4px 14px -8px rgba(15, 23, 42, .16);
      --shadow-lg: 0 18px 40px -20px rgba(15, 23, 42, .34);
      --week: calc(100% / 26);
    }

    * { box-sizing: border-box; }

    body {
      min-width: 320px;
      margin: 0;
      color: var(--ink);
      background-color: var(--bg);
      background-image: radial-gradient(circle at 1px 1px, rgba(15, 23, 42, .045) 1px, transparent 0);
      background-size: 24px 24px;
      font-family: var(--font);
      line-height: 1.5;
      letter-spacing: -.005em;
      -webkit-font-smoothing: antialiased;
    }

    @keyframes fade-up {
      from { opacity: 0; transform: translateY(14px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .wrap { max-width: 1600px; margin: 0 auto; padding: 32px clamp(14px, 3vw, 32px) 64px; }
    .wrap > * { animation: fade-up .45s cubic-bezier(.22, .61, .36, 1) both; }
    .wrap > *:nth-child(2) { animation-delay: .04s; }
    .wrap > *:nth-child(3) { animation-delay: .08s; }
    .wrap > *:nth-child(n+4) { animation-delay: .12s; }
    @media (prefers-reduced-motion: reduce) { .wrap > * { animation: none; } }

    .hero {
      position: relative;
      overflow: hidden;
      padding: 42px 46px;
      border-radius: 22px;
      color: #fff;
      background:
        radial-gradient(900px 420px at 12% -30%, rgba(99, 102, 241, .32), transparent 60%),
        radial-gradient(720px 400px at 102% -10%, rgba(13, 148, 136, .26), transparent 58%),
        linear-gradient(135deg, #0b1020 0%, #121a33 100%);
      box-shadow: var(--shadow-lg);
    }

    .hero::after {
      position: absolute;
      inset: 0;
      content: "";
      pointer-events: none;
      background-image: radial-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px);
      background-size: 18px 18px;
    }

    .hero > * { position: relative; z-index: 1; }
    .gantt-hero[hidden] { display: none; }
    .kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .22em; opacity: .72; text-transform: uppercase; }
    h1 { max-width: 850px; margin: 10px 0 14px; font-size: clamp(29px, 4vw, 42px); font-weight: 800; line-height: 1.08; letter-spacing: -.025em; }
    .subtitle { max-width: 780px; margin: 0; font-size: 15px; opacity: .92; }

    .chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
    .chip {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      padding: 7px 14px;
      border: 1px solid rgba(255, 255, 255, .25);
      border-radius: 999px;
      background: rgba(255, 255, 255, .15);
      backdrop-filter: blur(6px);
      font-size: 13px;
      font-weight: 600;
    }

    .chip b { font-weight: 800; }
    main { margin-top: 26px; }

    .summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    #summary-service { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-item {
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      gap: 10px;
      min-height: 118px;
      padding: 18px 20px;
      border: 1px solid var(--line);
      border-top: 4px solid var(--accent);
      border-radius: 16px;
      background: var(--card);
      box-shadow: var(--shadow);
    }

    .summary-item.kedo { --accent: var(--a); }
    .summary-item.service { --accent: var(--service); }
    .summary-item.h2 { --accent: var(--h2); }
    .summary-item.team { --accent: var(--scale); }
    .summary-item strong { display: block; margin: 0; font-size: 15px; }
    .summary-item span { color: var(--muted); font-size: 13px; line-height: 1.45; }

    .team-section {
      margin: 22px 0 26px;
      padding: 22px;
      border: 1px solid var(--line);
      border-radius: 18px;
      background: rgba(255, 255, 255, .82);
      box-shadow: var(--shadow);
    }
    .team-section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
    .team-section-head h3 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
    .team-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
    .team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
    .team-member-card {
      display: grid;
      grid-template-columns: 40px minmax(0, 1fr);
      gap: 11px;
      align-items: start;
      min-height: 92px;
      padding: 14px;
      border: 1px solid #e5e7eb;
      border-radius: 14px;
      background: #fff;
    }
    .team-avatar {
      display: grid;
      place-items: center;
      width: 40px;
      height: 40px;
      border-radius: 12px;
      color: #1e3a8a;
      background: #dbeafe;
      font-size: 13px;
      font-weight: 800;
    }
    .team-member-card:nth-child(3n + 2) .team-avatar { color: #0f766e; background: #ccfbf1; }
    .team-member-card:nth-child(3n) .team-avatar { color: #7e22ce; background: #f3e8ff; }
    .team-member-copy { min-width: 0; }
    .team-member-copy strong { display: block; font-size: 13px; line-height: 1.28; }
    .team-member-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
    .team-member-status {
      display: inline-flex !important;
      width: fit-content;
      margin-top: 7px !important;
      padding: 3px 7px;
      border-radius: 999px;
      color: #9a3412 !important;
      background: #ffedd5;
      font-size: 10.5px !important;
      font-weight: 700;
    }

    .service-data-flow {
      position: relative;
      overflow: hidden;
      margin: 24px 0 26px;
      padding: clamp(18px, 3vw, 30px);
      border: 1px solid #cbd5e1;
      border-radius: 22px;
      background:
        radial-gradient(680px 280px at 8% 0%, rgba(14, 165, 233, .14), transparent 64%),
        radial-gradient(620px 260px at 100% 100%, rgba(16, 185, 129, .13), transparent 62%),
        linear-gradient(145deg, #f8fbff, #f7fffc);
      box-shadow: var(--shadow-lg);
    }
    .service-data-flow::before {
      position: absolute;
      inset: 0;
      content: "";
      pointer-events: none;
      opacity: .55;
      background-image: radial-gradient(rgba(15, 23, 42, .11) 1px, transparent 1px);
      background-size: 16px 16px;
      mask-image: linear-gradient(90deg, rgba(0,0,0,.45), transparent 82%);
    }
    .service-flow-head,
    .service-flow-detail { position: relative; z-index: 1; }
    .service-flow-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
    .project-documentation { margin: 26px 0; }
    .project-documentation-content { margin-top: 14px; }
    .service-flow-summary-toggle { border: 0; padding: 0; color: #0369a1; background: transparent; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
    .service-flow-summary-toggle::after { content: '›'; display: inline-block; margin-left: 5px; transition: transform .16s ease; }
    .service-flow-summary-toggle[aria-expanded="true"]::after { transform: rotate(90deg); }
    [hidden].project-documentation-content { display: none; }
    .service-flow-kicker { margin: 0 0 5px; color: #0369a1; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
    .service-flow-head h2 { margin: 0; font-size: clamp(20px, 2.4vw, 27px); line-height: 1.15; letter-spacing: -.03em; }
    .service-flow-head p:last-child { max-width: 620px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
    .service-flow-live {
      display: inline-flex;
      flex: 0 0 auto;
      align-items: center;
      gap: 7px;
      margin-top: 2px;
      padding: 7px 10px;
      border: 1px solid #a7f3d0;
      border-radius: 999px;
      color: #047857;
      background: #ecfdf5;
      font-size: 11px;
      font-weight: 800;
      white-space: nowrap;
    }
    .service-flow-live i { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16,185,129,.5); animation: service-flow-pulse 1.8s ease-out infinite; }
    .service-flow-diagram { position: relative; z-index: 1; overflow-x: auto; }
    .service-flow-diagram svg { display: block; min-width: 1150px; width: 100%; height: auto; }
    .sf-ch { font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .sf-nt { font-size: 13px; font-weight: 800; fill: var(--ink); }
    .sf-nl { font-size: 11.5px; fill: var(--muted); }
    .sf-al { font-size: 10.5px; font-weight: 700; fill: #7c8698; paint-order: stroke; stroke: rgba(248, 251, 255, .9); stroke-width: 4px; stroke-linejoin: round; }
    .sf-badge { font-size: 10px; font-weight: 800; }
    .sf-flow { fill: none; stroke: #9aa7b8; stroke-width: 1.6; }
    .sf-flow.sf-dash { stroke-dasharray: 6 5; }
    .sf-node { cursor: pointer; outline: none; }
    .sf-box { fill: #fff; stroke-width: 1.6; transition: stroke-width .18s ease, filter .18s ease; }
    .sf-node:hover .sf-box, .sf-node:focus-visible .sf-box { stroke-width: 2.6; }
    .sf-node.is-active .sf-box { stroke-width: 2.6; filter: drop-shadow(0 6px 12px rgba(15, 23, 42, .22)); }
    .service-flow-legend { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; color: var(--muted); font-size: 12px; align-items: center; }
    .service-flow-legend .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
    .service-flow-detail { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; align-items: center; margin-top: 20px; padding: 14px 16px; border: 1px solid #d9e7f4; border-radius: 14px; background: rgba(255,255,255,.7); }
    .service-flow-detail-label { margin: 0; color: #0369a1; font-size: 10.5px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
    .service-flow-detail h3 { margin: 0; font-size: 15px; }
    .service-flow-detail p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
    @keyframes service-flow-pulse { to { box-shadow: 0 0 0 7px rgba(16,185,129,0); } }

    h2.section {
      display: flex;
      align-items: center;
      gap: 12px;
      margin: 34px 0 10px;
      font-size: 21px;
      font-weight: 800;
      letter-spacing: -.02em;
    }

    h2.section .num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 30px;
      height: 30px;
      border-radius: 9px;
      background: var(--ink);
      box-shadow: var(--shadow);
      color: #fff;
      font-size: 14px;
      font-weight: 800;
    }

    .hint { margin: 0 0 16px; color: var(--muted); font-size: 13px; }

    .legend {
      display: flex;
      flex-wrap: wrap;
      gap: 10px 18px;
      margin: 0 0 14px;
      color: var(--muted);
      font-size: 12.5px;
    }

    .legend-item { display: inline-flex; align-items: center; gap: 7px; }
    .legend-swatch { width: 18px; height: 11px; border: 1px solid var(--swatch); border-radius: 4px; background: var(--swatch-bg); }
    .legend-swatch.tech { --swatch: var(--a); --swatch-bg: var(--a-bg); }
    .legend-swatch.legal { --swatch: var(--b); --swatch-bg: var(--b-bg); }
    .legend-swatch.onboarding { --swatch: var(--v); --swatch-bg: var(--v-bg); }
    .legend-swatch.optional { --swatch: var(--g); --swatch-bg: var(--g-bg); border-style: dashed; }
    .legend-swatch.service { --swatch: var(--service); --swatch-bg: var(--service-bg); }
    .legend-swatch.milestone { --swatch: var(--pilot); --swatch-bg: var(--pilot-bg); }

    .gantt-scroll {
      --today-position: 0%;
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: 16px;
      background: var(--card);
      box-shadow: var(--shadow-lg);
    }

    .gantt-board { min-width: 1280px; }
    .axis, .group-row, .work-row { display: grid; grid-template-columns: 330px minmax(0, 1fr); }

    .axis {
      position: sticky;
      top: 0;
      z-index: 4;
      border-bottom: 1px solid var(--line);
      background: var(--card);
    }

    .axis-label {
      display: flex;
      flex-direction: column;
      justify-content: center;
      min-height: 88px;
      padding: 12px 20px;
      border-right: 1px solid var(--line);
      font-size: 14px;
      font-weight: 800;
    }

    .axis-label small { margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
    .timeline-header {
      position: relative;
      display: grid;
      grid-template-columns: repeat(26, minmax(0, 1fr));
      grid-template-rows: 38px 50px;
      min-height: 88px;
      padding: 0 8px;
      overflow: hidden;
    }

    .month {
      display: flex;
      grid-row: 1;
      align-self: center;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 27px;
      margin: 5px 2px 2px;
      border: 1px solid var(--line);
      border-radius: 7px;
      background: #f1f5f9;
      color: var(--muted);
      font-size: 13px;
      font-weight: 800;
    }

    .month small { margin-left: 5px; color: #94a3b8; font-size: 11px; font-weight: 600; }
    .month.july { grid-column: 1 / 6; }
    .month.august { grid-column: 6 / 10; }
    .month.september { grid-column: 10 / 14; }
    .month.october { grid-column: 14 / 19; }
    .month.november { grid-column: 19 / 23; }
    .month.december { grid-column: 23 / 27; }

    .week {
      grid-row: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-width: 0;
      border-left: 1px solid var(--line);
      color: var(--ink);
      font-size: 12px;
      font-weight: 800;
    }

    .week:first-of-type { border-left: 0; }
    .week small { margin-top: 2px; color: #94a3b8; font-size: 9.5px; font-weight: 600; }

    .group-row { border-bottom: 1px solid var(--line); background: #f8fafc; }
    .group-title {
      display: flex;
      align-items: center;
      min-height: 48px;
      padding: 10px 20px;
      border-right: 1px solid var(--line);
      font-size: 14px;
      font-weight: 800;
    }

    .group-title span { margin-left: 8px; color: var(--muted); font-size: 12px; font-weight: 600; }
    .group-range { display: grid; grid-template-columns: repeat(26, minmax(0, 1fr)); align-items: center; padding: 0 8px; }

    .range-tag {
      display: flex;
      align-items: center;
      min-height: 27px;
      padding: 0 10px;
      border: 1px solid var(--tag);
      border-radius: 7px;
      background: var(--tag-bg);
      color: var(--tag);
      font-size: 12px;
      font-weight: 800;
    }

    .range-tag.kedo { --tag: var(--a); --tag-bg: var(--a-bg); grid-column: 1 / 14; }
    .range-tag.service-q3 { --tag: var(--service); --tag-bg: var(--service-bg); grid-column: 1 / 14; }
    .range-tag.service-h2 { --tag: var(--h2); --tag-bg: var(--h2-bg); grid-column: 14 / 27; }

    .work-row { border-bottom: 1px solid var(--line); }
    .work-row:last-child { border-bottom: 0; }
    .work-title { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 8px 20px 8px 44px; border-right: 1px solid var(--line); }
    .work-title::before { position: absolute; left: 20px; width: 11px; height: 11px; border-radius: 3px; background: var(--dot, #94a3b8); content: ""; }
    .work-title.baseline { --dot: var(--baseline); }
    .work-title.tech { --dot: var(--a); }
    .work-title.legal { --dot: var(--b); }
    .work-title.onboarding { --dot: var(--v); }
    .work-title.optional { --dot: var(--g); }
    .work-title.pilot { --dot: var(--pilot); }
    .work-title.scale { --dot: var(--scale); }
    .work-title.service { --dot: var(--service); }
    .work-title.h2 { --dot: var(--h2); }
    .work-title strong { font-size: 13px; line-height: 1.25; }
    .work-title span { margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.25; }

    .timeline-row {
      position: relative;
      display: grid;
      grid-template-columns: repeat(26, minmax(0, 1fr));
      align-items: center;
      min-height: 52px;
      padding: 0 8px;
      background-color: #fff;
      background-image:
        linear-gradient(to right, transparent calc(100% - 1px), #e9eef1 calc(100% - 1px)),
        linear-gradient(to right, transparent calc(19.23% - 1px), #d6dde4 calc(19.23% - 1px), #d6dde4 19.23%, transparent 19.23%),
        linear-gradient(to right, transparent calc(34.61% - 1px), #d6dde4 calc(34.61% - 1px), #d6dde4 34.61%, transparent 34.61%),
        linear-gradient(to right, transparent calc(50% - 1px), #d6dde4 calc(50% - 1px), #d6dde4 50%, transparent 50%),
        linear-gradient(to right, transparent calc(69.23% - 1px), #d6dde4 calc(69.23% - 1px), #d6dde4 69.23%, transparent 69.23%),
        linear-gradient(to right, transparent calc(84.61% - 1px), #d6dde4 calc(84.61% - 1px), #d6dde4 84.61%, transparent 84.61%);
      background-size: var(--week) 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    }

    .work-row:nth-of-type(even) .timeline-row { background-color: #fbfcfe; }
    .timeline-row::after { position: absolute; top: 0; bottom: 0; left: var(--today-position); width: 2px; content: ""; background: var(--ink); opacity: .38; pointer-events: none; }
    .gantt-scroll.today-out-of-range .timeline-row::after { display: none; }

    .gantt-bar {
      position: relative;
      grid-column: var(--start) / var(--end);
      z-index: 1;
      min-width: 0;
      min-height: 30px;
      padding: 5px 9px;
      overflow: hidden;
      border: 1px solid var(--bar);
      border-radius: 8px;
      background-color: transparent;
      box-shadow: 0 2px 6px -3px rgba(0, 0, 0, .22);
      color: var(--ink);
      cursor: pointer;
      font: inherit;
      font-size: 11.5px;
      font-weight: 800;
      line-height: 1.1;
      text-align: left;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .gantt-bar:hover { filter: brightness(.975); box-shadow: 0 6px 14px -7px rgba(15, 23, 42, .42); }
    .gantt-bar:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
    .gantt-bar.baseline { --bar: var(--baseline); --bar-bg: var(--baseline-bg); }
    .gantt-bar.tech { --bar: var(--a); --bar-bg: var(--a-bg); }
    .gantt-bar.legal { --bar: var(--b); --bar-bg: var(--b-bg); }
    .gantt-bar.onboarding { --bar: var(--v); --bar-bg: var(--v-bg); }
    .gantt-bar.optional { --bar: var(--g); --bar-bg: var(--g-bg); border-style: dashed; }
    .gantt-bar.pilot { --bar: var(--pilot); --bar-bg: var(--pilot-bg); }
    .gantt-bar.scale { --bar: var(--scale); --bar-bg: var(--scale-bg); }
    .gantt-bar.service { --bar: var(--service); --bar-bg: var(--service-bg); }
    .gantt-bar.h2 { --bar: var(--h2); --bar-bg: var(--h2-bg); }
    .gantt-bar[data-kedo-track] {
      padding-right: 38px;
      background: linear-gradient(
        to right,
        color-mix(in srgb, var(--bar) 82%, transparent) 0 var(--progress, 0%),
        transparent var(--progress, 0%) 100%
      );
    }

    .gantt-bar[data-kedo-track]::after {
      position: absolute;
      top: 50%;
      right: 8px;
      transform: translateY(-50%);
      content: attr(data-progress);
      color: var(--ink);
      font-size: 11px;
      font-weight: 800;
    }

    .gantt-bar[data-service-track] {
      padding-right: 38px;
      background: linear-gradient(
        to right,
        color-mix(in srgb, var(--bar) 82%, transparent) 0 var(--progress, 0%),
        transparent var(--progress, 0%) 100%
      );
    }

    .gantt-bar[data-service-track]::after {
      position: absolute;
      top: 50%;
      right: 8px;
      transform: translateY(-50%);
      content: attr(data-progress);
      color: var(--ink);
      font-size: 11px;
      font-weight: 800;
    }

    .progress-note { margin: -4px 0 12px; color: var(--muted); font-size: 12px; }

    .gantt-tabs { display: flex; gap: 8px; margin: 16px 0 20px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
    /* Вкладки проектов - пилюли по содержимому. Полоса-подложка от ганта здесь
   не нужна: с одним проектом она читается как пустая серая строка. */
.gantt-tabs.top-tabs { flex: 0 1 auto; flex-wrap: wrap; gap: var(--space-2); min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; }
.top-tabs > .gantt-tab { flex: 0 0 auto; min-height: 36px; padding: var(--space-2) var(--space-4); border-color: var(--line); background: var(--surface); }
    .top-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
    .sources-link { flex: none; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 12.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
    .sources-link:hover, .sources-link:focus-visible { border-color: var(--a); color: var(--a); }
    .gantt-tab { flex: 1; min-height: 42px; padding: 9px 14px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: transparent; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
    .gantt-tab:hover { color: var(--ink); background: #fff; }
    .gantt-tab[aria-selected="true"] { border-color: var(--a); color: var(--a); background: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .12); }
    .gantt-panel[hidden] { display: none; }
    .gantt-panel:focus { outline: 0; }
    .documentation-hub { padding: clamp(20px, 4vw, 34px); border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
    .documentation-hub > p { max-width: 720px; margin: 8px 0 0; color: var(--muted); }
    .documentation-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
    .documentation-card { min-height: 132px; padding: 18px; border: 1px solid #dbe5f0; border-radius: 14px; background: #f8fbff; }
    .documentation-card span { color: #0369a1; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
    .documentation-card h3 { margin: 8px 0 5px; font-size: 17px; }
    .documentation-card p { margin: 0; color: var(--muted); font-size: 13px; }
    .documentation-card a { color: #0369a1; font-weight: 700; word-break: break-word; }
    .documentation-card code { color: var(--ink); font-size: 12px; word-break: break-all; }
    .doc-project { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
    .doc-project-title { margin: 0; font-size: 19px; letter-spacing: -.02em; }
    .doc-project-lead { max-width: 780px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
    .doc-block { margin-top: 22px; }
    .doc-block h4 { margin: 0 0 10px; font-size: 14px; font-weight: 800; }
    .doc-block > p { max-width: 900px; margin: 0 0 10px; font-size: 13.5px; line-height: 1.55; }
    .doc-block ul { max-width: 900px; margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.5; }
    .doc-block ul + p { margin-top: 10px; }
    .doc-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 8px; max-width: none; margin: 0; padding: 0; list-style: none; }
    .doc-stages li { display: flex; gap: 9px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 12.5px; line-height: 1.35; }
    .doc-stages li b { flex: 0 0 auto; min-width: 17px; color: var(--a); font-weight: 800; }
    .doc-stages li.doc-stage-final b { color: var(--baseline); }
    .doc-stages li.doc-stage-fail b { color: #dc2626; }
    .doc-callout { max-width: 900px; margin-top: 14px; padding: 13px 16px; border: 1px solid #fde68a; border-left: 4px solid #d97706; border-radius: 10px; background: #fffbeb; font-size: 13px; line-height: 1.55; }
    .doc-callout b { color: #92400e; }
    .doc-open { max-width: 900px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; background: #f8fafc; }
    .doc-open ul { gap: 7px; font-size: 13px; }
    .gantt-board[data-active-gantt="kedo"] [data-gantt-scope="service"],
    .gantt-board[data-active-gantt="service"] [data-gantt-scope="kedo"] { display: none; }
    .service-legend { margin-bottom: 12px; }

    .wins-hero-cover { position: relative; overflow: hidden; padding: 30px; border: 0; border-radius: 18px; color: #fff; box-shadow: var(--shadow); background: radial-gradient(circle at 88% 6%, rgba(255, 214, 130, .45), transparent 30%), radial-gradient(circle at 12% 116%, rgba(219, 39, 119, .5), transparent 44%), linear-gradient(135deg, #3b1d5e 0%, #7b2d63 52%, #b8531f 100%); }
    .wins-hero-cover .kicker { margin-bottom: 9px; color: #ffd8a8; }
    .wins-hero-cover h2 { max-width: 790px; margin: 0; font-size: clamp(26px, 3.6vw, 42px); line-height: 1.05; letter-spacing: -.04em; }
    .wins-hero-cover p.hero-copy { max-width: 700px; margin: 16px 0 0; color: rgba(255,255,255,.86); font-size: 15.5px; line-height: 1.55; }
    .wins-section { margin-top: 22px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
    .wins-section > h2 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.02em; }
    .wins-section > p.wins-lead { margin: 0 0 18px; max-width: 760px; color: var(--muted); font-size: 13px; }
    .wins-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .wins-step { position: relative; padding: 17px 18px 17px 19px; border: 1px solid #f0d9c4; border-radius: 14px; background: #fffaf4; }
    .wins-step::before { position: absolute; inset: 0 auto 0 0; width: 4px; border-radius: 14px 0 0 14px; content: ""; background: #d97706; }
    .wins-step-num { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: #92400e; background: #fde8c8; font-size: 12px; font-weight: 900; }
    .wins-step h3 { margin: 11px 0 5px; font-size: 14.5px; letter-spacing: -.015em; }
    .wins-step p { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
    .wins-step .wins-step-time { display: inline-block; margin-top: 10px; padding: 2px 8px; border-radius: 999px; color: #92400e; background: #fde8c8; font-size: 11px; font-weight: 800; }
    .wins-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
    .wins-rule-card { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafc; }
    .wins-rule-card h3 { margin: 0 0 10px; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
    .wins-rule-card.do h3 { color: #15803d; }
    .wins-rule-card.dont h3 { color: #b42318; }
    .wins-rule-card ul { display: grid; gap: 7px; margin: 0; padding-left: 17px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
    .wins-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; margin-top: 16px; }
    .wins-meta span { padding: 6px 11px; border: 1px solid #e5d3bd; border-radius: 999px; color: #92400e; background: #fffaf4; font-size: 12px; font-weight: 700; }
    .wins-board { display: grid; gap: 14px; margin-top: 16px; }
    .wins-meeting { padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    .wins-meeting-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .wins-meeting-title { font-size: 14px; font-weight: 800; }
    .wins-meeting-date { color: var(--muted); font-size: 12px; font-weight: 700; }
    .wins-meeting-host { padding: 2px 9px; border-radius: 999px; color: #92400e; background: #fef3e2; font-size: 11px; font-weight: 800; }
    .wins-meeting-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
    .wins-entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
    .wins-entry { padding: 14px 15px; border: 1px solid #f0d9c4; border-radius: 12px; background: #fffaf4; }
    .wins-entry-who { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; }
    .wins-entry-who::before { content: "★"; color: #d97706; font-size: 14px; }
    .wins-entry-win { margin: 9px 0 0; font-size: 12.5px; line-height: 1.45; }
    .wins-entry-thanks { margin: 9px 0 0; padding-top: 9px; border-top: 1px dashed #e5d3bd; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .wins-entry-thanks b { color: #92400e; font-weight: 800; }
    .wins-empty { margin: 0; padding: 22px; border: 1px dashed #d9c2a8; border-radius: 14px; color: var(--muted); background: #fffaf4; font-size: 13px; line-height: 1.55; text-align: center; }

    .presentation-cover { padding: 30px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
    .portfolio-hero { position: relative; overflow: hidden; color: #fff; border: 0; background: radial-gradient(circle at 86% 8%, rgba(80, 180, 255, .42), transparent 25%), radial-gradient(circle at 18% 118%, rgba(165, 27, 74, .55), transparent 42%), linear-gradient(135deg, #080f28 0%, #122d68 55%, #253e91 100%); }
    .portfolio-hero::after { content: ''; position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 34px 34px; mask-image: linear-gradient(90deg, transparent, #000 35%, #000); pointer-events: none; }
    .portfolio-hero-content { position: relative; z-index: 1; }
    .portfolio-hero .kicker { margin-bottom: 9px; color: #b9d7ff; }
    .portfolio-hero h2 { max-width: 790px; margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.02; letter-spacing: -.045em; }
    .portfolio-hero .hero-copy { max-width: 720px; margin: 17px 0 0; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.55; }
    .portfolio-signals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 900px; margin-top: 24px; }
    .portfolio-signal { min-height: 82px; padding: 13px 14px; border: 1px solid rgba(255,255,255,.2); border-radius: 13px; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }
    .portfolio-signal span { display: block; color: #b9d7ff; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
    .portfolio-signal strong { display: block; margin-top: 6px; font-size: 14px; line-height: 1.28; }
    .presentation-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
    .presentation-link { padding: 10px 13px; border: 1px solid rgba(255,255,255,.42); border-radius: 10px; color: #fff; background: rgba(255,255,255,.11); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
    .presentation-link:hover { color: #0b1b45; background: #fff; transform: translateY(-1px); }
    .portfolio-benefit-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
    .portfolio-benefit { min-height: 120px; padding: 14px 12px; border: 1px solid #dce7fb; border-radius: 14px; background: linear-gradient(145deg, #fff, #f2f7ff); box-shadow: 0 8px 20px rgba(18, 45, 104, .08); }
    .portfolio-benefit span { display: block; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .075em; text-transform: uppercase; }
    .portfolio-benefit strong { display: block; margin-top: 10px; color: var(--a); font-size: 14px; line-height: 1.18; letter-spacing: -.02em; }
    .portfolio-benefit small { display: block; margin-top: 7px; color: var(--ink); font-size: 10px; font-weight: 700; line-height: 1.3; }
    .portfolio-benefit:nth-child(2) strong, .portfolio-benefit:nth-child(5) strong { color: var(--service); }
    .portfolio-benefit:nth-child(3) strong, .portfolio-benefit:nth-child(6) strong { color: var(--h2); }
    .portfolio-story { margin-top: 18px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow); }
    .portfolio-story-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
    .portfolio-index { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 50%; color: #fff; background: var(--a); font-size: 11px; font-weight: 900; }
    .portfolio-story .kicker { margin: 0 0 3px; }
    .portfolio-story h3 { margin: 0; font-size: 22px; letter-spacing: -.025em; }
    .portfolio-story-head > p { max-width: 500px; margin: 3px 0 0 auto; color: var(--muted); font-size: 13px; line-height: 1.45; }
    .portfolio-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
    .portfolio-project-card { position: relative; min-height: 176px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(135deg, #fff, #f8fbff); }
    .portfolio-project-card::before { content: ''; position: absolute; top: 0; right: 0; width: 88px; height: 88px; border-radius: 0 0 0 100%; opacity: .14; background: var(--a); }
    .portfolio-project-card.service-project::before { background: var(--service); }
    .portfolio-project-card .project-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--a); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
    .portfolio-project-card.service-project .project-tag { color: var(--service); }
    .portfolio-project-card h4 { max-width: 310px; margin: 9px 0; font-size: 18px; line-height: 1.17; letter-spacing: -.02em; }
    .portfolio-project-card p { max-width: 410px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.48; }
    .portfolio-project-card .project-shift { display: block; margin-top: 15px; color: var(--ink); font-size: 12px; font-weight: 800; }
    .project-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
    .project-benefit { padding: 9px; border-radius: 10px; background: #edf3ff; }
    .service-project .project-benefit { background: #e9f8ff; }
    .project-benefit b { display: block; color: var(--a); font-size: 12px; line-height: 1.18; letter-spacing: -.01em; }
    .service-project .project-benefit b { color: var(--service); }
    .project-benefit small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 800; line-height: 1.25; }
    .portfolio-path { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
    .portfolio-path::before { content: ''; position: absolute; top: 20px; right: 10%; left: 10%; height: 2px; background: linear-gradient(90deg, var(--a), var(--service), var(--h2), var(--pilot)); }
    .portfolio-step { position: relative; z-index: 1; min-height: 182px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    .portfolio-step > span { display: grid; width: 40px; height: 40px; place-items: center; border: 3px solid var(--a); border-radius: 50%; color: var(--a); background: #fff; font-size: 11px; font-weight: 900; }
    .portfolio-step:nth-child(2) > span { border-color: var(--service); color: var(--service); }
    .portfolio-step:nth-child(3) > span { border-color: var(--h2); color: var(--h2); }
    .portfolio-step:nth-child(4) > span { border-color: var(--pilot); color: #9a6700; }
    .portfolio-step h4 { margin: 14px 0 6px; font-size: 15px; }
    .portfolio-step p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
    .portfolio-destination { position: relative; overflow: hidden; color: #fff; border: 0; background: linear-gradient(135deg, #0b1535, #152962); }
    .portfolio-destination::before { content: '→'; position: absolute; top: -54px; right: 20px; color: rgba(255,255,255,.09); font-size: 230px; font-weight: 900; line-height: 1; }
    .portfolio-destination .portfolio-index { color: #0d1d4b; background: #fff; }
    .portfolio-destination .kicker { color: #b9d7ff; }
    .portfolio-destination h3 { color: #fff; }
    .portfolio-destination .portfolio-story-head > p { color: rgba(255,255,255,.72); }
    .portfolio-destination-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 12px; }
    .portfolio-destination-card { min-height: 148px; padding: 17px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.09); }
    .portfolio-destination-card span { color: #b9d7ff; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
    .portfolio-destination-card h4 { margin: 8px 0; color: #fff; font-size: 16px; line-height: 1.2; }
    .portfolio-destination-card p { margin: 0; color: rgba(255,255,255,.76); font-size: 12px; line-height: 1.46; }

    .detail-panel {
      display: grid;
      grid-template-columns: minmax(210px, .65fr) minmax(0, 2fr);
      gap: 18px;
      margin-top: 18px;
      padding: 20px 22px;
      border: 1px solid var(--line);
      border-left: 4px solid var(--pilot);
      border-radius: 16px;
      background: var(--card);
      box-shadow: var(--shadow);
    }

    .detail-panel p { margin: 0; }
    .detail-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
    .detail-title { margin-top: 5px !important; font-size: 16px; font-weight: 800; }
    .detail-copy { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
    .detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; margin: 14px 0 0; padding: 0; list-style: none; }
    .detail-list[hidden] { display: none; }
    .detail-list li { position: relative; padding-left: 17px; color: var(--ink); font-size: 12.5px; line-height: 1.35; }
    .detail-list li::before { position: absolute; left: 0; content: "•"; color: var(--pilot); font-weight: 800; }
    .detail-list li.task-completed::before { content: "✓"; color: #16a34a; }
    .detail-list li.task-open::before { content: "○"; color: var(--muted); }

    .metric-calculations {
      margin-top: 22px;
      padding: 22px;
      border: 1px solid var(--line);
      border-top: 4px solid var(--a);
      border-radius: 16px;
      background: var(--card);
      box-shadow: var(--shadow);
    }

    .metric-calculations h2 { margin: 0; font-size: 18px; }
    .metric-calculations h2 + .metric-table { margin-top: 16px; }
    .metric-calculations > p { margin: 7px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
    .metric-table { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 12px; }
    .metric-table th, .metric-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; line-height: 1.45; }
    .metric-table th { color: #fff; background: #1e40af; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
    .metric-table th:first-child { border-top-left-radius: 10px; }
    .metric-table th:last-child { border-top-right-radius: 10px; }
    .metric-table tr:last-child td { border-bottom: 0; }
    .metric-table tbody tr:nth-child(even) td { background: #f8fbff; }
    .metric-name { min-width: 165px; font-weight: 700; }
    .metric-code { display: inline-block; margin-bottom: 3px; color: var(--a); font-size: 11px; font-weight: 800; }
    .metric-target { min-width: 108px; color: var(--ink); font-weight: 700; }
    .metric-status { min-width: 175px; color: var(--muted); }
    .metric-status strong { display: block; color: #a16207; font-size: 11px; }
    .metric-status.registry strong { color: #0f766e; }

    .hero-action { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--a); color: #fff; font-size: 13px; font-weight: 800; text-decoration: none; box-shadow: 0 2px 8px rgba(37, 99, 235, .25); }
    .hero-action:hover { background: #1d4ed8; }

    .weekly-list { display: grid; gap: 12px; margin-top: 16px; }
    .weekly-item { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .weekly-item-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; }
    .weekly-item-title { font-size: 14px; font-weight: 800; }
    .weekly-item-range { color: var(--muted); font-size: 12px; font-weight: 700; }
    .weekly-current-badge { padding: 2px 10px; border-radius: 999px; color: var(--a); background: var(--a-bg); font-size: 11px; font-weight: 800; }
    .weekly-done-badge { padding: 2px 10px; border-radius: 999px; color: var(--muted); background: var(--line); font-size: 11px; font-weight: 800; }
    .weekly-note { margin: 10px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
    .weekly-item ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; line-height: 1.5; }
    .weekly-empty { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
    .weekly-subtitle { margin: 12px 0 0; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
    .weekly-columns { display: grid; gap: 10px; margin-top: 12px; }
    @media (min-width: 900px) { .weekly-columns.has-both { grid-template-columns: 1fr 1fr; align-items: start; } }
    .weekly-col { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; background: #f8fafc; }
    .weekly-col.is-done { background: #f2fbf5; border-color: #cdeed8; }
    .weekly-col-head { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
    .weekly-col.is-done .weekly-col-head { color: #15803d; }
    .weekly-col-count { padding: 1px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0; }
    .weekly-col.is-done .weekly-col-count { border-color: #cdeed8; color: #15803d; }
    .weekly-col ul { margin: 8px 0 0; }
    .weekly-col.is-done ul { list-style: none; padding-left: 2px; }
    .weekly-col.is-done ul li { position: relative; padding-left: 20px; }
    .weekly-col.is-done ul li::before { content: "✓"; position: absolute; left: 0; top: 0; color: #16a34a; font-weight: 800; }
    .weekly-col .weekly-empty { margin: 8px 0 0; font-size: 12.5px; }
    .weekly-plan li.plan-done .plan-text { color: var(--muted); text-decoration: line-through; }
    .weekly-plan li.plan-missed .plan-text { color: var(--muted); text-decoration: line-through; text-decoration-color: #dc2626; }
    .plan-mark { margin-left: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; }
    .plan-mark.is-done { color: #16a34a; }
    .plan-mark.is-missed { color: #dc2626; }
    .plan-mark.is-ongoing { color: var(--a); }
    .plan-move.is-due { background: #fff7ed; color: #b45309; }
    .plan-move { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #eef2f7; color: var(--muted); font-size: 10.5px; font-weight: 800; white-space: nowrap; }
    .plan-move.is-incoming { background: var(--a-bg); color: var(--a); }

    /* Учёт нарушений командного соглашения */
    .agreement-log { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
    .agreement-log-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
    .agreement-log-head p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 760px; }
    .agreement-tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
    .cadence-quick { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .cadence-quick-title { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; }
    .cadence-list { display: flex; flex-wrap: wrap; gap: 8px; }
    .cadence-btn { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
    .cadence-btn:hover { border-color: var(--a); color: var(--a); }
    .cadence-btn[aria-pressed="true"] { border-color: var(--a); background: var(--a-bg); color: var(--a); }
    .cadence-btn i { font-style: normal; padding: 1px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 800; }
    .cadence-btn[aria-pressed="true"] i { border-color: var(--a); color: var(--a); }
    .cadence-btn.has-misses i { background: #fef2f2; border-color: #f6c6c6; color: #b91c1c; }
    .cadence-people { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
    .cadence-people-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .cadence-person-btn { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
    .cadence-person-btn:hover { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
    .cadence-cancel { margin-left: auto; border: none; background: none; color: var(--muted); font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
    .agreement-person { display: flex; align-items: baseline; gap: 7px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 12.5px; font-weight: 700; }
    .agreement-person b { font-size: 14px; font-weight: 850; }
    .agreement-person.is-top { border-color: #f3c9a4; background: #fff7ed; color: #b45309; }
    .agreement-tally-empty { color: var(--muted); font-size: 12.5px; }
    .agreement-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
    .agreement-field { display: grid; gap: 4px; flex: 1 1 190px; }
    .agreement-field.is-narrow { flex: 0 0 150px; }
    .agreement-field.is-wide { flex: 2 1 260px; }
    .agreement-field span { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .agreement-field input, .agreement-field select { padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; font-size: 13px; }
    .agreement-add { padding: 8px 16px; border: 1px solid var(--a); border-radius: 9px; background: var(--a); color: #fff; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
    .agreement-add:hover { filter: brightness(1.06); }
    .agreement-entries { display: grid; gap: 8px; margin-top: 14px; }
    .agreement-entry { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; }
    .agreement-entry .entry-date { color: var(--muted); font-size: 12px; font-weight: 800; white-space: nowrap; }
    .agreement-entry .entry-who { font-weight: 800; }
    .agreement-entry .entry-rule { padding: 2px 9px; border-radius: 999px; background: #fef2f2; color: #b91c1c; font-size: 12px; font-weight: 700; }
    .agreement-entry .entry-rule.is-cadence { background: #fff7ed; color: #b45309; }
    .agreement-entry .entry-note { flex: 1 1 200px; color: var(--muted); font-size: 12.5px; }
    .agreement-entry .entry-remove { margin-left: auto; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
    .agreement-entry .entry-remove:hover { border-color: #dc2626; color: #dc2626; }
    .agreement-empty { padding: 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; }
    .agreement-status { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
    .agreement-status.is-error { color: #b91c1c; font-weight: 700; }

    .metric-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    /* нижние плашки в одном стиле с «Командным соглашением» */
    .link-section .section-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
    .link-section .section-toggle:hover .link-section-title { color: var(--a); }
    .link-section-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
    .link-section-note { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 780px; }
    .link-section .section-chevron { transform: rotate(-45deg); }
    .link-section .section-toggle[aria-expanded="true"] .section-chevron { transform: rotate(45deg); }
    .metric-cta-btn { padding: 9px 16px; border: 1px solid var(--a); border-radius: 999px; background: var(--a-bg); color: var(--a); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
    .metric-cta-btn:hover, .metric-cta-btn:focus-visible { background: var(--a); color: #fff; outline: none; }
    .metric-cta-note { flex: 1 1 260px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

    /* Чек-лист готовности сотрудников к КЭДО */
    .staff-back-row { margin-bottom: 12px; }
    .staff-back { padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
    .staff-back:hover, .staff-back:focus-visible { border-color: var(--a); color: var(--a); outline: none; }
    .staff-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 18px; }
    .staff-stat { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .staff-stat span { display: block; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
    .staff-stat strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 850; letter-spacing: -.02em; }
    .staff-stat small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
    .staff-stat .staff-bar { margin-top: 8px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
    .staff-stat .staff-bar i { display: block; height: 100%; border-radius: 99px; background: var(--a); }
    .staff-stat.is-total strong { color: var(--a); }
    .staff-stat.is-warn strong { color: #b45309; }

    .staff-controls { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
    .staff-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
    .staff-filter-label { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
    .staff-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .staff-chip { padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
    .staff-chip[aria-pressed="true"] { border-color: var(--a); background: var(--a-bg); color: var(--a); }
    .staff-chip b { margin-left: 5px; font-weight: 800; opacity: .7; }
    .staff-search { display: flex; align-items: center; gap: 8px; }
    .staff-search input { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; min-width: 220px; }
    .staff-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; }
    .staff-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
    .staff-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
    .staff-btn:hover { border-color: var(--a); color: var(--a); }
    .staff-btn.is-danger:hover { border-color: #dc2626; color: #dc2626; }
    .staff-saved { margin: 0; color: var(--muted); font-size: 12px; }
    .staff-saved.is-active { color: #15803d; font-weight: 700; }

    .staff-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .staff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .staff-table th { position: sticky; top: 0; z-index: 1; padding: 10px 8px; border-bottom: 1px solid var(--line); background: #f8fafc; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-align: center; white-space: nowrap; }
    .staff-table th.staff-col-fio { text-align: left; }
    .staff-table td { padding: 9px 8px; border-bottom: 1px solid #f1f5f9; text-align: center; vertical-align: middle; }
    .staff-table tbody tr:hover { background: #fbfdff; }
    .staff-table tbody tr.is-complete { background: #f5fbf7; }
    .staff-col-num { width: 42px; color: var(--muted); }
    .staff-col-fio { text-align: left; min-width: 240px; }
    .staff-col-step { width: 92px; }
    .staff-col-progress { width: 120px; }
    .staff-dep-row td { padding: 9px 12px; background: #eef2f7; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
    .staff-dep-row td span { margin-left: 8px; color: var(--muted); font-weight: 700; text-transform: none; letter-spacing: 0; }
    .staff-fio { display: block; font-weight: 700; }
    .staff-position { display: block; color: var(--muted); font-size: 11.5px; }
    .staff-flags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
    .staff-flag { padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 800; }
    .staff-flag.is-button { background: #fef2f2; color: #b91c1c; }
    .staff-flag.is-note { background: #fff7ed; color: #b45309; }
    .staff-flag.is-absent { background: #eef2f7; color: var(--muted); }
    .staff-table input[type="checkbox"] { width: 17px; height: 17px; accent-color: #16a34a; cursor: pointer; }
    .staff-progress { display: flex; align-items: center; justify-content: center; gap: 7px; }
    .staff-progress i { display: block; width: 46px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
    .staff-progress i b { display: block; height: 100%; background: #16a34a; }
    .staff-progress span { color: var(--muted); font-size: 11.5px; font-weight: 800; }
    .staff-empty { margin: 14px; color: var(--muted); font-size: 13px; }
    .staff-source { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
    .staff-source code { padding: 1px 5px; border-radius: 5px; background: #f1f5f9; font-size: 11.5px; }

    /* Заявки ИУ: собственная доска Ганта (ось сентябрь 2025 - сентябрь 2026, 26 полумесяцев) и доска пилота */
    .iu-gantt .timeline-row { background-image: linear-gradient(to right, transparent calc(100% - 1px), #e9eef1 calc(100% - 1px)); background-size: var(--week) 100%; }
    .iu-gantt .gantt-bar { padding-right: 40px; background: linear-gradient(to right, color-mix(in srgb, var(--bar) 82%, transparent) 0 var(--progress, 0%), var(--bar-bg) var(--progress, 0%) 100%); }
    .iu-gantt .gantt-bar::after { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); content: attr(data-progress); color: var(--ink); font-size: 11px; font-weight: 800; }
    .iu-gantt .gantt-bar.iu-progress { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bar) 32%, transparent) 0 6px, color-mix(in srgb, var(--bar) 10%, transparent) 6px 12px); }
    .iu-gantt .gantt-bar.iu-upcoming { border-style: dashed; background: transparent; box-shadow: none; color: var(--muted); }
    .iu-gantt .gantt-bar.iu-upcoming::after { color: var(--muted); font-weight: 700; }
    .gantt-bar.iu-problem { --bar: #dc2626; --bar-bg: #fef2f2; }
    .legend-swatch.iu-problem { --swatch: #dc2626; --swatch-bg: #fef2f2; }
    .legend-swatch.iu-status-done { border-color: var(--a); background: color-mix(in srgb, var(--a) 82%, transparent); }
    .legend-swatch.iu-status-progress { border-color: var(--a); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--a) 32%, transparent) 0 4px, color-mix(in srgb, var(--a) 10%, transparent) 4px 8px); }
    .legend-swatch.iu-status-upcoming { border-style: dashed; border-color: var(--muted); background: transparent; }
    .range-tag.iu-2025 { --tag: var(--pilot); --tag-bg: var(--pilot-bg); grid-column: 1 / 9; }
    .range-tag.iu-2026 { --tag: var(--scale); --tag-bg: var(--scale-bg); grid-column: 9 / 27; }
    .iu-participants { margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }
    .iu-participants b { color: var(--ink); }
    .iu-pilot-scroll { overflow-x: auto; padding-bottom: 4px; }
    .iu-pilot-lane { margin-top: 6px; }
    .iu-pilot-lane h3 { margin: 12px 0 10px; font-size: 14px; }
    .iu-pilot-grid { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 12px; min-width: 900px; }
    .iu-pilot-stage-title { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
    .iu-pilot-card { margin-bottom: 8px; padding: 10px 12px; border: 1px solid #bbf7d0; border-radius: 10px; background: #f0fdf4; font-size: 12px; line-height: 1.4; }
    .iu-team-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
    .iu-team-card { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    .iu-team-card h3 { margin: 0 0 8px; font-size: 13px; }
    .iu-team-card ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13px; line-height: 1.45; }
    .iu-team-chips { display: flex; flex-wrap: wrap; gap: 8px; }
    .iu-team-chips span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #f8fafc; font-size: 12px; font-weight: 700; }

    .collapsible-section .section-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
    .collapsible-section .section-toggle:hover { color: var(--a); }
    .section-chevron { flex: 0 0 auto; width: 9px; height: 9px; margin-right: 5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; }
    .collapsible-section.is-collapsed .section-chevron { transform: rotate(-45deg); }
    .section-body { margin-top: 14px; }
    .metric-calculations .section-body > p { margin: 7px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }

    .okr-goals {
      margin-top: 34px;
      padding: 26px;
      border: 1px solid var(--line);
      border-top: 5px solid var(--scale);
      border-radius: 20px;
      background: linear-gradient(135deg, #fff 0%, #f7f6ff 100%);
      box-shadow: var(--shadow-lg);
    }
    .okr-goals-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
    .okr-kicker { margin: 0 0 5px; color: var(--scale); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
    .okr-goals h2 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
    .okr-deadline { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #c7d2fe; border-radius: 12px; color: #3730a3; background: #eef2ff; font-size: 11px; }
    .okr-deadline span, .okr-deadline strong { display: block; }
    .okr-deadline strong { margin-top: 2px; font-size: 13px; }
    .okr-goal { margin-top: 18px; padding: 17px 19px; border: 1px solid #ddd6fe; border-radius: 15px; background: #fff; }
    .okr-goal h3 { margin: 0; color: var(--scale); font-size: 13px; }
    .okr-goal p { max-width: 980px; margin: 7px 0 0; color: var(--ink); font-size: 15px; line-height: 1.5; }
    .okr-group-title { margin: 22px 0 10px; font-size: 15px; font-weight: 800; }
    .okr-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
    .okr-metric { position: relative; min-height: 142px; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
    .okr-metric.has-kr-progress h4 { padding-right: 52px; }
    .kr-progress { position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 999px; color: var(--a); background: var(--a-bg); font-size: 12px; font-weight: 800; cursor: help; }
    .kr-progress.is-manual::after { content: "•"; margin-left: 4px; color: #b45309; }
    .kr-progress-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
    .okr-metric.primary { border-top: 4px solid var(--scale); }
    .okr-metric.balance { border-top: 4px solid var(--pilot); }
    .okr-code { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
    .okr-metric h4 { margin: 6px 0 11px; font-size: 13px; line-height: 1.32; }
    .okr-indicator { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: #312e81; background: #eef2ff; font-size: 13px; font-weight: 800; }
    .okr-metric.balance .okr-indicator { color: #9f1239; background: #fff1f2; }
    .okr-status { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
    .service-period-tabs { display: inline-flex; gap: 5px; margin-top: 16px; padding: 4px; border: 1px solid #c7d2fe; border-radius: 12px; background: #eef2ff; }
    .service-period-button { min-width: 62px; padding: 8px 12px; border: 0; border-radius: 8px; color: #4338ca; background: transparent; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
    .service-period-button:hover { background: #e0e7ff; }
    .service-period-button:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
    .service-period-button[aria-selected="true"] { color: #fff; background: #4338ca; box-shadow: 0 2px 5px rgba(67, 56, 202, .25); }
    .service-period-panel[hidden], [data-service-period-value][hidden] { display: none; }

    .notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
    .note { padding: 18px 20px; border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
    .note.boundary { --accent: var(--a); }
    .note.update { --accent: var(--v); }
    .note h2 { margin: 0 0 8px; font-size: 15px; }
    .note p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

    @media (max-width: 760px) {
      .wrap { padding-top: 14px; }
      .hero { padding: 28px 22px; border-radius: 16px; }
      .hero h1 { font-size: 27px; }
      .summary, .notes, .detail-panel, .detail-list { grid-template-columns: 1fr; }
      #summary-service { grid-template-columns: 1fr; }
      .team-section { padding: 18px 14px; }
      .team-section-head { display: grid; gap: 4px; }
      .team-grid { grid-template-columns: 1fr; }
      .service-data-flow { margin-right: -2px; margin-left: -2px; padding: 18px 14px; border-radius: 18px; }
      .service-flow-head { display: block; }
      .service-flow-live { margin-top: 12px; }
      .service-flow-diagram svg { min-width: 900px; }
      .service-flow-detail { grid-template-columns: 1fr; gap: 7px; }
      .documentation-grid { grid-template-columns: 1fr; }
      .okr-goals { padding: 20px 14px; }
      .okr-goals-head { display: grid; gap: 12px; }
      .okr-deadline { width: fit-content; }
      .okr-metrics { grid-template-columns: 1fr; }
      .gantt-scroll { margin: 0 -14px; border-right: 0; border-left: 0; border-radius: 0; }
      .gantt-tabs { overflow-x: auto; }
      .gantt-tab { flex: 0 0 auto; min-width: 150px; }
      .metric-calculations { padding: 18px 14px; }
      .metric-table, .metric-table tbody, .metric-table tr, .metric-table td { display: block; width: 100%; }
      .metric-table thead { display: none; }
      .metric-table tr { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
      .metric-table tr:first-child { margin-top: 0; }
      .metric-table td { display: grid; grid-template-columns: minmax(92px, .45fr) minmax(0, 1fr); gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); }
      .metric-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
      .metric-table tr:last-child td { border-bottom: 1px solid var(--line); }
      .metric-table tr:last-child td:last-child { border-bottom: 0; }
      .presentation-cover { padding: 22px; }
      .wins-hero-cover { padding: 22px; }
      .wins-steps, .wins-rules { grid-template-columns: 1fr; }
      .wins-entries { grid-template-columns: 1fr; }
      .portfolio-hero h2 { font-size: 30px; }
      .portfolio-signals, .portfolio-pair, .portfolio-destination-grid { grid-template-columns: 1fr; }
      .portfolio-benefit-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .portfolio-story-head { display: block; }
      .portfolio-story-head > p { margin: 10px 0 0 48px; }
      .portfolio-path { grid-template-columns: 1fr 1fr; }
      .portfolio-path::before { display: none; }
    }

    @media (prefers-reduced-motion: reduce) {
      .service-flow-live i { animation: none; }
      .service-flow-map .flow-packet { display: none; }
      .sf-box { transition: none; }
    }

/* Размеры для элементов инструмента, которых в дашборде нет: шапка, кнопки,
   поля правки. Оформление самой страницы живёт на токенах дашборда выше. */
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --text-title: 28px;
  --text-head: 20px;
  --text-base: 15px;
  --text-small: 13px;
  --text-label: 12px;
  --radius-card: 12px;
  --radius-small: 8px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px rgba(15, 23, 42, .05);
  --surface: var(--card);
  --ink-muted: var(--muted);
  --accent: var(--a);
  --accent-bg: var(--a-bg);
  --ok: #15803d;
  --ok-bg: #f0fdf4;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --risk: #be123c;
  --risk-bg: #fff1f2;
  --content-max: 1600px;
}

/* ======================================================================
   Слой инструмента: шапка, вкладки проектов, режим правки.
   Оформление страницы выше не переопределяется - здесь только то,
   чего в дашборде не существует.
   ====================================================================== */

/* Кнопка добавления чипа подписана словом, поэтому ширина у неё по содержимому,
   а не квадрат в 24 пикселя: иначе подпись вылезает на соседний чип. */

.chips > .icon-btn.add {
  width: auto;
  height: auto;
  padding: var(--space-2) var(--space-3);
  border-color: rgba(255, 255, 255, .25);
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  font-size: var(--text-small);
  font-weight: 600;
}

.chips > .icon-btn.add:hover { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .28); color: #fff; }

/* Кнопка удаления стоит в углу карточки и в просмотре места не занимает. */

/* Карточке нужен якорь: в дашборде она без position, там удалять нечего. */
.team-member-card { position: relative; }
.team-member-card > .icon-btn { position: absolute; top: var(--space-2); right: var(--space-2); }

body.editing .team-member-copy { padding-right: var(--space-6); }

/* ======================================================================
   Режим редактирования и элементы управления инструмента.
   Всё, что ниже, добавлено к перенесённому оформлению и не меняет вид
   страницы при выключенном редактировании.
   ====================================================================== */

.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.app-bar-title {
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  font-weight: 800;
  letter-spacing: -.01em;
}

.app-bar-title small {
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 600;
}

/* Кнопки прижаты к правому краю, между ними один отступ. */

.app-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-left: auto;
}

/* Кнопка, выбор роли и переключатель одной высоты: ряд читается как ряд. */

.app-btn {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.app-btn:hover { border-color: var(--a); background: var(--a-bg); }

.app-btn:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }

.app-btn.danger:hover { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }

.switch {
  display: inline-flex;
  height: 36px;
  gap: var(--space-2);
  align-items: center;
  font-size: var(--text-small);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.switch i {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #d5d9e2;
  transition: background .18s ease;
}

.switch i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .3);
  transition: transform .18s ease;
}

.switch input:checked + i { background: var(--a); }

.switch input:checked + i::after { transform: translateX(18px); }

.switch input:focus-visible + i { outline: 2px solid var(--a); outline-offset: 2px; }

/* Элементы, которые существуют только в режиме редактирования. */

.edit-only { display: none; }

body.editing .edit-only { display: inline-flex; }

/* Вне правки страница читается как документ: ни кнопок удаления, ни полей,
   ни выпадающих списков. Скрытие идёт через body:not(.editing), а не через
   класс edit-only, чтобы в режиме правки у каждого элемента остался его
   собственный display: у полей настроек он блочный, у кнопок строчный.

   Текстовые data-edit сюда не попадают намеренно: это сам текст страницы,
   он виден всегда и правится по месту. */

body:not(.editing) .icon-btn,
body:not(.editing) select[data-edit],
body:not(.editing) input[data-edit] { display: none; }

body.editing .edit-only.block { display: block; }

body.editing .edit-only.grid { display: grid; }

/* Правимое место видно по лёгкой заливке, а не по пунктиру вокруг каждого
   слова: пунктир по всей странице рябил и мешал читать текст, ради которого
   страницу и открывают. Рамка рисуется внутрь, поэтому строки не разъезжаются. */
body.editing [data-edit] {
  border-radius: var(--radius-small);
  outline: none;
  background: rgba(37, 99, 235, .06);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .16);
  cursor: text;
  transition: background .15s ease, box-shadow .15s ease;
}

body.editing [data-edit]:hover {
  background: rgba(37, 99, 235, .11);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .38);
}

body.editing [data-edit]:focus {
  outline: none;
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--a);
}

/* Заголовок проекта лежит на тёмном: там синяя заливка не видна. */
body.editing .hero [data-edit] {
  background: rgba(255, 255, 255, .10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

body.editing .hero [data-edit]:hover {
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .45);
}

body.editing .hero [data-edit]:focus {
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px #fff;
}

body.editing [data-edit]:empty::before { content: attr(data-placeholder); color: var(--muted); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: var(--text-base);
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover { border-color: #dc2626; color: #b91c1c; background: #fef2f2; }

.icon-btn.add:hover { border-color: var(--a); color: var(--a); background: var(--a-bg); }

.icon-btn:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }

.add-row {
  display: none;
  margin-top: 10px;
}

body.editing .add-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Пустое состояние: первый экран, когда проектов ещё нет. */

.empty-state {
  margin: 40px auto;
  max-width: 640px;
  padding: 36px 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow);
}

.empty-state h2 { margin: 0 0 10px; font-size: var(--text-head); }

.empty-state p { margin: 0 auto 18px; max-width: 460px; color: var(--muted); }

.empty-state .app-btn { font-size: var(--text-base); padding: 10px 18px; }

/* Настройки проекта. */

.project-settings {
  display: none;
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.project-settings.open { display: block; }

.project-settings h3 { margin: 0 0 14px; font-size: var(--text-base); }

.settings-grid {
  display: grid;
  gap: 12px 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.settings-field { display: grid; gap: 5px; }

.settings-field > span { color: var(--muted); font-size: var(--text-label); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }

.settings-field input[type="date"],
.settings-field input[type="text"],
.settings-field input[type="number"],
.settings-field select,
.metric-edit input,
.metric-edit select {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-small);
}

.settings-field input:focus,
.settings-field select:focus,
.metric-edit input:focus,
.metric-edit select:focus { outline: 2px solid var(--a); outline-offset: 1px; }

.settings-check { display: flex; gap: 8px; align-items: center; font-size: var(--text-small); }

/* Тумблер вкладок проектов: кнопка добавления рядом с вкладками. */

.top-bar .tab-add { margin-left: var(--space-1); }

/* Прогресс показателя: цель стоит плашкой, факт - подписью под ней.
   Две плашки подряд читались как два равных значения. */

.metric-progress {
  align-self: flex-start;
  display: inline-flex;
  gap: var(--space-1);
  align-items: baseline;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 600;
}

.metric-progress.empty { background: transparent; color: var(--muted); }

.metric-progress small { font-size: var(--text-label); font-weight: 700; opacity: .75; }

.metric-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: #eceff4;
  overflow: hidden;
}

.metric-bar i { display: block; height: 100%; border-radius: 999px; background: var(--a); }

/* Панель полей показателя, видна только в режиме редактирования. */

.metric-edit {
  display: none;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

/* Внутри формы теперь свой заголовок, сетка полей и пояснение, поэтому сам
   блок обычный, а колонки задаёт .metric-edit-grid. Иначе заголовок вставал
   в первую колонку, а поля разъезжались вокруг него. */
body.editing .metric-edit { display: block; }

.metric-edit label { display: grid; gap: 4px; min-width: 0; font-size: var(--text-label); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

/* Поля не должны вылезать за карточку: у элемента сетки минимальная ширина
   по умолчанию равна содержимому, из-за чего строка распирала карточку
   и вся страница начинала ездить вбок. */
.metric-edit input,
.metric-edit select,
.gt-work-edit input,
.gt-work-edit select { width: 100%; min-width: 0; }

.gt-work-edit label { min-width: 0; }

/* Плашка «сохранено». */

.save-hint {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  padding: 9px 14px;
  border-radius: 10px;
  background: rgba(13, 19, 38, .9);
  color: #fff;
  font-size: var(--text-label);
  font-weight: 600;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}

.save-hint.show { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .app-bar { position: static; }
  .metric-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Пункты плана недели. */

.plan-list { margin: 8px 0 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }

.plan-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: baseline;
  font-size: var(--text-small);
  line-height: 1.5;
}

.plan-item > [data-edit], .plan-item > span:not(.plan-tag):not(.plan-mark) { flex: 1 1 200px; }

.plan-item.is-done .plan-mark { border-color: #86d3a3; background: #f2fbf5; color: #15803d; }

.plan-item.is-missed .plan-mark { border-color: #f0b4b4; background: #fef2f2; color: #b91c1c; }

.plan-item.is-ongoing .plan-mark { border-color: #b6c8f5; background: var(--a-bg); color: var(--a); cursor: default; }

.plan-item.is-done > [data-edit] { color: var(--muted); text-decoration: line-through; }

.plan-item.is-missed > [data-edit] { color: var(--muted); text-decoration: line-through; }

.plan-item.is-spanned { opacity: .85; }

.plan-tag {
  flex: 0 0 auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 800;
  letter-spacing: .01em;
}

.plan-tag.carried { background: var(--g-bg); color: var(--g); }

.plan-tag.ongoing { background: var(--a-bg); color: var(--a); }

.plan-tag.from { background: #f1f3f7; }

.plan-span { display: none; font-size: var(--text-label); padding: 2px 4px; border: 1px solid var(--line); border-radius: 7px; }

body.editing .plan-span { display: inline-block; }

.weekly-item .add-row { margin-top: 8px; }

.weekly-item .add-row .app-btn { font-size: var(--text-label); padding: 5px 10px; }

body.editing .view-only { display: none; }

.doc-controls { gap: 4px; margin-bottom: 8px; }

body.editing .doc-controls { display: flex; }

.doc-block .add-row .app-btn { font-size: var(--text-label); padding: 5px 10px; }

.wins-entry p { margin: 8px 0 0; font-size: var(--text-small); line-height: 1.5; }

.wins-label { display: block; color: var(--muted); font-size: var(--text-label); font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* Модальное окно выбора сотрудников. */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 19, 38, .45);
}

.modal-box {
  width: min(560px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.modal-head h3 { margin: 0 0 4px; font-size: var(--text-head); }

.modal-head p { margin: 0; color: var(--muted); font-size: var(--text-small); }

.modal-search {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  font-size: var(--text-small);
}

.modal-search:focus { outline: 2px solid var(--a); outline-offset: 1px; }

.modal-list { overflow-y: auto; display: grid; gap: 2px; padding-right: 4px; }

.modal-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.modal-row:hover { background: var(--a-bg); }

.modal-row span { display: grid; }

.modal-row small { color: var(--muted); font-size: var(--text-label); }

.modal-foot { display: flex; gap: 8px; justify-content: flex-end; }

.modal-box > p { margin: 0; white-space: pre-line; font-size: var(--text-small); line-height: 1.5; }

/* Роли: выбор «кто я» и отметка роли. */

.whoami { display: flex; gap: var(--space-2); align-items: center; font-size: var(--text-small); font-weight: 600; }

/* Кто я и признак роли - одна группа, кнопки - другая: между ними черта. */

.app-bar-actions .switch { padding-left: var(--space-4); border-left: 1px solid var(--line); }

.whoami > span { color: var(--muted); }

.whoami select {
  height: 36px;
  padding: 0 var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-small);
}

.whoami select:focus { outline: 2px solid var(--a); outline-offset: 1px; }

.role-badge {
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  background: #f1f3f7;
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 800;
}

.role-badge.role-admin { background: var(--b-bg); color: var(--b); }

.role-badge.role-lead { background: var(--a-bg); color: var(--a); }

.role-badge.role-member { background: var(--baseline-bg); color: var(--baseline); }

.role-chip {
  align-self: start;
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--a-bg);
  color: var(--a);
  font-size: var(--text-label);
  font-weight: 800;
}

.switch input:disabled + i { opacity: .45; }

.switch:has(input:disabled) { cursor: not-allowed; color: var(--muted); }

/* В правке карточка обрастает полями, и без выравнивания ряд разъезжается:
   у одного должность в строку, у другого в три. */
.team-member-card { height: 100%; align-items: stretch; }

/* Текстовая часть растягивается на всю карточку: тогда выбор роли стоит
   у нижнего края одинаково во всех карточках ряда, а не пляшет по высоте
   вслед за длиной должности. */
.team-member-copy { display: flex; flex-direction: column; gap: 4px; height: 100%; }
/* Выбор роли лежит в обёртке .edit-only, поэтому к низу прижимается она,
   а не сам список: иначе выравнивание молча не срабатывает. */
.team-member-copy > .edit-only { margin-top: auto; }

.team-member-card select {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  font-size: var(--text-label);
}

/* Гант: сетка недель, дорожки, полосы работ. */

.gt-block { padding-bottom: var(--space-4); }

.gt-scroll {
  margin-top: var(--space-4);
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.gt-board { min-width: 720px; }

.gt-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}

.gt-row:last-child { border-bottom: 0; }

.gt-head-row { position: sticky; top: 0; z-index: 3; background: var(--card); }

/* Колонка дорожек не уезжает при горизонтальной прокрутке: без этого
   на длинном проекте видно полосы, но не видно, к какой дорожке они относятся.
   Фон непрозрачный, иначе полосы просвечивают сквозь названия. */

.gt-row-label {
  position: sticky;
  left: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-right: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--text-small);
  font-weight: 700;
}

/* Угол шапки перекрывает и названия дорожек, и подписи недель. */

.gt-head-row .gt-row-label { z-index: 4; background: var(--card); }

.gt-swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--a); }

.gt-head { display: grid; grid-auto-rows: 26px 34px; padding: 4px 6px 6px; }

.gt-month {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 2px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 800;
}

.gt-week {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--line);
  font-size: var(--text-label);
  font-weight: 800;
}

.gt-week:first-of-type { border-left: 0; }

.gt-week small { color: var(--muted); font-size: var(--text-label); font-weight: 600; }

.gt-lane {
  display: grid;
  grid-auto-rows: minmax(30px, auto);
  gap: var(--space-1);
  padding: var(--space-2);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px);
  background-size: calc(100% / var(--weeks, 12)) 100%;
}

.gt-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--a);
  border-radius: var(--radius-small);
  background: var(--a-bg);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.gt-bar span { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gt-fill { position: absolute; inset: 0 auto 0 0; background: var(--a); opacity: .18; }

.gt-bar.is-selected { box-shadow: 0 0 0 2px var(--a); }

.gt-bar:focus-visible, .gt-milestone:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }

.gt-milestone {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 800;
  cursor: pointer;
}

.gt-milestone i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  transform: rotate(45deg);
  border: 2px solid var(--a);
  background: #fff;
}

.gt-milestone.is-selected i { background: var(--a); }

.gt-milestone span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gt-row.track-a .gt-swatch, .gt-row.track-a .gt-milestone i { background: var(--a); border-color: var(--a); }

.gt-row.track-a .gt-bar { border-color: var(--a); background: var(--a-bg); }

.gt-row.track-a .gt-fill { background: var(--a); }

.gt-row.track-b .gt-swatch { background: var(--b); }

.gt-row.track-b .gt-bar { border-color: var(--b); background: var(--b-bg); }

.gt-row.track-b .gt-fill, .gt-row.track-b .gt-milestone i { background: var(--b); border-color: var(--b); }

.gt-row.track-v .gt-swatch { background: var(--v); }

.gt-row.track-v .gt-bar { border-color: var(--v); background: var(--v-bg); }

.gt-row.track-v .gt-fill, .gt-row.track-v .gt-milestone i { background: var(--v); border-color: var(--v); }

.gt-row.track-g .gt-swatch { background: var(--g); }

.gt-row.track-g .gt-bar { border-color: var(--g); background: var(--g-bg); }

.gt-row.track-g .gt-fill, .gt-row.track-g .gt-milestone i { background: var(--g); border-color: var(--g); }

.gt-row.track-pilot .gt-swatch { background: var(--pilot); }

.gt-row.track-pilot .gt-bar { border-color: var(--pilot); background: var(--pilot-bg); }

.gt-row.track-pilot .gt-fill, .gt-row.track-pilot .gt-milestone i { background: var(--pilot); border-color: var(--pilot); }

.gt-row.track-scale .gt-swatch { background: var(--scale); }

.gt-row.track-scale .gt-bar { border-color: var(--scale); background: var(--scale-bg); }

.gt-row.track-scale .gt-fill, .gt-row.track-scale .gt-milestone i { background: var(--scale); border-color: var(--scale); }

.gt-row.track-baseline .gt-swatch { background: var(--baseline); }

.gt-row.track-baseline .gt-bar { border-color: var(--baseline); background: var(--baseline-bg); }

.gt-row.track-baseline .gt-fill, .gt-row.track-baseline .gt-milestone i { background: var(--baseline); border-color: var(--baseline); }

.gt-row.track-service .gt-swatch { background: var(--service); }

.gt-row.track-service .gt-bar { border-color: var(--service); background: var(--service-bg); }

.gt-row.track-service .gt-fill, .gt-row.track-service .gt-milestone i { background: var(--service); border-color: var(--service); }

.gt-works-edit { display: none; margin-top: 14px; gap: 10px; }

body.editing .gt-works-edit.block { display: grid; }

.gt-work-edit {
  display: grid;
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.gt-work-edit label { display: grid; gap: 4px; font-size: var(--text-label); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }

.gt-work-edit input, .gt-work-edit select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: var(--text-label); }

/* Колонки по смыслу поля, а не поровну: раньше название работы жалось до
   «Настройка портала и шабло...», а под двузначный процент уходила
   четверть строки. */
.gt-work-edit {
  grid-template-columns:
    minmax(200px, 2.6fr)   /* работа */
    minmax(140px, 1.4fr)   /* дорожка */
    minmax(90px, .8fr)     /* вид */
    minmax(130px, 1.1fr)   /* с недели */
    minmax(130px, 1.1fr)   /* по неделю */
    minmax(90px, .7fr)     /* выполнено */
    auto;                  /* удалить */
}

.gt-work-edit input, .gt-work-edit select { font-size: var(--text-small); }

.gt-work-edit .icon-btn { align-self: end; }

.detail-meta { margin: 4px 0 10px; color: var(--muted); font-size: var(--text-label); font-weight: 700; }

@media (max-width: 760px) {
  .gt-row { grid-template-columns: 140px minmax(0, 1fr); }
  .gt-work-edit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Перетаскивание строк. */

.drag-handle {
  flex: 0 0 auto;
  padding: 0 4px;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.drag-handle:hover { color: var(--a); }

.drag-handle:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; border-radius: 4px; }

.is-dragging { opacity: .5; }

.is-drop-target { outline: 2px dashed var(--a); outline-offset: 2px; }

[data-sortable] > [data-sort-index] { position: relative; }

/* Ручка и крестик в карточке показателя выносятся в угол,
   чтобы не разрывать строку с кодом KR. */

.okr-metric > .drag-handle { position: absolute; top: 11px; right: 36px; }

.okr-metric > .icon-btn { position: absolute; top: 8px; right: 8px; }

.metric-table td .drag-handle { margin-right: 6px; }

.doc-controls .drag-handle { margin-right: auto; }

/* Имя вошедшего: в серверном режиме стоит на месте выбора «кто я». */
.whoami-name { font-size: var(--text-small); font-weight: 700; }

/* Страница входа: одна мысль и одна кнопка, поэтому блок стоит по центру,
   а кнопка не должна выглядеть подчёркнутой ссылкой. */
.login-box { max-width: 640px; margin: 12vh auto 0; }
.login-kicker { color: var(--muted); letter-spacing: .22em; }
.login-title { max-width: 18ch; margin: var(--space-2) 0 var(--space-3); color: var(--ink); }
.login-text { max-width: 60ch; margin: 0 0 var(--space-6); color: var(--muted); font-size: var(--text-base); }
.login-btn { text-decoration: none; }
.login-btn:hover { border-color: var(--a); background: var(--a-bg); color: var(--a); }

/* В правке карточка показателя обрастает полями «тип», «база», «цель», «сейчас»,
   и пять колонок становятся слишком тесными: текст рвётся по два слова, а поля
   налезают друг на друга. Ширину раздвигаем только в режиме правки - вид
   страницы в просмотре остаётся ровно таким, как в дашборде. */
body.editing .okr-metrics { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: stretch; }
body.editing .okr-metric { height: 100%; }

/* Со страницы, отданной сервером, файловые кнопки и отмена не показываются:
   данные общие, копия не нужна, а отменять чужое кнопкой нельзя. */
body.okr-server .local-only { display: none !important; }

/* Модератор правит наравне с руководителем цели, поэтому его отметка
   отличается цветом, а не размером. */
.role-chip-moderator { background: var(--v-bg); color: var(--v); }
.role-badge.role-moderator { background: var(--v-bg); color: var(--v); }

/* Форма показателя: заголовок, поля с пояснениями и строка о том,
   что получится. Раньше это были пять однословных подписей, по которым
   нельзя было понять, за что отвечает поле. */
.metric-edit-title {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
}

.metric-field { display: grid; gap: 2px; min-width: 0; }
.metric-field-title { font-size: var(--text-small); font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0; }
.metric-field-hint { margin-bottom: 3px; font-size: var(--text-label); font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }

.metric-edit-note {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: var(--text-label);
  line-height: 1.45;
}

/* Диалог выбора сотрудников: выбранные собираются чипами над поиском,
   строка списка - кнопка, а не галочка: щелчок сразу добавляет человека. */
.modal-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); min-height: 30px; margin-bottom: var(--space-2); }
.modal-chips-empty { color: var(--muted); font-size: var(--text-small); align-self: center; }

.modal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--a);
  border-radius: 999px;
  background: var(--a-bg);
  color: var(--a);
  font: inherit;
  font-size: var(--text-small);
  font-weight: 700;
  cursor: pointer;
}

.modal-chip i { font-style: normal; font-size: var(--text-base); line-height: 1; opacity: .7; }
.modal-chip:hover { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }

.modal-row {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.modal-row.is-already { opacity: .55; cursor: default; }
.modal-row.is-already:hover { background: none; }
