/* Layout & variables */
:root{
  --brand:#104879;
  --brand-500:#0b3a64;
  --ink:#0f172a;
  --muted:#64748b;
  --border:#e5e7eb;
  --bg:#f6f8fb;
  --card:#ffffff;
  --success:#16a34a;
  --warn:#f59e0b;
  --danger:#e11d48;

  /* unified page/container vars (match home/resume width) */
  --page-max: 1150px;          /* outer container width target */
  --panel-max: 900px;          /* inner card/panel width when stacked */
  --gutter-l: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
}

*{box-sizing:border-box}

/* avoid cut-offs */
html, body { overflow-x: hidden; background: var(--bg); }

/* ======= CONTAINERS (wider like index/resume) ======= */
.dash-shell,
.dashboard-container{
  width: min(var(--page-max), 92%);
  margin: 0 auto;
  padding: 20px 0 48px;       /* gutters handled by width calc */
}

/* Headings */
.dash-title{
  margin:0 0 6px;
  color:var(--ink);
  font-size:28px;
  font-weight:700;
  text-align:center;
}
.dash-subtitle{
  margin:0 0 18px;
  color:#555;
  text-align:center;
}

/* ======= TOP GRID (kept responsive) ======= */
.dash-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
@media (max-width: 860px){
  .dash-grid{grid-template-columns:1fr;}
}

/* Cards */
.card,
.dashboard-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:18px;
  box-shadow:0 4px 18px rgba(16,72,121,.06);
}

