/* Prompt Builder | Metics Media. Every style of the page (SPEC part 9). Light only: every color is a token on :root. */

@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #F5F4F0;
  --sheet: #FFFFFF;
  --ink: #0E0F12;
  --ink-soft: #5E6066;
  --hint: #6A6C70;
  --line: #E4E3DE;
  --box-line: #D9D8D3;
  --field-line: #8A8C91;
  --track: #EAE8E1;
  --mark: #FBE7A6;
  --accent: #1C6B53;
  --button-hover: #2A2C31;
  --hover: rgba(14, 15, 18, 0.04);
  --shadow-card: 0 1px 2px rgba(14, 15, 18, 0.05), 0 8px 24px rgba(14, 15, 18, 0.05);
  --shadow-raised: 0 1px 2px rgba(14, 15, 18, 0.10), 0 2px 8px rgba(14, 15, 18, 0.06);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Space Grotesk", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font-family: inherit; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* a touch screen draws no square flash over the page's round shapes: each has its own picked and copied states */
.tab,
.row,
.chip-label,
.copy-button,
.link-button { -webkit-tap-highlight-color: transparent; }

.icon { display: inline-block; flex: none; }

/* ---------- the header and the two tabs ---------- */

.site-header {
  background: var(--sheet);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1264px;
  margin: 0 auto;
  padding: 0 32px;
  height: 63px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.brand {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
}

.logo {
  display: block;
  height: 28px;
  width: auto;
}

.tabs {
  grid-column: 2;
  display: flex;
  padding: 4px;
  height: 52px;
  background: var(--track);
  border-radius: 14px;
}

.tab {
  appearance: none;
  margin: 0;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 184px;
  height: 44px;
  padding: 0 20px;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  font: 600 17px/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ease), color var(--ease), box-shadow var(--ease);
}

@media (hover: hover) {
  .tab[aria-selected="false"]:hover {
    background: var(--hover);
    color: var(--ink);
  }
}

.tab[aria-selected="true"] {
  background: var(--sheet);
  color: var(--ink);
  box-shadow: var(--shadow-raised);
}

.tab-badge {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-soft);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 13px/1 var(--font-head);
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.tab[aria-selected="true"] .tab-badge {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}

/* ---------- the column ---------- */

main { display: block; }

.panel {
  max-width: 784px;
  margin: 0 auto;
  padding: 20px 32px 0;
}

.noscript {
  max-width: 720px;
  margin: 20px auto 0;
  padding: 0 32px;
  font-size: 17px;
  line-height: 25px;
}

.intro { margin: 0 0 20px; }

