/* Avalos AI - shared styles for /device and /extension.
   Same-origin file so a strict `style-src 'self'` policy works (no inline CSS).
   No fonts, images or URLs are fetched from anywhere else. */

:root {
  color-scheme: light dark;
  --bg: #FAFAF7;
  --panel: #FFFFFF;
  --text: #1B1B1F;
  --muted: #565662;
  --line: #C9C8C0;
  --accent: #E5A200;
  --on-accent: #1B1B1F;
  --link: #6B4700;
  --focus: #0B57D0;
  --note-bg: #FFF6DC;
  --note-text: #1B1B1F;
  --note-line: #B67E00;
  --warn-bg: #FDECEC;
  --warn-text: #6E1010;
  --warn-line: #B3261E;
  --ok-bg: #E7F5EA;
  --ok-text: #12391C;
  --ok-line: #1E7B34;
  --code-bg: #F1F0EA;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0F14;
    --panel: #15161D;
    --text: #E9EAF0;
    --muted: #A3A7B7;
    --line: #3A3D4B;
    --accent: #E5A200;
    --on-accent: #1B1B1F;
    --link: #F5C542;
    --focus: #8AB4F8;
    --note-bg: #2A2410;
    --note-text: #E9EAF0;
    --note-line: #E5A200;
    --warn-bg: #2E1416;
    --warn-text: #FFC9C6;
    --warn-line: #F2837C;
    --ok-bg: #12261A;
    --ok-text: #C8F0D2;
    --ok-line: #5FC27A;
    --code-bg: #1E2029;
  }
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .5rem 0 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .01em;
}
.brand img { width: 28px; height: 28px; }

h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 .5rem; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.1rem 0 .4rem; }
h1:focus, h2:focus { outline: none; }
p, ul, ol, dl { margin: 0 0 .9rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0 0 .35rem; }

.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

a { color: var(--link); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: 2px; }

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.1rem;
  margin: 0 0 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 48px;
  padding: .6rem 1.3rem;
  border: 2px solid var(--text);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--code-bg); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.1rem 0 .25rem; }

.code {
  display: inline-block;
  padding: .45rem .9rem;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--text);
  font: 700 2rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: .12em;
  overflow-wrap: anywhere;
}

.hash, code {
  font: .92rem/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--code-bg);
  color: var(--text);
  padding: .1rem .35rem;
  border-radius: 6px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

label { display: block; font-weight: 700; margin: 0 0 .4rem; }
input[type="text"] {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: .55rem .8rem;
  border: 2px solid var(--text);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: 700 1.5rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
}
input[type="text"]::placeholder { color: var(--muted); opacity: 1; }
.field-hint { color: var(--muted); font-size: .95rem; margin: .4rem 0 0; }
.field-error { color: var(--warn-text); font-weight: 700; margin: .4rem 0 0; min-height: 1.2em; }

.note, .warn, .ok {
  border-left: 6px solid var(--note-line);
  background: var(--note-bg);
  color: var(--note-text);
  padding: .8rem 1rem;
  border-radius: 8px;
  margin: 0 0 1rem;
}
.warn { border-left-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-text); }
.ok   { border-left-color: var(--ok-line);   background: var(--ok-bg);   color: var(--ok-text); }
.note p:last-child, .warn p:last-child, .ok p:last-child { margin-bottom: 0; }

.who { font-weight: 700; overflow-wrap: anywhere; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

footer { margin-top: 2rem; color: var(--muted); font-size: .92rem; }

@media (max-width: 30rem) {
  body { font-size: 16px; }
  .code { font-size: 1.6rem; }
  .btn { width: 100%; }
}

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