:root {
  --bg-color: #f9fafb;
  --surface: #ffffff;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --accent-blue: #2563eb;
  --accent-green: #16a34a;
  --accent-red: #dc2626;
  --border-light: #e5e7eb;
}

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
.btn,
.action-tile,
.lang-btn,
.icon-link,
.chip,
.nav-item {
  min-height: 48px;
  min-width: 48px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 14px 16px;
  background: var(--surface);
  color: var(--text-primary);
}

textarea {
  resize: vertical;
}

.app-shell {
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--surface);
}

.brand,
.icon-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lang-btn {
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-secondary);
  padding: 10px 12px;
}

.lang-btn.active {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

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

.notice-banner {
  margin: 0 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  color: var(--accent-blue);
  background: #eff6ff;
}

.card,
.provider-card,
.listing-card,
.request-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 16px;
}

.hero-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-xs,
.stack-sm,
.stack-md {
  display: flex;
  flex-direction: column;
}

.stack-xs {
  gap: 4px;
}

.stack-sm {
  gap: 8px;
}

.stack-md {
  gap: 12px;
}

.section-space-top {
  margin-top: 16px;
}

h1,
h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

p,
.helper-text {
  font-size: 1rem;
  color: var(--text-secondary);
}

.eyebrow {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.section-head,
.card-row,
.meta-row,
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.align-start {
  align-items: flex-start;
}

.grow {
  flex: 1;
}

.avatar-circle,
.role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--accent-blue);
  font-weight: 700;
}

.avatar-circle.large {
  width: 64px;
  height: 64px;
  font-size: 1.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.mini-stat {
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-stat strong {
  font-size: 1.125rem;
}

.mini-stat span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-green);
}

.role-grid,
.action-grid,
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.role-card,
.action-tile {
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  justify-content: center;
  background: var(--surface);
}

.role-card input {
  width: auto;
}

.action-tile {
  color: var(--text-primary);
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.btn-inline {
  width: auto;
}

.btn-primary {
  background: var(--accent-blue);
  color: #ffffff;
}

.btn-success {
  background: var(--accent-green);
  color: #ffffff;
}

.btn-danger {
  background: var(--accent-red);
  color: #ffffff;
}

.btn-secondary {
  background: transparent;
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

.text-link {
  color: var(--accent-blue);
  font-weight: 600;
}

.card-list,
.request-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 0 14px;
  background: var(--surface);
}

.input-with-icon input {
  border: none;
  padding-left: 0;
  padding-right: 0;
}

.search-form,
.search-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  background: var(--surface);
}

.chip-active {
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.badge,
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.accent-blue {
  color: var(--accent-blue);
  border-color: #bfdbfe;
  background: #eff6ff;
}

.accent-green,
.status-accepted,
.status-completed {
  color: var(--accent-green);
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.status-pending {
  color: #b45309;
  border-color: #fde68a;
  background: #fffbeb;
}

.status-rejected {
  color: var(--accent-red);
  border-color: #fecaca;
  background: #fef2f2;
}

.inline-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.tone-blue {
  background: #eff6ff;
}

.tone-green {
  background: #f0fdf4;
}

.bottom-nav {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--border-light);
  background: var(--surface);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-secondary);
  border-radius: 16px;
  padding: 8px;
}

.nav-item.active {
  color: var(--accent-blue);
  border: 1px solid #bfdbfe;
  background: #eff6ff;
}

.icon-svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-inline {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (min-width: 640px) {
  .main-content {
    padding: 20px;
  }

  .search-row {
    flex-direction: row;
    align-items: center;
  }

  .search-row .btn-inline {
    width: auto;
    min-width: 140px;
  }
}
