:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --text: #18212f;
  --muted: #677489;
  --border: #e3eaf3;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #b45309;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}

body {
  background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 100%);
  color: var(--text);
}

.page-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background: transparent;
  padding-bottom: 96px;
}

.centered-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.topbar {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.22);
}

.topbar h1 {
  font-size: 23px;
  font-weight: 800;
}

.topbar p {
  margin-top: 6px;
  font-size: 14px;
  opacity: 0.95;
}

.content {
  padding: 16px;
}

.card {
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 16px;
}

.card-soft {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.brand-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
}

.section-title {
  font-size: 18px;
  margin-bottom: 14px;
  font-weight: 800;
}

.no-margin {
  margin-bottom: 0;
}

.section-head-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
}

.text-input,
textarea,
select {
  width: 100%;
  border: 1px solid #d7e1ee;
  border-radius: 14px;
  padding: 13px;
  font-size: 16px;
  margin-bottom: 12px;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.text-input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.12s ease;
}

button:active,
.button-link:active {
  transform: scale(0.985);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
}

.primary-btn:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.secondary-btn {
  background: #eef3f9;
  color: var(--text);
  border: 1px solid var(--border);
}

.secondary-btn:hover {
  background: #e7edf5;
}

.danger-btn {
  background: linear-gradient(135deg, var(--danger) 0%, #ef4444 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.16);
}

.success-btn {
  background: linear-gradient(135deg, var(--success) 0%, #22c55e 100%);
  color: white;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.16);
}

.actions-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.actions-row > * {
  flex: 1;
}

.top-gap-sm {
  margin-top: 10px;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mode-switch {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.mode-btn {
  flex: 1;
  background: #e5e7eb;
  color: #111827;
  border: none;
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: white;
}

.status-box {
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.status-box.info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.status-box.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.status-box.error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.last-updated {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.install-banner {
  margin-top: 12px;
}

.task-cards,
.job-cards,
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-card-link {
  text-decoration: none;
  color: inherit;
}

.task-card,
.job-card,
.stat-card,
.mini-list-item,
.analysis-result,
.list li {
  border-radius: 16px;
}

.task-card,
.job-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.task-card-link:hover .task-card {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.task-title {
  font-size: 16px;
  font-weight: 800;
}

.task-meta {
  font-size: 14px;
  color: #526174;
  margin-bottom: 6px;
}

.task-meta:last-child {
  margin-bottom: 0;
}

.task-badge {
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.badge-normal {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-muted {
  background: #edf2f7;
  color: #475569;
}

.analysis-result {
  background: #f9fafb;
  border: 1px solid var(--border);
  padding: 12px;
}

.analysis-row {
  margin-bottom: 8px;
  line-height: 1.7;
}

.analysis-row:last-child {
  margin-bottom: 0;
}

.quick-box {
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.empty-state {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #d7e1ee;
  border-radius: 16px;
  background: #fafcff;
}

.list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list li {
  padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  line-height: 1.8;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  padding: 18px 14px;
  text-align: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.stat-value {
  font-size: 24px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.mini-list-item {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--border);
  padding: 12px;
  line-height: 1.7;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 1px;
  background: #dbe5f0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.05);
}

.bottom-nav-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.bottom-nav a,
.bottom-nav-more-btn {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  text-decoration: none;
  text-align: center;
  padding: 14px 8px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: 0;
  width: 100%;
  box-shadow: none;
}

.bottom-nav a.active,
.bottom-nav-more-btn.active {
  background: linear-gradient(180deg, #eaf2ff 0%, #dce9ff 100%);
  color: var(--primary-dark);
}

.bottom-nav-more-wrap {
  position: relative;
}

.bottom-nav-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.more-caret {
  font-size: 12px;
  opacity: 0.8;
}

.bottom-nav-more-menu {
  position: absolute;
  bottom: 56px;
  inset-inline-start: 0;
  min-width: 170px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
  overflow: hidden;
  z-index: 40;
}

.bottom-nav-more-menu a {
  display: block;
  padding: 13px 14px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid #f1f5f9;
  background: white;
}

.bottom-nav-more-menu a:last-child {
  border-bottom: none;
}

.bottom-nav-more-menu a:hover,
.bottom-nav-more-menu a.active {
  background: #f4f8ff;
  color: var(--primary-dark);
}

.pagination-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}

.pagination-btn {
  width: auto;
  min-width: 96px;
}

.pagination-info {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.notification-card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  padding: 14px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.notification-card.unread {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.notification-title {
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 8px;
}

.notification-body {
  font-size: 14px;
  color: #526174;
  line-height: 1.8;
  margin-bottom: 10px;
}

.notification-meta {
  font-size: 12px;
  color: var(--muted);
}

.notification-actions {
  margin-top: 12px;
}

.topbar-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.top-notification-btn {
  position: relative;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 22px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.top-notification-btn:active {
  transform: scale(0.96);
}

.top-notif-badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  border: 2px solid white;
  box-shadow: 0 6px 14px rgba(220, 38, 38, 0.28);
}

.settings-hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  border-color: #cfe3ff;
}

.settings-hero-card .muted-text {
  color: #526174;
  line-height: 1.8;
  margin-bottom: 12px;
}

.small-text {
  font-size: 13px;
}

.full-width-btn {
  width: 100%;
}

.dev-settings {
  padding: 0;
  overflow: hidden;
}

.dev-settings summary {
  padding: 16px;
  cursor: pointer;
  font-weight: 800;
  color: var(--muted);
  list-style: none;
}

.dev-settings summary::-webkit-details-marker {
  display: none;
}

.dev-settings summary::after {
  content: "▾";
  float: left;
  opacity: 0.7;
}

.dev-settings[open] summary::after {
  content: "▴";
}

.dev-settings-body {
  padding: 0 16px 16px;
}

.login-footer {
  margin-top: 12px;
  text-align: center;
}

.link-btn {
  color: #0d6efd;
  text-decoration: none;
  font-size: 14px;
}

.link-btn:hover {
  text-decoration: underline;
}

.code-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 20px;
  font-weight: 900;
}