:root {
  --pt-blue-900: #0f4c88;
  --pt-blue-700: #1d5f9e;
  --pt-blue-100: #eaf3ff;
  --pt-blue-200: #d3e4f8;
  --pt-border: #d2e3f6;
  --pt-text: #173f67;
  --pt-muted: #56718d;
  --pt-orange: #f28a00;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f8fd;
  color: var(--pt-text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.pt-wrap {
  width: min(1160px, calc(100% - 28px));
  margin: 20px auto 28px;
  display: grid;
  gap: 12px;
}

.card {
  background: #fff;
  border: 1px solid var(--pt-border);
  border-radius: 14px;
  padding: 14px;
}

.pt-head.hero {
  background: linear-gradient(120deg, #0d4d8b, #1f6fb2 55%, #2f89d0);
  color: #f8fbff;
}

.pt-head.hero .pt-kicker {
  color: rgba(255, 255, 255, 0.82);
}

.pt-head.hero h1 {
  color: #ffffff;
}

.pt-head.hero .pt-description {
  color: #f3f8ff;
}

.pt-head.hero .chip {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.pt-kicker {
  margin: 0;
  color: var(--pt-muted);
  font-size: .85rem;
}

.pt-head h1 {
  margin: 6px 0 6px;
  color: var(--pt-blue-900);
}

.pt-description {
  margin: 0 0 8px;
  color: #264e75;
}

.pt-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--pt-blue-200);
  border-radius: 999px;
  background: var(--pt-blue-100);
  color: #1a4a78;
  padding: 7px 11px;
  font-size: .84rem;
}

.pt-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 4px;
}

.field span {
  font-size: .8rem;
  color: #2a5279;
  font-weight: 700;
}

.field input {
  border: 1px solid #c8daef;
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  color: #163e66;
}

.pt-actions {
  display: flex;
  gap: 8px;
  align-items: end;
}

.btn {
  border: 1px solid #c8daef;
  border-radius: 999px;
  background: #e9f2ff;
  color: #1d4f80;
  font: inherit;
  font-size: .86rem;
  font-weight: 700;
  padding: 9px 13px;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--pt-orange);
  background: var(--pt-orange);
  color: #fff;
}

.hidden { display: none !important; }

.pt-view-switch {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 10px;
}

.pt-status {
  min-height: 18px;
  font-size: .9rem;
  color: var(--pt-muted);
}

.pt-status.error {
  color: #9a2d2d;
}

.pt-status.success {
  color: #17603c;
}

.pt-export-card h2 {
  margin: 0 0 6px;
}

.pt-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.pt-export-actions .btn {
  min-width: 200px;
}

.pt-export-picker {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #d6e3f2;
  border-radius: 12px;
  background: #f7fbff;
}

.pt-export-picker-title {
  margin: 0 0 8px;
}

.pt-export-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pt-export-formats .btn {
  min-width: 110px;
}

.pt-export-format-active {
  box-shadow: 0 0 0 2px rgba(16, 75, 129, 0.18) inset;
}

.pt-export-status {
  margin: 8px 0 0;
  min-height: 20px;
  color: var(--pt-muted);
  font-size: .88rem;
}

.pt-export-status.error {
  color: #9a2d2d;
}

.pt-export-status.success {
  color: #17603c;
}

.pt-summary {
  margin-top: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-card {
  border: 1px solid #d9e8fb;
  border-radius: 12px;
  background: #f8fbff;
  padding: 9px;
}

.summary-card .label {
  color: var(--pt-muted);
  font-size: .78rem;
}

.summary-card .value {
  color: var(--pt-blue-900);
  font-size: 1.05rem;
  font-weight: 700;
}

.week {
  border: 1px solid #d6e5f7;
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
}

.week-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: #f4f9ff;
  border-bottom: 1px solid #e4eefb;
}

.week-head h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--pt-blue-900);
}

.week-meta {
  color: var(--pt-muted);
  font-size: .82rem;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
}

