/* MobileNtfy PWA - styles. No frameworks; light and dark mode follow the phone.
   Layout rule: nothing may be wider than the screen. Every grid/flex child can shrink
   (min-width: 0) and long text wraps, so the page always fits the phone's width. */

:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1a1f29;
  --muted: #5d6675;
  --line: #e2e6ec;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --danger: #c93c37;
  --ok: #1a7f37;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --card: #181c24;
    --text: #e8ebf0;
    --muted: #9aa3b2;
    --line: #2a303b;
    --accent: #4c8dff;
    --danger: #ff6b66;
    --ok: #4ac26b;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden; /* safety net: never scroll sideways */
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}

.top { display: flex; align-items: center; gap: 10px; padding: 18px 2px 10px; min-width: 0; }
.top img { border-radius: 9px; }
h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
/* minmax(0, 1fr): the column follows the screen width instead of growing with its content. */
main { width: 100%; max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.top { max-width: 560px; margin: 0 auto; }

.card { min-width: 0; overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.card.subtle { background: transparent; }
.hint { color: var(--muted); font-size: 14px; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
ol { padding-left: 20px; margin: 6px 0 12px; }

form { display: flex; gap: 8px; width: 100%; min-width: 0; }
input {
  flex: 1 1 0; min-width: 0; width: 100%;
  font: 600 18px/1 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

button {
  font: inherit; font-weight: 600; cursor: pointer;
  border: 0; border-radius: 10px; padding: 12px 14px;
  background: var(--accent); color: var(--accent-text);
  max-width: 100%; white-space: nowrap;
}
form button { flex: 0 0 auto; }
button:disabled { opacity: 0.55; cursor: default; }
button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--line); margin-top: 4px; }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
button.link { background: none; color: var(--accent); padding: 4px; font-weight: 500; }

.status { margin: 10px 0 0; min-height: 1.4em; font-size: 15px; }
.status.ok { color: var(--ok); }
.status.error { color: var(--danger); }

#messages { list-style: none; margin: 8px 0 0; padding: 0; }
#messages li { border-top: 1px solid var(--line); padding: 10px 0; }
#messages li:first-child { border-top: 0; }
.msg-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.msg-app { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-head time { flex: 0 0 auto; }
.msg-body { margin-top: 2px; overflow-wrap: anywhere; white-space: pre-line; } /* keep line breaks from the PC */
.msg-link { display: block; max-width: 100%; margin-top: 4px; color: var(--accent); font-size: 14px; word-break: break-all; }

.msg-body a { color: var(--accent); word-break: break-all; }
.version { max-width: 560px; margin: 18px auto 0; text-align: center; font-size: 12px; color: var(--muted); }

.update-bar {
  max-width: 560px; margin: 0 auto 12px; padding: 10px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 1px solid var(--accent); border-radius: 12px; font-size: 15px;
}
.update-bar[hidden] { display: none; }
.update-bar button { padding: 8px 14px; flex: 0 0 auto; }
