/* LIFE OS v1.1 — 봇 V16 수묵용(水墨龍) 톤 100% 통일
 * 봇 V16 inkterm.xyz 패턴 그대로 (border 없음 + 우하 코너 브래킷)
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: #000000;
  color: #dddddd;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: 72px;
  max-width: 100%;
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: normal;
}

body {
  max-width: 480px;
  margin: 0 auto;
  padding: 14px 14px 72px 14px;
}

img, table, pre, code { max-width: 100%; }

/* ===================== 헤더 ===================== */
.app-header {
  background: transparent;
  border: none;
  padding: 14px 4px 12px 4px;
  margin-bottom: 16px;
  position: relative;
}
.app-header::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid #882222;
  border-right: 2px solid #882222;
  pointer-events: none;
}

.app-title {
  font-size: 11px;
  color: #555;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  word-break: keep-all;
}

.tab-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab-btn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 13px;
  color: #666;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  word-break: keep-all;
  flex: 0 0 auto;
}
.tab-btn:hover { color: #aaa; }
.tab-btn.active {
  color: #ffffff;
  border-bottom: 1px solid #cc3333;
  padding-bottom: 3px;
}
.tab-btn .han { font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 14px; }
.tab-btn .en {
  font-size: 9px;
  color: #555;
  display: block;
  margin-top: 2px;
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', monospace;
}
.tab-btn.active .en { color: #cc3333; }

/* ===================== 탭 컨텐츠 ===================== */
.tab-content { display: none; padding: 0; }
.tab-content.active { display: block; }

/* ===================== 터미널 프롬프트 ===================== */
.terminal {
  background: transparent;
  border: none;
  padding: 6px 0 10px 0;
  margin-bottom: 14px;
  font-size: 12px;
  word-break: keep-all;
}
.terminal > div:first-child {
  font-size: 12px;
  line-height: 1.6;
  color: #888;
}
.terminal .user { color: #cc3333; }
.terminal .prompt { color: #555; }
.terminal .path { color: #6688aa; }
.terminal .cmd { color: #cc3333; }

.terminal .log-lines {
  margin-top: 6px;
  padding-top: 0;
  border-top: none;
}

/* 로그 라인 */
.log-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 4px 0;
  line-height: 1.5;
}
.log-line .time {
  color: #555;
  min-width: 64px;
  font-size: 11px;
  white-space: nowrap;
}
.log-line .level {
  min-width: 38px;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 0;
  text-align: center;
  font-weight: 700;
  white-space: nowrap;
  margin: 0;
}
.log-line .level.LOAD { color: #6688aa; background: rgba(102,136,170,0.12); }
.log-line .level.OK   { color: #6688aa; background: rgba(102,136,170,0.12); }
.log-line .level.WARN { color: #cc6633; background: rgba(204,102,51,0.12); }
.log-line .level.ERROR{ color: #cc3333; background: rgba(204,51,51,0.12); }

/* ===================== 카드 ===================== */
.card {
  background: transparent;
  border: none;
  border-radius: 0;
  margin-bottom: 18px;
  padding: 16px 14px;
  position: relative;
}
.card::before { content: none; }  /* 좌측 컬러바 제거 */
.card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid #882222;
  border-right: 2px solid #882222;
  pointer-events: none;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #1a1a1a;
  flex-wrap: wrap;
  gap: 6px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  word-break: keep-all;
  flex: 1;
  line-height: 1.4;
}
.card-title .han {
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
  font-size: 15px;
}
.card-title .en {
  font-size: 10px;
  color: #666;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

.card-meta {
  font-size: 11px;
  color: #888;
  flex-shrink: 0;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  gap: 8px;
}
.card-row .label {
  color: #777;
  word-break: keep-all;
  flex-shrink: 0;
}
.card-row .value {
  color: #dddddd;
  text-align: right;
  word-break: keep-all;
}
.card-row .value.pos { color: #6688aa; }
.card-row .value.neg { color: #cc3333; }
.card-row .value.warn { color: #cc6633; }

.card-divider {
  border-top: 1px solid #1a1a1a;
  margin: 10px 0;
}

/* ===================== 진행 바 (게이지) ===================== */
.gauge {
  position: relative;
  height: 5px;
  background: #1a1a1a;
  border-radius: 0;
  overflow: hidden;
  margin: 10px 0 4px;
  border: none;
}
.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, #cc3333, #cc6633);
  transition: width 0.4s;
}
.gauge-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #555;
  margin-top: 4px;
}

/* ===================== 마일스톤 ===================== */
.milestone-list { margin-top: 4px; }
.milestone-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 13px;
}
.milestone-item:last-child { border-bottom: 0; }

.milestone-dday {
  font-weight: 700;
  font-size: 13px;
  color: #ffffff;
  white-space: nowrap;
  min-width: 54px;
}
.milestone-dday.urgent { color: #cc3333; }
.milestone-dday.soon { color: #cc6633; }
.milestone-dday.normal { color: #6688aa; }
.milestone-dday.measuring { color: #555; font-size: 11px; font-weight: 400; }

.milestone-date {
  display: none;  /* 봇 톤은 D-day + 이름 직결 */
}
.milestone-name {
  color: #aaa;
  font-size: 12px;
  word-break: keep-all;
}
.milestone-name .cat {
  display: inline-block;
  font-size: 9px;
  padding: 1px 5px;
  margin-right: 6px;
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===================== 식사/운동 체크 ===================== */
.meal-list, .workout-exercises {
  margin-top: 8px;
}
.meal-item {
  display: grid;
  grid-template-columns: 48px 56px 1fr 28px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 12px;
}
.meal-item:last-child { border-bottom: 0; }
.meal-time { color: #6688aa; font-weight: 700; font-size: 12px; }
.meal-name { color: #888; font-size: 12px; word-break: keep-all; }
.meal-menu { color: #ddd; font-size: 12px; word-break: keep-all; line-height: 1.4; }
.meal-kcal { font-size: 10px; color: #555; margin-top: 2px; }

.check-btn {
  background: transparent;
  border: 1px solid #333;
  color: #555;
  width: 26px; height: 26px;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}
.check-btn:hover { border-color: #6688aa; color: #6688aa; }
.check-btn.checked {
  border-color: #6688aa;
  color: #6688aa;
  background: rgba(102,136,170,0.08);
}
.check-btn.skipped {
  border-color: #444;
  color: #444;
}

/* 운동 분할 */
.workout-type {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Noto Serif KR', serif;
  margin-bottom: 8px;
}
.workout-exercises {
  font-size: 12px;
  color: #aaa;
  list-style: none;
  margin: 8px 0;
  padding: 0;
}
.workout-exercises li {
  padding: 4px 0 4px 16px;
  position: relative;
  border-bottom: 1px solid #1a1a1a;
}
.workout-exercises li:last-child { border-bottom: 0; }
.workout-exercises li::before {
  content: '└';
  position: absolute;
  left: 2px;
  color: #555;
}

/* ===================== 캘린더 ===================== */
.cal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
}
.cal-nav {
  background: transparent;
  border: 1px solid #333;
  color: #aaa;
  width: 30px; height: 30px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 0;
  font-size: 12px;
}
.cal-nav:hover { border-color: #cc3333; color: #cc3333; }
.cal-month {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  font-family: 'Noto Serif KR', serif;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow {
  text-align: center;
  font-size: 10px;
  color: #555;
  padding: 4px 0;
  letter-spacing: 0.5px;
}
.cal-cell {
  aspect-ratio: 1;
  background: transparent;
  border: 1px solid #222;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.cal-cell:hover { border-color: #444; color: #ddd; }
.cal-cell.empty { background: transparent; border: 1px solid transparent; cursor: default; }
.cal-cell.today {
  border-color: #cc3333;
  color: #ffffff;
  background: rgba(204,51,51,0.06);
}
.cal-cell .marks {
  display: flex;
  gap: 2px;
  font-size: 7px;
  margin-top: 2px;
}
.cal-cell .star { color: #d4aa44; }
.cal-cell .dot.diet { color: #6688aa; }
.cal-cell .dot.workout { color: #cc6633; }

.cal-detail {
  margin-top: 16px;
  padding: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  display: none;
  position: relative;
}
.cal-detail.show { display: block; }
.cal-detail::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid #882222;
  border-right: 2px solid #882222;
  pointer-events: none;
}

/* ===================== 그래프 ===================== */
.chart-card {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 14px;
  margin-bottom: 18px;
  position: relative;
}
.chart-card::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid #882222;
  border-right: 2px solid #882222;
  pointer-events: none;
}
.chart-card h3 {
  font-size: 12px;
  color: #ffffff;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  word-break: keep-all;
}
.chart-card h3 span:first-child {
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
}
.chart-wrap {
  position: relative;
  height: 200px;
}

/* ===================== 입력 폼 ===================== */
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 11px;
  color: #6688aa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ffffff;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  border-radius: 0;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #6688aa;
}
textarea { resize: vertical; min-height: 60px; }

.btn {
  background: transparent;
  border: 1px solid #333;
  color: #aaa;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.15s;
  word-break: keep-all;
}
.btn:hover { border-color: #6688aa; color: #6688aa; background: rgba(102,136,170,0.06); }
.btn.primary {
  color: #cc3333;
  border-color: #cc3333;
  background: transparent;
}
.btn.primary:hover {
  background: rgba(204,51,51,0.08);
}
.btn.danger {
  color: #cc3333;
  border-color: #333;
  background: transparent;
}
.btn.danger:hover { border-color: #cc3333; background: rgba(204,51,51,0.08); }
.btn.full { width: 100%; display: block; }

/* ===================== 모달 ===================== */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal-bg.show { display: flex; }
.modal {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 0;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  margin: auto;
  position: relative;
  padding: 0;
}
.modal::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid #882222;
  border-right: 2px solid #882222;
  pointer-events: none;
}
.modal h3 {
  padding: 14px 16px;
  font-size: 13px;
  color: #ffffff;
  font-weight: 700;
  border-bottom: 1px solid #222;
  font-family: 'Noto Serif KR', serif;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #222;
}

/* ===================== 設定 (settings) ===================== */
.settings-section {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 16px 14px;
  margin-bottom: 18px;
  position: relative;
}
.settings-section::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  width: 14px; height: 14px;
  border-bottom: 2px solid #882222;
  border-right: 2px solid #882222;
  pointer-events: none;
}
.settings-section h3 {
  font-size: 12px;
  color: #6688aa;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 13px;
  gap: 8px;
}
.settings-row:last-child { border-bottom: 0; }
.settings-row .label { color: #777; word-break: keep-all; }

/* ===================== 하단 풋탭 ===================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #000000;
  border-top: 1px solid #222;
  display: flex;
  padding: 8px 0 10px 0;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.8);
  max-width: 480px;
  margin: 0 auto;
}
.nav-btn {
  flex: 1;
  text-align: center;
  font-size: 12px;
  padding: 6px 0;
  color: #888;
  cursor: pointer;
  border-top: 2px solid transparent;
  margin-top: -8px;
  padding-top: 14px;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  font-family: inherit;
  word-break: keep-all;
  transition: color 0.15s;
}
.nav-btn:hover { color: #aaa; }
.nav-btn.active {
  color: #ffffff;
  border-top-color: #d4aa44;
}
.nav-btn .icon {
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
  color: #666;
  line-height: 1;
}
.nav-btn.active .icon { color: #d4aa44; }
.nav-btn .han {
  display: block;
  font-family: 'Noto Serif KR', serif;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}
.nav-btn .en {
  display: block;
  font-size: 8px;
  color: #555;
  margin-top: 2px;
  letter-spacing: 0.5px;
  font-family: 'JetBrains Mono', monospace;
}
.nav-btn.active .en { color: #d4aa44; }
.nav-btn.expand {
  flex: 0 0 44px;
  color: #cc9933;
  font-weight: 700;
  min-width: 44px;
  opacity: 0.4;
  border-top: 2px solid transparent;
}

/* ===================== 회고 ===================== */
.retro-axis {
  margin-bottom: 12px;
}
.retro-axis label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #6688aa;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
}
.retro-axis textarea {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #333;
  color: #ddd;
  font-family: inherit;
  font-size: 12px;
  padding: 8px;
  min-height: 50px;
  border-radius: 0;
}
.retro-axis textarea:focus { outline: none; border-color: #6688aa; }

/* ===================== 유틸 ===================== */
.empty-state {
  text-align: center;
  color: #555;
  padding: 24px 12px;
  font-size: 12px;
}
.text-cyan { color: #6688aa !important; }
.text-red { color: #cc3333 !important; }
.text-yellow { color: #d4aa44 !important; }
.text-orange { color: #cc6633 !important; }
.text-green { color: #6688aa !important; }  /* 봇 톤엔 녹색 없음 — 청록으로 대체 */
.text-gray { color: #555 !important; }

.badge {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 0;
  background: transparent;
  border: 1px solid #2a2a2a;
  color: #888;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.badge.OK    { color: #6688aa; border-color: rgba(102,136,170,0.5); background: rgba(102,136,170,0.08); }
.badge.LOAD  { color: #6688aa; border-color: rgba(102,136,170,0.5); background: rgba(102,136,170,0.08); }
.badge.WARN  { color: #cc6633; border-color: rgba(204,102,51,0.5); background: rgba(204,102,51,0.08); }
.badge.STALE { color: #cc6633; border-color: rgba(204,102,51,0.5); background: rgba(204,102,51,0.08); }
.badge.ERR   { color: #cc3333; border-color: rgba(204,51,51,0.5); background: rgba(204,51,51,0.08); }

/* 블링커 (LIVE 상태) */
.blinker {
  font-size: 11px;
  color: #cc3333;
  animation: blink 1.2s steps(1) infinite;
  flex-shrink: 0;
}
.blinker::before { content: '●'; }
@keyframes blink { 50% { opacity: 0; } }

/* 모바일 스크롤 */
.tab-content { min-height: calc(100vh - 200px); }

/* PWA 안전영역 */
@supports (padding: max(0px)) {
  .bottom-nav {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

/* 스크롤바 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #222; }

/* (영문) 텍스트 — 한글 옆 작게 회색 */
.nw {
  white-space: nowrap;
  font-size: 0.82em;
  font-weight: 400;
  color: #666;
  letter-spacing: 0;
  text-transform: none;
}

/* 한자 강조 */
.han-em {
  font-family: 'Noto Serif KR', serif;
  font-weight: 700;
  color: #ffffff;
}

/* ===================== 財 (money) ===================== */
.sec-title {
  font-size: 11px;
  color: #6688aa;
  letter-spacing: 0.08em;
  margin: 8px 0 6px;
  text-transform: uppercase;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.cat-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #1a1a1a;
}
.cat-row:last-child { border-bottom: 0; }
.cat-row .cat-name {
  color: #aaa;
  font-size: 12px;
  word-break: keep-all;
}
.cat-row .cat-right { width: 100%; }
.cat-row .cat-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}
.cat-row .cat-val { color: #ddd; }
.cat-row .cat-pct {
  color: #777;
  font-size: 10px;
  white-space: nowrap;
}
.cat-row .cat-pct.over { color: #cc3333; font-weight: 700; }

.gauge.mini {
  height: 3px;
  margin: 0;
  background: #1a1a1a;
}

.trend-row {
  display: grid;
  grid-template-columns: 40px 1fr 90px;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  padding: 4px 0;
}
.trend-row .trend-label {
  color: #888;
  font-family: 'JetBrains Mono', monospace;
}
.trend-row .trend-bar-track {
  height: 4px;
  background: #1a1a1a;
  overflow: hidden;
}
.trend-row .trend-bar {
  height: 100%;
  background: #6688aa;
  transition: width 0.3s;
  min-width: 1px;
}
.trend-row .trend-val {
  color: #aaa;
  text-align: right;
  white-space: nowrap;
}
.trend-row.current .trend-val { color: #cc3333; font-weight: 700; }
