:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --ink: #0f172a;
  --muted: #475569;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --accent: #059669;
  --teal: #0d9488;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --border: #e2e8f0;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #e2e8f0;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.mobile-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.12);
}

.app-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
}

.app-header .eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
}

.app-header h1 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.pill-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.app-main {
  flex: 1;
  padding: 16px 14px 92px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.card h2,
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}

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

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
}

.badge.time-badge {
  background: #ecfdf5;
  color: var(--accent);
}

.badge.warn-badge {
  background: var(--warn-bg);
  color: var(--warn);
}

.lock-banner {
  background: var(--warn-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  width: 100%;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.22);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--surface-soft);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid var(--border);
}

.btn-sm {
  padding: 7px 13px;
  font-size: 12px;
  width: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}

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

.item-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}

.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 0;
}

.chat-msg {
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.chat-msg.user {
  background: var(--primary);
  color: #fff;
  align-self: flex-end;
  max-width: 85%;
}

.chat-msg.assistant {
  background: var(--surface-soft);
  color: var(--ink);
  align-self: flex-start;
  max-width: 92%;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px 10px;
  z-index: 30;
}

.nav-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 2px;
  cursor: pointer;
}

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

.nav-tab span.icon {
  font-size: 17px;
  line-height: 1;
}

.hidden {
  display: none !important;
}

.status-msg {
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  color: var(--accent);
}

.status-msg.error {
  background: #fff1f2;
  color: #e11d48;
}
