.tp-shell {
  --tp-ink: #172235;
  --tp-muted: #6d7886;
  --tp-line: #dce2e8;
  --tp-panel: #fff;
  --tp-soft: #f4f6f8;
  --tp-purple: #642b8c;
  --tp-purple-soft: #f3ecf8;
  --tp-orange: #e97b24;
  --tp-green: #23845a;
  --tp-red: #b64343;
  display: grid;
  gap: 14px;
  color: var(--tp-ink);
}

.tp-shell * { box-sizing: border-box; }
.tp-shell button,
.tp-shell input,
.tp-shell select,
.tp-shell textarea { font: inherit; }
.tp-shell button { cursor: pointer; }
.tp-shell button:disabled { cursor: not-allowed; opacity: .48; }
.tp-shell button:focus-visible,
.tp-shell input:focus-visible,
.tp-shell select:focus-visible,
.tp-shell textarea:focus-visible {
  outline: 3px solid rgba(233, 123, 36, .3);
  outline-offset: 2px;
}
.tp-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tp-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 142px;
  padding: 24px 28px;
  overflow: hidden;
  border: 1px solid #22354d;
  border-radius: 16px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 10%, rgba(83, 166, 224, .28), transparent 27%),
    radial-gradient(circle at 54% 120%, rgba(100, 43, 140, .55), transparent 45%),
    linear-gradient(125deg, #071729 0%, #102b47 56%, #102137 100%);
  box-shadow: 0 14px 36px rgba(14, 34, 56, .16);
}
.tp-hero::after {
  content: "";
  position: absolute;
  right: 19%;
  bottom: -54px;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(117, 195, 243, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 35px rgba(117, 195, 243, .055), 0 0 0 70px rgba(117, 195, 243, .035);
  pointer-events: none;
}
.tp-hero > * { position: relative; z-index: 1; }
.tp-kicker {
  color: #8fd4ff;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
}
.tp-hero h1 {
  margin: 8px 0 6px;
  font-size: clamp(25px, 3vw, 37px);
  line-height: 1;
  letter-spacing: -.04em;
}
.tp-hero h1 em { color: #ff9b50; font-style: normal; }
.tp-hero p { max-width: 700px; margin: 0; color: #bac9d8; font-size: 12px; line-height: 1.55; }
.tp-identity {
  width: min(380px, 38%);
  padding: 13px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(6, 18, 32, .48);
  backdrop-filter: blur(8px);
}
.tp-identity-selectors { display: grid; gap: 8px; }
.tp-identity label { display: grid; gap: 5px; }
.tp-identity label > span { color: #aabfd2; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.tp-identity select {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  color: #fff;
  background: #152d45;
  font-size: 10px;
  font-weight: 700;
}
.tp-legacy-user {
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #c3d2df !important;
  font-size: 8px !important;
  line-height: 1.4 !important;
}
.tp-identity-row { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.tp-identity-row > div { min-width: 0; flex: 1; }
.tp-identity-row strong,
.tp-identity-row small { display: block; }
.tp-identity-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.tp-identity-row small { margin-top: 2px; color: #aabfd2; font-size: 8px; }
.tp-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #7f4aa4, #4b1d6f);
  font-size: 9px;
  font-weight: 850;
}

.tp-boundary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid #b9d8eb;
  border-radius: 10px;
  color: #245876;
  background: #eef8fd;
}
.tp-boundary > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: #276987;
  background: #d9eef8;
}
.tp-boundary strong,
.tp-boundary p { display: block; margin: 0; }
.tp-boundary strong { font-size: 9px; }
.tp-boundary p { margin-top: 2px; color: #4f7184; font-size: 8px; line-height: 1.45; }
.tp-boundary > b {
  padding: 5px 8px;
  border: 1px solid #b1d4e7;
  border-radius: 999px;
  color: #28627f;
  background: rgba(255,255,255,.6);
  font-size: 7px;
  letter-spacing: .08em;
}

.tp-tabs {
  display: flex;
  gap: 5px;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--tp-line);
  border-radius: 12px;
  background: #e9edf1;
  scrollbar-width: thin;
}
.tp-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 126px;
  min-height: 39px;
  padding: 9px 13px;
  border: 0;
  border-radius: 8px;
  color: #5c6877;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.tp-tabs button.active {
  color: var(--tp-purple);
  background: var(--tp-panel);
  box-shadow: 0 2px 8px rgba(28, 41, 58, .1);
}
.tp-tabs button b {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--tp-orange);
  font-size: 7px;
}
.tp-main { display: grid; gap: 13px; min-width: 0; }

