/* ==========================================================================
   WEBKMT mini-app shell — token typography, exit bar, flat surfaces
   Loads after design-tokens.css on every /mini-apps/* page.
   ========================================================================== */
body {
  margin: 0;
  background: var(--dt-bg-primary);
  color: var(--dt-ink);
  font-family: var(--dt-font-latin), "Segoe UI", sans-serif;
}
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
html[dir="rtl"] body, body[dir="rtl"], html:lang(ar) body {
  font-family: var(--dt-font-arabic-text), var(--dt-font-latin), sans-serif;
}
h1, h2, h3, h4 { color: var(--dt-ink); letter-spacing: -0.01em; }
p { color: var(--dt-ink-muted); }

/* Sticky exit bar: brand, tool name, X */
.wkma-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--dt-space-300);
  padding: var(--dt-space-300) var(--dt-space-400);
  background: var(--dt-elev-1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--dt-hairline);
}
.wkma-bar img { width: 28px; height: 28px; display: block; }
.wkma-bar__name { font-weight: 700; font-size: 16px; line-height: 24px; color: var(--dt-ink); }
.wkma-bar__tag {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dt-accent-text);
}
.wkma-bar__x {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid var(--dt-hairline);
  border-radius: var(--dt-radius-md);
  color: var(--dt-ink-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dt-duration-hover) var(--dt-ease-base),
              border-color var(--dt-duration-hover) var(--dt-ease-base),
              box-shadow var(--dt-duration-hover) var(--dt-ease-base);
}
.wkma-bar__x:hover { color: var(--dt-accent-text); border-color: var(--dt-accent-muted); box-shadow: var(--dt-glow-bright); }

/* Keyless / status notice */
.wkma-note {
  border: 1px dashed var(--dt-hairline-strong);
  border-radius: var(--dt-radius-xl);
  padding: var(--dt-space-400);
  background: var(--dt-elev-1);
  color: var(--dt-ink-muted);
  margin: var(--dt-space-400);
}

/* Element-level consistency over legacy page classes */
input, select, textarea {
  background: var(--dt-bg-surface);
  color: var(--dt-ink);
  border: 1px solid var(--dt-focus-ring);
  border-radius: var(--dt-radius-md);
  font: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--dt-focus-ring);
  outline-offset: 2px;
  border-color: var(--dt-accent-bright);
}
button { font-family: inherit; border-radius: var(--dt-radius-md); }
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--dt-focus-ring);
  outline-offset: 2px;
}

/*
  Shared tool icon contract: inline vectors inherit tokenized foreground color.
  Fill artwork opts into .ui-brand-icon; all other icons use stroke geometry.
*/
.ui-icon,
.profile-link-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ui-icon--large { width: 1em; height: 1em; }
.ui-brand-icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  vertical-align: -0.15em;
  fill: currentColor;
  stroke: none;
}
input::placeholder,
textarea::placeholder { color: var(--dt-ink-muted); opacity: 1; }
select option { background: var(--dt-bg-surface); color: var(--dt-ink); }
