/* ============================================================
   Resum3 — component styles
   ============================================================ */

/* ---------- Segmented control ---------- */
.seg {
  position: relative; display: inline-flex; background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 13px; padding: 4px; gap: 2px;
  max-width: 100%;
}
.seg-pill {
  position: absolute; top: 4px; bottom: 4px; border-radius: 9px;
  background: var(--surface); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  transition: left .26s cubic-bezier(.4,.9,.3,1.1), width .26s cubic-bezier(.4,.9,.3,1.1);
}
.seg-btn {
  position: relative; z-index: 1; border: none; background: none; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 16px; font-size: 14px; font-weight: 600; color: var(--ink-3);
  transition: color .18s ease;
  min-width: 0;
}
.seg-btn svg { width: 16px; height: 16px; opacity: .85; }
.seg-btn.active { color: var(--accent-ink); }
.seg-btn:hover:not(.active) { color: var(--ink-2); }
.seg-sm .seg-btn { padding: 6px 12px; font-size: 13px; }

/* ---------- Score ring ---------- */
.ring { position: relative; display: grid; place-items: center; flex: none; }
.ring-mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-num { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; display: flex; align-items: flex-start; }
.ring-num span { font-size: 17px; font-weight: 700; margin-top: 3px; margin-left: 1px; }
.ring-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-4); margin-top: 3px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border-radius: 9px; font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip-match { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in oklab, var(--accent), transparent 78%); }
.chip-miss { background: var(--amber-soft); color: var(--amber-ink); border-color: var(--amber-line); }
.chip-plain { background: var(--surface-3); color: var(--ink-2); border-color: var(--line); }

/* ---------- Section header ---------- */
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-head-l { display: flex; align-items: center; gap: 13px; }
.sec-n {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background: var(--accent-soft); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
}
.sec-ic {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center;
}
.sec-ic svg { width: 20px; height: 20px; }
.sec-title { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.sec-sub { font-size: 13.5px; color: var(--ink-3); margin-top: 2px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--canvas); padding: 12px 18px; border-radius: 13px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-pop);
  animation: toastIn .3s cubic-bezier(.2,.7,.3,1.2);
}
.toast svg { width: 18px; height: 18px; color: var(--accent); }
[data-theme='dark'] .toast svg { color: var(--accent-ink); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================================
   Workspace screen
   ============================================================ */
.ws-head { padding: 30px 0 22px; }
.ws-title { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; margin: 0; }
.ws-title .accent { color: var(--accent-ink); }
.ws-sub { font-size: 15px; color: var(--ink-3); margin: 7px 0 0; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.panel { padding: var(--pad); display: flex; flex-direction: column; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.panel-h { display: flex; align-items: center; gap: 11px; min-width: 0; }
.panel-h h2 { white-space: nowrap; }
.panel-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.panel-ic svg { width: 18px; height: 18px; }
.panel-h h2 { font-size: 16.5px; font-weight: 750; letter-spacing: -0.02em; margin: 0; }
.panel-count { font-size: 12.5px; color: var(--ink-4); font-weight: 600; font-variant-numeric: tabular-nums; }

/* dropzone */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--surface-3);
  padding: 18px; display: flex; align-items: center; gap: 14px; cursor: pointer;
  transition: all .16s ease; margin-bottom: 14px;
}
.drop:hover { border-color: var(--accent); background: var(--accent-softer); }
.drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--accent-ink); flex: none; box-shadow: var(--shadow-sm); }
.drop-ic svg { width: 20px; height: 20px; }
.drop-t { font-size: 14px; font-weight: 650; }
.drop-t b { color: var(--accent-ink); }
.drop-s { font-size: 12.5px; color: var(--ink-4); margin-top: 2px; }
.drop-formats { display: flex; gap: 5px; margin-left: auto; }
.fmt { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; color: var(--ink-4); background: var(--surface); border: 1px solid var(--line); padding: 3px 6px; border-radius: 6px; }

.divider-or { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.divider-or::before, .divider-or::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.divider-or span { font-size: 12px; font-weight: 600; color: var(--ink-4); }

.field-label { font-size: 13.5px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; display: block; }
.ta {
  width: 100%; resize: none; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); padding: 14px 15px; font-size: 13.5px; line-height: 1.6;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease; min-height: 260px; flex: 1;
}
.ta::placeholder { color: var(--ink-4); }
.ta:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.ta.filled { font-family: var(--font-doc); font-size: 13px; }
.helper { font-size: 12.5px; color: var(--ink-4); margin-top: 11px; display: flex; align-items: flex-start; gap: 7px; line-height: 1.5; }
.helper svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--ink-4); }

.filled-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.filled-flag svg { width: 13px; height: 13px; }

/* action bar */
.actionbar {
  margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 16px var(--pad); display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.actionbar-l { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.actionbar-label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.actionbar-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.platform-grid { display: grid; grid-template-columns: 1.45fr .95fr; gap: 20px; margin-top: 20px; }
.platform-card { padding: var(--pad); }
.platform-head { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; }
.trust-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.trust-opt {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 14px; text-align: left; display: flex; gap: 11px; align-items: flex-start;
  color: var(--ink-2); transition: all .15s ease; min-height: 108px;
}
.trust-opt:hover { border-color: var(--ink-4); background: var(--surface); }
.trust-opt.active { border-color: var(--accent); background: var(--accent-softer); box-shadow: 0 0 0 3px var(--accent-soft); }
.trust-opt-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent-ink); flex: none; }
.trust-opt-ic svg { width: 16px; height: 16px; }
.trust-opt b { display: block; font-size: 13.5px; color: var(--ink); margin-bottom: 4px; }
.trust-opt small { display: block; font-size: 12.2px; line-height: 1.35; color: var(--ink-3); }
.insight-card p { color: var(--ink-3); font-size: 13.5px; line-height: 1.5; margin: 8px 0 14px; }
.insight-title { font-size: 20px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; margin-top: 8px; }
.mini-flow { display: flex; flex-wrap: wrap; gap: 7px; }
.mini-flow span { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; }
.mini-flow svg { width: 12px; height: 12px; color: var(--ink-4); }

