/* =========================================================
   EMBE Tasks — calm, high-contrast, thumb-friendly.
   One column, clear status colours, big tap targets.
   ========================================================= */

:root {
  --bg: #f4f3ee;
  --surface: #ffffff;
  --ink: #17231d;
  --muted: #6f7a71;
  --line: #e4e3da;
  --accent: #0d6b52;
  --accent-ink: #084b3a;
  --accent-soft: #e4f0ea;
  --danger: #ad3348;
  --shadow: 0 1px 2px rgba(23, 35, 29, 0.05), 0 8px 24px rgba(23, 35, 29, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 108px;
}

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -16px;
  padding: 14px 16px 8px;
  background: rgba(244, 243, 238, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sync-pill {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 4px 9px;
  min-width: 56px;
  text-align: center;
  white-space: nowrap;
}

.sync-pill.saving {
  color: #9a5a08;
  border-color: #f0d9b0;
  background: #fdf6e7;
}

.sync-pill.offline,
.sync-pill.error {
  color: var(--danger);
  border-color: #f0c7cf;
  background: #fbeef1;
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* List / Calendar switch, pinned with the title so it is one tap from any list */
.view-switch {
  display: inline-flex;
  gap: 2px;
  margin-top: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.vs-opt {
  border: 0;
  border-radius: 999px;
  background: none;
  padding: 6px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.vs-opt.active {
  background: var(--ink);
  color: #fff;
}

.unit-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
}

.unit-strip::-webkit-scrollbar {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: #3c4841;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
}

.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #cfe3d8;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.notice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
}

.notice-go {
  margin-left: auto;
  font-weight: 700;
  font-size: 12px;
}

/* ---------------- view ---------------- */

.view {
  padding-top: 4px;
  min-height: 60vh;
}

.view-foot {
  height: 12px;
}

.today-head {
  padding: 14px 0 10px;
}

.hello {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.today-date {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 6px 0 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat b {
  display: block;
  font-size: 20px;
  line-height: 1.15;
}

.stat span {
  font-size: 10.5px;
  color: var(--muted);
}

.stat.warn b {
  color: var(--danger);
}

.stat.warn {
  background: #fdf1f3;
  border-color: #f0d3da;
}

.stat.today b {
  color: #9a5a08;
}

.stat.today {
  background: #fdf7ea;
  border-color: #efdfc0;
}

.stat.good b {
  color: #0f7a4f;
}

.stat.good {
  background: #eef8f2;
  border-color: #cfe9d9;
}

.section {
  margin-bottom: 22px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
}

.count {
  font-size: 11px;
  color: var(--muted);
  background: #e9e8e0;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 600;
}

.section-hint {
  margin: -4px 2px 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.later-note {
  margin: 2px 2px 16px;
  font-size: 13px;
  color: var(--muted);
}

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent, #0f8f6f);
  text-decoration: underline;
  cursor: pointer;
}

/* ---------------- tasks ---------------- */

.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--st, var(--line));
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.task:active {
  transform: scale(0.995);
}

.task.st-completed .task-title {
  color: var(--muted);
  text-decoration: line-through;
}

/* Completed work reads green, overdue work reads red, the rest stays neutral. */
.section.is-done .section-head h2 {
  color: #0f7a4f;
}

.section.is-done .task,
.done-list .task {
  background: #f2faf5;
  border-color: #d4ecdf;
  border-left-color: #2f9c69;
  opacity: 0.92;
}

.section.is-overdue .section-head h2 {
  color: var(--danger);
}

.section.is-overdue .task {
  background: #fdf3f5;
  border-color: #f1d5dc;
  border-left-color: var(--danger);
}

.section.is-today .section-head h2 {
  color: #9a5a08;
}

.task-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--stbg, #eef0e9);
  color: var(--st, #5b655c);
  white-space: nowrap;
}

.pill.big {
  font-size: 12.5px;
  padding: 6px 12px;
}

.p-new {
  --st: #5b655c;
  --stbg: #edefe8;
}
.p-assigned {
  --st: #2b62a8;
  --stbg: #e9f1fb;
}
.p-ongoing {
  --st: #9a5a08;
  --stbg: #fdf2dd;
}
.p-completed {
  --st: #0f7a4f;
  --stbg: #e4f5ec;
}
.p-not_completed {
  --st: #ad3348;
  --stbg: #fbe9ed;
}
.p-rejected {
  --st: #7b48b8;
  --stbg: #f2ebfd;
}

.st-new {
  --st: #a3aba1;
}
.st-assigned {
  --st: #2b62a8;
}
.st-ongoing {
  --st: #c98a1e;
}
.st-completed {
  --st: #2f9c69;
}
.st-not_completed {
  --st: #d25a70;
}
.st-rejected {
  --st: #9a6ad0;
}

.unit-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: #4c5a51;
  background: #f5f4ee;
  border: 1px solid var(--line);
  border-left: 2px solid var(--u, var(--line));
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.prio {
  margin-left: auto;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: #fbe9ed;
  color: var(--danger);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prio.low {
  background: #eef0e9;
  color: var(--muted);
}

.task-title {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.3;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--muted);
}

.person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  letter-spacing: 0.02em;
}

.avatar.small {
  width: 27px;
  height: 27px;
  font-size: 10px;
}

.avatar.large {
  width: 54px;
  height: 54px;
  font-size: 18px;
}

.avatar.muted {
  background: #e3e2d9;
  color: var(--muted);
}

.p-name {
  font-weight: 600;
  color: var(--p, var(--ink));
}

.p-role {
  font-size: 10.5px;
  background: #f1f0e8;
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--muted);
  white-space: nowrap;
}

.due {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}

.due.overdue {
  color: var(--danger);
  font-weight: 700;
}

.due.today {
  color: #9a5a08;
  font-weight: 650;
}

.due.soon {
  color: var(--muted);
}

.due.done {
  color: #0f7a4f;
  font-weight: 600;
}

.task-reason {
  margin: 8px 0 0;
  font-size: 12.5px;
  background: #fbeef1;
  border-radius: 8px;
  padding: 7px 9px;
  color: #8a2b3d;
}

.task-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.task-foot-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.repeat-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: #4b6b5c;
  background: #eef3ef;
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.photo-tag {
  font-size: 11px;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #eef1ec;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.btn-small {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 9px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-done {
  background: #0f7a4f;
  color: #fff;
}

.btn-go {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.btn-soft {
  background: #f1f0e8;
  color: var(--ink);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost.danger {
  color: var(--danger);
  border-color: #f0c7cf;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* ---------------- empty ---------------- */

.empty {
  text-align: center;
  padding: 32px 18px;
  background: var(--surface);
  border: 1px dashed #dcdbd2;
  border-radius: 16px;
}

.empty-mark {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
}

.empty-title {
  margin: 0 0 4px;
  font-weight: 650;
}

.empty-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------------- toolbar ---------------- */

.toolbar {
  display: flex;
  gap: 8px;
  margin: 10px 0;
}

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  height: 44px;
}

.search svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: 0 0 auto;
}

.search-input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 15px;
  color: var(--ink);
  min-width: 0;
}

select.select.compact {
  height: 44px;
  width: auto;
  max-width: 128px;
  font-size: 13px;
  padding: 0 8px;
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

/* ---------------- routines ---------------- */

.lead {
  margin: 10px 0 16px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.routine-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.routine {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.routine.paused {
  opacity: 0.62;
}

.routine-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.routine h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.muted-text {
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------------- people ---------------- */

.people-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.person-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: 0;
  border-bottom: 1px solid #efeee6;
  text-align: left;
  cursor: pointer;
}

.person-row:last-child {
  border-bottom: 0;
}

.person-row-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.person-row-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.person-row-name em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 5px;
}

.person-row-role {
  font-size: 12px;
  color: var(--muted);
}

.login-state {
  font-size: 10.5px;
  font-weight: 600;
  color: #9a9a8f;
  background: #f3f2eb;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.login-state.ok {
  color: #0f7a4f;
  background: #e4f5ec;
}

/* ---------------- profile & menu ---------------- */

.profile-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin: 12px 0 18px;
  box-shadow: var(--shadow);
}

.profile-card h2 {
  margin: 0;
  font-size: 18px;
}

.profile-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.menu {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: 0;
  border-bottom: 1px solid #efeee6;
  text-align: left;
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
}

.menu-row:last-child {
  border-bottom: 0;
}

.menu-row > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-row svg {
  width: 19px;
  height: 19px;
  color: var(--muted);
}

.menu-end {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.app-note {
  margin: 16px 4px 0;
  font-size: 12px;
  color: #8b948c;
  text-align: center;
  line-height: 1.5;
}

/* ---------------- timeline ---------------- */

.timeline {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 14px;
}

.timeline-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  align-items: flex-start;
}

.timeline-item + .timeline-item {
  border-top: 1px solid #f1f0e9;
}

.timeline-body {
  min-width: 0;
}

.timeline-body p {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
}

.timeline-meta {
  font-size: 11px;
  color: var(--muted);
}

/* ---------------- fab & tab bar ---------------- */

.add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1;
  padding-bottom: 2px;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  flex: 1 1 0;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 8px;
  background: none;
  border: 0;
  font-size: 10.5px;
  font-weight: 600;
  color: #8b948c;
  cursor: pointer;
  position: relative;
}

.tab svg {
  width: 22px;
  height: 22px;
}

.tab.active {
  color: var(--accent);
}

.tab-badge {
  position: absolute;
  top: 7px;
  left: calc(50% + 7px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

/* ---------------- sheets ---------------- */

body.sheet-open {
  overflow: hidden;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 23, 0.45);
  backdrop-filter: blur(2px);
  z-index: 40;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 41;
  transition: transform 0.18s ease;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.sheet.in {
  transform: translate(-50%, 0);
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  background: var(--surface);
  border-bottom: 1px solid #f1f0e9;
}

.sheet-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.sheet-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: #f1f0e8;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

.sheet-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.sheet-actions .btn {
  width: 100%;
}

/* ---------------- fields ---------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 12px;
  font-weight: 600;
  color: #4b574f;
}

.field em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.input,
.select {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  font-size: 16px;
  color: var(--ink);
  outline: none;
}

.input:focus,
.select:focus {
  border-color: #8bb9a8;
  box-shadow: 0 0 0 3px rgba(13, 107, 82, 0.1);
}

textarea.input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.45;
  font-family: inherit;
}

.input.invalid {
  border-color: var(--danger);
}

.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-unit span {
  font-size: 12px;
  color: var(--muted);
}

.input-unit .input {
  flex: 1;
  min-width: 0;
}

.units-field {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  margin: 0;
}

.units-field legend {
  font-size: 12px;
  font-weight: 600;
  color: #4b574f;
  padding: 0 4px;
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf9f4;
}

.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.check span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------------- task sheet ---------------- */

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-row .due {
  margin-left: 0;
}

.task-notes {
  margin: 0;
  font-size: 13.5px;
  color: #3f4b44;
  background: #faf9f4;
  border-radius: 10px;
  padding: 10px 12px;
}

.detail-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  background: #faf9f4;
  border-radius: 12px;
  padding: 2px 12px;
}

.detail-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #efeee6;
  align-items: center;
}

.detail-list > div:last-child {
  border-bottom: 0;
}

.detail-list dt {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  flex: 0 0 auto;
}

.detail-list dd {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  text-align: right;
}

.reason-box {
  background: #fbeef1;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 13px;
  color: #8a2b3d;
}

.reason-box b {
  font-size: 12px;
  display: block;
  margin-bottom: 2px;
}

.reason-box p {
  margin: 0;
}

.photo-block {
  background: #faf9f4;
  border-radius: 12px;
  padding: 12px;
}

.photo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
  gap: 8px;
}

.photo-head em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
}

