/* Styles for the homework helper, essay writer, PDF tools and daily games. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.grow { flex: 1; }

/* ================= homework helper ================= */
.hh-main { flex: 1; min-width: 0; }
.hh-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; text-align: left; }
.hh-strip { display: flex; align-items: center; gap: 14px; justify-content: space-between; padding: 12px 18px; background: #f2f8f4; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.hh-split { display: grid; grid-template-columns: minmax(0, 1fr); }
.hh-split.stacked { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.hh-split > * { min-width: 0; }
.hh-left { display: flex; flex-direction: column; min-height: 380px; padding: 16px 18px; gap: 10px; }
.hh-split.stacked .hh-left { border-right: 1px solid var(--line); }
.hh-input { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 250px; }
.hh-ta { flex: 1; width: 100%; min-height: 240px; border: 0; outline: 0; resize: vertical; font: 16px/1.6 var(--font); color: var(--ink); background: transparent; position: relative; z-index: 1; }
.hh-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 30px; color: var(--muted); font-size: 17px; line-height: 2; pointer-events: none; z-index: 2; }
.hh-hint button { pointer-events: auto; }
.hh-link-btn { border: 0; background: none; color: var(--primary); font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }
.hh-paste { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #9cc3dc; background: var(--primary-50); color: #0d4d75; border-radius: 999px; padding: 2px 12px; font-weight: 600; cursor: pointer; font-size: 15px; vertical-align: middle; }
.hh-paste svg { width: 16px; height: 16px; }
.hh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hh-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 12px; font-size: 14px; }
.hh-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.hh-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: #e3e6ec; color: var(--ink-2); cursor: pointer; font-size: 12px; padding: 0; }
.hh-x svg { width: 12px; height: 12px; }
.hh-image-row { padding-bottom: 8px; }
.hh-image-wrap { position: relative; display: inline-block; }
.hh-image-wrap img { max-height: 140px; max-width: 260px; border-radius: 10px; border: 1px solid var(--line); }
.hh-image-wrap .hh-x { position: absolute; top: -8px; right: -8px; background: var(--ink); color: #fff; }
.hh-link-row { display: flex; gap: 8px; }
.hh-link-row .input { flex: 1; }
.hh-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hh-controls-left { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.hh-go { min-width: 170px; height: 46px; font-size: 17px; }
.hh-tries { width: 100%; text-align: right; font-size: 13px; color: var(--muted); }
.hh-source { font-size: 13px; color: #a15c00; background: #fff6e5; border-radius: 8px; padding: 6px 10px; }
.hh-model { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.hh-model button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: #fff; padding: 6px 12px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.hh-model button svg { width: 14px; height: 14px; }
.hh-model button.active { background: var(--primary); color: #fff; }
.hh-model button.locked { color: var(--muted); }
.hh-right { display: flex; flex-direction: column; min-height: 380px; background: #fbfcfd; }
.hh-answer-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.hh-badge { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 8px; background: var(--primary-50); color: var(--primary); }
.hh-badge svg { width: 18px; height: 18px; }
.hh-subject { margin-left: auto; font-size: 13px; background: #eef3fb; color: var(--primary); border-radius: 999px; padding: 3px 12px; font-weight: 600; }
.hh-skeleton { padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.hh-skeleton i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eef1f5, #f8f9fb, #eef1f5); background-size: 200% 100%; animation: hhBone 1.2s infinite linear; }
@keyframes hhBone { to { background-position: -200% 0; } }
.hh-skeleton p { margin-top: 8px; color: var(--muted); font-size: 14px; }
.hh-error { padding: 22px 18px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.hh-error p { color: #b3261e; }
.hh-error .hh-note { color: var(--muted); font-size: 13px; }
.hh-answer { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.hh-scroll { flex: 1; overflow: auto; max-height: 560px; padding: 16px 18px; }
.hh-md { font-size: 15.5px; line-height: 1.65; color: var(--ink); }
.hh-md p { margin: 0 0 10px; }
.hh-md ol, .hh-md ul { margin: 0 0 10px; padding-left: 22px; }
.hh-md li { margin: 0 0 8px; }
.hh-md h2, .hh-md h3, .hh-md h4 { font-size: 16px; margin: 12px 0 6px; }
.hh-md pre { background: #f3f5f8; border-radius: 8px; padding: 10px; overflow: auto; font-size: 13.5px; }
.hh-md code { font-family: var(--mono); font-size: .92em; background: #f1f3f6; padding: 1px 4px; border-radius: 4px; }
.hh-md .katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.hh-box { border: 1px solid #b9dfc6; background: #f1faf4; border-radius: 10px; padding: 12px 14px; margin: 10px 0; }
.hh-take { border-left: 3px solid var(--primary); background: var(--primary-50); border-radius: 0 10px 10px 0; padding: 10px 14px; }
.hh-box-label { font-weight: 700; font-size: 14px; margin-bottom: 4px; color: var(--ink-2); }
.hh-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.hh-drop { position: absolute; inset: 8px; border: 2px dashed var(--primary); border-radius: 12px; background: rgba(234, 243, 249, .92); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--primary); z-index: 5; pointer-events: none; }
.hh-warning { margin-top: 14px; }
.hh-ex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.hh-ex { display: flex; flex-direction: column; gap: 10px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s; font: inherit; color: inherit; }
.hh-ex:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.hh-ex-head { display: flex; align-items: center; gap: 8px; }
.hh-ex-ico { font-size: 20px; width: 28px; text-align: center; }
.hh-ex-thumb { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.hh-ex-thumb svg { width: 100%; height: auto; }
.hh-ex-text { display: block; background: var(--bg-soft); border-radius: 8px; padding: 14px; min-height: 120px; color: var(--ink-2); font-size: 15px; }
.hh-cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.hh-cmp { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.hh-cmp.adv { border-color: var(--primary); box-shadow: var(--shadow); }
.hh-cmp ul { list-style: none; padding: 0; margin: 8px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.hh-cmp li { display: flex; gap: 10px; align-items: flex-start; }
.hh-cmp li svg { width: 18px; height: 18px; flex: none; margin-top: 3px; color: var(--green); }
.hh-cmp:not(.adv) li:last-child svg { color: #c0392b; }
.hh-cmp-badge { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-50); padding: 3px 10px; border-radius: 999px; }
.hh-cmp-ribbon { position: absolute; top: -12px; right: 18px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 12px; }
.hh-cmp .btn { align-self: flex-start; }
.hh-never h2 span, .hh-who h2 span { color: var(--primary); }
.hh-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.hh-list li { display: flex; gap: 12px; background: var(--bg-tint); border-radius: 12px; padding: 14px; }
.hh-list li svg { width: 22px; height: 22px; flex: none; color: var(--primary); }
.hh-how-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 16px; }
.hh-how-step h3 { font-size: 16px; margin: 12px 0 6px; }
.hh-how-step p { font-size: 14.5px; color: var(--ink-2); }
.hh-mock { height: 140px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; font-size: 13px; color: var(--muted); }
.hh-mock u { color: var(--primary); }
.hh-mock-bar { display: flex; justify-content: space-between; align-items: center; }
.hh-mock-bar i { display: inline-flex; gap: 4px; align-items: center; font-style: normal; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }
.hh-mock-bar i svg { width: 13px; height: 13px; }
.hh-mock-bar em { font-style: normal; background: var(--primary); color: #fff; border-radius: 6px; padding: 4px 10px; }
.hh-mock-file { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; background: var(--bg-soft); border-radius: 999px; padding: 4px 10px; }
.hh-mock-file svg { width: 15px; height: 15px; }
.hh-mock-ans { margin: auto; font-size: 18px; font-weight: 700; color: #1d7a45; background: #f1faf4; border: 1px solid #b9dfc6; border-radius: 10px; padding: 10px 16px; }
.hh-mock-adv { margin: auto; display: inline-flex; gap: 6px; align-items: center; background: var(--primary); color: #fff; font-weight: 600; border-radius: 8px; padding: 8px 14px; }
.hh-mock-adv svg { width: 16px; height: 16px; }
.hh-persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.hh-persona { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.hh-persona span { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--primary); }
.hh-persona p { font-size: 14.5px; color: var(--ink-2); }
@media (max-width: 900px) {
  .hh-split.stacked { grid-template-columns: minmax(0, 1fr); }
  .hh-split.stacked .hh-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .hh-ex-grid, .hh-persona-grid { grid-template-columns: 1fr 1fr; }
  .hh-how-grid { grid-template-columns: 1fr 1fr; }
  .hh-cmp-grid, .hh-list { grid-template-columns: 1fr; }
  .hh-strip { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .hh-ex-grid, .hh-persona-grid, .hh-how-grid { grid-template-columns: 1fr; }
  .hh-hint { font-size: 15px; padding: 0 10px; }
  .hh-go { width: 100%; min-width: 0; }
  .hh-left, .hh-scroll, .hh-answer-head, .hh-foot { padding-left: 14px; padding-right: 14px; }
}
.page-head.hh-page { max-width: 1240px; }
.hh-page .tool-wrap { max-width: 1180px; }
.hh-model button { border-radius: 0; }
.hh-card p, .hh-card li { font-size: 15.5px; font-weight: 400; margin-top: 0; }
.hh-card .hh-hint span { font-size: 17px; }
.hh-card .hh-box-label { font-size: 14px; font-weight: 700; }
.hh-card .hh-skeleton p { font-size: 14px; }
.hh-card .hh-error .hh-note { font-size: 13px; }
.hh-card .hh-source { font-size: 13px; }

/* ================= shared bits ================= */
.zc-spin { display: inline-block; width: 28px; height: 28px; border: 3px solid #d9e6ef; border-top-color: var(--primary); border-radius: 50%; animation: zcSpin .8s linear infinite; }
@keyframes zcSpin { to { transform: rotate(360deg); } }
.btn-danger { background: #c62f2f; color: #fff; }
.btn-danger:hover { background: #a92424; }
.btn-danger:disabled, .btn-primary:disabled, .btn-outline:disabled { opacity: .55; cursor: not-allowed; }

/* ================= essay writer ================= */
.page-head.ew-page { max-width: 1240px; }
.ew-page .tool-wrap { max-width: 1180px; }
.ew-main { flex: 1; min-width: 0; text-align: left; }
.ew-loading { display: flex; justify-content: center; padding: 80px 0; }
.ew-gate { display: grid; gap: 24px; justify-items: center; }
.ew-login { width: 100%; max-width: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; display: grid; gap: 12px; text-align: left; }
.ew-login .logo-mark { width: 56px; height: 56px; margin: 0 auto; }
.ew-login .brand-name { text-align: center; font-size: 22px; font-weight: 700; color: var(--primary); }
.ew-login h2 { font-size: 19px; text-align: center; margin: 4px 0 0; }
.ew-login .muted { text-align: center; color: var(--ink-2); font-size: 14px; margin: 0; }
.ew-login label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ew-login .input { padding: 10px 12px; font-weight: 400; }
.ew-login .btn-primary { width: 100%; height: 44px; }
.ew-login .or { margin: 6px 0; }
.ew-login .form-error { margin: 0; }
.ew-blog { text-align: center; display: grid; gap: 6px; }
.ew-blog h3 { font-size: 17px; margin-bottom: 4px; }
.ew-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ew-left { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-right: 1px solid var(--line); }
.ew-ta-wrap { position: relative; }
.ew-ta { width: 100%; min-height: 230px; resize: vertical; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 12px 26px; font: 15.5px/1.6 var(--font); color: var(--ink); }
.ew-ta:focus { outline: 2px solid #bcd7ea; border-color: var(--primary); }
.ew-ta-count { position: absolute; right: 12px; bottom: 10px; font-size: 12px; color: var(--muted); }
.ew-tip { position: absolute; left: 12px; top: calc(100% + 6px); z-index: 4; background: var(--ink); color: #fff; font-size: 13px; border-radius: 8px; padding: 7px 10px; box-shadow: var(--shadow); }
.ew-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ew-opts label { display: grid; gap: 5px; }
.ew-opts label > span { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.ew-opts .select { width: 100%; padding: 8px 10px; font-size: 14.5px; }
.ew-len-note { margin: -4px 0 0; font-size: 13px; color: var(--muted); }
.ew-cite { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.ew-agree { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); cursor: pointer; }
.ew-agree input { margin-top: 2px; }
.ew-actions { display: flex; gap: 10px; }
.ew-actions .btn { flex: 1; height: 44px; font-weight: 600; }
.ew-write svg { width: 17px; height: 16px; }
.ew-usage { margin: 0; font-size: 13px; color: var(--muted); text-align: right; }
.ew-right { display: flex; flex-direction: column; min-height: 520px; background: #fbfcfd; }
.ew-out-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ew-mode { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.ew-mode button { border: 0; background: #fff; padding: 6px 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; font-weight: 600; }
.ew-mode button.active { background: var(--primary); color: #fff; }
.ew-mode button:disabled { cursor: progress; }
.ew-saved { font-size: 12.5px; color: var(--green); }
.ew-del { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: #b3261e; cursor: pointer; }
.ew-del svg { width: 17px; height: 17px; }
.ew-del:disabled { color: var(--muted); cursor: not-allowed; opacity: .6; }
.ew-empty, .ew-busy { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 30px; text-align: center; }
.ew-empty svg { width: 34px; height: 32px; color: #b8c4d2; }
.ew-busy b { color: var(--ink); font-size: 16px; }
.ew-busy small { font-size: 13px; }
.ew-out { flex: 1; overflow: auto; max-height: 620px; padding: 18px 22px; }
.ew-title { font-size: 21px; line-height: 1.35; margin: 0 0 12px; outline: 0; }
.ew-body { font-size: 15.5px; line-height: 1.75; color: var(--ink); outline: 0; min-height: 200px; }
.ew-body p { margin: 0 0 12px; }
.ew-body h3 { font-size: 16.5px; margin: 16px 0 8px; }
.ew-title:focus, .ew-body:focus { background: #fff; box-shadow: 0 0 0 2px #e3eef6; border-radius: 6px; }
.ew-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.ew-foot b { color: var(--ink); }
.ew-foot .btn svg { width: 15px; height: 15px; }
.ew-dl { position: relative; }
.ew-dl-menu { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 6; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 210px; }
.ew-dl-menu button { border: 0; background: none; text-align: left; padding: 8px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; color: var(--ink); }
.ew-dl-menu button:hover { background: var(--bg-soft); }
.ew-history { margin-top: 28px; }
.ew-history h2 { font-size: 20px; margin-bottom: 8px; }
.ew-list { display: grid; gap: 12px; margin-top: 10px; }
.ew-item { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ew-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px #e3eef6; }
.ew-item-main { flex: 1; min-width: 0; }
.ew-item h3 { font-size: 16px; margin: 0 0 4px; }
.ew-item p { margin: 0 0 4px; font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.ew-item .muted { color: var(--muted); font-size: 13px; }
.ew-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ew-tags span { font-size: 12px; background: var(--bg-soft); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); }
.ew-item-actions { display: flex; gap: 8px; align-items: center; }
.ew-item-actions .ew-del { margin-left: 0; }
.ew-dialog { border: 0; border-radius: 14px; padding: 22px; max-width: 380px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(20, 30, 50, .25); }
.ew-dialog::backdrop { background: rgba(20, 30, 50, .35); }
.ew-dialog p { margin: 0 0 18px; color: var(--ink-2); }
.ew-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
@media (max-width: 900px) {
  .ew-card { grid-template-columns: minmax(0, 1fr); }
  .ew-left { border-right: 0; border-bottom: 1px solid var(--line); }
  .ew-right { min-height: 380px; }
}
@media (max-width: 560px) {
  .ew-opts { grid-template-columns: 1fr; }
  .ew-item { flex-direction: column; }
}
/* the page heading's paragraph style must not reach the tool itself */
.page-head .ew-main p { font-size: 15px; font-weight: 400; margin-top: 0; }
.page-head .ew-body p { font-size: 15.5px; margin: 0 0 12px; }
.page-head .ew-len-note { font-size: 13px; margin: -4px 0 0; }
.page-head .ew-usage { font-size: 13px; }
.page-head .ew-item p { font-size: 14px; margin: 0 0 4px; }
.page-head .ew-item p.muted { font-size: 13px; }
.page-head .ew-login .muted { font-size: 14px; }
.page-head .ew-login .form-error { font-size: 14px; }

/* ================= daily brain games ================= */
.gm-page { max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px; }
.gm-gate { display: flex; justify-content: center; padding: 40px 0; }
.gm-login-card { max-width: 440px; width: 100%; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 28px; }
.gm-login-card h1 { font-size: 24px; margin-bottom: 10px; }
.gm-login-card p { color: var(--ink-2); margin: 0 0 18px; }
.gm-login-card .btn { min-width: 180px; }
.gm-login-card .gm-small { font-size: 14px; margin: 16px 0 0; }
.gm-head { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.gm-head h1 { font-size: 28px; }
.gm-head p { color: var(--ink-2); margin-top: 6px; font-size: 16px; }
.gm-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.gm-date, .gm-premium { font-size: 13.5px; font-weight: 600; border-radius: 999px; padding: 5px 12px; }
.gm-date { background: var(--primary-50); color: var(--primary); }
.gm-premium { background: #fff4e0; color: #9a5b00; }
.gm-loading { display: flex; justify-content: center; padding: 80px 0; }
.gm-error { display: flex; justify-content: center; padding: 40px 0; }
.gm-error-card { max-width: 460px; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: grid; gap: 12px; justify-items: center; }
.gm-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: start; }
.gm-side { display: grid; gap: 10px; }
.gm-card { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; font: inherit; color: inherit; transition: box-shadow .15s, border-color .15s; }
.gm-card:hover { box-shadow: var(--shadow); }
.gm-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px #e3eef6; }
.gm-icon { flex: none; width: 44px; height: 44px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; font-weight: 800; }
.gm-card-body { display: grid; gap: 3px; min-width: 0; }
.gm-card-body b { font-size: 15.5px; }
.gm-card-body small { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.gm-done-tag { font-style: normal; font-size: 12px; font-weight: 700; color: var(--green); }
.gm-main { min-width: 0; display: grid; gap: 16px; }
.gm-empty { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.gm-empty h2 { font-size: 22px; }
.gm-empty p { color: var(--ink-2); margin: 0; max-width: 560px; }
.gm-empty .gm-pick { font-weight: 600; color: var(--ink); margin-top: 6px; }
.gm-err h2 { color: #b3261e; }
.gm-pills { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.gm-pill-wrap { display: grid; gap: 4px; justify-items: center; }
.gm-pill { border: 1px solid var(--primary); background: var(--primary); color: #fff; border-radius: 999px; padding: 10px 24px; font-size: 15px; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.gm-pill:hover { background: var(--primary-600); }
.gm-pill.done { background: #eef8f1; border-color: #b9dfc6; color: #1d7a45; cursor: default; }
.gm-pill.locked { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.gm-pill-time { font-size: 12.5px; color: var(--muted); }
.gm-board-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.gm-board-panel h3 { font-size: 17px; }
.gm-board-panel p { font-size: 13px; color: var(--muted); margin: 2px 0 10px; }
.gm-board-panel ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.gm-board-panel li { display: flex; gap: 12px; padding: 6px 10px; border-radius: 8px; background: var(--bg-soft); font-size: 14.5px; }
.gm-board-panel .rank { width: 34px; font-weight: 700; color: var(--primary); }
.gm-board-panel .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-board-panel .time { font-variant-numeric: tabular-nums; font-weight: 600; }
.gm-shell { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gm-shell-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.gm-back { border: 0; background: none; color: var(--primary); font-weight: 600; cursor: pointer; font-size: 15px; padding: 6px 4px; }
.gm-title { flex: 1; text-align: center; }
.gm-title h2 { font-size: 18px; }
.gm-title span { font-size: 13px; color: var(--muted); }
.gm-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; background: var(--bg-soft); border-radius: 8px; padding: 5px 12px; min-width: 68px; text-align: center; }
.gm-timer.done { background: #eef8f1; color: #1d7a45; }
.gm-puzzle { padding: 18px; display: grid; justify-items: center; gap: 12px; }
.gm-rule { margin: 0; color: var(--ink-2); font-size: 14.5px; text-align: center; max-width: 560px; }
.gm-board-wrap { width: 100%; max-width: 460px; display: grid; gap: 10px; justify-items: center; }
.gm-grid { width: 100%; display: grid; grid-template-columns: repeat(var(--n), 1fr); border: 2px solid #2a3550; border-radius: 10px; overflow: hidden; background: #2a3550; gap: 1px; touch-action: none; user-select: none; }
.gm-cell { aspect-ratio: 1; border: 0; background: #fff; display: flex; align-items: center; justify-content: center; font: 600 clamp(16px, 4.6vw, 26px)/1 var(--font); color: var(--ink); cursor: pointer; padding: 0; text-align: center; width: 100%; min-width: 0; border-radius: 0; }
.gm-cell:focus-visible { outline: 3px solid #7fb3d9; outline-offset: -3px; z-index: 1; }
.gm-cell.given { background: #eef1f6; color: #1d2a44; cursor: default; font-weight: 800; }
.gm-cell.hinted { box-shadow: inset 0 0 0 3px #f2b632; }
.gm-cell.bad { color: #c62f2f; background: #fdecea; }
.gm-sudoku .gm-cell { caret-color: var(--primary); }
.gm-cell { box-sizing: border-box; }
.gm-sudoku .gm-cell.br, .gm-blocks .gm-cell.br { border-right: 2px solid #2a3550; }
.gm-sudoku .gm-cell.bb, .gm-blocks .gm-cell.bb { border-bottom: 2px solid #2a3550; }
.gm-sunmoon .gm-cell.sun { color: #e59a12; font-size: clamp(20px, 5.4vw, 30px); }
.gm-sunmoon .gm-cell.moon { color: #4a5f9e; font-size: clamp(20px, 5.4vw, 30px); }
.gm-sunmoon .gm-cell.bad { background: #fdecea; }
.gm-blocks .gm-cell.given { box-shadow: inset 0 0 0 3px rgba(0, 0, 0, .28); }
.gm-blocks .gm-cell.given::after { content: "•"; color: rgba(0, 0, 0, .45); font-size: 18px; }
.gm-blocks .gm-cell.bad { box-shadow: inset 0 0 0 3px #c62f2f; }
.gm-blocks .gm-cell[data-v="0"] { background: #fff; }
.gm-crowns .gm-cell { color: #c4513a; font-size: clamp(20px, 5vw, 30px); }
.gm-crowns .gm-cell.alt { background: #f7f8fb; }
.gm-crowns .gm-cell.given { background: #fbeee9; }
.gm-crowns .gm-cell.bad { background: #fdecea; color: #c62f2f; }
.gm-path-wrap { position: relative; width: 100%; }
.gm-path-svg { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); pointer-events: none; z-index: 2; }
.gm-path-svg polyline { stroke: rgba(31, 157, 107, .55); stroke-width: 3.2; }
.gm-number .gm-cell.on, .gm-word .gm-cell.on { background: #e5f5ec; }

.gm-cell.on.head { background: #c6ead6; }
.gm-cell.checkpoint span { display: inline-flex; width: 64%; height: 64%; border-radius: 50%; background: #1d2a44; color: #fff; align-items: center; justify-content: center; font-size: clamp(13px, 3.6vw, 19px); position: relative; z-index: 3; }
.gm-cell.pulse span { animation: gmPulse .8s 2; }
@keyframes gmPulse { 50% { transform: scale(1.18); background: #1f9d6b; } }
.gm-cell.shake { animation: gmShake .35s; }
@keyframes gmShake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.gm-word .gm-cell span { position: relative; z-index: 3; }
.gm-clue { width: 100%; display: grid; gap: 2px; text-align: center; background: var(--bg-tint); border-radius: 10px; padding: 10px 14px; }
.gm-clue span { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.gm-clue b { font-size: 16.5px; }
.gm-clue small { font-size: 12.5px; color: var(--muted); }
#gmWord { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
#gmWord span { width: 34px; height: 38px; border-bottom: 3px solid #2a3550; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 20px; }
.gm-help { margin: 0; font-size: 13px; color: var(--muted); text-align: center; }
.gm-path-actions { display: flex; gap: 8px; }
.gm-hint-area { display: grid; gap: 8px; justify-items: center; width: 100%; max-width: 460px; }
.gm-hint-btn { min-width: 150px; }
.gm-hint-msg { margin: 0; text-align: center; font-size: 14.5px; color: var(--ink-2); background: #fff8e6; border-radius: 8px; padding: 8px 12px; }
.gm-hint-msg.good { background: #eef8f1; color: #1d7a45; font-weight: 600; }
.gm-hint-msg.bad { background: #fdecea; color: #a23224; }
.gm-congrats { position: fixed; inset: 0; z-index: 80; background: rgba(20, 30, 50, .4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gm-congrats[hidden] { display: none; }
.gm-congrats-modal { background: #fff; border-radius: 16px; padding: 28px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(20, 30, 50, .3); display: grid; gap: 10px; justify-items: center; }
.gm-confetti { font-size: 42px; }
.gm-congrats-modal p { margin: 0 0 8px; color: var(--ink-2); }
@media (max-width: 900px) {
  .gm-layout { grid-template-columns: minmax(0, 1fr); }
  .gm-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .gm-page { padding: 14px 16px 50px; }
  .gm-side { grid-template-columns: 1fr 1fr; gap: 8px; }
  .gm-card { padding: 9px; gap: 9px; align-items: center; }
  .gm-icon { width: 36px; height: 36px; font-size: 18px; }
  .gm-card-body b { font-size: 14px; }
  .gm-card small { display: none; }
  .gm-puzzle { padding: 14px 10px; }
  .gm-head h1 { font-size: 23px; }
}

/* ================================================================ PDF editor: catalog */
.pe-hero { text-align: center; padding: 56px 16px 30px; background: linear-gradient(180deg, #f3f8fc, #fff); }
.pe-hero h1 { font-size: 40px; font-weight: 700; }
.pe-hero h2 { font-size: 18px; font-weight: 400; color: var(--ink-2); margin-top: 12px; }
.pe-sections { max-width: 1180px; margin: 0 auto; padding: 10px 20px 40px; }
.pe-section { margin-top: 34px; }
.pe-section-title { font-size: 22px; font-weight: 700; color: var(--c); padding-left: 12px; border-left: 4px solid var(--c); margin-bottom: 16px; }
.pe-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pe-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); transition: box-shadow .15s, border-color .15s, transform .15s; text-decoration: none !important; min-width: 0; }
.pe-card:hover { border-color: var(--c); box-shadow: 0 6px 20px rgba(20, 40, 60, .1); transform: translateY(-1px); }
.pe-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pe-card-head b { font-size: 16px; }
.pe-card-ico { width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, #fff); }
.pe-card-ico svg { width: 21px; height: 21px; }
.pe-card-desc { font-size: 14px; color: var(--muted); line-height: 1.45; }
.pe-faq { max-width: 900px; margin: 30px auto 0; padding: 0 20px; }
.pe-faq .faq-list { margin-top: 18px; }
.pe-faq .faq-a ul { margin: 8px 0 0; padding-left: 22px; }
.pe-faq .faq-a { padding: 0 16px 24px; color: var(--ink-2); }
.pe-blog { max-width: 900px; margin: 30px auto 50px; padding: 0 20px; display: flex; flex-direction: column; gap: 8px; }
.pe-blog h3 { font-size: 18px; margin-bottom: 4px; }

/* ================================================================ PDF editor: tool pages */
.pt-page { max-width: 1240px; margin: 0 auto; padding: 22px 20px 50px; }
.pt-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.pt-crumbs b { color: var(--ink-2); font-weight: 600; }
.pt-head { display: flex; align-items: center; gap: 16px; margin: 16px 0 22px; }
.pt-head-ico { width: 54px; height: 54px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--c); }
.pt-head-ico svg { width: 28px; height: 28px; }
.pt-head h1 { font-size: 30px; font-weight: 700; }
.pt-head p { color: var(--ink-2); margin-top: 4px; }
.pt-shell { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.pt-shell--editor { grid-template-columns: minmax(0, 1fr) 300px; }
.pt-main { min-width: 0; }
.pt-drop { border: 2px dashed color-mix(in srgb, var(--c) 45%, #fff); border-radius: 16px; background: color-mix(in srgb, var(--c) 5%, #fff); min-height: 320px; display: flex; flex-direction: column; }
body.pt-dragging .pt-drop, body.pt-dragging .pt-work { outline: 3px solid var(--c); outline-offset: 4px; }
.pt-drop-inner { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 20px; text-align: center; }
.pt-drop-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--c); box-shadow: var(--shadow-sm); }
.pt-drop-ico svg { width: 30px; height: 30px; }
.pt-pick { background: var(--c); font-size: 17px; padding: 13px 26px; }
.pt-pick:hover { background: color-mix(in srgb, var(--c) 85%, #000); }
.pt-drop p { color: var(--ink-2); }
.pt-drop small { color: var(--muted); max-width: 420px; }
.pt-tabs { display: flex; gap: 6px; padding: 14px 14px 0; }
.pt-tabs button { border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 16px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.pt-tabs button.active { background: var(--c); border-color: var(--c); color: #fff; }
.pt-url { padding: 40px 24px; display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; width: 100%; }
.pt-url label { font-weight: 600; }
.pt-url small { color: var(--muted); }
.pt-work { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 14px; min-width: 0; }
.pt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.pt-count { font-weight: 600; margin-right: auto; }
.pt-files { display: flex; flex-direction: column; gap: 8px; }
.pt-files.sorting { cursor: grabbing; }
.pt-file { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.pt-file.dragging { box-shadow: 0 8px 24px rgba(20, 40, 60, .18); border-color: var(--c); position: relative; z-index: 2; }
.pt-handle { cursor: grab; color: var(--muted); padding: 6px 2px; touch-action: none; user-select: none; letter-spacing: -3px; }
.pt-file-thumb { width: 44px; height: 56px; flex: none; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: grid; place-items: center; background: var(--bg-soft); }
.pt-file-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.pt-file-thumb b { font-size: 12px; color: var(--c); }
.pt-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pt-file-info b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pt-file-info b em { font-style: normal; color: var(--muted); }
.pt-file-info small { color: var(--muted); font-size: 13px; }
.pt-file-opts { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13.5px; margin-top: 4px; }
.pt-file-opts label { display: inline-flex; align-items: center; gap: 6px; }
.pt-file-opts .input { width: 70px; padding: 4px 8px; }
.pt-move { display: flex; gap: 4px; }
.pt-move button, .pt-x { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; font-size: 15px; color: var(--ink-2); flex: none; }
.pt-move button:disabled { opacity: .35; cursor: default; }
.pt-x:hover { color: #c62f2f; border-color: #c62f2f; }
.pt-view:not(:empty) { margin-top: 14px; }
.pt-gbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.pt-gbar .chip { border: 1px solid var(--line-2); background: #fff; padding: 5px 12px; }
.pt-gbar .chip:disabled { opacity: .4; cursor: default; }
.pt-gcount { color: var(--muted); font-size: 14px; }
.pt-gpages { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.pt-gpages .input { width: 170px; padding: 5px 10px; }
.input.bad { border-color: #c62f2f; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.pt-thumb { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 10px; border: 2px solid transparent; position: relative; min-width: 0; }
.pt-thumb.pickable { cursor: pointer; }
.pt-thumb.pickable:hover { background: var(--bg-soft); }
.pt-thumb.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); }
.pt-thumb.dragging { opacity: .6; }
.pt-thumb-img { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; position: relative; }
.pt-grid-sort .pt-thumb-img { cursor: grab; touch-action: none; user-select: none; }
.pt-thumb-img img { max-width: 100%; max-height: 100%; box-shadow: 0 1px 4px rgba(20, 40, 60, .22); background: #fff; transition: transform .2s; -webkit-user-drag: none; pointer-events: none; }
.pt-thumb-img img:not(.ready) { width: 70%; height: 90%; background: var(--bg-soft); }
.pt-blank { width: 70%; height: 90%; background: #fff; box-shadow: 0 1px 4px rgba(20, 40, 60, .22); }
.pt-tick { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-style: normal; font-size: 13px; display: none; place-items: center; }
.pt-thumb.sel .pt-tick { display: grid; }
.pt-thumb-n { font-size: 13px; color: var(--ink-2); }
.pt-thumb-acts { display: flex; gap: 4px; }
.pt-thumb-acts button { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 14px; padding: 0; }
.pt-thumb-acts button:hover { border-color: var(--c); color: var(--c); }
.pt-area { display: flex; justify-content: center; background: var(--bg-soft); border-radius: 12px; padding: 16px; }
.pt-area-stage { position: relative; display: inline-block; touch-action: none; user-select: none; cursor: crosshair; max-width: 100%; }
.pt-area-stage img { max-width: 100%; max-height: 72vh; box-shadow: 0 2px 10px rgba(20, 40, 60, .2); background: #fff; -webkit-user-drag: none; pointer-events: none; }
.pt-area-sel { position: absolute; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); box-shadow: 0 0 0 9999px rgba(20, 30, 50, .28); }
.pt-area-sel i { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--c); border-radius: 3px; }
.pt-area-sel i[data-h=nw] { left: -8px; top: -8px; cursor: nwse-resize; }
.pt-area-sel i[data-h=ne] { right: -8px; top: -8px; cursor: nesw-resize; }
.pt-area-sel i[data-h=sw] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.pt-area-sel i[data-h=se] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.pt-area-text { font-size: 14px; color: var(--ink); background: #fff8d6; border-radius: 6px; padding: 3px 8px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-area-text:empty { display: none; }
.pt-side { border: 1px solid var(--line); border-radius: 16px; background: #fff; padding: 18px; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 100px); overflow: auto; }
.pt-side h2 { font-size: 18px; }
.pt-help { font-size: 14px; color: var(--ink-2); background: var(--bg-tint); border-radius: 8px; padding: 10px 12px; }
.pt-opts { display: flex; flex-direction: column; gap: 12px; }
.pt-opt { display: flex; flex-direction: column; gap: 5px; font-size: 14px; border: 0; padding: 0; margin: 0; min-width: 0; }
.pt-opt > span:first-child, .pt-opt legend { font-weight: 600; color: var(--ink-2); font-size: 13.5px; padding: 0; }
.pt-opt .select, .pt-opt .input { width: 100%; font-size: 14px; padding: 8px 10px; }
.pt-num { display: flex; align-items: center; gap: 8px; }
.pt-num em { font-style: normal; color: var(--muted); white-space: nowrap; }
.pt-check { flex-direction: row; align-items: flex-start; gap: 8px; cursor: pointer; }
.pt-check input { margin-top: 3px; flex: none; }
.pt-check > span:first-child { font-weight: 400; }
.pt-check span { font-weight: 400 !important; color: var(--ink) !important; font-size: 14px !important; }
.pt-radio label { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; cursor: pointer; }
.pt-radio label input { margin-top: 3px; flex: none; }
.pt-color { flex-direction: row; align-items: center; justify-content: space-between; }
.pt-color input { width: 54px; height: 32px; border: 1px solid var(--line-2); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }
.pt-opt input[type=range] { width: 100%; accent-color: var(--c); }
.pt-note { font-size: 13.5px; color: var(--muted); background: var(--bg-soft); border-radius: 8px; padding: 8px 10px; }
.pt-group { font-weight: 700; font-size: 14px; margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.pt-pos-grid { display: grid; grid-template-columns: repeat(3, 34px); gap: 4px; }
.pt-pos-grid label { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; cursor: pointer; background: #fff; }
.pt-pos-grid input { position: absolute; opacity: 0; pointer-events: none; }
.pt-pos-grid i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.pt-pos-grid label:has(input:checked) { border-color: var(--c); }
.pt-pos-grid label:has(input:checked) i { background: var(--c); }
.pt-pos-grid label:has(input:focus-visible) { outline: 2px solid var(--c); }
.pt-pos-tile { display: flex; align-items: center; gap: 8px; margin-top: 6px; cursor: pointer; }
.pt-run { background: var(--c); width: 100%; font-size: 17px; padding: 13px 18px; font-weight: 600; }
.pt-run:hover { background: color-mix(in srgb, var(--c) 85%, #000); }
.pt-prog { height: 6px; border-radius: 3px; background: var(--bg-soft); overflow: hidden; }
.pt-prog i { display: block; height: 100%; width: 0; background: var(--c); transition: width .2s; }
.pt-status { font-size: 14px; color: var(--ink-2); }
.pt-err { font-size: 14px; color: #a52020; background: #fdeeee; border-radius: 8px; padding: 9px 12px; }
.pt-result { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.pt-result h3 { color: #1b8a4b; font-size: 18px; }
.pt-res-msg { font-size: 14px; color: var(--ink-2); background: #eefaf2; border-radius: 8px; padding: 8px 10px; }
.pt-res-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.pt-out { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.pt-out-ico { width: 40px; height: 40px; flex: none; border-radius: 8px; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.pt-out-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-out-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pt-out-info small { color: var(--muted); font-size: 12.5px; }
.pt-out .btn { background: var(--c); }
.pt-preview { width: 100%; min-height: 160px; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px; font: 13px/1.5 var(--mono); resize: vertical; }
.pt-copy { align-self: flex-start; }
.pt-dlall { background: var(--c); }
.pt-res-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pt-more { margin-top: 46px; }
.pt-more h2 { font-size: 20px; margin-bottom: 14px; }
.pt-more .center { margin-top: 20px; }
.pt-pw input { width: 100%; margin-bottom: 18px; }
.pt-pw .pt-err { margin: 0 0 12px; }
.pt-tool-extra:empty { display: none; }
.pt-list { display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 980px) {
  .pt-shell, .pt-shell--editor { grid-template-columns: minmax(0, 1fr); }
  .pt-side { position: static; max-height: none; }
}
@media (max-width: 640px) {
  .pe-hero { padding: 36px 16px 20px; }
  .pe-hero h1 { font-size: 28px; }
  .pe-hero h2 { font-size: 16px; }
  .pe-sections, .pe-faq, .pe-blog { padding-left: 16px; padding-right: 16px; }
  .pe-cards { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .pt-page { padding: 16px 16px 40px; }
  .pt-head h1 { font-size: 24px; }
  .pt-head-ico { width: 44px; height: 44px; }
  .pt-drop { min-height: 240px; }
  .pt-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .pt-work { padding: 10px; }
  .pt-file { gap: 8px; padding: 8px; }
  .pt-gpages .input { width: 140px; }
}
.pt-bms { display: flex; flex-direction: column; gap: 6px; }
.pt-bm { display: flex; align-items: center; gap: 6px; padding-left: calc(var(--lvl, 0) * 24px); min-width: 0; }
.pt-bm button { border: 1px solid var(--line-2); background: #fff; border-radius: 6px; width: 28px; height: 30px; cursor: pointer; flex: none; padding: 0; color: var(--ink-2); }
.pt-bm button:disabled { opacity: .35; cursor: default; }
.pt-bm-title { flex: 1; min-width: 60px; padding: 6px 10px !important; }
.pt-bm-page { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.pt-bm-page .input { width: 64px; padding: 6px 8px; }
@media (max-width: 640px) { .pt-bm { flex-wrap: wrap; } .pt-bm-title { flex-basis: calc(100% - 70px); } }

/* ---------------- PDF editor tools (editor.js) ---------------- */
.pt-page--editor .pt-work { padding: 0; overflow: visible; }
.pt-page--editor .pt-bar { padding: 12px 14px 0; }
.pt-page--editor .pt-files { padding: 0 14px; }
.ed { margin-top: 10px; }
.ed-bar { position: sticky; top: 64px; z-index: 20; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 10px; background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ed-tools, .ed-acts { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ed-tool, .ed-act { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.ed-tool span { display: none; }
.ed-tool svg, .ed-act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ed-tool:hover, .ed-act:hover { background: color-mix(in srgb, var(--c) 8%, #fff); color: var(--ink); }
.ed-tool.active { background: color-mix(in srgb, var(--c) 14%, #fff); border-color: color-mix(in srgb, var(--c) 45%, #fff); color: var(--c); }
.ed-tool.active span { display: inline; font-weight: 600; }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.ed-zoom { min-width: 44px; text-align: center; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ed-pages { background: #eef0f4; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 14px; overflow-x: auto; border-radius: 0 0 16px 16px; min-height: 300px; }
.ed-page { position: relative; flex: none; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); user-select: none; -webkit-user-select: none; touch-action: none; }
.ed-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ed-layer { position: absolute; inset: 0; overflow: hidden; }
.ed-pno { position: absolute; right: 6px; bottom: -20px; font-size: 11px; color: var(--muted); }
.ed-pages[data-tool="text"] .ed-layer, .ed-pages[data-tool="date"] .ed-layer { cursor: text; }
.ed-pages[data-tool="draw"] .ed-layer, .ed-pages[data-tool="rect"] .ed-layer, .ed-pages[data-tool="ellipse"] .ed-layer, .ed-pages[data-tool="line"] .ed-layer, .ed-pages[data-tool="arrow"] .ed-layer, .ed-pages[data-tool="highlight"] .ed-layer, .ed-pages[data-tool="whiteout"] .ed-layer, .ed-pages[data-tool="link"] .ed-layer, .ed-pages[data-tool^="f"] .ed-layer, .ed-pages[data-tool="check"] .ed-layer, .ed-pages[data-tool="cross"] .ed-layer, .ed-pages[data-tool="dot"] .ed-layer { cursor: crosshair; }
.ed-obj { position: absolute; box-sizing: border-box; cursor: move; }
.ed-obj.sel { outline: 1.5px solid #2563eb; outline-offset: 1px; }
.ed-obj.editing { cursor: text; outline: 1.5px dashed #2563eb; }
.ed-obj img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ed-svg { display: block; overflow: visible; pointer-events: none; }
.ed-txt { white-space: pre; outline: none; min-width: 4px; min-height: 1em; padding: 0; margin: 0; user-select: text; -webkit-user-select: text; }
.ed-obj.editing .ed-txt { cursor: text; }
.ed-edit { z-index: 1; }
.ed-fill { position: absolute; inset: 0; }
.ed-highlight .ed-fill { mix-blend-mode: multiply; }
.ed-linkbox { position: absolute; inset: 0; border: 1.5px dashed #2563eb; background: rgba(37,99,235,.08); overflow: hidden; }
.ed-linkbox small { position: absolute; left: 2px; top: -1px; font-size: 10px; color: #1d4ed8; white-space: nowrap; }
.ed-h { position: absolute; width: 11px; height: 11px; background: #fff; border: 2px solid #2563eb; border-radius: 3px; transform: translate(-50%, -50%); cursor: nwse-resize; z-index: 2; }
.ed-h-se { left: 100%; top: 100%; }
.ed-h[data-h="p1"], .ed-h[data-h="p2"] { border-radius: 50%; cursor: crosshair; }
.ed-ghost { position: absolute; pointer-events: none; border: 1.5px dashed #2563eb; background: rgba(37,99,235,.06); }
.ed-ghost-draw, .ed-ghost-line, .ed-ghost-arrow { border: 0; background: none; }
.ed-ghost-highlight { background: rgba(255,225,77,.45); border: 0; }
.ed-ghost-whiteout { background: #fff; border-color: #94a3b8; }
.ed-seg { position: absolute; border: 1px solid transparent; background: transparent; padding: 0; border-radius: 2px; cursor: text; }
.ed-seg:hover { border-color: #2563eb; background: rgba(37,99,235,.08); }
.ed-pages[data-tool="edittext"] .ed-seg { border-color: rgba(37,99,235,.35); }
.ed-field { position: absolute; box-sizing: border-box; }
.ed-field input[type=text], .ed-field textarea, .ed-field select { width: 100%; height: 100%; box-sizing: border-box; border: 1px solid rgba(37,99,235,.45); background: rgba(219,234,254,.55); padding: 0 3px; font-family: Helvetica, Arial, sans-serif; color: #000; border-radius: 1px; resize: none; }
.ed-field textarea { padding: 2px 3px; line-height: 1.2; }
.ed-field input:focus, .ed-field textarea:focus, .ed-field select:focus { outline: 2px solid #2563eb; background: #fff; }
.ed-field input[type=checkbox], .ed-field input[type=radio] { width: 100%; height: 100%; margin: 0; accent-color: #1d4ed8; cursor: pointer; }
.ed-field.ro { opacity: .7; }
.ed-fbox { position: absolute; inset: 0; border: 1px solid #64748b; background: rgba(239,246,255,.9); display: flex; align-items: center; justify-content: center; color: #111; font-size: 11px; overflow: hidden; }
.ed-fline { justify-content: space-between; padding: 0 4px; }
.ed-fline em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-fmulti { align-items: flex-start; padding-top: 2px; }
.ed-fround { border-radius: 50%; background: #fff; }
.ed-fsq { background: #fff; }
.ed-flab { position: absolute; left: 0; bottom: 100%; font-size: 10px; line-height: 1.2; color: #1d4ed8; white-space: nowrap; background: rgba(255,255,255,.85); padding: 0 2px; pointer-events: none; }
.ed-panel h3 { font-size: 16px; margin-bottom: 6px; }
.ed-props { display: grid; gap: 10px; margin: 10px 0; }
.ed-prop { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.ed-prop .input { width: 100%; }
.ed-prop input[type=color] { width: 100%; height: 34px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; padding: 2px; }
.ed-props2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.ed-chk { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.ed-radio { display: grid; gap: 6px; }
.ed-pacts { display: flex; gap: 8px; margin-bottom: 8px; }
.ed-global { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; }
.ed-count { font-size: 13px; color: var(--muted); margin-top: 8px; }
.ed-orig { font-size: 12px; word-break: break-word; }
.ed-sig { width: min(640px, 94vw); --c: #0282e5; }
.ed-sig-form { display: grid; gap: 12px; }
.ed-sig-form h3 { font-size: 18px; }
.ed-sig-tabs { padding: 0; }
.ed-sig-panel { display: grid; gap: 8px; }
#edSigPad { width: 100%; aspect-ratio: 3 / 1; border: 1px dashed var(--line-2); border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.ed-sig-fonts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 220px; overflow: auto; }
.ed-sig-fonts button { border: 1px solid var(--line-2); background: #fff; border-radius: 10px; padding: 10px; font-size: 30px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-sig-fonts button.on { border-color: var(--c, #2563eb); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, #2563eb) 30%, #fff); }
.ed-sig-prev { min-height: 60px; border: 1px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.ed-sig-prev img { max-width: 100%; max-height: 120px; }
.ed-sig-prev img:not([src]) { display: none; }
.ed-sig-row { display: flex; justify-content: space-between; align-items: center; }
.ed-sig-colors { display: flex; gap: 8px; }
.ed-sig-colors button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.ed-sig-colors button.on { box-shadow: 0 0 0 2px var(--ink); }
.ed-sig-saved p { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.ed-sig-saved > div { display: flex; flex-wrap: wrap; gap: 8px; }
.ed-sig-item { position: relative; }
.ed-sig-item [data-sv] { border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 6px; cursor: pointer; height: 52px; }
.ed-sig-item img { height: 38px; max-width: 160px; object-fit: contain; }
.ed-sig-x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--ink-2); color: #fff; font-size: 12px; line-height: 18px; cursor: pointer; padding: 0; }
.ed-sig-acts { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 0; }
@media (max-width: 980px) { .ed-bar { top: 56px; } }
@media (max-width: 640px) { .ed-tool { padding: 6px; } .ed-tool.active span { display: none; } .ed-pages { padding: 10px 6px; } .ed-sig-fonts { grid-template-columns: 1fr; } }
