:root {
  --color: #18181b;
  --color-muted: #52525b;
  --bgcolor: #ffffff;
  --b-bgcolor: #fafafa;
  --c-bgcolor: #f4f4f5;
  --bordercolor: #d4d4d8;
  --b-bordercolor: #e4e4e7;
  --icon-color: #3f3f46;
  --link-color: #18181b;
  --link-b-color: #2563eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-text: #ffffff;
  --cta-bg: #18181b;
  --cta-hover: #27272a;
  --cta-text: #ffffff;
  --studio-canvas-bg: #1e1e22;
  --studio-canvas-border: #27272a;
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --logotype-color: #18181b;
  --logo-color-1: #f77;
  --logo-color-2: #fa0;
  --logo-color-3: #6b0;
  --logo-color-4: #3af;
  --logo-color-5: #b6b;
  --h-bgcolor: linear-gradient(#ffffff, #fafafa);
  --header-bg: rgba(255, 255, 255, 0.9);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
  --header-height: 54px;
  --pk-studio-inline-padding: clamp(16px, 3vw, 24px);
}

:root[data-theme="dark"] {
  --color: #f4f4f5;
  --color-muted: #a1a1aa;
  --bgcolor: #18181b;
  --b-bgcolor: #111113;
  --c-bgcolor: #27272a;
  --bordercolor: #3f3f46;
  --b-bordercolor: #27272a;
  --icon-color: #d4d4d8;
  --link-color: #f4f4f5;
  --link-b-color: #60a5fa;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --accent-text: #ffffff;
  --cta-bg: #f4f4f5;
  --cta-hover: #ffffff;
  --cta-text: #18181b;
  --studio-canvas-bg: #09090b;
  --studio-canvas-border: #27272a;
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --logotype-color: #fafafa;
  --h-bgcolor: linear-gradient(#18181b, #111113);
  --header-bg: rgba(24, 24, 27, 0.9);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color: #f4f4f5;
    --color-muted: #a1a1aa;
    --bgcolor: #18181b;
    --b-bgcolor: #111113;
    --c-bgcolor: #27272a;
    --bordercolor: #3f3f46;
    --b-bordercolor: #27272a;
    --icon-color: #d4d4d8;
    --link-color: #f4f4f5;
    --link-b-color: #60a5fa;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --accent-soft: rgba(59, 130, 246, 0.16);
    --accent-text: #ffffff;
    --cta-bg: #f4f4f5;
    --cta-hover: #ffffff;
    --cta-text: #18181b;
    --studio-canvas-bg: #09090b;
    --studio-canvas-border: #27272a;
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.12);
    --logotype-color: #fafafa;
    --h-bgcolor: linear-gradient(#18181b, #111113);
    --header-bg: rgba(24, 24, 27, 0.9);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--b-bgcolor);
  touch-action: manipulation;
  font-size: 62.5%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  color: var(--color);
  background-color: var(--b-bgcolor);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  -webkit-text-size-adjust: 100%;
  font-size: 1.5rem;
  line-height: 1.6;
  text-align: left;
  overflow-x: clip;
}

input, select, button, textarea, .table {
  color: var(--color);
}

a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-indent: 0;
  transition: color 0.15s ease, opacity 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

a, a:link, a:visited {
  color: var(--link-color);
}

a:hover, button:hover, .buttonline:hover {
  opacity: 0.85;
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.noborder {
  border-style: none;
}

h1, h2, h3 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  padding: 0 0 10px 0;
  color: var(--color);
}

h1 a, h2 a, h3 a {
  border-style: none;
  overflow: hidden;
}

/* Interactive controls & buttons */
.headerlink a,
.selecttheapp a,
.collanguage a,
.buttonbutton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--c-bgcolor);
  border: 1px solid var(--bordercolor);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  min-height: 36px;
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.headerlink a:hover,
.selecttheapp a:hover,
.collanguage a:hover,
.buttonbutton:hover {
  text-decoration: none;
  background-color: var(--accent-soft);
  border-color: var(--accent);
  opacity: 1;
}

.buttonbutton:active {
  transform: translateY(1px);
}

.button {
  background-color: var(--bgcolor);
}

.buttonfunction {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 8px 18px;
  min-height: 42px;
  background-color: var(--accent);
  color: var(--accent-text) !important;
  border-color: var(--accent);
}

.buttonfunction:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text) !important;
}

.buttonfunction.buttonrenew {
  background-color: var(--c-bgcolor);
  color: var(--color) !important;
  border-color: var(--bordercolor);
}

.buttonfunction.buttonrenew:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

#selectlanguage {
  margin-top: 0;
}

.headerlink a {
  margin: 0 0 6px 0 !important;
}

ul {
  margin: 0;
  display: inline-block;
}

li {
  margin: 8px 0;
  line-height: 1.6;
}

select, input[type="text"], input[type="number"], input[type="search"], textarea {
  background-color: var(--bgcolor);
  border: 1px solid var(--bordercolor);
  border-radius: var(--radius-sm);
  min-width: 40px;
  min-height: 36px;
  padding: 4px 10px;
  margin: 2px;
  font-size: 1.4rem;
}

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
  vertical-align: middle;
  cursor: pointer;
}

select {
  padding: 4px 10px;
  cursor: pointer;
}

textarea {
  text-align: left;
  padding: 8px 10px;
}

th, td {
  vertical-align: middle;
}

label {
  margin: 0;
}

.icon {
  color: var(--icon-color);
  min-height: 16px;
  min-width: 16px;
  display: inline-block;
}

/* Outline SVGs keep their interiors clear; solid icons retain their own fill. */
svg.icon[fill="none"] {
  fill: none;
}

.menubutton, .movebutton {
  background-color: transparent;
  border-style: none;
  z-index: 999;
}

.menubutton {
  position: fixed;
  top: 0;
  right: 0;
  display: none;
  width: 40px;
  height: 40px;
}

.movebutton {
  display: none;
  width: 32px;
  height: 40px;
}

.navbar {
  padding: 0;
}

.logotype {
  fill: var(--logotype-color);
}

/* Header & Navigation */
header {
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--b-bordercolor);
  box-shadow: var(--shadow-sm);
  text-align: center;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

main {
  background-color: var(--b-bgcolor);
  padding: 16px 0 24px 0;
  min-height: 70vh;
}

