/* The marketplace engine's layout and structure, for the class names pages.py writes.

   It holds no brand's look. Everything a brand would change is a custom property that starts
   with --mk-, declared once below on .dir (the marketplace's outer element) with a plain default:
   dark text on a light ground, system fonts. A brand's skin is a second stylesheet, loaded after
   this one, that gives .dir its own values for these properties and adds decoration of its own.
   No rule here types a colour or a font family; they all read a --mk- property.

   Mobile first. Tables fold into cards under 720px, so a 390px phone never scrolls sideways. */
.dir{
  /* colours */
  --mk-ground:#fafafa;          /* behind the pages */
  --mk-text:#1f1f1f;            /* running text, form fields */
  --mk-text-strong:#111111;     /* headings, names, tile text */
  --mk-muted:#595959;           /* notes, captions, hints */
  --mk-link:#0b57d0;
  --mk-nav:var(--mk-text-strong); /* the links in the crumbs */
  --mk-line:#333333;            /* the borders of tables, cards and tiles */
  --mk-rule:#d6d6d6;            /* the thin line between table rows */
  --mk-line-soft:#9e9e9e;       /* the border of a small chip */
  --mk-surface:#ffffff;         /* tables, cards, tiles, the form */
  --mk-sunk:#efefef;            /* empty boxes, tiles under the pointer, the back tiles */
  --mk-strong-ground:#222222;   /* the sign at the top, table heads */
  --mk-strong-text:#ffffff;     /* text on the strong ground */
  --mk-accent:#ffd84d;          /* the sign's kicker, evidence labels, extra tiles, the draft banner */
  --mk-accent-text:#111111;     /* text and borders on the accent */
  --mk-alert:#b3261e;           /* the things to notice: an offer, an empty title, a tile's number */
  --mk-focus:#0b57d0;           /* the keyboard focus outline, on the ground and the surface */
  --mk-focus-strong:var(--mk-accent); /* the keyboard focus outline on the strong ground (the sign) */
  --mk-control:var(--mk-link);  /* accent-color: the checked radios and boxes of the form */
  /* fonts */
  --mk-font-body:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mk-font-display:var(--mk-font-body);
  --mk-font-ui:var(--mk-font-body);
  --mk-font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --mk-display-weight:700;
  --mk-display-case:none;
  --mk-label-case:uppercase;    /* the small labels: kickers, captions, table heads, chips, stamps */
  /* display sizes */
  --mk-size-title:clamp(2rem,5vw,3.8rem);        /* the page's name on the sign */
  --mk-size-heading:clamp(1.45rem,2.4vw,2.2rem); /* section headings */
  --mk-size-tile:1.25rem;                        /* a name on a hub tile */
  /* borders and radii */
  --mk-border-thin:1px;
  --mk-border:2px;
  --mk-border-thick:3px;
  --mk-radius-s:4px;
  --mk-radius-m:6px;
  --mk-radius-l:10px;
  --mk-radius-pill:100px;
  /* spacing */
  --mk-space-1:4px;
  --mk-space-2:8px;
  --mk-space-3:12px;
  --mk-space-4:16px;
  --mk-space-5:20px;
  --mk-space-6:24px;
  --mk-space-box:clamp(16px,2vw,24px);           /* inside a card or a box */
  --mk-space-section:clamp(30px,3.4vw,48px);     /* above a section heading */
  --mk-space-page:clamp(18px,3vw,48px) clamp(40px,5vw,80px); /* above and below the page */
  --mk-space-list:4px;                           /* between the stacked links of a list (the pages read) */
  /* text */
  --mk-leading:1.5;             /* the line height of running text, so stacked links are tall enough to tap */
  /* widths */
  --mk-width:1180px;
  --mk-measure:72ch;

  background:var(--mk-ground);color:var(--mk-text);font-family:var(--mk-font-body);line-height:var(--mk-leading);padding-block:var(--mk-space-page)}
/* every box inside the marketplace counts its padding and border in its width, so a folded table
   at 100% does not reach past the page on a phone, whatever the host's own stylesheet does */