.day {
  border-right: 1px solid #ebf2fd;
  min-height: 180px;
  padding: 8px;
}

.day:last-child {
  border-right: 0;
}

.day-title {
  font-size: .8rem;
  color: #4f6d89;
  margin-bottom: 8px;
}

.session {
  border: 1px solid #cddff5;
  border-left: 4px solid #7fb0e2;
  border-radius: 10px;
  background: #ffffff;
  padding: 0;
  margin-bottom: 7px;
}

.session.session-intensity-low {
  border-left-color: #67b47c;
}

.session.session-intensity-moderate {
  border-left-color: #f0ad2c;
}

.session.session-intensity-high {
  border-left-color: #df7169;
}

.session-summary {
  padding: 0;
  overflow: hidden;
}

.session-open {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 10px 9px;
  cursor: pointer;
  display: grid;
  gap: 7px;
}

.session-open:hover,
.session-open:focus-visible {
  background: #f2f8ff;
}

.session-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 1px;
  font-size: .76rem;
  color: #1f5f98;
  font-weight: 700;
}

.session strong,
.session-title {
  display: block;
  color: #123f6a;
  font-size: .88rem;
  line-height: 1.25;
}

.session-meta {
  color: var(--pt-muted);
  font-size: .76rem;
  margin: 3px 0 5px;
}

.session-meta-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.session-meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #cfe0f4;
  background: #f2f7ff;
  color: #355d85;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1;
  padding: 5px 8px;
}

.small-note {
  color: var(--pt-muted);
  font-size: .84rem;
}

.ptv-week-card {
  border: 1px solid #efc38d;
  border-radius: 16px;
  background: #fffaf2;
  margin-bottom: 12px;
}

.ptv-week-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
}

.ptv-week-details > summary::-webkit-details-marker,
.ptv-session-details > summary::-webkit-details-marker {
  display: none;
}

.ptv-week-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ptv-week-title {
  display: grid;
  gap: 4px;
}

.ptv-week-badge {
  display: inline-flex;
  width: fit-content;
  border: 1px solid #e5b06b;
  border-radius: 999px;
  font-size: .77rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #94601d;
  padding: 4px 10px;
}

.ptv-week-title h4 {
  margin: 0;
  color: #0f2f52;
  line-height: 1.2;
  font-size: clamp(1rem, 1.5vw, 1.3rem);
}

.ptv-week-objective {
  margin: 0;
  color: #27486b;
  max-width: 900px;
}

.ptv-toggle-text {
  border: 1px solid #c8daef;
  border-radius: 999px;
  background: #f5f9ff;
  color: #2a5682;
  font-weight: 700;
  padding: 8px 13px;
  font-size: .9rem;
  white-space: nowrap;
}

.ptv-toggle-text .when-open { display: none; }
.ptv-week-details[open] .ptv-toggle-text .when-closed,
.ptv-session-details[open] .ptv-toggle-text .when-closed { display: none; }
.ptv-week-details[open] .ptv-toggle-text .when-open,
.ptv-session-details[open] .ptv-toggle-text .when-open { display: inline; }

