/* Packlyn Design Software — styles for AI picture tools, Upload Design, Replace Template, Print With Packlyn forms,
   plan usage and other additions in this release. Uses the tokens in base.css. */

/* ---------- AI progress card ---------- */
.ai-progress { position: fixed; right: 22px; bottom: 22px; z-index: 900; width: min(340px, calc(100vw - 44px)); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(10, 25, 40, .22); padding: 14px 16px; display: grid; gap: 9px; animation: aipIn .18s ease-out; }
.ai-progress.out { opacity: 0; transform: translateY(6px); transition: opacity .18s, transform .18s; }
.aip-head { display: flex; align-items: center; gap: 9px; }
.aip-head b { flex: 1; font-size: 13.5px; }
.aip-pct { font: 700 12px var(--font-ui); color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-progress small { color: var(--muted); }
@keyframes aipIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Smart Cut-Out editor ---------- */
.co-modal .modal-body { padding-bottom: 6px; }
.co-wrap { display: grid; grid-template-columns: auto minmax(240px, 300px); gap: 20px; align-items: start; }
.co-stage { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line), 0 6px 22px rgba(10, 25, 40, .08); justify-self: center; touch-action: none; }
.co-view { display: block; cursor: none; }
.co-cursor { position: absolute; pointer-events: none; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .45); }
.co-cursor.keep { background: rgba(19, 163, 127, .18); }
.co-cursor.remove { background: rgba(208, 32, 46, .18); }
.co-side { display: grid; gap: 14px; align-content: start; }
.co-side .seg { width: 100%; }
.co-side .seg button { flex: 1; }
.co-busy { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.co-meta { border-top: 1px solid var(--line); padding-top: 10px; }
.row.wrap { flex-wrap: wrap; }
@media (max-width: 980px) { .co-wrap { grid-template-columns: 1fr; } }

/* ---------- Upload Design ---------- */
.up-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 22px; align-items: start; }
.up-preview { min-width: 0; display: grid; gap: 10px; }
.up-img { border-radius: 14px; overflow: hidden; display: grid; place-items: center; min-height: 260px; max-height: 470px; box-shadow: 0 0 0 1px var(--line); padding: 14px; }
.up-img img { max-width: 100%; max-height: 440px; object-fit: contain; box-shadow: 0 8px 26px rgba(10, 25, 40, .14); }
.checker { background-color: #f4f6f8; background-image: linear-gradient(45deg, #e3e8ec 25%, transparent 25%), linear-gradient(-45deg, #e3e8ec 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e3e8ec 75%), linear-gradient(-45deg, transparent 75%, #e3e8ec 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
:root[data-theme="dark"] .checker { background-color: #1a2a37; background-image: linear-gradient(45deg, #223545 25%, transparent 25%), linear-gradient(-45deg, #223545 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #223545 75%), linear-gradient(-45deg, transparent 75%, #223545 75%); }
.up-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; max-height: 470px; overflow: auto; padding: 4px; }
.up-page { display: grid; gap: 6px; padding: 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--panel-2); cursor: pointer; transition: border-color .14s, background .14s; }
.up-page.on { border-color: var(--teal); background: var(--teal-tint); }
.up-thumb { display: grid; place-items: center; aspect-ratio: 3 / 4; background: var(--panel); border-radius: 6px; overflow: hidden; }
.up-cv { max-width: 100%; max-height: 100%; box-shadow: 0 2px 8px rgba(10, 25, 40, .15); }
.up-pg-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; }
.up-right { display: grid; gap: 14px; min-width: 0; }
.up-file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.up-file .ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--teal-tint); color: var(--teal); }
.up-file span { display: grid; min-width: 0; }
.up-file b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-file small { color: var(--muted); }
.up-choices { display: grid; gap: 10px; }
.up-choice { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); transition: border-color .14s, box-shadow .14s; }
.up-choice.on { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-tint); }
.up-choice-head { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.up-choice-head input { margin-top: 3px; accent-color: var(--teal); }
.up-choice-head span { display: grid; }
.up-choice-head small { color: var(--muted); }
.up-sub { display: none; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.up-choice.on .up-sub { display: grid; }
.up-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--gold-tint); color: var(--ink-2); font-size: 12.5px; margin: 0; }
.up-note .ico { flex: none; width: 18px; height: 18px; color: var(--gold-dk); }
.up-sum { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.warn-txt { color: #b45309; font-weight: 700; }
:root[data-theme="dark"] .warn-txt { color: #f6b04d; }
@media (max-width: 860px) { .up-wrap { grid-template-columns: 1fr; } .up-img { min-height: 180px; } }
.up-sub > p { margin: 0; }

/* Use This Template? — compare, then choose how the template goes in */
.rt { display: grid; gap: 16px; }
.rt-compare { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 10px; padding: 14px; border-radius: 14px; background: var(--work); }
.rt-fig { margin: 0; display: grid; gap: 8px; justify-items: center; min-width: 0; }
.rt-img { width: 100%; max-height: 150px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; }
.rt-img img { max-width: 100%; max-height: 150px; display: block; box-shadow: 0 3px 12px rgba(0, 0, 0, .2); }
.rt-fig figcaption { font: 600 11.5px var(--font); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-arrow { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); color: var(--ink-2); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.rt-arrow .ico { width: 16px; height: 16px; }
.rt-opts { display: grid; gap: 8px; }
.rt-opt { display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; gap: 12px; align-items: center; text-align: left; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; transition: border-color .12s, background .12s; }
.rt-opt:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line-2)); }
.rt-opt:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sel) 28%, transparent); }
.rt-opt.on { border-color: var(--gold); background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold); }
.rt-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--ink-2); }
.rt-opt.on .rt-ic { background: var(--gold-grad); color: var(--on-gold); }
.rt-ic .ico { width: 18px; height: 18px; }
.rt-txt { display: grid; gap: 2px; min-width: 0; }
.rt-txt b { font: 600 13.5px var(--font); }
.rt-txt small { color: var(--muted); font-size: 12px; line-height: 1.45; }
.rt-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); justify-self: end; }
.rt-opt.on .rt-radio { border: 5px solid var(--gold); background: var(--panel); }
.rt-note { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12px; }
.rt-note .ico { width: 15px; height: 15px; }
.rt-modal .modal-foot .btn { min-width: 108px; justify-content: center; }
@media (max-width: 520px) { .rt-compare { grid-template-columns: 1fr; } .rt-arrow { transform: rotate(90deg); justify-self: center; } }