footer {
  background-color: var(--b-bgcolor);
  border-top: 1px solid var(--b-bordercolor);
  text-align: center;
}

.headerlogo {
  position: relative;
  background: transparent;
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px;
  margin: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--b-bordercolor);
  background-color: var(--c-bgcolor);
  color: var(--color);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.header-action-btn:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
  text-decoration: none;
}

.header-action-primary,
.header-action-primary:link,
.header-action-primary:visited {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

.header-action-primary:hover,
.header-action-primary:focus-visible,
.header-action-primary:active {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
  opacity: 1;
}

.pk-hidden-upload-form {
  display: none !important;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-pill);
  border: 1px solid var(--b-bordercolor);
  background-color: var(--c-bgcolor);
  color: var(--icon-color);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.theme-toggle:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  opacity: 1;
}

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.headerlink {
  margin: 0 auto;
}

/* Grid & Content Cards */
.row {
  margin: 0;
  padding: 12px 0 0 0;
}

.col-12, .col-6 {
  padding: 0 10px 16px 10px;
  vertical-align: top;
  text-align: center;
}

.box {
  margin: 0 auto;
  display: inline-block;
}

.boxtitle {
  line-height: 1.8;
}

.box li {
  margin: 0;
}

.hleft, .ulleft {
  text-align: left;
  max-width: 740px;
}

.ulleft {
  margin: 0 auto !important;
}

.ulleft li {
  text-indent: -1.3rem;
  padding-left: 2rem;
}

.ulleft li::before {
  content: "- ";
  color: var(--color-muted);
}

/* Footer & Tool Directory */
.containerfooterlink {
  background-color: var(--c-bgcolor);
  border-top: 1px solid var(--b-bordercolor);
}

.containerfooterlink select {
  display: block;
  margin-left: 0;
}

footer h3, footer a {
  text-decoration: none;
  text-align: left;
  padding: 0;
  width: auto;
}

footer h3 {
  display: block;
  margin-bottom: 10px;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color);
}

.footerlink h3 {
  font-size: 1.6rem;
}

.toolblocksub {
  text-align: center;
  margin: 4px 0 16px 0;
}

.colblockintool, .footerlink {
  padding-left: 12px;
  padding-right: 12px;
  text-align: left;
}

.colblockintool a, .footerlink a {
  font-size: 1.4rem;
  display: inline-block;
  padding: 3px 6px;
  margin: 1px 0;
  border-radius: var(--radius-sm);
  color: var(--color);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.colblockintool a:hover, .footerlink a:hover {
  background-color: var(--accent-soft);
  color: var(--link-b-color);
  text-decoration: none;
  opacity: 1;
}

.footerlink a {
  line-height: 1.8;
}

.justify-content-around {
  justify-content: space-around !important;
}

.justify-content-center {
  justify-content: center !important;
}

.col-footerlink {
  width: 50%;
}

/* Recent Tools & Tool Search Bar */
.recent-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 820px;
  margin: 0 auto 14px auto;
  padding: 0 12px;
}

.recent-tools-label {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-muted);
  margin-right: 4px;
}

.recent-tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color);
  text-decoration: none !important;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.recent-tool-chip:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--link-b-color);
  opacity: 1;
}

.toolsearch-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 20px auto;
  padding: 0 12px;
  text-align: center;
}

.toolsearch-input {
  width: 100%;
  padding: 10px 42px 10px 18px !important;
  min-height: 44px !important;
  font-size: 1.5rem !important;
  border-radius: var(--radius-pill) !important;
  border: 1.5px solid var(--bordercolor) !important;
  background-color: var(--bgcolor) !important;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.toolsearch-clear {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background-color: var(--c-bgcolor);
  color: var(--color-muted);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.toolsearch-clear:hover {
  background-color: var(--accent-soft);
  color: var(--color);
  opacity: 1;
}

.toolsearch-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.toolsearch-empty {
  display: none;
  text-align: center;
  color: var(--color-muted);
  padding: 16px;
  font-size: 1.4rem;
}

/* Index Page Cards & Samples */
.newboxblock {
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.newboxtitle {
  background: transparent !important;
  font-size: 1.9rem;
  font-weight: 700;
  text-align: left;
  padding: 0 0 12px 0 !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--b-bordercolor);
}

.newboxcontents {
  text-align: left;
  display: block;
  font-size: 1.5rem;
  padding-top: 12px !important;
}

.newboxcontents li {
  text-indent: 0;
  padding-left: 2.4rem;
  background-image: none;
  margin: 8px 0;
}

.newboxalist a {
  margin-right: 10px;
  display: inline-block;
}

.indexsampleblock {
  display: inline-block;
  margin: 8px;
  padding: 8px;
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  vertical-align: top;
}

.indexsampleblock:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.indexsampleblock a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 1;
}

.indexsampleblock img {
  border-radius: var(--radius-sm);
  max-width: 100%;
  height: auto;
}

.indexsamplelabel {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color);
  text-align: center;
}

