/* 색은 전부 여기 토큰으로 모은다. 화면 어디서도 색을 직접 쓰지 않아야
   테마를 갈아끼울 때 한 곳만 하얗게 튀는 일이 없다.
   밝은 톤 = 검정+황동, 어두운 톤 = 검정 바탕에 황동. 포인트 색을 공유한다. */
:root {
  --bg: #f7f6f3;
  --panel: #ffffff;
  --panel-soft: #fbfaf7;        /* 카드 안의 한 겹 더 옅은 면 */
  --subtle: #efeee9;
  --line: #e0ded6;
  --line-strong: #cfccc2;       /* 그래버 등 또렷해야 하는 선 */
  --text: #141513;
  --muted: #726f66;
  --green: #1b1c19;             /* 주 포인트(버튼·활성 칩) */
  --green-strong: #8a6d2f;      /* 강조 글자 — 황동 */
  --green-soft: #f2ecdd;
  --green-soft-press: #e8dec7;
  --accent-line: #ddd0ae;       /* 포인트 계열 테두리 */
  --on-accent: #f0e2c2;         /* 포인트 위에 올라가는 글자 */
  --yellow-soft: #fff5df;
  --red-soft: #fdebea;
  --danger: #d14f45;
  --accent-secondary: #2f6fed;
  --bar-bg: rgba(255, 255, 255, 0.96);
  --scrim: linear-gradient(180deg, rgba(22, 32, 24, 0.12), rgba(22, 32, 24, 0.34));
  --fade-to-panel: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 28%);
  --thumb-bg: linear-gradient(145deg, #e6e2d6, #f8f7f3);
  --snack-bg: #1b1c19;
  --snack-error-bg: #7a2822;
  --shadow: 0 10px 24px rgba(20, 20, 18, 0.07);
  --sheet-shadow: 0 24px 60px rgba(20, 20, 18, 0.16);
  color-scheme: light;
}

/* 어두운 톤. 고른 적 없으면 기기 설정을 따라가고(아래 media), 고르면 data-theme 이 이긴다. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12130f;
    --panel: #1c1e19;
    --panel-soft: #22241e;
    --subtle: #24271f;
    --line: #33372d;
    --line-strong: #4a4f42;
    --text: #eceee7;
    --muted: #9aa093;
    --green: #c8a35a;
    --green-strong: #d8b978;
    --green-soft: #2a2a20;
    --green-soft-press: #34341f;
    --accent-line: #5c4f30;
    --on-accent: #15160f;
    --yellow-soft: #2a2417;
    --red-soft: #2c1e1d;
    --danger: #e07b70;
    --accent-secondary: #7aa2f7;
    --bar-bg: rgba(18, 19, 15, 0.96);
    --scrim: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.62));
    --fade-to-panel: linear-gradient(180deg, rgba(28, 30, 25, 0), rgba(28, 30, 25, 1) 28%);
    --thumb-bg: linear-gradient(145deg, #2b2e25, #1e2019);
    --snack-bg: #2b2e25;
    --snack-error-bg: #5c2420;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    --sheet-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #12130f;
  --panel: #1c1e19;
  --panel-soft: #22241e;
  --subtle: #24271f;
  --line: #33372d;
  --line-strong: #4a4f42;
  --text: #eceee7;
  --muted: #9aa093;
  --green: #c8a35a;
  --green-strong: #d8b978;
  --green-soft: #2a2a20;
  --green-soft-press: #34341f;
  --accent-line: #5c4f30;
  --on-accent: #15160f;
  --yellow-soft: #2a2417;
  --red-soft: #2c1e1d;
  --danger: #e07b70;
  --accent-secondary: #7aa2f7;
  --bar-bg: rgba(18, 19, 15, 0.96);
  --scrim: linear-gradient(180deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.62));
  --fade-to-panel: linear-gradient(180deg, rgba(28, 30, 25, 0), rgba(28, 30, 25, 1) 28%);
  --thumb-bg: linear-gradient(145deg, #2b2e25, #1e2019);
  --snack-bg: #2b2e25;
  --snack-error-bg: #5c2420;
  --shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  --sheet-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  /* 필터 칩을 옆으로 넘기다 위로 새는 순간 당겨져 새로고침되던 것 방지(pull-to-refresh). */
  overscroll-behavior-y: contain;
}

.app {
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  padding-bottom: 88px;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 18px 16px 14px;
  /* 스크롤되는 카드가 이 바 밑을 지나며 잘린다. 경계가 없으면 잘린 카드가
     깨진 것처럼 보이므로, 가는 선과 옅은 그림자로 '밑으로 지나간다'고 알린다.
     (blur 는 스크롤마다 배경을 다시 샘플링해 깜빡이므로 쓰지 않는다.) */
  box-shadow: 0 1px 0 var(--line), 0 10px 12px -10px rgba(20, 20, 18, 0.16);
  /* backdrop-filter(blur) 를 sticky 헤더에 쓰면 스크롤 중 매 프레임 뒤 배경을 다시 샘플링해
     상단 탭/필터가 깜빡인다. 배경이 이미 거의 불투명이라 블러를 빼고 불투명 배경으로 둔다. */
  background: var(--bg);
}

/* 제목 앞에 심볼이 붙으므로 글자와 세로 가운데를 맞춘다.
   min-height 는 옆에 놓이는 탭 줄(.seg = seg-btn 40px + 상하 padding 4px)과 같은 값이다.
   이 값이 없으면 화면마다 .head-row 의 높이를 정하는 요소가 달라(일정·설정은 탭,
   내 식물은 제목+부제) 제목 글자가 화면마다 다른 높이에 놓이고, 탭을 오갈 때 튄다. */
.title { margin: 0; font-size: 26px; line-height: 1.2; font-weight: 700;
  display: flex; align-items: center; gap: 0.3em; min-height: 48px; }
.subtitle { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* Today / Upcoming segmented control */
/* hidden 속성은 어떤 컴포넌트 클래스보다 우선해 항상 숨긴다 (버튼/바 등에서
   클래스의 display 가 [hidden] 을 덮어써 안 숨겨지던 버그 방지). */
[hidden] { display: none !important; }

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  background: var(--subtle);
  border-radius: 12px;
}
/* 탭은 늘 한 줄. 개수를 세지 않고 각 탭이 제 글자만큼만 차지하게 두고, 좁은
   화면에서 넘치면 탭 줄 안에서 가로로 스크롤한다(두 줄로 접거나 화면 밖으로
   밀어내면 마지막 탭을 누를 수가 없다). */