/* usage meters (downloads this month, cloud storage) */
.meter { display: grid; gap: 6px; min-width: 0; }
.meter-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.meter-top b { font-weight: 700; }
.meter-top span { color: var(--muted); }
.meter-bar { height: 8px; border-radius: 99px; background: var(--panel-3); overflow: hidden; }
.meter-bar i { display: block; height: 100%; border-radius: inherit; background: var(--teal); transition: width .3s; }
.meter.warn .meter-bar i { background: var(--warn); }
.meter.bad .meter-bar i { background: var(--danger); }
.meter small { font-size: 11.5px; }
.ac-usage { display: grid; gap: 14px; margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.ac-usage h3 { margin: 0; font: 600 15px var(--font); }
.cloud-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 24px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); margin-bottom: 14px; }
.cloud-usage p { grid-column: 1 / -1; margin: 0; }
.cloud-sort { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.cloud-sort label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.cloud-sort select { width: auto; min-height: 32px; padding: 4px 8px; }

/* Object Eraser */
.er-busy { position: absolute; inset: auto 12px 12px auto; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px; background: rgba(11, 21, 28, .82); color: #fff; font-size: 12.5px; font-weight: 600; }
.er-busy[hidden] { display: none; }
.er-modal .co-side .btn.gold { justify-content: center; }
/* inspector picture buttons: labels wrap instead of being cut off */
.btn-grid .btn { white-space: normal; text-align: left; line-height: 1.2; min-height: 34px; padding-top: 6px; padding-bottom: 6px; overflow: visible; }
.btn-grid .btn .ico { flex: none; }

/* Legal And Policies: the list of documents on the left, the open document on the right */
.legal-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; min-height: 460px; }
.legal-nav { display: grid; align-content: start; gap: 2px; max-height: 64vh; overflow-y: auto; padding-right: 4px; border-right: 1px solid var(--line); }
.legal-nav button { display: grid; gap: 1px; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 7px 10px; font: 600 12.5px/1.3 var(--font); color: var(--ink-2); cursor: pointer; }
.legal-nav button:hover { background: var(--hover); }
.legal-nav button.on { background: var(--gold-tint); color: var(--ink); }
.legal-nav-date { font-weight: 500; font-size: 11px; color: var(--muted); }
.legal-wrap .legal-body { min-width: 0; max-height: 64vh; overflow: auto; padding: 0 8px 8px 0; user-select: text; line-height: 1.6; font-size: 13.5px; outline: none; }
.legal-wrap .legal-body:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); border-radius: 8px; }
.legal-body h2.legal-title { margin: 0 0 6px; font-size: 21px; line-height: 1.25; text-wrap: balance; }
.legal-body h3 { margin: 18px 0 6px; font-size: 15.5px; }
.legal-body h4 { margin: 14px 0 4px; font-size: 13.5px; }
.legal-body p, .legal-body ul, .legal-body ol { max-width: 72ch; margin: 0 0 10px; }
.legal-body ul, .legal-body ol { padding-left: 22px; }
.legal-body li { margin: 3px 0; }
.legal-body .legal-meta { color: var(--muted); font-size: 12.5px; }
.legal-body .legal-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
.legal-link { color: var(--gold-dk); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.notice-item { padding: 10px 0; border-top: 1px solid var(--line); }
.legal-licence { white-space: pre-wrap; font: 11.5px/1.5 ui-monospace, monospace; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 280px; overflow: auto; margin: 4px 0 0; }
@media (max-width: 720px) { .legal-wrap { grid-template-columns: 1fr; } .legal-nav { grid-auto-flow: column; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); max-height: none; } .legal-nav button { white-space: nowrap; } }

