:root{
  --bg:#0b1220;
  --card:#111a2e;
  --card2:#0f172a;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --border:rgba(148,163,184,.18);
  --primary:#3b82f6;
  --primary2:#2563eb;
  --danger:#ef4444;
  --shadow: 0 12px 30px rgba(0,0,0,.35);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{height:100%}
html{ -webkit-text-size-adjust: 100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  font-size: 17px;               /* ✅ bigger base text */
  line-height: 1.35;
  background: radial-gradient(1200px 600px at 20% -10%, rgba(59,130,246,.25), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(34,197,94,.12), transparent 55%),
              var(--bg);
  color:var(--text);
}

.app{min-height:100%; display:flex; flex-direction:column}

.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px;              /* ✅ bigger */
  background: rgba(15,23,42,.85);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}

.brand{display:flex; align-items:center; gap:12px}
.logo{
  width:52px; height:52px;        /* ✅ bigger */
  border-radius:14px;
  object-fit:contain;
  background:rgba(255,255,255,.06);
  padding:7px;
}

.title{font-weight:700; letter-spacing:.2px; font-size:18px}  /* ✅ bigger */
.subtitle{font-size:14px; color:var(--muted); margin-top:3px} /* ✅ bigger */

.content{
  width:min(1100px, 92vw);
  margin:18px auto 28px;
  display:grid;
  gap:14px;
}

.status-card{
  background: linear-gradient(180deg, rgba(17,26,46,.85), rgba(15,23,42,.85));
  border:1px solid var(--border);
  border-radius: 18px;            /* ✅ bigger */
  box-shadow: var(--shadow);
  padding:18px 20px;              /* ✅ bigger */
}

.status-text{font-weight:650; font-size:16px} /* ✅ bigger */
.status-meta{margin-top:8px; font-size:14px; color:var(--muted)} /* ✅ bigger */

.docs-section{
  background: rgba(17,26,46,.7);
  border:1px solid var(--border);
  border-radius: 18px;            /* ✅ bigger */
  box-shadow: var(--shadow);
  padding:18px 20px 22px;         /* ✅ bigger */
}

.section-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.section-head h2{margin:0; font-size:19px}

.pill{
  padding:8px 12px;               /* ✅ bigger */
  font-size:14px;                 /* ✅ bigger */
  border:1px solid var(--border);
  border-radius:999px;
  color:var(--muted);
  background: rgba(15,23,42,.8);
}

.docs-grid{
  display:grid;
  grid-template-columns: repeat( auto-fit, minmax(280px, 1fr) ); /* ✅ bigger cards */
  gap:14px;                                                      /* ✅ bigger spacing */
}

.doc-card{
  border:1px solid var(--border);
  background: rgba(15,23,42,.85);
  border-radius: 18px;          /* ✅ bigger */
  padding:16px;                 /* ✅ bigger */
  display:flex;
  flex-direction:column;
  gap:12px;
  transition: transform .12s ease, border-color .12s ease;
}
.doc-card:hover{transform: translateY(-2px); border-color: rgba(59,130,246,.35)}

.doc-card.is-clickable{
  cursor: pointer;
  user-select: none;
}

.doc-card.is-clickable:active{
  transform: scale(.99);
}

.doc-card.is-clickable:focus{
  outline: none;
}

.doc-card.is-clickable:focus-visible{
  box-shadow: 0 0 0 3px rgba(59,130,246,.35), var(--shadow);
  border-color: rgba(59,130,246,.45);
}

.doc-card.is-disabled{
  opacity: .55;
  cursor: not-allowed;
}

.doc-title{font-weight:700; font-size:16px; line-height:1.25} /* ✅ bigger */
.doc-meta{font-size:14px; color:var(--muted)}                  /* ✅ bigger */

