/* Compact one-screen form + optional Align Labels A-Z panel */

:root{
  --page-bg:#f6f8fb;--card-bg:#fff;--text:#0d1726;--muted:#6a7484;
  --line:#dbe1e8;--field-bg:#fbfcfd;--primary:#297cc6;--primary-dark:#1769ad;
  --soft-blue:#f3f8fd;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{
  min-height:100vh;color:var(--text);
  background:radial-gradient(circle at top,#fff 0%,#f8fafc 58%,#f3f6fa 100%);
  font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
}
button,input{font:inherit}
.page-shell{min-height:100vh;padding:14px 20px;display:grid;place-items:center}
.generator-card{
  width:min(100%,1040px);padding:18px 30px 16px;border:1px solid var(--line);
  border-radius:18px;background:var(--card-bg);box-shadow:0 10px 30px rgba(18,43,70,.08)
}
.brand-header{display:flex;align-items:center;justify-content:center;gap:24px;margin-bottom:16px}
.brand-logo{width:175px;max-width:30%;height:auto;flex:0 0 auto}
.title-block{text-align:left}
.brand-header h1{margin:0;font-size:clamp(2rem,4vw,2.6rem);line-height:1.05;font-weight:800;letter-spacing:-.035em}
.intro{max-width:650px;margin:7px 0 0;color:var(--muted);font-size:.92rem;line-height:1.4}

.upload-form{display:grid;gap:14px}
.fields-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.field-group{display:grid;gap:8px}
.field-title{font-size:.95rem;line-height:1.2;font-weight:750}
.file-picker{
  min-height:62px;padding:10px 14px;display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;gap:13px;border:1px solid #cfd6df;border-radius:10px;background:var(--field-bg);
  cursor:pointer;transition:border-color .16s ease,box-shadow .16s ease,background .16s ease
}
.file-picker:hover{border-color:#aab7c6;background:#fff}
.file-type-icon{width:30px;height:38px;display:inline-grid;place-items:center;color:#fff;border-radius:4px;font-weight:800;line-height:1}
.excel-icon{background:linear-gradient(150deg,#28a75b,#0b8038);font-size:1.25rem}
.pdf-icon{background:linear-gradient(150deg,#ff4444,#e51e1e)}
.pdf-mark{font-size:.5rem;letter-spacing:.03em}
.file-name{min-width:0;overflow:hidden;color:#596577;font-size:.95rem;text-overflow:ellipsis;white-space:nowrap}
.upload-icon{width:24px;height:24px;fill:none;stroke:#596577;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.native-file-input{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;clip-path:inset(50%)}

.generate-button,.sort-button{
  width:100%;min-height:52px;border:0;border-radius:9px;color:#fff;
  background:linear-gradient(90deg,var(--primary),#2678bd);cursor:pointer;font-size:1.03rem;font-weight:800
}
.generate-button:hover,.sort-button:hover{background:linear-gradient(90deg,var(--primary-dark),#1e6eb3)}
.generate-button:disabled,.sort-button:disabled{opacity:.65;cursor:wait}

.secondary-tools{margin-top:12px}
.align-toggle{
  width:100%;min-height:44px;padding:0 15px;border:1px solid #cbd8e6;border-radius:9px;
  display:flex;align-items:center;justify-content:center;gap:9px;
  background:#fff;color:#246aa7;font-weight:800;cursor:pointer
}
.align-toggle:hover{background:var(--soft-blue)}
.chevron{font-size:1.15rem;transition:transform .18s ease}
.align-toggle[aria-expanded="true"] .chevron{transform:rotate(180deg)}

.align-panel{
  margin-top:10px;padding:14px;border:1px solid #d6e1ec;border-radius:10px;background:#f9fbfd
}
.align-copy{display:flex;flex-direction:column;gap:2px;margin-bottom:12px}
.align-copy strong{font-size:.97rem}
.align-copy span{color:var(--muted);font-size:.82rem;line-height:1.35}
.align-form{display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:12px;align-items:end}
.compact-field{gap:6px}
.compact-picker{min-height:54px}
.sort-button{min-height:54px}
.align-status{margin-top:10px;text-align:center;font-size:.88rem}

.card-footer{
  margin-top:14px;padding-top:12px;display:flex;justify-content:space-between;gap:20px;
  border-top:1px solid var(--line);color:#6b7585;font-size:.82rem;line-height:1.4
}

@media (max-width:800px){
  .page-shell{display:block;padding:14px}
  .generator-card{width:100%;padding:20px 18px}
  .brand-header{flex-direction:column;gap:10px;margin-bottom:20px}
  .brand-logo{width:210px;max-width:75%}
  .title-block{text-align:center}
  .brand-header h1{font-size:2rem}
  .intro{margin:7px auto 0;font-size:.92rem}
  .fields-grid{grid-template-columns:1fr;gap:14px}
  .align-form{grid-template-columns:1fr}
  .card-footer{flex-direction:column;align-items:center;gap:5px;text-align:center}
}
@media (max-width:480px){
  .page-shell{padding:9px}
  .generator-card{padding:16px 13px;border-radius:14px}
  .brand-logo{width:180px}
  .brand-header h1{font-size:1.75rem}
  .file-picker{min-height:60px}
  .generate-button{min-height:52px}
}
