/* The team sites' app pages (sidebar layout, boards, detail pages, roadmap, calendar, code, team pages, the
   command palette). Loaded after portal.css. */

/* ---------- Sidebar sites (development) ---------- */
.pt-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: calc(100vh - 57px); }
.pt-side { border-right: 1px solid var(--divider); padding: 18px 12px; position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; }
.pt-side nav { display: grid; gap: 2px; }
.pt-side-label { font-size: 10px; color: var(--muted); letter-spacing: .14em; margin: 16px 10px 6px; }
.pt-side a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.pt-side a .i { width: 17px; height: 17px; }
.pt-side a:hover { color: var(--text); background: var(--raised); }
.pt-side a[aria-current] { color: var(--text); background: var(--raised); }
.pt-side a[aria-current] .i { color: var(--accent); }
.pt-count { margin-left: auto; font-style: normal; font-size: 11px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.pt-shell .pt-main { padding-top: 28px; }
.pt-shell .pt-wrap { max-width: 1240px; }
.pt-menu { display: none; }
.pt-search-btn { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--inset); color: var(--muted); font: 600 13px Sora, sans-serif; cursor: pointer; min-width: 200px; }
.pt-search-btn:hover { border-color: var(--strong); color: var(--text); }
.pt-search-btn .i { width: 16px; height: 16px; }
.pt-search-btn kbd { margin-left: auto; }
kbd { font: 500 11px 'JetBrains Mono', monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--panel); }
.pt-bell { position: relative; }
.pt-bell em { position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #000; font: 700 10px/16px Sora, sans-serif; font-style: normal; text-align: center; }
.pt-bell em:empty { display: none; }

/* ---------- Shared bits ---------- */
.pt-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pt-h2 { font-size: 15px; margin: 28px 0 12px; }
.pt-label { display: inline-block; font: 500 11px 'JetBrains Mono', monospace; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; margin: 0 4px 2px 0; }
.pt-labels { display: flex; flex-wrap: wrap; }
.pt-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.pt-select { display: grid; gap: 4px; }
.pt-select select, .pt-search { height: 36px; padding: 0 10px; background: var(--inset); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font: 14px Sora, sans-serif; }
.pt-search { width: 100%; max-width: 420px; margin-bottom: 16px; }
.pt-filters .pt-search { margin: 0; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pt-table th { text-align: left; font: 500 10px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--divider); }
.pt-table td { padding: 12px 16px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.pt-table tr:last-child td { border-bottom: 0; }
.pt-table tr[data-go] { cursor: pointer; }
.pt-table tr[data-go]:hover td { background: var(--raised); }
.pt-table .pt-av { vertical-align: middle; margin-right: 6px; }
.pt-card-item.pr-urgent { border-top: 2px solid var(--danger); }
.pt-card-item.pr-high { border-top: 2px solid var(--warning); }
.pt-alerts { display: grid; gap: 8px; margin-bottom: 18px; }
.pt-alert { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); text-decoration: none; font-size: 14px; }
.pt-alert .i { color: var(--warning); width: 18px; height: 18px; }
.pt-alert strong { margin-left: auto; font-size: 13px; }
.pt-alert.is-live .i { color: var(--accent); }
.pt-alert.is-bad { border-color: #5c2a2a; }
.pt-alert.is-bad .i { color: var(--danger); }

/* ---------- Detail pages ---------- */
.pt-title-input { width: 100%; background: none; border: 0; border-bottom: 1px solid transparent; color: var(--text); font: 700 24px/1.25 Sora, sans-serif; letter-spacing: -.01em; padding: 0 0 4px; }
.pt-title-input:focus { outline: 0; border-bottom-color: var(--strong); }
.pt-notes { width: 100%; margin: 12px 0 20px; background: var(--inset); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; color: var(--text); font: 14px/1.6 Sora, sans-serif; resize: vertical; }
.pt-fields { display: grid; gap: 12px; }
.pt-fields .field-row { gap: 10px; grid-template-columns: 1fr 1fr; align-items: end; }
.pt-main-col .panel > .field, .pt-main-col .panel > .field-row { margin-top: 16px; }
.pt-main-col .field-row { grid-template-columns: 1fr 1fr; }
.pt-checklist { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.pt-checklist li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.pt-checklist label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pt-checklist input { accent-color: var(--accent); width: 16px; height: 16px; }
.pt-checklist .icon-btn { width: 26px; height: 26px; }
.pt-strike { text-decoration: line-through; }
.pt-inline { display: flex; gap: 8px; }
.pt-inline input { flex: 1; height: 34px; background: var(--inset); border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; color: var(--text); font: 14px Sora, sans-serif; }
.pt-attach { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pt-file { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--inset); color: var(--text); font: 12px Sora, sans-serif; cursor: pointer; }
.pt-file .i { width: 13px; height: 13px; }
.pt-compose div { gap: 8px; align-items: center; }
.pt-timer { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.pt-log { display: flex; gap: 6px; }
.pt-log input { width: 110px; height: 32px; background: var(--inset); border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; color: var(--text); font: 13px Sora, sans-serif; }
.pt-time-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.pt-time-list li { display: flex; align-items: center; gap: 8px; }
.pt-time-list li .muted { margin-left: auto; }

/* ---------- Roadmap ---------- */
.pt-progress { display: block; height: 6px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.pt-progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pt-progress.big { height: 8px; margin: 12px 0; }
.pt-ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pt-ms { display: grid; gap: 8px; padding: 16px 18px; color: var(--text); text-decoration: none; transition: border-color .15s; }
.pt-ms:hover { border-color: var(--strong); }
.pt-ms-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pt-ms-head .pt-progress { flex: 1; }
.pt-timeline { margin-bottom: 20px; }
.pt-tl-axis { position: relative; height: 18px; border-bottom: 1px solid var(--divider); font: 500 11px 'JetBrains Mono', monospace; color: var(--muted); }
.pt-tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.pt-tl-axis span:last-child { transform: translateX(-100%); }
.pt-tl-track { position: relative; height: 96px; margin-top: 12px; }
.pt-tl-dot { position: absolute; display: flex; align-items: center; gap: 6px; transform: translateX(-5px); color: var(--text); text-decoration: none; font-size: 12px; white-space: nowrap; }
.pt-tl-dot i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- Calendar ---------- */
.pt-legend { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.pt-key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.pt-key.commission, .pt-cal-item.commission { background: #3b2a0a; }
.pt-key.task, .pt-cal-item.task { background: #10363d; }
.pt-key.milestone, .pt-cal-item.milestone { background: #1f2a44; }
.pt-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--border); gap: 1px; }
.pt-cal-dow { background: var(--panel); padding: 8px 10px; font-size: 10px; color: var(--muted); letter-spacing: .12em; }
.pt-cal-day { background: var(--bg); min-height: 108px; padding: 6px; display: grid; align-content: start; gap: 3px; }
.pt-cal-day.is-out { background: var(--inset); }
.pt-cal-day.is-out .pt-cal-n { color: #444; }
.pt-cal-day.is-today .pt-cal-n { background: var(--accent); color: #000; border-radius: 6px; padding: 0 6px; width: fit-content; }
.pt-cal-n { font: 600 12px 'JetBrains Mono', monospace; color: var(--muted); margin-bottom: 2px; }
.pt-cal-item { display: block; padding: 2px 6px; border-radius: 4px; color: var(--text); text-decoration: none; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-cal-item.done { background: var(--raised); color: var(--muted); text-decoration: line-through; }
.pt-cal-item.is-mine { border-left: 2px solid var(--accent); }

/* ---------- Workload ---------- */
.pt-load { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.pt-person header { display: flex; gap: 12px; align-items: center; }
.pt-person header div { display: grid; }
.pt-person .rows .row { padding: 8px 0; }

/* ---------- Code ---------- */
.pt-pr { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--divider); align-items: start; }
.pt-pr:first-child { border-top: 0; }
.pt-pr p { margin: 2px 0 0; }
.pt-pr .pt-meta { margin-top: 8px; flex-wrap: wrap; }
.pt-build-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 16px; }
.pt-build { display: grid; gap: 6px; padding: 14px 16px; color: var(--text); text-decoration: none; }
.pt-build.bad { border-color: #5c2a2a; }
.pt-chart { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; height: 120px; align-items: end; margin-top: 12px; }
.pt-chart span { height: 100%; display: flex; align-items: flex-end; }
.pt-chart i { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 3px 3px 0 0; }
.pt-chart-axis { display: flex; justify-content: space-between; margin-top: 6px; }

/* ---------- Team ---------- */
.pt-standup { display: grid; gap: 12px; }
.pt-standups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.pt-standups .pt-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pt-standups .pt-who .muted { margin-left: auto; }
.pt-standups p { margin: 8px 0 0; }
.pt-blocked span { color: var(--warning); }
.pt-wiki { max-width: 860px; margin-bottom: 20px; }
.pt-snippets { display: grid; gap: 14px; }
.pt-snippet { padding: 16px 18px; }
.pt-snippet header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pt-snippet.is-open { border-color: var(--accent); }
.pt-snippet .prose pre { margin: 10px 0 0; }
.pt-code { font: 13px/1.5 'JetBrains Mono', monospace !important; tab-size: 2; }
.pt-notif { color: var(--text); text-decoration: none; }
.pt-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; }
.pt-notif.is-new .pt-dot { background: var(--accent); }
.pt-notif:hover { background: var(--raised); }

/* ---------- Command palette ---------- */
.pt-palette-back { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .6); display: flex; justify-content: center; padding-top: 12vh; }
.pt-palette { width: min(640px, calc(100vw - 32px)); max-height: 64vh; display: grid; grid-template-rows: auto 1fr; background: var(--panel); border: 1px solid var(--strong); border-radius: 14px; overflow: hidden; }
.pt-palette-in { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--divider); }
.pt-palette-in .i { color: var(--muted); }
.pt-palette-in input { flex: 1; background: none; border: 0; color: var(--text); font: 16px Sora, sans-serif; outline: 0; }
.pt-palette-list { overflow-y: auto; padding: 6px; }
.pt-palette-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: 14px Sora, sans-serif; text-align: left; cursor: pointer; }
.pt-palette-item .i { width: 16px; height: 16px; color: var(--muted); }
.pt-palette-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-palette-item em { font-style: normal; font-size: 11px; color: var(--muted); }
.pt-palette-item.on { background: var(--raised); }
.pt-palette-item.on .i { color: var(--accent); }
.pt-keys { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; align-items: center; margin: 12px 0 20px; font-size: 14px; }
.pt-keys kbd { justify-self: start; }

@media (max-width: 1100px) {
  .pt-board-6 { grid-template-columns: repeat(6, 200px); }
}
@media (max-width: 860px) {
  .pt-shell { grid-template-columns: 1fr; }
  .pt-side { position: fixed; z-index: 30; top: 57px; left: 0; width: 260px; background: var(--bg); transform: translateX(-100%); transition: transform .2s; }
  .pt-nav-open .pt-side { transform: none; }
  .pt-menu { display: inline-grid; }
  .pt-search-btn { min-width: 0; }
  .pt-search-btn span, .pt-search-btn kbd, .pt-main-link { display: none; }
  .pt-cal-day { min-height: 70px; }
  .pt-cal-item { font-size: 10px; }
  .pt-table { display: block; overflow-x: auto; }
}
