:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18263a;
  background: #edf2f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #18263a;
  --muted: #637389;
  --paper: #edf2f8;
  --card: #fbfdff;
  --line: #21354d;
  --accent: #f4bf64;
  --blue: #5e91c7;
  --blue-soft: #e5f1fa;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(circle at 90% 0, rgba(244, 191, 100, .38), transparent 28rem), radial-gradient(circle at 6% 28%, rgba(126, 197, 217, .24), transparent 30rem), linear-gradient(145deg, #f8fbff, #e7eef6); }
body::before { position: fixed; inset: 0; z-index: -1; pointer-events: none; content: ""; opacity: .22; background-image: linear-gradient(rgba(33, 53, 77, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(33, 53, 77, .05) 1px, transparent 1px); background-size: 30px 30px; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, a, select { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.tool-shell { width: min(1120px, calc(100% - 44px)); margin: 0 auto; padding: 22px 0 50px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; border-bottom: 2px solid var(--line); }
.brand { color: var(--ink); font-weight: 950; letter-spacing: .1em; text-decoration: none; }
.brand span { margin-left: 7px; padding: 5px 9px 4px; border: 2px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--accent); font-size: 10px; letter-spacing: .13em; }
.top-nav, footer nav { display: flex; align-items: center; gap: 16px; }
.top-nav a, footer a { color: var(--ink); font-size: 14px; font-weight: 850; text-decoration: none; }
.top-nav a:hover, footer a:hover { text-decoration: underline; text-underline-offset: 4px; }
.lang, .button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 16px; border: 2px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--card); box-shadow: 3px 3px 0 var(--line); font-weight: 900; text-decoration: none; transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease; }
.lang:hover, .button:not(:disabled):hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--line); background: var(--blue-soft); }
.button.primary { color: #fff; background: var(--line); }
.button.primary:hover { background: #2d587f; }
.button:active, .lang:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--line); }
button:disabled { opacity: .5; cursor: default; }
:where(button, a, input, select):focus-visible { outline: 3px solid #bd7b2c; outline-offset: 3px; }

.intro { max-width: 850px; padding: 72px 0 38px; }
.eyebrow { margin: 0 0 18px; color: #3f729f; font-size: 11px; font-weight: 950; letter-spacing: .16em; text-transform: uppercase; }
.intro h1 { max-width: 840px; margin: 0 0 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 8vw, 88px); letter-spacing: -.065em; line-height: .92; text-wrap: balance; }
.intro p:last-child { max-width: 720px; margin: 0; color: var(--muted); font-size: clamp(16px, 1.7vw, 19px); line-height: 1.65; }
.panel { padding: 20px; border: 2px solid rgba(33, 53, 77, .28); border-radius: 26px; background: rgba(251, 253, 255, .8); box-shadow: 10px 12px 0 rgba(33, 53, 77, .12); }
.drop { display: flex; min-height: 178px; align-items: center; justify-content: center; gap: 8px; border: 2px dashed #89accb; border-radius: 19px; color: #3f729f; background: rgba(229, 241, 250, .72); text-align: center; cursor: pointer; flex-direction: column; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
.drop:hover, .drop.is-dragging { border-color: var(--line); background: #dcedf8; box-shadow: inset 0 0 0 1px var(--line); }
.drop input { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.drop:focus-within { outline: 3px solid #bd7b2c; outline-offset: 3px; }
.drop-icon { display: grid; width: 52px; height: 52px; place-items: center; border: 2px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--accent); font-size: 34px; line-height: 1; }
.drop strong { color: var(--ink); }
.drop small { color: var(--muted); }
.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 18px 0 12px; }
.settings label { display: grid; min-width: 0; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 850; }
.settings select, .settings input[type="range"] { width: 100%; min-height: 44px; }
.settings select { padding: 9px 12px; border: 2px solid #b8c9d9; border-radius: 12px; color: var(--ink); background: var(--card); }
.settings input[type="range"] { accent-color: #3f729f; }
.settings label:nth-child(2) { grid-template-columns: 1fr auto; align-items: center; }
.settings label:nth-child(2) > span { grid-column: 1 / -1; }
.settings output { color: var(--ink); font-size: 12px; font-weight: 900; }
.color-control { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px; border: 2px solid #b8c9d9; border-radius: 12px; background: var(--card); }
.color-control input { width: 34px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.note { margin: 0 0 15px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.status { min-height: 28px; margin-left: auto; color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.status[data-state="error"] { color: #a3433d; }
.status[data-state="loading"] { color: #3f729f; }
.results { display: grid; gap: 14px; margin-top: 18px; }
.result-card { padding: 14px; border: 1px solid #cddae5; border-radius: 18px; background: var(--card); }
.preview-pair { display: grid; grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); align-items: center; gap: 10px; }
.preview-pair figure { min-width: 0; margin: 0; }
.preview-pair img { display: block; width: 100%; height: 180px; object-fit: contain; border: 1px solid #d2dfe9; border-radius: 12px; background: repeating-conic-gradient(#edf2f7 0 25%, #fff 0 50%) 50% / 20px 20px; }
.preview-pair figcaption { padding: 8px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.preview-pair figcaption strong { color: var(--ink); }
.preview-arrow { color: #bd7b2c; font-size: 24px; text-align: center; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #e0e8ef; }
.result-meta div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--ink); }
.result-meta span { color: #3f729f; font-size: 13px; font-weight: 800; }
.copy { padding: 54px 0 28px; }
.copy h2 { margin: 0 0 12px; font-family: Georgia, "Times New Roman", serif; font-size: 32px; letter-spacing: -.04em; }
.copy p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.65; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-top: 20px; border-top: 2px solid var(--line); color: var(--muted); font-size: 13px; }

@media (max-width: 760px) { .settings { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tool-shell { width: min(100% - 24px, 440px); padding-top: 14px; } .topbar { align-items: flex-start; } .top-nav a { display: none; } .intro { padding: 52px 0 32px; } .intro h1 { font-size: clamp(46px, 14vw, 68px); } .panel { padding: 14px; border-radius: 21px; } .settings { grid-template-columns: 1fr; } .status { flex-basis: 100%; margin-left: 0; } .preview-pair img { height: 125px; } .preview-arrow { font-size: 18px; } .result-meta { align-items: flex-start; flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; transition-duration: .01ms !important; } }
