/* The one product-demo layout: file bar, filters, eight cards, four charts,
   insights, table, paywall. Logical properties throughout so RTL needs no
   second stylesheet (SPEC §6.3.2). */

.pdash { --gap: 14px; }
.pdash .bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-block: 22px 16px;
}
.pdash .pchip {
  background: var(--paper2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font-size: 13.5px; color: var(--ink2); white-space: nowrap;
}
.pdash .pchip.demo { border-color: var(--acc-line); color: var(--acc); font-weight: 700; }
.pdash .pchip.mine { border-color: #199e70; color: #199e70; font-weight: 700; }
.pdash .pchip.trial { border-color: var(--acc-line); color: var(--acc); font-weight: 700; }
.pdash .bar .grow { flex: 1 1 auto; }

.pdash .filters {
  display: flex; flex-wrap: wrap; align-items: end; gap: 12px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px;
  padding: 14px 16px; margin-block-end: 18px;
}
.pdash .filters label { display: grid; gap: 5px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.pdash .filters select, .pdash .filters input {
  background: var(--paper2); color: var(--ink); border: 1px solid var(--line2);
  border-radius: 10px; padding: 8px 11px; font: inherit; font-size: 14px; min-width: 130px;
}
.pdash .filters .reset {
  margin-inline-start: auto; background: none; border: 0; color: var(--acc);
  font: inherit; font-weight: 700; cursor: pointer; padding: 8px 4px;
}

/* eight cards, 4×2 */
.pdash .pk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.pdash .pk {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px;
}
.pdash .pk h4 {
  margin: 0 0 8px; font-size: 11.5px; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
}
.pdash .pk .v { font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.pdash .pk .sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); }

/* charts */
.pdash .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin-top: var(--gap); }
.pdash .row1 { margin-top: var(--gap); }
.pdash .rowlast { display: grid; grid-template-columns: 3fr 2fr; gap: var(--gap); margin-top: var(--gap); }
.pdash .pbox {
  background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 18px;
  min-width: 0;
}
.pdash .pbox > h3 { margin: 0 0 2px; font-size: 16px; letter-spacing: -.02em; }
.pdash .pbox > .hint { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.pdash figure { margin: 0; position: relative; }
.pdash svg { display: block; width: 100%; height: auto; overflow: visible; }
.pdash .grid line { stroke: var(--line); stroke-width: 1; }
.pdash .axis text { fill: var(--muted); font-size: 11px; }
.pdash .legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 13px; color: var(--ink2); }
.pdash .legend span { display: inline-flex; align-items: center; gap: 7px; }
.pdash .legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }

.pdash .tip {
  position: absolute; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .12s;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 11px;
  font-size: 12.5px; line-height: 1.5; white-space: nowrap; box-shadow: 0 10px 30px #0006;
}
.pdash .tip.on { opacity: 1; }
.pdash .tip b { font-weight: 700; }

/* insights */
.pdash .ins { display: grid; gap: 10px; }
.pdash .ins li {
  list-style: none; display: flex; gap: 10px; align-items: start;
  background: var(--paper2); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font-size: 14px; color: var(--ink2); line-height: 1.7;
}
.pdash .ins li::before { content: "→"; color: var(--acc); font-weight: 800; flex: none; }

/* table */
.pdash .tablebox { margin-top: var(--gap); overflow: hidden; }
.pdash table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pdash th, .pdash td {
  text-align: start; padding: 9px 12px; border-block-end: 1px solid var(--line); white-space: nowrap;
}
.pdash th { color: var(--muted); font-weight: 700; font-size: 11.5px; letter-spacing: .6px; text-transform: uppercase; }
.pdash td { color: var(--ink2); }
.pdash .scroll { overflow-x: auto; }
.pdash .pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.pdash .pager button {
  background: var(--paper2); border: 1px solid var(--line2); color: var(--ink);
  border-radius: 9px; padding: 6px 13px; font: inherit; cursor: pointer;
}
.pdash .pager button[disabled] { opacity: .45; cursor: default; }

/* upload */
.pdash .up { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pdash .up .btn { white-space: nowrap; }
.pdash .report { margin-top: 12px; font-size: 13.5px; }
.pdash .report .bad { color: var(--bad); }
.pdash .report ul { margin: 8px 0 0; padding-inline-start: 18px; color: var(--ink2); }
.pdash .report li { margin: 3px 0; }

.pdash .paywall {
  margin-top: 26px; text-align: center; background: var(--paper);
  border: 1px solid var(--acc-line); border-radius: 22px; padding: 28px 24px;
}
.pdash .paywall h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.02em; }
.pdash .paywall p { margin: 0 0 18px; color: var(--muted); }

.pdash .loading { padding: 60px 0; text-align: center; color: var(--muted); }

@media (max-width: 1000px) {
  .pdash .pk-grid { grid-template-columns: repeat(2, 1fr); }
  .pdash .row2, .pdash .rowlast { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .pdash .pk-grid { grid-template-columns: 1fr 1fr; }
  .pdash .pk .v { font-size: 22px; }
}

/* template links + upload dialog */
.pdash .ptpl { font-size: 13px; color: var(--muted); display: inline-flex; gap: 8px; align-items: center; }
.pdash .ptpl a { color: var(--acc); font-weight: 700; text-decoration: none; }
.pdash .ptpl a:hover { text-decoration: underline; }
.pdash .bar .btn { padding: 9px 16px; font-size: 14px; }

dialog.pdlg {
  width: min(680px, 92vw); border: 1px solid var(--line2); border-radius: 20px;
  background: var(--paper); color: var(--ink); padding: 26px 28px 24px;
}
dialog.pdlg::backdrop { background: #000a; backdrop-filter: blur(3px); }
dialog.pdlg h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
dialog.pdlg .hint { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
dialog.pdlg .pfile {
  width: 100%; padding: 14px; border: 1px dashed var(--line2); border-radius: 14px;
  background: var(--paper2); color: var(--ink2); font: inherit; font-size: 14px;
}
dialog.pdlg .preport { margin-top: 16px; font-size: 13.5px; color: var(--ink2); }
dialog.pdlg .preport .bad { color: var(--bad); font-weight: 600; }
dialog.pdlg .preport ul { margin: 8px 0 0; padding-inline-start: 18px; }
dialog.pdlg .preport li { margin: 4px 0; }
dialog.pdlg .preport table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 6px; }
dialog.pdlg .preport th, dialog.pdlg .preport td {
  text-align: start; padding: 6px 9px; border-block-end: 1px solid var(--line); white-space: nowrap;
}
dialog.pdlg .preport th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
dialog.pdlg .scroll { overflow-x: auto; }
dialog.pdlg .pdlg-act { display: flex; gap: 10px; margin-top: 20px; }
dialog.pdlg .pdlg-x { position: absolute; inset-block-start: 14px; inset-inline-end: 16px; }
dialog.pdlg .pdlg-x button {
  background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
