/* Styles for js/more/smart.js: AI Summarizer, Translate PDF, PDF Forms, Workflows. */

/* ---------- shared ---------- */
.sm-status { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; }
.sm-status > .ic { width: 20px; height: 20px; margin-top: 1px; color: var(--muted); }
.sm-status strong { display: block; font-size: .92rem; line-height: 1.35; }
.sm-status p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }
.sm-status--ok { background: #ecfdf5; border-color: #bbebd6; }
.sm-status--ok > .ic { color: var(--ok); }
.sm-status--wait { background: var(--primary-soft); border-color: var(--primary-line); }
.sm-status--wait > .ic { color: var(--primary); }
.sm-status--bad { background: #fff7ed; border-color: #fed7aa; }
.sm-status--bad > .ic { color: #c2410c; }
.sm-note { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; font-size: .9rem; line-height: 1.5; }
.work__side > .sm-note { margin: 0; }
.sm-note .ic { width: 18px; height: 18px; margin-top: 2px; color: #c2410c; }
.sm-h { margin: 0 0 12px; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- summarizer ---------- */
.sm-sum { scroll-margin-top: 92px; }
.sm-sum__empty { display: grid; gap: 16px; max-width: 520px; margin: 40px auto; text-align: center; }
.sm-sum__empty .file-row { text-align: left; }
.sm-sum__empty p { margin: 0; }
.sm-sum__card { max-width: 760px; margin: 0 auto; }
.sm-sum__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.sm-sum__head h2 { margin: 0 0 2px; font-size: 1.3rem; letter-spacing: -.01em; }
.sm-sum__acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-sum__acts .btn { padding: 9px 14px; font-size: .88rem; }
.sm-md { padding-top: 8px; font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
.sm-md p { margin: 12px 0; }
.sm-md ul, .sm-md ol { margin: 12px 0; padding-left: 1.3em; }
.sm-md li { margin: 8px 0; padding-left: 4px; }
.sm-md li::marker { color: var(--c); font-weight: 700; }
.sm-md h3, .sm-md h4, .sm-md h5 { margin: 20px 0 6px; font-size: 1.05rem; }
.sm-md strong { font-weight: 700; }
.sm-sum__foot { margin-top: 18px !important; padding-top: 12px; border-top: 1px dashed var(--line); }

/* ---------- forms ---------- */
.sm-forms { display: flex; flex-direction: column; gap: 14px; }
.sm-bar { position: sticky; top: 76px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-radius: 16px; background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.sm-tool { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid transparent; border-radius: 11px; background: none; color: var(--text); font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.sm-tool:hover { background: var(--surface-2); }
.sm-tool .ic { width: 17px; height: 17px; color: var(--muted); }
.sm-tool.on { background: var(--primary-soft); border-color: var(--primary-line); color: var(--primary); }
.sm-tool.on .ic { color: var(--primary); }
.sm-tool--detect { margin-left: auto; background: var(--primary); color: #fff; }
.sm-tool--detect:hover { background: var(--primary-2); }
.sm-tool--detect .ic { color: #fff; }
.sm-pages { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 22px; border-radius: 18px; background: var(--stage); }
.sm-page { position: relative; width: 100%; max-width: 860px; container-type: inline-size; background: #fff; box-shadow: 0 14px 34px -14px rgba(23, 23, 58, .4); border-radius: 3px; }
.sm-page canvas { display: block; width: 100% !important; height: auto !important; border-radius: 3px; }
.sm-layer { position: absolute; inset: 0; overflow: hidden; }
.sm-pages.placing .sm-layer { cursor: crosshair; }
.sm-in { position: absolute; margin: 0; padding: 0 .3em; border: 1px solid rgba(102, 70, 232, .35); border-radius: 2px; background: rgba(102, 70, 232, .08); color: #10103a; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; }
.sm-in:hover { background: rgba(102, 70, 232, .14); }
.sm-in:focus { outline: 2px solid var(--primary); outline-offset: 0; background: #fff; }
textarea.sm-in { resize: none; padding-top: .2em; }
select.sm-in { padding: 0 .1em; }
input[type=checkbox].sm-in, input[type=radio].sm-in { padding: 0; accent-color: var(--primary); cursor: pointer; }
.sm-in:disabled { opacity: .6; }
.sm-old { position: absolute; border: 1px dashed rgba(23, 23, 58, .35); background: rgba(23, 23, 58, .04); pointer-events: none; }
.sm-fld { position: absolute; display: flex; align-items: center; padding: 0 .35em; border: 1.5px solid #d97706; border-radius: 3px; background: rgba(245, 158, 11, .14); color: #7c2d12; cursor: move; touch-action: none; user-select: none; }
.sm-fld--check, .sm-fld--radio { justify-content: center; padding: 0; }
.sm-fld--radio { border-radius: 50%; }
.sm-fld--sig { align-items: flex-end; padding-bottom: .2em; border-style: dashed; }
.sm-fld.on { border-color: var(--primary); background: rgba(102, 70, 232, .12); color: var(--primary-2); box-shadow: 0 0 0 3px rgba(102, 70, 232, .18); z-index: 2; }
.sm-fld__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 1em/1 Inter, system-ui, sans-serif; pointer-events: none; }
.sm-fld--check .sm-fld__name, .sm-fld--radio .sm-fld__name { position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); padding: 1px 5px; border-radius: 5px; background: rgba(255, 255, 255, .9); font-size: max(.9em, 9px); }
.sm-fld__x { position: absolute; right: -11px; top: -11px; display: none; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: var(--bad); color: #fff; cursor: pointer; }
.sm-fld__x .ic { width: 12px; height: 12px; }
.sm-fld__size { position: absolute; right: -6px; bottom: -6px; display: none; width: 12px; height: 12px; border: 2px solid #fff; border-radius: 4px; background: var(--primary); cursor: nwse-resize; }
.sm-fld.on .sm-fld__x { display: grid; }
.sm-fld.on .sm-fld__size { display: block; }
.sm-hint { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: .88rem; line-height: 1.5; }
.sm-props { display: flex; flex-direction: column; gap: 14px; }
.sm-props:empty { display: none; }
.sm-props__kind { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: .9rem; }
.sm-props__kind .ic { width: 18px; height: 18px; color: var(--c); }
.sm-opts { min-height: 96px; resize: vertical; }

/* ---------- workflows ---------- */
.sm-wf + .sm-wf { margin-top: 26px; }
.sm-files { display: flex; flex-direction: column; gap: 8px; }
.sm-file { display: flex; align-items: center; gap: 8px; }
.sm-file .file-row { flex: 1; min-width: 0; }
.sm-files__add { align-self: flex-start; }
.sm-steps { display: flex; flex-direction: column; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.sm-steps__empty { padding: 22px; border: 1.5px dashed var(--line-2); border-radius: 16px; color: var(--muted); text-align: center; }
.sm-step { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.sm-step__head { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; }
.sm-step__head strong { flex: 1; min-width: 0; font-size: .97rem; }
.sm-step__num { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: .78rem; font-weight: 800; }
.sm-step__icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--surface-2); color: var(--primary); }
.sm-step__icon .ic { width: 18px; height: 18px; }
.sm-step__btns { display: flex; gap: 2px; }
.sm-step__btns .iconbtn { width: 34px; height: 34px; }
.sm-step__body { display: flex; flex-direction: column; gap: 10px; padding: 2px 16px 16px; }
.sm-step__body .row2 { align-items: end; }
.sm-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sm-add__btn { display: inline-flex; align-items: center; gap: 6px; }
.sm-add__btn .ic { width: 15px; height: 15px; }

@media (max-width: 600px) {
  .sm-sum__empty { margin: 16px auto; }
  .sm-sum__acts { width: 100%; }
  .sm-sum__acts .btn { flex: 1; justify-content: center; padding: 9px 8px; }
  .sm-bar { top: 66px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sm-bar::-webkit-scrollbar { display: none; }
  .sm-tool { flex: none; flex-direction: column; gap: 3px; min-width: 64px; padding: 7px 8px; font-size: .74rem; }
  .sm-tool--detect { margin-left: 0; }
  .sm-pages { margin: 0 -8px; padding: 10px; gap: 14px; }
  .sm-step__head { flex-wrap: wrap; padding: 10px 8px 8px 12px; gap: 8px; }
  .sm-step__icon { display: none; }
  .sm-step__body { padding: 2px 12px 14px; }
  .sm-row { grid-template-columns: 1fr; }
}
