/* ================= MARKA =================
   Przy zmianie marki wystarczy zmienić te zmienne (oraz ikony PNG i theme-color w index.html / manifeście). */
:root {
  --brand-dark: #46413E;     /* grafit */
  --brand-light: #F7F5F2;    /* ciepła biel */
  --brand-soft: #E5BDB3;     /* pudrowy róż */
  --brand-accent: #B89258;   /* złoto */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
}
/* ========================================= */

:root {
  --bg: var(--brand-light); --surface: #fff; --text: #2b2826; --muted: #8d857f; --line: #ebe5df;
  --ok: #5b7f5e; --bad: #a8503f; --shadow: 0 1px 2px rgba(70,65,62,.06), 0 6px 20px rgba(70,65,62,.07);
  --accent-soft: color-mix(in srgb, var(--brand-accent) 14%, transparent);
  --safe-b: env(safe-area-inset-bottom); --safe-t: env(safe-area-inset-top);
  --r: 18px; --ease: cubic-bezier(.2,.8,.2,1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1f1d1c; --surface: #2a2725; --text: #f1ece7; --muted: #a39b94; --line: #3a3633;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
[hidden] { display: none !important; }
.defs { position: absolute; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round;
  stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; border: 0; border-radius: 14px; padding: 13px 16px; cursor: pointer;
  transition: transform .15s var(--ease), background .2s, opacity .2s; }
button:active { transform: scale(.97); }
button:disabled { opacity: .55; }
.primary { background: var(--brand-dark); color: #fff; font-weight: 600; width: 100%; display: flex;
  align-items: center; justify-content: center; gap: 10px; }
.primary.gold, .round.gold { background: var(--brand-accent); color: #fff; }
input, textarea { font: inherit; width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: var(--surface); color: var(--text); outline: none; transition: border-color .2s; }
input:focus, textarea:focus { border-color: var(--brand-accent); }
.screen { height: 100%; }
.eyebrow { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mono { width: 88px; height: 88px; border-radius: 26px; display: grid; place-items: center;
  background: linear-gradient(150deg, #57504c, var(--brand-dark)); color: var(--brand-accent);
  font: 600 56px/1 var(--font-display); box-shadow: inset 0 0 0 1px rgba(184,146,88,.35), 0 10px 30px rgba(0,0,0,.25); }
.mono.sm { width: 32px; height: 32px; border-radius: 10px; font-size: 20px; box-shadow: inset 0 0 0 1px rgba(184,146,88,.4); }

/* ---------- logowanie ---------- */
#login { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--brand-dark); color: #fff; }
.glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; top: -180px; right: -200px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-accent) 40%, transparent), transparent 65%);
  animation: drift 14s ease-in-out infinite alternate; pointer-events: none; }
.glow::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; left: -240px; top: 520px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand-soft) 30%, transparent), transparent 65%); }
@keyframes drift { to { transform: translate(-40px, 60px) scale(1.08); } }
.login-box { position: relative; width: 100%; max-width: 340px; display: grid; gap: 16px; justify-items: center;
  text-align: center; animation: rise .7s var(--ease) both; }
