/* DongFeng OS — design tokens + base components.
 * Tokens are the Wise system (design/design-systems/wise/tokens.css);
 * the component layer below implements DESIGN.md §4. */

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;800;900&display=swap");

:root {
  --bg: #ffffff;
  --surface: #e8ebe6;
  --fg: #0e0f0c;
  --muted: #868685;
  --border: rgba(14, 15, 12, 0.12);
  --accent: #9fe870;
  --accent-on: #163300;
  --accent-hover: #cdffad;
  --accent-soft: rgba(22, 51, 0, 0.08);
  --success: #054d28;
  --warn: #ffd11a;
  --danger: #d03238;

  --font-display: Inter, ui-sans-serif, system-ui, sans-serif;
  --font-body: Inter, Helvetica, Arial, ui-sans-serif, sans-serif;

  --text-sm: 14px;
  --text-base: 18px;
  --text-lg: 22px;
  --text-xl: 26px;

  --radius-sm: 16px;
  --radius-md: 30px;
  --radius-lg: 40px;
  --radius-pill: 9999px;

  --elev-ring: 0 0 0 1px var(--border);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.44;
  letter-spacing: 0.18px;
  font-feature-settings: "calt" 1;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 560px;          /* mobile-first single column */
  margin: 0 auto;
  padding: 20px 16px 64px;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 20px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.brand-name { font-weight: 600; font-size: var(--text-base); }
.brand-sub { color: var(--muted); font-size: var(--text-sm); }
.app-header a { color: var(--muted); text-decoration: none; font-size: var(--text-sm); }

/* Display number / page title */
.eyebrow { color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.page-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 0.85;
  letter-spacing: normal;
  margin: 4px 0 24px;
}

/* Sections */
.section { margin: 28px 0 0; }
.section-title { font-size: var(--text-lg); font-weight: 600; letter-spacing: -0.4px; margin: 0 0 12px; }

/* Cards */
.card {
  background: var(--bg);
  border-radius: var(--radius-md);
  box-shadow: var(--elev-ring);
  padding: 18px 20px;
}
.card + .card { margin-top: 12px; }

/* Metric chips */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.chip {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  text-align: center;
}
.chip .n { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1; }
.chip .l { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* Rows (todos, conversations, qr) */
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.row:first-child { border-top: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: var(--text-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s { color: var(--muted); font-size: var(--text-sm); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges */
.badge {
  display: inline-block; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600; padding: 2px 10px;
  background: var(--surface); color: var(--fg);
}
.badge.hot { background: var(--accent-hover); color: var(--accent-on); }
.badge.todo { background: var(--surface); color: var(--fg); }
.badge.done { background: rgba(5, 77, 40, 0.12); color: var(--success); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: var(--text-base); font-weight: 600;
  letter-spacing: -0.11px;
  border: none; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-on);
  border-radius: var(--radius-pill);
  padding: 12px 20px;
  transition: transform var(--ease) 150ms, background var(--ease) 150ms;
}
.btn:hover { background: var(--accent-hover); transform: scale(1.05); }
.btn:active { transform: scale(0.95); }
.btn.block { width: 100%; }
.btn.secondary { background: var(--accent-soft); color: var(--fg); }
.btn.secondary:hover { background: rgba(22, 51, 0, 0.14); }

/* Forms (login) */
.field { margin: 0 0 14px; }
.field label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.field input {
  width: 100%; font-family: inherit; font-size: var(--text-base);
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
}
.field input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 60%); border-color: var(--accent); }

/* Phone input with country-code selector */
.phone-row { display: flex; gap: 8px; }
.phone-row select {
  flex: 0 0 auto; width: 110px; font-family: inherit; font-size: var(--text-base);
  padding: 12px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
}
.phone-row input { flex: 1; min-width: 0; }
.phone-row select:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent), transparent 60%); border-color: var(--accent); }

.empty { color: var(--muted); font-size: var(--text-sm); padding: 8px 0; }
.devhint { margin-top: 14px; padding: 10px 14px; background: var(--surface); border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--fg); }
.code { font-family: ui-monospace, Menlo, monospace; font-weight: 600; }