.centercontents {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

.container {
  margin: 0 auto;
  padding: 0;
}

.row {
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 0;
}

.colblock {
  text-align: left;
  overflow: hidden;
  width: 100%;
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.colblockshort {
  padding-bottom: 10px;
}

.hnone {
  margin-bottom: 0;
}

.colblockcontents {
  width: 100%;
}

.colblockcontentsad {
  text-align: left;
  max-height: 280px;
  max-width: 336px;
  line-height: 0;
}

.pk-ad-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: 80px;
  padding: 12px 16px;
  border: 1px dashed var(--b-bordercolor);
  border-radius: var(--radius-sm);
  background-color: var(--bgcolor);
  color: var(--color-muted);
  font-size: 1.25rem;
  line-height: 1.5;
  text-align: center;
}

.colblockcenter h2 {
  text-align: center;
}

.colblockcenterin {
  text-align: center;
}

.colblockinindex {
  margin: 12px auto 0 auto;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.colblockinindexupload {
  width: 100%;
  text-align: center;
}

.colblockinconfig, .colblockinconfigb {
  display: none;
  margin-top: 12px;
}

.colblockblank {
  padding: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.colblockimage {
  padding: 12px;
}

form {
  display: block;
  margin: 0 auto;
}

li {
  text-align: left;
  margin: 6px 10px;
  padding-left: 2.2rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fa0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") left 0 top 4px no-repeat;
  background-size: 1.4rem;
}

li .icon {
  color: var(--logo-color-2);
  font-size: 1rem;
  margin-right: 1rem;
  padding: 2px;
}

/* Upload Dropzone & File Input */
.inputfile {
  margin: 0 0 8px 0;
  padding: 14px 16px;
  width: 100%;
  max-width: 480px;
  border: 2px dashed var(--bordercolor);
  border-radius: var(--radius-md);
  background-color: var(--b-bgcolor);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.inputfile:hover,
.inputfile.is-dragover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.inputfile::file-selector-button {
  background-color: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  margin-right: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.inputfile::file-selector-button:hover {
  background-color: var(--accent-hover);
}

.upload-hint {
  margin: 4px 0 0 0;
  font-size: 1.25rem;
  color: var(--color-muted);
}

.buttonfile {
  padding: 6px 14px;
}

.toolblock {
  margin: 4px 6px;
  display: inline-block;
}

.formbutton {
  display: inline-block;
}

#image, .imageb {
  max-width: 95%;
  max-height: 480px;
  float: right;
  margin: 0 5px 8px 5px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.imagemodal {
  cursor: zoom-in;
}

.inputtsix { width: 88px; }
.inputnfour { width: 64px; }
.inputs { width: 52px; }

table {
  margin: 0 0 15px 0;
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: right;
  padding: 8px 10px 8px 6px;
  font-weight: 600;
  color: var(--color-muted);
}

td {
  text-align: left;
  padding: 8px 6px 8px 10px;
}

.thtitle {
  text-align: left;
  padding: 10px 0 6px;
  font-weight: 700;
  color: var(--color);
  border-bottom: 1px solid var(--b-bordercolor);
}

.slider {
  display: inline-block;
  margin: 8px 12px 8px 4px;
  width: 132px;
  min-width: 110px;
  max-width: 100%;
  vertical-align: middle;
}

.inputcolor {
  width: 36px;
  height: 36px;
  border: 1px solid var(--bordercolor);
  border-radius: var(--radius-sm);
  display: inline-block;
  cursor: pointer;
}

.buttonline {
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background-color: transparent !important;
  border-style: none !important;
  display: inline-block;
  min-height: 36px;
}

.imagethumbnailbox {
  display: inline;
}

.imagethumbnailbox a {
  display: inline;
}

.imagethumbnail {
  margin: 0 0 6px 6px;
  float: left;
  border-radius: var(--radius-sm);
}

select {
  text-align: left;
}

.toolothers {
  display: none;
}

.toolothers.is-searching {
  display: block !important;
}

.tool-hidden {
  display: none !important;
}

.toolnow {
  font-weight: 700;
  color: var(--link-b-color) !important;
  background-color: var(--accent-soft);
  text-decoration: none !important;
}

.h1tool {
  text-align: right;
}

.imagebottom {
  clear: both;
  width: auto;
  text-align: right;
  padding: 4px 10px;
  color: var(--color-muted);
  font-size: 1.3rem;
}

/* Modal */
.modal {
  display: none;
  cursor: zoom-out;
}

.modalbox {
  z-index: 10000;
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(4px);
}

.modalboxb {
  padding: 16px;
  width: 100%;
  height: 100%;
  text-align: center;
  vertical-align: middle;
}

#modalimage {
  max-width: 100%;
  max-height: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-right: -50%;
  transform: translate(-50%, -50%);
  border-radius: var(--radius-md);
}

.showothertools {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 6px 20px;
  min-height: 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--bordercolor) !important;
  background-color: var(--bgcolor) !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.4rem;
}

.showothertools:hover {
  background-color: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  opacity: 1;
}

/* jQuery UI Slider Modernization */
.ui-slider.ui-widget-content {
  position: relative;
  background: var(--bordercolor);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  touch-action: none;
}

.ui-slider.ui-slider-horizontal {
  height: 6px;
}

.ui-slider .ui-slider-range {
  background: var(--accent);
  border: none;
  border-radius: var(--radius-pill);
}

.ui-slider.ui-widget-content .ui-slider-handle.ui-state-default {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: grab;
  touch-action: none;
  transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.14s ease, border-color 0.14s ease;
}

.ui-slider.ui-slider-horizontal .ui-slider-handle.ui-state-default {
  top: 50%;
  margin-left: -9px;
  transform: translateY(-50%) scale(1);
}

/* Expand hit target to ~38px without changing visual knob size */
.ui-slider .ui-slider-handle::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
}

.ui-slider.ui-widget-content .ui-slider-handle.ui-state-focus {
  background: #ffffff;
  border-color: var(--accent);
}

.ui-slider.ui-widget-content .ui-slider-handle:hover,
.ui-slider.ui-widget-content .ui-slider-handle.ui-state-hover {
  background: #ffffff;
  border-color: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.24), 0 0 0 5px var(--accent-soft);
}

.ui-slider.ui-slider-horizontal .ui-slider-handle:hover,
.ui-slider.ui-slider-horizontal .ui-slider-handle.ui-state-hover {
  transform: translateY(-50%) scale(1.12);
}

.ui-slider.ui-widget-content .ui-slider-handle:active,
.ui-slider.ui-widget-content .ui-slider-handle.ui-state-active {
  cursor: grabbing;
  background: #ffffff;
  border-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 0 0 7px var(--accent-soft);
}

.ui-slider.ui-slider-horizontal .ui-slider-handle:active,
.ui-slider.ui-slider-horizontal .ui-slider-handle.ui-state-active {
  transform: translateY(-50%) scale(1.16);
}

.ui-slider.ui-widget-content .ui-slider-handle:focus-visible {
  outline: none;
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 2px var(--bgcolor), 0 0 0 4.5px var(--accent);
}

.ui-slider.ui-state-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ui-slider.ui-state-disabled .ui-slider-handle.ui-state-default {
  cursor: not-allowed;
  box-shadow: none;
  transform: translateY(-50%) scale(1);
}

.imagechange {
  display: inline-block;
}

.selecttheapp a {
  line-height: 1.5;
  margin: 3px 2px 0 0;
}

.buttoniconword {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 1.1rem;
  text-decoration: none;
  line-height: 1.3;
  vertical-align: middle;
  margin: 4px 2px 0 2px;
  text-align: center;
  cursor: pointer;
  min-width: 48px;
  min-height: 42px;
  padding: 4px 8px;
}

.buttoniconword br {
  display: none;
}

.buttoniconword .labelnomove {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: inherit;
  cursor: inherit;
}

.buttoniconword:hover {
  text-decoration: none;
}

.infobox {
  padding: 15px 12px 5px 12px;
}

.h3info {
  font-weight: 700;
}

.h3info, .infocontents {
  margin-bottom: 15px;
}

li .buttonline {
  display: inline !important;
}

.buttonnone {
  border-style: none;
  background: transparent;
  padding: 0;
  margin: 0;
}

.buttonnone:active {
  outline: none;
}

.imagethumbnailbox .buttonnone {
  float: right;
}

.imageexif {
  clear: both;
  text-align: left;
  display: inline-block;
  margin: 0 auto;
  padding: 10px;
}

.buttonthumbnail {
  cursor: pointer;
}

.colblockattention {
  text-align: center;
  padding: 12px 16px;
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  color: var(--color);
}

.pattention {
  color: var(--danger);
  font-weight: 600;
}

.imagebottomedit {
  margin-top: 12px;
}

.imagebox {
  width: auto;
  display: inline-block;
  float: right;
}

.inputnone {
  border-style: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 60px;
}

.sampleblock {
  display: inline-block;
  margin: 4px;
  padding: 6px;
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.sampleblock a {
  text-decoration: none;
}

.animationstop {
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}

.animationnew {
  animation: new 1s ease-in-out 0s infinite normal none running;
  transform-origin: left top;
}

@keyframes new {
  0% { transform: scale(1, 1) translate(-25px, -25px); }
  20% { transform: scale(1.2, 0.8) translate(-25px, -25px); }
  40% { transform: scale(0.8, 1.2) translate(-25px, -25px); }
  60% { transform: scale(1, 1) translate(-25px, -25px); }
  100% { transform: scale(1, 1) translate(-25px, -25px); }
}

@media screen and (max-width: 991.99px) {
  .ainline { text-indent: 0; padding: 0 2px; }
  .selecttheapp a { margin: 2px 0 4px 0; }
  .menubutton { display: block; }
  .movebutton { display: inline-block; }
  .movebutton svg { margin-top: 2px; }
  .mobileoff { display: none; }
  .imagebox { width: 100%; text-align: center; float: none; }
  #image, .imageb { max-height: 240px; float: none; }
  .imagethumbnailbox { clear: both; display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .imagethumbnailboxb { width: 1400px; text-align: left; padding: 5px 5px 0 5px; }
  .imagethumbnail { float: left; max-height: 80px; }
  .colblockinindex { min-height: auto; }
  .h1tool, .imagebottom { text-align: center; }
  .colblockcontentsad { text-align: center; margin: 0 auto; }
  .toolblock { display: inline-block; }
  #inputfiletop { display: none !important; }
  .footersns { padding: 0 10px !important; }
}

@media screen and (max-width: 575.99px) {
  :root {
    --header-height: 48px;
  }
  .headerlink a, .footerlink a, .colblockintool a, .selecttheapp a, .collanguage a, .buttonbutton {
    min-width: 40px;
    min-height: 40px;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
  }
  select, input[type="text"], input[type="number"] {
    min-height: 40px;
  }
  footer h3 { margin-bottom: 12px; }
  .headerlogo {
    padding: 5px 10px;
    gap: 6px;
  }
  .headerlogo a.header-brand { min-height: 36px; }
  .header-brand svg {
    width: 136px;
    height: 32px;
  }
  .header-actions {
    gap: 6px;
  }
  .newboxblock { padding: 14px; }
  .colblock { padding: 14px; }
  .newboxblock a { min-height: auto; min-width: auto; }
}

@media (max-width: 799.98px) {
  .pk-open-tool-palette span,
  #msamples span,
  .pk-random-tool span {
    display: none;
  }
  .pk-open-tool-palette,
  #msamples,
  .pk-random-tool {
    width: 34px;
    padding: 0;
  }
}

@media (max-width: 440px) {
  .header-brand svg {
    width: 112px;
    height: 26px;
  }
  .header-actions {
    gap: 4px;
  }
  .header-action-btn {
    height: 32px;
    padding: 0 9px;
    font-size: 1.15rem;
    gap: 4px;
  }
  .pk-open-tool-palette,
  #msamples,
  .pk-random-tool {
    width: 32px;
    padding: 0;
  }
  .header-action-primary span {
    display: none;
  }
  .header-action-primary {
    width: 32px;
    padding: 0;
  }
  .header-action-btn svg {
    width: 14px;
    height: 14px;
  }
  .theme-toggle {
    width: 32px;
    height: 32px;
  }
}

/* Editor Image Toolbar & Metadata */
.imagebottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 10px 4px 4px 4px;
}

.imagebottom .buttoniconword {
  border-radius: var(--radius-md);
  border: 1px solid var(--b-bordercolor) !important;
  background-color: var(--b-bgcolor) !important;
  padding: 6px 10px;
  margin: 0;
  color: var(--color);
  text-decoration: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.imagebottom .buttoniconword:hover {
  background-color: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  opacity: 1;
}

.imagebottom .buttoniconword.is-active {
  background-color: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  color: var(--link-b-color);
  font-weight: 700;
}

.imagebottom .buttoniconword.is-active .icon {
  color: var(--accent);
}

.imagedatabox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--color-muted);
}

.imagedatabox .inputnone {
  width: 52px;
  min-height: 24px !important;
  text-align: center;
  font-size: 1.2rem;
  color: var(--color-muted);
  cursor: default;
  pointer-events: none;
}

@media screen and (max-width: 991.99px) {
  .imagebottom {
    justify-content: center;
  }
  .imagedatabox {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }
}

/* Floating Back-to-Top Button */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 20px;
  z-index: 990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--bordercolor);
  background-color: var(--bgcolor);
  color: var(--color);
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  opacity: 1;
}

