:root{
  --bg:#0b1220;
  --panel:#0f1b33;
  --panel2:#0d172c;
  --text:#e7eefc;
  --muted:#a9b7d0;
  --accent:#66e3ff;
  --accent2:#7c5cff;
  --danger:#ff5c7a;
  --ok:#44f1a6;
  --border:rgba(255,255,255,.08);
  --shadow: 0 16px 50px rgba(0,0,0,.45);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}

body{
  margin:0;
  font-family:var(--sans);
  background:
    radial-gradient(1200px 700px at 15% 20%, rgba(124,92,255,.25), transparent 60%),
    radial-gradient(900px 600px at 90% 30%, rgba(102,227,255,.18), transparent 55%),
    linear-gradient(180deg, var(--bg), #060a14 80%);
  color:var(--text);
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:28px;
}

.wrap{width:min(980px, 100%)}
.wrap-full{width:90%}

/* ---------- Hero / Header ---------- */
.hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.title{
  font-size: clamp(24px, 3vw, 34px);
  font-weight:800;
  letter-spacing:-.02em;
  margin:0;
}

.subtitle{
  margin:6px 0 0;
  color:var(--muted);
  line-height:1.45;
  max-width:70ch;
  font-size:14px;
}

/* Small “tech badge” used on password page */
.badge{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  padding:10px 12px;
  border-radius:999px;
  color:var(--muted);
  font-size:12px;
  display:flex;
  gap:8px;
  align-items:center;
  white-space:nowrap;
}

.dot{
  width:8px;height:8px;border-radius:50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 0 18px rgba(102,227,255,.35);
}

/* Back button */
.back-link{
  display:inline-block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:600;
  text-decoration:none;
  color:var(--muted);
  border:1px solid var(--border);
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.04);
  transition: filter .12s ease, transform .08s ease;
}
.back-link:hover{filter:brightness(1.1)}
.back-link:active{transform:translateY(1px)}

/* ---------- Cards ---------- */
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow:hidden;
}

.head{
  padding:16px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(0,0,0,.15);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.head h2{
  font-size:14px;
  text-transform:uppercase;
  letter-spacing:.12em;
  color:var(--muted);
  margin:0;
}

.body{padding:16px 18px}

/* Pill label used in header corners */
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  white-space:nowrap;
}

/* ---------- Layout helpers ---------- */
.grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:16px;
}

@media (min-width: 880px){
  .grid{grid-template-columns: 1fr 1fr;}
}

.row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}

/* ---------- Inputs ---------- */
label{
  display:block;
  font-size:13px;
  color:var(--muted);
  margin:0 0 8px;
}

/* Password page uses password inputs; save page uses file input */
input[type="password"], input[type="text"]{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
  font-size:14px;
}

input[type="password"]::placeholder,
input[type="text"]::placeholder{
  color:rgba(169,183,208,.6);
}

input[type="file"]{
  width:100%;
  padding:12px;
  border-radius:12px;
  border:1px dashed var(--border);
  background: rgba(0,0,0,.18);
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn{
  border:1px solid var(--border);
  background: linear-gradient(135deg, rgba(102,227,255,.16), rgba(124,92,255,.14));
  color: var(--text);
  padding:11px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:650;
  font-size:14px;
  text-decoration:none;
  transition: transform .08s ease, filter .12s ease;
  user-select:none;
}

.btn:hover{filter:brightness(1.08)}
.btn:active{transform: translateY(1px)}

.btn.secondary{
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-weight:600;
}

/* ---------- Output / Notes ---------- */
.note{
  font-size:12px;
  color: var(--muted);
  line-height:1.45;
  margin-top:10px;
}

.out{
  width:100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.22);
  color: var(--text);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.45;
  overflow:auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Save page wants a taller output area */
.out.tall{
  min-height: 320px;
  white-space: pre; /* nicer for pretty JSON */
  word-break: normal;
}

/* ---------- Alerts ---------- */
.alert{
  border-radius: 14px;
  border: 1px solid rgba(255,92,122,.35);
  background: rgba(255,92,122,.10);
  color: #ffd2da;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.warn{
  border-radius: 14px;
  border: 1px solid rgba(255,227,102,.35);
  background: rgba(255,227,102,.10);
  color: #fff0c2;
  padding: 12px 14px;
  margin-bottom: 14px;
}

/* ---------- Footer ---------- */
.footer{
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align:center;
}

/* ---------- Issue Detection (Save File Editor) ---------- */
.issues-container {
  margin-top: 16px;
}

.issue-item {
  background: rgba(249, 38, 114, 0.05);
  border: 1px solid rgba(249, 38, 114, 0.2);
  border-left: 3px solid #f92672;
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 14px;
  transition: all 0.2s ease;
}

.issue-item:hover {
  background: rgba(249, 38, 114, 0.08);
  border-color: rgba(249, 38, 114, 0.3);
}

.issue-item.severity-high {
  border-left-color: #f92672;
  border-color: rgba(249, 38, 114, 0.2);
  background: rgba(249, 38, 114, 0.05);
}

.issue-item.severity-medium {
  border-left-color: #fd971f;
  border-color: rgba(253, 151, 31, 0.2);
  background: rgba(253, 151, 31, 0.05);
}

.issue-item.severity-low {
  border-left-color: #66d9ef;
  border-color: rgba(102, 217, 239, 0.2);
  background: rgba(102, 217, 239, 0.05);
}

.issue-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.issue-checkbox {
  margin: 0;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.issue-content {
  flex: 1;
  min-width: 0;
}

.issue-title {
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  color: var(--text);
  line-height: 1.5;
  display: inline-block;
}

.issue-description {
  font-size: 14px;
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 12px;
  line-height: 1.6;
}

.issue-path {
  font-size: 11px;
  color: #75715e;
  font-family: var(--mono);
  margin: 12px 0 0 0;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  display: block;
  word-break: break-all;
}

.issue-input {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.issue-input label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

.issue-input input {
  width: 100%;
  max-width: 400px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 14px;
  font-family: var(--mono);
  transition: all 0.2s ease;
}

.issue-input input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(102, 227, 255, 0.1);
}

.issue-input input::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

.issues-actions {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.issues-summary {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}