.login-sub { margin: 4px 0 18px; font: 400 22px/1.2 var(--font-display); color: #efe7de; }
#login details { width: 100%; text-align: left; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px; padding: 12px 14px; }
#login details[open] { display: grid; gap: 10px; }
#login summary { cursor: pointer; color: #e6dccf; font-size: 14px; list-style: none; text-align: center; }
#login summary::-webkit-details-marker { display: none; }
#login input { background: rgba(255,255,255,.95); color: #2b2826; }
.hint { color: #bfb5ab; font-size: 13px; margin: 0; }
.msg { min-height: 1.4em; color: var(--brand-soft); margin: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ---------- szkielet aplikacji ---------- */
#app { display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 4px; padding: calc(10px + var(--safe-t)) 12px 10px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); border-bottom: 1px solid var(--line); z-index: 2; }
.brand { flex: 1; display: flex; align-items: center; gap: 10px; }
.brand .title { font: 600 19px/1 var(--font-display); }
.icon-btn { background: none; padding: 8px; border-radius: 12px; color: var(--muted); }
main { flex: 1; min-height: 0; position: relative; }
.tab { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 16px 24px;
  animation: fade .28s var(--ease); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
h2 { font: 600 13px/1 var(--font-body); color: var(--muted); text-transform: uppercase; letter-spacing: .08em;
  margin: 20px 4px 10px; }
h2:first-child { margin-top: 4px; }

/* ---------- Dziś ---------- */
.hello { margin: 4px 4px 16px; }
.hello h1 { margin: 4px 0 0; font: 500 30px/1.15 var(--font-display); letter-spacing: -.01em; }
.hero { display: flex; align-items: center; gap: 18px; padding: 18px; position: relative; overflow: hidden;
  background: linear-gradient(140deg, #534c48, var(--brand-dark)); color: #fff; }
.hero .eyebrow { color: #cdbfae; }
.ring { width: 108px; height: 108px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: rgba(255,255,255,.1); }
.ring-fg { stroke: var(--brand-accent); stroke-linecap: round; stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 1.1s var(--ease); }
.ring-label { position: absolute; left: 18px; width: 108px; display: grid; justify-items: center; }
.ring-label b { font: 600 32px/1 var(--font-display); }
.ring-label span { font-size: 12px; color: #cdbfae; }
.hero-line { margin: 6px 0 0; font: 400 18px/1.3 var(--font-display); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px;
  display: grid; gap: 2px; text-align: left; }
.tile-num { font: 600 28px/1.1 var(--font-display); }
.tile-lab { font-size: 13px; color: var(--muted); }
.tile.accent .tile-num { color: var(--brand-accent); }
.tile.alert .tile-num { color: var(--bad); }
.recon { padding: 14px 16px; }
.card-head { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.card-head span { flex: 1; }
.card-head b { background: var(--accent-soft); color: var(--brand-accent); border-radius: 10px; padding: 2px 9px; font-size: 14px; }
.mini { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.mini li { display: grid; padding-top: 8px; border-top: 1px solid var(--line); }
.mini li span { font-size: 13px; color: var(--muted); }
.talk { margin-top: 14px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--surface); box-shadow: var(--shadow); color: var(--brand-accent); font-weight: 600; }

/* ---------- czat ---------- */
#tab-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
#messages { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 84%; padding: 10px 14px; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word;
  animation: pop .25s var(--ease); line-height: 1.4; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.bubble.in { align-self: flex-end; background: var(--brand-dark); color: #fff; border-bottom-right-radius: 6px; }
.bubble.out { align-self: flex-start; background: var(--surface); box-shadow: var(--shadow); border-bottom-left-radius: 6px; }
.bubble.out::before { content: "Jarvis"; display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--brand-accent); margin-bottom: 2px; }
.bubble time { display: block; font-size: 11px; opacity: .55; margin-top: 4px; text-align: right; }
.bubble a.file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: inherit; font-weight: 600; }
.bubble audio { width: 230px; max-width: 100%; height: 36px; }
.day { align-self: center; font-size: 12px; color: var(--muted); margin: 10px 0 4px; padding: 3px 10px;
  border-radius: 10px; background: var(--accent-soft); }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-accent); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
#composer { display: flex; gap: 8px; align-items: flex-end; padding: 8px 10px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 88%, transparent); border-top: 1px solid var(--line); }
#composer textarea { resize: none; max-height: 140px; border-radius: 22px; padding: 11px 16px; }
.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--brand-dark); color: #fff; }
#btn-mic { touch-action: none; user-select: none; -webkit-user-select: none; position: relative; }
#btn-mic.rec { background: var(--bad); transform: scale(1.18); }
#btn-mic.rec::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--bad);
  animation: pulse 1.2s ease-out infinite; }
@keyframes pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.5); } }
#rec { position: absolute; left: 12px; right: 70px; bottom: calc(14px + var(--safe-b)); height: 46px;
  display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 23px; background: var(--surface);
  box-shadow: var(--shadow); font-variant-numeric: tabular-nums; }
#rec .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
#rec .rec-hint { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---------- listy: zadania i zatwierdzenia ---------- */
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list li { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: flex;
  gap: 12px; align-items: flex-start; transition: opacity .35s, transform .35s var(--ease); animation: pop .25s var(--ease); }
.list li.leaving { opacity: 0; transform: translateX(40px); }
.list li.empty { color: var(--muted); justify-content: center; box-shadow: none; background: transparent;
  border: 1.5px dashed var(--line); }
.check { flex: none; width: 30px; height: 30px; border-radius: 50%; padding: 0; display: grid; place-items: center;
  border: 2px solid var(--brand-accent); background: transparent; color: #fff; }
.check .ic { width: 18px; height: 18px; stroke-width: 2.6; stroke-dasharray: 24; stroke-dashoffset: 24; }
.check.done { background: var(--brand-accent); animation: boop .4s var(--ease); }
.check.done .ic { stroke-dashoffset: 0; transition: stroke-dashoffset .35s .05s var(--ease); }
@keyframes boop { 50% { transform: scale(1.25); } }
.item { flex: 1; min-width: 0; }
.item .t { font-weight: 600; }
.item .m { font-size: 13px; color: var(--muted); margin-top: 3px; }
.item .m.late { color: var(--bad); font-weight: 600; }
.prio-urgent, .prio-high { box-shadow: inset 3px 0 0 var(--bad), var(--shadow) !important; }
.approval { flex-direction: column; box-shadow: inset 3px 0 0 var(--brand-accent), var(--shadow) !important; }
.approval .t { font-weight: 500; white-space: pre-wrap; }
.approval .row { display: flex; gap: 8px; width: 100%; margin-top: 4px; }
.approval button { flex: 1; font-weight: 600; }
.ok { background: var(--brand-accent); color: #fff; }
.no { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }

/* ---------- pasek zakładek ---------- */
.tabs { display: flex; padding: 6px 6px calc(4px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); border-top: 1px solid var(--line); }
.tabs button { flex: 1; background: none; border-radius: 12px; padding: 6px 0 4px; display: grid; justify-items: center;
  gap: 3px; color: var(--muted); position: relative; }
.tabs button span { font-size: 11px; font-weight: 500; }
.tabs button.active { color: var(--brand-accent); }
.tabs button.active .ic { stroke-width: 2.1; }
.tabs b { position: absolute; top: 2px; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; padding: 0 5px; box-shadow: 0 0 0 2px var(--bg); }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + var(--safe-b)); background: var(--brand-dark);
  color: #fff; padding: 13px 16px; border-radius: 16px; white-space: pre-wrap; z-index: 10; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  animation: rise .3s var(--ease); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