/* Toast Notification */
.pk-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  z-index: 10001;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background-color: var(--color);
  color: var(--bgcolor);
  font-size: 1.4rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  max-width: 90vw;
  text-align: center;
}

.pk-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.pk-toast.is-error {
  background-color: var(--danger);
  color: #ffffff;
}

/* Home Page Hero & Trust Pillars */
.pk-hero {
  background: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  padding: 28px 26px;
  box-shadow: var(--shadow-sm);
  margin-top: 8px;
}

.pk-hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  gap: 28px;
  align-items: center;
  text-align: left;
}

.pk-hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}

.pk-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background-color: var(--c-bgcolor);
  border: 1px solid var(--b-bordercolor);
  color: var(--color);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

.pk-badge-accent {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.pk-hero-title {
  font-size: 2.7rem;
  font-weight: 800;
  line-height: 1.28;
  margin: 0 0 10px 0;
  padding: 0;
  color: var(--color);
}

.pk-hero-subtitle {
  margin: 0 0 18px 0;
  font-size: 1.5rem;
  line-height: 1.65;
  color: var(--color-muted);
}

.pk-quick-upload {
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-md);
  padding: 16px;
}

.pk-quick-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 10px;
}

.pk-quick-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color);
}

.pk-quick-toollabel {
  font-size: 1.25rem;
  color: var(--color-muted);
}