.upload {
  cursor: pointer;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.photo {
  display: block;
  aspect-ratio: 1;
  border-radius: 9px;
  overflow: hidden;
  background: #e9e8e0;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.task-timeline {
  border-top: 1px solid #f1f0e9;
  padding-top: 10px;
}

.task-timeline h3 {
  margin: 0 0 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------------- settings ---------------- */

.setting-block {
  background: #faf9f4;
  border: 1px solid #efeee6;
  border-radius: 13px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-block h3 {
  margin: 0;
  font-size: 14.5px;
}

.setting-block .muted-text {
  margin: -4px 0 0;
  line-height: 1.45;
}

.unit-manage {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.unit-manage-row .input {
  height: 40px;
  font-size: 14px;
}

.cleanup {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ---------------- auth ---------------- */

.auth-root {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(145deg, #12876a, #084b3a);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  box-shadow: 0 8px 22px rgba(13, 107, 82, 0.28);
}

.auth-title {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.01em;
}

.auth-sub {
  margin: 6px 0 20px;
  color: var(--muted);
  font-size: 14px;
  max-width: 300px;
}

.auth-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  box-shadow: var(--shadow);
}

.auth-error {
  margin: 0;
  font-size: 12.5px;
  color: var(--danger);
  background: #fbeef1;
  border-radius: 9px;
  padding: 8px 10px;
}

.auth-foot {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.auth-loading {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---------------- toast ---------------- */

.toast-root {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 96px;
  z-index: 60;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 18px;
}

.toast {
  background: #1d2a23;
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  animation: toastIn 0.18s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------- responsive ---------------- */

@media (max-width: 380px) {
  .stat b {
    font-size: 18px;
  }
  .stat span {
    font-size: 9.5px;
  }
  .row2 {
    grid-template-columns: 1fr;
  }
  .check-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 760px) {
  .sheet {
    border-radius: 20px;
    bottom: 24px;
    opacity: 0;
    transform: translate(-50%, 20px);
    transition: transform 0.18s ease, opacity 0.18s ease;
  }
  .sheet.in {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ---------------- install sheet ---------------- */

.install-steps {
  margin: 10px 0 4px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13.5px;
}

.install-steps li::marker {
  color: var(--accent);
  font-weight: 700;
}

.install-tip {
  margin: 14px 0 16px;
}

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

/* ---------------- calendar plan ---------------- */

.tl-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  flex-wrap: wrap;
}

.tl-step {
  padding: 7px 12px;
  font-size: 12.5px;
}

.tl-range {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.tl-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.tl-table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  min-width: 100%;
}

.tl-table thead th {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 9.5px;
  color: var(--muted);
  text-align: center;
  width: 30px;
  min-width: 30px;
  padding: 6px 0 5px;
}

.tl-table thead th span {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tl-table thead th b {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
  line-height: 1.2;
}

.tl-table thead th.is-weekend {
  background: #f7f6ef;
}

.tl-table thead th.is-today {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.tl-table thead th.is-today b {
  color: var(--accent-ink);
}

.tl-corner {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface) !important;
  text-align: left !important;
  padding: 7px 10px !important;
  width: 186px;
  min-width: 186px;
  border-right: 1px solid var(--line);
  font-size: 10.5px;
}

.tl-group th {
  position: sticky;
  left: 0;
  background: #efeee6;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 700;
}

.tl-group .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}

.tl-group-role {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
}

.tl-group-count {
  float: right;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.tl-task {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  width: 186px;
  min-width: 186px;
  max-width: 186px;
  padding: 6px 10px;
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
}

.tl-task-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.tl-task-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--muted);
}

.tl-cell {
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  height: 42px;
}

.tl-cell.is-weekend {
  background: #fbfaf4;
}

.tl-cell.is-today {
  background: #eef6f1;
}

.tl-bar-cell {
  border-bottom: 1px solid var(--line);
  padding: 12px 2px;
}

.tl-bar {
  display: block;
  height: 18px;
  border-radius: 7px;
  background: var(--c);
  opacity: 0.92;
}

.tl-bar.completed {
  opacity: 0.38;
}

.tl-bar.rejected,
.tl-bar.not_completed {
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--danger);
}

@media (max-width: 420px) {
  .tl-range {
    margin-left: 0;
    width: 100%;
  }
}