.dir,.dir *,.dir *::before,.dir *::after{box-sizing:border-box}
.dir__in{max-width:var(--mk-width)}
.dir h2{font-family:var(--mk-font-display);font-weight:var(--mk-display-weight);font-size:var(--mk-size-heading);line-height:1.05;text-transform:var(--mk-display-case);color:var(--mk-text-strong);margin:var(--mk-space-section) 0 var(--mk-space-3)}
.dir h3{font-family:var(--mk-font-ui);font-weight:800;font-size:1.02rem;color:var(--mk-text-strong);margin:var(--mk-space-5) 0 var(--mk-space-1)}
.dir p,.dir li{max-width:var(--mk-measure);overflow-wrap:anywhere}
.dir a{color:var(--mk-link)}
.dir code{font-family:var(--mk-font-mono);font-size:.86em;overflow-wrap:anywhere}
.dir :focus-visible{outline:3px solid var(--mk-focus);outline-offset:2px}
.dir-sign :focus-visible{outline-color:var(--mk-focus-strong)}
/* the trap field of the form: out of sight, never display:none */
.dir .hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

/* the draft banner (draft: true) */
.dir-draft{margin:0 0 var(--mk-space-3);padding:var(--mk-space-2) var(--mk-space-3);background:var(--mk-accent);color:var(--mk-accent-text);font-family:var(--mk-font-ui);font-weight:700;border-radius:var(--mk-radius-s)}

/* where you are */
.dir-crumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 0;font-family:var(--mk-font-mono);font-size:12px}
.dir-crumbs li+li::before{content:"\203A";padding:0 var(--mk-space-2);color:var(--mk-muted)}
.dir-crumbs a{color:var(--mk-nav);font-weight:700;text-decoration:none;display:inline-block;padding:6px 0}
.dir-crumbs a:hover{text-decoration:underline}

/* the sign at the top of every page */
.dir-sign{position:relative;margin:26px 0 var(--mk-space-5);background:var(--mk-strong-ground);color:var(--mk-strong-text);border-radius:var(--mk-radius-s);padding:clamp(18px,2.2vw,30px) clamp(18px,2.4vw,34px)}
.dir-sign__no{margin:0;font-family:var(--mk-font-ui);font-weight:800;font-size:.78rem;letter-spacing:.16em;text-transform:var(--mk-label-case);color:var(--mk-accent)}
.dir-sign__name{margin:6px 0 0;font-family:var(--mk-font-display);font-weight:var(--mk-display-weight);font-size:var(--mk-size-title);line-height:.98;text-transform:var(--mk-display-case);overflow-wrap:anywhere}
.dir-sign__sub{margin:10px 0 0;font-size:clamp(.95rem,1.1vw,1.1rem);line-height:1.45;color:var(--mk-strong-text)}
.dir-sign__sub a{color:var(--mk-accent)}

.dir-lede{font-size:clamp(1rem,1.15vw,1.15rem);line-height:1.55}
.dir-tally{font-family:var(--mk-font-mono);font-size:.9rem;color:var(--mk-text-strong)}
.dir-count{font-weight:700}
.dir-note{font-size:.92rem;color:var(--mk-muted)}
.dir-slogan{color:var(--mk-alert);font-size:1.25rem;margin-top:36px}
.dir-list{padding-left:1.2em}
.dir-list li{margin:6px 0}