.pk-tool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.pk-tool-pill {
  appearance: none;
  background-color: var(--bgcolor);
  border: 1px solid var(--bordercolor);
  border-radius: var(--radius-pill);
  color: var(--color);
  font-size: 1.3rem;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pk-tool-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pk-tool-pill.is-active,
.pk-tool-pill[aria-pressed="true"] {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.pk-dropzone {
  position: relative;
  border: 2px dashed var(--bordercolor);
  border-radius: var(--radius-md);
  background-color: var(--bgcolor);
  padding: 18px 16px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pk-dropzone.is-dragover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
}

.pk-dropzone .pk-dropzone-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
}

.pk-dropzone-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pk-dropzone-icon {
  color: var(--accent);
}

.pk-dropzone-text {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--color);
}

.pk-dropzone-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.pk-quick-btn {
  cursor: pointer;
  margin: 0;
}

.pk-dropzone-note {
  margin: 2px 0 0 0;
  font-size: 1.2rem;
  color: var(--color-muted);
}

/* Before / After Preview Card */
.pk-ba-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pk-ba-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 400px;
  margin: 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--b-bordercolor);
  background-color: var(--c-bgcolor);
  box-shadow: var(--shadow-md);
  user-select: none;
  -webkit-user-select: none;
}

.pk-ba-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pk-ba-before-wrap {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--ba-pos, 52%)) 0 0);
}

.pk-ba-tag {
  position: absolute;
  top: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  z-index: 2;
}

.pk-ba-tag-before {
  left: 10px;
}

.pk-ba-tag-after {
  right: 10px;
}

.pk-ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--ba-pos, 52%);
  width: 2px;
  background-color: #ffffff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 3;
}

.pk-ba-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--accent);
  color: var(--accent-text);
  border: 2px solid #ffffff;
  box-shadow: var(--shadow-md);
  transition: transform 0.14s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.14s ease, background-color 0.14s ease;
}

.pk-ba-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  touch-action: pan-y;
  z-index: 4;
}

.pk-ba-range:hover ~ .pk-ba-divider .pk-ba-knob {
  background-color: var(--accent-hover);
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: var(--shadow-md), 0 0 0 5px var(--accent-soft);
}

.pk-ba-range:active ~ .pk-ba-divider .pk-ba-knob {
  background-color: var(--accent-hover);
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: var(--shadow-md), 0 0 0 7px var(--accent-soft);
}

.pk-ba-range:focus-visible ~ .pk-ba-divider .pk-ba-knob {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.pk-ba-presets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pk-ba-preset {
  appearance: none;
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-size: 1.25rem;
  font-weight: 600;
  padding: 5px 11px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pk-ba-preset:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pk-ba-preset.is-active,
.pk-ba-preset[aria-pressed="true"] {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.pk-btn-primary,
.pk-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 1.45rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pk-btn-primary,
.pk-btn-primary:link,
.pk-btn-primary:visited {
  background-color: var(--accent);
  color: var(--accent-text);
  border: 1px solid var(--accent);
  box-shadow: var(--shadow-sm);
}

.pk-btn-primary:hover,
.pk-btn-primary:focus-visible,
.pk-btn-primary:active {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  opacity: 1;
}

.pk-btn-secondary {
  background-color: var(--b-bgcolor);
  color: var(--color);
  border: 1px solid var(--bordercolor);
}

.pk-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  opacity: 1;
}

.pk-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--b-bordercolor);
  padding-bottom: 10px;
}

.pk-section-header .newboxtitle {
  border-bottom: none;
  padding-bottom: 0 !important;
}

.pk-section-more {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--link-b-color);
  text-decoration: none;
  white-space: nowrap;
}

.pk-section-more:hover {
  text-decoration: underline;
}

/* Category Tabs & Discover Grid */
.pk-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.pk-tab {
  appearance: none;
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  font-size: 1.35rem;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pk-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pk-tab.is-active,
.pk-tab[aria-selected="true"] {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.pk-sample-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding-top: 16px;
}

.pk-sample-grid .indexsampleblock {
  display: block;
  margin: 0;
}

.pk-sample-grid .indexsampleblock[hidden] {
  display: none;
}

.pk-discover-footer {
  display: flex;
  justify-content: center;
  padding-top: 18px;
}

.pk-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pk-pillar-card {
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.pk-pillar-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pk-pillar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.pk-pillar-title {
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0;
  padding: 0;
  color: var(--color);
  line-height: 1.35;
}

.pk-pillar-body {
  font-size: 1.45rem;
  line-height: 1.7;
  margin: 0;
  color: var(--color-muted);
}

.pk-howto-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  list-style: none;
  margin: 0;
  padding: 14px 0 0 0;
}

.pk-howto-steps li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding-left: 0;
  background: none;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color);
}

.pk-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* FAQ Accordion */
.pk-faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
}

.pk-faq-item {
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-md);
  background-color: var(--b-bgcolor);
  overflow: hidden;
}

.pk-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color);
  cursor: pointer;
  list-style: none;
}

.pk-faq-q::-webkit-details-marker {
  display: none;
}

.pk-faq-q::after {
  content: "+";
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}

.pk-faq-item[open] .pk-faq-q::after {
  content: "\2212";
}

