/* Grant Portal styles (D12). Written for this project; no Harbor or keel code.
   No colour literals here: every colour is a token from the active theme file. */

:root {
  /* Colours live in static/css/themes/<PORTAL_THEME>.css; only type and shape here. */
  /* DEP-12: the site's fonts cover English and German; Korean partners' text falls
     back to the device's Korean font (macOS/iOS, Windows, Android/Linux) */
  --gp-font-display: "Fraunces", Georgia, "Times New Roman", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", serif;
  --gp-font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
  --gp-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK KR", monospace;
  --gp-radius: 10px;
  --gp-radius-sm: 6px;

  /* Bootstrap 5.3 variables */
  --bs-body-font-family: var(--gp-font-body);
  --bs-body-bg: var(--gp-ground);
  --bs-body-color: var(--gp-ink);
  --bs-secondary-color: var(--gp-muted);
  --bs-border-color: var(--gp-line);
  --bs-link-color: var(--gp-accent);
  --bs-link-color-rgb: var(--gp-accent-rgb);
  --bs-link-hover-color: var(--gp-accent-hover);
  --bs-link-hover-color-rgb: var(--gp-accent-hover-rgb);
  --bs-primary: var(--gp-accent);
  --bs-primary-rgb: var(--gp-accent-rgb);
  --bs-border-radius: var(--gp-radius-sm);
  --bs-focus-ring-color: rgba(var(--gp-accent-rgb), .3);
}

body {
  background: var(--gp-ground);
  color: var(--gp-ink);
  font-family: var(--gp-font-body);
}

h1, h2, h3, .gp-display { font-family: var(--gp-font-display); letter-spacing: -0.01em; }
code { color: var(--gp-ink-2); font-family: var(--gp-font-mono); font-size: .85em; }
.text-muted { color: var(--gp-muted) !important; }

/* Small uppercase labels */
.gp-eyebrow {
  font-family: var(--gp-font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gp-muted);
}
.gp-mono { font-family: var(--gp-font-mono); font-size: .9em; }

/* Brand */
.gp-brand { display: flex; align-items: center; gap: 10px; color: var(--gp-ink); text-decoration: none; }
.gp-brand:hover { color: var(--gp-ink); }
.gp-brand-mark {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: var(--gp-radius-sm);
  background: var(--gp-accent); color: var(--gp-ground);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--gp-font-display); font-weight: 600; font-size: 17px;
}
.gp-brand-name { display: block; font-family: var(--gp-font-display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.gp-brand .gp-eyebrow { font-size: 10px; letter-spacing: .08em; }

/* Signed-in shell: sidebar + content */
.gp-shell { display: flex; min-height: 100vh; }
.gp-sidebar { background: var(--gp-ground-2); border-right: 1px solid var(--gp-line); }
@media (min-width: 768px) {
  .gp-sidebar { width: 240px; flex-shrink: 0; }
  .gp-sidebar .offcanvas-body { position: sticky; top: 0; }
}
.gp-sidebar .offcanvas-body { display: flex; flex-direction: column; gap: 28px; padding: 24px 16px; }
.gp-nav-group { display: flex; flex-direction: column; gap: 4px; }
.gp-nav-group .gp-eyebrow { padding: 0 10px 6px; font-size: 10px; }
.gp-nav-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 10px;
  border-radius: var(--gp-radius-sm);
  color: var(--gp-ink-2); text-decoration: none;
}
.gp-nav-link:hover { background: var(--gp-nav-hover); color: var(--gp-ink); }
.gp-nav-link[aria-current="page"] {
  background: var(--gp-surface); color: var(--gp-ink); font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--gp-line);
}
.gp-nav-link svg { flex-shrink: 0; }

.gp-content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.gp-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 32px; border-bottom: 1px solid var(--gp-line);
}
.gp-topbar-end { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-left: auto; }
.gp-role {
  font-family: var(--gp-font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 8px; border: 1px solid var(--gp-field-line); border-radius: 4px; color: var(--gp-ink-2);
}
.gp-user { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--gp-ink); text-decoration: none; font-size: 14px; }
.gp-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--gp-line); display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px;
}
.gp-menu-button {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gp-field-line); border-radius: 8px; background: var(--gp-surface); color: var(--gp-ink);
}
.gp-signout { background: none; border: 0; padding: 0; color: var(--gp-accent); font-size: 14px; min-height: 44px; }
.gp-signout:hover { color: var(--gp-accent-hover); text-decoration: underline; }

