:root {
  /* Embassy Design System */
  --primary: #000000;       /* embassy-black */
  --accent: #f58220;        /* orange-500 */
  --accent-2: #c65e0f;      /* orange-600 (hover) */
  --accent-tint: #fde7d3;   /* orange-100 */
  --text: #1a1a1a;          /* ink-800 */
  --muted: #666567;         /* ink-500 */
  --light: #f5f5f4;         /* ink-50 / surface-subtle */
  --white: #ffffff;
  --border: #d9d9d9;        /* ink-200 */
  --radius: 8px;            /* radius-lg */
  --radius-sm: 4px;         /* radius-md */
  --font-head: 'Tenor Sans', 'Times New Roman', serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--light);
  line-height: 1.5;
}

header.topbar {
  background: var(--primary);
  color: var(--white);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand .emblem { width: 32px; height: 32px; display: block; }
.brand .wordmark {
  font-family: var(--font-head);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--white);
}
.brand .wordmark b {
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: .5px;
  margin-left: 2px;
}
nav a {
  color: var(--white);
  text-decoration: none;
  margin-left: 22px;
  font-size: 14px;
  opacity: .8;
}
nav a:hover, nav a.active { opacity: 1; border-bottom: 2px solid var(--accent); padding-bottom: 4px; }

main { max-width: 860px; margin: 40px auto; padding: 0 24px; }
h1 { font-family: var(--font-head); color: var(--primary); font-size: 30px; margin: 0 0 6px; }
.sub { color: var(--muted); margin: 0 0 28px; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
}
.card h2 { font-family: var(--font-head); color: var(--primary); margin: 0 0 14px; font-size: 19px; }

label { display: block; font-size: 13px; font-weight: 600; color: var(--primary); margin: 14px 0 6px; }
input[type=text], input[type=password], textarea, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  background: #ffffff;
}
textarea { min-height: 80px; resize: vertical; }

.dropzone {
  position: relative;
  overflow: hidden;
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 40px;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  background: var(--light);
  transition: background .15s;
}
.dropzone.hover { background: var(--accent-tint); }
.dropzone strong { color: var(--accent); }
.dropzone .dz-inner { position: relative; z-index: 1; transition: opacity .4s ease; }

/* Caricature "working" art — invisible at rest, fades in slowly while
   converting (acts as the busy/spinner state), fades back out when done. */
.dropzone .dz-art {
  position: absolute;
  inset: 12px;
  background: url('SG-%20cari.png') center/contain no-repeat;
  opacity: 0;
  transition: opacity 1.6s ease;
  pointer-events: none;
}
.dropzone.processing { cursor: default; border-style: solid; }
.dropzone.processing .dz-art { opacity: 1; }
.dropzone.processing .dz-inner { opacity: .55; }

.formats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.formats label {
  flex: 1; min-width: 120px; margin: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px;
  text-align: center; cursor: pointer; background: #ffffff; font-weight: 600;
}
.formats input { display: none; }
.formats input:checked + span { color: var(--accent); }
.formats label:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }

button.primary {
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 20px;
}
button.primary:hover { background: var(--accent-2); }
button.primary:disabled { opacity: .5; cursor: not-allowed; }

.status { margin-top: 18px; font-size: 14px; }
.status.err { color: #b00020; }
.result {
  margin-top: 18px; padding: 18px; border-radius: var(--radius-sm);
  background: #eef3ee; border: 1px solid #cfe0cf;
}
.result a {
  display: inline-block; margin-top: 10px; background: var(--primary);
  color: #fff; text-decoration: none; padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600;
}
.pill { display:inline-block; font-size:12px; padding:3px 9px; border-radius:20px; background:var(--light); color:var(--muted); margin-left:8px; }
.ok { color: #1a7a3c; }
.spinner { display:inline-block; width:16px; height:16px; border:3px solid #ddd; border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; vertical-align:middle; margin-right:8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skill-row { display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid var(--border); }
.skill-row:last-child { border:none; }
.hint { font-size:12px; color:var(--muted); margin-top:4px; }

/* selected-file list */
.filelist { list-style:none; margin:14px 0 0; padding:0; }
.filelist li {
  display:flex; align-items:center; gap:10px;
  padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:#fff; margin-bottom:8px;
}
.filelist .fname { flex:1; font-size:14px; color:var(--primary); word-break:break-all; }
.filelist .fsize { font-size:12px; color:var(--muted); }
.filelist .rm {
  border:none; background:none; color:var(--muted); cursor:pointer;
  font-size:15px; line-height:1; padding:2px 6px;
}
.filelist .rm:hover { color:var(--accent); }

/* results */
.result .zip {
  display:inline-block; margin-bottom:12px; background:var(--accent);
  color:#fff; text-decoration:none; padding:11px 20px; border-radius:var(--radius-sm); font-weight:600;
}
.result .zip:hover { background:var(--accent-2); }
.reslist { list-style:none; margin:0; padding:0; }
.reslist li {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:11px 0; border-bottom:1px solid #cfe0cf;
}
.reslist li:last-child { border:none; }
.reslist .src { flex:1; font-weight:600; color:var(--primary); word-break:break-all; }
.reslist a {
  margin-top:0; background:var(--primary); color:#fff; text-decoration:none;
  padding:8px 14px; border-radius:var(--radius-sm); font-weight:600; font-size:13px;
}
.reslist .failrow { color:#b00020; }
.reslist .failmsg { font-size:13px; color:#b00020; }