.pk-faq-a {
  padding: 0 16px 14px 16px;
  font-size: 1.45rem;
  line-height: 1.7;
  color: var(--color-muted);
}

.pk-faq-a p {
  margin: 0;
}

@media (max-width: 991.98px) {
  .pk-hero-split {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .pk-pillars {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 767.98px) {
  .pk-hero {
    padding: 20px 16px;
  }
  .pk-hero-title {
    font-size: 2.15rem;
  }
  .pk-hero-subtitle {
    font-size: 1.45rem;
  }
  .pk-sample-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .pk-ba-viewer {
    max-width: 320px;
  }
}

/* ===== Accessibility ===== */

/* Skip link: hidden until focused with the keyboard */
.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}
.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Former <span> controls are now <button>: keep their link-like look */
button.buttonline {
  font: inherit;
  color: inherit;
  padding: 0;
  margin: 0;
  line-height: inherit;
  -webkit-appearance: none;
  appearance: none;
}
button.buttonline:not(.buttoniconword) {
  color: var(--link-color);
}
button.buttonline.is-active,
button.buttonline[aria-pressed="true"] {
  font-weight: 700;
}

/* Respect the OS "reduce motion" setting */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Editor flow ===== */

/* Upload / loading dialog status text */
.modalstatus {
  margin: 14px auto 0;
  max-width: 90%;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  word-break: break-all;
}
.modalstatus:empty {
  display: none;
}

/* Download is the main action after editing */
.imagebottom .buttoniconword.pk-download {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
  font-weight: 700;
}
.imagebottom .buttoniconword.pk-download .icon {
  color: #fff;
}
.imagebottom .buttoniconword.pk-download:hover {
  filter: brightness(1.08);
  background-color: var(--accent) !important;
}

/* ==========================================================================
   Studio Tool Screen Overhaul (.pk-studio)
   ========================================================================== */
@keyframes pk-spin {
  to { transform: rotate(360deg); }
}

.pk-studio {
  --pk-studio-column-gutter: 10px;
  /* Own the horizontal inset; main owns the space below the site header. */
  padding-inline: var(--pk-studio-inline-padding);
  padding-bottom: 24px;
}

.pk-studio-grid {
  align-items: flex-start;
  /* Keep the stage sticky relative to the viewport, not a clipped row. */
  overflow: visible;
  /* Offset column gutters so card edges align with the studio heading. */
  width: calc(100% + var(--pk-studio-column-gutter) * 2);
  margin-inline: calc(-1 * var(--pk-studio-column-gutter));
}

.pk-studio-grid > .col-12 {
  padding-inline: var(--pk-studio-column-gutter);
}

@media screen and (min-width: 992px) {
  .pk-stage-pane {
    position: sticky;
    top: calc(var(--header-height, 64px) + 12px);
    z-index: 10;
  }
}

.pk-stage-card {
  padding: 14px 16px;
}

.pk-studio .imagebox {
  width: 100%;
  display: block;
  float: none;
}

.pk-canvas-stage {
  position: relative;
  width: 100%;
  min-height: 0;
  border-radius: var(--radius-md);
  background-color: var(--studio-canvas-bg);
  border: 1px solid var(--studio-canvas-border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pk-canvas-stage.has-checkerboard {
  background-image:
    linear-gradient(45deg, rgba(128, 128, 128, 0.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(128, 128, 128, 0.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(128, 128, 128, 0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(128, 128, 128, 0.16) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.pk-canvas-viewport {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

.pk-canvas-viewport[hidden] {
  display: none !important;
}

.pk-canvas-stage #image,
.pk-canvas-stage .imageb {
  float: none;
  /* Let both dimensions scale together instead of retaining HTML sizes. */
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 290px);
  margin: 0;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

@media screen and (max-width: 991.99px) {
  .pk-canvas-stage #image,
  .pk-canvas-stage .imageb,
  .pk-studio-compare-after {
    max-height: 55vh;
  }
}

.pk-canvas-stage.is-zoom-100 {
  overflow: auto;
  justify-content: flex-start;
  align-items: flex-start;
  max-height: calc(100vh - 270px);
}

.pk-canvas-stage.is-zoom-100 .pk-canvas-viewport {
  width: auto;
  min-width: 100%;
}

.pk-canvas-stage.is-zoom-100 #image,
.pk-canvas-stage.is-zoom-100 .imageb {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

.pk-compare-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 6;
  background: rgba(15, 23, 42, 0.82);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.pk-stage-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.45);
  color: #ffffff;
  font-weight: 600;
  font-size: 1.35rem;
  backdrop-filter: blur(2px);
}

.pk-canvas-stage.is-loading .pk-stage-loading {
  display: flex;
}

.pk-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: pk-spin 0.75s linear infinite;
}

.pk-drop-overlay {
  position: absolute;
  inset: 6px;
  z-index: 9;
  display: none;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--color);
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.pk-drop-overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  background: var(--bgcolor);
  box-shadow: var(--shadow-md);
  font-weight: 700;
  font-size: 1.35rem;
  text-align: center;
}

.pk-canvas-stage.is-dragover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.pk-canvas-stage.is-dragover .pk-drop-overlay {
  display: flex;
}

/* Studio Toolbar & Preset Thumbnail Strip */
.pk-studio .imagebottom {
  justify-content: flex-start;
  padding: 12px 2px 2px;
}

.pk-stage-card .imagethumbnailbox {
  display: block;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: 10px;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.pk-stage-card .imagethumbnailboxb {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-width: 100%;
  padding: 4px 2px;
}

.pk-stage-card .pk-thumb-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  background: transparent;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pk-stage-card .pk-thumb-btn {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.pk-stage-card .pk-thumb-item .imagethumbnail {
  display: block;
  float: none;
  margin: 0;
  height: 76px;
  width: auto;
  max-height: 76px;
  border: 0;
  border-radius: 0;
}

.pk-stage-card .pk-thumb-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.pk-stage-card .pk-thumb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pk-stage-card .pk-thumb-btn.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.pk-stage-card .pk-thumb-label {
  position: absolute;
  left: 3px;
  bottom: 3px;
  max-width: calc(100% - 6px);
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}

.pk-stage-card .pk-thumb-btn.is-active .pk-thumb-label {
  background: var(--accent);
  color: #ffffff;
}

/* Inspector Pane & Controls */
.colblockcontentsad:empty {
  display: none;
}

.pk-config-toggle-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  text-align: left;
}

.pk-accordion-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 700;
  color: var(--color);
  padding: 4px 2px;
  min-height: 36px;
}

.pk-accordion-btn .pk-chevron {
  transition: transform 0.2s ease;
}

.pk-accordion-btn[aria-expanded="true"] .pk-chevron {
  transform: rotate(180deg);
}

.pk-inspector-pane .lefttable,
.pk-inspector-pane .righttable {
  margin-bottom: 8px;
}

.pk-inspector-pane .lefttable th,
.pk-inspector-pane .righttable th {
  width: 34%;
  font-size: 1.3rem;
  vertical-align: middle;
}

.pk-inspector-pane .lefttable td,
.pk-inspector-pane .righttable td {
  width: 66%;
}

.pk-inspector-pane .slider {
  width: clamp(88px, calc(100% - 104px), 168px);
  min-width: 88px;
  margin: 8px 10px 8px 2px;
}

@media screen and (max-width: 575.99px) {
  .pk-inspector-pane .lefttable tr,
  .pk-inspector-pane .righttable tr {
    display: block;
    padding: 6px 0;
  }
  .pk-inspector-pane .lefttable th,
  .pk-inspector-pane .lefttable td,
  .pk-inspector-pane .righttable th,
  .pk-inspector-pane .righttable td {
    display: block;
    width: 100%;
    text-align: left;
    padding: 3px 2px;
  }
  .pk-inspector-pane .slider {
    width: calc(100% - 112px);
    min-width: 120px;
    max-width: 240px;
  }
}

.pk-apply-btn {
  margin: 0;
  min-height: 44px;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: var(--radius-md);
}

/* Home: Hero Tagline (Catchphrase) */
.pk-hero-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 12px 0;
}

.pk-hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.pk-since {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--b-bgcolor);
  border: 1px solid var(--bordercolor);
  color: var(--color-muted);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pk-since::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.75;
  flex-shrink: 0;
}

.pk-hero-tagline svg {
  flex-shrink: 0;
}

/* Home: Media Mentions */
.pk-media-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.pk-media-eyebrow {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.pk-media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding-top: 14px;
}

.pk-media-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  text-align: left;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.pk-media-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
}

.pk-media-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background-color: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}

.pk-media-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.pk-media-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color);
  line-height: 1.3;
}

