/* drugaopinia.pl — strona czatu. Czcionki hostowane lokalnie (licencja OFL). */

@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonty/newsreader-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonty/newsreader-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fonty/newsreader-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fonty/newsreader-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonty/libre-franklin-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/static/fonty/libre-franklin-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/static/fonty/libre-franklin-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 500; font-display: swap;
  src: url(/static/fonty/libre-franklin-latin-ext-500-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fonty/libre-franklin-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Libre Franklin"; font-style: normal; font-weight: 600; font-display: swap;
  src: url(/static/fonty/libre-franklin-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: "Roboto Condensed"; font-style: normal; font-weight: 700; font-display: swap;
  src: url(/static/fonty/roboto-condensed-latin-700-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #E9EEF2; --surface: #FFFFFF; --ink: #15212F; --muted: #56657A; --line: #CFD8E1;
  --accent: #0E6468; --accent-soft: #DCEDEC; --warn: #9A3F0C; --warn-soft: #FBEBDD;
  --user: #15212F; --user-ink: #F3F6F8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F161E; --surface: #17212C; --ink: #E4EAF0; --muted: #93A2B4; --line: #2A3847;
    --accent: #5FB8B4; --accent-soft: #1B3436; --warn: #F0A36E; --warn-soft: #3A2517;
    --user: #DDE6EE; --user-ink: #101820;
    --logo-granat: #E4EAF0; --logo-napis: #E4EAF0; --logo-wspolne: var(--bg);
  }
}
:root[data-theme="dark"] {
  --bg: #0F161E; --surface: #17212C; --ink: #E4EAF0; --muted: #93A2B4; --line: #2A3847;
  --accent: #5FB8B4; --accent-soft: #1B3436; --warn: #F0A36E; --warn-soft: #3A2517;
  --user: #DDE6EE; --user-ink: #101820;
    --logo-granat: #E4EAF0; --logo-napis: #E4EAF0; --logo-wspolne: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1, h2 { font-family: "Newsreader", Georgia, "Times New Roman", serif; font-weight: 600; margin: 0; }
a { color: var(--accent); }

.app { display: grid; grid-template-columns: 320px 1fr; height: 100%; max-width: 1280px; margin: 0 auto; }

aside {
  padding: 28px 24px; border-right: 1px solid var(--line); overflow-y: auto;
  display: flex; flex-direction: column; gap: 22px;
}
.persona h1 { font-size: 1.75rem; line-height: 1.15; }
.persona h1 .logo { font-size: 1.9rem; }
.logo-link { text-decoration: none; }
/* Logo: znak + napis drugaopinia.pl */
.logo { display: inline-flex; align-items: center; gap: .5em; color: var(--logo-napis, #102F54); text-decoration: none; }
.logo__znak { width: 1.6em; height: auto; flex: none; }
.logo__granat { fill: var(--logo-granat, #102F54); }
.logo__turkus { fill: #65A4A2; }
.logo__wspolne { fill: var(--logo-wspolne, #FFFFFF); }
.logo__napis { font-family: "Roboto Condensed", "Arial Narrow", sans-serif; font-weight: 700; letter-spacing: -.01em; line-height: 1; }

.persona p { margin: .5rem 0 0; color: var(--muted); font-size: .93rem; }
.persona p.persona-lead { color: var(--ink); font-weight: 500; }
.wiecej { margin-top: .5rem; font-size: .93rem; }
.wiecej summary { cursor: pointer; color: var(--accent); font-weight: 500; width: fit-content; }
.wiecej summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 821px) {
  .wiecej { margin-top: 0; }
  .wiecej summary { display: none; }
}
.ai-note { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 12px 14px; font-size: .88rem; }
.ai-note strong { display: block; margin-bottom: 2px; }
.flags { background: var(--warn-soft); border-left: 3px solid var(--warn); padding: 12px 14px; font-size: .88rem; }
.flags strong { color: var(--warn); display: block; margin-bottom: 2px; }
/* Ostrzeżenie na starcie: modalne okno na środku, zamykane przyciskiem „Rozumiem”. */
.ostrzezenie {
  width: min(560px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto;
  border: 0; border-radius: 14px; padding: 28px; background: var(--surface); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.ostrzezenie::backdrop { background: rgba(15, 22, 30, .6); }
.ostrzezenie h2 { font-size: 1.6rem; margin-bottom: 16px; }
.ostrzezenie .ai-note, .ostrzezenie .flags { font-size: 1rem; padding: 14px 16px; margin-bottom: 12px; }
.ostrzezenie .flags { border-left-width: 5px; }
.ostrzezenie .flags strong { font-size: 1.1rem; }
.ostrzezenie form { display: block; padding: 8px 0 0; border: 0; background: none; }
.ostrzezenie .send { display: block; width: 100%; padding: 14px 20px; font-size: 1.05rem; }
.upload-link { display: block; border: 1px solid var(--accent); color: var(--accent); padding: 10px 14px; font-size: .88rem; font-weight: 600; text-align: center; text-decoration: none; }
.upload-link:hover { background: var(--accent-soft); }
.topics h2 { font-size: 1.1rem; margin-bottom: 8px; }
.topics button {
  display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line);
  padding: 10px 2px; color: var(--ink); font: inherit; font-size: .92rem; cursor: pointer;
}
.topics button:last-child { border-bottom: 1px solid var(--line); }
.topics button:hover { color: var(--accent); }
.topics button[disabled] { opacity: .5; cursor: default; }
.aside-stopka { margin-top: auto; font-size: .82rem; color: var(--muted); }

main { display: flex; flex-direction: column; min-height: 0; height: 100%; }

#log { flex: 1; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.msg { max-width: 68ch; }
.msg.bot { align-self: flex-start; }
.msg.bot .who {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
  font-family: "Roboto Condensed", "Arial Narrow", sans-serif; font-weight: 700;
  color: var(--logo-napis, #102F54); font-size: 1rem; line-height: 1;
}
.who__znak { width: 1.6em; height: auto; flex: none; }
/* Mruganie: tylko znak przy ostatniej odpowiedzi, co kilka sekund. */
.who__oczy { transform-box: fill-box; transform-origin: center; }
#log > .msg.bot:last-child .who__oczy { animation: mrugniecie 5s infinite; }
@keyframes mrugniecie {
  0%, 92%, 100% { transform: scaleY(1); }
  95% { transform: scaleY(.1); }
}
@media (prefers-reduced-motion: reduce) {
  #log > .msg.bot:last-child .who__oczy { animation: none; }
}
.msg.bot .body p { margin: 0 0 .7em; }
.msg.bot .body ul { margin: 0 0 .7em; padding-left: 1.2em; }
.msg.user {
  align-self: flex-end; background: var(--user); color: var(--user-ink);
  padding: 10px 14px; border-radius: 14px 14px 2px 14px; white-space: pre-wrap;
}
.msg.blad .body { color: var(--warn); }
.thinking { color: var(--muted); font-style: italic; }
.empty { margin: auto; max-width: 46ch; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 1.6rem; margin-bottom: 8px; }

form { display: flex; gap: 10px; padding: 16px 28px 8px; border-top: 1px solid var(--line); background: var(--bg); }
textarea {
  flex: 1; resize: none; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); min-height: 52px; max-height: 180px;
}
textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.send { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 0 20px; font: inherit; font-weight: 600; cursor: pointer; }
.send[disabled] { opacity: .5; cursor: default; }
.pasek-dolny {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 0 28px 16px; font-size: .82rem; color: var(--muted); min-height: 1.6em;
}
.status { color: var(--warn); }
.nowa { background: none; border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 4px 10px; font: inherit; cursor: pointer; }

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: auto; min-height: 100%; }
  aside { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px 16px; }
  .topics, .aside-stopka { display: none; }
  main { height: 85vh; height: 85dvh; }
  /* Przed pierwszą wiadomością pole pytania stoi zaraz pod zachętą, bez pustej przestrzeni. */
  main:has(#empty) { height: auto; }
  #log { padding: 20px 16px; }
  form { padding: 12px 16px 8px; }
  .pasek-dolny { padding: 0 16px 12px; }
}
