/* MARENA TEAM — style (mobile-first, "Duolingo simple") */
:root {
  --green: #16a34a; --green-d: #15803d; --bg: #f6f7f4; --card: #fff;
  --ink: #1a2b1e; --muted: #6b7a6e; --line: #e4e8e2; --red: #dc2626; --amber: #d97706;
}
* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--ink); }
.boot { text-align: center; padding: 40vh 0 0; color: var(--muted); }

.shell { display: flex; flex-direction: column; min-height: 100dvh; }
main { flex: 1; padding: 16px 16px 90px; max-width: 640px; margin: 0 auto; width: 100%; }
main.nopad { padding: 0 0 70px; max-width: 640px; }

nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
nav button { flex: 1; border: 0; background: none; padding: 8px 0 6px; font-size: 10px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
nav button .ico { font-size: 20px; filter: grayscale(1); opacity: .6; }
nav button.on { color: var(--green-d); font-weight: 700; }
nav button.on .ico { filter: none; opacity: 1; }

h1 { font-size: 26px; } h2 { font-size: 22px; margin: 6px 0 12px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 8px; }
.muted { color: var(--muted); font-size: 14px; } .center { text-align: center; margin-top: 24px; }
.sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pre { white-space: pre-wrap; font-size: 15px; margin-top: 6px; }
.late { color: var(--red); font-weight: 700; }
.err { background: #fee2e2; color: #991b1b; padding: 10px 12px; border-radius: 12px; font-size: 14px; margin: 10px 0; }

.row { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin-bottom: 8px; }
.row .t { font-weight: 600; font-size: 15px; }
.row.done .t { text-decoration: line-through; color: var(--muted); }
.row.tap, .tap { cursor: pointer; }
.grow { flex: 1; min-width: 0; }
.chev { color: var(--muted); font-size: 22px; }
.avatar { font-size: 22px; }

.check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); background: #fff;
  font-size: 16px; color: #fff; cursor: pointer; flex-shrink: 0; }
.check.on { background: var(--green); border-color: var(--green); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 10px; font-size: 15px; }
.card.alert { background: #fff7ed; border-color: #fed7aa; cursor: pointer; }

.stats { display: flex; gap: 10px; margin: 12px 0 18px; }
.stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 8px; text-align: center; }
.stat b { display: block; font-size: 24px; color: var(--green-d); }
.stat span { font-size: 11px; color: var(--muted); }

.btn { background: var(--green); color: #fff; border: 0; border-radius: 14px; padding: 12px 18px;
  font-size: 15px; font-weight: 700; cursor: pointer; }
.btn:disabled { opacity: .5; }
.btn.big { width: 100%; padding: 15px; font-size: 16px; margin-top: 14px; }
.btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.ok { background: var(--green); }
.btns { display: flex; gap: 8px; margin-top: 10px; }
.back { background: none; border: 0; color: var(--green-d); font-size: 16px; font-weight: 700; padding: 6px 0; cursor: pointer; }
.x { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }

.fab { position: fixed; right: 18px; bottom: 84px; width: 58px; height: 58px; border-radius: 50%;
  background: var(--green); color: #fff; font-size: 30px; border: 0; box-shadow: 0 6px 18px rgba(22,163,74,.4);
  cursor: pointer; z-index: 15; }

input, select, textarea { width: 100%; padding: 13px 14px; border: 2px solid var(--line); border-radius: 14px;
  font-size: 16px; margin-bottom: 10px; background: #fff; font-family: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 4px 0 4px 2px; }
label.inline { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink); }
label.inline input { width: auto; margin: 0; }

.tabs2 { display: flex; background: #e9ede7; border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.tabs2 button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 11px; font-size: 14px;
  font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs2 button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: #eee; }
.chip.ok { background: #dcfce7; color: #166534; }
.chip.bad { background: #fee2e2; color: #991b1b; }
.chip.wait { background: #fef3c7; color: #92400e; }

.empty { text-align: center; color: var(--muted); padding: 34px 0; font-size: 15px; }

.prio-row { display: flex; gap: 8px; margin-bottom: 10px; }
.prio { flex: 1; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 4px;
  font-size: 13px; font-weight: 700; cursor: pointer; color: var(--ink); }
.prio.on { border-color: var(--green); background: #f0fdf4; }
.arch { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px; }

table.stt { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden;
  font-size: 13px; margin-bottom: 6px; border: 1px solid var(--line); }
table.stt th, table.stt td { padding: 8px 5px; text-align: center; border-bottom: 1px solid var(--line); }
table.stt th { background: #f0f4ee; font-size: 11px; color: var(--muted); }
table.stt td.l { text-align: left; font-weight: 600; padding-left: 10px; }
table.stt tr:last-child td { border-bottom: 0; }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 30; display: flex; align-items: flex-end; }
.sheet { background: var(--bg); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88dvh; overflow-y: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 17px; }

.login { max-width: 380px; margin: 0 auto; padding: 12vh 24px 0; text-align: center; }
.login .logo { font-size: 54px; }
.loginlogo { width: 88px; height: 88px; border-radius: 22px; box-shadow: 0 6px 20px rgba(18,138,67,.35); }
.login h1 { margin: 8px 0 4px; }
.login form { margin-top: 22px; text-align: left; }

.chat { display: flex; flex-direction: column; height: calc(100dvh - 70px); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.chat-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: 16px 16px 16px 4px;
  padding: 9px 13px; margin-bottom: 8px; max-width: 82%; width: fit-content; font-size: 15px; }
.msg.mine { background: #dcfce7; border-color: #bbf7d0; margin-left: auto; border-radius: 16px 16px 4px 16px; }
.msg .who { font-size: 12px; font-weight: 700; color: var(--green-d); margin-bottom: 2px; }
.msg .when { font-size: 10px; color: var(--muted); text-align: right; margin-top: 3px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--card); border-top: 1px solid var(--line); }
.chat-input input { margin: 0; flex: 1; }
.chat-input .btn { border-radius: 50%; width: 48px; flex-shrink: 0; padding: 0; }

@media (min-width: 700px) {
  nav { max-width: 640px; left: 50%; transform: translateX(-50%); border: 1px solid var(--line);
    border-radius: 18px 18px 0 0; }
}

.selwrap { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.selchip { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink); }
.selchip.on { border-color: var(--green); background: #f0fdf4; color: var(--green-d); }