.gp-main { padding: 32px; width: 100%; max-width: 1180px; display: flex; flex-direction: column; gap: 24px; }
.gp-footnote { padding: 0 32px 24px; font-size: 12px; color: var(--gp-muted); }
@media (max-width: 767.98px) {
  .gp-topbar { padding: 8px 16px; }
  .gp-main { padding: 24px 16px; }
  .gp-footnote { padding: 0 16px 20px; }
}

/* Signed-out layout */
.gp-auth { min-height: 100vh; display: flex; flex-direction: column; }
.gp-auth-header { padding: 28px 40px; }
.gp-auth-main { flex: 1 1 auto; display: flex; align-items: flex-start; justify-content: center; padding: 24px 16px 48px; }
.gp-auth-column { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 24px; }
.gp-auth-footer {
  padding: 20px 40px; border-top: 1px solid var(--gp-line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px; color: var(--gp-muted);
}
@media (min-width: 768px) { .gp-auth-main { align-items: center; } }
@media (max-width: 767.98px) { .gp-auth-header, .gp-auth-footer { padding-left: 16px; padding-right: 16px; } }

/* Error pages (templates/errors/base.html) */
.gp-error { gap: 16px; }
.gp-error-code { font-family: var(--gp-font-display); font-size: 64px; line-height: 1; color: var(--gp-line); }
.gp-error-text { color: var(--gp-ink-2); font-size: 15px; line-height: 1.6; }
.gp-error-text p { margin: 0 0 8px; }

/* Page heading */
.gp-page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.gp-page-head > div { display: flex; flex-direction: column; gap: 6px; }
.gp-title { margin: 0; font-family: var(--gp-font-display); font-weight: 400; font-size: 34px; line-height: 1.15; letter-spacing: -0.02em; }
.gp-subtitle { color: var(--gp-ink-2); font-size: 15px; }
.gp-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards and sections */
.gp-card { background: var(--gp-surface); border: 1px solid var(--gp-line); border-radius: var(--gp-radius); padding: 24px; }
.gp-card-flush { padding: 0; overflow: hidden; }
.gp-card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 20px 24px; border-bottom: 1px solid var(--gp-line);
}
.gp-card-title { margin: 0; font-family: var(--gp-font-display); font-weight: 600; font-size: 20px; }
.gp-card > .gp-card-title { margin-bottom: 18px; }
.gp-card-body { padding: 20px 24px; }
.gp-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.gp-form { max-width: 36rem; }
.gp-form-wide { max-width: 44rem; }

/* Definition lists */
.gp-dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 18px 24px; }
.gp-dl > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gp-dl dt {
  font-family: var(--gp-font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gp-muted);
}
.gp-dl dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.gp-dl .gp-span { grid-column: 1 / -1; }
.gp-amount { font-family: var(--gp-font-display); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; }

