@charset "UTF-8";

:root{
  --bg:#0d181c;
  --card:#17252a;
  --panel:#111e23;
  --panel-hover:#1b2b30;
  --text:#edf4f2;
  --muted:#adbbb8;
  --line:#2d3c40;
  --accent:#fa8705;
  --accent-hover:#ff9a24;
  --radius:22px;
}

*{box-sizing:border-box}
html,body{min-height:100%}
[hidden]{display:none!important}

body{
  margin:0;
  padding:0 16px 24px;
  color:var(--text);
  background:var(--bg);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:18px;
  line-height:1.5;
}

.wrap{max-width:1100px;margin:0 auto}

.site-header{padding:22px 70px 20px;text-align:center}
.brand{
  display:inline-block;
  color:var(--text);
  font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  font-size:48px;
  font-weight:800;
  line-height:1.05;
  letter-spacing:-.055em;
  text-decoration:none;
}
.brand-tool{color:var(--accent)}
.tagline{
  margin:10px 0 0;
  color:var(--muted);
  font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace;
  font-size:18px;
  text-align:center;
}

h1,h2,h3{color:var(--text)}
h1{margin:0;font-size:30px;line-height:1.2}
button,input{font:inherit}
button{color:var(--text)}

.card{
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--card);
  box-shadow:none;
}
.tool-card{
  border:7px solid transparent;
  background:
    linear-gradient(var(--card),var(--card)) padding-box,
    conic-gradient(from -90deg,#fa8705 0%,#034a9b 16.666%,#9b0803 33.333%,#969b03 50%,#039b54 66.666%,#54039b 83.333%,#fa8705 100%) border-box;
}

.tool-heading{padding:28px 28px 20px}
.tool-heading p{margin:14px 0 0;color:var(--muted)}

.mode-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  margin:0 28px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
}
.mode-tab{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-height:50px;
  padding:10px 16px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:var(--muted);
  font-weight:700;
  cursor:pointer;
}
.mode-tab:hover{background:var(--panel-hover);color:var(--text)}
.mode-tab.is-active{border-color:var(--accent);background:#2a302d;color:var(--text)}
.mode-tab svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.mode-panel{padding:24px 28px 28px}
.manual-entry{display:flex;align-items:flex-start;gap:14px}
.field-group{flex:1;min-width:0}
.field-group label{display:block;margin-bottom:7px;font-size:15px;font-weight:700}
input[type="text"]{
  width:100%;
  min-height:50px;
  padding:11px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  outline:none;
  background:var(--panel);
  color:var(--text);
}
input[type="text"]:focus{border-color:var(--accent);box-shadow:0 0 0 2px rgba(250,135,5,.16)}
.color-selector{position:relative;min-width:178px;min-height:44px;display:flex;align-items:center;gap:8px;margin-bottom:0;padding:3px 8px;border:1px solid var(--line);border-radius:10px;background:var(--panel);cursor:pointer}
.color-selector:hover{border-color:#52666b;background:var(--panel-hover)}
.color-selector:focus-within{border-color:var(--accent);box-shadow:0 0 0 2px rgba(250,135,5,.16)}
.color-selector input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}
.color-selector-preview{display:block;width:32px;height:32px;flex:0 0 32px;border:2px solid rgba(255,255,255,.7);border-radius:8px;background:#fa8705}
.color-selector-copy{display:flex;flex-direction:column;line-height:1.2}.color-selector-copy strong{font-size:13px}.color-selector-copy small{margin-top:3px;color:var(--muted);font-size:11px}
.manual-actions{display:flex;gap:10px;padding-top:29px}

button{
  min-height:44px;
  padding:9px 14px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#26353a;
  font-weight:700;
  cursor:pointer;
  transition:background .15s ease,border-color .15s ease,transform .05s ease;
}
button:hover{border-color:#43565b;background:#314247}
button:active{transform:translateY(1px)}
.primary-button{border-color:var(--accent);background:var(--accent);color:#fff}
.primary-button:hover{border-color:var(--accent-hover);background:var(--accent-hover)}
.small-button,.copy{min-height:36px;padding:6px 10px;font-size:13px}
.copy-button{white-space:nowrap}

.quick-examples{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:14px;color:var(--muted);font-size:14px}
.hint{margin-top:7px;color:var(--muted);font-size:13px}
.error{margin-top:12px;color:#ffd1d1;font-size:14px}
.v{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}

.upload-zone{
  border:1px dashed #52666b;
  border-radius:16px;
  background:var(--panel);
  transition:border-color .15s ease,background .15s ease;
}
.upload-zone:hover,.upload-zone.is-dragging{border-color:var(--accent);background:#19272b}
.upload-label{
  min-height:260px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:30px;
  color:var(--muted);
  text-align:center;
  cursor:pointer;
}
.upload-label strong{color:var(--text);font-size:20px}
.upload-icon{width:58px;height:58px;display:grid;place-items:center;margin-bottom:8px;border:1px solid var(--line);border-radius:16px;background:#26353a;color:var(--accent)}
.upload-icon svg{width:30px;height:30px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.upload-types{margin-top:5px;font-size:13px}

.image-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:14px}
.image-toolbar>div:first-child{display:flex;flex-direction:column;min-width:0}
.image-toolbar strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.image-toolbar span{color:var(--muted);font-size:14px}
.image-actions{display:flex;flex-shrink:0;gap:8px}
.canvas-wrap{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:14px;background:var(--panel);cursor:crosshair}
#imageCanvas{display:block;width:auto;height:auto;max-width:100%;max-height:650px;margin:0 auto}
.picker-crosshair{position:absolute;width:32px;height:32px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;filter:drop-shadow(0 0 2px #000)}
.picker-crosshair::before,.picker-crosshair::after{content:"";position:absolute;left:50%;top:50%;background:#fff;transform:translate(-50%,-50%)}
.picker-crosshair::before{width:42px;height:2px}.picker-crosshair::after{width:2px;height:42px}
.picker-readout{position:absolute;transform:translate(18px,18px);padding:5px 8px;border:1px solid rgba(255,255,255,.25);border-radius:8px;background:rgba(8,15,18,.88);color:#fff;font-size:13px;pointer-events:none}

.selected-section{
  display:grid;
  grid-template-columns:minmax(250px,1fr) minmax(280px,.85fr);
  gap:18px;
  padding:0 28px 28px;
}
.selected-swatch{min-height:150px;display:flex;flex-direction:column;justify-content:space-between;padding:18px;border:1px solid var(--line);border-radius:14px;background:#fa8705;color:#fff}
.selected-label{font-weight:700}.selected-value{font-size:25px;font-weight:800}
.selected-details{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
.selected-details>div{display:flex;flex-direction:column;gap:4px}.selected-details strong{font-size:22px}.selected-details p{grid-column:1/-1;margin:0;padding-top:12px;border-top:1px solid var(--line);color:var(--muted);font-size:14px}
.detail-label{color:var(--muted);font-size:12px;font-weight:700;letter-spacing:.08em}

.matches{padding:26px 28px 30px;border-top:1px solid var(--line)}
.section-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:16px}
.section-heading h2{margin:0;font-size:22px}.section-heading p{margin:5px 0 0;color:var(--muted);font-size:14px}.section-heading a{color:var(--text);font-size:14px;text-underline-offset:4px}
.section-links{display:flex;align-items:center;gap:14px;white-space:nowrap}
.palette-tone{display:flex;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--panel)}
.tone-button{min-height:30px;padding:4px 8px;border:0;border-radius:6px;background:transparent;color:var(--muted);font-size:11px;font-weight:700}
.tone-button:hover{border:0;background:var(--panel-hover);color:var(--text)}
.tone-button.is-active{background:var(--accent);color:#fff}
.matchgrid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.match{min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:11px;background:var(--panel)}
.match .bar{height:92px}
.match .info{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:11px}
.match .info>div{min-width:0}.tag{overflow:hidden;color:var(--muted);font-size:11px;line-height:1.3;white-space:nowrap;text-overflow:ellipsis}.match .v{font-size:12px}

footer{color:var(--muted);font-size:12px}
footer.whp-footer{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-top:20px;padding:22px 2px 6px;border-top:1px solid var(--line);font-size:14px}
footer.whp-footer a{color:var(--text);font-weight:500;text-decoration:none}footer.whp-footer a:hover{color:var(--accent-hover)}
.footer-links,.footer-credit{display:flex;align-items:center}.footer-links{gap:18px}.footer-credit{gap:14px;white-space:nowrap}
.footer-heart{display:inline-block;width:1.35em;height:1.35em;vertical-align:-.25em}.footer-heart svg{display:block;width:100%;height:100%;overflow:visible}.footer-heart path{fill:#e32636;stroke:#e32636;stroke-width:1.25;stroke-linejoin:round}
.footer-email{width:42px;height:42px;display:grid;place-items:center;border:1px solid var(--line);border-radius:10px;background:#26353a}.footer-email:hover{border-color:#43565b;background:#314247}.footer-email svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.legal-card{padding:30px}.legal-card h1{font-size:30px}.legal-card h2{margin:28px 0 8px;font-size:20px}.legal-card p,.legal-card li{color:var(--muted)}.legal-card p{margin:10px 0}.legal-card ul,.legal-card ol{margin:10px 0;padding-left:24px}.legal-card a{color:var(--text)}.legal-meta{font-size:14px}.legal-notice{margin-top:24px;padding:16px;border:1px solid var(--line);border-radius:10px;background:var(--panel)}
.step-list{display:grid;gap:12px;list-style:none!important;padding:0!important;counter-reset:steps}.step-list li{position:relative;padding:16px 16px 16px 58px;border:1px solid var(--line);border-radius:12px;background:var(--panel);counter-increment:steps}.step-list li::before{content:counter(steps);position:absolute;left:16px;top:16px;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;background:var(--accent);color:#fff;font-weight:800}

@media(max-width:900px){
  .matchgrid{grid-template-columns:repeat(3,minmax(0,1fr))}
  footer.whp-footer{align-items:flex-start;flex-direction:column}.footer-credit{align-self:stretch;justify-content:space-between}
}

@media(max-width:700px){
  body{padding-inline:14px}
  .site-header{padding:24px 0 20px}.brand{font-size:clamp(24px,7.5vw,42px)}.tagline{font-size:14px}
  .tool-heading{padding:22px 18px 18px}.tool-heading h1{font-size:25px}
  .mode-tabs{margin:0 18px}.mode-tab{font-size:14px}
  .mode-panel{padding:20px 18px 22px}.manual-entry{align-items:stretch;flex-direction:column}.manual-actions{padding:0}.manual-actions button{flex:1}
  .color-selector{min-width:178px}
  .image-toolbar{align-items:flex-start;flex-direction:column}.image-actions{width:100%}.image-actions button{flex:1}
  .selected-section{grid-template-columns:1fr;padding:0 18px 22px}.selected-swatch{min-height:125px}
  .matches{padding:22px 18px 24px}.section-heading{align-items:flex-start;flex-direction:column;gap:8px}.section-links{flex-wrap:wrap;white-space:normal}.matchgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .footer-links{align-items:flex-start;flex-direction:column;gap:10px}.legal-card{padding:22px 18px}
}

@media(max-width:420px){
  .mode-tab{gap:6px;padding-inline:8px}.mode-tab svg{width:18px;height:18px}
  .selected-details{grid-template-columns:1fr}.copy-button{width:100%}.selected-details p{grid-column:auto}
  .matchgrid{grid-template-columns:1fr 1fr}.match .info{align-items:flex-start;flex-direction:column}.match .copy{width:100%}
  .footer-credit{align-items:center;gap:10px;font-size:13px}
}