.tp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #596573;
  background: #eef1f4;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .035em;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}
.tp-chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tp-chip.good { color: #1e724e; border-color: #b8dec9; background: #e5f5ec; }
.tp-chip.bad { color: #9f3838; border-color: #edbbbb; background: #fbe8e8; }
.tp-chip.info { color: #28698f; border-color: #bcd8e9; background: #e9f4fa; }
.tp-chip.warn { color: #9a5917; border-color: #efcf9e; background: #fff2df; }

.tp-compliance-banner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px 15px;
  border: 1px solid #b6ddca;
  border-radius: 11px;
  color: #216648;
  background: #ecf8f2;
}
.tp-compliance-banner.warn { color: #865116; border-color: #efcd9d; background: #fff6e9; }
.tp-compliance-banner.bad { color: #923838; border-color: #ecb9b9; background: #fcecec; }
.tp-compliance-banner.compact { margin: 12px 14px 0; }
.tp-compliance-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: currentColor;
  background: rgba(255,255,255,.65);
}
.tp-compliance-banner strong,
.tp-compliance-banner p { display: block; margin: 0; }
.tp-compliance-banner strong { font-size: 10px; }
.tp-compliance-banner p { margin-top: 3px; color: currentColor; font-size: 8.5px; line-height: 1.45; opacity: .85; }
.tp-compliance-banner button,
.tp-wide-btn,
.tp-text-btn,
.tp-action-tray button,
.tp-inline-form button,
.tp-compliance-form button,
.tp-empty button {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid #c8d0d8;
  border-radius: 8px;
  color: var(--tp-ink);
  background: var(--tp-panel);
  font-size: 8.5px;
  font-weight: 800;
}
.tp-compliance-banner button { border-color: currentColor; color: currentColor; background: rgba(255,255,255,.7); }
.tp-wide-btn { width: 100%; }
.tp-wide-btn.primary,
.tp-action-tray button.primary,
.tp-inline-form button.primary,
.tp-compliance-form button.primary { color: #fff; border-color: var(--tp-purple); background: var(--tp-purple); }
.tp-inline-form button.danger { color: #fff; border-color: var(--tp-red); background: var(--tp-red); }
.tp-text-btn { min-height: 0; padding: 3px 0; border: 0; color: var(--tp-purple); background: transparent; }

.tp-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; }
.tp-metrics article {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--tp-line);
  border-top: 3px solid #82909e;
  border-radius: 10px;
  background: var(--tp-panel);
  box-shadow: 0 4px 12px rgba(29, 43, 61, .045);
}
.tp-metrics article.purple { border-top-color: var(--tp-purple); }
.tp-metrics article.orange { border-top-color: var(--tp-orange); }
.tp-metrics article.blue { border-top-color: #3985b9; }
.tp-metrics article.green { border-top-color: var(--tp-green); }
.tp-metrics article.red { border-top-color: var(--tp-red); }
.tp-metrics span,
.tp-metrics strong,
.tp-metrics small { display: block; }
.tp-metrics span { overflow: hidden; color: var(--tp-muted); font-size: 8px; font-weight: 750; letter-spacing: .04em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.tp-metrics strong { margin-top: 7px; font-size: 21px; letter-spacing: -.04em; }
.tp-metrics small { margin-top: 3px; overflow: hidden; color: var(--tp-muted); font-size: 7.5px; text-overflow: ellipsis; white-space: nowrap; }

.tp-home-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .7fr); gap: 12px; align-items: start; }
.tp-card,
.tp-order-list,
.tp-order-detail,
.tp-detail-section,
.tp-compliance-card,
.tp-policy-note,
.tp-invoice-card {
  border: 1px solid var(--tp-line);
  border-radius: 11px;
  background: var(--tp-panel);
  box-shadow: 0 4px 14px rgba(29, 43, 61, .045);
}
.tp-card { overflow: hidden; }
.tp-card > header,
.tp-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-card > header span,
.tp-section-head span,
.tp-detail-section > header span,
.tp-order-head > div > span,
.tp-invoice-card > header > div > span,
.tp-inline-form header span,
.tp-compliance-form header span,
.tp-list-head > div > span {
  color: var(--tp-purple);
  font-size: 7px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.tp-card > header h2,
.tp-section-head h1,
.tp-list-head h2,
.tp-detail-section > header h3,
.tp-inline-form h3,
.tp-compliance-form h3 { margin: 3px 0 0; font-size: 12px; letter-spacing: -.01em; }
.tp-section-head h1 { font-size: 23px; }
.tp-card > header p,
.tp-section-head p,
.tp-list-head p,
.tp-detail-section > header p,
.tp-inline-form header p,
.tp-compliance-form header p { margin: 3px 0 0; color: var(--tp-muted); font-size: 8px; line-height: 1.45; }
.tp-action-list { display: grid; }
.tp-action-list > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--tp-line);
  color: var(--tp-ink);
  background: transparent;
  text-align: left;
}
.tp-action-list > button:last-child { border-bottom: 0; }
.tp-action-list > button:hover { background: #faf8fc; }
.tp-action-list > button > span:nth-child(2) { min-width: 0; }
.tp-action-list strong,
.tp-action-list small { display: block; }
.tp-action-list strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.tp-action-list small { margin-top: 3px; overflow: hidden; color: var(--tp-muted); font-size: 7.5px; text-overflow: ellipsis; white-space: nowrap; }
.tp-action-list > button > b { color: var(--tp-purple); font-size: 8px; white-space: nowrap; }
.tp-order-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--tp-purple);
  background: var(--tp-purple-soft);
}
.tp-reminder-list { display: grid; padding: 5px 14px; }
.tp-reminder-list > div {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--tp-line);
}
.tp-reminder-list > div:last-child { border-bottom: 0; }
.tp-reminder-list strong,
.tp-reminder-list small { display: block; }
.tp-reminder-list strong { font-size: 8.5px; }
.tp-reminder-list small { margin-top: 2px; color: var(--tp-muted); font-size: 7px; }
.tp-reminder-dot { width: 7px; height: 7px; border-radius: 50%; background: #87929e; }
.tp-reminder-dot.expired,
.tp-reminder-dot.missing { background: var(--tp-red); }
.tp-reminder-dot.expiring { background: var(--tp-orange); }
.tp-reminder-dot.unverified { background: #3985b9; }
.tp-card > .tp-wide-btn { width: calc(100% - 28px); margin: 4px 14px 14px; }

.tp-empty {
  display: grid;
  justify-items: center;
  padding: 27px 18px;
  color: var(--tp-muted);
  text-align: center;
}
.tp-empty.large { min-height: 250px; align-content: center; border: 1px dashed #ccd4dc; border-radius: 11px; background: var(--tp-panel); }
.tp-empty.compact { padding: 18px 10px; }
.tp-empty > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 8px;
  border-radius: 11px;
  color: var(--tp-purple);
  background: var(--tp-purple-soft);
}
.tp-empty strong { color: var(--tp-ink); font-size: 9px; }
.tp-empty p { max-width: 390px; margin: 5px 0 0; font-size: 8px; line-height: 1.5; }

.tp-work-layout { display: grid; grid-template-columns: minmax(245px, .62fr) minmax(0, 1.7fr); gap: 12px; align-items: start; }
.tp-order-list { position: sticky; top: 8px; overflow: hidden; }
.tp-list-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 12px 13px; border-bottom: 1px solid var(--tp-line); }
.tp-list-head select {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid #ccd4dc;
  border-radius: 7px;
  color: var(--tp-ink);
  background: var(--tp-panel);
  font-size: 8px;
}
.tp-order-items { display: grid; max-height: 69vh; overflow-y: auto; overscroll-behavior: contain; }
.tp-order-items > button {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 88px;
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid var(--tp-line);
  color: var(--tp-ink);
  background: transparent;
  text-align: left;
}
.tp-order-items > button:last-child { border-bottom: 0; }
.tp-order-items > button:hover { background: #faf8fc; }
.tp-order-items > button.active { background: var(--tp-purple-soft); box-shadow: inset 3px 0 var(--tp-purple); }
.tp-order-items > button > span { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tp-order-items > button > span > b { font-size: 8px; }
.tp-order-items > button > strong { font-size: 9px; }
.tp-order-items > button > small { overflow: hidden; color: var(--tp-muted); font-size: 7.5px; text-overflow: ellipsis; white-space: nowrap; }
.tp-order-items > button > em { color: var(--tp-purple); font-size: 9px; font-style: normal; font-weight: 850; }
.tp-order-detail { min-width: 0; overflow: hidden; }
.tp-order-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 18px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-order-head h2 { margin: 4px 0; font-size: 18px; letter-spacing: -.025em; }
.tp-order-head p { margin: 0; color: var(--tp-muted); font-size: 8.5px; line-height: 1.45; }
.tp-order-head > div:last-child { display: grid; justify-items: end; gap: 4px; text-align: right; }
.tp-order-head > div:last-child > strong { font-size: 20px; letter-spacing: -.03em; }
.tp-order-head > div:last-child > small { color: var(--tp-muted); font-size: 7px; }
.tp-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tp-line);
  background: #f8fafb;
}
.tp-timeline > div { position: relative; display: flex; align-items: center; gap: 7px; min-width: 0; }
.tp-timeline > div:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 50%; right: 4px; left: 31px; height: 1px; background: #cfd6dd; }
.tp-timeline i {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 1px solid #c8d0d8;
  border-radius: 50%;
  color: #737e89;
  background: var(--tp-panel);
  font-size: 8px;
  font-style: normal;
  font-weight: 850;
}
.tp-timeline .complete i { color: #fff; border-color: var(--tp-green); background: var(--tp-green); }
.tp-timeline .current i { color: #fff; border-color: var(--tp-orange); background: var(--tp-orange); box-shadow: 0 0 0 3px rgba(233,123,36,.13); }
.tp-timeline span { min-width: 0; padding-right: 6px; }
.tp-timeline strong,
.tp-timeline small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-timeline strong { font-size: 7.5px; }
.tp-timeline small { margin-top: 2px; color: var(--tp-muted); font-size: 6.5px; }
.tp-detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 11px; padding: 12px 14px 0; }
.tp-detail-section { margin: 12px 14px 0; overflow: hidden; box-shadow: none; }
.tp-detail-grid .tp-detail-section { margin: 0; }
.tp-detail-section > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid var(--tp-line);
  background: #fafbfc;
}
.tp-detail-section > header > strong { font-size: 14px; }
.tp-detail-section > header > strong small { color: var(--tp-muted); font-size: 7px; }
.tp-detail-section dl { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; padding: 8px 13px; }
.tp-detail-section dl > div { padding: 7px 4px; border-bottom: 1px solid var(--tp-line); }
.tp-detail-section dl > div:nth-last-child(-n+2) { border-bottom: 0; }
.tp-detail-section dt { color: var(--tp-muted); font-size: 7px; text-transform: uppercase; }
.tp-detail-section dd { margin: 3px 0 0; font-size: 8.5px; font-weight: 750; }
.tp-commercial { display: grid; padding: 8px 13px 0; }
.tp-commercial > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--tp-line); font-size: 8px; }
.tp-commercial > div.total { font-size: 9px; font-weight: 850; }
.tp-note { margin: 0; padding: 9px 13px 12px; color: var(--tp-muted); font-size: 7.2px; line-height: 1.5; }
.tp-scope-list { display: grid; }
.tp-scope-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 9px 13px; border-bottom: 1px solid var(--tp-line); }
.tp-scope-list > div:last-child { border-bottom: 0; }
.tp-scope-list strong,
.tp-scope-list small { display: block; }
.tp-scope-list strong { font-size: 8.5px; }
.tp-scope-list small { margin-top: 3px; color: var(--tp-muted); font-size: 7px; }
.tp-scope-list > div > b { align-self: center; color: var(--tp-purple); font-size: 7.5px; }
.tp-activity,
.tp-evidence-list { display: grid; }
.tp-activity > div,
.tp-evidence-list > div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 13px;
  border-bottom: 1px solid var(--tp-line);
}
.tp-activity > div:last-child,
.tp-evidence-list > div:last-child { border-bottom: 0; }
.tp-activity > div > span,
.tp-evidence-list > div > span { color: var(--tp-purple); }
.tp-activity p,
.tp-evidence-list p { margin: 0; font-size: 8px; line-height: 1.45; }
.tp-activity strong,
.tp-activity small,
.tp-evidence-list strong,
.tp-evidence-list small { display: block; }
.tp-activity strong,
.tp-evidence-list strong { margin-bottom: 2px; }
.tp-activity small,
.tp-evidence-list small { margin-top: 3px; color: var(--tp-muted); font-size: 7px; }