/* Tables */
.table {
  --bs-table-bg: transparent;
  --bs-table-color: var(--gp-ink);
  --bs-table-border-color: var(--gp-line-soft);
  font-size: 14px; margin-bottom: 0;
}
.table > thead th {
  font-family: var(--gp-font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gp-muted); white-space: nowrap;
  border-bottom-color: var(--gp-line);
}
.table > :not(caption) > * > * { padding: 14px 20px; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table-responsive { margin: 0; }
.gp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Tables partners read on a phone (5.6): below 576px each row becomes a block of
   labelled values instead of a table that must be scrolled sideways. Cells carry
   data-label with their column name. */
@media (max-width: 575.98px) {
  .gp-table-stack thead { display: none; }
  .gp-table-stack, .gp-table-stack tbody, .gp-table-stack tr, .gp-table-stack td { display: block; width: 100%; }
  .gp-table-stack > tbody > tr { padding: 12px 16px; border-bottom: 1px solid var(--gp-line-soft); }
  .gp-table-stack > tbody > tr:last-child { border-bottom: 0; }
  .table.gp-table-stack > :not(caption) > * > * { padding: 3px 0; border: 0; }
  .gp-table-stack td.gp-num, .gp-table-stack td.text-end { text-align: left; }
  .gp-table-stack td[data-label]::before {
    content: attr(data-label); display: inline-block; min-width: 96px; margin-right: 8px;
    font-family: var(--gp-font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--gp-muted); vertical-align: baseline;
  }
  .gp-table-stack td:empty { display: none; }
}

/* Status chips: each state differs by shape or fill, not hue alone */
.gp-status {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.gp-status-draft { background: var(--gp-line-soft); color: var(--gp-neutral-ink); border: 1px dashed var(--gp-draft-line); }
.gp-status-active { background: var(--gp-accent); color: var(--gp-on-accent); }
.gp-status-on_hold { background: var(--gp-warn-bg); color: var(--gp-warn-ink); }
.gp-status-closed { background: var(--gp-surface); color: var(--gp-neutral-ink); border-color: var(--gp-field-line); }
.gp-status-muted { background: var(--gp-surface); color: var(--gp-muted); border-color: var(--gp-field-line); }
/* Milestone performance states (5.1): shape and fill differ, not hue alone */
.gp-status-in_progress { background: var(--gp-accent); color: var(--gp-on-accent); }
.gp-status-under_review { background: var(--gp-surface); color: var(--gp-accent); border: 2px solid var(--gp-accent); padding: 2px 9px; }
.gp-status-revision_requested { background: var(--gp-warn-bg); color: var(--gp-warn-ink); border-color: var(--gp-warn-line); }
.gp-status-approved { background: var(--gp-ok-bg); color: var(--gp-ok-ink); border-color: var(--gp-ok-line); }
.gp-status-cancelled { background: var(--gp-surface); color: var(--gp-muted); border-color: var(--gp-field-line); text-decoration: line-through; }
/* Submission states (Appendix B) and item review results */
.gp-status-sub-submitted { background: var(--gp-surface); color: var(--gp-accent); border: 2px solid var(--gp-accent); padding: 2px 9px; }
.gp-status-sub-withdrawn, .gp-status-sub-approval_cancelled { background: var(--gp-surface); color: var(--gp-muted); border-color: var(--gp-field-line); border-style: dashed; }
.gp-status-sub-revision_requested, .gp-status-review-needs_revision { background: var(--gp-warn-bg); color: var(--gp-warn-ink); border-color: var(--gp-warn-line); }
.gp-status-sub-approved, .gp-status-review-confirmed { background: var(--gp-ok-bg); color: var(--gp-ok-ink); border-color: var(--gp-ok-line); }
.gp-evidence-revise { border-color: var(--gp-warn-line); box-shadow: inset 4px 0 0 var(--gp-warn-line); }
.gp-evidence-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.gp-break { overflow-wrap: anywhere; }
.gp-link-row { border-top: 1px solid var(--gp-line-soft); padding-top: 12px; }
.gp-confirm { border-color: var(--gp-accent); }
.gp-money-summary dd { font-variant-numeric: tabular-nums; }
.gp-attention { color: var(--gp-warn-ink); font-weight: 600; }
/* Flags next to a status (delayed, outside period, personal information) */
.gp-flag {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  background: var(--gp-surface); color: var(--gp-ink-2); border: 1px solid var(--gp-field-line);
}
.gp-flag-warn { background: var(--gp-warn-bg); color: var(--gp-warn-ink); border-color: var(--gp-warn-line); }
.gp-flag-danger { color: var(--gp-danger); border-color: var(--gp-danger-line); }
/* Foundation-internal blocks (E19): tinted and labelled so they are never mistaken for shared ones */
.gp-internal { background: var(--gp-internal-bg); border-color: var(--gp-internal-line); }
.gp-internal-label {
  font-family: var(--gp-font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--gp-internal-ink); border: 1px solid var(--gp-internal-line); border-radius: 4px; padding: 2px 6px;
}
.gp-flags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.gp-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gp-checklist li { display: flex; gap: 10px; align-items: flex-start; }
.gp-tag {
  display: inline-flex; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600;
  background: var(--gp-info-bg); color: var(--gp-info-ink); border: 1px solid var(--gp-info-line);
}

/* Notices */
.gp-notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 8px;
  background: var(--gp-info-bg); border: 1px solid var(--gp-info-line); color: var(--gp-info-ink);
  font-size: 14px; line-height: 1.5;
}
.gp-notice svg { flex-shrink: 0; margin-top: 2px; }
.alert { border-radius: 8px; font-size: 14px; }

/* Forms */
.form-label { font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-control, .form-select {
  min-height: 44px; border-color: var(--gp-field-line); border-radius: var(--gp-radius-sm);
  background-color: var(--gp-surface); color: var(--gp-ink); font-size: 15px;
}
textarea.form-control { min-height: auto; }
.form-control:focus, .form-select:focus { border-color: var(--gp-accent); box-shadow: 0 0 0 3px rgba(var(--gp-accent-rgb), .2); }
.form-text { color: var(--gp-muted); }
/* Bootstrap colours checked boxes with its own blue; follow the theme instead. */
.form-check-input:checked { background-color: var(--gp-accent); border-color: var(--gp-accent); }
/* Django renders radio lists and single checkboxes without .form-check wrappers:
   keep each input on the line of its own label instead of floating it. */
label > .form-check-input, .mb-3 > .form-check-input { float: none; margin: 0; flex: none; }
label:has(> .form-check-input) { display: flex; align-items: center; gap: .5em; margin-bottom: .35rem; }
.mb-3 > input.form-check-input { display: block; }
/* RadioSelect puts the widget class on its wrapping <div> too: undo the input look there. */
div.form-check-input { width: auto; height: auto; float: none; margin: 0; padding: 0; border: 0;
  background: none; box-shadow: none; appearance: none; display: block; }
.form-check-input:focus { border-color: var(--gp-accent); box-shadow: 0 0 0 3px rgba(var(--gp-accent-rgb), .2); }
.gp-form-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.gp-danger-zone { border-color: var(--gp-danger-line-soft); }
.gp-danger-zone .gp-card-title { color: var(--gp-danger); }

/* Buttons */
.btn { border-radius: var(--gp-radius-sm); font-weight: 600; font-size: 14px; min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-primary {
  --bs-btn-bg: var(--gp-accent); --bs-btn-border-color: var(--gp-accent);
  --bs-btn-hover-bg: var(--gp-accent-hover); --bs-btn-hover-border-color: var(--gp-accent-hover);
  --bs-btn-active-bg: var(--gp-accent-hover); --bs-btn-active-border-color: var(--gp-accent-hover);
  --bs-btn-disabled-bg: var(--gp-accent); --bs-btn-disabled-border-color: var(--gp-accent);
}
.btn-outline-primary, .btn-outline-secondary {
  --bs-btn-color: var(--gp-ink); --bs-btn-bg: var(--gp-surface); --bs-btn-border-color: var(--gp-field-line);
  --bs-btn-hover-color: var(--gp-ink); --bs-btn-hover-bg: var(--gp-ground); --bs-btn-hover-border-color: var(--gp-muted);
  --bs-btn-active-color: var(--gp-ink); --bs-btn-active-bg: var(--gp-line); --bs-btn-active-border-color: var(--gp-muted);
}
.btn-outline-danger {
  --bs-btn-color: var(--gp-danger); --bs-btn-bg: var(--gp-surface); --bs-btn-border-color: var(--gp-danger-line);
  --bs-btn-hover-color: var(--gp-on-danger); --bs-btn-hover-bg: var(--gp-danger); --bs-btn-hover-border-color: var(--gp-danger);
}
.btn-outline-warning {
  --bs-btn-color: var(--gp-warn-ink); --bs-btn-bg: var(--gp-surface); --bs-btn-border-color: var(--gp-warn-line);
  --bs-btn-hover-color: var(--gp-warn-ink); --bs-btn-hover-bg: var(--gp-warn-bg); --bs-btn-hover-border-color: var(--gp-warn-line);
}

.gp-hidden-form { display: contents; }
.gp-change { max-width: 20rem; min-width: 12rem; white-space: normal; overflow-wrap: anywhere; }
.gp-change summary { cursor: pointer; color: var(--gp-ink-2); }

/* Pagination */
.gp-pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--gp-muted); }

/* allauth forms render fields with form.as_p; style them like Bootstrap fields */
.gp-af { display: flex; flex-direction: column; gap: 4px; }
.gp-af p { margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.gp-af label { font-size: 14px; font-weight: 500; }
.gp-af input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .gp-af select, .gp-af textarea {
  min-height: 44px; width: 100%; padding: 0 12px;
  border: 1px solid var(--gp-field-line); border-radius: var(--gp-radius-sm);
  background: var(--gp-surface); color: var(--gp-ink); font: inherit; font-size: 15px;
}
.gp-af textarea { padding: 10px 12px; }
.gp-af input:focus, .gp-af select:focus, .gp-af textarea:focus { outline: none; border-color: var(--gp-accent); box-shadow: 0 0 0 3px rgba(var(--gp-accent-rgb), .2); }
.gp-af p:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 8px; }
.gp-af .helptext, .gp-af p > span { font-size: 13px; color: var(--gp-muted); }
.gp-af ul.errorlist { list-style: none; padding: 0; margin: 0 0 8px; color: var(--gp-danger); font-size: 13px; }
.gp-auth-column > p, .gp-auth-column > section > p { color: var(--gp-ink-2); font-size: 14px; line-height: 1.55; }
.gp-af .gp-form-actions .btn { width: 100%; }
.gp-dl dd.gp-amount { font-family: var(--gp-font-display); font-size: 26px; }
.gp-card-head form .form-select { width: auto; min-width: 220px; }
@media (max-width: 575.98px) {
  .gp-topbar { flex-wrap: nowrap; }
  .gp-topbar-end { gap: 10px; flex-wrap: nowrap; }
  .gp-user-name, .gp-role { display: none; }
}

/* File preview (5.5) */
.gp-preview { display: flex; justify-content: center; }
.gp-preview img, .gp-preview video { max-width: 100%; max-height: 75vh; height: auto; }
.gp-preview iframe { width: 100%; height: 75vh; border: 0; }

/* Upload widget (D6) */
.gp-upload { display: grid; gap: 8px; }
.gp-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-upload-camera { display: none; }
@media (pointer: coarse) { .gp-upload-camera { display: inline-block; } }
.gp-upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gp-upload-item { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--gp-line); border-radius: 8px; background: var(--gp-surface); font-size: 14px; }
.gp-upload-item > span:first-child { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 575.98px) {
  .gp-upload-item { grid-template-columns: 1fr auto; }
  .gp-upload-item .gp-upload-state { grid-column: 1 / -1; grid-row: 2; }
}
.gp-upload-bar { grid-column: 1 / -1; height: 4px; background: var(--gp-line); border-radius: 2px; overflow: hidden; }
.gp-upload-bar > i { display: block; height: 100%; width: 0; background: var(--gp-accent); transition: width .2s; }
.gp-upload-state { font-size: 12px; color: var(--gp-muted); }
.gp-upload-item.is-ready .gp-upload-state { color: var(--gp-ok-ink); }
.gp-upload-item.is-bad { border-color: var(--gp-danger-line); }
.gp-upload-item.is-bad .gp-upload-state { color: var(--gp-danger); }