h1 {
  margin: 0;
  font: 700 38px/42px var(--font-head);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lede {
  margin: 8px 0 0;
  font-size: 19px;
  line-height: 28px;
}

.phone-line {
  display: none;
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

@media (pointer: coarse) and (max-width: 759px) {
  .phone-line { display: block; }
}

.quiet-line {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 23px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.icon-lock {
  color: var(--accent);
  vertical-align: -2px;
  margin-right: 6px;
}

.icon-info {
  color: var(--ink-soft);
  vertical-align: -2px;
  margin-right: 6px;
}

/* the phone lines' icon (fix 2): the one intro line that changes what a phone viewer does gets the same icon slot as
   the lock and info lines, so it is not skimmed past */
.icon-phone {
  color: var(--ink-soft);
  vertical-align: -2px;
  margin-right: 6px;
}

/* ---------- cards ---------- */

.card {
  margin: 0 0 20px;
  padding: 24px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 30px;
}

.badge {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--sheet);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 15px/1 var(--font-head);
}

.badge-done { background: var(--accent); }

h2 {
  margin: 0;
  font: 700 24px/30px var(--font-head);
  letter-spacing: -0.01em;
}

.card-line {
  margin: 4px 0 0;
  padding: 0 0 0 42px;
  font-size: 17px;
  line-height: 25px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* a fieldset's legend drawn as a plain line */
.group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.group > legend {
  float: left;
  width: 100%;
}

.group > legend + * { clear: both; }

.field-legend {
  margin: 16px 0 0;
  padding: 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: var(--ink);
}

/* ---------- fields ---------- */

.field { margin-top: 16px; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: var(--ink);
}

.hint {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 23px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.box {
  display: block;
  width: 100%;
  height: 52px;
  margin: 8px 0 0;
  padding: 0 16px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.4;
  transition: border-color var(--ease), background-color var(--ease);
}

.box::placeholder {
  color: var(--hint);
  opacity: 1;
}

.box:focus { border-color: var(--ink); }

.box:focus-visible { outline-offset: 1px; }

.box:disabled {
  background: var(--paper);
  color: var(--ink-soft);
  -webkit-text-fill-color: var(--ink-soft);
  cursor: default;
}

.box-area {
  height: auto;
  min-height: 104px;
  max-height: 16rem;
  padding: 14px 16px;
  resize: vertical;
  overflow: auto;
  field-sizing: content;
}

/* ---------- checkbox and radio rows ---------- */

.rows { margin-top: 4px; }

.row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  margin: 0 -12px;
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color var(--ease);
}

@media (hover: hover) {
  .row:hover { background: var(--hover); }
}

.row-after-box { margin-top: 4px; }

.row input[type="checkbox"],
.row input[type="radio"] {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  cursor: pointer;
}

.row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.row-label {
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  color: var(--ink);
}

.row-sub {
  font-size: 16px;
  line-height: 23px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.indent {
  margin: 0 0 4px 34px;
  padding-left: 16px;
  border-left: 2px solid var(--line);
}

.indent-field { padding-top: 4px; padding-bottom: 4px; }

.indent > .row:first-child { margin-top: 0; }

/* ---------- the look ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font-weight: 500;
  font-size: 17px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--ease), color var(--ease), border-color var(--ease);
}

.chip-label .chip-off { color: var(--ink-soft); }

.chip-label .chip-on { display: none; }

@media (hover: hover) {
  .chip-input:not(:checked) + .chip-label:hover { background: var(--hover); }
}

.chip-input:checked + .chip-label {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--sheet);
}

.chip-input:checked + .chip-label .chip-off { display: none; }

.chip-input:checked + .chip-label .chip-on {
  display: inline-block;
  color: var(--sheet);
}

.chip-input:focus-visible + .chip-label {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- already in your prompt ---------- */

.done-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 42px;
}

.done-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 17px;
  line-height: 25px;
  color: var(--ink);
  text-wrap: pretty;
}

.done-list li + li { margin-top: 6px; }

.done-list .icon {
  color: var(--accent);
  margin-top: 3.5px;
}

/* ---------- your prompt ---------- */

.prompt-card { margin-bottom: 0; }

.prompt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  flex-wrap: wrap;
}

.prompt-side {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-soft);
}

.prompt {
  margin: 12px 0 0;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--box-line);
  border-radius: 14px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* the Main prompt never holds a line break (its list lines are joined with spaces), so it wraps normally: a space where
   a highlighted answer wraps is not painted yellow at the line's end. The Hosting prompt keeps pre-wrap for its line feed. */
#prompt-main { white-space: normal; }

/* typed words are isolated, so a direction mark a viewer pasted can never reorder the page's own words around them */
.prompt mark {
  unicode-bidi: isolate;
  background: var(--mark);
  color: var(--ink);
  border-radius: 4px;
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.blank {
  border: 1.5px dashed var(--field-line);
  border-radius: 6px;
  padding: 0 0.22em;
  color: var(--ink-soft);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.prompt .link {
  overflow-wrap: normal;
  word-break: normal;
}

.fill-line {
  margin: 12px 0 0;
  min-height: 24px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  text-wrap: pretty;
}

.fill-line .fill-lead { font-weight: 600; }

.fill-line .icon,
.status .icon {
  color: var(--accent);
  vertical-align: -4px;
  margin-right: 6px;
}

.link-button {
  display: inline-block;
  min-height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  line-height: 24px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (hover: hover) {
  .link-button:hover { text-decoration-thickness: 2px; }
}

.copy-button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 60px;
  margin: 12px 0 0;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--sheet);
  font-weight: 600;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--ease);
}

