/* QR Actions: dark navy theme, mirrors the desktop tool. */
:root {
  --bg: #0b1220; --panel: #131c2e; --panel2: #18233a; --border: #26334d;
  --text: #e6ebf5; --muted: #8f9bb3; --accent: #4f9cff; --accent-dk: #2f7fe0;
  --ok: #3ddc84; --warn: #ffb454; --err: #ff6b6b; --yellow: #ffd54a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
  padding-top: env(safe-area-inset-top);
}

.TopBar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.Brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.Brand img { border-radius: 6px; }
.TopBar nav { display: flex; gap: 8px; }

.Main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; padding: 16px; max-width: 1000px; width: 100%; margin: 0 auto; }
@media (max-width: 760px) { .Main { grid-template-columns: minmax(0, 1fr); } .Row { flex-wrap: wrap; } }
.Panel { min-width: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }

.Row { display: flex; gap: 10px; align-items: flex-end; }
.Grow { flex: 1; }
.Field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.Field.Check { flex-direction: row; align-items: center; gap: 8px; }
.Cap { font-size: 12.5px; color: var(--muted); }
input[type=text], input[type=datetime-local], select, textarea {
  width: 100%; background: var(--panel2); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 64px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
input[type=datetime-local] { color-scheme: dark; }

.Hint { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.Idea { margin: 6px 0 0; padding: 8px 12px; border-left: 3px solid var(--yellow); background: var(--panel2); border-radius: 0 8px 8px 0; font-style: italic; }
.Errors { color: var(--err); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.MapBar { display: flex; gap: 8px; margin: 2px 0 8px; flex-wrap: wrap; }

button, a.Ghost { font: inherit; cursor: pointer; border-radius: 10px; padding: 10px 14px; border: 1px solid var(--border); background: var(--panel2); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.Primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.Primary:not(:disabled):hover { background: var(--accent-dk); }
.Ghost:not(:disabled):hover { border-color: var(--accent); }
.Ideas { font-family: Verdana, sans-serif; font-weight: 700; font-style: italic; color: var(--yellow); white-space: nowrap; margin-bottom: 10px; }
.Actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.Actions.Center { justify-content: center; margin-top: 12px; }
.Remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 14px; }

.PreviewPanel { display: flex; flex-direction: column; align-items: center; }
.PreviewBox { width: 100%; aspect-ratio: 1; background: #fff; border-radius: 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 2px dashed transparent; position: relative; }
.PreviewBox.drag { border-color: var(--accent); }
.PreviewBox img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.PreviewHint { color: #5b667c; text-align: center; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.PreviewHint strong { font-size: 18px; color: #3b4660; }
.PreviewHint span { font-size: 13px; }
.Cam { width: 100%; margin-top: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.Cam video { width: 100%; border-radius: 12px; background: #000; }
.PayloadWrap { width: 100%; margin-top: 12px; }
.PayloadWrap pre { background: var(--panel2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow: auto; margin: 4px 0 0; user-select: all; }

footer {
  padding: 10px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px;
  display: flex; gap: 16px; flex-wrap: wrap; align-items: center;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
footer a { color: var(--accent); text-decoration: none; }
.tip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tip a { border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; }
.tip a:hover { border-color: var(--accent); background: var(--panel); }

.Toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--panel2); border: 1px solid var(--accent); color: var(--text); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
.Toast.show { opacity: 1; transform: translateX(-50%); }
.Toast.warn { border-color: var(--warn); }