/* About and updates */
.about-body { display: grid; gap: 12px; }
.about-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.about-facts dt { color: var(--muted); font-size: 12.5px; }
.about-facts dd { margin: 0; font-weight: 600; font-size: 13px; }
.about-body p { margin: 0; line-height: 1.5; }
.upd-notes { white-space: pre-wrap; max-height: 220px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 13px; line-height: 1.5; }

/* Print Guide */
.pg-guide { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pg-tabs { justify-self: start; }
.pg-body { max-height: 62vh; overflow-y: auto; padding-right: 6px; line-height: 1.6; font-size: 13.5px; outline: none; }
.pg-body:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); border-radius: 8px; }
.pg-body > p, .pg-sec p, .pg-sec ul { max-width: 72ch; margin: 0 0 8px; }
.pg-sec { padding: 10px 0 4px; border-top: 1px solid var(--line); }
.pg-sec:first-of-type { border-top: 0; }
.pg-sec h3, .pg-products h3 { margin: 4px 0 6px; font-size: 14.5px; }
.pg-sec ul { padding-left: 20px; }
.pg-products { display: grid; gap: 6px; margin-top: 10px; }
.pg-products h3 { margin-top: 10px; }
.pg-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pg-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pg-table th, .pg-table td { text-align: left; padding: 7px 10px; vertical-align: top; border-top: 1px solid var(--line); }
.pg-table thead th { border-top: 0; background: var(--panel-2); color: var(--muted); font-weight: 700; white-space: nowrap; }
.pg-table tbody th { font-weight: 600; min-width: 150px; }
.pg-table tbody th small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.pg-table td:nth-child(3), .pg-table td:nth-child(4) { white-space: nowrap; }
.pg-check { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.pg-check li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; }
.pg-check .ico { width: 16px; height: 16px; color: var(--teal); margin-top: 3px; }