@media (hover: hover) {
  .copy-button:hover { background: var(--button-hover); }
}

.copy-button .check-icon { display: none; }

.copy-button.is-copied .copy-icon { display: none; }

.copy-button.is-copied .check-icon { display: inline-block; }

.copy-button.is-ready,
.copy-button.is-ready:hover { background: var(--accent); }

.status {
  margin: 10px 0 0;
  min-height: 24px;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.next {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 23px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.fallback { margin-top: 12px; }

.fallback-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
}

.fallback-box {
  display: block;
  width: 100%;
  margin: 8px 0 0;
  padding: 14px 16px;
  border: 1px solid var(--field-line);
  border-radius: 12px;
  background: var(--sheet);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  resize: vertical;
}

.fallback-box:focus { border-color: var(--ink); }

.fallback-box:focus-visible { outline-offset: 1px; }

.offscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.clear-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 16px 0 0;
}

.clear-status {
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.clear-button {
  font-size: 15px;
  color: var(--ink-soft);
}

/* ---------- the footer ---------- */

.site-footer {
  margin-top: 48px;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink-soft);
}

.site-footer cite { font-style: italic; }

/* ---------- the header in two rows, under 860 px ---------- */

@media (max-width: 859px) {
  .header-inner {
    height: auto;
    display: block;
    padding: 0 32px 10px;
  }

  .brand { height: 52px; }

  .tabs {
    width: max-content;
    margin: 0 auto;
  }
}

/* ---------- a phone, under 600 px ---------- */

@media (max-width: 599px) {
  .header-inner { padding: 0 16px 10px; }

  .tabs {
    width: 100%;
    height: 56px;
  }

  .tab {
    flex: 1 1 0;
    min-width: 0;
    height: 48px;
    padding: 0 8px;
    gap: 8px;
    font-size: 15px;
  }

  .logo { height: 24px; }

  .panel { padding: 20px 16px 0; }

  .noscript { padding: 0 16px; }

  h1 {
    font-size: 30px;
    line-height: 34px;
  }

  .lede {
    font-size: 17px;
    line-height: 25px;
  }

  .quiet-line {
    font-size: 15px;
    line-height: 22px;
  }

  .card {
    margin-bottom: 16px;
    padding: 20px;
    border-radius: 16px;
  }

  .prompt-card { margin-bottom: 0; }

  h2 {
    font-size: 21px;
    line-height: 26px;
  }

  .card-line {
    font-size: 16px;
    line-height: 24px;
  }

  .field-label,
  .row-label,
  .field-legend {
    font-size: 17px;
    line-height: 24px;
  }

  .hint,
  .row-sub,
  .next {
    font-size: 15px;
    line-height: 22px;
  }

  .fill-line,
  .status {
    font-size: 15px;
    line-height: 22px;
  }

  .box { font-size: 17px; }

  .chips { gap: 8px; }

  .chip-label {
    padding: 0 12px;
    font-size: 16px;
  }

  .done-list li {
    font-size: 16px;
    line-height: 24px;
  }

  .done-list .icon { margin-top: 3px; }

  .prompt-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .prompt {
    padding: 16px;
    font-size: 17px;
    line-height: 1.65;
  }

  .copy-button {
    height: 56px;
    font-size: 18px;
  }
}

/* ---------- very narrow: the tab badges hide so the names never wrap ---------- */

@media (max-width: 359px) {
  .tab-badge { display: none; }
}

/* ---------- reduced motion: nothing animates ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
