:root {
  --bg: #eef1ea;
  --green: #1a6b4d;
  --green-soft: #dfe8db;
  --card-green: #e3ead9;
  --text-dark: #14161a;
  --text-muted: #7b8577;
  --border: #e6e6e2;
  --black: #0d0e0c;
  --radius-lg: 20px;
  --radius-md: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #cfd6c9;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex;
  justify-content: center;
}

/* Mobile app frame. On an actual phone this simply fills the viewport;
   on a wider screen it stays capped at a phone-sized column. */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text-dark);
  overflow-x: hidden;
}

.screen {
  display: none;
  padding: 18px 20px calc(110px + var(--safe-bottom));
}

.screen.active {
  display: block;
}

/* ---------- Top bar ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 18px;
}

.top-bar.centered {
  position: relative;
}

.bar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--green);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:active {
  opacity: 0.6;
}

/* ---------- Title ---------- */
.page-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  margin: 4px 0 18px;
}

/* ---------- Request card ---------- */
.request-card {
  position: relative;
  background: var(--card-green);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 150px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.avatar {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.request-meta {
  margin: 0;
  font-size: 15px;
}

.request-meta .muted {
  color: var(--text-muted);
  font-weight: 400;
}

.request-meta strong {
  font-weight: 600;
}

/* ---------- Segmented control ---------- */
.segmented {
  display: flex;
  background: var(--card-green);
  border-radius: var(--radius-md);
  padding: 5px;
  margin-bottom: 18px;
}

.segment {
  flex: 1;
  border: none;
  background: transparent;
  padding: 13px 0;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
}

.segment.active {
  background: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ---------- Info card ---------- */
.info-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 22px 20px 6px;
}

.info-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 700;
  flex-shrink: 0;
}

.info-value {
  font-size: 15px;
  font-weight: 400;
  color: var(--text-dark);
  text-align: right;
}

/* ---------- View document screen ---------- */
.doc-preview {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 20px;
}

.doc-frame {
  width: 100%;
  height: 780px;
  border: none;
  border-radius: 0;
  display: block;
  touch-action: pinch-zoom pan-x pan-y;
}

/* ---------- Fixed bottom CTA ---------- */
.bottom-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 430px;
  padding: 14px 20px calc(18px + var(--safe-bottom));
  background: linear-gradient(to top, var(--bg) 60%, rgba(238,241,234,0));
}

.cta-btn {
  width: 100%;
  border: none;
  background: var(--black);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 17px 0;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.cta-btn:active {
  opacity: 0.85;
}

.bottom-spacer {
  height: 10px;
}