@media (max-width: 860px) {
  .cols { grid-template-columns: 1fr; }
  .platform-grid { grid-template-columns: 1fr; }
  .trust-options { grid-template-columns: 1fr; }
  .actionbar { flex-direction: column; align-items: stretch; }
  .actionbar-r { margin-left: 0; }
  .actionbar-r .btn { flex: 1; }
}

@media (max-width: 640px) {
  .seg {
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .seg-pill { display: none; }
  .seg-btn {
    padding: 10px 8px;
    font-size: 13px;
    white-space: normal;
    line-height: 1.15;
  }
  .seg-btn.active {
    background: var(--surface);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
  }
  .seg-sm .seg-btn { padding: 9px 7px; font-size: 12.5px; }
  .chip { white-space: normal; }
  .sec-head,
  .panel-head,
  .platform-head {
    align-items: flex-start;
  }
  .sec-head {
    flex-direction: column;
    gap: 10px;
  }
  .sec-head-l,
  .panel-h {
    min-width: 0;
  }
  .panel-h h2 {
    white-space: normal;
    line-height: 1.15;
  }
  .ws-head { padding: 22px 0 16px; }
  .ws-title {
    font-size: 24px;
    line-height: 1.08;
  }
  .ws-sub {
    font-size: 14px;
    line-height: 1.45;
  }
  .cols { gap: 14px; }
  .drop {
    align-items: flex-start;
    padding: 14px;
    gap: 12px;
  }
  .drop-ic {
    width: 38px;
    height: 38px;
  }
  .drop-formats { display: none; }
  .ta {
    min-height: 210px;
    padding: 13px;
    font-size: 14px;
  }
  .helper { font-size: 12px; }
  .actionbar {
    margin-top: 14px;
    padding: 14px;
    gap: 12px;
  }
  .actionbar-l,
  .actionbar-r {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .actionbar-r .btn,
  .actionbar .seg {
    width: 100%;
  }
  .trust-opt { min-height: 0; padding: 13px; }
  .insight-title { font-size: 18px; }
  .launch-head {
    padding: 22px 0 16px;
    align-items: stretch;
  }
  .launch-head .btn { width: 100%; }
  .launch-note {
    padding: 16px;
    flex-direction: column;
  }
  .gen-overlay {
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  }
  .gen-card {
    width: 100%;
    max-width: 420px;
    padding: 24px 18px;
    border-radius: var(--radius);
  }
}

@media (max-width: 360px) {
  .seg-btn svg { display: none; }
  .drop { flex-direction: column; }
  .panel-count { display: none; }
}

/* ============================================================
   Launch readiness screen
   ============================================================ */
.launch-head { padding: 30px 0 20px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.launch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.launch-card { padding: 18px; }
.launch-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.launch-card-top b { font-size: 15px; }
.launch-card p { margin: 10px 0 0; color: var(--ink-3); font-size: 13.5px; line-height: 1.45; }
.launch-pill { flex: none; border-radius: 99px; border: 1px solid var(--line); padding: 4px 8px; font-size: 11px; font-weight: 850; }
.launch-pill.miss { color: var(--rose); background: var(--rose-soft); }
.launch-pill.proto { color: var(--amber-ink); background: var(--amber-soft); border-color: var(--amber-line); }
.launch-pill.ready { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in oklab, var(--accent), transparent 76%); }
.launch-note { margin-top: 18px; padding: 20px; display: flex; align-items: flex-start; gap: 14px; }
.launch-note b { display: block; margin-bottom: 4px; }
.launch-note p { margin: 0; color: var(--ink-3); line-height: 1.5; }

@media (max-width: 720px) {
  .launch-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Generate loading overlay
   ============================================================ */
.gen-overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: color-mix(in oklab, var(--canvas), transparent 8%); backdrop-filter: blur(6px);
  animation: pageIn .25s ease;
}
.gen-card { width: 380px; max-width: 90vw; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 30px 28px; text-align: center; }
.gen-orb { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; background: linear-gradient(150deg, var(--accent), var(--accent-strong)); display: grid; place-items: center; color: #fff; box-shadow: 0 12px 30px -10px color-mix(in oklab, var(--accent), transparent 40%); animation: orbPulse 1.6s ease-in-out infinite; }
.gen-orb svg { width: 30px; height: 30px; }
@keyframes orbPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.gen-title { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; }
.gen-step { font-size: 14px; color: var(--ink-3); margin-top: 6px; height: 20px; }
.gen-bar { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 20px; }
.gen-bar > div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-strong)); transition: width .4s ease; }
.gen-steps { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; text-align: left; }
.gen-li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-4); transition: color .3s ease; }
.gen-li.done { color: var(--ink-2); }
.gen-li.active { color: var(--ink); font-weight: 600; }
.gen-li .tick { width: 19px; height: 19px; border-radius: 99px; border: 1.7px solid var(--line-2); display: grid; place-items: center; flex: none; transition: all .3s ease; }
.gen-li .tick svg { width: 12px; height: 12px; color: #fff; }
.gen-li.done .tick { background: var(--accent); border-color: var(--accent); }
.gen-li.active .tick { border-color: var(--accent); }
.gen-li.active .tick::after { content: ''; width: 7px; height: 7px; border-radius: 99px; background: var(--accent); animation: orbPulse 1s infinite; }
