.pm-shell {
  --pm-ink: #18201d;
  --pm-muted: #68736e;
  --pm-paper: #fbfaf6;
  --pm-line: #d9ddd7;
  --pm-accent: #b75522;
  color: var(--pm-ink);
  display: grid;
  gap: 1rem;
}

.pm-hero {
  align-items: end;
  background: linear-gradient(135deg, #1b2924, #293a33);
  border-radius: 18px;
  color: #f8f3e8;
  display: flex;
  gap: 1.25rem;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  position: relative;
}

.pm-hero::after {
  background: repeating-linear-gradient(90deg, transparent 0 23px, #ffffff10 24px 25px);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.pm-hero p { color: #f2a26f; font: 700 .72rem/1.2 ui-monospace, monospace; letter-spacing: .15em; margin: 0 0 .55rem; }
.pm-hero h2 { font: 650 clamp(1.45rem, 3vw, 2.35rem)/1.05 Georgia, serif; margin: 0 0 .7rem; }
.pm-hero span { color: #cbd5cf; display: block; max-width: 44rem; }
.pm-rule { border-left: 2px solid #de7842; min-width: 13rem; padding-left: 1rem; position: relative; z-index: 1; }
.pm-rule strong { color: #ffd1b5; display: block; font: 700 .85rem ui-monospace, monospace; margin-bottom: .35rem; }
.pm-rule span { font-size: .82rem; }

.pm-tabs { border-bottom: 1px solid var(--pm-line); display: flex; gap: .25rem; overflow-x: auto; }
.pm-tabs button { background: transparent; border: 0; border-bottom: 3px solid transparent; color: var(--pm-muted); min-height: 44px; padding: .7rem 1rem; white-space: nowrap; }
.pm-tabs button.active { border-color: var(--pm-accent); color: var(--pm-ink); font-weight: 700; }
.pm-tabs span { background: #e9ece8; border-radius: 999px; font-size: .72rem; margin-left: .35rem; padding: .12rem .42rem; }
.pm-panel { background: var(--pm-paper); border: 1px solid var(--pm-line); border-radius: 14px; min-width: 0; padding: 1rem; }

.pm-create { background: #f0efe9; border: 1px solid var(--pm-line); border-radius: 10px; margin-bottom: 1rem; }
.pm-create summary { cursor: pointer; font-weight: 700; min-height: 44px; padding: .75rem 1rem; }
.pm-create form { display: grid; gap: .8rem; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0 1rem 1rem; }
.pm-create label { color: var(--pm-muted); display: grid; font-size: .78rem; gap: .35rem; }
.pm-create input, .pm-batchbar select { background: white; border: 1px solid #bcc4be; border-radius: 8px; color: var(--pm-ink); min-height: 44px; padding: .65rem .75rem; }
.pm-create p { color: var(--pm-muted); font-size: .76rem; grid-column: 1 / -1; margin: 0; }
.pm-create button { justify-self: start; }

.pm-table-wrap { overflow-x: auto; }
.pm-table { border-collapse: collapse; min-width: 760px; width: 100%; }
.pm-table th { color: var(--pm-muted); font-size: .72rem; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.pm-table th, .pm-table td { border-bottom: 1px solid var(--pm-line); padding: .8rem .65rem; vertical-align: middle; }
.pm-table tbody tr:hover { background: #f4f3ed; }
.pm-table small { color: var(--pm-muted); display: block; font-size: .7rem; margin-top: .25rem; }
.pm-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.pm-status { border-radius: 999px; display: inline-flex; font-size: .76rem; padding: .28rem .55rem; }
.pm-status.is-active { background: #dcece1; color: #235d38; }
.pm-status.is-inactive { background: #eee6d3; color: #7a5b18; }
.pm-status.is-archived { background: #e6e6e6; color: #656565; }
.pm-row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.pm-row-actions button, .pm-batchbar button, .pm-error button, .pm-dialog button { border: 1px solid #aeb7b1; border-radius: 8px; min-height: 44px; padding: .55rem .75rem; }
.pm-primary { background: var(--pm-accent) !important; border-color: var(--pm-accent) !important; color: white !important; font-weight: 700; }
.pm-primary:disabled { cursor: not-allowed; opacity: .45; }

.pm-batchbar { align-items: end; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: flex-end; margin-bottom: .6rem; }
.pm-batchbar > span { margin-right: auto; padding: .7rem 0; }
.pm-batchbar label { color: var(--pm-muted); display: grid; font-size: .75rem; gap: .3rem; min-width: min(100%, 20rem); }
.pm-scope-note { color: var(--pm-muted); font-size: .78rem; margin: 0 0 1rem; }
.pm-events { display: grid; gap: .65rem; list-style: none; margin: 0; padding: 0; }
.pm-events li { border-left: 3px solid #cbd1cc; display: grid; gap: .25rem; padding: .6rem .8rem; }
.pm-events small { color: var(--pm-muted); overflow-wrap: anywhere; }
.pm-event-action { color: var(--pm-accent); font: 700 .7rem ui-monospace, monospace; text-transform: uppercase; }
.pm-empty, .pm-loading, .pm-error { color: var(--pm-muted); display: grid; gap: .6rem; justify-items: start; padding: 2rem 1rem; }
.pm-error { background: #fff2ec; border: 1px solid #e6b49a; border-radius: 10px; color: #7d3216; }
.pm-notice { background: #e8f2eb; border-left: 4px solid #43835a; border-radius: 6px; color: #285d39; padding: .75rem 1rem; }

.pm-dialog-backdrop { align-items: center; background: #0e1714aa; display: flex; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: 1200; }
.pm-dialog { background: #fffdf8; border-radius: 14px; box-shadow: 0 24px 70px #0005; max-width: 34rem; padding: 1.25rem; width: 100%; }
.pm-dialog header p { color: var(--pm-accent); font: 700 .7rem ui-monospace, monospace; margin: 0; }
.pm-dialog h3 { font-family: Georgia, serif; margin: .35rem 0 1rem; }
.pm-dialog dl { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.pm-dialog dl div { background: #f0efe9; border-radius: 8px; padding: .7rem; }
.pm-dialog dt { color: var(--pm-muted); font-size: .7rem; }
.pm-dialog dd { font-weight: 700; margin: .25rem 0 0; }
.pm-dialog footer { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; }

@media (max-width: 900px) {
  .pm-hero { align-items: start; flex-direction: column; }
  .pm-rule { border-left: 0; border-top: 2px solid #de7842; min-width: 0; padding: .8rem 0 0; width: 100%; }
  .pm-create form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .pm-panel { padding: .75rem; }
  .pm-create form { grid-template-columns: 1fr; }
  .pm-batchbar { align-items: stretch; flex-direction: column; }
  .pm-batchbar > span { margin: 0; }
  .pm-batchbar label { min-width: 0; }
  .pm-dialog dl { grid-template-columns: 1fr; }
  .pm-dialog footer { flex-direction: column-reverse; }
  .pm-dialog button { width: 100%; }
}

[data-theme="dark"] .pm-shell { --pm-ink: #edf2ee; --pm-muted: #aeb9b3; --pm-paper: #1d2521; --pm-line: #3d4943; }
[data-theme="dark"] .pm-panel, [data-theme="dark"] .pm-dialog { background: #1d2521; }
[data-theme="dark"] .pm-create, [data-theme="dark"] .pm-dialog dl div { background: #252f2a; }
[data-theme="dark"] .pm-create input, [data-theme="dark"] .pm-batchbar select { background: #15201b; color: #edf2ee; }
[data-theme="dark"] .pm-table tbody tr:hover { background: #252f2a; }

