:root {
  color-scheme: light;
  --bg: #f4f5f8; --surface: #fff; --text: #171a26; --muted: #555e70;
  --line: #e0e4ed; --blue: #2554dc; --blue-ink: #224bc6; --blue-soft: #e9efff;
  --hero-a: #eef3ff; --hero-b: #dfe8ff; --hero-line: #dce5fb;
  --green: #187257; --shadow: 0 10px 24px #1e33720a;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-xs: 4px; --space-sm: 8px; --space-md: 16px; --space-lg: 24px; --space-xl: 32px;
  --radius-control: 12px; --radius-card: 17px; --radius-panel: 22px; --radius-hero: 28px;
  --tap: 44px; --text-small: .875rem; --press: 120ms; --hover: 200ms; --panel: 280ms;
  --ease-out: cubic-bezier(.2,.65,.3,1); --lift: -2px; --pressed: .98;
  --action: #3158df; --action-hover: #2444bc; --action-ink: #fff;
  --glass: #fffffff0; --backdrop: #10173288; --depth-panel: 0 20px 80px #101a4a44;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11131a; --surface: #1a1e29; --text: #f3f5fd; --muted: #b0b9cd;
  --line: #303647; --blue: #9db6ff; --blue-ink: #aac0ff; --blue-soft: #263457;
  --hero-a: #1b2541; --hero-b: #263763; --hero-line: #35476f;
  --green: #80d9bb; --shadow: 0 10px 24px #0002;
  --glass: #1a1e29ed; --backdrop: #080b16b0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 var(--font); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
svg { display: block; width: 1.25em; height: 1.25em; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar, .foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.bar { min-height: 68px; }
.brand, .foot-brand { display: inline-flex; align-items: center; gap: 9px; font-size: 23px; font-weight: 770; letter-spacing: -.075em; }
.brand-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: white; background: #345de8; }
.brand-icon svg { width: 20px; height: 20px; }
.beta-badge { margin-left: 2px; padding: 2px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .68rem; font-weight: 650; letter-spacing: .02em; }
.top-nav, .settings { display: flex; align-items: center; gap: 23px; }
.top-nav { font-size: 14px; color: var(--muted); font-weight: 600; }
.top-nav a:hover { color: var(--blue-ink); }
.settings { gap: 8px; }
.language select, .icon-button { min-width: var(--tap); min-height: var(--tap); border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--text); background: var(--surface); }
.language select { padding: 0 6px; font-size: 12px; font-weight: 700; }
.icon-button { display: inline-grid; place-items: center; }
.icon-button:hover { background: var(--blue-soft); }
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: 1.3fr 1fr; align-items: center; min-height: 323px; margin-top: 32px; overflow: hidden; border: 1px solid var(--hero-line); border-radius: 28px; background: linear-gradient(116deg, var(--hero-a) 25%, var(--hero-b)); }
.hero-copy { padding: 35px 0 38px 48px; z-index: 1; }
.hero-label { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; color: var(--green); font-size: 13px; font-weight: 680; }
.local-dot { width: 8px; height: 8px; background: currentColor; border-radius: 50%; }
h1 { margin: 0; font-size: clamp(2.3125rem, 5.5vw, 4.3125rem); font-weight: 790; line-height: .99; letter-spacing: -.062em; overflow-wrap: anywhere; }
h1 em { color: var(--blue-ink); font-style: normal; }
.hero-description { margin: 19px 0 0; max-width: 38ch; color: var(--muted); font-size: 1rem; text-wrap: pretty; }
.hero-art { position: relative; width: 100%; height: 100%; min-height: 280px; }
.orbit, .art-tile, .art-star { position: absolute; }
.orbit { width: 84%; height: 63%; left: 5%; top: 17%; border: 1px solid #5277df32; border-radius: 50%; transform: rotate(-24deg); }
.orbit-two { transform: rotate(-24deg) scale(1.18); }
.art-tile { display: grid; place-items: center; border: 1px solid #ffffffb5; border-radius: 26%; box-shadow: 0 16px 34px #2c4fab29, inset 0 1px 0 #ffffffb3; }
.art-tile svg { width: 47%; height: 47%; stroke-width: 1.45; }
.art-file { width: 24%; aspect-ratio: 1; top: 20%; left: 9%; transform: rotate(-17deg); background: linear-gradient(145deg, #fff, #dce6ff); color: #4a64ce; }
.art-image { width: 36%; aspect-ratio: 1; top: 25%; left: 30%; transform: rotate(-10deg); background: linear-gradient(140deg, #fefeff, #d7e3ff); color: #3156dc; }
.art-type { width: 23%; aspect-ratio: 1; top: 54%; left: 60%; transform: rotate(14deg); background: linear-gradient(145deg, #617ef3, #314ed5); color: white; border-color: #869dff; }
.art-star { color: var(--blue); font-size: 22px; }
.star-one { left: 73%; top: 20%; }
.star-two { left: 17%; top: 67%; font-size: 15px; }
.discovery { display: grid; justify-items: start; gap: 16px; margin: 24px 0 28px; }
.search { width: 100%; min-height: 54px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); padding-inline: 15px; box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--blue); outline: 2px solid var(--blue); outline-offset: 2px; }
.search input { width: 100%; align-self: stretch; padding-block: 9px; border: 0; outline: none; background: none; color: var(--text); }
.search input::placeholder { color: var(--muted); opacity: 1; }
.categories { display: flex; flex-wrap: wrap; gap: 8px; }
.category { display: inline-flex; align-items: center; gap: 7px; min-height: 39px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 620; }
.category svg { width: 15px; height: 15px; }
.category:hover, .category[aria-pressed="true"] { background: var(--blue-soft); border-color: transparent; color: var(--blue-ink); }
.category[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--blue-ink); }
section[id] { scroll-margin-top: 16px; }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 15px; margin-bottom: 13px; }
h2 { margin: 0; font-size: clamp(1.4375rem, 3vw, 1.875rem); line-height: 1.16; letter-spacing: -.047em; overflow-wrap: anywhere; }
.section-meta { color: var(--muted); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.card { display: flex; align-items: flex-start; gap: 12px; min-width: 0; min-height: 118px; padding: var(--space-md); color: var(--text); text-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: var(--shadow); }
.card-icon { display: grid; place-items: center; flex: 0 0 41px; height: 41px; border-radius: 12px; background: var(--tile, var(--blue-soft)); color: var(--tile-ink, var(--blue-ink)); }
.card-icon svg { width: 22px; height: 22px; }
[data-tone="violet"] { --tile: #f1e9ff; --tile-ink: #6939b0; }
[data-tone="mint"] { --tile: #ddf5ed; --tile-ink: #147458; }
[data-tone="coral"] { --tile: #ffe9e4; --tile-ink: #a03b32; }
[data-tone="amber"] { --tile: #fff1d6; --tile-ink: #855712; }
:root[data-theme="dark"] [data-tone="violet"] { --tile: #35254e; --tile-ink: #d3b6ff; }
:root[data-theme="dark"] [data-tone="mint"] { --tile: #1d3933; --tile-ink: #99e6cf; }
:root[data-theme="dark"] [data-tone="coral"] { --tile: #482b2b; --tile-ink: #ffb7ac; }
:root[data-theme="dark"] [data-tone="amber"] { --tile: #40331e; --tile-ink: #ffda93; }
.card-copy { flex: 1; min-width: 0; }
.card-title { display: block; margin: 1px 0 3px; font-size: 1rem; font-weight: 730; line-height: 1.2; letter-spacing: -.024em; overflow-wrap: anywhere; }
.card-description { display: block; color: var(--muted); font-size: .8125rem; line-height: 1.42; overflow-wrap: anywhere; }
.card-arrow { color: var(--muted); padding-top: 2px; }
.card-arrow svg { width: 15px; height: 15px; }
.card-status { display: inline-block; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 660; }
#planned { margin-top: 31px; }
.empty { margin: 0; padding: 18px 0; color: var(--muted); }
footer { margin-top: 38px; border-top: 1px solid var(--line); }
.foot { min-height: 71px; color: var(--muted); font-size: 13px; }
.foot:has(.foot-links) { flex-wrap: wrap; padding-block: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.tool-guide a { overflow-wrap: anywhere; }
.foot-brand { font-size: 20px; color: var(--text); }
dialog { width: min(550px, calc(100% - 28px)); max-height: calc(100% - 28px); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); color: var(--text); padding: 25px; box-shadow: var(--depth-panel); overscroll-behavior: contain; }
dialog::backdrop { background: var(--backdrop); }
.close-tool { position: absolute; top: 14px; right: 14px; }
.tool-intro { margin: 8px 0 21px; color: var(--muted); }
dialog #tool-title { padding-right: 96px; }
.tool-fields { display: grid; gap: 13px; }
.field { display: grid; gap: 5px; font-size: var(--text-small); font-weight: 620; min-width: 0; }
.field :is(input, textarea, select) { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); }
.field input[type="range"] { padding: 0; accent-color: var(--blue); }
.crop-preview {
  display: block; max-width: 100%; height: auto; margin: 0 auto; border: 1px solid var(--line);
  background: repeating-conic-gradient(var(--bg) 0% 25%, var(--line) 0% 50%) 0 0 / 16px 16px;
}
.pdf-order { margin: 0; padding-left: 24px; }
.pdf-order li { padding: 3px 0; }
.pdf-order li > div { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; align-items: center; }
.pdf-order span { overflow-wrap: anywhere; }
.pdf-order button {
  width: 34px; min-height: 34px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); background: var(--bg);
}
.pdf-order button:disabled { opacity: .45; }
.field input[type="color"] { min-height: 44px; padding: 4px; }
.qr-preview { width: min(100%, 280px); height: auto; justify-self: center; image-rendering: pixelated; }
.swatches {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
  margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; list-style: none;
}
.swatches span { display: block; height: 65px; }
.gradient-preview { min-height: 120px; border-radius: 12px; border: 1px solid var(--line); }
.text-diff { max-height: 300px; overflow: auto; padding: 6px; border: 1px solid var(--line); border-radius: 9px; }
.text-diff > div { display: grid; grid-template-columns: 1.2em minmax(0, 1fr); padding: 2px 5px; white-space: pre-wrap; overflow-wrap: anywhere; font: .87em ui-monospace, monospace; }
.diff-add { color: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.diff-remove { color: var(--text); background: #e86d6d33; }
.field textarea { min-height: 115px; resize: vertical; }
.field-row, .metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { display: grid; padding: 8px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-ink); font-size: 13px; overflow-wrap: anywhere; }
.metric strong { font-size: 20px; }
.action { justify-self: start; display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 8px 15px; border: 0; border-radius: var(--radius-control); background: var(--action); color: var(--action-ink); font-weight: 680; }
.action:hover { background: var(--action-hover); }
.action:disabled { opacity: .62; cursor: wait; }
.feedback { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.feedback:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tool-output { margin: 0; font-weight: 680; color: var(--blue-ink); overflow-wrap: anywhere; }
.tool-output:empty { display: none; }
@media (max-width: 800px) {
  .wrap { width: calc(100% - 40px); }
  .hero-copy { padding-left: 26px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 28px); }
  .bar { min-height: 59px; }
  .top-nav { display: none; }
  .hero { display: block; min-height: 0; margin-top: 17px; border-radius: 20px; }
  .hero-copy { position: relative; padding: 24px 15px 81px; }
  h1 { font-size: clamp(2.125rem, 9vw, 2.875rem); }
  .hero-description { font-size: var(--text-small); margin-top: 12px; }
  .hero-art { position: absolute; bottom: -7px; right: 0; width: min(46%, 170px); height: 109px; min-height: 0; }
  .art-star { font-size: 14px; }
  .star-two { font-size: 10px; }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .card { min-height: 84px; padding: 13px; }
  .discovery { gap: 12px; margin: 16px 0 22px; }
  .category { padding-inline: 10px; min-height: var(--tap); }
  .foot { gap: 11px; }
}
.skip-link { position: absolute; z-index: 3; inset: var(--space-sm) auto auto var(--space-sm); padding: 10px 16px; border-radius: var(--radius-control); background: var(--surface); color: var(--blue-ink); }
.skip-link:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
#main { scroll-margin-top: var(--space-md); }
.collection { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
#recent-setting { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
#recent-setting input { width: 20px; height: 20px; }
.search-key { color: var(--muted); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .75rem; padding: 1px 6px; white-space: nowrap; }
.result-group { grid-column: 1 / -1; margin: var(--space-sm) 0 0; font-size: 1rem; }
.favorite-tool[aria-pressed="true"] { color: var(--blue-ink); background: var(--blue-soft); }
.favorite-tool[aria-pressed="true"] svg { fill: currentColor; }
dialog .favorite-tool { position: absolute; top: 14px; right: 66px; }
.file-field { position: relative; border: 1px dashed var(--muted); border-radius: var(--radius-control); padding: var(--space-sm) var(--space-md); }
.file-field input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; }
.file-field input[type="file"]:disabled { cursor: wait; }
.file-field.is-drop-target, .file-field:focus-within { border-color: var(--blue-ink); background: var(--blue-soft); }
.file-field:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 3px; }
.file-pick-row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); min-width: 0; }
.file-button { display: inline-flex; align-items: center; min-height: var(--tap); padding: 5px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-control); }
.file-selection { overflow-wrap: anywhere; color: var(--muted); font-weight: 400; }
.file-hint { color: var(--muted); font-weight: 400; }
.tool-page { max-width: 750px; margin: var(--space-xl) auto; }
.breadcrumb, .tool-guide a { color: var(--blue-ink); text-decoration: underline; text-underline-offset: .18em; }
.breadcrumb { display: inline-flex; align-items: center; min-height: var(--tap); }
.page-title-row { display: flex; justify-content: space-between; align-items: start; gap: var(--space-md); }
.tool-page h1 { font-size: clamp(1.9rem, 5vw, 3.25rem); line-height: 1.05; }
.tool-workspace, .tool-guide { border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); padding: clamp(16px, 4vw, 28px); }
#page-fields { min-block-size: var(--fields-desktop, 17rem); }
@media (max-width: 767px) { #page-fields { min-block-size: var(--fields-mobile, 17rem); } }
.tool-guide { margin-block-start: var(--space-md); overflow-wrap: anywhere; }
.tool-guide h2 { font-size: clamp(1.2rem, 3vw, 1.55rem); }
.tool-guide p { color: var(--muted); }
.tool-guide li + li { margin-top: var(--space-xs); }
.tool-guide summary { min-height: var(--tap); padding-block: 10px; cursor: pointer; }
.site-language { display: inline-flex; min-height: var(--tap); align-items: center; padding-inline: var(--space-sm); color: var(--blue-ink); }
@supports (backdrop-filter: blur(10px)) { .top { background: var(--glass); backdrop-filter: blur(10px); } }
@media (hover: hover) {
  :is(a,button).card:hover { border-color: var(--blue); }
  .file-field:hover { border-color: var(--blue-ink); }
}
@media (prefers-reduced-motion: no-preference) {
  :is(.card, .icon-button, .category, .action) { transition: transform var(--hover) var(--ease-out), color var(--hover), background-color var(--hover), border-color var(--hover); }
  :is(button, a.action):active:not(:disabled) { transform: scale(var(--pressed)); transition-duration: var(--press); }
  dialog[open] { animation: panel-in var(--panel) var(--ease-out) both; }
  dialog[open]::backdrop { animation: backdrop-in var(--hover) ease-out both; }
  @media (hover: hover) { :is(a,button).card:hover:not(:active) { transform: translateY(var(--lift)); } }
}
@keyframes panel-in { from { transform: translateY(6px) scale(.995); } }
@keyframes backdrop-in { from { opacity: 0; } }
@media (pointer: coarse) {
  .top { background: var(--surface); backdrop-filter: none; }
  .search-key, .file-hint { display: none; }
  .field :is(input:not([type="checkbox"]),select,textarea) { min-height: var(--tap); font-size: 1rem; }
  .field input[type="checkbox"] { min-width: 24px; min-height: 24px; }
  .pdf-order button { min-height: var(--tap); min-width: var(--tap); }
}
@media (max-width: 560px) {
  .wrap { width: auto; margin-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); }
  dialog { margin: auto 0 0; width: 100%; max-width: none; max-height: calc(100% - 12px); max-height: calc(100dvh - 12px); border-radius: var(--radius-panel) var(--radius-panel) 0 0; padding: 20px max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  dialog .tool-fields { min-width: 0; }
  .tool-page { margin-block: var(--space-md); }
}