.pk-media-kind {
  display: inline-block;
  align-self: flex-start;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-muted);
  background-color: var(--c-bgcolor);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  line-height: 1.4;
}

.pk-intro-callout {
  padding-top: 10px;
  font-size: 1.45rem;
  line-height: 1.75;
  color: var(--color-muted);
}

.pk-intro-callout p {
  margin: 0 0 6px 0;
}

.pk-intro-callout p:last-child {
  margin-bottom: 0;
}

/* Home: About & Hinokoto Studio */
.pk-about-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 16px;
  padding-top: 14px;
}

.pk-studio-card,
.pk-notes-card {
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}

.pk-studio-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  box-shadow: var(--shadow-sm);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color);
}

.pk-studio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent);
  flex-shrink: 0;
}

.pk-studio-desc {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.65;
  color: var(--color-muted);
}

.pk-about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.pk-about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  color: var(--link-color);
  font-size: 1.3rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.pk-about-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background-color: var(--accent-soft);
  text-decoration: none;
}

.pk-notes-heading {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color);
}

.pk-info-list {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pk-info-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--color-muted);
}

.pk-info-check {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Home: Language Pills */
.pk-lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
}

.pk-lang-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  color: var(--link-color);
  font-size: 1.3rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pk-lang-pill:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 991.98px) {
  .pk-about-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Catalog page (/samples/) */
.pk-catalog-page {
  padding: 20px 22px;
}

.pk-catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.pk-catalog-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--color);
}

.pk-catalog-subtitle {
  margin: 0;
  font-size: 1.4rem;
  color: var(--color-muted);
  line-height: 1.5;
}

.pk-catalog-switch {
  flex-shrink: 0;
  white-space: nowrap;
}

.pk-catalog-toolbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.pk-catalog-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pk-catalog-search {
  margin: 0;
  flex: 1 1 280px;
  max-width: 460px;
}

.pk-catalog-count {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}

.pk-sample-grid--catalog {
  grid-template-columns: repeat(5, 1fr);
}

.pk-sample-grid--catalog .indexsampleblock[hidden] {
  display: none;
}

.pk-sample-grid--catalog .indexsampleblock img {
  aspect-ratio: 1 / 1;
  width: 100%;
  height: auto;
  object-fit: cover;
}

.pk-tool-cat-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1.4;
}

@media (max-width: 1199.98px) {
  .pk-sample-grid--catalog {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 991.98px) {
  .pk-sample-grid--catalog {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 575.98px) {
  .pk-catalog-page {
    padding: 16px 12px;
  }
  .pk-sample-grid--catalog {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

/* Footer integrated tool discovery bar */
footer #tool {
  /* Match the content container's 12px padding plus the column's 10px. */
  padding-inline: 22px;
}

.maintool ~ footer #tool {
  /* The studio sits inside centercontents (12px), with its own responsive inset. */
  padding-inline: calc(12px + var(--pk-studio-inline-padding));
}

.pk-tools-footer-bar {
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}

.pk-tools-footer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pk-tools-footer-title {
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color);
}

.pk-tools-footer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pk-tools-footer-cta {
  padding: 6px 14px;
  font-size: 1.3rem;
}

.pk-tools-footer-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pk-tools-cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--b-bgcolor);
  border: 1px solid var(--b-bordercolor);
  color: var(--link-color);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pk-tools-cat-chip:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

/* Floating thumbnail preview on footer tool link hover */
.pk-tool-hover-preview {
  position: fixed;
  z-index: 1200;
  width: 156px;
  padding: 6px;
  border-radius: var(--radius-md);
  background-color: var(--bgcolor);
  border: 1px solid var(--b-bordercolor);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.pk-tool-hover-preview.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.pk-tool-hover-preview img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 2px);
}

.pk-tool-hover-preview span {
  display: block;
  margin-top: 5px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Photo-First Studio Header, Split Compare, Next Tools, Palette & Home Gallery
   ========================================================================== */

/* Studio Header Bar */
.pk-studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0;
  margin-block-end: 16px;
  flex-wrap: wrap;
}