/* Buttons */
.btn{
  appearance:none;
  border:none;
  border-radius:10px;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer;
}
.btn[disabled]{opacity:.55; cursor:not-allowed;}
.btn-primary{ background:var(--brand); color:#fff; }
.btn-outline{ background:#fff; color:var(--brand); border:1px solid var(--brand); }

/* Upload card */
.upload-title{ text-align:center; color:#333; margin:0 0 12px; }
.dropzone{
  border:2px dashed #ccd6e2;
  border-radius:12px;
  padding:24px 12px;
  text-align:center;
  cursor:pointer;
  transition:border-color .2s, background-color .2s;
}
.dropzone:hover{border-color:var(--brand); background:#f6fbff;}
.dropzone__cloud{
  width:54px;height:54px;margin:0 auto 6px;
  background: url("data:image/svg+xml,%3Csvg width='54' height='54' viewBox='0 0 24 24' fill='none' stroke='%2391a4b7' stroke-width='1.6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18a4 4 0 1 1 1-7.874A5.002 5.002 0 0 1 21 12a4 4 0 0 1-1 7H7z'/%3E%3Cpath d='M12 12v6m0-6-2.5 2.5M12 12l2.5 2.5'/%3E%3C/svg%3E") center/54px 54px no-repeat;
}
.dropzone__title{ color:var(--brand); font-weight:800; font-size:22px; }
.dropzone__hint{ color:#7c8a9b; font-size:15px; }

.field{display:block;margin-top:12px;}
.field__label{display:block;margin:8px 0 6px;color:var(--ink);font-weight:600}
.textarea, .select{
  width:100%;
  border:1px solid #cbd5e1;
  border-radius:10px;
  padding:12px;
  font-size:14px;
  background:#fff;
}
.actions{display:flex; align-items:center; gap:12px; margin-top:12px;}
.help{color:#666; text-align:center; margin:12px 0 0}

/* Score card */
.score-card__top{ display:flex; align-items:center; justify-content:space-between; }
.score-card__icon{
  width:24px;height:24px; border-radius:6px;
  background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='%23104879' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 2h9l3 3v15a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1-2-2zM6 4v16h10V6h-2V4H6z'/%3E%3C/svg%3E") center/24px 24px no-repeat;
  opacity:.85;
}
.score-card__body{
  display:grid; grid-template-columns:240px 1fr; gap:18px; align-items:center; padding-top:8px;
}
@media (max-width: 480px){
  .score-card__body{grid-template-columns:1fr;}
}

/* Ring */
.ring{width:240px; height:240px; margin:0 auto;}
.ring svg{width:100%; height:100%}
.ring__track{ fill:none; stroke:#e6edf3; stroke-width:14; }
.ring__progress{
  fill:none; stroke:var(--success); stroke-width:14; stroke-linecap:round;
  transform: rotate(-90deg); transform-origin: 50% 50%;
}
.ring__label{ font-size:32px; font-weight:800; text-anchor:middle; fill:#153b5b; }

/* Metrics */
.metrics{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.metric{border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:#fff;}
.metric--wide{grid-column:1 / -1}
.metric__head{display:flex; justify-content:space-between; align-items:center; font-weight:700; color:#14223a}
.bar{height:8px; border-radius:8px; background:#eef2f7; overflow:hidden; margin-top:6px;}
.bar__fill{height:100%; width:0%; background:var(--success);}

/* Footer note */
.score-card__foot{display:flex; justify-content:space-between; align-items:center; margin-top:8px;}
.score-card__foot small{color:#667085}

/* No analysis */
.no-analysis{text-align:center; margin:18px 0 0}

/* Optimize */
.opt-shell{
  display:grid; grid-template-columns:260px 1fr; gap:16px;
  margin-top:24px;
}
@media (max-width: 860px){
  .opt-shell{grid-template-columns:1fr;}
}

.opt-nav{
  position:sticky; top:14px;
  align-self:start;
  background:#fff; border:1px solid var(--border); border-radius:14px; padding:12px;
}
.opt-btn{
  width:100%;
  text-align:left;
  padding:12px 14px;
  border-radius:12px;
  background:#f3f6fa;
  color:#0f172a;
  font-weight:700;
  margin-bottom:10px;
  border:1px solid #e2e8f0;
  cursor:pointer;
}
.opt-btn.is-active{background:var(--brand); color:#fff; border-color:var(--brand)}
.opt-btn:last-child{margin-bottom:0}

.opt-panel{
  background:#fff; border:1px solid var(--border); border-radius:14px;
  padding:16px;
}

/* Panel blocks */
.panel-title{font-size:20px; font-weight:800; color:#14223a; margin:2px 0 10px}
.panel-sub{color:#5f6c7b; margin:0 0 12px}
.list{padding-left:18px; margin:0}
.list li{margin:6px 0}
.kv{display:grid; grid-template-columns:1fr auto; gap:8px; border-top:1px dashed #e5e7eb; padding:8px 0}
.kv:first-child{border-top:none}

/* Optimize CTA & output */
.opt-cta{margin-top:16px; text-align:center}
.loading{color:#555; margin-top:10px}
.opt-output{
  background:#fff; border:1px solid var(--border); border-radius:12px;
  padding:12px; white-space:pre-wrap; margin-top:12px;
}
.download-row{margin-top:10px; display:flex; gap:8px; justify-content:center}
.download-hint{text-align:center; margin-top:10px}

/* Utilities */
.sr-only{position:absolute; width:1px; height:1px; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); border:0}
.field__label.center{ text-align:center; }
.file-name{
  margin-top:8px;
  text-align:center;
  color:var(--muted);
  font-weight:600;
  word-break: break-word;
}

/* click feedback for Analyze updated resume */
.btn-outline.is-hot,
.btn-outline:active{
  background:var(--brand);
  color:#fff;
  border-color:var(--brand);
}
.dropzone.pulse{ box-shadow:0 0 0 3px rgba(16,72,121,.15); }
.opt-explain{ margin:0 0 10px; color:#475569; }

/* ======= STACKED SECTION (centered, panel width) ======= */
.dash-stack{
  display:flex;
  flex-direction:column;
  gap:18px;
  width: min(var(--panel-max), 100%);
  margin: 0 auto;
  padding: 0;                    /* outer container already has padding */
}

/* Upload card: center heading + controls */
.upload-card h3,
.upload-card .upload-title,
.upload-card .helper,
.upload-card .role-title {
  text-align: center;
  margin: 0 0 12px;
}

/* Dropzone look (id variant) */
#dropzone{
  border:2px dashed #d7e1ea;
  border-radius:12px;
  padding:28px 16px;
  text-align:center;
  cursor:pointer;
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease;
}
#dropzone.is-drag { border-color:#104879; box-shadow:0 0 0 3px rgba(16,72,121,0.12); }
#dropzone .dz-title{ font-weight:800; color:#0f3a5f; font-size:22px; }
#dropzone .dz-sub{ color:#6b7c8f; margin-top:6px; }

.role-title { text-align:center; font-weight:700; color:#0f3a5f; }
#dashAnalyzeBtn { width:100%; border-radius:12px; }

/* Make sure no legacy two-column grid fights this layout */
.dash-top, .dash-grid { grid-template-columns: unset; }
.metric__head span { white-space: nowrap; }

/* Toolbar pills styled like .opt-btn */
.rw-pill{
  display:inline-block;
  text-align:left;
  padding:12px 14px;
  border-radius:12px;
  background:#f3f6fa;
  color:#0f172a;
  font-weight:700;
  margin:0 .5rem .5rem 0;
  border:1px solid #e2e8f0;
  cursor:pointer;
}
.rw-pill:hover,
.rw-pill.active{
  background:#104879;
  color:#fff;
  border-color:#104879;
}

.item-sub .sep { opacity:.6; }
.ed-date { font-weight:600; }

/* Hover/focus polish for opt buttons */
.opt-btn:hover:not(.is-active){
  background:#104879;
  color:#fff;
  border-color:#104879;
}
.opt-btn:focus-visible:not(.is-active){
  outline:2px solid #104879;
  outline-offset:2px;
}
.opt-btn.is-active{
  background:#104879;
  color:#fff;
  border-color:#104879;
  font-weight:800;
}

/* ================= Power verbs chips ================= */
.verbs-wrap{ display:flex; flex-wrap:wrap; gap:10px; }
.rw-verb-chip{
  padding:8px 12px;
  border-radius:12px;
  border:0;
  line-height:1.2;
  background:var(--brand);
  color:#fff;
  cursor:pointer;
}
.rw-verb-chip:hover,
.rw-verb-chip:focus{
  background:var(--brand-500);
  color:#fff;
  outline:none;
  box-shadow:0 0 0 2px rgba(16,72,121,.15);
}
.rw-verb-chip.active{ transform: translateY(1px); }