/* Working copy (F6.1) */
.gp-flag-ok { background: var(--gp-ok-bg); color: var(--gp-ok-ink); border-color: var(--gp-ok-line); }
.gp-working-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.gp-working-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--gp-line); border-radius: 8px; }
.gp-working-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.gp-working-state { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.gp-working-actions { display: flex; gap: 6px; align-items: center; }
/* SIM-Q32: the trash is folded, dashed and muted so it never reads as part of an item. */
.gp-trash { border-style: dashed; background: var(--gp-line-soft); }
.gp-trash > summary { cursor: pointer; list-style-position: inside; }
.gp-trash .gp-working-item { border-style: dashed; color: var(--gp-muted); }
@media (max-width: 575.98px) {
  .gp-working-item { grid-template-columns: 1fr; }
  .gp-working-state { justify-content: flex-start; }
}

/* 3D document box (F9.1, F9.6) */
.gp-folder-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gp-folder-chips a { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border: 1px solid var(--gp-line); border-radius: 999px; text-decoration: none; font-size: 14px; }
.gp-folder-chips a[aria-current="true"] { border-color: var(--gp-ink); font-weight: 600; }
.gp-doc-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; }
.gp-doc-filters .gp-form-actions { margin: 0; }
.gp-doc-path { font-size: 13px; color: var(--gp-muted); }
.gp-version-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
/* F13.2 / OD-50: viewer name and time over a personal-information preview. */
.gp-preview { position: relative; }
.gp-watermark { position: absolute; inset: 0; pointer-events: none; overflow: hidden; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 48px 24px; padding: 24px; }
.gp-watermark span { transform: rotate(-24deg); font-size: 15px; font-weight: 600; color: var(--gp-muted); opacity: 0.3; white-space: nowrap; user-select: none; }