.pk-studio-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.pk-studio-accent {
  width: 4px;
  height: 36px;
  border-radius: var(--radius-pill);
  flex-shrink: 0;
  margin-top: 2px;
  background: linear-gradient(
    180deg,
    var(--logo-color-1) 0%,
    var(--logo-color-2) 33%,
    var(--logo-color-3) 66%,
    var(--logo-color-4) 100%
  );
}

.pk-studio-title {
  margin: 0;
  padding: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--color);
}

.pk-studio-desc {
  margin: 3px 0 0;
  font-size: 1.3rem;
  color: var(--color-muted);
  line-height: 1.45;
}

.pk-studio-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--bordercolor);
  background-color: var(--bgcolor);
  color: var(--color);
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pk-studio-switch-btn:hover {
  border-color: var(--color-muted);
  background-color: var(--c-bgcolor);
}

.pk-kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--bordercolor);
  background-color: var(--c-bgcolor);
  color: var(--color-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}

@media screen and (max-width: 767.98px) {
  .pk-kbd-header {
    display: none;
  }
  .pk-studio-title {
    font-size: 1.75rem;
  }
}

/* Studio Split Compare Overlay */
.pk-studio-compare {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 24px);
  margin: 12px;
  user-select: none;
}

.pk-studio-compare[hidden] {
  display: none !important;
}

.pk-studio-compare-after {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 290px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.pk-studio-compare-before {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.pk-studio-compare-before-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  clip-path: inset(0 calc(100% - var(--ba-pos, 50%)) 0 0);
  pointer-events: none;
}

.pk-studio-compare .pk-ba-divider {
  left: var(--ba-pos, 50%);
}

/* Next Tools Continuous-Editing Strip */
.pk-next-tools-bar {
  display: flex;
  align-items: center;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--b-bordercolor);
}

.pk-next-tools-label {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-muted);
  white-space: nowrap;
}

.pk-next-tools-list {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pk-next-tool-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--b-bordercolor);
  background-color: var(--b-bgcolor);
  color: var(--link-color);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pk-next-tool-chip:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

/* Demoted Reset & Secondary Upload Actions */
.pk-upload-secondary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--b-bordercolor);
}

.pk-btn-sm {
  font-size: 1.25rem !important;
  padding: 5px 12px !important;
}

.pk-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-muted) !important;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
}

.pk-btn-ghost:hover {
  color: var(--danger) !important;
  background-color: var(--danger-soft);
  opacity: 1;
}

/* Command Palette Modal (⌘K) */
.pk-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: rgba(9, 9, 11, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 24px;
}

.pk-palette-backdrop[hidden] {
  display: none !important;
}

.pk-palette-dialog {
  width: 100%;
  max-width: 580px;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bgcolor);
  border: 1px solid var(--bordercolor);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.pk-palette-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--b-bordercolor);
  color: var(--color-muted);
}

.pk-palette-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--color);
  font-size: 1.55rem;
  font-weight: 500;
  outline: none !important;
}

.pk-palette-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--bordercolor);
  background-color: var(--c-bgcolor);
  color: var(--color-muted);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.pk-palette-hint {
  margin: 0;
  padding: 8px 16px;
  font-size: 1.2rem;
  color: var(--color-muted);
  background-color: var(--b-bgcolor);
  border-bottom: 1px solid var(--b-bordercolor);
}

.pk-palette-results {
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.pk-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.pk-palette-item:hover,
.pk-palette-item.is-selected {
  background-color: var(--accent-soft);
  border-color: var(--accent);
  color: var(--color);
  text-decoration: none;
}

.pk-palette-item img {
  width: 36px;
  height: 36px;
  border-radius: 5px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: var(--c-bgcolor);
}

.pk-palette-item span {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pk-palette-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--color-muted);
  font-size: 1.4rem;
}

/* Home Page Visual Sample Gallery */
.pk-home-gallery {
  padding: 18px 20px;
}

.pk-gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.pk-gallery-head .newboxtitle {
  margin: 0;
  padding: 0;
}

.pk-gallery-all-link {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--link-b-color) !important;
  text-decoration: none;
}

.pk-gallery-all-link:hover {
  text-decoration: underline;
}

.pk-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

@media screen and (max-width: 991.98px) {
  .pk-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.pk-gallery-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  border: 1px solid var(--b-bordercolor);
  background-color: var(--b-bgcolor);
  overflow: hidden;
  text-decoration: none !important;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.pk-gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--bordercolor);
  opacity: 1;
}

.pk-gallery-thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--studio-canvas-bg);
}

.pk-gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.pk-gallery-card:hover .pk-gallery-thumb img {
  transform: scale(1.04);
}

.pk-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
}

.pk-gallery-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color);
}

.pk-gallery-cat {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-muted);
  white-space: nowrap;
}

/* Keep the full directory collapsed until the visitor asks for it. */
.pk-tools-disclosure {
  margin-bottom: 24px;
  text-align: left;
}

.pk-tools-disclosure > summary {
  width: fit-content;
  margin: 0 auto;
  padding: 10px 16px;
  border: 1px solid var(--b-bordercolor);
  border-radius: var(--radius-sm);
  color: var(--link-color);
  cursor: pointer;
  font-weight: 600;
}

.pk-tools-disclosure > summary:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}

.pk-tools-disclosure > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.pk-tools-disclosure[open] > summary {
  margin-bottom: 18px;
}

/* Studio inspector: ads, image selection, then settings and apply. */
.pk-inspector-pane {
  display: flex;
  flex-direction: column;
}
.pk-inspector-pane > #formconfig {
  order: 4;
  width: 100%;
  min-width: 0;
  margin: 0;
  text-align: left;
}
.pk-inspector-pane > #selectb {
  order: 3;
}
.pk-inspector-pane > #select {
  order: 2;
}
.pk-inspector-pane > .colblockcontentsad {
  order: 1;
}

/* Crop / area selection hint pill */
.pk-crop-hint {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
  white-space: nowrap;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.pk-crop-hint[hidden] {
  display: none !important;
}

/* Next-tools header */
.pk-next-tools-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.pk-next-tools-head .pk-next-tools-label {
  margin-bottom: 0;
}