.tp-action-tray {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding: 12px 14px;
  border-top: 1px solid #d8c6e4;
  color: #492064;
  background: rgba(247, 241, 250, .97);
  box-shadow: 0 -8px 18px rgba(43, 32, 52, .07);
  backdrop-filter: blur(8px);
}
.tp-action-tray.quiet { color: #31566f; border-color: #c8dce9; background: rgba(239,247,251,.97); }
.tp-action-tray.danger { color: #8d3a3a; border-color: #e6bcbc; background: rgba(252,238,238,.98); }
.tp-action-tray > div:first-child { min-width: 0; }
.tp-action-tray strong,
.tp-action-tray span { display: block; }
.tp-action-tray strong { font-size: 9px; }
.tp-action-tray span { margin-top: 3px; color: currentColor; font-size: 7.5px; line-height: 1.4; opacity: .85; }
.tp-action-tray > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.tp-inline-form,
.tp-compliance-form {
  display: grid;
  gap: 12px;
  margin: 12px 14px 0;
  padding: 14px;
  border: 1px solid #cbb6d9;
  border-radius: 10px;
  background: #fbf8fd;
  box-shadow: 0 7px 20px rgba(57, 34, 71, .08);
}
.tp-compliance-form { margin: 12px 0 0; }
.tp-inline-form > header,
.tp-compliance-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.tp-inline-form > header button,
.tp-compliance-form > header button {
  display: grid;
  min-width: 34px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  font-size: 18px;
}
.tp-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tp-form-grid .wide { grid-column: 1 / -1; }
.tp-inline-form label,
.tp-compliance-form label { display: grid; gap: 5px; color: var(--tp-ink); font-size: 8px; font-weight: 750; }
.tp-inline-form input,
.tp-inline-form select,
.tp-inline-form textarea,
.tp-compliance-form input,
.tp-compliance-form select,
.tp-compliance-form textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 9px;
  border: 1px solid #cbd3da;
  border-radius: 7px;
  color: var(--tp-ink);
  background: var(--tp-panel);
  font-size: 9px;
}
.tp-inline-form textarea,
.tp-compliance-form textarea { min-height: 70px; resize: vertical; }
.tp-inline-form input[type="file"],
.tp-compliance-form input[type="file"] { min-height: 44px; padding: 7px; border-style: dashed; }
.tp-inline-form label > small,
.tp-compliance-form label > small { color: var(--tp-muted); font-size: 7px; font-weight: 500; line-height: 1.45; }
.tp-check { display: flex !important; align-items: flex-start; gap: 8px !important; padding: 9px; border: 1px solid var(--tp-line); border-radius: 8px; background: var(--tp-panel); }
.tp-check input { flex: 0 0 auto; width: 16px; min-height: 16px; margin-top: 1px; }
.tp-check b,
.tp-check small { display: block; }
.tp-check small { margin-top: 3px; color: var(--tp-muted); font-size: 7px; }
.tp-inline-form > footer,
.tp-compliance-form > footer { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }

.tp-policy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-color: #d5c5e1;
  background: var(--tp-purple-soft);
}
.tp-policy-note > span { color: var(--tp-purple); }
.tp-policy-note strong { display: block; color: var(--tp-purple); font-size: 9px; }
.tp-policy-note p { margin: 3px 0 0; color: #65546e; font-size: 8px; line-height: 1.5; }
.tp-compliance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; align-items: start; }
.tp-compliance-card { padding: 13px; }
.tp-compliance-card.current { border-top: 3px solid var(--tp-green); }
.tp-compliance-card.expiring { border-top: 3px solid var(--tp-orange); }
.tp-compliance-card.expired,
.tp-compliance-card.missing { border-top: 3px solid var(--tp-red); }
.tp-compliance-card.unverified { border-top: 3px solid #3985b9; }
.tp-compliance-card > header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.tp-doc-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--tp-purple); background: var(--tp-purple-soft); }
.tp-compliance-card header small { display: block; color: var(--tp-muted); font-size: 6.5px; font-weight: 800; letter-spacing: .07em; }
.tp-compliance-card h2 { margin: 3px 0 0; font-size: 10px; }
.tp-compliance-card > p { min-height: 35px; margin: 11px 0; color: var(--tp-muted); font-size: 8px; line-height: 1.45; }
.tp-compliance-card dl { display: grid; gap: 0; margin: 0 0 11px; }
.tp-compliance-card dl > div { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--tp-line); font-size: 7.5px; }
.tp-compliance-card dt { color: var(--tp-muted); }
.tp-compliance-card dd { margin: 0; max-width: 62%; font-weight: 750; text-align: right; }
.tp-missing { margin: 0 0 11px; padding: 18px 10px; border: 1px dashed #deb0b0; border-radius: 8px; color: var(--tp-red); background: #fff6f6; font-size: 8px; text-align: center; }
.tp-reminder-policy { margin-top: 1px; }
.tp-reminder-steps { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding: 14px; }
.tp-reminder-steps > div { padding: 10px; border: 1px solid var(--tp-line); border-radius: 8px; background: var(--tp-soft); text-align: center; }
.tp-reminder-steps b,
.tp-reminder-steps span { display: block; }
.tp-reminder-steps b { color: var(--tp-purple); font-size: 10px; }
.tp-reminder-steps span { margin-top: 3px; color: var(--tp-muted); font-size: 6.5px; line-height: 1.35; }

.tp-invoices { display: grid; gap: 11px; }
.tp-invoice-card { overflow: hidden; }
.tp-invoice-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--tp-line); }
.tp-invoice-card h2 { margin: 4px 0 3px; font-size: 12px; }
.tp-invoice-card header p { margin: 0; color: var(--tp-muted); font-size: 8px; }
.tp-invoice-money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; padding: 12px 14px; }
.tp-invoice-money > div { padding: 10px; border: 1px solid var(--tp-line); border-radius: 8px; background: var(--tp-soft); }
.tp-invoice-money span,
.tp-invoice-money strong { display: block; }
.tp-invoice-money span { color: var(--tp-muted); font-size: 7px; text-transform: uppercase; }
.tp-invoice-money strong { margin-top: 5px; font-size: 13px; }
.tp-invoice-card > .tp-wide-btn { width: calc(100% - 28px); margin: 0 14px 14px; }
.tp-invoice-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 14px 14px; }
.tp-invoice-meta > span { padding: 9px; border: 1px solid var(--tp-line); border-radius: 8px; }
.tp-invoice-meta strong,
.tp-invoice-meta small { display: block; }
.tp-invoice-meta strong { font-size: 8.5px; }
.tp-invoice-meta small { margin-top: 3px; color: var(--tp-muted); font-size: 7px; }
.tp-invoice-history { display: grid; }
.tp-invoice-history > div { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--tp-line); }
.tp-invoice-history > div:last-child { border-bottom: 0; }
.tp-invoice-history strong,
.tp-invoice-history small { display: block; }
.tp-invoice-history strong { font-size: 8.5px; }
.tp-invoice-history small { margin-top: 2px; color: var(--tp-muted); font-size: 7px; }
.tp-invoice-history > div > b { font-size: 9px; }