/* tables: real tables on a wide screen, stacked cards on a phone */
.dir-table,.dir-facts{width:100%;border-collapse:collapse;background:var(--mk-surface);border:var(--mk-border) solid var(--mk-line);font-size:.92rem}
.dir-table caption,.dir-facts caption{text-align:left;font-family:var(--mk-font-ui);font-weight:700;font-size:.82rem;letter-spacing:.06em;text-transform:var(--mk-label-case);color:var(--mk-muted);padding:0 0 var(--mk-space-2)}
.dir-table th,.dir-table td,.dir-facts th,.dir-facts td{padding:10px var(--mk-space-3);text-align:left;vertical-align:top;border-bottom:var(--mk-border-thin) solid var(--mk-rule)}
.dir-table thead th{background:var(--mk-strong-ground);color:var(--mk-strong-text);font-family:var(--mk-font-ui);font-size:.74rem;letter-spacing:.08em;text-transform:var(--mk-label-case)}
.dir-table tbody th{font-family:var(--mk-font-ui);font-weight:800}
.dir-facts th{width:30%;font-family:var(--mk-font-ui);font-weight:700;font-size:.8rem;letter-spacing:.04em;color:var(--mk-text-strong);background:var(--mk-ground)}
.dir-facts td{overflow-wrap:anywhere}
.dir-sources{margin:0;padding-left:1.1em}
.dir-sources li{margin-block:var(--mk-space-list)}
@media (max-width:720px){
  .dir-table,.dir-table tbody,.dir-table tr,.dir-table th,.dir-table td{display:block;width:100%}
  .dir-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
  .dir-table tr{border-bottom:var(--mk-border) solid var(--mk-line);padding:6px 0}
  .dir-table th,.dir-table td{border:0;padding:3px var(--mk-space-3)}
  .dir-table td::before{content:attr(data-label) ": ";font-family:var(--mk-font-ui);font-weight:700;font-size:.74rem;letter-spacing:.04em;text-transform:var(--mk-label-case);color:var(--mk-muted)}
  .dir-facts,.dir-facts tbody,.dir-facts tr,.dir-facts th,.dir-facts td{display:block;width:100%}
  .dir-facts th{border-bottom:0;padding-bottom:2px}
  /* A caption inside a block table shrinks to one word a line on a phone. */
  .dir-table caption,.dir-facts caption{display:block;width:100%;padding:var(--mk-space-2) var(--mk-space-3)}
}

/* the label on a plugin page: what it does, and its evidence */
.dir-label{background:var(--mk-surface);border:var(--mk-border-thick) solid var(--mk-line);border-radius:var(--mk-radius-l);padding:var(--mk-space-box);margin:0 0 18px}
.dir-label__text{margin:0;font-family:var(--mk-font-ui);font-weight:800;font-size:clamp(1.1rem,1.6vw,1.4rem);line-height:1.3;color:var(--mk-text-strong)}
.dir-evidence{margin:var(--mk-space-3) 0 0;font-size:.9rem}
.dir-evidence__label{display:inline-block;background:var(--mk-accent);color:var(--mk-accent-text);font-family:var(--mk-font-ui);font-weight:800;font-size:.72rem;letter-spacing:.08em;text-transform:var(--mk-label-case);padding:var(--mk-space-1) 9px;border-radius:var(--mk-radius-pill);margin-right:6px}
.dir-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--mk-space-3) 22px;margin:0 0 var(--mk-space-6)}
.dir-wrong{font-family:var(--mk-font-ui);font-weight:700}
.dir-price{font-family:var(--mk-font-mono);font-weight:700}
.dir-sale{color:var(--mk-alert)}

/* chips: the makers, more from the same category */
.dir-chips{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:var(--mk-space-2)}
.dir-chips li{background:var(--mk-surface);border:var(--mk-border-thin) solid var(--mk-line-soft);border-radius:var(--mk-radius-pill);padding:6px var(--mk-space-3);font-size:.88rem}
.dir-chips span{color:var(--mk-muted)}

/* empty and thin categories, the closed form */
.dir-empty,.dir-closed{background:var(--mk-sunk);border:var(--mk-border) dashed var(--mk-line);border-radius:var(--mk-radius-m);padding:var(--mk-space-box);margin:18px 0}
.dir-empty__title,.dir-closed__title{font-family:var(--mk-font-ui);font-weight:800;color:var(--mk-alert);font-size:1.05rem;margin-top:0}
.dir-thin{font-weight:600}

/* the other categories */
.dir-categories ul{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:var(--mk-space-2)}
.dir-categories a{display:block;background:var(--mk-surface);border:var(--mk-border) solid var(--mk-line);border-radius:var(--mk-radius-s);padding:var(--mk-space-2) 10px;text-decoration:none;font-family:var(--mk-font-ui);font-weight:700;color:var(--mk-text-strong)}
.dir-categories a span{display:block;font-size:.68rem;letter-spacing:.12em;text-transform:var(--mk-label-case);color:var(--mk-alert)}