.ptv-week-strip {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ptv-mini-chip {
  border: 1px solid #d1e2f6;
  border-radius: 999px;
  background: #f3f8ff;
  color: #1a476f;
  padding: 6px 11px;
  font-size: .83rem;
}

.ptv-intensity-chip.ptv-intensity-low {
  border-color: #9fd3ae;
  background: #ecf8ef;
  color: #1f6a3e;
}

.ptv-intensity-chip.ptv-intensity-moderate {
  border-color: #e7c07a;
  background: #fff6e8;
  color: #8f611d;
}

.ptv-intensity-chip.ptv-intensity-high {
  border-color: #e9b6b6;
  background: #fff0f0;
  color: #8f2a2a;
}

.ptv-week-content {
  border-top: 1px dashed #ecd4b8;
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
}

.ptv-week-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.ptv-kpi {
  border: 1px solid #d5e3f6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
  display: grid;
  gap: 4px;
}

.ptv-kpi span {
  color: #56708c;
  font-size: .84rem;
  font-weight: 700;
}

.ptv-kpi strong {
  color: #11365b;
  font-size: 1.08rem;
}

.ptv-week-gauge {
  margin-top: 3px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.ptv-week-gauge span {
  height: 9px;
  border-radius: 999px;
  background: #d3dce7;
}

.ptv-week-gauge span.on { background: #f0ad2c; }

.ptv-sessions-wrap {
  border: 1px solid #e8cfac;
  border-radius: 14px;
  padding: 12px;
  background: #fffcf7;
}

.ptv-sessions-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #1a4874;
  font-weight: 700;
}

.ptv-sessions-head strong {
  border: 1px solid #e4b06d;
  border-radius: 999px;
  min-width: 30px;
  text-align: center;
  padding: 2px 8px;
  color: #945e16;
}

.ptv-sessions-list {
  display: grid;
  gap: 10px;
}

.ptv-session-row {
  display: grid;
  gap: 5px;
}

.ptv-day-label {
  margin: 0;
  color: #526e89;
  font-weight: 700;
  font-size: .84rem;
}

.ptv-session {
  border: 1px solid #d9e7f8;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.ptv-session.ptv-intensity-low { border-left: 4px solid #67b47c; }
.ptv-session.ptv-intensity-moderate { border-left: 4px solid #f0ad2c; }
.ptv-session.ptv-intensity-high { border-left: 4px solid #df7169; }

.ptv-session-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
}

.ptv-session-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.ptv-session-head > div:first-child {
  min-width: 0;
}

.ptv-session-head h5 {
  margin: 0;
  color: #14385d;
  font-size: clamp(1rem, 1.4vw, 1.16rem);
  line-height: 1.24;
}

.ptv-session-actions {
  display: flex;
  width: 100%;
  justify-content: flex-end;
}

.ptv-session-actions .ptv-toggle-text {
  min-width: 116px;
  text-align: center;
}

.ptv-objective {
  margin: 3px 0 0;
  color: #355a7f;
}

.ptv-session-content {
  border-top: 1px dashed #d8e6f7;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.ptv-session-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.ptv-session-kpi {
  border: 1px solid #d5e3f6;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
  display: grid;
  gap: 3px;
}

.ptv-session-kpi span {
  color: #56708c;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ptv-session-kpi strong {
  color: #13395d;
  font-size: .95rem;
}

.ptv-session-kpi .ptv-session-kpi-intensity {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #d4e4f8;
  border-radius: 999px;
  padding: 4px 10px;
}

.ptv-session-kpi .ptv-session-kpi-intensity.ptv-intensity-low {
  border-color: #9fd3ae;
  background: #ecf8ef;
  color: #1f6a3e;
}

.ptv-session-kpi .ptv-session-kpi-intensity.ptv-intensity-moderate {
  border-color: #e7c07a;
  background: #fff6e8;
  color: #8f611d;
}

.ptv-session-kpi .ptv-session-kpi-intensity.ptv-intensity-high {
  border-color: #e9b6b6;
  background: #fff0f0;
  color: #8f2a2a;
}

.ptv-session-flow-title {
  margin: 2px 0 0;
  color: #1a436d;
  font-size: .95rem;
}

.ptv-session-flow {
  display: grid;
  gap: 10px;
}

.ptv-block {
  border: 1px solid #dce8f8;
  border-radius: 18px;
  background: #f5f7fa;
  padding: 10px 12px;
}

.ptv-block-repetition {
  border-color: #2f69f5;
  background: #f8fbff;
  position: relative;
  padding-top: 16px;
}

.ptv-repetition-badge {
  position: absolute;
  top: -15px;
  left: 14px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 4px 10px;
  border: 1px solid #90b0f8;
  border-radius: 999px;
  background: #e8f0ff;
  color: #2f5bbf;
  font-weight: 800;
  font-size: 1.02rem;
}

.ptv-repetition-steps {
  display: grid;
  gap: 8px;
}

.ptv-block-total {
  margin: 8px 4px 0;
  color: #4f6d89;
  font-size: .86rem;
  font-weight: 700;
}

.ptv-step-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 10px;
}

.ptv-step-card-compact {
  grid-template-columns: 80px minmax(0, 1fr);
}

.ptv-step-unit {
  color: #4d6984;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.3;
}

.ptv-step-body {
  display: grid;
  gap: 5px;
}

.ptv-step-type {
  color: #485e77;
  font-weight: 700;
  font-size: .95rem;
}

.ptv-step-line {
  border-radius: 18px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .92rem;
  font-weight: 700;
  line-height: 1.35;
}

.ptv-step-line > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ptv-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 14px;
}

.ptv-step-line.ptv-tone-low {
  background: #bfe3f8;
  color: #214c6e;
}

.ptv-step-line.ptv-tone-low .ptv-step-dot {
  background: #1ea1e5;
}

.ptv-step-line.ptv-tone-moderate {
  background: #f2debc;
  color: #5e4a2c;
}

.ptv-step-line.ptv-tone-moderate .ptv-step-dot {
  background: #c4903a;
}

.ptv-step-line.ptv-tone-high {
  background: #ddd6d2;
  color: #543f36;
}

.ptv-step-line.ptv-tone-high .ptv-step-dot {
  background: #7b5f53;
}

.ptv-step-secondary {
  margin-left: 14px;
  color: #5f748b;
  font-weight: 700;
  font-size: .82rem;
}

.pt-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}

.pt-modal.open {
  display: flex;
}

.pt-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(11, 33, 53, .45);
}

