/* Local-only Persian font stack: no external font request is made. */
@font-face {
  font-family: "PSM Vazir";
  src: local("Vazirmatn Variable"), local("Vazirmatn"), local("Vazir Variable"), local("Vazir");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

.psm-app,
.psm-settings-wrap,
.psm-admin-wrap {
  --psm-font: "PSM Vazir", "Vazirmatn", "Vazir", Tahoma, Arial, sans-serif;
  --psm-primary: #e31b23;
  --psm-primary-hover: #b9151b;
  --psm-primary-soft: #fff1f2;
  --psm-primary-border: #ffd8db;
  --psm-ink: #151b2d;
  --psm-muted: #667085;
  --psm-subtle: #98a2b3;
  --psm-border: #e3e7ef;
  --psm-border-strong: #d1d7e2;
  --psm-surface: #ffffff;
  --psm-canvas: #f5f7fb;
  --psm-success: #087a55;
  --psm-danger: #b42318;
  --psm-warning: #b54708;
  --psm-shadow: 0 26px 80px rgba(22, 34, 66, .12);
  color: var(--psm-ink);
  font-family: var(--psm-font);
  font-size: 14px;
  line-height: 1.75;
  box-sizing: border-box;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.psm-app *, .psm-app *::before, .psm-app *::after,
.psm-settings-wrap *, .psm-settings-wrap *::before, .psm-settings-wrap *::after,
.psm-admin-wrap *, .psm-admin-wrap *::before, .psm-admin-wrap *::after { box-sizing: border-box; }

.psm-app button,
.psm-app input,
.psm-app select,
.psm-app output,
.psm-settings-wrap button,
.psm-settings-wrap input,
.psm-settings-wrap select { font-family: var(--psm-font); }

.psm-admin-wrap { max-width: 1460px; }
.psm-admin-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 22px 0 18px; }
.psm-admin-heading h1 { margin: 0 0 5px; color: #151b2d; font-family: var(--psm-font); font-size: 25px; font-weight: 850; letter-spacing: -.35px; }
.psm-admin-heading p { max-width: 720px; margin: 0; color: var(--psm-muted); }
.psm-admin-heading code { direction: ltr; padding: 8px 12px; color: #b9151b; background: #fff1f2; border: 1px solid #ffd8db; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.psm-shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  overflow: hidden;
  background: var(--psm-surface);
  border: 1px solid rgba(208, 215, 229, .9);
  border-radius: 26px;
  box-shadow: var(--psm-shadow);
}

.psm-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 104px;
  padding: 23px 28px;
  overflow: hidden;
  background: linear-gradient(118deg, #f9faff 0%, #f1f5ff 56%, #fafcff 100%);
  border-bottom: 1px solid var(--psm-border);
}
.psm-hero::before { position: absolute; top: -110px; left: -50px; width: 260px; height: 260px; background: radial-gradient(circle, rgba(80,112,229,.17), transparent 68%); content: ""; pointer-events: none; }
.psm-hero-icon { position: relative; display: grid; width: 56px; height: 56px; flex: 0 0 56px; place-items: center; color: #fff; background: linear-gradient(145deg, #4f6fe3, #2949be); border: 1px solid rgba(255,255,255,.45); border-radius: 17px; box-shadow: 0 12px 28px rgba(227,27,35,.27), inset 0 1px rgba(255,255,255,.28); }
.psm-hero-icon .dashicons { width: 29px; height: 29px; font-size: 29px; }
.psm-hero h2 { margin: 0 0 4px; color: #131a2c; font-family: var(--psm-font); font-size: clamp(21px, 2vw, 28px); font-weight: 900; line-height: 1.35; letter-spacing: -.45px; }
.psm-hero p { max-width: 720px; margin: 0; color: #667085; font-size: 13px; }
.psm-local-badge { position: relative; display: inline-flex; min-height: 36px; align-items: center; gap: 7px; margin-right: auto; padding: 7px 12px; white-space: nowrap; color: #067647; background: rgba(236,253,243,.9); border: 1px solid #a9e4c5; border-radius: 999px; font-size: 11px; font-weight: 800; box-shadow: 0 5px 15px rgba(5,96,58,.06); }
.psm-local-badge .dashicons { width: 16px; height: 16px; font-size: 16px; }

.psm-grid { display: grid; grid-template-columns: minmax(0, 1.48fr) minmax(360px, .72fr); align-items: stretch; min-height: 640px; }
.psm-main-panel { min-width: 0; padding: 30px; background: #fff; }
.psm-preview-panel { min-width: 0; padding: 25px; background: linear-gradient(180deg, #f7f8fc, #f2f5fa); border-right: 1px solid var(--psm-border); }

.psm-dropzone { position: relative; display: flex; min-height: 190px; flex-direction: column; align-items: center; justify-content: center; padding: 30px 22px; overflow: hidden; text-align: center; cursor: pointer; background: linear-gradient(180deg, #fbfcff, #fffafa); border: 1.5px dashed #abbbe8; border-radius: 20px; outline: 0; transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.psm-dropzone::before { position: absolute; inset: 0; background: linear-gradient(120deg, transparent 20%, rgba(255,255,255,.72) 47%, transparent 74%); content: ""; opacity: 0; pointer-events: none; transform: translateX(-100%); }
.psm-dropzone::after { position: absolute; right: 20%; bottom: -65px; width: 60%; height: 100px; background: radial-gradient(ellipse, rgba(227,27,35,.10), transparent 68%); content: ""; pointer-events: none; }
.psm-dropzone:hover, .psm-dropzone:focus-visible { background: #f4f6ff; border-color: #8799de; box-shadow: 0 12px 30px rgba(227,27,35,.10), inset 0 0 0 1px rgba(227,27,35,.06); outline: none; transform: translateY(-1px); }
.psm-dropzone.is-dragging { color: #1839a5; background: linear-gradient(145deg, #e9efff, #f5f7ff); border-color: var(--psm-primary); border-style: solid; box-shadow: 0 18px 48px rgba(227,27,35,.20), inset 0 0 0 3px rgba(227,27,35,.10); transform: scale(1.012); }
.psm-dropzone.is-dragging .psm-upload-icon { color: #fff; background: linear-gradient(145deg, #5575e5, #2d4cc2); border-color: transparent; box-shadow: 0 12px 28px rgba(227,27,35,.28); transform: translateY(-3px) scale(1.06); }
.psm-dropzone.is-receiving { cursor: progress; background: #f5f7ff; border-color: #8195dc; transform: none; }
.psm-dropzone.is-receiving::before { opacity: 1; animation: psm-receiving-shimmer 1.45s linear infinite; }
.psm-file-input { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; }
.psm-upload-icon { position: relative; z-index: 1; display: grid; width: 56px; height: 56px; margin-bottom: 13px; place-items: center; color: var(--psm-primary); background: #fff1f2; border: 1px solid #d6defc; border-radius: 17px; font-size: 28px; line-height: 56px; transition: .2s ease; }
.psm-dropzone-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.psm-dropzone strong { margin-bottom: 5px; color: #20283c; font-size: 16px; font-weight: 850; }
.psm-dropzone small { color: var(--psm-muted); font-size: 11px; }
.psm-dropzone-state { position: relative; z-index: 1; display: inline-flex; min-height: 26px; align-items: center; margin-top: 13px; padding: 4px 10px; color: #536077; background: rgba(255,255,255,.72); border: 1px solid #e0e5ef; border-radius: 999px; font-size: 10px; font-weight: 750; }
.psm-dropzone.is-dragging .psm-dropzone-state { color: #b9151b; background: #fff; border-color: #c9d4fb; }

.psm-file-queue { margin-top: 16px; overflow: hidden; background: #fff; border: 1px solid var(--psm-border); border-radius: 18px; box-shadow: 0 8px 24px rgba(21,31,58,.05); }
.psm-file-queue[hidden] { display: none; }
.psm-file-queue-head, .psm-file-queue-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 15px; background: #f8faff; }
.psm-file-queue-head { border-bottom: 1px solid #e7eaf1; }
.psm-file-queue-foot { border-top: 1px solid #e7eaf1; }
.psm-file-queue-head > div:first-child { display: flex; min-width: 0; align-items: baseline; gap: 8px; }
.psm-file-queue-head strong { color: #20283c; font-size: 12px; font-weight: 850; }
.psm-file-count, .psm-selected-summary { color: var(--psm-muted); font-size: 10.5px; }
.psm-file-queue-actions { display: flex; align-items: center; gap: 12px; }
.psm-select-all { display: inline-flex; align-items: center; gap: 7px; color: #475467; cursor: pointer; font-size: 10.5px; font-weight: 750; }
.psm-select-all input, .psm-file-select-control input { width: 17px; height: 17px; margin: 0; accent-color: var(--psm-primary); }
.psm-file-list { display: flex; max-height: 330px; flex-direction: column; gap: 8px; overflow: auto; padding: 10px; scrollbar-width: thin; }
.psm-file-row { position: relative; display: grid; grid-template-columns: 28px minmax(0,1fr) 38px; align-items: center; gap: 8px; min-height: 70px; overflow: hidden; background: #fff; border: 1px solid #e2e6ef; border-radius: 14px; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.psm-file-row:hover { border-color: #bcc8ed; box-shadow: 0 7px 18px rgba(227,27,35,.07); }
.psm-file-row.is-active { background: linear-gradient(105deg, #f6f8ff, #fff); border-color: #8195df; box-shadow: inset -3px 0 #e31b23, 0 8px 20px rgba(227,27,35,.09); }
.psm-file-row.is-error { background: #fff8f7; border-color: #f2b8b3; }
.psm-file-row.is-reading { background: linear-gradient(100deg, #fafbff, #fff7f7); }
.psm-file-select-control { display: grid; height: 100%; place-items: center; cursor: pointer; }
.psm-file-open { display: flex; min-width: 0; align-items: center; gap: 12px; padding: 9px 0; text-align: right; cursor: pointer; background: transparent; border: 0; outline: none; }
.psm-file-open:focus-visible { border-radius: 10px; box-shadow: 0 0 0 3px rgba(227,27,35,.18); }
.psm-file-open:disabled { cursor: default; opacity: .92; }
.psm-file-type { display: grid; width: 45px; height: 45px; flex: 0 0 45px; place-items: center; color: #fff; background: linear-gradient(145deg, #e64f45, #be302a); border-radius: 12px; font-family: Arial, sans-serif; font-size: 10px; font-weight: 900; box-shadow: 0 7px 16px rgba(190,48,42,.17); }
.psm-file-meta { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; }
.psm-file-name { overflow: hidden; color: #20283c; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 850; }
.psm-file-detail { overflow: hidden; color: var(--psm-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.psm-file-row.is-error .psm-file-detail { color: #b42318; }
.psm-icon-button { display: grid; width: 36px; height: 36px; padding: 0; place-items: center; color: #667085; cursor: pointer; background: #fff; border: 1px solid var(--psm-border); border-radius: 10px; transition: .18s ease; }
.psm-icon-button:hover:not(:disabled) { color: var(--psm-danger); background: #fff5f4; border-color: #f4b4af; }
.psm-icon-button:disabled { cursor: not-allowed; opacity: .45; }
.psm-file-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; overflow: hidden; background: #e8ecf6; }
.psm-file-progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #e31b23, #6d8df2); transition: width .12s linear; }
.psm-text-button:disabled { cursor: not-allowed; opacity: .45; }

@keyframes psm-receiving-shimmer { to { transform: translateX(100%); } }

.psm-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; margin-top: 24px; }
.psm-field { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.psm-field-wide { grid-column: 1 / -1; }
.psm-field > label, .psm-range-field > span { color: #344054; font-size: 12px; font-weight: 800; }
.psm-field small, .psm-quality-note { color: var(--psm-muted); font-size: 10.5px; line-height: 1.7; }
.psm-field select, .psm-field input[type="text"] { width: 100%; min-height: 46px; margin: 0; padding: 8px 13px; color: #20283c; background: #fff; border: 1px solid var(--psm-border-strong); border-radius: 12px; box-shadow: 0 1px 2px rgba(16,24,40,.02); font: inherit; transition: .18s ease; }
.psm-field select:hover, .psm-field input[type="text"]:hover { border-color: #aeb8ca; }
.psm-field select:focus, .psm-field input[type="text"]:focus { border-color: var(--psm-primary); box-shadow: 0 0 0 4px rgba(227,27,35,.11); outline: none; }

.psm-segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 5px; background: #f1f3f7; border: 1px solid #e7eaf0; border-radius: 13px; }
.psm-segmented label { position: relative; cursor: pointer; }
.psm-segmented input { position: absolute; opacity: 0; pointer-events: none; }
.psm-segmented span { display: block; padding: 10px 7px; text-align: center; color: #596174; border: 1px solid transparent; border-radius: 9px; font-size: 11px; font-weight: 800; transition: .18s ease; }
.psm-segmented input:checked + span { color: #2849bc; background: #fff; border-color: #d9e0fa; box-shadow: 0 4px 12px rgba(29,45,83,.08); }
.psm-segmented input:focus-visible + span { outline: 3px solid rgba(227,27,35,.18); }

.psm-output-formats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.psm-format-card { position: relative; display: flex; min-height: 82px; align-items: center; gap: 10px; padding: 12px; overflow: hidden; cursor: pointer; background: #fff; border: 1px solid var(--psm-border); border-radius: 14px; transition: .2s ease; }
.psm-format-card:hover { border-color: #aebcf0; box-shadow: 0 8px 22px rgba(227,27,35,.08); transform: translateY(-1px); }
.psm-format-card input { position: absolute; opacity: 0; pointer-events: none; }
.psm-format-card:has(input:checked) { background: linear-gradient(145deg, #fffafa, #fff1f2); border-color: #8499e9; box-shadow: inset 0 0 0 1px rgba(227,27,35,.12), 0 8px 20px rgba(227,27,35,.09); }
.psm-format-icon { display: grid; width: 43px; height: 43px; flex: 0 0 43px; place-items: center; color: #fff; border-radius: 11px; font-family: Arial, sans-serif; font-size: 10px; font-weight: 900; letter-spacing: -.2px; }
.psm-format-pdf { background: linear-gradient(145deg, #eb5a50, #c8322a); }
.psm-format-jpeg { background: linear-gradient(145deg, #526fe0, #304ebd); }
.psm-format-png { background: linear-gradient(145deg, #19a47a, #087a55); }
.psm-format-docx { background: linear-gradient(145deg, #2878d7, #174ea6); font-size: 8px; }
.psm-format-copy { display: flex; min-width: 0; flex-direction: column; }
.psm-format-copy strong { color: #293145; font-size: 11.5px; font-weight: 850; }
.psm-format-copy small { color: #7a8498; font-size: 9.5px; line-height: 1.55; }
.psm-format-check { position: absolute; top: 7px; left: 7px; width: 16px; height: 16px; color: var(--psm-primary); opacity: 0; font-size: 16px; transform: scale(.65); transition: .18s ease; }
.psm-format-card:has(input:checked) .psm-format-check { opacity: 1; transform: scale(1); }
.psm-format-card:has(input:disabled) { cursor: not-allowed; opacity: .62; }
.psm-format-card:focus-within { outline: 3px solid rgba(227,27,35,.14); outline-offset: 1px; }

.psm-advanced { margin-top: 21px; overflow: hidden; background: #fbfcfe; border: 1px solid var(--psm-border); border-radius: 16px; }
.psm-advanced summary { position: relative; padding: 15px 17px; color: #344054; cursor: pointer; list-style: none; font-size: 12px; font-weight: 850; }
.psm-advanced summary::-webkit-details-marker { display: none; }
.psm-advanced summary::after { float: left; color: var(--psm-primary); content: "+"; font-size: 20px; font-weight: 400; line-height: 1; transition: transform .2s ease; }
.psm-advanced[open] summary::after { transform: rotate(45deg); }
.psm-advanced[open] summary { background: #fff; border-bottom: 1px solid var(--psm-border); }
.psm-advanced-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 19px 23px; padding: 19px; }
.psm-range-field { display: flex; min-width: 0; flex-direction: column; gap: 8px; }
.psm-range-field span { display: flex; justify-content: space-between; gap: 10px; }
.psm-range-field output { color: var(--psm-primary); direction: ltr; font-weight: 850; }
.psm-range-field input[type="range"] { width: 100%; height: 4px; margin: 7px 0; accent-color: var(--psm-primary); cursor: pointer; }
.psm-range-field.is-disabled { opacity: .48; }
.psm-range-field.is-disabled input { cursor: not-allowed; }

.psm-artifact-control { padding: 16px; background: linear-gradient(145deg,#fafbff,#f3f6ff); border: 1px solid #d9e1fb; border-radius: 14px; }
.psm-artifact-head { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding-bottom: 13px; border-bottom: 1px solid #e3e8f4; }
.psm-artifact-head small { max-width: 390px; color: var(--psm-muted); font-size: 10.5px; line-height: 1.7; }
.psm-reroll-lines { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; gap: 5px; padding: 5px 10px; white-space: nowrap; color: #344054; cursor: pointer; background: #fff; border: 1px solid var(--psm-border-strong); border-radius: 9px; font: inherit; font-size: 10.5px; font-weight: 800; transition: .18s ease; }
.psm-reroll-lines:hover:not(:disabled) { color: var(--psm-primary); border-color: #9aacdf; }
.psm-reroll-lines:disabled { cursor: not-allowed; opacity: .45; }
.psm-reroll-lines .dashicons { width: 14px; height: 14px; font-size: 14px; }
.psm-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.psm-switch input { position: absolute; opacity: 0; }
.psm-switch-track { position: relative; width: 40px; height: 23px; flex: 0 0 40px; background: #b9c0ce; border-radius: 999px; transition: .2s ease; }
.psm-switch-track::after { position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; background: #fff; border-radius: 50%; box-shadow: 0 2px 5px rgba(16,24,40,.25); content: ""; transition: .2s ease; }
.psm-switch input:checked + .psm-switch-track { background: var(--psm-primary); }
.psm-switch input:checked + .psm-switch-track::after { transform: translateX(-17px); }
.psm-switch input:focus-visible + .psm-switch-track { outline: 3px solid rgba(227,27,35,.18); }
.psm-switch-label { color: #283146; font-size: 12px; font-weight: 850; }
.psm-artifact-options { display: grid; grid-template-columns: minmax(170px,.7fr) minmax(230px,1.3fr); gap: 19px; align-items: end; padding-top: 14px; transition: opacity .18s ease; }
.psm-artifact-options.is-disabled { opacity: .45; }
.psm-artifact-select { display: flex; flex-direction: column; gap: 7px; }
.psm-artifact-select > span { color: #344054; font-size: 11px; font-weight: 800; }
.psm-artifact-select select { width: 100%; min-height: 42px; margin: 0; padding: 7px 10px; color: #293145; background: #fff; border: 1px solid var(--psm-border-strong); border-radius: 10px; font: inherit; }

.psm-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.psm-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 9px 17px; text-decoration: none !important; cursor: pointer; border: 1px solid transparent; border-radius: 12px; font: inherit; font-size: 12px; font-weight: 850; transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease; }
.psm-button:hover:not(:disabled) { transform: translateY(-1px); }
.psm-button:disabled { cursor: not-allowed; opacity: .48; }
.psm-button-primary { color: #fff !important; background: linear-gradient(135deg,#3d61df,#2849bd); border-color: #2949be; box-shadow: 0 10px 23px rgba(227,27,35,.23); }
.psm-button-primary:hover:not(:disabled) { background: linear-gradient(135deg,#3459d5,#203fac); box-shadow: 0 13px 27px rgba(227,27,35,.28); }
.psm-button-secondary { color: #344054; background: #fff; border-color: var(--psm-border-strong); box-shadow: 0 3px 9px rgba(16,24,40,.04); }
.psm-button-secondary:hover:not(:disabled) { border-color: #aab5c7; box-shadow: 0 7px 15px rgba(16,24,40,.07); }
.psm-button-danger { color: var(--psm-danger); background: #fff5f4; border-color: #f0b9b4; }
.psm-button .dashicons { width: 17px; height: 17px; font-size: 17px; }

.psm-status { margin-top: 17px; padding: 14px; background: #f6f8ff; border: 1px solid #d8e0fb; border-radius: 13px; }
.psm-status[hidden] { display: none; }
.psm-status-row { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: #3a4358; font-size: 11px; }
.psm-status-percent { color: var(--psm-primary); direction: ltr; font-weight: 850; }
.psm-progress { height: 7px; overflow: hidden; background: #e1e6f3; border-radius: 999px; }
.psm-progress > span { display: block; width: 0; height: 100%; background: linear-gradient(90deg,#6d89ec,#e31b23); border-radius: inherit; transition: width .25s ease; }
.psm-app.is-busy .psm-progress > span { background-size: 24px 24px; animation: psm-progress-pulse 1.2s linear infinite; }
@keyframes psm-progress-pulse { 50% { filter: brightness(1.13); } }
.psm-message { margin-top: 14px; padding: 11px 13px; border-radius: 11px; font-size: 11px; line-height: 1.8; }
.psm-message[hidden] { display: none; }
.psm-message.is-error { color: #912018; background: #fff2f1; border: 1px solid #f4c4c0; }
.psm-message.is-info { color: #26469f; background: #fff5f5; border: 1px solid #ccd8ff; }
.psm-message.is-success { color: #05603a; background: #ecfdf3; border: 1px solid #abe4c5; }

.psm-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.psm-preview-head > div { min-width: 0; }
.psm-preview-head h3 { margin: 0 0 3px; color: #293145; font-family: var(--psm-font); font-size: 14px; font-weight: 850; }
.psm-preview-file-name { display: block; max-width: 280px; overflow: hidden; color: #566176; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 700; }
.psm-preview-label { flex: 0 0 auto; color: var(--psm-muted); font-size: 10px; }
.psm-preview-stage { display: grid; min-height: 500px; place-items: center; overflow: auto; padding: 22px; background-color: #e9edf4; background-image: linear-gradient(45deg,rgba(255,255,255,.65) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.65) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.65) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.65) 75%); background-position: 0 0,0 10px,10px -10px,-10px 0; background-size: 20px 20px; border: 1px solid #d7dce6; border-radius: 17px; box-shadow: inset 0 1px 4px rgba(16,24,40,.04); }
.psm-preview-placeholder { max-width: 230px; text-align: center; color: #8c95a7; }
.psm-preview-placeholder .dashicons { width: 55px; height: 55px; color: #a5aebe; font-size: 55px; }
.psm-preview-placeholder p { margin: 12px 0 0; font-size: 11px; line-height: 1.9; }
.psm-preview-canvas { display: block; max-width: 100%; height: auto; background: #fff; border: 1px solid rgba(16,24,40,.09); box-shadow: 0 18px 42px rgba(15,23,42,.22); }
.psm-preview-canvas[hidden] { display: none; }

.psm-result { padding: 42px 10px 28px; text-align: center; }
.psm-result[hidden] { display: none; }
.psm-success-icon { display: grid; width: 64px; height: 64px; margin: 0 auto 12px; place-items: center; color: #067647; background: linear-gradient(145deg,#e2fbee,#c9f3de); border: 1px solid #aae3c5; border-radius: 20px; box-shadow: 0 10px 24px rgba(6,118,71,.12); }
.psm-success-icon .dashicons { width: 34px; height: 34px; font-size: 34px; }
.psm-result-format { display: inline-flex; margin-bottom: 10px; padding: 4px 9px; color: #e31b23; background: #fff1f2; border: 1px solid #d5defc; border-radius: 999px; direction: ltr; font-family: Arial,sans-serif; font-size: 9px; font-weight: 900; }
.psm-result h3 { margin: 0 0 7px; color: #20283c; font-family: var(--psm-font); font-size: 20px; font-weight: 900; }
.psm-result-meta { margin: 0 0 18px; color: var(--psm-muted); font-size: 10.5px; line-height: 1.9; }
.psm-result .psm-download { width: 100%; }
.psm-text-button { margin-top: 12px; padding: 4px 8px; color: var(--psm-primary); cursor: pointer; background: transparent; border: 0; font: inherit; font-size: 11px; font-weight: 800; }
.psm-text-button:hover { color: var(--psm-primary-hover); text-decoration: underline; }

.psm-privacy-note { display: flex; align-items: flex-start; gap: 9px; padding: 14px 28px; color: #596174; background: #fbfcfe; border-top: 1px solid var(--psm-border); font-size: 10.5px; line-height: 1.8; }
.psm-privacy-note .dashicons { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 3px; color: var(--psm-success); font-size: 17px; }

.psm-settings-wrap { max-width: 1260px; font-family: var(--psm-font); }
.psm-settings-wrap > h1 { font-family: var(--psm-font); font-weight: 850; }
.psm-settings-grid { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(300px,.6fr); gap: 20px; align-items: start; }
.psm-settings-card { padding: 23px; background: #fff; border: 1px solid #dfe3eb; border-radius: 17px; box-shadow: 0 12px 36px rgba(15,23,42,.06); }
.psm-settings-card h2 { margin-top: 0; font-family: var(--psm-font); font-weight: 850; }
.psm-settings-card .form-table th { width: 210px; font-family: var(--psm-font); font-weight: 800; }
.psm-settings-card input, .psm-settings-card select { font-family: var(--psm-font); }
.psm-system-card ul { margin: 0 0 18px; }
.psm-system-card li { padding: 10px 0; border-bottom: 1px solid #eef0f3; }
.psm-disabled { padding: 14px; text-align: center; background: #fff8e6; border: 1px solid #f3cf72; border-radius: 11px; }

@media (max-width: 1100px) {
  .psm-grid { grid-template-columns: minmax(0,1.25fr) minmax(330px,.75fr); }
  .psm-output-formats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .psm-format-card { min-height: 68px; }
}

@media (max-width: 900px) {
  .psm-grid { grid-template-columns: 1fr; }
  .psm-preview-panel { border-top: 1px solid var(--psm-border); border-right: 0; }
  .psm-preview-stage { min-height: 360px; }
  .psm-output-formats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .psm-settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .psm-app { font-size: 13px; }
  .psm-shell { border-radius: 18px; box-shadow: 0 14px 40px rgba(22,34,66,.10); }
  .psm-hero { align-items: flex-start; padding: 18px; }
  .psm-hero-icon { width: 45px; height: 45px; flex-basis: 45px; border-radius: 13px; }
  .psm-hero-icon .dashicons { width: 24px; height: 24px; font-size: 24px; }
  .psm-hero h2 { font-size: 19px; }
  .psm-hero p { font-size: 11px; line-height: 1.7; }
  .psm-local-badge { display: none; }
  .psm-main-panel, .psm-preview-panel { padding: 17px; }
  .psm-dropzone { min-height: 168px; padding: 22px 14px; border-radius: 16px; }
  .psm-file-queue-head, .psm-file-queue-foot { align-items: flex-start; flex-direction: column; }
  .psm-file-queue-actions { width: 100%; justify-content: space-between; }
  .psm-file-list { max-height: 390px; padding: 8px; }
  .psm-file-row { grid-template-columns: 25px minmax(0,1fr) 34px; gap: 5px; }
  .psm-file-type { width: 39px; height: 39px; flex-basis: 39px; }
  .psm-file-open { gap: 9px; }
  .psm-preview-file-name { max-width: 180px; }
  .psm-upload-icon { width: 49px; height: 49px; line-height: 49px; }
  .psm-settings { grid-template-columns: 1fr; gap: 15px; }
  .psm-field-wide { grid-column: auto; }
  .psm-segmented { grid-template-columns: repeat(2,1fr); }
  .psm-output-formats { grid-template-columns: 1fr; }
  .psm-format-card { min-height: 66px; }
  .psm-advanced-grid { grid-template-columns: 1fr; padding: 15px; }
  .psm-artifact-head { align-items: flex-start; flex-direction: column; }
  .psm-artifact-options { grid-template-columns: 1fr; }
  .psm-actions { display: grid; grid-template-columns: 1fr; }
  .psm-button { width: 100%; }
  .psm-preview-stage { min-height: 300px; padding: 13px; }
  .psm-privacy-note { padding: 13px 17px; }
  .psm-admin-heading { align-items: flex-start; flex-direction: column; }
  .psm-settings-card { padding: 16px; }
  .psm-settings-card .form-table th, .psm-settings-card .form-table td { display: block; width: 100%; padding-right: 0; padding-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .psm-app *, .psm-app *::before, .psm-app *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* API documentation */
.psm-settings-section-row th{padding-top:28px!important;border-top:1px solid #e2e8f0}.psm-settings-section-row h3{margin:0 0 6px;font-size:17px;color:#0f172a}
.psm-api-docs{--psm-doc-primary:#e31b23;--psm-doc-ink:#0f172a;--psm-doc-muted:#64748b;--psm-doc-line:#e2e8f0;--psm-doc-soft:#f8fafc;max-width:1440px;margin:20px 20px 40px 0;color:var(--psm-doc-ink);font-family:Vazirmatn,IRANSansX,IRANSans,Shabnam,Tahoma,Arial,sans-serif}
.psm-docs-hero{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:34px 38px;border-radius:22px;background:linear-gradient(135deg,#0f172a,#172554 58%,#b9151b);color:#fff;box-shadow:0 20px 45px rgba(15,23,42,.16)}
.psm-docs-hero h1{margin:5px 0 10px;color:#fff;font-size:34px;line-height:1.25}.psm-docs-hero p{margin:0;max-width:720px;color:#dbeafe;font-size:15px}.psm-docs-kicker{display:inline-flex;padding:5px 10px;border:1px solid rgba(255,255,255,.24);border-radius:999px;background:rgba(255,255,255,.08);font-size:12px;letter-spacing:.03em}.psm-docs-version{display:grid;place-items:center;min-width:112px;min-height:112px;border:1px solid rgba(255,255,255,.22);border-radius:22px;background:rgba(255,255,255,.09);font-size:28px;font-weight:800}.psm-docs-version small{display:block;font-size:11px;font-weight:500;color:#bfdbfe}
.psm-api-key-once{margin-top:18px;padding:18px 20px;border:1px solid #86efac;border-radius:16px;background:#f0fdf4;color:#14532d}.psm-api-key-once>strong{display:block;margin-bottom:10px}.psm-api-key-once p{margin:8px 0 0}.psm-copy-row{display:flex;gap:10px;align-items:center}.psm-copy-row code{direction:ltr;flex:1;overflow:auto;padding:12px;border:1px dashed #22c55e;border-radius:10px;background:#fff;color:#14532d;text-align:left}
.psm-docs-layout{display:grid;grid-template-columns:245px minmax(0,1fr);gap:22px;margin-top:22px}.psm-docs-nav{position:sticky;top:42px;align-self:start;display:flex;flex-direction:column;padding:18px;border:1px solid var(--psm-doc-line);border-radius:18px;background:#fff;box-shadow:0 8px 26px rgba(15,23,42,.05)}.psm-docs-nav strong{padding:4px 10px 12px;font-size:14px}.psm-docs-nav a{padding:9px 10px;border-radius:9px;color:#334155;text-decoration:none;font-size:13px}.psm-docs-nav a:hover{background:#fff1f2;color:#b9151b}
.psm-docs-content{min-width:0}.psm-doc-section{scroll-margin-top:42px;margin-bottom:18px;padding:28px 30px;border:1px solid var(--psm-doc-line);border-radius:20px;background:#fff;box-shadow:0 8px 28px rgba(15,23,42,.045)}.psm-doc-title{display:flex;gap:14px;align-items:flex-start;margin-bottom:22px}.psm-doc-title>span{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#fff1f2;color:#b9151b;font-size:12px;font-weight:800}.psm-doc-title h2{margin:0 0 5px;font-size:22px;color:#0f172a}.psm-doc-title p{margin:0;color:var(--psm-doc-muted)}.psm-doc-section h3{margin:24px 0 10px;font-size:16px;color:#1e293b}.psm-doc-section p{line-height:1.9}
.psm-endpoint-box,.psm-endpoint-row{display:flex;align-items:center;gap:10px;padding:13px 14px;border:1px solid var(--psm-doc-line);border-radius:12px;background:var(--psm-doc-soft);direction:ltr;text-align:left}.psm-endpoint-box span{direction:inherit;color:#475569;font-weight:700}.psm-endpoint-box code,.psm-endpoint-row code{flex:1;overflow:auto;background:transparent;color:#0f172a;white-space:nowrap}.psm-copy-button{border:0;border-radius:8px;background:#e2e8f0;color:#334155;padding:7px 11px;cursor:pointer;font-family:inherit}.psm-copy-button:hover{background:#cbd5e1}.psm-copy-button.is-copied{background:#dcfce7;color:#166534}
.psm-http-method{display:inline-flex;align-items:center;justify-content:center;min-width:54px;padding:5px 9px;border-radius:7px;font-weight:800;font-size:12px}.psm-http-method.get{background:#dcfce7;color:#166534}.psm-http-method.post{background:#dbeafe;color:#b9151b}
.psm-doc-section pre{position:relative;overflow:auto;margin:12px 0 18px;padding:19px 18px;border:1px solid #1e293b;border-radius:14px;background:#0f172a;color:#e2e8f0;direction:ltr;text-align:left;line-height:1.75}.psm-doc-section pre code{display:block;padding-left:68px;background:transparent;color:inherit;white-space:pre}.psm-doc-section pre .psm-copy-button{position:absolute;top:10px;left:10px;background:#334155;color:#e2e8f0}.psm-doc-section pre .psm-copy-button:hover{background:#475569}
.psm-callout{margin:18px 0 0;padding:16px 18px;border-radius:12px;border-right:4px solid}.psm-callout strong{display:block;margin-bottom:5px}.psm-callout p{margin:0}.psm-callout-info{border-color:#3b82f6;background:#fff1f2;color:#1e3a8a}.psm-callout-warning{border-color:#f59e0b;background:#fffbeb;color:#78350f}
.psm-api-status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}.psm-api-status-grid>div{padding:15px;border:1px solid var(--psm-doc-line);border-radius:13px;background:var(--psm-doc-soft)}.psm-api-status-grid span{display:block;margin-bottom:8px;color:#64748b;font-size:12px}.psm-api-status-grid strong{font-size:14px}.psm-api-status-grid .is-ready{color:#15803d}.psm-api-status-grid .is-error{color:#b91c1c}.psm-api-status-grid .is-off{color:#b45309}
.psm-key-manager{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-top:20px;padding:18px;border:1px solid #bfdbfe;border-radius:14px;background:#fff1f2}.psm-key-manager p{margin:5px 0 0}.psm-key-actions{display:flex;gap:8px;flex-wrap:wrap}.psm-key-actions form{margin:0}
.psm-table-scroll{overflow:auto}.psm-api-table{width:100%;border-collapse:separate;border-spacing:0;margin:14px 0;border:1px solid var(--psm-doc-line);border-radius:13px;overflow:hidden}.psm-api-table th,.psm-api-table td{padding:12px 13px;border-bottom:1px solid var(--psm-doc-line);text-align:right;vertical-align:top}.psm-api-table th{background:#f8fafc;color:#334155;font-size:12px}.psm-api-table tr:last-child td{border-bottom:0}.psm-api-table code{direction:ltr;display:inline-block}.psm-doc-list{margin:0;padding:0 22px 0 0}.psm-doc-list li{margin:10px 0;line-height:1.85}
@media(max-width:1100px){.psm-docs-layout{grid-template-columns:1fr}.psm-docs-nav{position:static;display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.psm-docs-nav strong{grid-column:1/-1}.psm-api-status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:782px){.psm-api-docs{margin:10px 0 30px}.psm-docs-hero{padding:25px 20px;border-radius:16px}.psm-docs-hero h1{font-size:27px}.psm-docs-version{display:none}.psm-docs-nav{grid-template-columns:repeat(2,minmax(0,1fr));padding:12px}.psm-doc-section{padding:21px 17px;border-radius:15px}.psm-doc-title h2{font-size:19px}.psm-api-status-grid{grid-template-columns:1fr 1fr}.psm-key-manager{align-items:flex-start;flex-direction:column}.psm-endpoint-box{align-items:stretch;flex-wrap:wrap}.psm-endpoint-box code{width:100%;flex-basis:100%}.psm-doc-section pre{font-size:11px}.psm-doc-section pre code{padding-left:0;padding-top:32px}}
@media(max-width:520px){.psm-docs-nav{grid-template-columns:1fr}.psm-api-status-grid{grid-template-columns:1fr}.psm-copy-row{align-items:stretch;flex-direction:column}.psm-doc-title>span{display:none}}

/* 1.3 admin alignment overrides */
.psm-admin-wrap,.psm-settings-wrap{max-width:1500px;margin-right:0}
.psm-settings-wrap{margin-top:0}

/* 2.3.0 — resilient multi-file workspace */
.psm-file-row.is-processing { background: linear-gradient(105deg, #f5f8ff, #fff); border-color: #7890e5; box-shadow: inset -3px 0 #e31b23, 0 8px 22px rgba(227,27,35,.10); }
.psm-file-row.is-processing .psm-file-progress > span { background: linear-gradient(90deg, #e31b23, #8da4f4); }
.psm-file-row.is-done { background: linear-gradient(105deg, #f3fbf7, #fff); border-color: #9ed7b7; }
.psm-file-row.is-done .psm-file-type { background: linear-gradient(145deg, #16a36f, #08764f); box-shadow: 0 7px 16px rgba(8,118,79,.16); }
.psm-file-row.is-done .psm-file-detail { color: #14724f; }

.psm-preview-toolbar { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.psm-preview-nav { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; color: #3e4b66; cursor: pointer; background: #fff; border: 1px solid var(--psm-border); border-radius: 10px; transition: .18s ease; }
.psm-preview-nav:hover:not(:disabled), .psm-preview-nav:focus-visible { color: #2749ba; background: #fff7f7; border-color: #9bace8; outline: none; box-shadow: 0 0 0 3px rgba(227,27,35,.12); }
.psm-preview-nav:disabled { cursor: not-allowed; opacity: .38; }
.psm-preview-page-control { display: inline-flex; min-height: 34px; align-items: center; gap: 5px; padding: 3px 8px; color: #667085; background: #fff; border: 1px solid var(--psm-border); border-radius: 10px; font-size: 10px; font-weight: 750; }
.psm-preview-page-input { width: 48px !important; min-height: 26px !important; margin: 0 !important; padding: 2px 5px !important; text-align: center; color: #20283c !important; background: #f8f9fc !important; border: 0 !important; border-radius: 7px !important; box-shadow: none !important; font: inherit !important; font-weight: 850 !important; appearance: textfield; }
.psm-preview-page-input::-webkit-inner-spin-button, .psm-preview-page-input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.psm-preview-page-input:focus { outline: 2px solid rgba(227,27,35,.22) !important; }
.psm-preview-page-total { white-space: nowrap; }
.psm-preview-label { white-space: nowrap; }

.psm-app.is-busy .psm-preview-toolbar { opacity: .72; }

@media (max-width: 760px) {
  .psm-preview-head { align-items: stretch; flex-direction: column; }
  .psm-preview-toolbar { width: 100%; justify-content: space-between; }
  .psm-preview-label { flex: 1 0 100%; text-align: center; }
  .psm-preview-page-control { flex: 1; justify-content: center; }
}

@media (max-width: 430px) {
  .psm-preview-nav { width: 38px; height: 38px; }
  .psm-preview-page-control { min-height: 38px; }
  .psm-file-row { min-height: 76px; }
  .psm-file-type { width: 40px; height: 40px; flex-basis: 40px; }
}

/* 2.5.0 — resource preflight, retry controls and cancellable operations */
.psm-file-row { grid-template-columns: 28px minmax(0,1fr) auto; }
.psm-file-row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; padding-left: 7px; }
.psm-retry-file-row { color: #e31b23; background: #f5f7ff; border-color: #c7d2f6; }
.psm-retry-file-row:hover:not(:disabled), .psm-retry-file-row:focus-visible { color: #2342a8; background: #eaf0ff; border-color: #8fa3e8; outline: none; box-shadow: 0 0 0 3px rgba(227,27,35,.12); }
.psm-remove-file-row:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(217,45,32,.12); }

.psm-preflight { margin-top: 20px; padding: 16px; background: linear-gradient(145deg,#fbfcff,#f6f8fd); border: 1px solid #dfe5f1; border-radius: 16px; box-shadow: 0 7px 20px rgba(31,45,78,.04); }
.psm-preflight-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.psm-preflight-head > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.psm-preflight-head strong { color: #20283c; font-size: 12.5px; font-weight: 850; }
.psm-preflight-head small { color: #7a8498; font-size: 10px; line-height: 1.6; }
.psm-preflight-risk { display: inline-flex; min-height: 28px; align-items: center; padding: 4px 10px; white-space: nowrap; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 850; }
.psm-preflight-risk.is-idle { color: #667085; background: #f2f4f7; border-color: #e4e7ec; }
.psm-preflight-risk.is-low { color: #087a55; background: #ecfdf3; border-color: #a6e7c8; }
.psm-preflight-risk.is-medium { color: #8a5700; background: #fffaeb; border-color: #f6d989; }
.psm-preflight-risk.is-high { color: #a1440b; background: #fff4e8; border-color: #f3bd8e; }
.psm-preflight-risk.is-critical { color: #b42318; background: #fff1f0; border-color: #f2b8b3; }
.psm-preflight-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.psm-preflight-grid > div { min-width: 0; padding: 10px 11px; background: rgba(255,255,255,.86); border: 1px solid #e6eaf2; border-radius: 11px; }
.psm-preflight-grid span { display: block; margin-bottom: 5px; color: #7a8498; font-size: 9.5px; }
.psm-preflight-grid strong { display: block; overflow: hidden; color: #26324a; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 850; }
.psm-preflight-note { margin: 11px 0 0; color: #596579; font-size: 10.5px; line-height: 1.75; }

@media (max-width: 760px) {
  .psm-preflight-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .psm-file-row-actions { gap: 4px; padding-left: 4px; }
  .psm-file-row-actions .psm-icon-button { width: 34px; height: 34px; }
}

@media (max-width: 430px) {
  .psm-preflight { padding: 13px; }
  .psm-preflight-head { align-items: stretch; flex-direction: column; }
  .psm-preflight-risk { align-self: flex-start; }
  .psm-preflight-grid { grid-template-columns: 1fr 1fr; }
  .psm-file-row { grid-template-columns: 25px minmax(0,1fr) auto; gap: 5px; }
  .psm-file-row-actions { flex-direction: column; }
  .psm-file-row-actions .psm-icon-button { width: 30px; height: 30px; border-radius: 8px; }
}

/* 2.7.1 — public shortcode responsive shell and post-preview actions */
.psm-output-top {
  margin-bottom: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #fbfcff, #fffafa);
  border: 1px solid var(--psm-border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(21, 31, 58, .045);
}
.psm-output-top-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.psm-output-top-head strong { display: block; margin-bottom: 2px; color: #20283c; font-size: 13px; font-weight: 900; }
.psm-output-top-head small { display: block; color: var(--psm-muted); font-size: 10.5px; line-height: 1.75; }
.psm-preview-actions { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--psm-border); }
.psm-preview-actions .psm-actions { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.35fr); gap: 10px; margin-top: 0; }
.psm-preview-actions .psm-button { width: 100%; min-width: 0; }
.psm-preview-actions .psm-cancel-button:not([hidden]) { grid-column: 1 / -1; }
.psm-preview-actions .psm-status,
.psm-preview-actions .psm-message { margin-top: 12px; }

.psm-app[data-context="frontend"] {
  width: 98%;
  max-width: none;
  min-width: 0;
  margin-inline: auto;
  font-family: inherit;
  container: psm-public-scanner / inline-size;
}
.psm-app[data-context="frontend"] .psm-shell { width: 100%; max-width: none; }
.psm-app[data-context="frontend"] :where(button, input, select, textarea, output, label, p, small, strong, h2, h3, a):not(.dashicons) {
  font-family: inherit;
}

@container psm-public-scanner (max-width: 1040px) {
  .psm-app[data-context="frontend"] .psm-grid { grid-template-columns: 1fr; }
  .psm-app[data-context="frontend"] .psm-preview-panel { border-top: 1px solid var(--psm-border); border-right: 0; }
  .psm-app[data-context="frontend"] .psm-preview-stage { min-height: 350px; }
  .psm-app[data-context="frontend"] .psm-output-formats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container psm-public-scanner (max-width: 720px) {
  .psm-app[data-context="frontend"] .psm-hero { align-items: flex-start; padding: 18px; }
  .psm-app[data-context="frontend"] .psm-local-badge { display: none; }
  .psm-app[data-context="frontend"] .psm-main-panel,
  .psm-app[data-context="frontend"] .psm-preview-panel { padding: 16px; }
  .psm-app[data-context="frontend"] .psm-output-top { padding: 13px; border-radius: 15px; }
  .psm-app[data-context="frontend"] .psm-settings { grid-template-columns: 1fr; gap: 15px; }
  .psm-app[data-context="frontend"] .psm-field-wide { grid-column: auto; }
  .psm-app[data-context="frontend"] .psm-file-queue-head,
  .psm-app[data-context="frontend"] .psm-file-queue-foot { align-items: flex-start; flex-direction: column; }
  .psm-app[data-context="frontend"] .psm-file-queue-actions { width: 100%; justify-content: space-between; }
  .psm-app[data-context="frontend"] .psm-preview-head { align-items: stretch; flex-direction: column; }
  .psm-app[data-context="frontend"] .psm-preview-toolbar { width: 100%; justify-content: space-between; }
  .psm-app[data-context="frontend"] .psm-preview-page-control { flex: 1; justify-content: center; }
  .psm-app[data-context="frontend"] .psm-preview-label { flex: 1 0 100%; text-align: center; }
  .psm-app[data-context="frontend"] .psm-preview-stage { min-height: 290px; padding: 12px; }
}

@container psm-public-scanner (max-width: 520px) {
  .psm-app[data-context="frontend"] { width: 98%; font-size: 12.5px; }
  .psm-app[data-context="frontend"] .psm-shell { border-radius: 16px; }
  .psm-app[data-context="frontend"] .psm-hero-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
  .psm-app[data-context="frontend"] .psm-hero h2 { font-size: 18px; }
  .psm-app[data-context="frontend"] .psm-output-formats { grid-template-columns: 1fr; }
  .psm-app[data-context="frontend"] .psm-format-card { min-height: 64px; }
  .psm-app[data-context="frontend"] .psm-dropzone { min-height: 155px; padding: 20px 12px; }
  .psm-app[data-context="frontend"] .psm-segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .psm-app[data-context="frontend"] .psm-preview-actions .psm-actions { grid-template-columns: 1fr; }
  .psm-app[data-context="frontend"] .psm-preview-actions .psm-cancel-button:not([hidden]) { grid-column: auto; }
  .psm-app[data-context="frontend"] .psm-button { width: 100%; }
  .psm-app[data-context="frontend"] .psm-privacy-note { padding: 12px 15px; }
}
