/* postkontor.css · P43, Postkontor: the layout of the page that connects a
   domain, the page that audits one and the page inside the engines, on the
   design system's tokens. The buttons, segmented controls, cards, stats,
   banners, tables, trees, progress and budget bars are the design system's;
   this file places them and draws what the pages add: the lifecycle's
   steps, the log, the health grade and the zone file field. Every class
   starts with pk-. */

.pk { flex: 1; min-height: 0; overflow: auto; background: var(--paper); }
.pk-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 1320px; margin: 0 auto; padding: 28px 32px 80px; box-sizing: border-box; }
.pk-head { display: flex; flex-direction: column; gap: 6px; max-width: 820px; }
.pk-head > h1 { margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-550); color: var(--ink); }
.pk-head > p { margin: 0; color: var(--ink-2); text-wrap: pretty; }
.pk-h3 { margin: 4px 0 0; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: var(--fw-550); color: var(--ink); }
.pk-note { margin: 0; color: var(--ink-2); font-size: var(--fs-12); line-height: var(--lh-12); text-wrap: pretty; }
.pk-dim { color: var(--ink-3); font-size: var(--fs-12); line-height: var(--lh-12); }
.pk-line { margin: 0; color: var(--ink-2); max-width: 820px; text-wrap: pretty; }
.pk-line b { color: var(--ink); font-weight: var(--fw-550); }
.pk-status { margin: 0; min-height: var(--lh-12); color: var(--ink-2); font-size: var(--fs-12); line-height: var(--lh-12); }
.pk-spacer { flex: 1; }
.pk-bar, .pk-acts { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pk-bar [data-r="segmented"] { flex-wrap: wrap; max-width: 100%; }
.pk-wrap [data-r="card"] { min-width: 0; }
.pk-wrap [data-r="card"] > [data-part="body"] { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pk-wrap [data-part="table"] { overflow-x: auto; }
.pk-wrap td code, .pk-mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-12); font-variant-numeric: tabular-nums slashed-zero; overflow-wrap: anywhere; }
.pk-wrap [data-r="tree-item"] > [data-part="label"] { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-12); }

.pk-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
.pk-stats dd { margin: 0; }
.pk-stats [data-part="value"] { overflow: hidden; text-overflow: ellipsis; }
.pk-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pk-main, .pk-side, .pk-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pk-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* the lifecycle: the four states in a row, the ones passed filled, the one now ringed */
.pk-life { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.pk-life > li { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--ink-3); font-size: var(--fs-12); line-height: var(--lh-12); }
.pk-life > li > i { display: block; height: 4px; border-radius: var(--r-press); background: var(--well); box-shadow: inset 0 0 0 var(--px) var(--line-2); }
.pk-life > li[data-was] { color: var(--ink-2); }
.pk-life > li[data-was] > i { background: var(--success-dot); box-shadow: none; }
.pk-life > li[aria-current="step"] { color: var(--ink); font-weight: var(--fw-550); }
.pk-life > li[aria-current="step"] > i { background: var(--accent); box-shadow: none; }
.pk-life[data-off] > li[aria-current="step"] > i { background: var(--danger); }
.pk-log { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; max-height: 220px; overflow: auto; font-size: var(--fs-12); line-height: var(--lh-12); }
.pk-log > li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; color: var(--ink-2); }
.pk-log > li > b { color: var(--ink); font-weight: var(--fw-550); }
.pk-log > li > span:first-child { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* health: the grade as a letter beside the score, the problems in the order to fix them */
.pk-score { display: flex; align-items: center; gap: 12px; }
.pk-score b { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: var(--fw-550); color: var(--ink); font-variant-numeric: tabular-nums; }
.pk-grade { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-contain); background: var(--well); box-shadow: inset 0 0 0 var(--px) var(--line-2); font-size: var(--fs-16); line-height: 1; font-weight: var(--fw-550); color: var(--ink); }
.pk-grade[data-grade="A"] { background: var(--success-tint); color: var(--success-ink); box-shadow: none; }
.pk-grade[data-grade="B"], .pk-grade[data-grade="C"] { background: var(--warning-tint); color: var(--warning-ink); box-shadow: none; }
.pk-grade[data-grade="D"], .pk-grade[data-grade="F"] { background: var(--danger-tint); color: var(--danger-ink); box-shadow: none; }
.pk-problems { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pk-problems > li { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-12); line-height: var(--lh-12); color: var(--ink-2); }
.pk-problems > li > span:first-child { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: var(--fw-550); }
.pk-problems > li > span:first-child > em { margin-left: auto; font-style: normal; font-weight: var(--fw-450); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* the audit: the domain field and its four presets, the progress line, the SPF budget */
.pk-ask { display: flex; align-items: flex-end; gap: 8px 12px; flex-wrap: wrap; }
.pk-ask [data-r="form-row"] { flex: 1 1 260px; max-width: 420px; }
.pk-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.pk-progress { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.pk-budget { display: flex; align-items: center; gap: 12px; }
.pk-budget [data-r="budget-bar"] { max-width: 280px; }
.pk-budget[data-over] [data-part="done"] { background: var(--danger); }
.pk-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 12px; margin: 0; font-size: var(--fs-12); line-height: var(--lh-12); }
.pk-facts dt { color: var(--ink-3); }
.pk-facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.pk-notes { display: flex; flex-direction: column; gap: 4px; margin: 0; padding-left: 16px; color: var(--ink-2); font-size: var(--fs-12); line-height: var(--lh-12); }
.pk-notes:empty { display: none; }
.pk-pre { margin: 0; padding: 10px 12px; border-radius: var(--r-contain); background: var(--well); box-shadow: inset 0 0 0 var(--px) var(--line-2); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-12); line-height: 18px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); max-height: 200px; overflow: auto; }

/* the zone file: a field of the design system grown to a block of text */
.pk-area { height: auto; padding: 0; }
.pk-area > textarea { display: block; width: 100%; box-sizing: border-box; min-height: 260px; padding: 10px 12px; border: 0; resize: vertical; background: transparent; color: var(--ink); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: var(--fs-12); line-height: 18px; white-space: pre; outline: none; tab-size: 8; }

@media (max-width: 960px) {
  .pk-grid, .pk-two { grid-template-columns: minmax(0, 1fr); }
  .pk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pk-wrap { padding: 20px 16px 64px; }
  .pk-life { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
