/* Shared surfaces for settings, the API catalog and the phone player.
   Tokens already live in workmindr.css. These classes only add compact controls. */

.wm-page {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 32px) 80px;
  display: grid;
  gap: 18px;
}
.wm-kicker {
  margin: 0;
  color: var(--faint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wm-page h1 {
  margin: 4px 0 0;
  font-size: clamp(1.45rem, 2.4vw, 1.8rem);
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.wm-lead { margin: 6px 0 0; max-width: 62ch; color: var(--muted); line-height: 1.5; }

.wm-section {
  display: grid;
  gap: 10px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line);
}
.wm-section h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 620;
  letter-spacing: -0.02em;
}

.wm-btn, .wm-field input, .wm-field select {
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
}
.wm-btn { cursor: pointer; }
.wm-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .05); }
.wm-btn:disabled { opacity: .45; cursor: default; }
.wm-btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.wm-btn-primary:hover:not(:disabled) { background: #d5dcfb; }
.wm-field { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.wm-field input, .wm-field select { width: 100%; background: var(--surface); color: var(--text); }
.wm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.wm-note { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.wm-warning { margin: 0; padding-left: 10px; border-left: 2px solid rgba(251, 191, 36, .55); color: var(--muted); font-size: .88rem; }
.wm-status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.wm-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.wm-status[data-kind="ok"] { color: var(--text); }
.wm-status[data-kind="ok"]::before { background: var(--green, #5ec98f); }
.wm-status[data-kind="bad"]::before { background: var(--coral, #fda4af); }
.wm-status[data-kind="wait"]::before { background: var(--orange, #e8a84a); }

.wm-switch { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: .92rem; }
.wm-empty, .wm-error {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.wm-error { border-color: rgba(253, 164, 175, .45); color: var(--text); }

.wm-catalog { display: grid; gap: 8px; }
.wm-op {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 8px 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.wm-method { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--faint); }
.wm-method[data-method="GET"] { color: #a7f3d0; }
.wm-method[data-method="POST"], .wm-method[data-method="PUT"], .wm-method[data-method="PATCH"] { color: #fde68a; }
.wm-method[data-method="DELETE"] { color: #fda4af; }
.wm-path { margin: 0; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.wm-op p { margin: 2px 0 0; color: var(--muted); font-size: .84rem; }
.wm-pre {
  margin: 0;
  padding: 12px;
  overflow: auto;
  max-height: 320px;
  border-radius: 10px;
  background: #0c0c0e;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wm-wide { width: min(1120px, 100%); }
.wm-service-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 0;
  font-size: 1rem;
}
.wm-split { display: grid; gap: 14px; }
.wm-split .wm-pre { max-height: 240px; }
#devParams { display: grid; gap: 8px; margin-bottom: 8px; }
#devParams:empty { display: none; }

article.wm-gap .wm-gap-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 12px;
  border-bottom: 1px solid var(--line);
}
#view-detail button.wm-gap-tab {
  width: auto;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
#view-detail button.wm-gap-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
article.wm-gap > .wm-gap-es,
article.wm-gap > .wm-gap-summary { display: none; }
article.wm-gap[data-gap="original"] > #ltRead { display: none; }
article.wm-gap[data-gap="es"] > .mtg-kicker,
article.wm-gap[data-gap="es"] > #ltOriginal,
article.wm-gap[data-gap="es"] > #ltRead,
article.wm-gap[data-gap="summary"] > .mtg-kicker,
article.wm-gap[data-gap="summary"] > #ltOriginal,
article.wm-gap[data-gap="summary"] > .wm-gap-es { display: none; }
article.wm-gap[data-gap="es"] > .wm-gap-es { display: block; }
article.wm-gap[data-gap="summary"] > #ltRead { display: block; }
article.wm-gap[data-gap="summary"] > #ltRead:empty + .wm-gap-summary { display: block; }

@media (min-width: 900px) {
  .wm-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; }
}

@media (max-width: 720px) {
  .wm-page { padding: 18px 16px 96px; }
  .wm-btn, .wm-field input, .wm-field select, #view-detail button.wm-gap-tab { min-height: 44px; height: 44px; }
  .wm-op { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .wm-btn, .wm-status::before { transition: none; }
}