.pt-modal-card {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 18px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  background: #fff;
  border: 1px solid #cfe0f6;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 14px 34px rgba(10, 35, 58, .22);
}

.pt-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pt-modal-head h3 {
  margin: 0;
  color: var(--pt-blue-900);
}

.pt-modal-body {
  display: grid;
  gap: 8px;
}

.pt-export-email-modal-card {
  width: min(560px, calc(100% - 18px));
}

.pt-export-email-modal-card .field input {
  width: 100%;
}

.pt-export-newsletter-optin {
  margin-top: 4px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #2b4d71;
  font-weight: 600;
}

.pt-export-newsletter-optin input {
  margin-top: 3px;
}

.pt-export-modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}

@media (max-width: 1100px) {
  .pt-controls {
    grid-template-columns: 1fr 1fr;
  }
  .pt-actions {
    grid-column: span 2;
  }
  .days {
    grid-template-columns: 1fr;
  }
  .day {
    border-right: 0;
    border-bottom: 1px solid #ebf2fd;
    min-height: auto;
  }
  .day:last-child {
    border-bottom: 0;
  }
  .pt-summary {
    grid-template-columns: 1fr 1fr;
  }
  .ptv-week-kpis {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .ptv-session-kpis {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
  .ptv-session-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .ptv-session-actions {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .pt-controls {
    grid-template-columns: 1fr;
  }
  .pt-actions {
    grid-column: span 1;
  }
  .pt-summary {
    grid-template-columns: 1fr;
  }
  .pt-view-switch .btn {
    width: 100%;
  }
  .pt-export-actions .btn {
    width: 100%;
    min-width: 0;
  }
  .ptv-week-details > summary,
  .ptv-week-content,
  .ptv-session-details > summary,
  .ptv-session-content {
    padding: 10px;
  }
  .ptv-week-head {
    flex-direction: column;
    align-items: stretch;
  }
  .ptv-week-kpis {
    grid-template-columns: 1fr;
  }
  .ptv-session-kpis {
    grid-template-columns: 1fr;
  }
  .ptv-step-card,
  .ptv-step-card-compact {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .ptv-step-unit {
    font-size: .98rem;
  }
}