html[data-theme="dark"] .tp-shell {
  --tp-ink: var(--ink);
  --tp-muted: var(--slate);
  --tp-line: var(--border);
  --tp-panel: var(--surface);
  --tp-soft: var(--surface-panel);
  --tp-purple: var(--purple);
  --tp-purple-soft: var(--purple-soft);
  --tp-orange: var(--orange);
  --tp-green: var(--green);
  --tp-red: var(--red);
}
html[data-theme="dark"] .tp-tabs { background: #111923; }
html[data-theme="dark"] .tp-boundary { color: #8ed0f2; border-color: #28506a; background: #142a3a; }
html[data-theme="dark"] .tp-boundary > span { background: #1b3c51; }
html[data-theme="dark"] .tp-boundary p { color: #9ec0d2; }
html[data-theme="dark"] .tp-boundary > b { border-color: #315e78; background: #173448; }
html[data-theme="dark"] .tp-compliance-banner { color: var(--green); border-color: #315c4c; background: var(--green-soft); }
html[data-theme="dark"] .tp-compliance-banner.warn { color: var(--amber); border-color: #64502b; background: var(--amber-soft); }
html[data-theme="dark"] .tp-compliance-banner.bad { color: var(--red); border-color: #6c3f45; background: var(--red-soft); }
html[data-theme="dark"] .tp-compliance-banner button { background: rgba(17,25,35,.42); }
html[data-theme="dark"] .tp-chip.good { color: var(--green); border-color: #315c4c; background: var(--green-soft); }
html[data-theme="dark"] .tp-chip.bad { color: var(--red); border-color: #70444b; background: var(--red-soft); }
html[data-theme="dark"] .tp-chip.info { color: var(--blue); border-color: #31576d; background: var(--blue-soft); }
html[data-theme="dark"] .tp-chip.warn { color: var(--amber); border-color: #66522c; background: var(--amber-soft); }
html[data-theme="dark"] .tp-chip.neutral { color: var(--slate); background: var(--surface-panel); }
html[data-theme="dark"] .tp-action-list > button:hover,
html[data-theme="dark"] .tp-order-items > button:hover { background: var(--surface-hover); }
html[data-theme="dark"] .tp-order-items > button.active { background: var(--purple-soft); }
html[data-theme="dark"] .tp-timeline,
html[data-theme="dark"] .tp-detail-section > header { background: var(--surface-panel); }
html[data-theme="dark"] .tp-timeline i { background: var(--surface-raised); border-color: var(--border); }
html[data-theme="dark"] .tp-action-tray { color: #d9b7ec; border-color: #5a3d6d; background: rgba(48,35,62,.97); }
html[data-theme="dark"] .tp-action-tray.quiet { color: #a8d4ed; border-color: #31576d; background: rgba(27,48,64,.97); }
html[data-theme="dark"] .tp-action-tray.danger { color: var(--red); border-color: #70444b; background: rgba(59,35,40,.98); }
html[data-theme="dark"] .tp-inline-form,
html[data-theme="dark"] .tp-compliance-form { border-color: #5c426e; background: var(--purple-soft); }
html[data-theme="dark"] .tp-policy-note { border-color: #5c426e; background: var(--purple-soft); }
html[data-theme="dark"] .tp-policy-note p { color: #cdb7da; }
html[data-theme="dark"] .tp-missing { border-color: #70444b; color: var(--red); background: var(--red-soft); }

@media (max-width: 1180px) {
  .tp-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tp-home-grid { grid-template-columns: 1fr; }
  .tp-work-layout { grid-template-columns: 1fr; }
  .tp-order-list { position: static; }
  .tp-order-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; }
  .tp-order-items > button:nth-child(odd) { border-right: 1px solid var(--tp-line); }
  .tp-compliance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .tp-hero { align-items: stretch; flex-direction: column; padding: 21px; }
  .tp-identity { width: 100%; }
  .tp-tabs { scroll-snap-type: x proximity; }
  .tp-tabs button { min-width: 118px; scroll-snap-align: start; }
  .tp-detail-grid { grid-template-columns: 1fr; }
  .tp-timeline { grid-template-columns: 1fr; gap: 7px; }
  .tp-timeline > div:not(:last-child)::after { top: 22px; right: auto; bottom: -8px; left: 11px; width: 1px; height: auto; }
  .tp-timeline strong,
  .tp-timeline small { white-space: normal; }
  .tp-reminder-steps { grid-template-columns: repeat(3, 1fr); }
  .tp-action-tray { position: static; align-items: stretch; flex-direction: column; }
  .tp-action-tray > div:last-child { justify-content: stretch; }
  .tp-action-tray > div:last-child button { flex: 1; }
}

@media (max-width: 600px) {
  .tp-shell { gap: 10px; }
  .tp-hero { min-height: 0; padding: 18px; border-radius: 12px; }
  .tp-hero::after { display: none; }
  .tp-boundary { grid-template-columns: auto 1fr; }
  .tp-boundary > b { grid-column: 2; justify-self: start; }
  .tp-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tp-action-list > button { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 74px; }
  .tp-action-list > button > .tp-chip { grid-column: 2; }
  .tp-action-list > button > b { grid-column: 3; grid-row: 1 / span 2; }
  .tp-order-items { grid-template-columns: 1fr; }
  .tp-order-items > button:nth-child(odd) { border-right: 0; }
  .tp-order-head { flex-direction: column; }
  .tp-order-head > div:last-child { justify-items: start; text-align: left; }
  .tp-detail-section dl { grid-template-columns: 1fr; }
  .tp-detail-section dl > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--tp-line); }
  .tp-detail-section dl > div:last-child { border-bottom: 0; }
  .tp-scope-list > div { grid-template-columns: 1fr; }
  .tp-form-grid,
  .tp-compliance-grid,
  .tp-invoice-money,
  .tp-invoice-meta { grid-template-columns: 1fr; }
  .tp-form-grid .wide { grid-column: auto; }
  .tp-reminder-steps { grid-template-columns: repeat(2, 1fr); }
  .tp-inline-form > footer,
  .tp-compliance-form > footer { align-items: stretch; flex-direction: column-reverse; }
  .tp-inline-form > footer button,
  .tp-compliance-form > footer button { min-height: 44px; }
  .tp-action-tray button,
  .tp-compliance-banner button,
  .tp-wide-btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tp-shell *,
  .tp-shell *::before,
  .tp-shell *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