/* 3E storage (F14.4) */
.gp-meter { height: 8px; border-radius: 999px; background: var(--gp-line-soft); overflow: hidden; }
.gp-meter i { display: block; height: 100%; background: var(--gp-ink); }
.gp-meter i.is-near { background: var(--gp-danger); }
.gp-meter-sm { display: inline-block; width: 80px; vertical-align: middle; }

/* 3E partner phone pass (5.6): stacked project list and finger-sized targets. */
@media (max-width: 575.98px) {
  .gp-table-stack td.gp-stack-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; white-space: normal; }
  .gp-table-stack td.gp-stack-head a { display: inline-block; padding-block: 10px; }
  .gp-folder-chips a { min-height: 40px; align-items: center; }
  details > summary { padding-block: 10px; }
  .gp-working-main > a, .gp-version-list a, .gp-evidence-list a { display: inline-block; padding-block: 8px; }
  .gp-panel-link, a.gp-flag { display: inline-block; padding-block: 9px; }
}
@media (pointer: coarse) {
  .form-check-input { width: 1.4em; height: 1.4em; }
}

/* Stage 4 change comparison (F8.3) */
.gp-compare th[scope="row"] { width: 30%; font-weight: 500; }
.gp-compare td:last-child { color: var(--gp-ink); }
.gp-compare td { white-space: nowrap; }
@media (max-width: 575.98px) {
  .gp-compare td { white-space: normal; overflow-wrap: anywhere; }
  .gp-compare th[scope="row"] { display: block; width: 100%; padding: 0 0 4px; border: 0; }
}