#settings-tabs {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  justify-content: start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* basis 를 0 으로 둬야 제목 옆 '남는 자리'만 차지한다. auto 로 두면 내용 폭
     (탭 7개 = 약 380px)을 요구해 제목 옆에 못 들어가고 아래로 밀린다.
     (.head-row .seg 의 flex:0 0 auto 를 여기서 되돌린다) */
  /* 제목(.title)도 flex-grow:1 이라 남는 자리를 절반씩 나눠 갖는다. '설정' 은 더
     넓어져 봐야 소용없으므로 남는 자리는 탭이 가져가게 한다. */
  flex: 999 1 0;
  min-width: 0;
  max-width: 100%;
}
#settings-tabs::-webkit-scrollbar { display: none; }
#settings-tabs .seg-btn { white-space: nowrap; padding: 0 12px; }
@media (max-width: 480px) {
  #settings-tabs .seg-btn { font-size: 13px; padding: 0 10px; }
}

.seg-btn {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.head-row .seg { flex: 0 0 auto; min-width: 176px; }
.action-item { width: 100%; min-height: 48px; justify-content: flex-start; font-size: 15px; }

.seg-btn.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 36, 24, 0.1);
}

.up-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0 4px;
}

.chip, .tag, .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.chip {
  padding: 6px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
}
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}


.content { padding: 0 16px 24px; }
.section { margin-top: 18px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-title { margin: 0; font-size: 18px; font-weight: 700; }
.section-meta { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.up-breakdown { margin: -4px 0 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }

.card-list { display: grid; gap: 12px; }
.accordion { display: grid; gap: 12px; }

.accordion-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity 200ms ease, transform 200ms ease;
}

/* Watered → leaves the Today list */
.accordion-item.leaving { opacity: 0; transform: translateX(44px); }

.accordion-item summary { list-style: none; }
.accordion-item summary::-webkit-details-marker { display: none; }

.card { padding: 14px; }

.card.compact {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  gap: 12px;
  align-items: center;
}

.expand-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  /* 카드 우측 끝까지 채우는 연한 녹색 터치 영역 (card 패딩 14px 상쇄) */
  margin: -14px -14px -14px 0;
  background: var(--green-soft);
}

.expand-zone:active { background: var(--green-soft-press); }

.chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--green-strong);
  font-size: 16px;
  font-weight: 700;
  transition: transform 160ms ease;
}

.accordion-item[open] .chevron { transform: rotate(180deg); }

/* One-tap watering on the thumbnail corner (opposite side from chevron) */
.quick-water {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 2px solid var(--panel);
  background: var(--green);
  color: var(--on-accent);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(20, 36, 24, 0.2);
  cursor: pointer;
}

.quick-water.done { background: var(--green-strong); }

.thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--thumb-bg);
  border: 1px solid var(--line);
  object-fit: cover;
}

.compact-core { min-width: 0; }
.compact-name { margin: 0; font-size: 15px; line-height: 1.25; font-weight: 700; }
.compact-meta { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.compact-focus { display: grid; gap: 4px; margin-top: 8px; }
.compact-line { font-size: 13px; line-height: 1.3; font-weight: 600; color: var(--text); }
.compact-line.soft { color: var(--green-strong); }

/* Upcoming rows: read-only, tap goes to detail */
.up-item { cursor: pointer; }
.up-item .card.compact { grid-template-columns: 56px 1fr 18px; }
.chev { color: var(--muted); font-size: 22px; font-weight: 700; text-align: center; align-self: center; }

.tag-row, .wrap-row, .badge-row, .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.tag { min-height: 26px; padding: 0 10px; background: var(--subtle); color: var(--text); }
.badge { min-height: 28px; padding: 0 10px; }
.badge.today { background: var(--green-soft); color: var(--green-strong); }
.badge.warn { background: var(--yellow-soft); color: #8b6414; }

.info { display: grid; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--text); }

.memo {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--subtle);
  border-radius: 14px;
  color: var(--text);
  font-size: 13px;
}