.btn{
  appearance:none;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding:14px 16px;          /* ✅ bigger */
  border-radius: 14px;        /* ✅ bigger */
  font-weight:700;
  font-size:15px;             /* ✅ bigger */
  cursor:pointer;
  transition: transform .06s ease, background .12s ease, border-color .12s ease;
}
.btn:active{transform: scale(.98)}
.btn-primary{
  background: linear-gradient(180deg, var(--primary), var(--primary2));
  border-color: rgba(59,130,246,.55);
}
.btn-block{width:100%}

.icon-btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.05);
  color:var(--text);
  border-radius: 14px;
  width:44px; height:44px;     /* ✅ bigger */
  cursor:pointer;
}

.input{
  width:100%;
  padding:14px 16px;           /* ✅ bigger */
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(15,23,42,.9);
  color: var(--text);
  outline:none;
  font-size:15px;              /* ✅ bigger */
}
.label{display:block; margin-top:12px; margin-bottom:8px; font-size:13px; color:var(--muted)}
.error{margin-top:10px; color: #fecaca; font-size:13px}
.muted{color:var(--muted); font-size:13px}

.empty{
  margin-top:12px;
  padding:12px;
  border-radius: 14px;
  border:1px dashed var(--border);
  color:var(--muted);
  text-align:center;
}

.toast{
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 20px;
  background: rgba(15,23,42,.92);
  border:1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;         /* ✅ bigger */
  box-shadow: var(--shadow);
  font-size: 14px;            /* ✅ bigger */
}

.modal {
  position: fixed;
  inset: 0;                 /* full screen */
  display: none;            /* hidden by default */
  align-items: center;      /* vertical center */
  justify-content: center;  /* horizontal center */
  z-index: 1000;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal-card{
  position: relative;
  width: min(520px, 92vw);
  max-width: 520px;
  border-radius: 18px;
  padding: 20px 20px 18px;
  z-index: 1;

  background: linear-gradient(180deg, rgba(17,26,46,.96), rgba(15,23,42,.96));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
}
.modal-head h3{
  font-size: 22px;
  font-weight: 700;
}

.modal{ padding: 16px; } /* keeps it from feeling “stuck” to edges on tablets */

.modal-head h3{
  color: var(--text);
}

.modal .muted{
  color: var(--muted);
  font-size: 16px;
}

.modal .label{
  color: var(--muted);
  font-size: 16px;
}

/* Close button inside the modal */
.modal .icon-btn{
  background: rgba(255,255,255,.06);
  border-color: var(--border);
}
.modal .icon-btn:active{ transform: scale(.98); }

/* Placeholder contrast */
.modal .input::placeholder{
  color: rgba(148,163,184,.65);
}

/* Fullscreen viewer (tablet/phone friendly) */
.viewer.hidden { display: none; }

.viewer{
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,.85);
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.viewer-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px;
  background: rgba(15,23,42,.95);
  border-bottom: 1px solid var(--border);
}

.viewer-title{
  font-weight: 700;
  color: var(--text);
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.viewer-frame{
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b1220;
}

/* Better layout on phones */
@media (max-width: 900px){
  body{ font-size: 18px; }        /* ✅ bigger on mobile */
  .content{ width: min(1100px, 94vw); margin: 12px auto 22px; }
  .topbar{ padding: 16px 14px; }
  .logo{ width:56px; height:56px; }
  .docs-grid{ grid-template-columns: 1fr; }
  .btn{ padding: 16px 16px; font-size: 16px; }
  .input{ padding: 16px 16px; font-size: 16px; }
}

/* ===== Topbar small-screen layout fix ===== */
@media (max-width: 900px) {
  .topbar{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .brand{
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .brand > div{
    min-width: 0;
  }

  .title,
  .subtitle{
    white-space: normal;   /* allow wrapping */
  }

  .topbar-actions{
    display: flex;
    flex-direction: column; /* stack buttons */
    gap: 10px;
    width: 100%;
  }

  .topbar-actions .btn{
    width: 100%;
    justify-content: center;
  }

  /* Optional: make header padding feel better on small screens */
  .topbar{
    padding: 14px 14px;
  }

  .logo{
    width: 38px;
    height: 38px;
  }
}