/* F4.3 / F5.4: plan and new-milestone previews on a proposal (4C) */
.gp-preview { display: flex; flex-direction: column; gap: 12px; }
.gp-preview-item { border-top: 1px solid var(--gp-line); padding-top: 12px; min-width: 0; overflow-wrap: anywhere; }
.gp-preview-item:first-child { border-top: 0; padding-top: 0; }
.gp-num-inline { font-variant-numeric: tabular-nums; }

/* F8.4 change history (4D): a phone-first list */
.gp-history { display: flex; flex-direction: column; gap: 14px; }
.gp-history-item { border-top: 1px solid var(--gp-line); padding-top: 14px; min-width: 0; overflow-wrap: anywhere; }
.gp-history-item:first-child { border-top: 0; padding-top: 0; }
.gp-history-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.gp-history-changes { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.gp-history-changes > div { display: flex; flex-wrap: wrap; gap: 0 8px; }
.gp-history-changes dt { font-weight: 500; }
.gp-history-changes dd { margin: 0; font-variant-numeric: tabular-nums; }
.gp-history-filter select { max-width: 420px; flex: 1 1 200px; }

/* F11.2 notification bell and centre (5A) */
.gp-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 999px; color: var(--gp-ink-2, inherit); }
.gp-bell:hover, .gp-bell:focus-visible { background: var(--gp-ground-2); }
.gp-bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--gp-danger); color: var(--gp-on-danger); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.gp-notice-unread { position: relative; }
.gp-notice-unread::before { content: ""; position: absolute; left: -12px; top: 22px; width: 6px; height: 6px; border-radius: 999px; background: var(--gp-danger); }
.gp-history-item.gp-notice-unread:first-child::before { top: 8px; }
.gp-notice-filter .form-select { min-width: 140px; }
.gp-reminder-message { border-left: 3px solid var(--gp-line); padding-left: 10px; color: var(--gp-ink-2); overflow-wrap: anywhere; }