.actions { margin-top: 12px; align-items: stretch; }
/* 할 일 버튼(간편관수/방제/돌보기)은 남는 폭을 채우고, 미루기/보류는 작게 뒤따른다 */
.actions .btn { flex: 1 1 auto; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.actions .postpone-btn { flex: 0 1 auto; background: var(--subtle); border-color: transparent; color: var(--muted); font-size: 12px; padding: 0 12px; }
.btn.danger { border-color: transparent; background: var(--red-soft); color: var(--danger); }
.head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.row-actions .btn { min-height: 32px; padding: 0 12px; font-size: 13px; }
.field-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.field-row .input { flex: 1; }
.sheet-body { display: grid; gap: 14px; margin: 6px 0 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted, #6b7280); }
/* 편집 불가 필터(상태·정렬)는 라벨을 더 연하게 — '필터 관리'로 못 바꾼다는 표시.
   (.filter-label 규칙이 뒤에 정의되므로 특이도를 올려 확실히 이긴다.) */
.filter-label.filter-label--fixed { color: #a9b3ab; font-weight: 500; }
.filter-manage-btn { flex: 0 0 auto; }
.info-card .field { margin-top: 4px; }
.loc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.loc-name { font-weight: 600; }
/* 선택 모드: 체크박스 칸이 앞에 붙으므로 그리드를 4→3칸(체크·썸네일·내용)으로 */
.plant-row.selectable { grid-template-columns: 24px 48px 1fr; cursor: pointer; }
.plant-row.checked { background: var(--green-soft); }
.row-check { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--green-strong); }
.select-bar {
  position: fixed; left: 0; right: 0; bottom: 64px; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.select-bar-actions { display: flex; gap: 8px; }
.select-bar[hidden] { display: none; }
.expanded { padding: 0 14px 14px; }
.expanded-inner { border-top: 1px solid var(--line); padding-top: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 14px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn.primary { background: var(--green); border-color: transparent; color: var(--on-accent); }
.btn.quick-action { background: var(--accent-secondary); border-color: transparent; color: var(--on-accent); font-size: 12px; min-height: 34px; padding: 0 10px; border-radius: 10px; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100%);
  background: var(--bar-bg);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 8px 8px 12px;
}

.tab { display: grid; place-items: center; gap: 4px; min-height: 48px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.tab.active { color: var(--green-strong); }

/* 빈 화면과 로딩 자리. 허전한 곳에 집사 심볼을 흐리게 얹는다.
   글자는 반드시 .empty-text 안에만 둔다. 오류 문구를 textContent 로 갈아끼우는
   자리가 있어서, 글자를 요소 바로 밑에 두면 앞의 심볼까지 지워진다.
   ([hidden] 이 !important 라 여기서 display 를 줘도 숨김은 그대로 동작한다.) */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 48px 16px;
  margin: 0;
}

.empty-symbol {
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  color: var(--text);
  opacity: 0.18;
}

.snackbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 96px;
  z-index: 40;
  width: min(400px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--snack-bg);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(20, 36, 24, 0.28);
}

.snackbar[hidden] { display: none; }
.snackbar.error { background: var(--snack-error-bg); }
.snackbar button { border: 0; background: transparent; color: #8fe0a6; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- Quick-complete care sheet (bottom sheet) ---------- */
/* 키보드가 올라오면 레이아웃 뷰포트는 그대로인 채 '보이는 영역'만 줄어든다.
   keyboard-inset.js 가 그 영역을 --vv-* 로 내려주므로 시트가 키보드 위에
   자리잡는다. 값이 없으면(미지원 브라우저) 화면 전체를 그대로 쓴다. */
.scrim {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-top, 0px);
  height: var(--vv-height, 100dvh);
  z-index: 100; /* above the desktop sidebar (60) so modals fully overlay it */
  background: var(--scrim);
  display: grid;
  place-items: end center;
}

.scrim[hidden] { display: none; }

.sheet {
  width: min(430px, 100%);
  max-height: 92%;
  overflow: auto;
  background: var(--panel);
  border-radius: 28px 28px 0 0;
  box-shadow: var(--sheet-shadow);
  padding: 14px 16px 20px;
}

.grabber { width: 96px; height: 6px; border-radius: 999px; background: var(--line-strong); margin: 0 auto 16px; }

.sheet .sheet-title { margin: 0; font-size: 22px; font-weight: 700; }
.sheet .sheet-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

/* Record-time control */
.when-wrap { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.when {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.when-edit { color: var(--green-strong); font-size: 12px; }

.when-past {
  display: none;
  height: 26px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: #8b6414;
  font-size: 12px;
  font-weight: 700;
}

.when-past.show { display: inline-flex; }

.when-input { display: none; min-height: 44px; width: 100%; }
.when-input.show { display: block; }

.sheet .section-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; }

.row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 6px;
  cursor: pointer;
}
/* 라벨은 고정폭·한 줄, 입력/칩은 그 옆에서 필요하면 안쪽에서만 줄바꿈, 표식은 맨 오른쪽 */
.row > .care-label { order: 0; flex: 0 0 auto; min-width: 34px; white-space: nowrap; font-weight: 700; padding-top: 3px; }
.row > .care-prod { order: 1; flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; border-left: 0; }
.row > .check, .row > .care-mark { order: 2; flex: 0 0 auto; margin-left: auto; padding-top: 2px; }
.care-mark { color: var(--muted); cursor: pointer; font-size: 15px; }

.row .note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.row.active { background: var(--green-soft); border-color: var(--accent-line); }
.row .check { font-weight: 800; color: var(--green-strong); visibility: hidden; }
.row.active .check { visibility: visible; }

.input, textarea, select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 48px;
  padding: 12px 14px;
  font: inherit;
  /* 지정하지 않으면 브라우저 기본(흰 배경·검은 글자)이 나와 어두운 테마에서
     입력칸만 하얗게 튄다. */
  background: var(--panel);
  color: var(--text);
}
.input::placeholder, textarea::placeholder { color: var(--muted); }

/* iOS/WebKit 의 date 입력은 기본(native) 렌더가 intrinsic 크기라 width:100% 를 무시하고
   다른 입력과 폭이 안 맞는다. appearance 를 없애 일반 입력처럼 컨테이너 폭을 채우게 한다
   (모바일에선 탭하면 네이티브 날짜 피커가 그대로 뜬다). */
input.input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
/* 값이 오른쪽/가운데로 몰리지 않게 왼쪽 정렬 */
input.input[type="date"]::-webkit-date-and-time-value { text-align: left; }
/* 데스크톱에선 달력 아이콘을 오른쪽에 클릭 가능하게 남긴다 */
input.input[type="date"]::-webkit-calendar-picker-indicator { margin-left: auto; cursor: pointer; opacity: 0.6; }

textarea { min-height: 92px; resize: none; }

.preset-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }

.mini-chip {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mini-chip.active { background: var(--green-soft); border-color: var(--accent-line); color: var(--green-strong); }

.inline-inputs { display: grid; grid-template-columns: 1fr 92px; gap: 8px; }

.add-action {
  width: 100%;
  min-height: 48px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.add-menu { display: none; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.add-menu.show { display: grid; }

.add-item {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.routine-note { font-size: 13px; color: var(--muted); padding: 4px 2px 0; }

.product-panel {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-soft);
}

.product-panel[hidden] { display: none; }

.product-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.product-panel-head::-webkit-details-marker { display: none; }
.product-panel[open] .product-panel-head .chevron { transform: rotate(180deg); }

.product-panel-summary {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.product-panel-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.product-suggestion {
  background: var(--green-soft);
  border-color: var(--accent-line);
  color: var(--green-strong);
}

.product-suggestion.muted {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

.footer {
  position: sticky;
  bottom: 0;
  background: var(--fade-to-panel);
  padding-top: 14px;
  margin-top: 18px;
}

.sheet .footer .btn { width: 100%; min-height: 52px; border: 0; border-radius: 16px; background: var(--green); color: var(--on-accent); font-size: 15px; font-weight: 700; }
.sheet .footer .btn.secondary { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.sheet .footer .btn[disabled] { opacity: 0.6; }

/* Snooze folded into this same sheet */
.snooze { margin-top: 8px; border-top: 1px solid var(--line); }

.snooze-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 4px;
  cursor: pointer;
  list-style: none;
}

.snooze-head::-webkit-details-marker { display: none; }
.snooze-title { font-size: 15px; font-weight: 700; }
.snooze-sub { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.snooze[open] .snooze-head .chevron { transform: rotate(180deg); }
.snooze-body { padding: 8px 0 4px; }

.snooze-assure {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  margin-bottom: 10px;
}

.snooze-assure strong { color: var(--green-strong); }
#snooze-confirm { margin-top: 10px; }

/* ---------- Plants list ---------- */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row > :first-child { flex: 1 1 auto; min-width: 0; }
.head-row .title { margin: 0; }
.head-row .search { flex: 1 1 160px; margin-top: 0; }
.head-row .seg { flex: 0 0 auto; margin-top: 0; }

.filter-bar { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 12px; }
.filter-summary { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-summary:empty { display: none; }
/* 내 식물: 요약을 툴바 아래 한 줄로 */
.head-actions + .filter-summary { margin: 8px 0 0; }
.filter-toggle {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--subtle);
  color: var(--green-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}
.filter-toggle[hidden] { display: none; }
.filters.collapsed { display: none; }

.search { position: relative; margin-top: 14px; }

.search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px 48px 12px 14px;
  font: inherit;
  font-size: 16px;
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: var(--subtle);
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
}
.search-btn:active { background: var(--green-soft); }

.filters { display: grid; gap: 0; margin-top: 12px; }
.filters[hidden] { display: none; }
.filter-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.filter-row:first-child { border-top: 0; padding-top: 2px; }
/* 칩이 2줄을 넘겨 스크롤 가능할 때만: 얇은 하단 페이드 + 오른쪽 가장자리에 '스크롤바 썸'.
   썸은 스크롤 위치(--scroll-ratio, JS)에 따라 위아래로 움직여 "스크롤 되는 영역"임을 알린다. */
.filter-row.has-scroll > .scroll-row,
.filter-row.has-scroll .tagbox {
  /* 위·아래 페이드 크기는 스크롤 위치(JS)에 따라 켜짐/꺼짐 → 잘린 쪽이 딱 튀어나오지 않게. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 var(--mask-top, 0px), #000 calc(100% - var(--mask-bottom, 12px)), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 var(--mask-top, 0px), #000 calc(100% - var(--mask-bottom, 12px)), transparent 100%);
}
/* 오른쪽 가장자리 스크롤바 썸. 위치·높이는 JS 가 '박스(strip) 기준'으로 계산해 박스 밖으로
   삐져나오지 않게 한다. */
.filter-row.has-scroll::after {
  content: "";
  position: absolute;
  right: 0;
  width: 3px;
  border-radius: 3px;
  background: var(--muted);
  opacity: 0.45;
  height: var(--thumb-h, 14px);
  top: var(--thumb-top, 14px);
  pointer-events: none;
}
/* 필터 칩은 조밀하게 — 간격·패딩을 줄여 한 줄에 더 많이, 세로도 덜 차지하게 한다. */
.filter-row .chip { padding: 4px 9px; font-size: 12px; }
.filter-row .chip.chip-settings { padding: 4px 8px; }
.filter-label { flex: 0 0 40px; font-size: 12px; font-weight: 800; color: var(--muted); padding-top: 8px; }
.filter-row > .scroll-row,
.filter-row > .wrap-row,
.filter-row > .tag-row { flex: 1 1 auto; min-width: 0; }
/* 필터 칩은 한 줄 가로 스크롤 대신 여러 줄로 감싸(wrap) 전부 한눈에 보이게 한다.
   필터는 목록을 스크롤하면 자동으로 접히므로, 펼쳤을 때만 커지고 그때는 다 보이는 게 낫다. */
/* 필터 칩 영역(구역·행동·상태)도 태그처럼 '2줄 창 + 내부 세로 스크롤'. */
.scroll-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 64px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.scroll-row::-webkit-scrollbar { display: none; }
/* 여전히 가로 스크롤인 스트립(기록칩): 가로 팬만 받게 해 옆으로 넘길 때 세로로 새지
   않고(→ 새로고침 방지), 끝에서 페이지로 스크롤이 전이되지 않게 한다. */
.history-chips {
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.plant-list { display: grid; gap: 8px; }

.plant-row {
  display: grid;
  grid-template-columns: 48px 1fr 18px;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.plant-row .thumb { width: 48px; height: 48px; border-radius: 12px; }
.thumb-badge-wrap { position: relative; width: 48px; height: 48px; }
.rot-badge {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--green);
  border: 2px solid var(--panel);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(20, 36, 24, 0.28);
}
.rot-badge svg { width: 15px; height: 15px; display: block; }
.plant-core { min-width: 0; }

.plant-name {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plant-tags { display: flex; gap: 6px; margin-top: 5px; overflow: hidden; }

.plant-tags .tag {
  min-height: 22px;
  padding: 0 8px;
  background: var(--subtle);
  color: var(--muted);
  font-size: 11px;
}

.plant-sched { display: grid; gap: 3px; margin-top: 7px; }
.sched-line { display: flex; gap: 8px; align-items: baseline; font-size: 12px; min-width: 0; }
.sched-label { flex: 0 0 auto; width: 28px; font-weight: 800; color: var(--muted); }
.sched-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.sched-line.due .sched-val { color: var(--green-strong); font-weight: 700; }
.sched-line.none .sched-val { color: var(--muted); font-weight: 500; }

/* ---------- Plant detail ---------- */
.page { max-width: 430px; margin: 0 auto; padding: 16px 16px 28px; }

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 12px;
}

.detail-symbol { width: 26px; height: 26px; flex: 0 0 auto; color: var(--green); opacity: 0.55; }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  margin-top: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-photo { position: relative; }
.hero-photo-clickable { cursor: zoom-in; }
.hero-img {
  height: 300px;
  width: 100%;
  object-fit: cover;
  background: var(--thumb-bg);
  display: block;
}

/* 앨범 어포던스: 사진 우하단 아이콘 배지 */
.album-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.album-badge-n { line-height: 1; }

/* 전체화면 앨범 */
.album-scrim {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #0c0c0c;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none; /* 가로 드래그가 스크롤로 새지 않게 */
}
.album-stage { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 6px; }
.album-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  user-select: none;
  -webkit-user-drag: none;
}

/* 화살표 탭 영역은 화면 좌/우 세로 전체. 보이는 건 안쪽 칩뿐이다. */
.album-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: min(30%, 180px);
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}
.album-nav-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}
.album-nav.is-off { cursor: default; }
.album-nav.is-off .album-nav-chip { opacity: 0.2; }
.album-prev { left: 0; justify-content: flex-start; }
.album-next { right: 0; justify-content: flex-end; }
.album-close {
  position: absolute;
  z-index: 3; /* 좌우 넓은 nav 영역 위로 */
  top: 14px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.album-counter {
  position: absolute;
  z-index: 3;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.album-cap {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #eee;
  font-size: 13px;
  padding: 0 12px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.record-thumb-btn { position: relative; flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: zoom-in; }
.thumb-count { position: absolute; right: 3px; bottom: 3px; padding: 1px 6px; border-radius: 999px; background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; font-weight: 800; }
.timeline-thumb { display: block; margin-top: 6px; }
.timeline-thumb .record-thumb { width: 64px; height: 64px; }
.timeline-record-marks { margin-left: 8px; font-size: 13px; letter-spacing: 2px; }
.record-memo-clip { cursor: pointer; }
.record-memo-clip::after { content: " 더보기"; color: var(--green-strong); font-weight: 700; font-size: 12px; }

.hero-body { padding: 16px; }
.detail-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.detail-title { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; }
.detail-edit-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 8px;
}
.detail-edit-btn:active { background: var(--subtle); }
.plant-info-form { display: grid; gap: 10px; margin: 2px 0 12px; }
.plant-info-form .actions { margin-top: 2px; }
.grown-badge { font-size: 12px; font-weight: 700; color: var(--green-strong); background: var(--green-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.detail-meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.detail-goal { margin: 8px 0 0; font-size: 13px; color: var(--green-strong); font-weight: 700; }

.hero .tags, .hero .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hero .tag { min-height: 28px; padding: 0 10px; background: var(--subtle); font-size: 12px; }

.info-card {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.info-card-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.info-card-title.rot-title { display: flex; align-items: center; gap: 7px; }
.rot-title-ic { flex: 0 0 auto; width: 22px; height: 22px; color: var(--green-strong); display: inline-flex; }
.rot-title-ic svg { width: 100%; height: 100%; display: block; }
.info-card-sub { margin: -6px 0 8px; font-size: 12px; color: var(--muted); }
.info-card-sub.after-actions { margin-top: 12px; }

/* ---------- Drag-to-reorder (drag-reorder.js) ---------- */
/* touch-action:none 이 핵심 — 핸들에서 시작한 제스처만 브라우저 스크롤 대신
   드래그가 되고, 행의 나머지 영역은 평소대로 스크롤된다. */
.drag-handle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 32px;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.drag-handle:active { cursor: grabbing; color: var(--green-strong); }
/* 끌 수 있는 행은 글자를 고르는 곳이 아니다. 꾹 누르는 350ms 동안 브라우저가
   범위 선택을 시작하는 것을 원천에서 막는다(입력칸은 예외). */
.rec-rows,
.tag-manage-group {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.rec-rows input,
.rec-rows textarea,
.tag-manage-group input,
.tag-manage-group textarea {
  user-select: text;
  -webkit-user-select: text;
}
.drag-active { user-select: none; -webkit-user-select: none; }
/* 꾹 눌러 시작할 땐 잡힌 순간이 눈에 보여야 한다 — 살짝 커지며 떠오른다.
   translateY 는 인라인 스타일이 계속 갱신하므로 scale 은 따로 준다. */
.drag-active .drag-item {
  position: relative;
  z-index: 2;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgb(0 0 0 / 18%);
  scale: 1.02;
}

/* ---------- Recurrence interval editor ---------- */
.rec-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  min-height: 52px;
}
.rec-row:first-of-type { border-top: 0; }
.rec-action {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 62px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.rec-action .dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.rec-every { flex: 1 1 auto; font-size: 14px; color: var(--text); }
.rec-every.rec-none { color: var(--muted); }
.rec-every .num { font-weight: 800; }
.rec-row.rec-locked { opacity: 0.6; }
.rec-locked-note { flex: 1 1 auto; font-size: 12px; color: var(--muted); line-height: 1.35; }
.rec-drag { margin-right: 2px; }
.rec-edit {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--green-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.rec-editing { flex: 1 1 auto; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex: 0 0 auto; }
.stepper button { border: 0; background: var(--subtle); width: 26px; height: 32px; font-size: 16px; cursor: pointer; color: var(--text); }
.stepper input { width: 34px; height: 32px; border: 0; text-align: center; font: inherit; font-weight: 800; font-size: 16px; }
.rec-editing .unit { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.mini { border: 0; border-radius: 8px; padding: 7px 9px; font: inherit; font-weight: 700; font-size: 12px; cursor: pointer; flex: 0 0 auto; white-space: nowrap; }
.mini.save { background: var(--green); color: #fff; }
.mini.cancel { background: var(--subtle); color: var(--text); }
.mini.none { background: transparent; color: var(--danger); border: 1px solid var(--line); }

/* ---------- Feeding routine card ---------- */
.routine-now { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 4px; }
.routine-now-lbl { font-size: 12px; color: var(--muted); }
.routine-now-val { font-size: 18px; font-weight: 800; color: var(--green-strong); }
.routine-next { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.routine-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.routine-btns .btn { min-height: 40px; padding: 0 14px; }
.routine-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px;
  border-top: 1px solid var(--line);
}
.routine-step:first-of-type { border-top: 0; }
.routine-idx {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-strong);
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.routine-pname { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; }
.iconbtn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 7px;
}
.iconbtn:disabled { opacity: 0.3; cursor: default; }
.iconbtn.x { color: var(--danger); }
.routine-track { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0; }
.rt-step { padding: 4px 9px; border-radius: 9px; background: var(--subtle); font-size: 13px; color: var(--text); }
.rt-step.water { background: transparent; color: var(--muted); padding: 4px 2px; font-size: 12px; }
.rt-step.current { background: var(--green); color: #fff; font-weight: 800; }
.rt-step.rt-pick { cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* 길게 누르는 동안(약 0.8초) 왼쪽부터 녹색이 서서히 차오른다 → 다 차면 이동 확인. */
.rt-step.rt-pick.holding {
  color: #fff;
  background-image: linear-gradient(var(--green), var(--green));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  animation: rt-hold 0.8s linear forwards;
}
@keyframes rt-hold { to { background-size: 100% 100%; } }
.rt-arrow { color: var(--muted); font-size: 12px; }
.routine-steps { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.routine-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--subtle); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.routine-add { margin-top: 10px; }
.routine-add select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: var(--panel);
}
.routine-cycle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.routine-cycle-lbl { flex: 0 0 auto; font-weight: 600; }
.routine-cycle input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  background: var(--panel);
}

/* ---------- Full history sheet ---------- */
.history-open { width: 100%; margin-top: 14px; }
.history-search-wrap { position: relative; margin-bottom: 10px; }
.history-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 44px 11px 14px;
  font: inherit;
}
.history-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: var(--subtle);
  cursor: pointer;
  font-size: 15px;
  display: grid;
  place-items: center;
}
.history-search-btn:active { background: var(--green-soft); }
.history-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.history-chips::-webkit-scrollbar { display: none; }
.history-count { margin: 4px 0 10px; font-size: 12px; color: var(--muted); }
.history-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.history-head .sheet-title { margin: 0; }
.history-edit-toggle { flex: 0 0 auto; }
.history-list { min-height: 40px; }
.history-more {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-weight: 700;
  color: var(--green-strong);
  cursor: pointer;
}
.history-close { width: 100%; margin-top: 10px; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric { background: var(--subtle); border-radius: 16px; padding: 12px; }
.metric-label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.metric-value { font-size: 14px; font-weight: 700; }

/* 최근·다음 일정: 이전 박스 그리드 유지, 상위 3개까지 + 높이 살짝 축소 */
.info-card.compact-card { padding: 14px; }
.info-card.compact-card .info-card-title { margin-bottom: 10px; }
.info-card.compact-card .metrics { gap: 8px; }
.info-card.compact-card .metric { padding: 9px 12px; }
.info-card.compact-card .metric-label { margin-bottom: 3px; }
.sched-more { width: 100%; margin-top: 10px; min-height: 40px; font-size: 13px; }

.row-list { display: grid; gap: 0; }
.timeline-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-row:last-child { border-bottom: 0; }
.row-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.row-meta { font-size: 12px; color: var(--muted); }

.timeline-list { display: grid; gap: 12px; }

.timeline-group {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: start;
  padding-top: 4px;
}

.timeline-group + .timeline-group {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.timeline-group-date {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--subtle);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.timeline-group-entries {
  position: relative;
  display: grid;
  gap: 8px;
  padding-left: 16px;
}

.timeline-group-entries::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--line);
}

.timeline-entry {
  position: relative;
  min-width: 0;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--green-strong);
  box-shadow: 0 0 0 3px var(--panel);
}

.timeline-entry-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.timeline-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.timeline-entry-inline {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  word-break: break-word;
}

.timeline-entry-text {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  white-space: pre-wrap;
}

/* ---------- Tag filter row ----------
   Mobile: chips scroll horizontally in one row (모두 보기 hidden, 태그 설정 pinned).
   Desktop: chips wrap but clamp to one line, expanded via 모두 보기 (responsive
   layer below). Controls (모두 보기 / 태그 설정) are pinned to the right. */
/* 태그는 개수가 많아 다 펼치면 과하다. '2줄 창'으로 고정하고, 넘치면 그 안에서 세로 스크롤.
   관리 ⚙는 스크롤에 묻히지 않게 박스 아래 별도 줄에 둔다. */
.tag-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.tag-row .tagbox {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 64px; /* 칩 2줄 */
  overflow-y: auto;
  overscroll-behavior: contain; /* 끝에서 페이지로 스크롤 전이 방지 */
  scrollbar-width: none;
}
.tag-row .tagbox::-webkit-scrollbar { display: none; }
.tag-row .tagctrls { display: flex; gap: 8px; }
.chip-more { display: none; }

/* ---------- Tag filter settings ---------- */
.chip-settings {
  border-style: dashed;
  color: var(--green-strong);
  font-weight: 700;
}
.tag-settings-group { margin-top: 16px; }
.tag-toggle-list { display: grid; gap: 2px; margin-top: 8px; }
.tag-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: 10px;
  cursor: pointer;
}
.tag-toggle-row:hover { background: var(--subtle); }
.tag-toggle-row input { width: 18px; height: 18px; accent-color: var(--green); flex: 0 0 auto; }
.tag-toggle-name { font-size: 14px; }

/* ---------- Tag manager sheet ---------- */
.tag-add-row { display: flex; gap: 8px; margin: 4px 0 6px; }
.tag-add-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.tag-add-btn { min-height: 0; padding: 0 16px; flex: 0 0 auto; }
.tag-add-error { margin: 0 0 6px; font-size: 12px; color: var(--danger); min-height: 14px; }
.tag-manage-list { display: grid; gap: 1px; }
.tag-manage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 6px;
  border-radius: 10px;
}
.tag-manage-row:hover { background: var(--subtle); }
.action-color { flex: 0 0 auto; width: 30px; height: 30px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.action-color::-webkit-color-swatch { border: none; border-radius: 5px; }
.action-color::-webkit-color-swatch-wrapper { padding: 0; }
.tag-manage-row > input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  flex: 0 0 auto;
}
.tag-manage-name { flex: 1 1 auto; min-width: 0; font-size: 14px; }
.tag-rename-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--green);
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
}
.rowbtn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

/* 필터 관리 시트: 진입 버튼, 탭, 행동 목록 */
.filter-manage-row { display: flex; justify-content: flex-end; padding: 2px 0 6px; }
.fm-tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.fm-tab {
  flex: 1 1 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.fm-tab.active { background: var(--green); border-color: var(--green); color: #fff; }
.fm-body { min-height: 40px; }
.action-manage-list { display: grid; gap: 2px; }
.action-manage-sys { flex: 0 0 auto; margin-left: auto; font-size: 11px; color: var(--muted); }
.action-uses { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.rowbtn.edit { color: var(--green-strong); }
.rowbtn.del { color: var(--danger); }
.tag-manage-hint { margin: 0 0 6px; font-size: 11px; color: var(--muted); }
.tag-manage-group { display: grid; gap: 1px; }
.tag-row-error { flex: 0 0 auto; font-size: 12px; color: var(--danger); }

/* ---------- Plant-detail editable tags ---------- */
.tags-edit { align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; }
.tag-x {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
.tag-x:hover { color: var(--danger); }
.tag-add-chip {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--green-strong);
  cursor: pointer;
}
.tag-picker {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  max-height: 220px;
  overflow: auto;
  background: var(--panel);
}
.tag-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}
.tag-picker-row:hover { background: var(--subtle); }
.tag-picker-row input { width: 16px; height: 16px; accent-color: var(--green); flex: 0 0 auto; }
.tag-picker-name { font-size: 14px; }
.tag-create-row { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 8px; }
.tag-create-error { flex-basis: 100%; font-size: 12px; color: var(--danger); }

/* ============================================================
   Responsive desktop layer (>= 900px): sidebar app-shell.
   Phones/small tablets (< 900px) keep the mobile layout above.
   The left rail reuses the existing nav; content clears it and
   card lists flow into multiple columns to use the wide space.
   ============================================================ */
.sidebar { display: none; }

@media (min-width: 900px) {
  /* --- left navigation rail --- */
  .sidebar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: fixed;
    left: 0;
    top: 0;
    width: 240px;
    height: 100dvh;
    padding: 24px 16px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    z-index: 60;
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 20px; }
  .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--green-soft);
    color: var(--green-strong);
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 800;
  }
  .brand-name { font-size: 18px; font-weight: 700; }
  .nav-item {
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
  }
  .nav-item:hover { background: var(--subtle); color: var(--text); }
  .nav-item.active { background: var(--green-soft); color: var(--green-strong); }

  /* --- content shells clear the rail and widen --- */
  .app,
  .page {
    margin: 0 auto 0 240px;
    max-width: 1180px;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 40px;
  }
  .app { min-height: 100dvh; }
  .page { padding-top: 8px; }

  .top { padding: 24px 0 16px; }
  .content { padding: 8px 0 0; }
  .title { font-size: 30px; }
  .seg { max-width: 300px; }
  /* Plants search sits in the empty space to the right of the title */
  .head-row .search { flex: 0 0 340px; }
  .filters { flex-wrap: wrap; overflow: visible; }
  /* 데스크톱은 공간이 넉넉하니 2줄 클램프·스크롤·페이드를 풀고 전부 펼친다. */
  .scroll-row, .tag-row .tagbox {
    flex-wrap: wrap;
    overflow: visible;
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .chip-more { display: inline-flex; }

  /* --- hide mobile-only affordances --- */
  .tabbar { display: none; }
  .grabber { display: none; }

  /* --- multi-column card grids --- */
  .accordion,
  #view-upcoming .card-list,
  .plant-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    align-items: start;
  }
  .card.compact:hover,
  .plant-row:hover {
    border-color: var(--accent-line);
    transform: translateY(-2px);
    transition: transform 0.12s ease, border-color 0.12s ease;
  }

  /* --- care sheet becomes a centered modal --- */
  .scrim { place-items: center; }
  .sheet {
    width: min(520px, 92vw);
    max-height: 88dvh;
    border-radius: 20px;
    padding: 24px 24px 20px;
  }

  /* --- plant detail: hero full width, info cards in two columns --- */
  #detail-root {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
  #detail-root .hero { grid-column: 1 / -1; }

  /* --- toast clears the (now absent) bottom bar --- */
  .snackbar { left: auto; right: 32px; transform: none; bottom: 28px; }
}


.timeline-entry-head { display: flex; align-items: center; gap: 8px; }
.timeline-edit { flex: 0 0 auto; margin-left: auto; border: 1px solid var(--line); background: var(--panel); color: var(--green-strong); border-radius: 8px; font: inherit; font-size: 12px; font-weight: 700; padding: 4px 9px; cursor: pointer; }
.record-edit-sec { margin-bottom: 14px; }
.record-edit-label { font-size: 13px; font-weight: 800; margin: 0 0 6px; }
.record-prow { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.record-prow select { flex: 1 1 auto; min-width: 0; }
.record-prow .record-sm { flex: 0 0 78px; }
.record-x { flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); color: var(--danger); border-radius: 9px; width: 34px; height: 40px; font-size: 16px; cursor: pointer; }
.record-addp { border: 1px dashed var(--line); background: transparent; color: var(--green-strong); border-radius: 10px; padding: 9px; font: inherit; font-weight: 700; font-size: 13px; width: 100%; cursor: pointer; }
.record-edit-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.record-del { border: 1px solid var(--line); background: transparent; color: var(--danger); border-radius: 12px; padding: 11px 14px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.rec-addrow { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.rec-addbtn { width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--green-strong); border-radius: 12px; padding: 11px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.rec-picker { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--panel-soft); }
.rec-picker-h { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.rec-picker-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rec-achip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.rec-newrow { display: flex; gap: 8px; }
.rec-newrow input { flex: 1 1 auto; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 16px; }
.rec-mk { flex: 0 0 auto; border: 0; background: var(--green); color: #fff; border-radius: 10px; padding: 9px 14px; font: inherit; font-weight: 800; font-size: 13px; cursor: pointer; }
.record-foot-spacer { flex: 1 1 auto; }
/* 관찰 기록 카드 */
.record-list { display: grid; gap: 10px; }
.record-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.record-thumb-link { flex: 0 0 auto; }
.record-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; display: block; background: var(--subtle); }
.record-body { flex: 1 1 auto; min-width: 0; }
.record-memo { margin: 0 0 4px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.record-date { margin: 0; font-size: 12px; color: var(--muted); }
.record-item .record-del { flex: 0 0 auto; padding: 6px 10px; font-size: 13px; }
.record-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.record-preview { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; background: var(--subtle); }
.record-cover-opt { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--text); cursor: pointer; }
.record-cover-opt input { width: 18px; height: 18px; accent-color: var(--green-strong); }
.record-sheet-error { margin: 0 0 8px; font-size: 13px; color: var(--danger); font-weight: 700; }
.oneoff-addbtn { width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--green-strong); border-radius: 12px; padding: 11px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.oneoff-form { margin-top: 10px; }
.oneoff-lbl { font-size: 12px; font-weight: 800; color: var(--muted); margin: 12px 0 6px; }
.oneoff-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.oneoff-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 12px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.oneoff-chip.active { background: var(--green-soft); border-color: var(--green); color: var(--green-strong); }
.oneoff-daterow { display: flex; gap: 8px; margin-top: 6px; }
.oneoff-daterow .oneoff-date { flex: 1 1 auto; min-width: 0; }
.oneoff-go { flex: 0 0 auto; border: 0; background: var(--green); color: #fff; border-radius: 10px; padding: 9px 16px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.oneoff-pending:not(:empty) { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.oneoff-prow { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; }
.oneoff-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent-secondary); flex: 0 0 auto; }
.oneoff-pd { color: var(--muted); font-size: 13px; }
.oneoff-px { margin-left: auto; border: 1px solid var(--line); background: var(--panel); color: var(--danger); border-radius: 8px; padding: 4px 9px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.rec-uses-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--text); }
.rec-uses-row input { width: 18px; height: 18px; }
.rec-achip-group { display: inline-flex; align-items: center; gap: 2px; }
.rec-achip-edit { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 8px; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.rec-edit-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; width: 100%; }
.rec-edit-name { flex: 1 1 140px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; }
.care-prod { margin: 6px 0 2px; padding: 8px 10px; border-left: 2px solid var(--green); background: transparent; }
.care-prod-current { display: flex; }
.care-prod-picker { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.care-prod-picker[hidden] { display: none; }
/* 제품이 많아도 시트를 밀어내지 않도록 칩 상자 안에서만 스크롤한다.
   대략 3줄이 보이는 높이 — 더 있으면 스크롤로 닿는다. */
.care-prod-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.care-chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 12px; font-size: 13px; font-weight: 700; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.care-chip.primary { border-color: var(--green); color: var(--green-strong); }
.care-chip.new { border-style: dashed; color: var(--green-strong); }
.care-prod-new { display: flex; flex-wrap: wrap; gap: 6px; }
.care-prod-new[hidden] { display: none; }
.care-prod-pill { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 8px; border: 1px solid var(--green); border-radius: 12px; background: var(--panel); }
.care-prod-name { font-weight: 800; font-size: 14px; flex: 0 0 auto; }
/* 16px 미만이면 iOS Safari 가 입력창을 탭할 때 페이지를 확대해버린다. 16px 유지. */
.care-prod-amt { flex: 1 1 90px; min-width: 70px; max-width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 16px; }
.care-prod-link { flex: 0 0 auto; border: 0; background: transparent; color: var(--green-strong); font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: underline; padding: 4px; }
.care-prod-x { flex: 0 0 auto; border: 1px solid var(--line); background: var(--panel); color: var(--danger); border-radius: 8px; width: 30px; height: 30px; font-size: 14px; cursor: pointer; }
.care-water-amt { width: 100%; margin-top: 8px; }
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.auth-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.auth-title { font-size: 20px; margin: 12px 0 16px; }
.auth-label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.auth-card .input, .settings .input { width: 100%; }
.auth-error { color: var(--danger); font-size: 13px; margin: 10px 0 0; }
.auth-submit { width: 100%; margin-top: 16px; }

/* 설정: 섹션 제목과 그 아래 입력/목록 사이 여백 */
.settings-panel .section-title { margin-bottom: 12px; }
@media (max-width: 640px) {
  .labels-panel { flex-direction: column; gap: 0; }
}

/* 설정 > 제품 관리 */
.product-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.product-name { font-size: 14px; font-weight: 700; }
.product-cat { font-size: 12px; color: var(--muted); }
.product-dil { font-size: 12px; color: var(--muted); }
.product-confirm { flex: 1 1 auto; font-size: 12px; color: var(--muted); }
.product-row .row-actions { margin-left: auto; display: flex; gap: 4px; }
.product-row .input { flex: 1 1 120px; min-width: 0; }

/* 설정 > 만들어 놓은 로테이션 */
.rotation-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rotation-name { font-size: 14px; font-weight: 700; }
.rotation-seq { font-size: 12px; color: var(--muted); flex: 1 1 160px; min-width: 0; }
.rotation-cycle { font-size: 12px; color: var(--muted); }
.rotation-confirm { flex: 1 1 auto; font-size: 12px; color: var(--muted); }
.rotation-row .row-actions { margin-left: auto; display: flex; gap: 4px; }
.rotation-row .input { flex: 1 1 120px; min-width: 0; }
.rotation-row .routine-steps { flex: 1 1 100%; }

/* 설정 > 화면 : 톤 3택 */
.theme-choice {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 12px;
}
.theme-choice .seg-btn { min-height: 44px; }

/* 브랜드 심볼. 사이드바(데스크톱)와 로그인 화면에서 쓴다. */
.brand-symbol { width: 36px; height: 36px; flex: 0 0 auto; color: var(--green); }

/* 화면 제목 앞의 심볼. 글자 크기를 따라가고 색은 포인트 색을 쓴다. */
.title-symbol {
  /* 글자 크기를 따라간다. 제목 줄 높이(48px = 옆 탭 줄)를 넘으면 헤더가 같이
     두꺼워지므로, 데스크톱 30px 기준 46.5px 이 되는 1.55em 이 상한이다. */
  width: 1.55em;
  height: 1.55em;
  flex: 0 0 auto;
  color: var(--green);
}

/* 오류 문구(.auth-error)는 평소 숨어 있다. 이 여백이 없으면 '변경' 버튼이
   바로 위 입력칸에 달라붙는다(로그인 화면의 .auth-submit 과 같은 값). */
#pw-save { margin-top: 16px; }

/* 설정 맨 아래 앱 정보. 조용히 이름만 밝히는 자리다. */
.about {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 36px 16px 16px;
  color: var(--muted);
  font-size: 15px;
}
.about b { color: var(--text); font-weight: 700; font-size: 22px; }
/* 이 크기라야 잎맥까지 또렷해 심볼이 브랜드 마크로 읽힌다. */
.about-symbol { width: 72px; height: 72px; flex: 0 0 auto; color: var(--green); opacity: 0.9; }

/* 로그인 화면은 이 앱을 처음 만나는 자리라 브랜드를 사이드바보다 크게 세운다. */
.auth-card .brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auth-card .brand-symbol { width: 60px; height: 60px; }
.auth-card .brand-name { font-size: 26px; font-weight: 700; color: var(--text); }

/* 로테이션 편집 — 비료를 주는 행동 고르기.
   관수를 담그기로 하고 비료는 분무로 주는 경우가 있어 로테이션마다 정한다. */
.routine-carriers { display: grid; gap: 8px; margin-top: 14px; }
.routine-carrier-box { display: flex; flex-wrap: wrap; gap: 8px; }
.routine-carrier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 14px;
  font-weight: 700;
}
.routine-carrier input { width: 16px; height: 16px; accent-color: var(--green); }
