/* ===== mitr Table — colors and basics ===== */
:root {
  --olive: #6B7A3A;
  --olive-dark: #4A5624;
  --olive-soft: #EEF2E3;
  --gold: #DDA02E;
  --gold-dark: #A87E22;
  --gold-ink: #3D2B04;
  --cream: #FAF7EF;
  --card: #FFFFFF;
  --sage: #DDE6CC;
  --butter: #FBEACB;
  --peach: #F6D9CC;
  --mist: #D7E6EC;
  --ink: #2E3322;
  --muted: #6C705E;
  --line: #ECE7D8;
  --ok: #4F8A3A;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(74, 86, 36, .06), 0 6px 18px rgba(74, 86, 36, .07);
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 12px 16px calc(96px + env(safe-area-inset-bottom));
}

/* ===== Top bar ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 4px; }
.topbar .logo { height: 40px; width: auto; display: block; }
.topbar .actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); box-shadow: var(--shadow);
  position: relative; color: var(--olive-dark);
}
.icon-btn .dot {
  position: absolute; top: 9px; right: 10px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--gold); border: 2px solid var(--card);
}

.demo-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: .06em;
  color: var(--butter-ink); background: var(--butter);
  padding: 4px 10px; border-radius: 999px; margin-top: 10px;
}

/* ===== Greeting ===== */
.hello { margin: 14px 0 16px; }
.hello h1 { font-size: 28px; line-height: 1.15; margin: 0; font-weight: 800; color: var(--olive-dark); }
.hello p { margin: 4px 0 0; color: var(--muted); font-weight: 600; }

/* ===== Avatars ===== */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800; color: var(--olive-dark);
  border: 3px solid var(--card); flex: none;
}
.avatar.me { width: 46px; height: 46px; border: 0; box-shadow: var(--shadow); }
.avatar-row { display: flex; align-items: center; }
.avatar-row .avatar + .avatar { margin-left: -10px; }

/* ===== Today card ===== */
.today {
  position: relative; overflow: hidden;
  border-radius: 28px; padding: 20px 20px 18px;
  box-shadow: var(--shadow);
}
.today.morning { background: var(--sage); }
.today.afternoon { background: var(--butter); }
.today.evening { background: var(--mist); }
.today .label { font-size: 14px; font-weight: 800; color: var(--olive-dark); text-transform: uppercase; letter-spacing: .07em; }
.today .time { font-size: clamp(26px, 7.6vw, 34px); font-weight: 900; line-height: 1.1; margin: 6px 0 12px; color: var(--ink); white-space: nowrap; }
.today .meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--chip-bg); color: var(--olive-dark);
  font-size: 14px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
}
.today .illus { position: absolute; top: 8px; right: 8px; width: 64px; height: 58px; }
.today .with { display: flex; align-items: center; gap: 10px; margin: 16px 0 18px; }
.today .with span { font-size: 14px; font-weight: 700; color: var(--olive-dark); }

.clock-btn {
  width: 100%; min-height: 66px; border-radius: 20px;
  background: var(--gold); color: var(--gold-ink);
  font-size: 22px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 4px 0 var(--gold-dark);
  transition: transform .12s ease, box-shadow .12s ease;
}
.clock-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-dark); }
.clock-btn.out { background: var(--card); color: var(--olive-dark); box-shadow: 0 4px 0 var(--btn-shadow-out); }
.clock-btn.out:active { box-shadow: 0 1px 0 var(--btn-shadow-out); }

.status-line {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; color: var(--olive-dark); margin-bottom: 12px;
}
.status-line .tick {
  width: 28px; height: 28px; border-radius: 50%; background: var(--ok); color: #fff;
  display: grid; place-items: center; flex: none;
}
.status-line small { display: block; font-weight: 600; color: var(--muted); font-size: 14px; }
.done-msg { text-align: center; padding: 6px 0 2px; font-weight: 800; color: var(--olive-dark); }
.done-msg small { display: block; color: var(--muted); font-weight: 600; }

/* ===== Section + cards ===== */
.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 26px 2px 10px;
}
.section-title h2 { font-size: 19px; margin: 0; font-weight: 800; color: var(--olive-dark); }
.section-title button { font-size: 15px; font-weight: 800; color: var(--olive); padding: 4px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }

.shift-list { padding: 6px; }
.shift-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; border-radius: 16px;
}
.shift-row + .shift-row { margin-top: 2px; }
.day-badge {
  width: 54px; height: 58px; border-radius: 16px; flex: none;
  display: grid; place-content: center; text-align: center; line-height: 1.05;
}
.day-badge b { font-size: 21px; font-weight: 900; }
.day-badge span { font-size: 12px; font-weight: 800; text-transform: uppercase; }
.bg-morning { background: var(--sage); }
.bg-afternoon { background: var(--butter); }
.bg-evening { background: var(--mist); }
.bg-off { background: var(--peach); }
.shift-row .info { flex: 1; min-width: 0; }
.shift-row .info b { display: block; font-size: 17px; }
.shift-row .info span { color: var(--muted); font-size: 14px; font-weight: 600; }

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 4px 12px 10px; font-size: 13px; color: var(--muted); font-weight: 700; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

/* small tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 8px; position: relative; }
.tile .ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--olive-dark); }
.tile b { font-size: 16px; line-height: 1.25; }
.tile span { font-size: 14px; color: var(--muted); font-weight: 600; }
.tile .new { position: absolute; top: 14px; right: 14px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); }
.progress { height: 8px; border-radius: 99px; background: var(--olive-soft); overflow: hidden; }
.progress > div { height: 100%; background: var(--olive); border-radius: 99px; transition: width .3s ease; }

/* checklist sheet */
.check-panel { padding: 8px 8px 12px; margin-top: 12px; }
.check-panel h3 { margin: 8px 10px 6px; font-size: 17px; color: var(--olive-dark); }
.check-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 12px 10px; border-radius: 14px; text-align: left; font-weight: 700;
}
.check-item .box {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  border: 2.5px solid var(--line-strong); display: grid; place-items: center; color: #fff;
  transition: background .15s ease, border-color .15s ease;
}
.check-item.done .box { background: var(--ok); border-color: var(--ok); }
.check-item.done .txt { color: var(--muted); text-decoration: line-through; }

/* ===== Bottom tab bar ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--tabbar-bg);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.tabbar nav { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; font-size: 12.5px; font-weight: 800; color: var(--muted);
  border-radius: 14px;
}
.tab .ico { width: 52px; height: 32px; border-radius: 999px; display: grid; place-items: center; --icon-fill: var(--chip); }
.tab.active { color: var(--olive-dark); }
.tab.active .ico { background: var(--sage); --icon-fill: var(--card); }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--toast-bg); color: var(--toast-ink); font-weight: 700; font-size: 15px;
  padding: 12px 18px; border-radius: 16px; width: max-content; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 10px;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Confetti + steam ===== */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 9px; height: 13px; border-radius: 3px;
  animation: fall 1.4s cubic-bezier(.2, .6, .4, 1) forwards;
}
@keyframes fall {
  to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .9; }
}
.steam { animation: steam 2.8s ease-in-out infinite; transform-origin: center; }
.steam.s2 { animation-delay: .9s; }
.steam.s3 { animation-delay: 1.8s; }
@keyframes steam {
  0% { transform: translateY(4px); opacity: 0; }
  40% { opacity: .9; }
  100% { transform: translateY(-6px); opacity: 0; }
}

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

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

/* Wider screens: a little more breathing room */
@media (min-width: 700px) {
  .app { padding-top: 24px; }
}