/* the hub: a grid of tiles */
.dir-map{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.dir-map__cell a{display:flex;flex-direction:column;gap:var(--mk-space-1);height:100%;min-height:110px;box-sizing:border-box;padding:var(--mk-space-3);border-radius:var(--mk-radius-s);text-decoration:none;background:var(--mk-surface);border:var(--mk-border) solid var(--mk-line);color:var(--mk-text-strong)}
.dir-map__cell a:hover{background:var(--mk-sunk);color:var(--mk-text-strong)}
.dir-map__no{font-family:var(--mk-font-ui);font-weight:800;font-size:.7rem;letter-spacing:.14em;text-transform:var(--mk-label-case);color:var(--mk-alert)}
.dir-map__name{font-family:var(--mk-font-display);font-weight:var(--mk-display-weight);font-size:var(--mk-size-tile);line-height:1.05;text-transform:var(--mk-display-case)}
.dir-map__note{font-size:.82rem;color:var(--mk-muted);margin-top:auto}
/* an extra tile is on the accent, so its text and border are the accent's text; under the
   pointer it is on the sunk ground like every tile, with the tile's own colours */
.dir-map__cell--extra a{background:var(--mk-accent);border-color:var(--mk-accent-text);color:var(--mk-accent-text)}
.dir-map__cell--extra .dir-map__no,.dir-map__cell--extra .dir-map__note{color:var(--mk-accent-text)}
.dir-map__cell--extra a:hover{border-color:var(--mk-text-strong)}
.dir-map__cell a:hover .dir-map__no{color:var(--mk-alert)}
.dir-map__cell a:hover .dir-map__note{color:var(--mk-muted)}
.dir-map__cell--back a{background:var(--mk-sunk);border-style:dashed}

/* the opt-in list and its section for plugins made with AI */
.dir-ai{list-style:none;padding:0;display:flex;flex-wrap:wrap;gap:var(--mk-space-2)}
.dir-ai li{border:var(--mk-border) solid var(--mk-line);border-radius:var(--mk-radius-s);padding:6px 10px;background:var(--mk-surface)}
.dir-optin{list-style:none;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:var(--mk-space-3)}
.dir-optin__item{background:var(--mk-surface);border:var(--mk-border-thick) solid var(--mk-line);border-radius:var(--mk-radius-l);padding:var(--mk-space-4)}
.dir-optin__item h3{margin-top:0}
.dir-stamp{display:inline-block;border:var(--mk-border) solid var(--mk-alert);color:var(--mk-alert);font-family:var(--mk-font-mono);font-size:.78rem;text-transform:var(--mk-label-case);padding:3px var(--mk-space-2)}

/* the request form */
.dir-form{background:var(--mk-surface);border:var(--mk-border-thick) solid var(--mk-line);border-radius:var(--mk-radius-l);padding:clamp(16px,2vw,26px);max-width:640px;accent-color:var(--mk-control)}
.dir-form fieldset{border:0;margin:0 0 var(--mk-space-2);padding:0}
.dir-form legend{font-family:var(--mk-font-ui);font-weight:800;color:var(--mk-text-strong);margin-bottom:var(--mk-space-1)}
.dir-form label{display:block;font-family:var(--mk-font-ui);font-weight:700;font-size:.9rem;color:var(--mk-text-strong)}
.dir-form input[type=text],.dir-form input[type=url],.dir-form input:not([type]),.dir-form textarea,.dir-form select{display:block;width:100%;box-sizing:border-box;margin-top:var(--mk-space-1);border:var(--mk-border) solid var(--mk-line);border-radius:var(--mk-radius-s);padding:10px;font:inherit;background:var(--mk-surface);color:var(--mk-text)}
.dir-hint{display:block;font-size:.8rem;color:var(--mk-muted);margin-top:var(--mk-space-1)}
.dir-form button{cursor:pointer}
/* the engine's own button, when the pack gives it no class (css.button); a brand's class dresses its own */
.dir-form button:not([class]){font:inherit;font-family:var(--mk-font-ui);font-weight:700;background:var(--mk-strong-ground);color:var(--mk-strong-text);border:var(--mk-border) solid var(--mk-strong-ground);border-radius:var(--mk-radius-s);padding:10px var(--mk-space-4)}
.dir-form .form-status{font-family:var(--mk-font-mono);font-size:.85rem;color:var(--mk-text-strong)}
.dir .form-status:empty{display:none}