/* F10.1 comments (5C): internal ones are tinted and badged so they never pass as shared (E19) */
.gp-comments { display: flex; flex-direction: column; gap: 10px; margin: 0 0 16px; }
.gp-comment { border: 1px solid var(--gp-line); border-radius: 8px; padding: 10px 12px; min-width: 0; overflow-wrap: anywhere; }
.gp-comment-internal { background: var(--gp-warn-bg); border-color: var(--gp-warn-line); }
.gp-flag-internal { background: var(--gp-warn-bg); color: var(--gp-warn-ink); border-color: var(--gp-warn-line); }
.gp-comment-meta { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; margin-bottom: 4px; }
.gp-comment-edits summary { display: inline; cursor: pointer; }
/* Mentions (practice P-5): a told person reads as a chip; the @ picker sits under the box */
.gp-mention {
  display: inline; padding: 0 4px; border-radius: 4px; font-weight: 600; white-space: nowrap;
  background: var(--gp-info-bg); color: var(--gp-info-ink);
}
.gp-mention-wrap { position: relative; }
.gp-mention-menu {
  position: absolute; left: 0; right: 0; z-index: 20; margin-top: 4px; overflow: hidden;
  background: var(--gp-surface); border: 1px solid var(--gp-field-line); border-radius: var(--gp-radius-sm);
  box-shadow: 0 8px 24px rgba(var(--gp-accent-rgb), .16);
}
.gp-mention-head {
  padding: 6px 12px; font-size: 12px; color: var(--gp-muted);
  border-bottom: 1px solid var(--gp-line-soft); background: var(--gp-ground);
}
.gp-mention-menu ul { list-style: none; margin: 0; padding: 4px; max-height: 240px; overflow-y: auto; }
.gp-mention-menu li {
  display: flex; flex-direction: column; gap: 1px; padding: 7px 10px; border-radius: 4px;
  cursor: pointer; overflow-wrap: anywhere;
}
.gp-mention-menu li:hover { background: var(--gp-line-soft); }
.gp-mention-menu li[aria-selected="true"] {
  background: var(--gp-info-bg); color: var(--gp-info-ink); box-shadow: inset 3px 0 0 var(--gp-accent);
}
.gp-mention-name { font-weight: 600; }
.gp-mention-org { font-size: 12px; color: var(--gp-muted); }

/* F12.1 role homes and F12.3 open items (6A) */
.gp-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.gp-home-section { min-width: 0; }
.gp-home-empty { padding-block: 12px; }
.gp-count { display: inline-block; min-width: 1.6em; padding: 0 6px; border-radius: 999px; background: var(--gp-ground-2); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.gp-home-list { display: flex; flex-direction: column; }
.gp-home-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--gp-line); min-width: 0; }
.gp-home-row:first-child { border-top: 0; }
.gp-home-main { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.gp-home-side { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gp-home-late { box-shadow: inset 3px 0 0 var(--gp-danger); padding-left: 8px; }

/* F12.2 overview figures (6B) */
.gp-figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.gp-figure { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--gp-line); border-radius: 10px; background: var(--gp-surface); color: inherit; text-decoration: none; min-width: 0; }
.gp-figure:hover, .gp-figure-on { border-color: var(--gp-accent); }
.gp-figure-label { font-size: 13px; color: var(--gp-ink-2); }
.gp-figure-value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.gp-figure-detail { font-size: 12px; color: var(--gp-ink-2); }
.gp-overview-table { font-size: 13px; }
.gp-overview-table th, .gp-overview-table .gp-num, .gp-overview-table .gp-mono { white-space: nowrap; }
@media (min-width: 768px) { .gp-overview-project { min-width: 200px; } }

/* 5.3 deleted file (7A) */
.gp-file-deleted { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.gp-file-deleted s { color: var(--gp-ink-2); }

/* SIM-Q34: "On this page" links on long pages (F-047). */
.gp-jump { margin-block: 4px 12px; }
.gp-jump ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }
.gp-jump a { display: inline-block; padding-block: 4px; }

/* Go to bottom (long pages: review rounds, comment threads, audit log) */
.gp-to-bottom {
  position: fixed; right: 16px; bottom: 16px; z-index: 30;
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px;
  border-radius: 999px; border: 1px solid var(--gp-field-line);
  background: var(--gp-surface); color: var(--gp-ink); font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(var(--gp-accent-rgb), .18); cursor: pointer;
}
.gp-to-bottom:hover { border-color: var(--gp-accent); color: var(--gp-accent); }
.gp-to-bottom:focus-visible { outline: 2px solid var(--gp-accent); outline-offset: 2px; }
.gp-to-bottom[hidden] { display: none; }
@media (max-width: 575.98px) {
  .gp-to-bottom { padding: 10px; }
  .gp-to-bottom-label { display: none; }
}
@media print { .gp-to-bottom { display: none; } }
